Post merge cleanup

This commit is contained in:
Charlie Kolb 2024-11-27 14:54:03 +01:00
parent f716a607a5
commit a5fd679df8
No known key found for this signature in database

View file

@ -14,6 +14,9 @@ const FIELDS = 'fields';
const WORKFLOW_INPUTS = 'workflowInputs'; const WORKFLOW_INPUTS = 'workflowInputs';
const INPUT_OPTIONS = 'inputOptions'; const INPUT_OPTIONS = 'inputOptions';
const VALUES = 'values'; const VALUES = 'values';
const DEFAULT_PLACEHOLDER = null;
type ValueOptions = { name: string; type: FieldType };
function hasFields(context: IExecuteFunctions, index: number): boolean { function hasFields(context: IExecuteFunctions, index: number): boolean {
const inputSource = context.getNodeParameter(INPUT_SOURCE, index) as string; const inputSource = context.getNodeParameter(INPUT_SOURCE, index) as string;
@ -27,23 +30,11 @@ function hasFields(context: IExecuteFunctions, index: number): boolean {
} }
} }
function parseJson( function parseJson(context: IExecuteFunctions, index: number): ValueOptions[] {
context: IExecuteFunctions, return [{ name: 'Placeholder', type: 'number' }];
index: number,
): Array<{
name: string;
type: FieldType;
}> {
return [{ name: 'dummy', type: 'number' }];
} }
function getSchema( function getSchema(context: IExecuteFunctions, index: number): ValueOptions[] {
context: IExecuteFunctions,
index: number,
): Array<{
name: string;
type: FieldType;
}> {
const inputSource = context.getNodeParameter(INPUT_SOURCE, index) as string; const inputSource = context.getNodeParameter(INPUT_SOURCE, index) as string;
if (inputSource === FIELDS) { if (inputSource === FIELDS) {
const fields = context.getNodeParameter(`${WORKFLOW_INPUTS}.${VALUES}`, index, []) as Array<{ const fields = context.getNodeParameter(`${WORKFLOW_INPUTS}.${VALUES}`, index, []) as Array<{
@ -55,9 +46,6 @@ function getSchema(
return parseJson(context, index); return parseJson(context, index);
} }
} }
type ValueOptions = { name: string; value: FieldType };
const DEFAULT_PLACEHOLDER = null;
export class ExecuteWorkflowTrigger implements INodeType { export class ExecuteWorkflowTrigger implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
@ -183,7 +171,7 @@ If you don't provide fields, all data passed into the 'Execute Workflow' node wi
value: 'object', value: 'object',
}, },
// Intentional omission of `dateTime`, `time`, `string-alphanumeric`, `form-fields`, `jwt` and `url` // Intentional omission of `dateTime`, `time`, `string-alphanumeric`, `form-fields`, `jwt` and `url`
] as ValueOptions[], ] as Array<{ name: string; value: FieldType }>,
default: 'string', default: 'string',
noDataExpression: true, noDataExpression: true,
}, },