8311 serverless function functions can be executed with any input (#8380)
- remove ts-morph - update inputSchema shape  https://github.com/user-attachments/assets/913cd305-9e7c-48da-b20f-c974a8ac7cea ## TODO - have inputTypes to match the inputSchema type (string, number, boolean, etc...), only string for now - handle required/optional inputs - handle case when inputSchema changes, fix data reset when switching function
This commit is contained in:
@ -173,18 +173,16 @@ export class WorkflowBuilderWorkspaceService {
|
||||
return {};
|
||||
}
|
||||
|
||||
const inputSchema =
|
||||
codeIntrospectionService.getFunctionInputSchema(sourceCode);
|
||||
const fakeFunctionInput =
|
||||
codeIntrospectionService.generateInputData(sourceCode);
|
||||
|
||||
// handle the case when event parameter is destructured:
|
||||
// (event: {param1: string; param2: number}) VS ({param1, param2}: {param1: string; param2: number})
|
||||
const formattedInput = Object.values(fakeFunctionInput)[0];
|
||||
codeIntrospectionService.generateInputData(inputSchema);
|
||||
|
||||
const resultFromFakeInput =
|
||||
await serverlessFunctionService.executeOneServerlessFunction(
|
||||
serverlessFunctionId,
|
||||
workspaceId,
|
||||
formattedInput,
|
||||
fakeFunctionInput,
|
||||
serverlessFunctionVersion,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user