UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

32 lines (30 loc) 1.61 kB
/** * GitHub - Repository 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 getGetIssuesSchema = require('./operation_get_issues.schema'); const getGetLicenseSchema = require('./operation_get_license.schema'); const getGetProfileSchema = require('./operation_get_profile.schema'); const getGetPullRequestsSchema = require('./operation_get_pull_requests.schema'); const getListPopularPathsSchema = require('./operation_list_popular_paths.schema'); const getListReferrersSchema = require('./operation_list_referrers.schema'); module.exports = function getSchema(helpers) { const { parameters, z } = helpers; // Apply operation default if not set const effectiveParams = parameters.operation === undefined ? { ...parameters, operation: 'getRepositories' } : parameters; return z.union([ getGetSchema({ ...helpers, parameters: effectiveParams }), getGetIssuesSchema({ ...helpers, parameters: effectiveParams }), getGetLicenseSchema({ ...helpers, parameters: effectiveParams }), getGetProfileSchema({ ...helpers, parameters: effectiveParams }), getGetPullRequestsSchema({ ...helpers, parameters: effectiveParams }), getListPopularPathsSchema({ ...helpers, parameters: effectiveParams }), getListReferrersSchema({ ...helpers, parameters: effectiveParams }), ]); };