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.
This commit is contained in:
commit
b4150c8250
1364 changed files with 6814366 additions and 0 deletions
31
vendor/zapier-platform/packages/schema/lib/functional-constraints/labelWhenVisible.js
vendored
Normal file
31
vendor/zapier-platform/packages/schema/lib/functional-constraints/labelWhenVisible.js
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
const _ = require('lodash');
|
||||
const jsonschema = require('jsonschema');
|
||||
|
||||
const actionTypes = ['triggers', 'searches', 'creates', 'bulkReads'];
|
||||
|
||||
const labelWhenVisible = (definition) => {
|
||||
const errors = [];
|
||||
|
||||
for (const actionType of actionTypes) {
|
||||
const group = definition[actionType] || {};
|
||||
_.each(group, (action, key) => {
|
||||
const { display } = action;
|
||||
if (!display.hidden && !(display.label && display.description)) {
|
||||
errors.push(
|
||||
new jsonschema.ValidationError(
|
||||
`visible actions must have a label and description`,
|
||||
action,
|
||||
`/BasicDisplaySchema`,
|
||||
`instance.${actionType}.${key}.display`,
|
||||
'invalid',
|
||||
'key',
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return errors;
|
||||
};
|
||||
|
||||
module.exports = labelWhenVisible;
|
||||
Loading…
Add table
Add a link
Reference in a new issue