n8n-nodes-base
Version:
Base nodes of n8n
48 lines (46 loc) • 2.81 kB
JavaScript
/**
* Telegram - Message 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 getDeleteMessageSchema = require('./operation_delete_message.schema');
const getEditMessageTextSchema = require('./operation_edit_message_text.schema');
const getPinChatMessageSchema = require('./operation_pin_chat_message.schema');
const getSendAndWaitSchema = require('./operation_send_and_wait.schema');
const getSendAnimationSchema = require('./operation_send_animation.schema');
const getSendAudioSchema = require('./operation_send_audio.schema');
const getSendChatActionSchema = require('./operation_send_chat_action.schema');
const getSendDocumentSchema = require('./operation_send_document.schema');
const getSendLocationSchema = require('./operation_send_location.schema');
const getSendMediaGroupSchema = require('./operation_send_media_group.schema');
const getSendMessageSchema = require('./operation_send_message.schema');
const getSendPhotoSchema = require('./operation_send_photo.schema');
const getSendStickerSchema = require('./operation_send_sticker.schema');
const getSendVideoSchema = require('./operation_send_video.schema');
const getUnpinChatMessageSchema = require('./operation_unpin_chat_message.schema');
module.exports = function getSchema(helpers) {
const { parameters, z } = helpers;
// Apply operation default if not set
const effectiveParams = parameters.operation === undefined ? { ...parameters, operation: 'get' } : parameters;
return z.union([
getDeleteMessageSchema({ ...helpers, parameters: effectiveParams }),
getEditMessageTextSchema({ ...helpers, parameters: effectiveParams }),
getPinChatMessageSchema({ ...helpers, parameters: effectiveParams }),
getSendAndWaitSchema({ ...helpers, parameters: effectiveParams }),
getSendAnimationSchema({ ...helpers, parameters: effectiveParams }),
getSendAudioSchema({ ...helpers, parameters: effectiveParams }),
getSendChatActionSchema({ ...helpers, parameters: effectiveParams }),
getSendDocumentSchema({ ...helpers, parameters: effectiveParams }),
getSendLocationSchema({ ...helpers, parameters: effectiveParams }),
getSendMediaGroupSchema({ ...helpers, parameters: effectiveParams }),
getSendMessageSchema({ ...helpers, parameters: effectiveParams }),
getSendPhotoSchema({ ...helpers, parameters: effectiveParams }),
getSendStickerSchema({ ...helpers, parameters: effectiveParams }),
getSendVideoSchema({ ...helpers, parameters: effectiveParams }),
getUnpinChatMessageSchema({ ...helpers, parameters: effectiveParams }),
]);
};