zapier-platform-schema 12.2.1 → 14.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.
- package/CHANGELOG.md +1 -1
- package/exported-schema.json +9 -5
- package/lib/functional-constraints/index.js +0 -1
- package/lib/functional-constraints/searchOrCreateKeys.js +11 -5
- package/lib/schemas/AppFlagsSchema.js +1 -1
- package/lib/schemas/AuthenticationOAuth2ConfigSchema.js +5 -0
- package/lib/schemas/BasicHookOperationSchema.js +2 -2
- package/lib/utils/links.js +4 -4
- package/package.json +4 -4
- package/lib/functional-constraints/searchAndCreatesAlias.js +0 -24
package/CHANGELOG.md
CHANGED
package/exported-schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "14.0.0",
|
|
3
3
|
"schemas": {
|
|
4
4
|
"AppSchema": {
|
|
5
5
|
"id": "/AppSchema",
|
|
@@ -550,6 +550,10 @@
|
|
|
550
550
|
"autoRefresh": {
|
|
551
551
|
"description": "Should Zapier invoke `refreshAccessToken` when we receive an error for a 401 response?",
|
|
552
552
|
"type": "boolean"
|
|
553
|
+
},
|
|
554
|
+
"enablePkce": {
|
|
555
|
+
"description": "Should Zapier use PKCE for OAuth2?",
|
|
556
|
+
"type": "boolean"
|
|
553
557
|
}
|
|
554
558
|
},
|
|
555
559
|
"additionalProperties": false
|
|
@@ -725,7 +729,7 @@
|
|
|
725
729
|
"$ref": "/FunctionSchema"
|
|
726
730
|
},
|
|
727
731
|
"performList": {
|
|
728
|
-
"description": "
|
|
732
|
+
"description": "Fetch a list of items on demand during testing instead of waiting for a hook. You can also consider resources and their built-in hook/list methods. Note: this is required for public apps to ensure the best UX for the end-user. For private apps, this is strongly recommended for testing REST Hooks. Otherwise, you can ignore warnings about this property with the `--without-style` flag during `zapier push`.",
|
|
729
733
|
"oneOf": [
|
|
730
734
|
{
|
|
731
735
|
"$ref": "/RequestSchema"
|
|
@@ -746,7 +750,7 @@
|
|
|
746
750
|
"type": "boolean"
|
|
747
751
|
},
|
|
748
752
|
"performSubscribe": {
|
|
749
|
-
"description": "Takes a URL and any necessary data from the user and subscribes. Note: this is required for public apps to ensure the best UX for the end-user. For private apps, you can ignore warnings about this property with the `--without-style` flag during `zapier push`.",
|
|
753
|
+
"description": "Takes a URL and any necessary data from the user and subscribes. Note: this is required for public apps to ensure the best UX for the end-user. For private apps, this is strongly recommended for testing REST Hooks. Otherwise, you can ignore warnings about this property with the `--without-style` flag during `zapier push`.",
|
|
750
754
|
"oneOf": [
|
|
751
755
|
{
|
|
752
756
|
"$ref": "/RequestSchema"
|
|
@@ -763,7 +767,7 @@
|
|
|
763
767
|
}
|
|
764
768
|
},
|
|
765
769
|
"performUnsubscribe": {
|
|
766
|
-
"description": "Takes a URL and data from a previous subscribe call and unsubscribes. Note: this is required for public apps to ensure the best UX for the end-user. For private apps, you can ignore warnings about this property with the `--without-style` flag during `zapier push`.",
|
|
770
|
+
"description": "Takes a URL and data from a previous subscribe call and unsubscribes. Note: this is required for public apps to ensure the best UX for the end-user. For private apps, this is strongly recommended for testing REST Hooks. Otherwise, you can ignore warnings about this property with the `--without-style` flag during `zapier push`.",
|
|
767
771
|
"oneOf": [
|
|
768
772
|
{
|
|
769
773
|
"$ref": "/RequestSchema"
|
|
@@ -1524,7 +1528,7 @@
|
|
|
1524
1528
|
"type": "boolean"
|
|
1525
1529
|
},
|
|
1526
1530
|
"skipThrowForStatus": {
|
|
1527
|
-
"description": "Starting in `core` version `10.0.0`, `response.throwForStatus()` was called by default. We introduced a per-request way to opt-out of this behavior. This flag takes that a step further and controls that behavior integration-wide **for requests made using `z.request()`**. Unless they specify otherwise (per-request, or via middleware), [Shorthand requests](https://github.com/zapier/zapier-platform/blob/
|
|
1531
|
+
"description": "Starting in `core` version `10.0.0`, `response.throwForStatus()` was called by default. We introduced a per-request way to opt-out of this behavior. This flag takes that a step further and controls that behavior integration-wide **for requests made using `z.request()`**. Unless they specify otherwise (per-request, or via middleware), [Shorthand requests](https://github.com/zapier/zapier-platform/blob/main/packages/cli/README.md#shorthand-http-requests) _always_ call `throwForStatus()`. `z.request()` calls can also ignore this flag if they set `skipThrowForStatus` directly",
|
|
1528
1532
|
"type": "boolean"
|
|
1529
1533
|
}
|
|
1530
1534
|
},
|
|
@@ -21,11 +21,7 @@ const getSearchOutputSampleKeys = (definition, searchKey) => {
|
|
|
21
21
|
return Object.keys(searchOutputSampleFields);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
// searchAndCreates is an alias for searchOrCreates. Another functional constraint makes sure only one of them is defined.
|
|
26
|
-
const searchCreatesKey = definition.searchAndCreates
|
|
27
|
-
? 'searchAndCreates'
|
|
28
|
-
: 'searchOrCreates';
|
|
24
|
+
const validateSearchCreateKeys = (definition, searchCreatesKey) => {
|
|
29
25
|
const searchCreates = definition[searchCreatesKey];
|
|
30
26
|
|
|
31
27
|
if (!searchCreates) {
|
|
@@ -254,4 +250,14 @@ const validateSearchOrCreateKeys = (definition) => {
|
|
|
254
250
|
return errors;
|
|
255
251
|
};
|
|
256
252
|
|
|
253
|
+
const validateSearchOrCreateKeys = (definition) => {
|
|
254
|
+
// searchAndCreates is an alias for searchOrCreates. They are the same, but
|
|
255
|
+
// you can define both searchAndCreates and searchOrCreates to avoid search
|
|
256
|
+
// key collision.
|
|
257
|
+
return [
|
|
258
|
+
...validateSearchCreateKeys(definition, 'searchOrCreates'),
|
|
259
|
+
...validateSearchCreateKeys(definition, 'searchAndCreates'),
|
|
260
|
+
];
|
|
261
|
+
};
|
|
262
|
+
|
|
257
263
|
module.exports = validateSearchOrCreateKeys;
|
|
@@ -14,7 +14,7 @@ module.exports = makeSchema({
|
|
|
14
14
|
},
|
|
15
15
|
skipThrowForStatus: {
|
|
16
16
|
description:
|
|
17
|
-
'Starting in `core` version `10.0.0`, `response.throwForStatus()` was called by default. We introduced a per-request way to opt-out of this behavior. This flag takes that a step further and controls that behavior integration-wide **for requests made using `z.request()`**. Unless they specify otherwise (per-request, or via middleware), [Shorthand requests](https://github.com/zapier/zapier-platform/blob/
|
|
17
|
+
'Starting in `core` version `10.0.0`, `response.throwForStatus()` was called by default. We introduced a per-request way to opt-out of this behavior. This flag takes that a step further and controls that behavior integration-wide **for requests made using `z.request()`**. Unless they specify otherwise (per-request, or via middleware), [Shorthand requests](https://github.com/zapier/zapier-platform/blob/main/packages/cli/README.md#shorthand-http-requests) _always_ call `throwForStatus()`. `z.request()` calls can also ignore this flag if they set `skipThrowForStatus` directly',
|
|
18
18
|
type: 'boolean',
|
|
19
19
|
},
|
|
20
20
|
},
|
|
@@ -44,6 +44,10 @@ module.exports = makeSchema(
|
|
|
44
44
|
'Should Zapier invoke `refreshAccessToken` when we receive an error for a 401 response?',
|
|
45
45
|
type: 'boolean',
|
|
46
46
|
},
|
|
47
|
+
enablePkce: {
|
|
48
|
+
description: 'Should Zapier use PKCE for OAuth2?',
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
},
|
|
47
51
|
},
|
|
48
52
|
additionalProperties: false,
|
|
49
53
|
examples: [
|
|
@@ -58,6 +62,7 @@ module.exports = makeSchema(
|
|
|
58
62
|
codeParam: 'unique_code',
|
|
59
63
|
scope: 'read/write',
|
|
60
64
|
autoRefresh: true,
|
|
65
|
+
enablePkce: true,
|
|
61
66
|
},
|
|
62
67
|
],
|
|
63
68
|
antiExamples: [
|
|
@@ -14,7 +14,7 @@ const BasicHookOperationSchema = JSON.parse(
|
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
const hookTechnicallyRequired =
|
|
17
|
-
'Note: this is required for public apps to ensure the best UX for the end-user. For private apps, you can ignore warnings about this property with the `--without-style` flag during `zapier push`.';
|
|
17
|
+
'Note: this is required for public apps to ensure the best UX for the end-user. For private apps, this is strongly recommended for testing REST Hooks. Otherwise, you can ignore warnings about this property with the `--without-style` flag during `zapier push`.';
|
|
18
18
|
|
|
19
19
|
BasicHookOperationSchema.id = '/BasicHookOperationSchema';
|
|
20
20
|
|
|
@@ -41,7 +41,7 @@ BasicHookOperationSchema.properties = {
|
|
|
41
41
|
},
|
|
42
42
|
performList: {
|
|
43
43
|
description:
|
|
44
|
-
'
|
|
44
|
+
'Fetch a list of items on demand during testing instead of waiting for a hook. You can also consider resources and their built-in hook/list methods. ' +
|
|
45
45
|
hookTechnicallyRequired,
|
|
46
46
|
oneOf: [{ $ref: RequestSchema.id }, { $ref: FunctionSchema.id }],
|
|
47
47
|
docAnnotation: {
|
package/lib/utils/links.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zapier-platform-schema",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.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/",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
16
|
"preversion": "git pull && yarn test && yarn build",
|
|
17
|
-
"test": "mocha -t
|
|
18
|
-
"smoke-test": "mocha -t
|
|
19
|
-
"test:debug": "mocha
|
|
17
|
+
"test": "mocha -t 10s --recursive test --exit",
|
|
18
|
+
"smoke-test": "mocha -t 10s --recursive smoke-test --exit",
|
|
19
|
+
"test:debug": "mocha --recursive --inspect-brk test",
|
|
20
20
|
"lint": "eslint lib",
|
|
21
21
|
"lint:fix": "eslint --fix lib",
|
|
22
22
|
"coverage": "istanbul cover _mocha -- --recursive",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const jsonschema = require('jsonschema');
|
|
4
|
-
|
|
5
|
-
const searchAndCreatesAliasConstraint = (definition) => {
|
|
6
|
-
// Ensure that 'searchOrCreates' and 'searchAndCreates' don't appear together, since one is an alias of the other
|
|
7
|
-
const errors = [];
|
|
8
|
-
if (definition.searchOrCreates && definition.searchAndCreates) {
|
|
9
|
-
errors.push(
|
|
10
|
-
new jsonschema.ValidationError(
|
|
11
|
-
`should not be used at the same time as its alias, searchAndCreates`,
|
|
12
|
-
definition,
|
|
13
|
-
`/AppSchema`,
|
|
14
|
-
`instance.searchOrCreates`,
|
|
15
|
-
'invalid',
|
|
16
|
-
'key'
|
|
17
|
-
)
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return errors;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
module.exports = searchAndCreatesAliasConstraint;
|