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

55 lines
1.4 KiB
JavaScript

'use strict';
const makeSchema = require('../utils/makeSchema');
const { SKIP_KEY } = require('../constants');
const SearchSchema = require('./SearchSchema');
module.exports = makeSchema(
{
id: '/SearchesSchema',
description: 'Enumerates the searches 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 SearchSchema.',
$ref: SearchSchema.id,
},
},
additionalProperties: false,
examples: [
{
recipe: {
key: 'recipe',
noun: 'Recipe',
display: {
label: 'Find a Recipe',
description: 'Search for recipe by cuisine style.',
hidden: true,
},
operation: { perform: '$func$2$f$' },
},
},
],
antiExamples: [
{
[SKIP_KEY]: true, // Cannot validate that keys match
example: {
searchRecipe: {
key: 'recipe',
noun: 'Recipe',
display: {
label: 'Find a Recipe',
description: 'Search for recipe by cuisine style.',
hidden: true,
},
operation: { perform: '$func$2$f$' },
},
},
reason: 'Key must match the key of the associated /SearchSchema',
},
],
},
[SearchSchema],
);