master-zapier-plan-draft/vendor/zapier-platform/packages/schema/lib/schemas/CreatesSchema.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

79 lines
2.1 KiB
JavaScript

'use strict';
const makeSchema = require('../utils/makeSchema');
const { SKIP_KEY } = require('../constants');
const CreateSchema = require('./CreateSchema');
module.exports = makeSchema(
{
id: '/CreatesSchema',
description: 'Enumerates the creates 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 CreateSchema.',
$ref: CreateSchema.id,
},
},
additionalProperties: false,
examples: [
{
createRecipe: {
key: 'createRecipe',
noun: 'Recipe',
display: {
label: 'Create Recipe',
description: 'Creates a new recipe.',
},
operation: { perform: '$func$2$f$', sample: { id: 1 } },
},
},
{
Create_Recipe_01: {
key: 'Create_Recipe_01',
noun: 'Recipe',
display: {
label: 'Create Recipe',
description: 'Creates a new recipe.',
},
operation: { perform: '$func$2$f$', sample: { id: 1 } },
},
},
],
antiExamples: [
{
[SKIP_KEY]: true, // Cannot validate that key matches pattern
example: {
'01_Create_Recipe': {
key: '01_Create_Recipe',
noun: 'Recipe',
display: {
label: 'Create Recipe',
description: 'Creates a new recipe.',
},
operation: { perform: '$func$2$f$', sample: { id: 1 } },
},
},
reason: 'Key must start with a letter',
},
{
[SKIP_KEY]: true, // Cannot validate that keys match
example: {
Create_Recipe: {
key: 'createRecipe',
noun: 'Recipe',
display: {
label: 'Create Recipe',
description: 'Creates a new recipe.',
},
operation: { perform: '$func$2$f$', sample: { id: 1 } },
},
},
reason: 'Key must match the key field in CreateSchema',
},
],
},
[CreateSchema],
);