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

83 lines
2.1 KiB
JavaScript

'use strict';
const makeSchema = require('../utils/makeSchema');
const BasicDisplaySchema = require('./BasicDisplaySchema');
const BasicCreateOperationSchema = require('./BasicCreateOperationSchema');
const KeySchema = require('./KeySchema');
module.exports = makeSchema(
{
id: '/CreateSchema',
description: 'How will Zapier create a new object?',
type: 'object',
required: ['key', 'noun', 'display', 'operation'],
properties: {
key: {
description: 'A key to uniquely identify this create.',
$ref: KeySchema.id,
},
noun: {
description:
'A noun for this create that completes the sentence "creates a new XXX".',
type: 'string',
minLength: 2,
maxLength: 255,
},
display: {
description: 'Configures the UI for this create.',
$ref: BasicDisplaySchema.id,
},
operation: {
description: 'Powers the functionality for this create.',
$ref: BasicCreateOperationSchema.id,
},
},
examples: [
{
key: 'recipe',
noun: 'Recipe',
display: {
label: 'Create Recipe',
description: 'Creates a new recipe.',
},
operation: { perform: '$func$2$f$', sample: { id: 1 } },
},
{
key: 'recipe',
noun: 'Recipe',
display: {
label: 'Create Recipe',
description: 'Creates a new recipe.',
hidden: true,
},
operation: {
perform: '$func$2$f$',
},
},
],
antiExamples: [
{
example: 'abc',
reason: 'Must be an object',
},
{
example: {
key: 'recipe',
noun: 'Recipe',
display: {
label: 'Create Recipe',
description: 'Creates a new recipe.',
},
operation: {
perform: '$func$2$f$',
},
},
reason:
'Missing required key on operation: sample. Note - this is valid if the resource has defined a sample.',
},
],
additionalProperties: false,
},
[BasicDisplaySchema, BasicCreateOperationSchema, KeySchema],
);