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.
35 lines
852 B
JavaScript
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],
|
|
);
|