Skip to content

Commit

Permalink
Merge pull request #399 from zapier/TN-169-hook-can-paginate
Browse files Browse the repository at this point in the history
feat(schema) TN-169 Adds canPaginate to BasicHookOperationSchema
  • Loading branch information
cyberwitch authored Jul 22, 2021
2 parents 50ccdf5 + ac46562 commit fda2d05
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2666,7 +2666,7 @@ describe('triggers', () => {

### Using the `z` Object in Tests

Introduced in `[email protected]`, `appTester` can now run arbitrary functions that are not in your app definition:
Introduced in `[email protected]`, `appTester` can now run arbitrary functions:

```js
/* globals describe, expect, test */
Expand Down
3 changes: 2 additions & 1 deletion packages/schema/docs/build/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ Key | Required | Type | Description
`resource` | no | [/KeySchema](#keyschema) | Optionally reference and extends a resource. Allows Zapier to automatically tie together samples, lists and hooks, greatly improving the UX. EG: if you had another trigger reusing a resource but filtering the results.
`perform` | **yes** | [/FunctionSchema](#functionschema) | A function that processes the inbound webhook request.
`performList` | **yes** (with exceptions, see description) | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | Can get "live" data on demand instead of waiting for a hook. If you find yourself reaching for this - 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, you can ignore warnings about this property with the `--without-style` flag during `zapier push`.
`canPaginate` | no | `boolean` | Does this endpoint support pagination via temporary cursor storage?
`performSubscribe` | **yes** (with exceptions, see description) | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | 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`.
`performUnsubscribe` | **yes** (with exceptions, see description) | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | 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`.
`inputFields` | no | [/DynamicFieldsSchema](#dynamicfieldsschema) | What should the form a user sees and configures look like?
Expand Down Expand Up @@ -545,7 +546,7 @@ Key | Required | Type | Description
`type` | no | `string` in (`'polling'`) | Clarify how this operation works (polling == pull or hook == push).
`resource` | no | [/KeySchema](#keyschema) | Optionally reference and extends a resource. Allows Zapier to automatically tie together samples, lists and hooks, greatly improving the UX. EG: if you had another trigger reusing a resource but filtering the results.
`perform` | **yes** | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | How will Zapier get the data? This can be a function like `(z) => [{id: 123}]` or a request like `{url: 'http...'}`.
`canPaginate` | no | `boolean` | Does this endpoint support a page offset?
`canPaginate` | no | `boolean` | Does this endpoint support pagination via temporary cursor storage?
`inputFields` | no | [/DynamicFieldsSchema](#dynamicfieldsschema) | What should the form a user sees and configures look like?
`outputFields` | no | [/DynamicFieldsSchema](#dynamicfieldsschema) | What fields of data will this return? Will use resource outputFields if missing, will also use sample if available.
`sample` | **yes** (with exceptions, see description) | `object` | What does a sample of data look like? Will use resource sample if missing. Requirement waived if `display.hidden` is true or if this belongs to a resource that has a top-level sample
Expand Down
6 changes: 5 additions & 1 deletion packages/schema/exported-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,10 @@
}
}
},
"canPaginate": {
"description": "Does this endpoint support pagination via temporary cursor storage?",
"type": "boolean"
},
"performSubscribe": {
"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`.",
"oneOf": [
Expand Down Expand Up @@ -816,7 +820,7 @@
]
},
"canPaginate": {
"description": "Does this endpoint support a page offset?",
"description": "Does this endpoint support pagination via temporary cursor storage?",
"type": "boolean"
},
"inputFields": {
Expand Down
5 changes: 5 additions & 0 deletions packages/schema/lib/schemas/BasicHookOperationSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ BasicHookOperationSchema.properties = {
},
},
},
canPaginate: {
description:
'Does this endpoint support pagination via temporary cursor storage?',
type: 'boolean',
},
performSubscribe: {
description:
'Takes a URL and any necessary data from the user and subscribes. ' +
Expand Down
3 changes: 2 additions & 1 deletion packages/schema/lib/schemas/BasicPollingOperationSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ BasicPollingOperationSchema.properties = {
resource: BasicPollingOperationSchema.properties.resource,
perform: BasicPollingOperationSchema.properties.perform,
canPaginate: {
description: 'Does this endpoint support a page offset?',
description:
'Does this endpoint support pagination via temporary cursor storage?',
type: 'boolean',
},
inputFields: BasicPollingOperationSchema.properties.inputFields,
Expand Down

0 comments on commit fda2d05

Please sign in to comment.