n8n-nodes-base
Version:
Base nodes of n8n
30 lines (28 loc) • 1.43 kB
JavaScript
/**
* Jenkins - Instance 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 getCancelQuietDownSchema = require('./operation_cancel_quiet_down.schema');
const getExitSchema = require('./operation_exit.schema');
const getQuietDownSchema = require('./operation_quiet_down.schema');
const getRestartSchema = require('./operation_restart.schema');
const getSafeExitSchema = require('./operation_safe_exit.schema');
const getSafeRestartSchema = require('./operation_safe_restart.schema');
module.exports = function getSchema(helpers) {
const { parameters, z } = helpers;
// Apply operation default if not set
const effectiveParams = parameters.operation === undefined ? { ...parameters, operation: 'trigger' } : parameters;
return z.union([
getCancelQuietDownSchema({ ...helpers, parameters: effectiveParams }),
getExitSchema({ ...helpers, parameters: effectiveParams }),
getQuietDownSchema({ ...helpers, parameters: effectiveParams }),
getRestartSchema({ ...helpers, parameters: effectiveParams }),
getSafeExitSchema({ ...helpers, parameters: effectiveParams }),
getSafeRestartSchema({ ...helpers, parameters: effectiveParams }),
]);
};