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
35
vendor/zapier-platform/packages/schema/lib/functional-constraints/pollingThrottle.js
vendored
Normal file
35
vendor/zapier-platform/packages/schema/lib/functional-constraints/pollingThrottle.js
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
const _ = require('lodash');
|
||||
const jsonschema = require('jsonschema');
|
||||
|
||||
const pollingThrottle = (definition) => {
|
||||
const errors = [];
|
||||
const actionType = 'triggers';
|
||||
|
||||
if (definition[actionType]) {
|
||||
_.each(definition[actionType], (actionDef) => {
|
||||
if (
|
||||
actionDef.operation &&
|
||||
actionDef.operation.throttle &&
|
||||
_.has(actionDef.operation.throttle, 'retry') &&
|
||||
(!actionDef.operation.type || actionDef.operation.type === 'polling')
|
||||
) {
|
||||
errors.push(
|
||||
new jsonschema.ValidationError(
|
||||
'must not use the "retry" field for a polling trigger.',
|
||||
actionDef.operation.throttle,
|
||||
'/ThrottleObjectSchema',
|
||||
`instance.${actionType}.${actionDef.key}.operation.throttle`,
|
||||
'invalid',
|
||||
'throttle',
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return errors;
|
||||
};
|
||||
|
||||
module.exports = pollingThrottle;
|
||||
Loading…
Add table
Add a link
Reference in a new issue