UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

26 lines (24 loc) 1.74 kB
/** * Intercom Node - Version 1 - Zod Schema * Discriminator: resource=company, operation=create * * 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 }) { return z.object({ parameters: z.object({ resource: z.literal('company'), operation: z.literal('create').default('create'), companyId: stringOrExpression.optional(), jsonParameters: booleanOrExpression.optional(), additionalFields: z.object({ industry: stringOrExpression.optional(), monthlySpend: stringOrExpression.optional(), name: stringOrExpression.optional(), plan: stringOrExpression.optional(), size: numberOrExpression.optional(), website: stringOrExpression.optional() }).optional(), customAttributesJson: resolveSchema({ parameters, schema: z.union([iDataObjectSchema, z.string()]), required: false, displayOptions: {"show":{"jsonParameters":[true]}}, defaults: {"jsonParameters":false} }), customAttributesUi: resolveSchema({ parameters, schema: z.object({ customAttributesValues: z.array(z.object({ name: stringOrExpression.optional(), value: stringOrExpression.optional() })).optional() }), required: false, displayOptions: {"show":{"jsonParameters":[false]}}, defaults: {"jsonParameters":false} }), }).optional(), }); };