From fb5cd7203cf5e88812629f69bf1242e4fa8d13a8 Mon Sep 17 00:00:00 2001 From: SZ-CHENG HUANG Date: Fri, 17 May 2024 13:40:20 +0800 Subject: [PATCH] Redirect pages site. --- docs/build/schema.md | 1439 +----------------------------------------- 1 file changed, 6 insertions(+), 1433 deletions(-) diff --git a/docs/build/schema.md b/docs/build/schema.md index 27050c8..7d0790f 100644 --- a/docs/build/schema.md +++ b/docs/build/schema.md @@ -1,1433 +1,6 @@ - -# `zapier-platform-schema` Generated Documentation - -This is automatically generated by the `npm run docs` command in `zapier-platform-schema` version `8.2.1`. - ------ - -## Index - - - -* [/AppFlagsSchema](#appflagsschema) -* [/AppSchema](#appschema) -* [/AuthenticationBasicConfigSchema](#authenticationbasicconfigschema) -* [/AuthenticationCustomConfigSchema](#authenticationcustomconfigschema) -* [/AuthenticationDigestConfigSchema](#authenticationdigestconfigschema) -* [/AuthenticationOAuth1ConfigSchema](#authenticationoauth1configschema) -* [/AuthenticationOAuth2ConfigSchema](#authenticationoauth2configschema) -* [/AuthenticationSchema](#authenticationschema) -* [/AuthenticationSessionConfigSchema](#authenticationsessionconfigschema) -* [/BasicActionOperationSchema](#basicactionoperationschema) -* [/BasicCreateActionOperationSchema](#basiccreateactionoperationschema) -* [/BasicDisplaySchema](#basicdisplayschema) -* [/BasicHookOperationSchema](#basichookoperationschema) -* [/BasicOperationSchema](#basicoperationschema) -* [/BasicPollingOperationSchema](#basicpollingoperationschema) -* [/CreateSchema](#createschema) -* [/CreatesSchema](#createsschema) -* [/DynamicFieldsSchema](#dynamicfieldsschema) -* [/FieldChoiceWithLabelSchema](#fieldchoicewithlabelschema) -* [/FieldChoicesSchema](#fieldchoicesschema) -* [/FieldOrFunctionSchema](#fieldorfunctionschema) -* [/FieldSchema](#fieldschema) -* [/FieldsSchema](#fieldsschema) -* [/FlatObjectSchema](#flatobjectschema) -* [/FunctionRequireSchema](#functionrequireschema) -* [/FunctionSchema](#functionschema) -* [/FunctionSourceSchema](#functionsourceschema) -* [/HydratorsSchema](#hydratorsschema) -* [/KeySchema](#keyschema) -* [/MiddlewaresSchema](#middlewaresschema) -* [/RedirectRequestSchema](#redirectrequestschema) -* [/RefResourceSchema](#refresourceschema) -* [/RequestSchema](#requestschema) -* [/ResourceMethodCreateSchema](#resourcemethodcreateschema) -* [/ResourceMethodGetSchema](#resourcemethodgetschema) -* [/ResourceMethodHookSchema](#resourcemethodhookschema) -* [/ResourceMethodListSchema](#resourcemethodlistschema) -* [/ResourceMethodSearchSchema](#resourcemethodsearchschema) -* [/ResourceSchema](#resourceschema) -* [/ResourcesSchema](#resourcesschema) -* [/ResultsSchema](#resultsschema) -* [/SearchOrCreateSchema](#searchorcreateschema) -* [/SearchOrCreatesSchema](#searchorcreatesschema) -* [/SearchSchema](#searchschema) -* [/SearchesSchema](#searchesschema) -* [/TriggerSchema](#triggerschema) -* [/TriggersSchema](#triggersschema) -* [/VersionSchema](#versionschema) - - - ------ - -## /AppFlagsSchema - -Codifies high-level options for your app. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/AppFlagsSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/AppFlagsSchema.js) - -#### Examples - -* `{ skipHttpPatch: true }` -* `{ skipHttpPatch: false }` -* `{}` - -#### Anti-Examples - -* `{ blah: true }` -* `{ skipHttpPatch: 'yes' }` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`skipHttpPatch` | no | `boolean` | By default, Zapier patches the core `http` module so that all requests (including those from 3rd-party SDKs) can be logged. Set this to true if you're seeing issues using an SDK (such as AWS). - ------ - -## /AppSchema - -Represents a full app. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/AppSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/AppSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`version` | **yes** | [/VersionSchema](#versionschema) | A version identifier for your code. -`platformVersion` | **yes** | [/VersionSchema](#versionschema) | A version identifier for the Zapier execution environment. -`beforeApp` | no | [/MiddlewaresSchema](#middlewaresschema) | EXPERIMENTAL: Before the perform method is called on your app, you can modify the execution context. -`afterApp` | no | [/MiddlewaresSchema](#middlewaresschema) | EXPERIMENTAL: After the perform method is called on your app, you can modify the response. -`authentication` | no | [/AuthenticationSchema](#authenticationschema) | Choose what scheme your API uses for authentication. -`requestTemplate` | no | [/RequestSchema](#requestschema) | Define a request mixin, great for setting custom headers, content-types, etc. -`beforeRequest` | no | [/MiddlewaresSchema](#middlewaresschema) | Before an HTTP request is sent via our `z.request()` client, you can modify it. -`afterResponse` | no | [/MiddlewaresSchema](#middlewaresschema) | After an HTTP response is recieved via our `z.request()` client, you can modify it. -`hydrators` | no | [/HydratorsSchema](#hydratorsschema) | An optional bank of named functions that you can use in `z.hydrate('someName')` to lazily load data. -`resources` | no | [/ResourcesSchema](#resourcesschema) | All the resources for your app. Zapier will take these and generate the relevent triggers/searches/creates automatically. -`triggers` | no | [/TriggersSchema](#triggersschema) | All the triggers for your app. You can add your own here, or Zapier will automatically register any from the list/hook methods on your resources. -`searches` | no | [/SearchesSchema](#searchesschema) | All the searches for your app. You can add your own here, or Zapier will automatically register any from the search method on your resources. -`creates` | no | [/CreatesSchema](#createsschema) | All the creates for your app. You can add your own here, or Zapier will automatically register any from the create method on your resources. -`searchOrCreates` | no | [/SearchOrCreatesSchema](#searchorcreatesschema) | All the search-or-create combos for your app. You can create your own here, or Zapier will automatically register any from resources that define a search, a create, and a get (or define a searchOrCreate directly). Register non-resource search-or-creates here as well. -`flags` | no | [/AppFlagsSchema](#appflagsschema) | Top-level app options - ------ - -## /AuthenticationBasicConfigSchema - -Config for Basic Authentication. No extra properties are required to setup Basic Auth, so you can leave this empty if your app uses Basic Auth. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/AuthenticationBasicConfigSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/AuthenticationBasicConfigSchema.js) - ------ - -## /AuthenticationCustomConfigSchema - -Config for custom authentication (like API keys). No extra properties are required to setup this auth type, so you can leave this empty if your app uses a custom auth method. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/AuthenticationCustomConfigSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/AuthenticationCustomConfigSchema.js) - ------ - -## /AuthenticationDigestConfigSchema - -Config for Digest Authentication. No extra properties are required to setup Digest Auth, so you can leave this empty if your app uses Digets Auth. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/AuthenticationDigestConfigSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/AuthenticationDigestConfigSchema.js) - ------ - -## /AuthenticationOAuth1ConfigSchema - -Config for OAuth1 authentication. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/AuthenticationOAuth1ConfigSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/AuthenticationOAuth1ConfigSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`getRequestToken` | **yes** | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | Define where Zapier will acquire a request token which is used for the rest of the three legged authentication process. -`authorizeUrl` | **yes** | oneOf([/RedirectRequestSchema](#redirectrequestschema), [/FunctionSchema](#functionschema)) | Define where Zapier will redirect the user to authorize our app. Typically, you should append an `oauth_token` querystring parameter to the request. -`getAccessToken` | **yes** | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | Define how Zapier fetches an access token from the API - ------ - -## /AuthenticationOAuth2ConfigSchema - -Config for OAuth2 authentication. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/AuthenticationOAuth2ConfigSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/AuthenticationOAuth2ConfigSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`authorizeUrl` | **yes** | oneOf([/RedirectRequestSchema](#redirectrequestschema), [/FunctionSchema](#functionschema)) | Define where Zapier will redirect the user to authorize our app. Note: we append the redirect URL and state parameters to return value of this function. -`getAccessToken` | **yes** | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | Define how Zapier fetches an access token from the API -`refreshAccessToken` | no | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | Define how Zapier will refresh the access token from the API -`scope` | no | `string` | What scope should Zapier request? -`autoRefresh` | no | `boolean` | Should Zapier include a pre-built afterResponse middleware that invokes `refreshAccessToken` when we receive a 401 response? - ------ - -## /AuthenticationSchema - -Represents authentication schemes. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/AuthenticationSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/AuthenticationSchema.js) - -#### Examples - -* `{ type: 'basic', test: '$func$2$f$' }` -* `{ type: 'custom', test: '$func$2$f$', fields: [ { key: 'abc' } ] }` -* `{ type: 'custom', test: '$func$2$f$', connectionLabel: '{{bundle.inputData.abc}}' }` -* `{ type: 'custom', test: '$func$2$f$', connectionLabel: '$func$2$f$' }` -* `{ type: 'custom', test: '$func$2$f$', connectionLabel: { url: 'abc' } }` - -#### Anti-Examples - -* `{}` -* `'$func$2$f$'` -* `{ type: 'unknown', test: '$func$2$f$' }` -* `{ type: 'custom', test: '$func$2$f$', fields: '$func$2$f$' }` -* `{ type: 'custom', test: '$func$2$f$', fields: [ { key: 'abc' }, '$func$2$f$' ] }` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`type` | **yes** | `string` in (`'basic'`, `'custom'`, `'digest'`, `'oauth1'`, `'oauth2'`, `'session'`) | Choose which scheme you want to use. -`test` | **yes** | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | A function or request that confirms the authentication is working. -`fields` | no | [/FieldsSchema](#fieldsschema) | Fields you can request from the user before they connect your app to Zapier. -`connectionLabel` | no | anyOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema), `string`) | A string with variables, function, or request that returns the connection label for the authenticated user. -`basicConfig` | no | [/AuthenticationBasicConfigSchema](#authenticationbasicconfigschema) | _No description given._ -`customConfig` | no | [/AuthenticationCustomConfigSchema](#authenticationcustomconfigschema) | _No description given._ -`digestConfig` | no | [/AuthenticationDigestConfigSchema](#authenticationdigestconfigschema) | _No description given._ -`oauth1Config` | no | [/AuthenticationOAuth1ConfigSchema](#authenticationoauth1configschema) | _No description given._ -`oauth2Config` | no | [/AuthenticationOAuth2ConfigSchema](#authenticationoauth2configschema) | _No description given._ -`sessionConfig` | no | [/AuthenticationSessionConfigSchema](#authenticationsessionconfigschema) | _No description given._ - ------ - -## /AuthenticationSessionConfigSchema - -Config for session authentication. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/AuthenticationSessionConfigSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/AuthenticationSessionConfigSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`perform` | **yes** | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | Define how Zapier fetches the additional authData needed to make API calls. - ------ - -## /BasicActionOperationSchema - -Represents the fundamental mechanics of a search/create. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/BasicActionOperationSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/BasicActionOperationSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`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** | 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...'}`. -`performResume` | no | [/FunctionSchema](#functionschema) | A function that parses data from a perform + callback to resume this action. For use with callback semantics -`performGet` | no | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | How will Zapier get a single record? If you find yourself reaching for this - consider resources and their built-in get methods. -`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 - ------ - -## /BasicCreateActionOperationSchema - -Represents the fundamental mechanics of a create. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/BasicCreateActionOperationSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/BasicCreateActionOperationSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`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** | 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...'}`. -`performResume` | no | [/FunctionSchema](#functionschema) | A function that parses data from a perform + callback to resume this action. For use with callback semantics -`performGet` | no | oneOf([/RequestSchema](#requestschema), [/FunctionSchema](#functionschema)) | How will Zapier get a single record? If you find yourself reaching for this - consider resources and their built-in get methods. -`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 -`shouldLock` | no | `boolean` | Should this action be performed one at a time (avoid concurrency)? - ------ - -## /BasicDisplaySchema - -Represents user information for a trigger, search, or create. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/BasicDisplaySchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/BasicDisplaySchema.js) - -#### Examples - -* `{ label: 'New Thing', description: 'Gets a new thing for you.' }` -* ``` - { label: 'New Thing', - description: 'Gets a new thing for you.', - directions: 'This is how you use the thing.', - hidden: false, - important: true } - ``` - -#### Anti-Examples - -* `{ label: 'New Thing' }` -* `{ label: 'New Thing', description: 'Gets a new thing for you.', important: 1 }` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`label` | **yes** | `string` | A short label like "New Record" or "Create Record in Project". -`description` | **yes** | `string` | A description of what this trigger, search, or create does. -`directions` | no | `string` | A short blurb that can explain how to get this working. EG: how and where to copy-paste a static hook URL into your application. Only evaluated for static webhooks. -`important` | no | `boolean` | Affects how prominently this operation is displayed in the UI. Only mark a few of the most popular operations important. -`hidden` | no | `boolean` | Should this operation be unselectable by users? - ------ - -## /BasicHookOperationSchema - -Represents the inbound mechanics of hooks with optional subscribe/unsubscribe. Defers to list for fields. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/BasicHookOperationSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/BasicHookOperationSchema.js) - - - -#### Properties - -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` | **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 - ------ - -## /BasicOperationSchema - -Represents the fundamental mechanics of triggers, searches, or creates. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/BasicOperationSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/BasicOperationSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`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** | 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...'}`. -`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 - ------ - -## /BasicPollingOperationSchema - -Represents the fundamental mechanics of a trigger. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/BasicPollingOperationSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/BasicPollingOperationSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`type` | no | `string` in (`'polling'`) | Clarify how this operation works (polling == pull or hook == push). -`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** | 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? -`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 - ------ - -## /CreateSchema - -How will Zapier create a new object? - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/CreateSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/CreateSchema.js) - -#### Examples - -* ``` - { key: 'recipe', - noun: 'Recipe', - display: { label: 'Create Recipe', description: 'Creates a new recipe.' }, - operation: { perform: '$func$2$f$', sample: { id: 1 } } } - ``` -* ``` - { key: 'recipe', - noun: 'Recipe', - display: { label: 'Create Recipe', description: 'Creates a new recipe.' }, - operation: { perform: '$func$2$f$', sample: { id: 1 }, shouldLock: true } } - ``` -* ``` - { key: 'recipe', - noun: 'Recipe', - display: { label: 'Create Recipe', description: 'Creates a new recipe.', hidden: true }, - operation: { perform: '$func$2$f$' } } - ``` - -#### Anti-Examples - -* `'abc'` -* ``` - { key: 'recipe', - noun: 'Recipe', - display: { label: 'Create Recipe', description: 'Creates a new recipe.' }, - operation: { perform: '$func$2$f$', shouldLock: 'yes' } } - ``` -* ``` - { key: 'recipe', - noun: 'Recipe', - display: { label: 'Create Recipe', description: 'Creates a new recipe.' }, - operation: { perform: '$func$2$f$' } } - ``` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`key` | **yes** | [/KeySchema](#keyschema) | A key to uniquely identify this create. -`noun` | **yes** | `string` | A noun for this create that completes the sentence "creates a new XXX". -`display` | **yes** | [/BasicDisplaySchema](#basicdisplayschema) | Configures the UI for this create. -`operation` | **yes** | [/BasicCreateActionOperationSchema](#basiccreateactionoperationschema) | Powers the functionality for this create. - ------ - -## /CreatesSchema - -Enumerates the creates your app has available for users. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/CreatesSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/CreatesSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`^[a-zA-Z]+[a-zA-Z0-9_]*$` | no | [/CreateSchema](#createschema) | Any unique key can be used and its values will be validated against the CreateSchema. - ------ - -## /DynamicFieldsSchema - -Like [/FieldsSchema](#fieldsschema) but you can provide functions to create dynamic or custom fields. - -#### Details - -* **Type** - [/FieldOrFunctionSchema](#fieldorfunctionschema) -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/DynamicFieldsSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/DynamicFieldsSchema.js) - -#### Examples - -* `[]` -* `[ { key: 'abc' } ]` -* `[ { key: 'abc' }, '$func$2$f$' ]` -* `[ '$func$2$f$', '$func$2$f$' ]` - -#### Anti-Examples - -* `[ {} ]` -* `[ { key: 'abc', choices: {} } ]` -* `'$func$2$f$'` - ------ - -## /FieldChoiceWithLabelSchema - -An object describing a labeled choice in a static dropdown. Useful if the value a user picks isn't exactly what the zap uses. For instance, when they click on a nickname, but the zap uses the user's full name ([image](https://cdn.zapier.com/storage/photos/8ed01ac5df3a511ce93ed2dc43c7fbbc.png)). - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/FieldChoiceWithLabelSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/FieldChoiceWithLabelSchema.js) - -#### Examples - -* `{ label: 'Red', sample: '#f00', value: '#f00' }` - -#### Anti-Examples - -* `{ label: 'Red', value: '#f00' }` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`value` | **yes** | `string` | The actual value that is sent into the Zap. Should match sample exactly. -`sample` | **yes** | `string` | Displayed as light grey text in the editor. It's important that the value match the sample. Otherwise, the actual value won't match what the user picked, which is confusing. -`label` | **yes** | `string` | A human readable label for this value. - ------ - -## /FieldChoicesSchema - -A static dropdown of options. Which you use depends on your order and label requirements: - -Need a Label? | Does Order Matter? | Type to Use ----|---|--- -Yes | No | Object of value -> label -No | Yes | Array of Strings -Yes | Yes | Array of [FieldChoiceWithLabel](#fieldchoicewithlabelschema) - -#### Details - -* **Type** - oneOf(`object`, `array`[oneOf(`string`, [/FieldChoiceWithLabelSchema](#fieldchoicewithlabelschema))]) -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/FieldChoicesSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/FieldChoicesSchema.js) - -#### Examples - -* `{ a: '1', b: '2', c: '3' }` -* `[ 'first', 'second', 'third' ]` - -#### Anti-Examples - -* `[ 1, 2, 3 ]` -* `[ { a: '1', b: '2', c: '3' } ]` - ------ - -## /FieldOrFunctionSchema - -Represents an array of fields or functions. - -#### Details - -* **Type** - `array`[oneOf([/FieldSchema](#fieldschema), [/FunctionSchema](#functionschema))] -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/FieldOrFunctionSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/FieldOrFunctionSchema.js) - -#### Examples - -* `[]` -* `[ { key: 'abc' } ]` -* `[ { key: 'abc' }, '$func$2$f$' ]` -* `[ '$func$2$f$', '$func$2$f$' ]` - -#### Anti-Examples - -* `[ {} ]` -* `[ { key: 'abc', choices: {} } ]` -* `'$func$2$f$'` - ------ - -## /FieldSchema - -Defines a field an app either needs as input, or gives as output. In addition to the requirements below, the following keys are mutually exclusive: - -* `children` & `list` -* `children` & `dict` -* `children` & `type` -* `children` & `placeholder` -* `children` & `helpText` -* `children` & `default` -* `dict` & `list` -* `dynamic` & `dict` -* `dynamic` & `choices` - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/FieldSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/FieldSchema.js) - -#### Examples - -* `{ key: 'abc' }` -* `{ key: 'abc', choices: { mobile: 'Mobile Phone' } }` -* `{ key: 'abc', choices: [ 'first', 'second', 'third' ] }` -* `{ key: 'abc', choices: [ { label: 'Red', sample: '#f00', value: '#f00' } ] }` -* `{ key: 'abc', children: [ { key: 'abc' } ] }` -* `{ key: 'abc', type: 'integer', helpText: 'neat' }` - -#### Anti-Examples - -* `{}` -* `{ key: 'abc', choices: {} }` -* `{ key: 'abc', choices: [] }` -* `{ key: 'abc', choices: [ 3 ] }` -* `{ key: 'abc', choices: [ { label: 'Red', value: '#f00' } ] }` -* `{ key: 'abc', choices: 'mobile' }` -* `{ key: 'abc', type: 'loltype' }` -* `{ key: 'abc', children: [], helpText: '' }` -* `{ key: 'abc', children: [ { key: 'def', children: [] } ] }` -* `{ key: 'abc', children: [ { key: 'def', children: [ { key: 'dhi' } ] } ] }` -* `{ key: 'abc', children: [ '$func$2$f$' ] }` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`key` | **yes** | `string` | A unique machine readable key for this value (IE: "fname"). -`label` | no | `string` | A human readable label for this value (IE: "First Name"). -`helpText` | no | `string` | A human readable description of this value (IE: "The first part of a full name."). You can use Markdown. -`type` | no | `string` in (`'string'`, `'text'`, `'integer'`, `'number'`, `'boolean'`, `'datetime'`, `'file'`, `'password'`, `'copy'`) | The type of this value. -`required` | no | `boolean` | If this value is required or not. -`placeholder` | no | `string` | An example value that is not saved. -`default` | no | `string` | A default value that is saved the first time a Zap is created. -`dynamic` | no | [/RefResourceSchema](#refresourceschema) | A reference to a trigger that will power a dynamic dropdown. -`search` | no | [/RefResourceSchema](#refresourceschema) | A reference to a search that will guide the user to add a search step to populate this field when creating a Zap. -`choices` | no | [/FieldChoicesSchema](#fieldchoicesschema) | An object of machine keys and human values to populate a static dropdown. -`list` | no | `boolean` | Can a user provide multiples of this field? -`children` | no | `array`[[/FieldSchema](#fieldschema)] | An array of child fields that define the structure of a sub-object for this field. Usually used for line items. -`dict` | no | `boolean` | Is this field a key/value input? -`computed` | no | `boolean` | Is this field automatically populated (and hidden from the user)? -`altersDynamicFields` | no | `boolean` | Does the value of this field affect the definitions of other fields in the set? -`inputFormat` | no | `string` | Useful when you expect the input to be part of a longer string. Put "{{input}}" in place of the user's input (IE: "https://{{input}}.yourdomain.com"). - ------ - -## /FieldsSchema - -An array or collection of fields. - -#### Details - -* **Type** - `array`[[/FieldSchema](#fieldschema)] -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/FieldsSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/FieldsSchema.js) - ------ - -## /FlatObjectSchema - -An object whose values can only be primitives - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/FlatObjectSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/FlatObjectSchema.js) - -#### Examples - -* `{ a: 1, b: 2, c: 3 }` -* `{ a: 1.2, b: 2.2, c: 3.3 }` -* `{ a: 'a', b: 'b', c: 'c' }` -* `{ a: true, b: true, c: false }` -* `{ a: 'a', b: 2, c: 3.1, d: true, e: false }` -* `{ '123': 'hello' }` - -#### Anti-Examples - -* `{ a: {}, b: 2 }` -* `{ a: { aa: 1 }, b: 2 }` -* `{ a: [], b: 2 }` -* `{ a: [ 1, 2, 3 ], b: 2 }` -* `{ '': 1 }` -* `{ ' ': 1 }` -* `{ ' ': 1 }` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`[^\s]+` | no | anyOf(`null`, `string`, `integer`, `number`, `boolean`) | Any key may exist in this flat object as long as its values are simple. - ------ - -## /FunctionRequireSchema - -A path to a file that might have content like `module.exports = (z, bundle) => [{id: 123}];`. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/FunctionRequireSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/FunctionRequireSchema.js) - -#### Examples - -* `{ require: 'some/path/to/file.js' }` - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`require` | **yes** | `string` | _No description given._ - ------ - -## /FunctionSchema - -Internal pointer to a function from the original source or the source code itself. Encodes arity and if `arguments` is used in the body. Note - just write normal functions and the system will encode the pointers for you. Or, provide {source: "return 1 + 2"} and the system will wrap in a function for you. - -#### Details - -* **Type** - oneOf(`string`, [/FunctionRequireSchema](#functionrequireschema), [/FunctionSourceSchema](#functionsourceschema)) -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/FunctionSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/FunctionSchema.js) - -#### Examples - -* `'$func$0$f$'` -* `'$func$2$t$'` -* `{ source: 'return 1 + 2' }` -* `{ require: 'some/path/to/file.js' }` - -#### Anti-Examples - -* `'funcy'` -* `{ source: '1 + 2' }` -* `{ source: '1 + 2', require: 'some/path/to/file.js' }` - ------ - -## /FunctionSourceSchema - -Source code like `{source: "return 1 + 2"}` which the system will wrap in a function for you. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/FunctionSourceSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/FunctionSourceSchema.js) - -#### Examples - -* `{ source: 'return 1 + 2' }` -* `{ args: [ 'x', 'y' ], source: 'return x + y;' }` - -#### Anti-Examples - -* `{ source: '1 + 2' }` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`source` | **yes** | `string` | JavaScript code for the function body. This must end with a `return` statement. -`args` | no | `array`[`string`] | Function signature. Defaults to `['z', 'bundle']` if not specified. - ------ - -## /HydratorsSchema - -A bank of named functions that you can use in `z.hydrate('someName')` to lazily load data. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/HydratorsSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/HydratorsSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`^[a-zA-Z]+[a-zA-Z0-9]*$` | no | [/FunctionSchema](#functionschema) | Any unique key can be used in `z.hydrate('uniqueKeyHere')`. - ------ - -## /KeySchema - -A unique identifier for this item. - -#### Details - -* **Type** - `string` -* **Pattern** - `^[a-zA-Z]+[a-zA-Z0-9_]*$` -* **Source Code** - [lib/schemas/KeySchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/KeySchema.js) - ------ - -## /MiddlewaresSchema - -List of before or after middlewares. Can be an array of functions or a single function - -#### Details - -* **Type** - oneOf(`array`[[/FunctionSchema](#functionschema)], [/FunctionSchema](#functionschema)) -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/MiddlewaresSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/MiddlewaresSchema.js) - ------ - -## /RedirectRequestSchema - -A representation of a HTTP redirect - you can use the `{{syntax}}` to inject authentication, field or global variables. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/RedirectRequestSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/RedirectRequestSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`method` | no | `string` in (`'GET'`) | The HTTP method for the request. -`url` | no | `string` | A URL for the request (we will parse the querystring and merge with params). Keys and values will not be re-encoded. -`params` | no | [/FlatObjectSchema](#flatobjectschema) | A mapping of the querystring - will get merged with any query params in the URL. Keys and values will be encoded. - ------ - -## /RefResourceSchema - -Reference a resource by key and the data it returns. In the format of: `{resource_key}.{foreign_key}(.{human_label_key})`. - -#### Details - -* **Type** - `string` -* **Pattern** - `^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)?(\.[a-zA-Z0-9_]+)?$` -* **Source Code** - [lib/schemas/RefResourceSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/RefResourceSchema.js) - -#### Examples - -* `'contact'` -* `'contact.id'` -* `'contact.id.full_name'` - -#### Anti-Examples - -* `'Contact.list.id.full_name'` - ------ - -## /RequestSchema - -A representation of a HTTP request - you can use the `{{syntax}}` to inject authentication, field or global variables. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/RequestSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/RequestSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`method` | no | `string` in (`'GET'`, `'PUT'`, `'POST'`, `'PATCH'`, `'DELETE'`, `'HEAD'`) | The HTTP method for the request. -`url` | no | `string` | A URL for the request (we will parse the querystring and merge with params). Keys and values will not be re-encoded. -`body` | no | oneOf(`null`, `string`, `object`, `array`) | Can be nothing, a raw string or JSON (object or array). -`params` | no | [/FlatObjectSchema](#flatobjectschema) | A mapping of the querystring - will get merged with any query params in the URL. Keys and values will be encoded. -`headers` | no | [/FlatObjectSchema](#flatobjectschema) | The HTTP headers for the request. -`auth` | no | oneOf(`array`[`string`], [/FlatObjectSchema](#flatobjectschema)) | An object holding the auth parameters for OAuth1 request signing, like `{oauth_token: 'abcd', oauth_token_secret: '1234'}`. Or an array reserved (i.e. not implemented yet) to hold the username and password for Basic Auth. Like `['AzureDiamond', 'hunter2']`. -`removeMissingValuesFrom` | no | `object` | Should missing values be sent? (empty strings, `null`, and `undefined` only — `[]`, `{}`, and `false` will still be sent). Allowed fields are `params` and `body`. The default is `false`, ex: ```removeMissingValuesFrom: { params: false, body: false }``` - ------ - -## /ResourceMethodCreateSchema - -How will we find create a specific object given inputs? Will be turned into a create automatically. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/ResourceMethodCreateSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/ResourceMethodCreateSchema.js) - -#### Examples - -* ``` - { display: { label: 'Create Tag', description: 'Create a new Tag in your account.' }, - operation: { perform: '$func$2$f$', sample: { id: 1 } } } - ``` -* ``` - { display: { label: 'Create Tag', description: 'Create a new Tag in your account.', hidden: true }, - operation: { perform: '$func$2$f$' } } - ``` - -#### Anti-Examples - -* ``` - { display: { label: 'Create Tag', description: 'Create a new Tag in your account.' }, - operation: { perform: '$func$2$f$' } } - ``` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`display` | **yes** | [/BasicDisplaySchema](#basicdisplayschema) | Define how this create method will be exposed in the UI. -`operation` | **yes** | [/BasicActionOperationSchema](#basicactionoperationschema) | Define how this create method will work. - ------ - -## /ResourceMethodGetSchema - -How will we get a single object given a unique identifier/id? - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/ResourceMethodGetSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/ResourceMethodGetSchema.js) - -#### Examples - -* ``` - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.' }, - operation: { perform: { url: '$func$0$f$' }, sample: { id: 385, name: 'proactive enable ROI' } } } - ``` -* ``` - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.', hidden: true }, - operation: { perform: { url: '$func$0$f$' } } } - ``` - -#### Anti-Examples - -* ``` - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.' }, - operation: { perform: { url: '$func$0$f$' } } } - ``` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`display` | **yes** | [/BasicDisplaySchema](#basicdisplayschema) | Define how this get method will be exposed in the UI. -`operation` | **yes** | [/BasicOperationSchema](#basicoperationschema) | Define how this get method will work. - ------ - -## /ResourceMethodHookSchema - -How will we get notified of new objects? Will be turned into a trigger automatically. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/ResourceMethodHookSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/ResourceMethodHookSchema.js) - -#### Examples - -* ``` - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.' }, - operation: { type: 'hook', perform: '$func$0$f$', sample: { id: 385, name: 'proactive enable ROI' } } } - ``` -* ``` - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.', hidden: true }, - operation: { type: 'hook', perform: '$func$0$f$' } } - ``` - -#### Anti-Examples - -* ``` - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.' }, - operation: { type: 'hook', perform: '$func$0$f$' } } - ``` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`display` | **yes** | [/BasicDisplaySchema](#basicdisplayschema) | Define how this hook/trigger method will be exposed in the UI. -`operation` | **yes** | [/BasicHookOperationSchema](#basichookoperationschema) | Define how this hook/trigger method will work. - ------ - -## /ResourceMethodListSchema - -How will we get a list of new objects? Will be turned into a trigger automatically. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/ResourceMethodListSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/ResourceMethodListSchema.js) - -#### Examples - -* ``` - { display: { label: 'New User', description: 'Trigger when a new User is created in your account.' }, - operation: - { perform: { url: 'http://fake-crm.getsandbox.com/users' }, - sample: { id: 49, name: 'Veronica Kuhn', email: 'veronica.kuhn@company.com' } } } - ``` -* ``` - { display: - { label: 'New User', - description: 'Trigger when a new User is created in your account.', - hidden: true }, - operation: { perform: { url: 'http://fake-crm.getsandbox.com/users' } } } - ``` - -#### Anti-Examples - -* ``` - { display: { label: 'New User', description: 'Trigger when a new User is created in your account.' }, - operation: { perform: { url: 'http://fake-crm.getsandbox.com/users' } } } - ``` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`display` | **yes** | [/BasicDisplaySchema](#basicdisplayschema) | Define how this list/trigger method will be exposed in the UI. -`operation` | **yes** | [/BasicPollingOperationSchema](#basicpollingoperationschema) | Define how this list/trigger method will work. - ------ - -## /ResourceMethodSearchSchema - -How will we find a specific object given filters or search terms? Will be turned into a search automatically. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/ResourceMethodSearchSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/ResourceMethodSearchSchema.js) - -#### Examples - -* ``` - { display: { label: 'Find a Recipe', description: 'Search for recipe by cuisine style.' }, - operation: { perform: '$func$2$f$', sample: { id: 1 } } } - ``` -* ``` - { display: { label: 'Find a Recipe', description: 'Search for recipe by cuisine style.', hidden: true }, - operation: { perform: '$func$2$f$' } } - ``` - -#### Anti-Examples - -* ``` - { key: 'recipe', - noun: 'Recipe', - display: { label: 'Find a Recipe', description: 'Search for recipe by cuisine style.' }, - operation: { perform: '$func$2$f$' } } - ``` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`display` | **yes** | [/BasicDisplaySchema](#basicdisplayschema) | Define how this search method will be exposed in the UI. -`operation` | **yes** | [/BasicActionOperationSchema](#basicactionoperationschema) | Define how this search method will work. - ------ - -## /ResourceSchema - -Represents a resource, which will in turn power triggers, searches, or creates. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/ResourceSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/ResourceSchema.js) - -#### Examples - -* ``` - { key: 'tag', - noun: 'Tag', - get: - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.' }, - operation: - { perform: { url: 'http://fake-crm.getsandbox.com/tags/{{inputData.id}}' }, - sample: { id: 385, name: 'proactive enable ROI' } } } } - ``` -* ``` - { key: 'tag', - noun: 'Tag', - sample: { id: 385, name: 'proactive enable ROI' }, - get: - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.' }, - operation: { perform: { url: 'http://fake-crm.getsandbox.com/tags/{{inputData.id}}' } } } } - ``` -* ``` - { key: 'tag', - noun: 'Tag', - get: - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.', hidden: true }, - operation: { perform: { url: 'http://fake-crm.getsandbox.com/tags/{{inputData.id}}' } } }, - list: - { display: { label: 'New Tag', description: 'Trigger when a new Tag is created in your account.' }, - operation: - { perform: { url: 'http://fake-crm.getsandbox.com/tags' }, - sample: { id: 385, name: 'proactive enable ROI' } } } } - ``` - -#### Anti-Examples - -* ``` - { key: 'tag', - noun: 'Tag', - get: - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.' }, - operation: { perform: { url: 'http://fake-crm.getsandbox.com/tags/{{inputData.id}}' } } }, - list: - { display: { label: 'New Tag', description: 'Trigger when a new Tag is created in your account.' }, - operation: - { perform: { url: 'http://fake-crm.getsandbox.com/tags' }, - sample: { id: 385, name: 'proactive enable ROI' } } } } - ``` -* ``` - { key: 'tag', - noun: 'Tag', - get: - { display: { label: 'Get Tag by ID', description: 'Grab a specific Tag by ID.' }, - operation: { perform: { url: 'http://fake-crm.getsandbox.com/tags/{{inputData.id}}' } } } } - ``` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`key` | **yes** | [/KeySchema](#keyschema) | A key to uniquely identify this resource. -`noun` | **yes** | `string` | A noun for this resource that completes the sentence "create a new XXX". -`get` | no | [/ResourceMethodGetSchema](#resourcemethodgetschema) | How will we get a single object given a unique identifier/id? -`hook` | no | [/ResourceMethodHookSchema](#resourcemethodhookschema) | How will we get notified of new objects? Will be turned into a trigger automatically. -`list` | no | [/ResourceMethodListSchema](#resourcemethodlistschema) | How will we get a list of new objects? Will be turned into a trigger automatically. -`search` | no | [/ResourceMethodSearchSchema](#resourcemethodsearchschema) | How will we find a specific object given filters or search terms? Will be turned into a search automatically. -`create` | no | [/ResourceMethodCreateSchema](#resourcemethodcreateschema) | How will we find create a specific object given inputs? Will be turned into a create automatically. -`outputFields` | no | [/DynamicFieldsSchema](#dynamicfieldsschema) | What fields of data will this return? -`sample` | no | `object` | What does a sample of data look like? - ------ - -## /ResourcesSchema - -All the resources that underlie common CRUD methods powering automatically handled triggers, creates, and searches for your app. Zapier will break these apart for you. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/ResourcesSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/ResourcesSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`^[a-zA-Z]+[a-zA-Z0-9_]*$` | no | [/ResourceSchema](#resourceschema) | Any unique key can be used and its values will be validated against the ResourceSchema. - ------ - -## /ResultsSchema - -An array of objects suitable for returning in perform calls. - -#### Details - -* **Type** - `array`[`object`] -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/ResultsSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/ResultsSchema.js) - ------ - -## /SearchOrCreateSchema - -Pair an existing search and a create to enable "Find or Create" functionality in your app - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/SearchOrCreateSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/SearchOrCreateSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`key` | **yes** | [/KeySchema](#keyschema) | A key to uniquely identify this search-or-create. Must match the search key. -`display` | **yes** | [/BasicDisplaySchema](#basicdisplayschema) | Configures the UI for this search-or-create. -`search` | **yes** | [/KeySchema](#keyschema) | The key of the search that powers this search-or-create -`create` | **yes** | [/KeySchema](#keyschema) | The key of the create that powers this search-or-create - ------ - -## /SearchOrCreatesSchema - -Enumerates the search-or-creates your app has available for users. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/SearchOrCreatesSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/SearchOrCreatesSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`^[a-zA-Z]+[a-zA-Z0-9_]*$` | no | [/SearchOrCreateSchema](#searchorcreateschema) | Any unique key can be used and its values will be validated against the SearchOrCreateSchema. - ------ - -## /SearchSchema - -How will Zapier search for existing objects? - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/SearchSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/SearchSchema.js) - -#### Examples - -* ``` - { key: 'recipe', - noun: 'Recipe', - display: { label: 'Find a Recipe', description: 'Search for recipe by cuisine style.' }, - operation: { perform: '$func$2$f$', sample: { id: 1 } } } - ``` -* ``` - { key: 'recipe', - noun: 'Recipe', - display: { label: 'Find a Recipe', description: 'Search for recipe by cuisine style.', hidden: true }, - operation: { perform: '$func$2$f$' } } - ``` - -#### Anti-Examples - -* `'abc'` -* ``` - { key: 'recipe', - noun: 'Recipe', - display: { label: 'Find a Recipe', description: 'Search for recipe by cuisine style.' }, - operation: { perform: '$func$2$f$' } } - ``` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`key` | **yes** | [/KeySchema](#keyschema) | A key to uniquely identify this search. -`noun` | **yes** | `string` | A noun for this search that completes the sentence "finds a specific XXX". -`display` | **yes** | [/BasicDisplaySchema](#basicdisplayschema) | Configures the UI for this search. -`operation` | **yes** | [/BasicActionOperationSchema](#basicactionoperationschema) | Powers the functionality for this search. - ------ - -## /SearchesSchema - -Enumerates the searches your app has available for users. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/SearchesSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/SearchesSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`^[a-zA-Z]+[a-zA-Z0-9_]*$` | no | [/SearchSchema](#searchschema) | Any unique key can be used and its values will be validated against the SearchSchema. - ------ - -## /TriggerSchema - -How will Zapier get notified of new objects? - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/TriggerSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/TriggerSchema.js) - -#### Examples - -* ``` - { key: 'new_recipe', - noun: 'Recipe', - display: { label: 'New Recipe', description: 'Triggers when a new recipe is added.' }, - operation: { type: 'polling', perform: '$func$0$f$', sample: { id: 1 } } } - ``` -* ``` - { key: 'new_recipe', - noun: 'Recipe', - display: { label: 'New Recipe', description: 'Triggers when a new recipe is added.', hidden: true }, - operation: { type: 'polling', perform: '$func$0$f$' } } - ``` - -#### Anti-Examples - -* ``` - { key: 'new_recipe', - noun: 'Recipe', - display: { label: 'New Recipe', description: 'Triggers when a new recipe is added.' }, - operation: { perform: '$func$0$f$' } } - ``` - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`key` | **yes** | [/KeySchema](#keyschema) | A key to uniquely identify this trigger. -`noun` | **yes** | `string` | A noun for this trigger that completes the sentence "triggers on a new XXX". -`display` | **yes** | [/BasicDisplaySchema](#basicdisplayschema) | Configures the UI for this trigger. -`operation` | **yes** | anyOf([/BasicPollingOperationSchema](#basicpollingoperationschema), [/BasicHookOperationSchema](#basichookoperationschema)) | Powers the functionality for this trigger. - ------ - -## /TriggersSchema - -Enumerates the triggers your app has available for users. - -#### Details - -* **Type** - `object` -* **Pattern** - _n/a_ -* **Source Code** - [lib/schemas/TriggersSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/TriggersSchema.js) - - - -#### Properties - -Key | Required | Type | Description ---- | -------- | ---- | ----------- -`^[a-zA-Z]+[a-zA-Z0-9_]*$` | no | [/TriggerSchema](#triggerschema) | Any unique key can be used and its values will be validated against the TriggerSchema. - ------ - -## /VersionSchema - -Represents a simplified semver string, from `0.0.0` to `999.999.999`. - -#### Details - -* **Type** - `string` -* **Pattern** - `^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$` -* **Source Code** - [lib/schemas/VersionSchema.js](https://github.com/zapier/zapier-platform-schema/blob/v8.2.1/lib/schemas/VersionSchema.js) - -#### Examples - -* `'1.0.0'` -* `'2.11.3'` -* `'999.999.999'` - -#### Anti-Examples - -* `'1.0.0.0'` -* `'1000.0.0'` -* `'v1.0.0'` -* `'1.0.0-beta'` -* `'1.0.0-beta.x.y.z'` -* `'1.0.0-beta+12487'` - \ No newline at end of file +--- +layout: forward +target: https://github.com/zapier/zapier-platform/blob/main/packages/schema/docs/build/schema.md +message: This page has been moved. +time: 10 +---