Skip to content

Commit 943cab9

Browse files
committed
feat: changes to renamings
1 parent 97274b5 commit 943cab9

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

ts/examples/simple-example-ts/src/functions/fibonacciRuntimeFunction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import {
33
FunctionContext, Parameter,
44
Identifier,
55
Name,
6-
OmitFunction,
6+
OmitRuntimeFunction,
77
Signature,
88
} from "@code0-tech/hercules";
99

1010
@Identifier("fibonacci_runtime")
1111
@Signature("(test: number): number")
1212
@Name({code: "en-US", content: "Fibonacci (Runtime)"})
1313
@DisplayMessage({code: "en-US", content: "Computes the n-th Fibonacci number"})
14-
@OmitFunction()
14+
@OmitRuntimeFunction()
1515
@Parameter({runtimeName: "test", name: [{code: "en-US", content: "N"}]})
1616
export class FibonacciRuntimeFunction {
1717
run(context: FunctionContext, test: number): number {

ts/examples/simple-example-ts/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const action = new Action(
2020
}],
2121
);
2222

23-
// Runtime function (with OmitFunctionDefinition — no auto-generated function def)
23+
// Runtime function (with OmitRuntimeFunction — no auto-generated function def)
2424
action.registerRuntimeFunction(FibonacciRuntimeFunction);
2525

2626
// Function: named public variant that extends the runtime function

ts/scripts/build-definitions.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function buildSettingDecorators(settings: any[]): string[] {
146146
...(s.optional ? [`optional: true,`] : []),
147147
...(s.hidden ? [`hidden: true,`] : []),
148148
];
149-
return [`@RuntimeEventSetting({`, ...props.map(p => ` ${p}`), `})`];
149+
return [`@EventSetting({`, ...props.map(p => ` ${p}`), `})`];
150150
});
151151
}
152152

@@ -159,26 +159,23 @@ function buildParameterDecorators(params: any[]): string[] {
159159
...(p.optional ? [`optional: true,`] : []),
160160
...(p.hidden ? [`hidden: true,`] : []),
161161
];
162-
return [`@RuntimeParameter({`, ...props.map(p => ` ${p}`), `})`];
162+
return [`@Parameter({`, ...props.map(p => ` ${p}`), `})`];
163163
});
164164
}
165165

166166
function generateRuntimeFlowType(json: Record<string, unknown>, className: string, relModule: string): string {
167167
const src = (seg: string) => srcRelativePath(relModule, seg);
168-
const linkedIds = json.linkedDataTypeIdentifiers as string[] | undefined;
169168
const settings = json.runtimeSettings as any[] | undefined;
170169
const metaDecorators = collectMetaDecorators(json);
171170

172171
const imports = [
173172
`import {RuntimeEventRunnable} from "${src("models/runtime_event.model")}";`,
174-
`import {${metaDecorators.join(", ")}} from "${src("decorators/meta")}";`,
175-
...(linkedIds?.length ? [`import {LinkedDataTypeIdentifiers} from "${src("decorators/function")}";`] : []),
176-
...(settings?.length ? [`import {RuntimeEventSetting} from "${src("decorators/runtime-event")}";`] : []),
173+
`import {${metaDecorators.join(", ")}} from "${src("decorators/meta.dec")}";`,
174+
...(settings?.length ? [`import {EventSetting} from "${src("decorators/event.dec")}";`] : []),
177175
];
178176

179177
const decorators = [
180178
...buildMetaDecorators(json, "identifier"),
181-
...(linkedIds?.length ? [`@LinkedDataTypeIdentifiers(${linkedIds.map(s => JSON.stringify(s)).join(", ")})`] : []),
182179
...buildSettingDecorators(settings ?? []),
183180
];
184181

@@ -193,28 +190,25 @@ function generateRuntimeFlowType(json: Record<string, unknown>, className: strin
193190

194191
function generateRuntimeFunction(json: Record<string, unknown>, className: string, relModule: string): string {
195192
const src = (seg: string) => srcRelativePath(relModule, seg);
196-
const linkedIds = json.linkedDataTypeIdentifiers as string[] | undefined;
197193
const params = json.runtimeParameterDefinitions as any[] | undefined;
198194
const metaDecorators = collectMetaDecorators(json);
199195
const funcDecorators = [
200-
"OmitFunctionDefinition",
201196
...(json.throwsError ? ["ThrowsError"] : []),
202-
...(params?.length ? ["RuntimeParameter"] : []),
203-
...(linkedIds?.length ? ["LinkedDataTypeIdentifiers"] : []),
197+
...(params?.length ? ["Parameter"] : []),
204198
];
205199

206200
const imports = [
207201
`import {RuntimeFunctionRunnable} from "${src("models/runtime_function.model")}";`,
208-
`import {${metaDecorators.join(", ")}} from "${src("decorators/meta")}";`,
209-
`import {${funcDecorators.join(", ")}} from "${src("decorators/function")}";`,
202+
`import {${metaDecorators.join(", ")}} from "${src("decorators/meta.dec")}";`,
203+
`import {OmitRuntimeFunction} from "${src("decorators/runtime_function.dec")}";`,
204+
...(funcDecorators.length ? [`import {${funcDecorators.join(", ")}} from "${src("decorators/function.dec")}";`] : []),
210205
`import type {PlainValue} from "@code0-tech/tucana/helpers";`,
211206
];
212207

213208
const decorators = [
214-
`@OmitFunctionDefinition()`,
209+
`@OmitRuntimeFunction()`,
215210
...buildMetaDecorators(json, "runtimeName"),
216211
...(json.throwsError ? [`@ThrowsError()`] : []),
217-
...(linkedIds?.length ? [`@LinkedDataTypeIdentifiers(${linkedIds.map(s => JSON.stringify(s)).join(", ")})`] : []),
218212
...buildParameterDecorators(params ?? []),
219213
];
220214

0 commit comments

Comments
 (0)