UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

28 lines (26 loc) 2.35 kB
/** * Onfleet Node - Version 1 - Zod Schema * Discriminator: resource=worker, operation=getAll * * 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('worker'), operation: z.literal('getAll').default('getAll'), byLocation: booleanOrExpression.optional(), longitude: resolveSchema({ parameters, schema: numberOrExpression, required: false, displayOptions: {"show":{"byLocation":[true]}}, defaults: {"byLocation":false} }), latitude: resolveSchema({ parameters, schema: numberOrExpression, required: false, displayOptions: {"show":{"byLocation":[true]}}, defaults: {"byLocation":false} }), returnAll: booleanOrExpression.optional(), limit: resolveSchema({ parameters, schema: numberOrExpression, required: false, displayOptions: {"show":{"returnAll":[false]}}, defaults: {"returnAll":false} }), filters: resolveSchema({ parameters, schema: z.object({ radius: numberOrExpression.optional(), states: z.array(z.union([z.literal(2), z.literal(1), z.literal(0)])).optional(), teams: z.array(z.string()).optional(), phones: stringOrExpression.optional() }), required: false, displayOptions: {"show":{"byLocation":[true,false]}}, defaults: {"byLocation":false} }), options: z.object({ filter: z.array(z.union([z.literal('accountStatus'), z.literal('activeTask'), z.literal('capacity'), z.literal('delayTime'), z.literal('displayName'), z.literal('imageUrl'), z.literal('location'), z.literal('metadata'), z.literal('name'), z.literal('onDuty'), z.literal('organization'), z.literal('phone'), z.literal('tasks'), z.literal('teams'), z.literal('timeCreated'), z.literal('timeLastModified'), z.literal('timeLastSeen'), z.literal('userData'), z.literal('vehicle'), z.literal('id')])).optional() }).optional(), }).optional(), }); };