UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

31 lines (28 loc) 1.99 kB
/** * Stackby Node - Version 1 - Zod Validation Schemas * * These schemas validate node configuration at runtime. * Use .parse() for strict validation or .safeParse() for error handling. * * Schema helpers (z, expressionSchema, etc.) are passed as parameters * by the schema-validator, not imported from external files. * * @generated - CommonJS JavaScript for runtime loading */ module.exports = function getSchema({ parameters, z, expressionSchema, stringOrExpression, numberOrExpression, booleanOrExpression, resourceLocatorValueSchema, resourceMapperValueSchema, filterValueSchema, assignmentCollectionValueSchema, iDataObjectSchema, resolveSchema }) { // Parameters schema const parametersSchema = z.object({ operation: z.union([z.literal('append'), z.literal('delete'), z.literal('list'), z.literal('read')]).optional(), stackId: stringOrExpression.optional(), table: stringOrExpression.optional(), id: resolveSchema({ parameters, schema: stringOrExpression, required: false, displayOptions: {"show":{"operation":["read","delete"]}}, defaults: {"operation":"append"} }), returnAll: resolveSchema({ parameters, schema: booleanOrExpression, required: false, displayOptions: {"show":{"operation":["list"]}}, defaults: {"operation":"append"} }), limit: resolveSchema({ parameters, schema: numberOrExpression, required: false, displayOptions: {"show":{"operation":["list"],"returnAll":[false]}}, defaults: {"operation":"append","returnAll":true} }), additionalFields: resolveSchema({ parameters, schema: z.object({ view: stringOrExpression.optional() }), required: false, displayOptions: {"show":{"operation":["list"]}}, defaults: {"operation":"append"} }), columns: resolveSchema({ parameters, schema: stringOrExpression, required: false, displayOptions: {"show":{"operation":["append"]}}, defaults: {"operation":"append"} }), }); // Return combined config schema return z.object({ parameters: parametersSchema.optional(), }); };