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.
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
const makeSchema = require('../utils/makeSchema');
|
|
|
|
module.exports = makeSchema({
|
|
id: '/RefResourceSchema',
|
|
description:
|
|
'Reference a resource by key and the data it returns. In the format of: `{resource_key}.{foreign_key}(.{human_label_key})`.',
|
|
type: 'string',
|
|
// the human_label_key should match the broad `string` type that PlainFieldSchema.key can be, with commas!
|
|
pattern:
|
|
'^[a-zA-Z0-9_]+\\.[a-zA-Z0-9_\\s\\[\\]]+(\\.[a-zA-Z0-9_\\s\\[\\]]+(,[a-zA-Z0-9_\\s\\[\\]]+)*)?$',
|
|
examples: [
|
|
'contact.id',
|
|
'contact.id.name',
|
|
'contact.id.firstName,lastName',
|
|
'contact.id.first_name,last_name,email',
|
|
'contact.Contact Id.Full Name',
|
|
'contact.data[]id.data[]First Name,data[]Last Name',
|
|
],
|
|
antiExamples: [
|
|
{
|
|
example: 'Contact List',
|
|
reason: 'Does not match resource_key pattern',
|
|
},
|
|
{
|
|
example: 'Contact.list,find.id',
|
|
reason: 'Does not match foreign_key pattern',
|
|
},
|
|
{
|
|
example: 'Contact.list.id.full_name',
|
|
reason: 'Does not match human_label_key pattern',
|
|
},
|
|
],
|
|
});
|