UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

24 lines (22 loc) 1.02 kB
/** * One Simple API - Utility Resource - Zod Schema Factory * Exports a factory that unions all operation schemas for this resource. * * Schema helpers (z, expressionSchema, etc.) are passed as parameters * by the schema-validator, not imported from external files. * * @generated - CommonJS JavaScript for runtime loading */ const getExpandURLSchema = require('./operation_expand_u_r_l.schema'); const getQrCodeSchema = require('./operation_qr_code.schema'); const getValidateEmailSchema = require('./operation_validate_email.schema'); module.exports = function getSchema(helpers) { const { parameters, z } = helpers; // Apply operation default if not set const effectiveParams = parameters.operation === undefined ? { ...parameters, operation: 'pdf' } : parameters; return z.union([ getExpandURLSchema({ ...helpers, parameters: effectiveParams }), getQrCodeSchema({ ...helpers, parameters: effectiveParams }), getValidateEmailSchema({ ...helpers, parameters: effectiveParams }), ]); };