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.
61 lines
1.6 KiB
JavaScript
61 lines
1.6 KiB
JavaScript
'use strict';
|
|
|
|
const makeSchema = require('../utils/makeSchema');
|
|
const { SKIP_KEY } = require('../constants');
|
|
|
|
const TriggerSchema = require('./TriggerSchema');
|
|
|
|
module.exports = makeSchema(
|
|
{
|
|
id: '/TriggersSchema',
|
|
description: 'Enumerates the triggers your app has available for users.',
|
|
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 TriggerSchema.',
|
|
$ref: TriggerSchema.id,
|
|
},
|
|
},
|
|
additionalProperties: false,
|
|
examples: [
|
|
{
|
|
newRecipe: {
|
|
key: 'newRecipe',
|
|
noun: 'Recipe',
|
|
display: {
|
|
label: 'New Recipe',
|
|
description: 'Triggers when a new recipe is added.',
|
|
},
|
|
operation: {
|
|
type: 'polling',
|
|
perform: '$func$0$f$',
|
|
sample: { id: 1 },
|
|
},
|
|
},
|
|
},
|
|
],
|
|
antiExamples: [
|
|
{
|
|
example: {
|
|
[SKIP_KEY]: true, // Cannot validate that keys don't match
|
|
newRecipe: {
|
|
key: 'new_recipe',
|
|
noun: 'Recipe',
|
|
display: {
|
|
label: 'New Recipe',
|
|
description: 'Triggers when a new recipe is added.',
|
|
},
|
|
operation: {
|
|
type: 'polling',
|
|
perform: '$func$0$f$',
|
|
sample: { id: 1 },
|
|
},
|
|
},
|
|
},
|
|
reason: 'Key must match the key on the associated /TriggerSchema',
|
|
},
|
|
],
|
|
},
|
|
[TriggerSchema],
|
|
);
|