@@ -5,13 +5,16 @@ import {
55 DefinitionDataType ,
66 DefinitionDataTypeRule , FlowType ,
77 FlowTypeSetting_UniquenessScope , FunctionDefinition ,
8- RuntimeFunctionDefinition ,
9- Translation
8+ RuntimeFunctionDefinition
109} from "@code0-tech/tucana/shared" ;
1110import { PlainValue } from "@code0-tech/tucana/helpers" ;
1211import { ActionTransferServiceClient , TransferRequest , TransferResponse } from "@code0-tech/tucana/aquila" ;
1312import 'reflect-metadata' ;
1413
14+ export interface HerculesTranslation {
15+ code : "en-US" | "de-DE" | string ,
16+ content : string
17+ }
1518
1619export interface HerculesFunctionContext {
1720 projectId : number | bigint ,
@@ -21,9 +24,9 @@ export interface HerculesFunctionContext {
2124
2225export interface HerculesDataType {
2326 identifier : string ,
24- name ?: Translation [ ] ,
25- displayMessage ?: Translation [ ] ,
26- alias ?: Translation [ ] ,
27+ name ?: HerculesTranslation [ ] ,
28+ displayMessage ?: HerculesTranslation [ ] ,
29+ alias ?: HerculesTranslation [ ] ,
2730 rules ?: DefinitionDataTypeRule [ ] ,
2831 genericKeys ?: string [ ] ,
2932 type : string ,
@@ -37,8 +40,8 @@ export interface HerculesFlowTypeSetting {
3740 unique ?: FlowTypeSetting_UniquenessScope ,
3841 linkedDataTypeIdentifiers ?: string [ ] ,
3942 defaultValue ?: PlainValue ,
40- name ?: Translation [ ] ,
41- description ?: Translation [ ] ,
43+ name ?: HerculesTranslation [ ] ,
44+ description ?: HerculesTranslation [ ] ,
4245}
4346
4447export interface HerculesFlowType {
@@ -47,21 +50,21 @@ export interface HerculesFlowType {
4750 signature : string ,
4851 linkedDataTypes ?: string [ ] ,
4952 editable : boolean ,
50- name ?: Translation [ ] ,
51- description ?: Translation [ ] ,
52- documentation ?: Translation [ ] ,
53- displayMessage ?: Translation [ ] ,
54- alias ?: Translation [ ] ,
53+ name ?: HerculesTranslation [ ] ,
54+ description ?: HerculesTranslation [ ] ,
55+ documentation ?: HerculesTranslation [ ] ,
56+ displayMessage ?: HerculesTranslation [ ] ,
57+ alias ?: HerculesTranslation [ ] ,
5558 version ?: string ,
5659 displayIcon ?: string ,
5760}
5861
5962export interface HerculesRuntimeFunctionDefinitionParameter {
6063 runtimeName : string ,
6164 defaultValue ?: PlainValue ,
62- name ?: Translation [ ] ,
63- description ?: Translation [ ] ,
64- documentation ?: Translation [ ] ,
65+ name ?: HerculesTranslation [ ] ,
66+ description ?: HerculesTranslation [ ] ,
67+ documentation ?: HerculesTranslation [ ] ,
6568 hidden ?: boolean ,
6669 optional ?: boolean
6770}
@@ -71,12 +74,12 @@ export interface HerculesRuntimeFunctionDefinition {
7174 parameters ?: HerculesRuntimeFunctionDefinitionParameter [ ] ,
7275 signature : string ,
7376 throwsError ?: boolean ,
74- name ?: Translation [ ] ,
75- description ?: Translation [ ] ,
76- documentation ?: Translation [ ] ,
77- deprecationMessage ?: Translation [ ] ,
78- displayMessage ?: Translation [ ] ,
79- alias ?: Translation [ ] ,
77+ name ?: HerculesTranslation [ ] ,
78+ description ?: HerculesTranslation [ ] ,
79+ documentation ?: HerculesTranslation [ ] ,
80+ deprecationMessage ?: HerculesTranslation [ ] ,
81+ displayMessage ?: HerculesTranslation [ ] ,
82+ alias ?: HerculesTranslation [ ] ,
8083 linkedDataTypes ?: string [ ] ,
8184 version ?: string ,
8285 displayIcon ?: string ,
@@ -85,9 +88,9 @@ export interface HerculesRuntimeFunctionDefinition {
8588export interface HerculesFunctionDefinitionParameter {
8689 runtimeName : string ,
8790 defaultValue ?: PlainValue ,
88- name ?: Translation [ ] ,
89- description ?: Translation [ ] ,
90- documentation ?: Translation [ ] ,
91+ name ?: HerculesTranslation [ ] ,
92+ description ?: HerculesTranslation [ ] ,
93+ documentation ?: HerculesTranslation [ ] ,
9194 hidden ?: boolean ,
9295 optional ?: boolean ,
9396 runtimeDefinitionName ?: string
@@ -99,12 +102,12 @@ export interface HerculesFunctionDefinition {
99102 parameters ?: HerculesFunctionDefinitionParameter [ ] ,
100103 signature : string ,
101104 throwsError ?: boolean ,
102- name ?: Translation [ ] ,
103- description ?: Translation [ ] ,
104- documentation ?: Translation [ ] ,
105- deprecationMessage ?: Translation [ ] ,
106- displayMessage ?: Translation [ ] ,
107- alias ?: Translation [ ] ,
105+ name ?: HerculesTranslation [ ] ,
106+ description ?: HerculesTranslation [ ] ,
107+ documentation ?: HerculesTranslation [ ] ,
108+ deprecationMessage ?: HerculesTranslation [ ] ,
109+ displayMessage ?: HerculesTranslation [ ] ,
110+ alias ?: HerculesTranslation [ ] ,
108111 linkedDataTypes ?: string [ ] ,
109112 version ?: string ,
110113 displayIcon ?: string ,
@@ -120,8 +123,8 @@ export interface HerculesActionProjectConfiguration {
120123}
121124
122125export interface HerculesActionConfigurationDefinition {
123- name ?: Translation [ ] ,
124- description ?: Translation [ ] ,
126+ name ?: HerculesTranslation [ ] ,
127+ description ?: HerculesTranslation [ ] ,
125128 type : string ,
126129 linkedDataTypes ?: string [ ] ,
127130 defaultValue ?: PlainValue ,
@@ -199,18 +202,18 @@ export const FunctionParameter = (parameter: HerculesFunctionDefinitionParameter
199202 Reflect . defineMetadata ( 'hercules:function_parameters' , parameters , target )
200203 }
201204
202- export const Name = ( ...translation : Translation [ ] ) : ClassDecorator =>
205+ export const Name = ( ...translation : HerculesTranslation [ ] ) : ClassDecorator =>
203206 ( target ) => Reflect . defineMetadata ( 'hercules:name' , translation , target )
204207
205- export const DisplayMessage = ( ...translation : Translation [ ] ) : ClassDecorator =>
208+ export const DisplayMessage = ( ...translation : HerculesTranslation [ ] ) : ClassDecorator =>
206209 ( target ) => Reflect . defineMetadata ( 'hercules:display_message' , translation , target )
207- export const Description = ( ...translation : Translation [ ] ) : ClassDecorator =>
210+ export const Description = ( ...translation : HerculesTranslation [ ] ) : ClassDecorator =>
208211 ( target ) => Reflect . defineMetadata ( 'hercules:description' , translation , target )
209- export const DeprecationMessage = ( ...translation : Translation [ ] ) : ClassDecorator =>
212+ export const DeprecationMessage = ( ...translation : HerculesTranslation [ ] ) : ClassDecorator =>
210213 ( target ) => Reflect . defineMetadata ( 'hercules:deprecation_message' , translation , target )
211- export const Alias = ( ...translation : Translation [ ] ) : ClassDecorator =>
214+ export const Alias = ( ...translation : HerculesTranslation [ ] ) : ClassDecorator =>
212215 ( target ) => Reflect . defineMetadata ( 'hercules:alias' , translation , target )
213- export const Documentation = ( ...translation : Translation [ ] ) : ClassDecorator =>
216+ export const Documentation = ( ...translation : HerculesTranslation [ ] ) : ClassDecorator =>
214217 ( target ) => Reflect . defineMetadata ( 'hercules:documentation' , translation , target )
215218
216219export const Signature = ( signature : string ) : ClassDecorator =>
0 commit comments