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

95 lines
2.7 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
const { SKIP_KEY } = require('../constants');
const makeSchema = require('../utils/makeSchema');
const ResourceSchema = require('./ResourceSchema');
module.exports = makeSchema(
{
id: '/ResourcesSchema',
description:
'All the resources that underlie common CRUD methods powering automatically handled triggers, creates, and searches for your app. Zapier will break these apart for you.',
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 ResourceSchema.',
$ref: ResourceSchema.id,
},
},
additionalProperties: false,
examples: [
{
tag: {
key: 'tag',
noun: 'Tag',
get: {
display: {
label: 'Get Tag by ID',
description: 'Grab a specific Tag by ID.',
},
operation: {
perform: {
url: 'https://fake-crm.getsandbox.com/tags/{{inputData.id}}',
},
sample: {
id: 385,
name: 'proactive enable ROI',
},
},
},
},
},
],
antiExamples: [
{
[SKIP_KEY]: true, // Cannot validate that keys don't match
example: {
getTag: {
key: 'tag',
noun: 'Tag',
get: {
display: {
label: 'Get Tag by ID',
description: 'Grab a specific Tag by ID.',
},
operation: {
perform: {
url: 'https://fake-crm.getsandbox.com/tags/{{inputData.id}}',
},
sample: {
id: 385,
name: 'proactive enable ROI',
},
},
},
},
},
reason: 'Key does not match key for associated /ResourceSchema',
},
{
[SKIP_KEY]: true, // Cannot validate that sample is only required if display isn't true / top-level resource doesn't have sample
example: {
tag: {
key: 'tag',
noun: 'Tag',
get: {
display: {
label: 'Get Tag by ID',
description: 'Grab a specific Tag by ID.',
},
operation: {
perform: {
url: 'https://fake-crm.getsandbox.com/tags/{{inputData.id}}',
},
},
},
},
},
reason:
'Missing key from operation: sample. Note  this is valid if the resource has defined a sample.',
},
],
},
[ResourceSchema],
);