master-zapier-plan-draft/vendor/zapier-platform/packages/schema/lib/schemas/MiddlewaresSchema.js
George Lambert b4150c8250 Milestone 0: import zappier billing, Verae middleware, and Zapier research
Compose-ready workspace: packages/zappier (rate card, portal, Stripe),
packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier
(CLI app), vendor/zapier-platform, and research/zapier vendor corpus.

Gate 0 structure checks pass. Product code and research are not yet wired.
2026-09-09 02:37:36 -04:00

35 lines
852 B
JavaScript

'use strict';
const { SKIP_KEY } = require('../constants');
const makeSchema = require('../utils/makeSchema');
const FunctionSchema = require('./FunctionSchema');
module.exports = makeSchema(
{
id: '/MiddlewaresSchema',
description:
'List of before or after middlewares. Can be an array of functions or a single function',
oneOf: [
{
type: 'array',
items: { $ref: FunctionSchema.id },
},
{ $ref: FunctionSchema.id },
],
additionalProperties: false,
examples: [
{
[SKIP_KEY]: true, // TODO fix this
require: 'some/path/to/file.js',
},
[{ require: 'some/path/to/file.js' }],
],
antiExamples: [
{
example: {},
reason: 'Does not match either /FunctionSchema or an array of such',
},
],
},
[FunctionSchema],
);