n8n-nodes-base
Version:
Base nodes of n8n
30 lines (28 loc) • 1.46 kB
JavaScript
/**
* Databricks Node - Version 1 - Zod Schema Factory
* Exports a factory that unions all discriminator schemas.
*
* 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 getDatabricksSqlSchema = require('./resource_databricks_sql/index.schema');
const getFilesSchema = require('./resource_files/index.schema');
const getGenieSchema = require('./resource_genie/index.schema');
const getModelServingSchema = require('./resource_model_serving/index.schema');
const getUnityCatalogSchema = require('./resource_unity_catalog/index.schema');
const getVectorSearchSchema = require('./resource_vector_search/index.schema');
module.exports = function getSchema(helpers) {
const { parameters, z } = helpers;
// Apply discriminator default if not set
const effectiveParams = parameters.resource === undefined ? { ...parameters, resource: 'databricksSql' } : parameters;
return z.union([
getDatabricksSqlSchema({ ...helpers, parameters: effectiveParams }),
getFilesSchema({ ...helpers, parameters: effectiveParams }),
getGenieSchema({ ...helpers, parameters: effectiveParams }),
getModelServingSchema({ ...helpers, parameters: effectiveParams }),
getUnityCatalogSchema({ ...helpers, parameters: effectiveParams }),
getVectorSearchSchema({ ...helpers, parameters: effectiveParams }),
]);
};