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
41
vendor/zapier-platform/packages/schema/lib/functional-constraints/index.js
vendored
Normal file
41
vendor/zapier-platform/packages/schema/lib/functional-constraints/index.js
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
'use strict';
|
||||
|
||||
/* Each check below is expected to return a list of ValidationSchema errors. An error is defined by:
|
||||
* new jsonschema.ValidationError(
|
||||
* message, // string that explains the problem, like 'must not have a URL that points to AWS'
|
||||
* instance, // the snippet of the app definition that is invalid
|
||||
* schema, // name of the schema that failed, like '/TriggerSchema'
|
||||
* propertyPath, // stringified path to problematic snippet, like 'instance.triggers.find_contact'
|
||||
* name, // optional, the validation type that failed. Can make something up like 'invalidUrl'
|
||||
* argument // optional
|
||||
* );
|
||||
*/
|
||||
const checks = [
|
||||
require('./searchOrCreateKeys'),
|
||||
require('./deepNestedFields'),
|
||||
require('./mutuallyExclusiveFields'),
|
||||
require('./requiredSamples'),
|
||||
require('./matchingKeys'),
|
||||
require('./labelWhenVisible'),
|
||||
require('./uniqueInputFieldKeys'),
|
||||
require('./bufferedCreateConstraints'),
|
||||
require('./requirePerformConditionally'),
|
||||
require('./pollingThrottle'),
|
||||
require('./AuthFieldisSafe'),
|
||||
require('./inputFieldGroupsConstraints'),
|
||||
require('./validateJsonFieldSchema'),
|
||||
];
|
||||
|
||||
const runFunctionalConstraints = (definition, mainSchema) => {
|
||||
return checks.reduce((errors, checkFunc) => {
|
||||
const errorsForCheck = checkFunc(definition, mainSchema);
|
||||
if (errorsForCheck) {
|
||||
errors = errors.concat(errorsForCheck);
|
||||
}
|
||||
return errors;
|
||||
}, []);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
run: runFunctionalConstraints,
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue