n8n-nodes-base
Version:
Base nodes of n8n
52 lines (50 loc) • 3.09 kB
JavaScript
/**
* Databricks - UnityCatalog 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 getCreateCatalogSchema = require('./operation_create_catalog.schema');
const getCreateFunctionSchema = require('./operation_create_function.schema');
const getCreateTableSchema = require('./operation_create_table.schema');
const getCreateVolumeSchema = require('./operation_create_volume.schema');
const getDeleteCatalogSchema = require('./operation_delete_catalog.schema');
const getDeleteFunctionSchema = require('./operation_delete_function.schema');
const getDeleteTableSchema = require('./operation_delete_table.schema');
const getDeleteVolumeSchema = require('./operation_delete_volume.schema');
const getGetCatalogSchema = require('./operation_get_catalog.schema');
const getGetFunctionSchema = require('./operation_get_function.schema');
const getGetTableSchema = require('./operation_get_table.schema');
const getGetVolumeSchema = require('./operation_get_volume.schema');
const getListCatalogsSchema = require('./operation_list_catalogs.schema');
const getListFunctionsSchema = require('./operation_list_functions.schema');
const getListTablesSchema = require('./operation_list_tables.schema');
const getListVolumesSchema = require('./operation_list_volumes.schema');
const getUpdateCatalogSchema = require('./operation_update_catalog.schema');
module.exports = function getSchema(helpers) {
const { parameters, z } = helpers;
// Apply operation default if not set
const effectiveParams = parameters.operation === undefined ? { ...parameters, operation: 'listDirectory' } : parameters;
return z.union([
getCreateCatalogSchema({ ...helpers, parameters: effectiveParams }),
getCreateFunctionSchema({ ...helpers, parameters: effectiveParams }),
getCreateTableSchema({ ...helpers, parameters: effectiveParams }),
getCreateVolumeSchema({ ...helpers, parameters: effectiveParams }),
getDeleteCatalogSchema({ ...helpers, parameters: effectiveParams }),
getDeleteFunctionSchema({ ...helpers, parameters: effectiveParams }),
getDeleteTableSchema({ ...helpers, parameters: effectiveParams }),
getDeleteVolumeSchema({ ...helpers, parameters: effectiveParams }),
getGetCatalogSchema({ ...helpers, parameters: effectiveParams }),
getGetFunctionSchema({ ...helpers, parameters: effectiveParams }),
getGetTableSchema({ ...helpers, parameters: effectiveParams }),
getGetVolumeSchema({ ...helpers, parameters: effectiveParams }),
getListCatalogsSchema({ ...helpers, parameters: effectiveParams }),
getListFunctionsSchema({ ...helpers, parameters: effectiveParams }),
getListTablesSchema({ ...helpers, parameters: effectiveParams }),
getListVolumesSchema({ ...helpers, parameters: effectiveParams }),
getUpdateCatalogSchema({ ...helpers, parameters: effectiveParams }),
]);
};