Skip to content

Commit a495b58

Browse files
committed
Remove handler because function definitions dont have handlers
1 parent 15373d2 commit a495b58

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

ts/src/action_sdk.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ const createSdk = (config: ActionSdk["config"], configDefinitions?: HerculesActi
175175
},
176176
registerFunctionDefinitions: async (...functionDefinitions) => {
177177
for (const registeredFunction of functionDefinitions) {
178-
const handler = registeredFunction.handler;
179178
const runtimeFunctionDefinition = registeredFunction.definition;
180179
state.functions.push({
181180
identifier: runtimeFunctionDefinition.runtimeName,
@@ -200,8 +199,7 @@ const createSdk = (config: ActionSdk["config"], configDefinitions?: HerculesActi
200199
})),
201200
signature: runtimeFunctionDefinition.signature,
202201
throwsError: runtimeFunctionDefinition.throwsError || false,
203-
},
204-
handler: handler,
202+
}
205203
});
206204
}
207205
return Promise.resolve()

ts/src/types.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ export type HerculesRegisterRuntimeFunctionParameter = {
105105
}
106106

107107
export type HerculesRegisterFunctionParameter = {
108-
definition: HerculesRegisterFunctionDefinition,
109-
handler: (...args: any[]) => Promise<PlainValue> | PlainValue,
108+
definition: HerculesRegisterFunctionDefinition
110109
}
111110

112111
export interface ActionSdk {
@@ -144,8 +143,7 @@ export class RuntimeErrorException extends Error {
144143

145144
export interface RegisteredFunction {
146145
identifier: string,
147-
definition: FunctionDefinition,
148-
handler: (...args: any[]) => Promise<PlainValue> | PlainValue,
146+
definition: FunctionDefinition
149147
}
150148

151149
export interface RegisteredRuntimeFunction {

0 commit comments

Comments
 (0)