zapier-platform-schema 15.19.0 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/exported-schema.json +1 -1
  2. package/lib/functional-constraints/bufferedCreateConstraints.js +11 -11
  3. package/lib/functional-constraints/deepNestedFields.js +7 -7
  4. package/lib/functional-constraints/labelWhenVisible.js +2 -2
  5. package/lib/functional-constraints/matchingKeys.js +2 -2
  6. package/lib/functional-constraints/mutuallyExclusiveFields.js +3 -3
  7. package/lib/functional-constraints/pollingThrottle.js +2 -2
  8. package/lib/functional-constraints/requirePerformConditionally.js +2 -2
  9. package/lib/functional-constraints/requiredSamples.js +3 -3
  10. package/lib/functional-constraints/searchOrCreateKeys.js +29 -29
  11. package/lib/functional-constraints/uniqueInputFieldKeys.js +6 -7
  12. package/lib/schemas/AppSchema.js +2 -3
  13. package/lib/schemas/AuthenticationCustomConfigSchema.js +1 -1
  14. package/lib/schemas/AuthenticationOAuth1ConfigSchema.js +1 -1
  15. package/lib/schemas/AuthenticationOAuth2ConfigSchema.js +1 -1
  16. package/lib/schemas/AuthenticationSchema.js +1 -1
  17. package/lib/schemas/AuthenticationSessionConfigSchema.js +1 -1
  18. package/lib/schemas/BasicActionOperationSchema.js +2 -2
  19. package/lib/schemas/BasicCreateActionOperationSchema.js +2 -2
  20. package/lib/schemas/BasicHookOperationSchema.js +2 -2
  21. package/lib/schemas/BasicHookToPollOperationSchema.js +2 -2
  22. package/lib/schemas/BasicOperationSchema.js +9 -1
  23. package/lib/schemas/BasicPollingOperationSchema.js +2 -2
  24. package/lib/schemas/BulkReadSchema.js +1 -1
  25. package/lib/schemas/BulkReadsSchema.js +1 -1
  26. package/lib/schemas/CreateSchema.js +1 -1
  27. package/lib/schemas/CreatesSchema.js +1 -1
  28. package/lib/schemas/DynamicFieldsSchema.js +1 -1
  29. package/lib/schemas/FieldChoiceWithLabelSchema.js +1 -1
  30. package/lib/schemas/FieldChoicesSchema.js +1 -1
  31. package/lib/schemas/FieldOrFunctionSchema.js +1 -1
  32. package/lib/schemas/FieldSchema.js +1 -1
  33. package/lib/schemas/FieldsSchema.js +1 -1
  34. package/lib/schemas/FunctionSchema.js +1 -1
  35. package/lib/schemas/HydratorsSchema.js +1 -1
  36. package/lib/schemas/MiddlewaresSchema.js +1 -1
  37. package/lib/schemas/RedirectRequestSchema.js +1 -1
  38. package/lib/schemas/RequestSchema.js +1 -1
  39. package/lib/schemas/ResourceMethodCreateSchema.js +1 -1
  40. package/lib/schemas/ResourceMethodGetSchema.js +1 -1
  41. package/lib/schemas/ResourceMethodHookSchema.js +1 -1
  42. package/lib/schemas/ResourceMethodListSchema.js +1 -1
  43. package/lib/schemas/ResourceMethodSearchSchema.js +1 -1
  44. package/lib/schemas/ResourceSchema.js +1 -1
  45. package/lib/schemas/ResourcesMethodGetSchema.js +1 -1
  46. package/lib/schemas/ResourcesSchema.js +1 -1
  47. package/lib/schemas/SearchAndCreatesSchema.js +1 -1
  48. package/lib/schemas/SearchOrCreateSchema.js +1 -1
  49. package/lib/schemas/SearchOrCreatesSchema.js +1 -1
  50. package/lib/schemas/SearchSchema.js +1 -1
  51. package/lib/schemas/SearchesSchema.js +1 -1
  52. package/lib/schemas/ThrottleObjectSchema.js +1 -1
  53. package/lib/schemas/TriggerSchema.js +1 -1
  54. package/lib/schemas/TriggersSchema.js +1 -1
  55. package/lib/utils/buildDocs.js +2 -2
  56. package/lib/utils/exportSchema.js +1 -1
  57. package/lib/utils/makeValidator.js +5 -5
  58. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "15.19.0",
2
+ "version": "16.0.0",
3
3
  "schemas": {
4
4
  "AppSchema": {
5
5
  "id": "/AppSchema",
@@ -18,8 +18,8 @@ const bufferedCreateConstraints = (definition) => {
18
18
  '/BasicCreateActionOperationSchema',
19
19
  `instance.${actionType}.${actionDef.key}.operation`,
20
20
  'missing',
21
- 'performBuffer'
22
- )
21
+ 'performBuffer',
22
+ ),
23
23
  );
24
24
  }
25
25
 
@@ -31,8 +31,8 @@ const bufferedCreateConstraints = (definition) => {
31
31
  '/BasicCreateActionOperationSchema',
32
32
  `instance.${actionType}.${actionDef.key}.operation`,
33
33
  'invalid',
34
- 'perform'
35
- )
34
+ 'perform',
35
+ ),
36
36
  );
37
37
  }
38
38
 
@@ -41,7 +41,7 @@ const bufferedCreateConstraints = (definition) => {
41
41
  const inputFields = _.get(
42
42
  actionDef,
43
43
  ['operation', 'inputFields'],
44
- []
44
+ [],
45
45
  );
46
46
  inputFields.forEach((inputField) => {
47
47
  if (inputField.required) {
@@ -58,8 +58,8 @@ const bufferedCreateConstraints = (definition) => {
58
58
  '/BufferConfigSchema',
59
59
  `instance.${actionType}.${actionDef.key}.operation.buffer.groupedBy[${index}]`,
60
60
  'invalid',
61
- 'groupedBy'
62
- )
61
+ 'groupedBy',
62
+ ),
63
63
  );
64
64
  }
65
65
  });
@@ -75,8 +75,8 @@ const bufferedCreateConstraints = (definition) => {
75
75
  '/BasicCreateActionOperationSchema',
76
76
  `instance.${actionType}.${actionDef.key}.operation`,
77
77
  'missing',
78
- 'buffer'
79
- )
78
+ 'buffer',
79
+ ),
80
80
  );
81
81
  }
82
82
 
@@ -88,8 +88,8 @@ const bufferedCreateConstraints = (definition) => {
88
88
  '/BasicCreateActionOperationSchema',
89
89
  `instance.${actionType}.${actionDef.key}.operation`,
90
90
  'invalid',
91
- 'perform'
92
- )
91
+ 'perform',
92
+ ),
93
93
  );
94
94
  }
95
95
  }
@@ -16,13 +16,13 @@ const collectErrors = (inputFields, path) => {
16
16
  '/FieldSchema',
17
17
  `instance.${path}.inputFields[${index}].children`,
18
18
  'empty',
19
- 'inputFields'
20
- )
19
+ 'inputFields',
20
+ ),
21
21
  );
22
22
  } else {
23
23
  const hasDeeplyNestedChildren = _.some(
24
24
  inputField.children,
25
- (child) => child.children
25
+ (child) => child.children,
26
26
  );
27
27
 
28
28
  if (hasDeeplyNestedChildren) {
@@ -33,8 +33,8 @@ const collectErrors = (inputFields, path) => {
33
33
  '/FieldSchema',
34
34
  `instance.${path}.inputFields[${index}]`,
35
35
  'deepNesting',
36
- 'inputFields'
37
- )
36
+ 'inputFields',
37
+ ),
38
38
  );
39
39
  }
40
40
  }
@@ -54,8 +54,8 @@ const validateFieldNesting = (definition) => {
54
54
  errors = errors.concat(
55
55
  collectErrors(
56
56
  actionDef.operation.inputFields,
57
- `${typeOf}.${actionDef.key}`
58
- )
57
+ `${typeOf}.${actionDef.key}`,
58
+ ),
59
59
  );
60
60
  }
61
61
  });
@@ -18,8 +18,8 @@ const labelWhenVisible = (definition) => {
18
18
  `/BasicDisplaySchema`,
19
19
  `instance.${actionType}.${key}.display`,
20
20
  'invalid',
21
- 'key'
22
- )
21
+ 'key',
22
+ ),
23
23
  );
24
24
  }
25
25
  });
@@ -22,8 +22,8 @@ const matchingKeys = (definition) => {
22
22
  `/${_.capitalize(actionType)}Schema`,
23
23
  `instance.${key}.key`,
24
24
  'invalid',
25
- 'key'
26
- )
25
+ 'key',
26
+ ),
27
27
  );
28
28
  }
29
29
  });
@@ -35,8 +35,8 @@ const verifyIncompatibilities = (inputFields, path) => {
35
35
  '/FieldSchema',
36
36
  `instance.${path}.inputFields[${index}]`,
37
37
  'invalid',
38
- 'inputFields'
39
- )
38
+ 'inputFields',
39
+ ),
40
40
  );
41
41
  }
42
42
  });
@@ -56,7 +56,7 @@ const mutuallyExclusiveFields = (definition) => {
56
56
  ...errors,
57
57
  ...verifyIncompatibilities(
58
58
  actionDef.operation.inputFields,
59
- `${typeOf}.${actionDef.key}`
59
+ `${typeOf}.${actionDef.key}`,
60
60
  ),
61
61
  ];
62
62
  }
@@ -22,8 +22,8 @@ const pollingThrottle = (definition) => {
22
22
  '/ThrottleObjectSchema',
23
23
  `instance.${actionType}.${actionDef.key}.operation.throttle`,
24
24
  'invalid',
25
- 'throttle'
26
- )
25
+ 'throttle',
26
+ ),
27
27
  );
28
28
  }
29
29
  });
@@ -22,8 +22,8 @@ const requirePerformConditionally = (definition) => {
22
22
  '/BasicCreateActionOperationSchema',
23
23
  `instance.${actionType}.${actionDef.key}.operation`,
24
24
  'required',
25
- 'perform'
26
- )
25
+ 'perform',
26
+ ),
27
27
  );
28
28
  }
29
29
  });
@@ -18,7 +18,7 @@ const check = (definition) => {
18
18
  : new jsonschema.ValidationError(
19
19
  'requires "sample", because it\'s not hidden',
20
20
  definition,
21
- definition.id
21
+ definition.id,
22
22
  );
23
23
  };
24
24
 
@@ -27,7 +27,7 @@ module.exports = (definition, mainSchema) => {
27
27
 
28
28
  if (mainSchema.id === RESOURCE_ID) {
29
29
  definitions = RESOURCE_METHODS.map((method) => definition[method]).filter(
30
- Boolean
30
+ Boolean,
31
31
  );
32
32
 
33
33
  // allow method definitions to inherit the sample
@@ -44,7 +44,7 @@ module.exports = (definition, mainSchema) => {
44
44
  new jsonschema.ValidationError(
45
45
  'expected at least one resource operation',
46
46
  definition,
47
- definition.id
47
+ definition.id,
48
48
  ),
49
49
  ];
50
50
  }
@@ -15,7 +15,7 @@ const getSearchOutputSampleKeys = (definition, searchKey) => {
15
15
  const searchOutputSampleFields = _.get(
16
16
  definition.searches,
17
17
  `${searchKey}.operation.sample`,
18
- {}
18
+ {},
19
19
  );
20
20
 
21
21
  return Object.keys(searchOutputSampleFields);
@@ -41,19 +41,19 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
41
41
 
42
42
  const updateInputKeys = getFieldKeys(
43
43
  definition.creates,
44
- `${updateKey}.operation.inputFields`
44
+ `${updateKey}.operation.inputFields`,
45
45
  );
46
46
  const searchInputKeys = getFieldKeys(
47
47
  definition.searches,
48
- `${searchKey}.operation.inputFields`
48
+ `${searchKey}.operation.inputFields`,
49
49
  );
50
50
  const searchOutputKeys = getFieldKeys(
51
51
  definition.searches,
52
- `${searchKey}.operation.outputFields`
52
+ `${searchKey}.operation.outputFields`,
53
53
  );
54
54
  const searchOutputSampleKeys = getSearchOutputSampleKeys(
55
55
  definition,
56
- searchKey
56
+ searchKey,
57
57
  );
58
58
 
59
59
  // There are constraints where we check for keys in either outputFields or sample, so combining them is a shortcut
@@ -65,11 +65,11 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
65
65
  // For some constraints, there is a difference between not "having" a key defined versus having one but with empty values
66
66
  const hasSearchOutputFields = _.has(
67
67
  definition.searches,
68
- `${searchKey}.operation.outputFields`
68
+ `${searchKey}.operation.outputFields`,
69
69
  );
70
70
  const hasSearchOutputSample = _.has(
71
71
  definition.searches,
72
- `${searchKey}.operation.sample`
72
+ `${searchKey}.operation.sample`,
73
73
  );
74
74
 
75
75
  // Confirm searchOrCreate.key matches a searches.key (current Zapier editor limitation)
@@ -81,8 +81,8 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
81
81
  '/SearchOrCreateSchema',
82
82
  `instance.${searchCreatesKey}.${key}.key`,
83
83
  'invalidKey',
84
- 'key'
85
- )
84
+ 'key',
85
+ ),
86
86
  );
87
87
  }
88
88
 
@@ -95,8 +95,8 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
95
95
  '/SearchOrCreateSchema',
96
96
  `instance.${searchCreatesKey}.${key}.search`,
97
97
  'invalidKey',
98
- 'search'
99
- )
98
+ 'search',
99
+ ),
100
100
  );
101
101
  }
102
102
 
@@ -109,8 +109,8 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
109
109
  '/SearchOrCreateSchema',
110
110
  `instance.${searchCreatesKey}.${key}.create`,
111
111
  'invalidKey',
112
- 'create'
113
- )
112
+ 'create',
113
+ ),
114
114
  );
115
115
  }
116
116
 
@@ -122,8 +122,8 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
122
122
  searchOrCreateDef,
123
123
  '/SearchOrCreateSchema',
124
124
  `instance.${searchCreatesKey}.${key}.update`,
125
- 'invalidKey'
126
- )
125
+ 'invalidKey',
126
+ ),
127
127
  );
128
128
  }
129
129
 
@@ -135,8 +135,8 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
135
135
  searchOrCreateDef,
136
136
  '/SearchOrCreateSchema',
137
137
  `instance.${searchCreatesKey}.${key}.updateInputFromSearchOutput`,
138
- 'invalid'
139
- )
138
+ 'invalid',
139
+ ),
140
140
  );
141
141
  }
142
142
 
@@ -148,8 +148,8 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
148
148
  searchOrCreateDef,
149
149
  '/SearchOrCreateSchema',
150
150
  `instance.${searchCreatesKey}.${key}.searchUniqueInputToOutputConstraint`,
151
- 'invalid'
152
- )
151
+ 'invalid',
152
+ ),
153
153
  );
154
154
  }
155
155
 
@@ -167,7 +167,7 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
167
167
  const searchOutputOptionHint = `(options: ${[...allSearchOutputKeys]})`;
168
168
 
169
169
  for (const [updateInputField, searchOutputField] of Object.entries(
170
- searchOrCreateDef.updateInputFromSearchOutput
170
+ searchOrCreateDef.updateInputFromSearchOutput,
171
171
  )) {
172
172
  if (!updateInputKeys.includes(updateInputField)) {
173
173
  errors.push(
@@ -176,8 +176,8 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
176
176
  searchOrCreateDef,
177
177
  '/SearchOrCreateSchema',
178
178
  `instance.${searchCreatesKey}.${key}.updateInputFromSearchOutput`,
179
- 'invalidKey'
180
- )
179
+ 'invalidKey',
180
+ ),
181
181
  );
182
182
  }
183
183
 
@@ -191,8 +191,8 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
191
191
  searchOrCreateDef,
192
192
  '/SearchOrCreateSchema',
193
193
  `instance.${searchCreatesKey}.${key}.updateInputFromSearchOutput`,
194
- 'invalidKey'
195
- )
194
+ 'invalidKey',
195
+ ),
196
196
  );
197
197
  }
198
198
  }
@@ -212,7 +212,7 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
212
212
  const searchOutputOptionHint = `(options: ${[...allSearchOutputKeys]})`;
213
213
 
214
214
  for (const [searchInputField, searchOutputField] of Object.entries(
215
- searchOrCreateDef.searchUniqueInputToOutputConstraint
215
+ searchOrCreateDef.searchUniqueInputToOutputConstraint,
216
216
  )) {
217
217
  if (!searchInputKeys.includes(searchInputField)) {
218
218
  errors.push(
@@ -221,8 +221,8 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
221
221
  searchOrCreateDef,
222
222
  '/SearchOrCreateSchema',
223
223
  `instance.${searchCreatesKey}.${key}.searchUniqueInputToOutputConstraint`,
224
- 'invalidKey'
225
- )
224
+ 'invalidKey',
225
+ ),
226
226
  );
227
227
  }
228
228
 
@@ -237,8 +237,8 @@ const validateSearchCreateKeys = (definition, searchCreatesKey) => {
237
237
  searchOrCreateDef,
238
238
  '/SearchOrCreateSchema',
239
239
  `instance.${searchCreatesKey}.${key}.searchUniqueInputToOutputConstraint`,
240
- 'invalidKey'
241
- )
240
+ 'invalidKey',
241
+ ),
242
242
  );
243
243
  }
244
244
  }
@@ -30,8 +30,8 @@ const uniqueInputFieldKeys = (definition) => {
30
30
  }.key`,
31
31
  inputField.key,
32
32
  `/BasicOperationSchema`,
33
- `instance.${actionType}.${key}.operation.inputFields[${index}].key`
34
- )
33
+ `instance.${actionType}.${key}.operation.inputFields[${index}].key`,
34
+ ),
35
35
  );
36
36
  } else {
37
37
  existingKeys[inputField.key] = `inputFields[${index}]`;
@@ -48,13 +48,12 @@ const uniqueInputFieldKeys = (definition) => {
48
48
  }.key`,
49
49
  subField.key,
50
50
  `/BasicOperationSchema`,
51
- `instance.${actionType}.${key}.operation.inputFields[${index}].children[${subFieldIndex}].key`
52
- )
51
+ `instance.${actionType}.${key}.operation.inputFields[${index}].children[${subFieldIndex}].key`,
52
+ ),
53
53
  );
54
54
  } else {
55
- existingKeys[
56
- subField.key
57
- ] = `inputFields[${index}].children[${subFieldIndex}]`;
55
+ existingKeys[subField.key] =
56
+ `inputFields[${index}].children[${subFieldIndex}]`;
58
57
  }
59
58
  });
60
59
  });
@@ -107,8 +107,7 @@ module.exports = makeSchema(
107
107
  $ref: AppFlagsSchema.id,
108
108
  },
109
109
  throttle: {
110
- description:
111
- `Zapier uses this configuration to apply throttling when the limit for the window is exceeded. When set here, it is the default throttle configuration used on each action of the integration. And when set in an action's operation object, it gets overwritten for that action only.`,
110
+ description: `Zapier uses this configuration to apply throttling when the limit for the window is exceeded. When set here, it is the default throttle configuration used on each action of the integration. And when set in an action's operation object, it gets overwritten for that action only.`,
112
111
  $ref: ThrottleObjectSchema.id,
113
112
  },
114
113
  legacy: {
@@ -157,5 +156,5 @@ module.exports = makeSchema(
157
156
  HydratorsSchema,
158
157
  AppFlagsSchema,
159
158
  ThrottleObjectSchema,
160
- ]
159
+ ],
161
160
  );
@@ -33,5 +33,5 @@ module.exports = makeSchema(
33
33
  ],
34
34
  antiExamples: [{ example: { foo: true }, reason: 'Invalid key.' }],
35
35
  },
36
- [RequestSchema, FunctionSchema]
36
+ [RequestSchema, FunctionSchema],
37
37
  );
@@ -49,5 +49,5 @@ module.exports = makeSchema(
49
49
  },
50
50
  ],
51
51
  },
52
- [FunctionSchema, RedirectRequestSchema, RequestSchema]
52
+ [FunctionSchema, RedirectRequestSchema, RequestSchema],
53
53
  );
@@ -74,5 +74,5 @@ module.exports = makeSchema(
74
74
  },
75
75
  ],
76
76
  },
77
- [FunctionSchema, RedirectRequestSchema, RequestSchema]
77
+ [FunctionSchema, RedirectRequestSchema, RequestSchema],
78
78
  );
@@ -114,5 +114,5 @@ module.exports = makeSchema(
114
114
  AuthenticationOAuth1ConfigSchema,
115
115
  AuthenticationOAuth2ConfigSchema,
116
116
  AuthenticationSessionConfigSchema,
117
- ]
117
+ ],
118
118
  );
@@ -27,5 +27,5 @@ module.exports = makeSchema(
27
27
  },
28
28
  ],
29
29
  },
30
- [FunctionSchema, RequestSchema]
30
+ [FunctionSchema, RequestSchema],
31
31
  );
@@ -10,7 +10,7 @@ const RequestSchema = require('./RequestSchema');
10
10
  // TODO: would be nice to deep merge these instead
11
11
  // or maybe use allOf which is built into json-schema
12
12
  const BasicActionOperationSchema = JSON.parse(
13
- JSON.stringify(BasicOperationSchema.schema)
13
+ JSON.stringify(BasicOperationSchema.schema),
14
14
  );
15
15
 
16
16
  BasicActionOperationSchema.id = '/BasicActionOperationSchema';
@@ -57,5 +57,5 @@ BasicActionOperationSchema.antiExamples = [
57
57
 
58
58
  module.exports = makeSchema(
59
59
  BasicActionOperationSchema,
60
- BasicOperationSchema.dependencies
60
+ BasicOperationSchema.dependencies,
61
61
  );
@@ -10,7 +10,7 @@ const RequestSchema = require('./RequestSchema');
10
10
  // TODO: would be nice to deep merge these instead
11
11
  // or maybe use allOf which is built into json-schema
12
12
  const BasicCreateActionOperationSchema = JSON.parse(
13
- JSON.stringify(BasicActionOperationSchema.schema)
13
+ JSON.stringify(BasicActionOperationSchema.schema),
14
14
  );
15
15
 
16
16
  BasicCreateActionOperationSchema.id = '/BasicCreateActionOperationSchema';
@@ -63,5 +63,5 @@ delete BasicCreateActionOperationSchema.required;
63
63
 
64
64
  module.exports = makeSchema(
65
65
  BasicCreateActionOperationSchema,
66
- BasicActionOperationSchema.dependencies.concat(BufferConfigSchema)
66
+ BasicActionOperationSchema.dependencies.concat(BufferConfigSchema),
67
67
  );
@@ -10,7 +10,7 @@ const RequestSchema = require('./RequestSchema');
10
10
  // TODO: would be nice to deep merge these instead
11
11
  // or maybe use allOf which is built into json-schema
12
12
  const BasicHookOperationSchema = JSON.parse(
13
- JSON.stringify(BasicOperationSchema.schema)
13
+ JSON.stringify(BasicOperationSchema.schema),
14
14
  );
15
15
 
16
16
  const hookTechnicallyRequired =
@@ -113,5 +113,5 @@ BasicHookOperationSchema.antiExamples = [
113
113
 
114
114
  module.exports = makeSchema(
115
115
  BasicHookOperationSchema,
116
- BasicOperationSchema.dependencies
116
+ BasicOperationSchema.dependencies,
117
117
  );
@@ -10,7 +10,7 @@ const RequestSchema = require('./RequestSchema');
10
10
  // TODO: would be nice to deep merge these instead
11
11
  // or maybe use allOf which is built into json-schema
12
12
  const BasicHookToPollOperationSchema = JSON.parse(
13
- JSON.stringify(BasicOperationSchema.schema)
13
+ JSON.stringify(BasicOperationSchema.schema),
14
14
  );
15
15
 
16
16
  BasicHookToPollOperationSchema.id = '/BasicHookToPollOperationSchema';
@@ -94,5 +94,5 @@ BasicHookToPollOperationSchema.antiExamples = [
94
94
 
95
95
  module.exports = makeSchema(
96
96
  BasicHookToPollOperationSchema,
97
- BasicOperationSchema.dependencies
97
+ BasicOperationSchema.dependencies,
98
98
  );
@@ -81,5 +81,13 @@ module.exports = makeSchema(
81
81
  ],
82
82
  additionalProperties: false,
83
83
  },
84
- [DynamicFieldsSchema, FunctionSchema, KeySchema, LockObjectSchema, RequestSchema, ResultsSchema, ThrottleObjectSchema]
84
+ [
85
+ DynamicFieldsSchema,
86
+ FunctionSchema,
87
+ KeySchema,
88
+ LockObjectSchema,
89
+ RequestSchema,
90
+ ResultsSchema,
91
+ ThrottleObjectSchema,
92
+ ],
85
93
  );
@@ -7,7 +7,7 @@ const BasicOperationSchema = require('./BasicOperationSchema');
7
7
  // TODO: would be nice to deep merge these instead
8
8
  // or maybe use allOf which is built into json-schema
9
9
  const BasicPollingOperationSchema = JSON.parse(
10
- JSON.stringify(BasicOperationSchema.schema)
10
+ JSON.stringify(BasicOperationSchema.schema),
11
11
  );
12
12
 
13
13
  BasicPollingOperationSchema.id = '/BasicPollingOperationSchema';
@@ -38,5 +38,5 @@ BasicPollingOperationSchema.properties = {
38
38
 
39
39
  module.exports = makeSchema(
40
40
  BasicPollingOperationSchema,
41
- BasicOperationSchema.dependencies
41
+ BasicOperationSchema.dependencies,
42
42
  );
@@ -68,5 +68,5 @@ module.exports = makeSchema(
68
68
  ],
69
69
  additionalProperties: false,
70
70
  },
71
- [KeySchema, BasicDisplaySchema, BasicActionOperationSchema]
71
+ [KeySchema, BasicDisplaySchema, BasicActionOperationSchema],
72
72
  );
@@ -65,5 +65,5 @@ module.exports = makeSchema(
65
65
  },
66
66
  ],
67
67
  },
68
- [BulkReadSchema]
68
+ [BulkReadSchema],
69
69
  );
@@ -104,5 +104,5 @@ module.exports = makeSchema(
104
104
  ],
105
105
  additionalProperties: false,
106
106
  },
107
- [BasicDisplaySchema, BasicCreateActionOperationSchema, KeySchema]
107
+ [BasicDisplaySchema, BasicCreateActionOperationSchema, KeySchema],
108
108
  );
@@ -75,5 +75,5 @@ module.exports = makeSchema(
75
75
  },
76
76
  ],
77
77
  },
78
- [CreateSchema]
78
+ [CreateSchema],
79
79
  );
@@ -32,5 +32,5 @@ module.exports = makeSchema(
32
32
  },
33
33
  ],
34
34
  },
35
- [FieldOrFunctionSchema]
35
+ [FieldOrFunctionSchema],
36
36
  );
@@ -17,7 +17,7 @@ module.exports = makeSchema({
17
17
  },
18
18
  sample: {
19
19
  description:
20
- "A legacy field that is no longer used by the editor, but it is still required for now and should match the value.",
20
+ 'A legacy field that is no longer used by the editor, but it is still required for now and should match the value.',
21
21
  type: 'string',
22
22
  minLength: 1,
23
23
  },
@@ -36,5 +36,5 @@ module.exports = makeSchema(
36
36
  },
37
37
  ],
38
38
  },
39
- [FieldChoiceWithLabelSchema]
39
+ [FieldChoiceWithLabelSchema],
40
40
  );
@@ -36,5 +36,5 @@ module.exports = makeSchema(
36
36
  },
37
37
  ],
38
38
  },
39
- [FieldSchema, FunctionSchema]
39
+ [FieldSchema, FunctionSchema],
40
40
  );
@@ -206,5 +206,5 @@ module.exports = makeSchema(
206
206
  ],
207
207
  additionalProperties: false,
208
208
  },
209
- [RefResourceSchema, FieldChoicesSchema, FieldMetaSchema]
209
+ [RefResourceSchema, FieldChoicesSchema, FieldMetaSchema],
210
210
  );
@@ -13,5 +13,5 @@ module.exports = makeSchema(
13
13
  examples: [[{ key: 'abc' }]],
14
14
  antiExamples: [{ example: {}, reason: 'Must be an array' }],
15
15
  },
16
- [FieldSchema]
16
+ [FieldSchema],
17
17
  );
@@ -38,5 +38,5 @@ module.exports = makeSchema(
38
38
  },
39
39
  ],
40
40
  },
41
- [FunctionRequireSchema, FunctionSourceSchema]
41
+ [FunctionRequireSchema, FunctionSourceSchema],
42
42
  );
@@ -25,5 +25,5 @@ module.exports = makeSchema(
25
25
  },
26
26
  ],
27
27
  },
28
- [FunctionSchema]
28
+ [FunctionSchema],
29
29
  );
@@ -31,5 +31,5 @@ module.exports = makeSchema(
31
31
  },
32
32
  ],
33
33
  },
34
- [FunctionSchema]
34
+ [FunctionSchema],
35
35
  );
@@ -37,5 +37,5 @@ module.exports = makeSchema(
37
37
  },
38
38
  ],
39
39
  },
40
- [FlatObjectSchema]
40
+ [FlatObjectSchema],
41
41
  );
@@ -110,5 +110,5 @@ module.exports = makeSchema(
110
110
  },
111
111
  ],
112
112
  },
113
- [FlatObjectSchema, FunctionSchema]
113
+ [FlatObjectSchema, FunctionSchema],
114
114
  );
@@ -63,5 +63,5 @@ module.exports = makeSchema(
63
63
  },
64
64
  ],
65
65
  },
66
- [BasicDisplaySchema, BasicActionOperationSchema]
66
+ [BasicDisplaySchema, BasicActionOperationSchema],
67
67
  );
@@ -70,5 +70,5 @@ module.exports = makeSchema(
70
70
  },
71
71
  ],
72
72
  },
73
- [BasicDisplaySchema, BasicOperationSchema]
73
+ [BasicDisplaySchema, BasicOperationSchema],
74
74
  );
@@ -68,5 +68,5 @@ module.exports = makeSchema(
68
68
  },
69
69
  ],
70
70
  },
71
- [BasicDisplaySchema, BasicHookOperationSchema]
71
+ [BasicDisplaySchema, BasicHookOperationSchema],
72
72
  );
@@ -72,5 +72,5 @@ module.exports = makeSchema(
72
72
  },
73
73
  ],
74
74
  },
75
- [BasicDisplaySchema, BasicPollingOperationSchema]
75
+ [BasicDisplaySchema, BasicPollingOperationSchema],
76
76
  );
@@ -63,5 +63,5 @@ module.exports = makeSchema(
63
63
  },
64
64
  ],
65
65
  },
66
- [BasicDisplaySchema, BasicActionOperationSchema]
66
+ [BasicDisplaySchema, BasicActionOperationSchema],
67
67
  );
@@ -164,5 +164,5 @@ module.exports = makeSchema(
164
164
  ResourceMethodCreateSchema,
165
165
  DynamicFieldsSchema,
166
166
  KeySchema,
167
- ]
167
+ ],
168
168
  );
@@ -53,5 +53,5 @@ module.exports = makeSchema(
53
53
  },
54
54
  additionalProperties: false,
55
55
  },
56
- [BasicDisplaySchema, BasicActionOperationSchema]
56
+ [BasicDisplaySchema, BasicActionOperationSchema],
57
57
  );
@@ -91,5 +91,5 @@ module.exports = makeSchema(
91
91
  },
92
92
  ],
93
93
  },
94
- [ResourceSchema]
94
+ [ResourceSchema],
95
95
  );
@@ -10,5 +10,5 @@ module.exports = makeSchema(
10
10
  id: '/SearchAndCreatesSchema',
11
11
  description: 'Alias for /SearchOrCreatesSchema',
12
12
  },
13
- [SearchOrCreatesSchema]
13
+ [SearchOrCreatesSchema],
14
14
  );
@@ -134,5 +134,5 @@ module.exports = makeSchema(
134
134
  },
135
135
  ],
136
136
  },
137
- [BasicDisplaySchema, KeySchema, FlatObjectSchema]
137
+ [BasicDisplaySchema, KeySchema, FlatObjectSchema],
138
138
  );
@@ -69,5 +69,5 @@ module.exports = makeSchema(
69
69
  },
70
70
  ],
71
71
  },
72
- [SearchOrCreateSchema]
72
+ [SearchOrCreateSchema],
73
73
  );
@@ -80,5 +80,5 @@ module.exports = makeSchema(
80
80
  },
81
81
  ],
82
82
  },
83
- [BasicDisplaySchema, BasicActionOperationSchema, KeySchema]
83
+ [BasicDisplaySchema, BasicActionOperationSchema, KeySchema],
84
84
  );
@@ -51,5 +51,5 @@ module.exports = makeSchema(
51
51
  },
52
52
  ],
53
53
  },
54
- [SearchSchema]
54
+ [SearchSchema],
55
55
  );
@@ -127,5 +127,5 @@ module.exports = makeSchema(
127
127
  ],
128
128
  additionalProperties: false,
129
129
  },
130
- [ThrottleOverrideObjectSchema]
130
+ [ThrottleOverrideObjectSchema],
131
131
  );
@@ -92,5 +92,5 @@ module.exports = makeSchema(
92
92
  BasicPollingOperationSchema,
93
93
  BasicHookOperationSchema,
94
94
  BasicHookToPollOperationSchema,
95
- ]
95
+ ],
96
96
  );
@@ -57,5 +57,5 @@ module.exports = makeSchema(
57
57
  },
58
58
  ],
59
59
  },
60
- [TriggerSchema]
60
+ [TriggerSchema],
61
61
  );
@@ -59,7 +59,7 @@ const formatExample = (example) => {
59
59
  return `* ${quoteOrNa(
60
60
  util.inspect(ex, { depth: null, breakLength: BREAK_LENGTH }),
61
61
  true,
62
- ' '
62
+ ' ',
63
63
  )}`.replace(/\s+\n/gm, '\n');
64
64
  };
65
65
 
@@ -205,7 +205,7 @@ const buildDocs = (InitSchema) => {
205
205
  # \`zapier-platform-schema\` Generated Documentation
206
206
 
207
207
  This is automatically generated by the \`npm run docs\` command in \`zapier-platform-schema\` version ${quoteOrNa(
208
- packageJson.version
208
+ packageJson.version,
209
209
  )}.
210
210
 
211
211
  -----
@@ -12,7 +12,7 @@ const exportSchema = (InitSchema) => {
12
12
  exportedSchema.schemas[Schema.id.replace('/', '')] = _.omit(
13
13
  Schema.schema,
14
14
  'examples',
15
- 'antiExamples'
15
+ 'antiExamples',
16
16
  );
17
17
  Schema.dependencies.map(addAndRecurse);
18
18
  };
@@ -45,7 +45,7 @@ const processBaseError = (err, path) => {
45
45
  // the subschemas have a type property
46
46
  err.message = err.message.replace(
47
47
  subschema,
48
- err.schema[err.name][idx].type || 'unknown'
48
+ err.schema[err.name][idx].type || 'unknown',
49
49
  );
50
50
  }
51
51
  });
@@ -105,8 +105,8 @@ const cleanError = (validationError, path, validator, definition) => {
105
105
  e,
106
106
  makePath(path, validationError.property),
107
107
  validator,
108
- definition
109
- )
108
+ definition,
109
+ ),
110
110
  );
111
111
  });
112
112
 
@@ -131,10 +131,10 @@ const makeValidator = (mainSchema, subSchemas) => {
131
131
  validate: (definition) => {
132
132
  const results = v.validate(definition, mainSchema);
133
133
  const allErrors = results.errors.concat(
134
- functionalConstraints.run(definition, mainSchema)
134
+ functionalConstraints.run(definition, mainSchema),
135
135
  );
136
136
  const cleanedErrors = flattenDeep(
137
- allErrors.map((e) => cleanError(e, '', v, definition))
137
+ allErrors.map((e) => cleanError(e, '', v, definition)),
138
138
  );
139
139
 
140
140
  results.errors = cleanedErrors.map((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zapier-platform-schema",
3
- "version": "15.19.0",
3
+ "version": "16.0.0",
4
4
  "description": "Schema definition for CLI apps in the Zapier Developer Platform.",
5
5
  "repository": "zapier/zapier-platform",
6
6
  "homepage": "https://platform.zapier.com/",