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.
69 lines
1.8 KiB
JavaScript
69 lines
1.8 KiB
JavaScript
'use strict';
|
|
|
|
const makeSchema = require('../utils/makeSchema');
|
|
const { SKIP_KEY } = require('../constants');
|
|
|
|
const BulkReadSchema = require('./BulkReadSchema');
|
|
|
|
module.exports = makeSchema(
|
|
{
|
|
id: '/BulkReadsSchema',
|
|
description: 'Enumerates the bulk reads your app exposes.',
|
|
type: 'object',
|
|
patternProperties: {
|
|
'^[a-zA-Z]+[a-zA-Z0-9_]*$': {
|
|
description:
|
|
'Any unique key can be used and its values will be validated against the BulkReadSchema.',
|
|
$ref: BulkReadSchema.id,
|
|
},
|
|
},
|
|
additionalProperties: false,
|
|
examples: [
|
|
{
|
|
recipes: {
|
|
key: 'recipes',
|
|
noun: 'Recipes',
|
|
display: {
|
|
label: 'Recipes',
|
|
description: 'A Read that lets Zapier fetch all recipes.',
|
|
},
|
|
operation: {
|
|
perform: '$func$0$f$',
|
|
sample: {
|
|
id: 1,
|
|
firstName: 'Walter',
|
|
lastName: 'Sobchak',
|
|
occupation: 'Bowler',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
],
|
|
antiExamples: [
|
|
{
|
|
[SKIP_KEY]: true, // Cannot validate that keys don't match
|
|
example: {
|
|
readRecipes: {
|
|
key: 'recipes',
|
|
noun: 'Recipes',
|
|
display: {
|
|
label: 'Recipes',
|
|
description: 'A Read that lets Zapier fetch all recipes.',
|
|
},
|
|
operation: {
|
|
perform: '$func$0$f$',
|
|
sample: {
|
|
id: 1,
|
|
firstName: 'Walter',
|
|
lastName: 'Sobchak',
|
|
occupation: 'Bowler',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
reason: 'Key must match the key of the associated BulkReadSchema',
|
|
},
|
|
],
|
|
},
|
|
[BulkReadSchema],
|
|
);
|