UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

28 lines (26 loc) 1.3 kB
/** * Spotify - Artist 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 getGetSchema = require('./operation_get.schema'); const getGetAlbumsSchema = require('./operation_get_albums.schema'); const getGetRelatedArtistsSchema = require('./operation_get_related_artists.schema'); const getGetTopTracksSchema = require('./operation_get_top_tracks.schema'); const getSearchSchema = require('./operation_search.schema'); module.exports = function getSchema(helpers) { const { parameters, z } = helpers; // Apply operation default if not set const effectiveParams = parameters.operation === undefined ? { ...parameters, operation: 'addSongToQueue' } : parameters; return z.union([ getGetSchema({ ...helpers, parameters: effectiveParams }), getGetAlbumsSchema({ ...helpers, parameters: effectiveParams }), getGetRelatedArtistsSchema({ ...helpers, parameters: effectiveParams }), getGetTopTracksSchema({ ...helpers, parameters: effectiveParams }), getSearchSchema({ ...helpers, parameters: effectiveParams }), ]); };