101 featch available variables from previous steps (#8062)
- add outputSchema in workflow step settings - use outputSchemas to compute step available variables https://github.com/user-attachments/assets/6b851d8e-625c-49ff-b29c-074cd86cbfee
This commit is contained in:
@ -12,6 +12,7 @@ import {
|
||||
CodeIntrospectionException,
|
||||
CodeIntrospectionExceptionCode,
|
||||
} from 'src/modules/code-introspection/code-introspection.exception';
|
||||
import { generateFakeValue } from 'src/engine/utils/generate-fake-value';
|
||||
|
||||
type FunctionParameter = {
|
||||
name: string;
|
||||
@ -89,4 +90,24 @@ export class CodeIntrospectionService {
|
||||
type: parameter.getType().getText(),
|
||||
};
|
||||
}
|
||||
|
||||
public generateInputData(fileContent: string, fileName = 'temp.ts') {
|
||||
const parameters = this.analyze(fileContent, fileName);
|
||||
|
||||
return this.generateFakeDataFromParams(parameters);
|
||||
}
|
||||
|
||||
private generateFakeDataFromParams(
|
||||
params: FunctionParameter[],
|
||||
): Record<string, any> {
|
||||
const data: Record<string, any> = {};
|
||||
|
||||
params.forEach((param) => {
|
||||
const type = param.type;
|
||||
|
||||
data[param.name] = generateFakeValue(type);
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user