diff --git a/docs/build/schema.md b/docs/build/schema.md index e34016b..7c60c89 100644 --- a/docs/build/schema.md +++ b/docs/build/schema.md @@ -323,9 +323,9 @@ Key | Required | Type | Description `type` | **yes** (with exceptions, see description) | `string` in (`'hook'`) | Must be explicitly set to `"hook"` unless this hook is defined as part of a resource, in which case it's optional. `resource` | no | [/RefResourceSchema](#refresourceschema) | 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` | no | 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. -`performSubscribe` | no | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | Takes a URL and any necessary data from the user and subscribes. -`performUnsubscribe` | no | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | Takes a URL and data from a previous subscribe call and unsubscribes. +`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`. +`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? `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 diff --git a/exported-schema.json b/exported-schema.json index 30918de..3b79239 100644 --- a/exported-schema.json +++ b/exported-schema.json @@ -662,7 +662,7 @@ }, "performList": { "description": - "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.", + "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`.", "oneOf": [ { "$ref": "/RequestSchema" @@ -670,11 +670,17 @@ { "$ref": "/FunctionSchema" } - ] + ], + "docAnnotation": { + "required": { + "type": "replace", + "value": "**yes** (with exceptions, see description)" + } + } }, "performSubscribe": { "description": - "Takes a URL and any necessary data from the user and subscribes.", + "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": [ { "$ref": "/RequestSchema" @@ -682,11 +688,17 @@ { "$ref": "/FunctionSchema" } - ] + ], + "docAnnotation": { + "required": { + "type": "replace", + "value": "**yes** (with exceptions, see description)" + } + } }, "performUnsubscribe": { "description": - "Takes a URL and data from a previous subscribe call and unsubscribes.", + "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`.", "oneOf": [ { "$ref": "/RequestSchema" @@ -694,7 +706,13 @@ { "$ref": "/FunctionSchema" } - ] + ], + "docAnnotation": { + "required": { + "type": "replace", + "value": "**yes** (with exceptions, see description)" + } + } }, "inputFields": { "description": diff --git a/lib/schemas/BasicHookOperationSchema.js b/lib/schemas/BasicHookOperationSchema.js index 21670f4..c13fbbb 100644 --- a/lib/schemas/BasicHookOperationSchema.js +++ b/lib/schemas/BasicHookOperationSchema.js @@ -12,6 +12,9 @@ const BasicHookOperationSchema = JSON.parse( JSON.stringify(BasicOperationSchema.schema) ); +const hookTechnicallyRequired = + '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`.'; + BasicHookOperationSchema.id = '/BasicHookOperationSchema'; BasicHookOperationSchema.description = @@ -37,18 +40,39 @@ BasicHookOperationSchema.properties = { }, performList: { description: - '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.', - oneOf: [{ $ref: RequestSchema.id }, { $ref: FunctionSchema.id }] + '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. ' + + hookTechnicallyRequired, + oneOf: [{ $ref: RequestSchema.id }, { $ref: FunctionSchema.id }], + docAnnotation: { + required: { + type: 'replace', + value: '**yes** (with exceptions, see description)' + } + } }, performSubscribe: { description: - 'Takes a URL and any necessary data from the user and subscribes.', - oneOf: [{ $ref: RequestSchema.id }, { $ref: FunctionSchema.id }] + 'Takes a URL and any necessary data from the user and subscribes. ' + + hookTechnicallyRequired, + oneOf: [{ $ref: RequestSchema.id }, { $ref: FunctionSchema.id }], + docAnnotation: { + required: { + type: 'replace', + value: '**yes** (with exceptions, see description)' + } + } }, performUnsubscribe: { description: - 'Takes a URL and data from a previous subscribe call and unsubscribes.', - oneOf: [{ $ref: RequestSchema.id }, { $ref: FunctionSchema.id }] + 'Takes a URL and data from a previous subscribe call and unsubscribes. ' + + hookTechnicallyRequired, + oneOf: [{ $ref: RequestSchema.id }, { $ref: FunctionSchema.id }], + docAnnotation: { + required: { + type: 'replace', + value: '**yes** (with exceptions, see description)' + } + } }, inputFields: BasicHookOperationSchema.properties.inputFields, outputFields: BasicHookOperationSchema.properties.outputFields, diff --git a/package-lock.json b/package-lock.json index f8c5363..7ebfadf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "zapier-platform-schema", - "version": "7.3.0", + "version": "7.4.0", "lockfileVersion": 1, "requires": true, "dependencies": {