UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

30 lines (28 loc) 1.39 kB
/** * Todoist Node - Version 2.1 - Zod Schema Factory * Exports a factory that unions all discriminator schemas. * * 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 getTaskSchema = require('./resource_task/index.schema'); const getProjectSchema = require('./resource_project/index.schema'); const getSectionSchema = require('./resource_section/index.schema'); const getCommentSchema = require('./resource_comment/index.schema'); const getLabelSchema = require('./resource_label/index.schema'); const getReminderSchema = require('./resource_reminder/index.schema'); module.exports = function getSchema(helpers) { const { parameters, z } = helpers; // Apply discriminator default if not set const effectiveParams = parameters.resource === undefined ? { ...parameters, resource: 'task' } : parameters; return z.union([ getTaskSchema({ ...helpers, parameters: effectiveParams }), getProjectSchema({ ...helpers, parameters: effectiveParams }), getSectionSchema({ ...helpers, parameters: effectiveParams }), getCommentSchema({ ...helpers, parameters: effectiveParams }), getLabelSchema({ ...helpers, parameters: effectiveParams }), getReminderSchema({ ...helpers, parameters: effectiveParams }), ]); };