zapier-platform-cli 15.0.0 → 15.0.1
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/README-source.md +15 -9
- package/README.md +18 -12
- package/oclif.manifest.json +1 -1
- package/package.json +3 -2
- package/scaffold/test.template.js +0 -2
- package/src/generators/index.js +1 -1
- package/src/utils/convert.js +49 -179
- package/scaffold/convert/create-test.template.js +0 -22
- package/scaffold/convert/gitignore +0 -62
- package/scaffold/convert/package.template.json +0 -26
- package/scaffold/convert/search-test.template.js +0 -24
- package/scaffold/convert/trigger-test.template.js +0 -22
package/README-source.md
CHANGED
|
@@ -34,7 +34,7 @@ This doc describes the latest CLI version (**PACKAGE_VERSION**), as of this writ
|
|
|
34
34
|
|
|
35
35
|
## Getting Started
|
|
36
36
|
|
|
37
|
-
> If you're new to Zapier Platform CLI, we strongly recommend you to walk through the [Tutorial](https://zapier.com/
|
|
37
|
+
> If you're new to Zapier Platform CLI, we strongly recommend you to walk through the [Tutorial](https://platform.zapier.com/cli_tutorials/getting-started) for a more thorough introduction.
|
|
38
38
|
|
|
39
39
|
### What is an App?
|
|
40
40
|
|
|
@@ -64,7 +64,7 @@ The Zapier Platform includes two ways to build integrations: a CLI (to build int
|
|
|
64
64
|
|
|
65
65
|
Zapier Platform CLI is designed to be used by development teams who collaborate with version control and CI, and can be used to build more advanced integrations with custom coding for every part of your API calls and response parsing.
|
|
66
66
|
|
|
67
|
-
[Zapier Platform UI](https://zapier.com/
|
|
67
|
+
[Zapier Platform UI](https://developer.zapier.com/) is designed to quickly spin up new integrations, and collaborate on them with teams that include non-developers. It's the quickest way to start using the Zapier platform—and you can manage your CLI apps' core details from its online UI as well. You can also [export](https://platform.zapier.com/docs/export) Zapier Platform UI integrations to CLI to start development in your browser, then finish out the core features in your local development environment.
|
|
68
68
|
|
|
69
69
|
> Learn more in our [Zapier Platform UI vs CLI](https://platform.zapier.com/docs/vs) post.
|
|
70
70
|
|
|
@@ -92,7 +92,7 @@ npm install -g zapier-platform-cli
|
|
|
92
92
|
# setup auth to Zapier's platform with a deploy key
|
|
93
93
|
zapier login
|
|
94
94
|
```
|
|
95
|
-
> Note: If you log into Zapier via the single sign-on (Google, Facebook, or Microsoft), you may not have a Zapier password. If that's the case, you'll need to generate a deploy key, go to [your Zapier developer account here](https://zapier.com/
|
|
95
|
+
> Note: If you log into Zapier via the single sign-on (Google, Facebook, or Microsoft), you may not have a Zapier password. If that's the case, you'll need to generate a deploy key, go to [your Zapier developer account here](https://developer.zapier.com/partner-settings/deploy-keys/) and create/copy a key, then run ```zapier login``` command with the --sso flag.
|
|
96
96
|
|
|
97
97
|
Your Zapier CLI should be installed and ready to go at this point. Next up, we'll create our first app!
|
|
98
98
|
|
|
@@ -106,7 +106,13 @@ cd example-app
|
|
|
106
106
|
# install all the libraries needed for your app
|
|
107
107
|
npm install
|
|
108
108
|
```
|
|
109
|
+
Depending on the authentication method for your app, you'll also likely need to set your `CLIENT_ID` and `CLIENT_SECRET` as environment variables. These are the consumer key and secret in OAuth1 terminology.
|
|
109
110
|
|
|
111
|
+
```bash
|
|
112
|
+
# setting the environment variables on Zapier.com
|
|
113
|
+
$ zapier env:set 1.0.0 CLIENT_ID=1234
|
|
114
|
+
$ zapier env:set 1.0.0 CLIENT_SECRET=abcd
|
|
115
|
+
```
|
|
110
116
|
> Note: When you run `zapier init`, you'll be presented with a list of templates to start with. Pick the one that matches a feature you'll need (such as "dynamic-dropdown" for an integration with [dynamic dropdown fields](#dynamic-dropdowns)), or select "minimal" for an integration with only the essentials. [View more example apps here](https://github.com/zapier/zapier-platform/tree/main/example-apps).
|
|
111
117
|
|
|
112
118
|
You should now have a working local app. You can run several local commands to try it out.
|
|
@@ -124,16 +130,16 @@ Next, you'll probably want to upload app to Zapier itself so you can start testi
|
|
|
124
130
|
zapier push
|
|
125
131
|
```
|
|
126
132
|
|
|
127
|
-
> Go check out our [full CLI reference documentation](https://
|
|
133
|
+
> Go check out our [full CLI reference documentation](https://github.com/zapier/zapier-platform/blob/main/packages/cli/docs/cli.md#zapier-cli-reference) to see all the other commands!
|
|
128
134
|
|
|
129
135
|
|
|
130
136
|
### Tutorial
|
|
131
137
|
|
|
132
|
-
For a full tutorial, head over to our [Tutorial](https://zapier.com/
|
|
138
|
+
For a full tutorial, head over to our [Tutorial](https://platform.zapier.com/cli_tutorials/getting-started) for a comprehensive walkthrough for creating your first app. If this isn't your first rodeo, read on!
|
|
133
139
|
|
|
134
140
|
## Creating a Local App
|
|
135
141
|
|
|
136
|
-
> Tip: Check the [Quick Setup](#quick-setup-guide) if this is your first time using the platform!
|
|
142
|
+
> Tip: Check the [Quick Setup](https://github.com/zapier/zapier-platform/blob/main/packages/cli/README.md#quick-setup-guide) if this is your first time using the platform!
|
|
137
143
|
|
|
138
144
|
Creating an App can be done entirely locally and they are fairly simple Node.js apps using the standard Node environment and should be completely testable. However, a local app stays local until you `zapier register`.
|
|
139
145
|
|
|
@@ -280,7 +286,7 @@ zapier deprecate 1.0.0 2020-06-01
|
|
|
280
286
|
|
|
281
287
|
## Converting an Existing App
|
|
282
288
|
|
|
283
|
-
If you have an existing Zapier [legacy Web Builder app](https://zapier.com/
|
|
289
|
+
If you have an existing Zapier [legacy Web Builder app](https://platform.zapier.com/conversion/maintaining), you can use it as a template to kickstart your local application.
|
|
284
290
|
|
|
285
291
|
```bash
|
|
286
292
|
# Convert an existing Web Builder app to a CLI app in the my-app directory
|
|
@@ -1899,9 +1905,9 @@ zapier test
|
|
|
1899
1905
|
zapier push
|
|
1900
1906
|
```
|
|
1901
1907
|
|
|
1902
|
-
There are a lot of details left out - check out the full example app
|
|
1908
|
+
There are a lot of details left out - check out the full example app [here](https://github.com/zapier/zapier-platform/tree/main/example-apps/babel).
|
|
1903
1909
|
|
|
1904
|
-
>
|
|
1910
|
+
> We recommend using `zapier init .` to create an app - you’ll be presented with a list of currently available example templates to start with.
|
|
1905
1911
|
|
|
1906
1912
|
## FAQs
|
|
1907
1913
|
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ You may find docs duplicate or outdated across the Zapier site. The most up-to-d
|
|
|
22
22
|
|
|
23
23
|
Our code is updated frequently. To see a full list of changes, look no further than [the CHANGELOG](https://github.com/zapier/zapier-platform/blob/main/CHANGELOG.md).
|
|
24
24
|
|
|
25
|
-
This doc describes the latest CLI version (**15.0.
|
|
25
|
+
This doc describes the latest CLI version (**15.0.1**), as of this writing. If you're using an older version of the CLI, you may want to check out these historical releases:
|
|
26
26
|
|
|
27
27
|
- CLI Docs: [11.3.3](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@11.3.3/packages/cli/README.md), [10.2.0](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@10.2.0/packages/cli/README.md), [9.7.3](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@9.7.3/packages/cli/README.md)
|
|
28
28
|
- CLI Reference: [11.3.3](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@11.3.3/packages/cli/docs/cli.md), [10.2.0](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@10.2.0/packages/cli/docs/cli.md), [9.7.3](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@9.7.3/packages/cli/docs/cli.md)
|
|
@@ -152,7 +152,7 @@ This doc describes the latest CLI version (**15.0.0**), as of this writing. If y
|
|
|
152
152
|
|
|
153
153
|
## Getting Started
|
|
154
154
|
|
|
155
|
-
> If you're new to Zapier Platform CLI, we strongly recommend you to walk through the [Tutorial](https://zapier.com/
|
|
155
|
+
> If you're new to Zapier Platform CLI, we strongly recommend you to walk through the [Tutorial](https://platform.zapier.com/cli_tutorials/getting-started) for a more thorough introduction.
|
|
156
156
|
|
|
157
157
|
### What is an App?
|
|
158
158
|
|
|
@@ -182,7 +182,7 @@ The Zapier Platform includes two ways to build integrations: a CLI (to build int
|
|
|
182
182
|
|
|
183
183
|
Zapier Platform CLI is designed to be used by development teams who collaborate with version control and CI, and can be used to build more advanced integrations with custom coding for every part of your API calls and response parsing.
|
|
184
184
|
|
|
185
|
-
[Zapier Platform UI](https://zapier.com/
|
|
185
|
+
[Zapier Platform UI](https://developer.zapier.com/) is designed to quickly spin up new integrations, and collaborate on them with teams that include non-developers. It's the quickest way to start using the Zapier platform—and you can manage your CLI apps' core details from its online UI as well. You can also [export](https://platform.zapier.com/docs/export) Zapier Platform UI integrations to CLI to start development in your browser, then finish out the core features in your local development environment.
|
|
186
186
|
|
|
187
187
|
> Learn more in our [Zapier Platform UI vs CLI](https://platform.zapier.com/docs/vs) post.
|
|
188
188
|
|
|
@@ -210,7 +210,7 @@ npm install -g zapier-platform-cli
|
|
|
210
210
|
# setup auth to Zapier's platform with a deploy key
|
|
211
211
|
zapier login
|
|
212
212
|
```
|
|
213
|
-
> Note: If you log into Zapier via the single sign-on (Google, Facebook, or Microsoft), you may not have a Zapier password. If that's the case, you'll need to generate a deploy key, go to [your Zapier developer account here](https://zapier.com/
|
|
213
|
+
> Note: If you log into Zapier via the single sign-on (Google, Facebook, or Microsoft), you may not have a Zapier password. If that's the case, you'll need to generate a deploy key, go to [your Zapier developer account here](https://developer.zapier.com/partner-settings/deploy-keys/) and create/copy a key, then run ```zapier login``` command with the --sso flag.
|
|
214
214
|
|
|
215
215
|
Your Zapier CLI should be installed and ready to go at this point. Next up, we'll create our first app!
|
|
216
216
|
|
|
@@ -224,7 +224,13 @@ cd example-app
|
|
|
224
224
|
# install all the libraries needed for your app
|
|
225
225
|
npm install
|
|
226
226
|
```
|
|
227
|
+
Depending on the authentication method for your app, you'll also likely need to set your `CLIENT_ID` and `CLIENT_SECRET` as environment variables. These are the consumer key and secret in OAuth1 terminology.
|
|
227
228
|
|
|
229
|
+
```bash
|
|
230
|
+
# setting the environment variables on Zapier.com
|
|
231
|
+
$ zapier env:set 1.0.0 CLIENT_ID=1234
|
|
232
|
+
$ zapier env:set 1.0.0 CLIENT_SECRET=abcd
|
|
233
|
+
```
|
|
228
234
|
> Note: When you run `zapier init`, you'll be presented with a list of templates to start with. Pick the one that matches a feature you'll need (such as "dynamic-dropdown" for an integration with [dynamic dropdown fields](#dynamic-dropdowns)), or select "minimal" for an integration with only the essentials. [View more example apps here](https://github.com/zapier/zapier-platform/tree/main/example-apps).
|
|
229
235
|
|
|
230
236
|
You should now have a working local app. You can run several local commands to try it out.
|
|
@@ -242,16 +248,16 @@ Next, you'll probably want to upload app to Zapier itself so you can start testi
|
|
|
242
248
|
zapier push
|
|
243
249
|
```
|
|
244
250
|
|
|
245
|
-
> Go check out our [full CLI reference documentation](https://
|
|
251
|
+
> Go check out our [full CLI reference documentation](https://github.com/zapier/zapier-platform/blob/main/packages/cli/docs/cli.md#zapier-cli-reference) to see all the other commands!
|
|
246
252
|
|
|
247
253
|
|
|
248
254
|
### Tutorial
|
|
249
255
|
|
|
250
|
-
For a full tutorial, head over to our [Tutorial](https://zapier.com/
|
|
256
|
+
For a full tutorial, head over to our [Tutorial](https://platform.zapier.com/cli_tutorials/getting-started) for a comprehensive walkthrough for creating your first app. If this isn't your first rodeo, read on!
|
|
251
257
|
|
|
252
258
|
## Creating a Local App
|
|
253
259
|
|
|
254
|
-
> Tip: Check the [Quick Setup](#quick-setup-guide) if this is your first time using the platform!
|
|
260
|
+
> Tip: Check the [Quick Setup](https://github.com/zapier/zapier-platform/blob/main/packages/cli/README.md#quick-setup-guide) if this is your first time using the platform!
|
|
255
261
|
|
|
256
262
|
Creating an App can be done entirely locally and they are fairly simple Node.js apps using the standard Node environment and should be completely testable. However, a local app stays local until you `zapier register`.
|
|
257
263
|
|
|
@@ -424,7 +430,7 @@ zapier deprecate 1.0.0 2020-06-01
|
|
|
424
430
|
|
|
425
431
|
## Converting an Existing App
|
|
426
432
|
|
|
427
|
-
If you have an existing Zapier [legacy Web Builder app](https://zapier.com/
|
|
433
|
+
If you have an existing Zapier [legacy Web Builder app](https://platform.zapier.com/conversion/maintaining), you can use it as a template to kickstart your local application.
|
|
428
434
|
|
|
429
435
|
```bash
|
|
430
436
|
# Convert an existing Web Builder app to a CLI app in the my-app directory
|
|
@@ -2394,7 +2400,7 @@ This behavior has changed periodically across major versions, which changes how/
|
|
|
2394
2400
|
|
|
2395
2401
|

|
|
2396
2402
|
|
|
2397
|
-
Ensure you're handling errors correctly for your platform version. The latest released version is **15.0.
|
|
2403
|
+
Ensure you're handling errors correctly for your platform version. The latest released version is **15.0.1**.
|
|
2398
2404
|
|
|
2399
2405
|
### HTTP Request Options
|
|
2400
2406
|
|
|
@@ -3230,9 +3236,9 @@ zapier test
|
|
|
3230
3236
|
zapier push
|
|
3231
3237
|
```
|
|
3232
3238
|
|
|
3233
|
-
There are a lot of details left out - check out the full example app
|
|
3239
|
+
There are a lot of details left out - check out the full example app [here](https://github.com/zapier/zapier-platform/tree/main/example-apps/babel).
|
|
3234
3240
|
|
|
3235
|
-
>
|
|
3241
|
+
> We recommend using `zapier init .` to create an app - you’ll be presented with a list of currently available example templates to start with.
|
|
3236
3242
|
|
|
3237
3243
|
## FAQs
|
|
3238
3244
|
|
|
@@ -3587,7 +3593,7 @@ Broadly speaking, all releases will continue to work indefinitely. While you nev
|
|
|
3587
3593
|
For more info about which Node versions are supported, see [the faq](#how-do-i-manually-set-the-nodejs-version-to-run-my-app-with).
|
|
3588
3594
|
|
|
3589
3595
|
<!-- TODO: if we decouple releases, change this -->
|
|
3590
|
-
The most recently released version of `cli` and `core` is **15.0.
|
|
3596
|
+
The most recently released version of `cli` and `core` is **15.0.1**. You can see the versions you're working with by running `zapier -v`.
|
|
3591
3597
|
|
|
3592
3598
|
To update `cli`, run `npm install -g zapier-platform-cli`.
|
|
3593
3599
|
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"15.0.0","commands":{"analytics":{"id":"analytics","description":"Show the status of the analytics that are collected. Also used to change what is collected.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier analytics --mode enabled"],"flags":{"mode":{"name":"mode","type":"option","char":"m","description":"Choose how much information to share. Anonymous mode drops the OS type and Zapier user id, but keeps command info. Identifying information is used only for debugging purposes.","options":["enabled","anonymous","disabled"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"build":{"id":"build","description":"Build a pushable zip from the current directory.\n\nThis command does the following:\n\n* Creates a temporary folder\n* Copies all code into the temporary folder\n* Adds an entry point: `zapierwrapper.js`\n* Generates and validates app definition.\n* Detects dependencies via browserify (optional, on by default)\n* Zips up all needed `.js` files. If you want to include more files, add a \"includeInBuild\" property (array with strings of regexp paths) to your `.zapierapprc`.\n* Moves the zip to `build/build.zip` and `build/source.zip` and deletes the temp folder\n\nThis command is typically followed by `zapier upload`.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"disable-dependency-detection":{"name":"disable-dependency-detection","type":"boolean","description":"Disable \"smart\" file inclusion. By default, Zapier only includes files that are required by `index.js`. If you (or your dependencies) require files dynamically (such as with `require(someVar)`), then you may see \"Cannot find module\" errors. Disabling this may make your `build.zip` too large. If that's the case, try using the `includeInBuild` option in your `.zapierapprc`. See the docs about `includeInBuild` for more info.","allowNo":false},"skip-npm-install":{"name":"skip-npm-install","type":"boolean","description":"Skips installing a fresh copy of npm dependencies on build. Helpful for using `yarn` or local copies of dependencies.","hidden":true,"allowNo":false},"skip-validation":{"name":"skip-validation","type":"boolean","description":"Skips local pre-push validation checks, and remote validation check of the CLI app's schema and AppVersion integrity.","hidden":true,"allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"convert":{"id":"convert","description":"Convert a Visual Builder integration to a CLI integration.\n\nThe resulting CLI integration will be identical to its Visual Builder version and ready to push and use immediately!\n\nIf you re-run this command on an existing directory it will leave existing files alone and not clobber them.\n\nYou'll need to do a `zapier push` before the new version is visible in the editor, but otherwise you're good to go.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"version":{"name":"version","type":"option","char":"v","description":"Convert a specific version. Required when converting a Visual Builder integration.","required":true},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"integrationId","description":"To get the integration/app ID, go to \"https://developer.zapier.com\", click on an integration, and copy the number directly after \"/app/\" in the URL.","required":true},{"name":"path","description":"Relative to your current path - IE: `.` for current directory.","required":true}]},"deprecate":{"id":"deprecate","description":"Mark a non-production version of your integration as deprecated, with removal by a certain date.\n\nUse this when an integration version will not be supported or start breaking at a known date.\n\nZapier will send an email warning users of the deprecation once a date is set, they'll start seeing it as \"Deprecated\" in the UI, and once the deprecation date arrives, if the Zaps weren't updated, they'll be paused and the users will be emailed again explaining what happened.\n\nAfter the deprecation date has passed it will be safe to delete that integration version.\n\nDo not use this if you have non-breaking changes, such as fixing help text.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier deprecate 1.2.3 2011-10-01"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"The version to deprecate.","required":true},{"name":"date","description":"The date (YYYY-MM-DD) when Zapier will make the specified version unavailable.","required":true}]},"describe":{"id":"describe","description":"Describe the current integration.\n\nThis command prints a human readable enumeration of your integrations's\ntriggers, searches, and creates as seen by Zapier. Useful to understand how your\nresources convert and relate to different actions.\n\n* **Noun**: your action's noun\n* **Label**: your action's label\n* **Resource**: the resource (if any) this action is tied to\n* **Available Methods**: testable methods for this action","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"history":{"id":"history","description":"Get the history of your integration.\n\nHistory includes all the changes made over the lifetime of your integration. This includes everything from creation, updates, migrations, admins, and invitee changes, as well as who made the change and when.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"init":{"id":"init","description":"Initialize a new Zapier integration with a project template.\n\nAfter running this, you'll have a new integration in the specified directory. If you re-run this command on an existing directory, it will prompt before overwriting any existing files.\n\nThis doesn't register or deploy the integration with Zapier - try the `zapier register` and `zapier push` commands for that!","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier init myapp","zapier init ./path/myapp --template oauth2"],"flags":{"template":{"name":"template","type":"option","char":"t","description":"The template to start your integration with.","options":["basic-auth","callback","custom-auth","digest-auth","dynamic-dropdown","files","minimal","oauth1-trello","oauth2","search-or-create","session-auth","typescript"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"path","description":"Where to create the new integration. If the directory doesn't exist, it will be created. If the directory isn't empty, we'll ask for confirmation","required":true}]},"integrations":{"id":"integrations","description":"List integrations you have admin access to.\n\nThis command also checks the current directory for a linked integration.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["apps"],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"jobs":{"id":"jobs","description":"Lists ongoing migration or promotion jobs for the current integration.\n\nA job represents a background process that will be queued up when users execute a \"migrate\" or \"promote\" command for the current integration.\n\nEach job will be added to the end of a queue of \"promote\" and \"migration\" jobs where the \"Job Stage\" will then be initialized with \"requested\".\n\nJob stages will then move to \"estimating\", \"in_progress\" and finally one of four \"end\" stages: \"complete\", \"aborted\", \"errored\" or \"paused\".\n\nJob times will vary as it depends on the size of the queue and how many users your integration has.\n\nJobs are returned from oldest to newest.\n","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier jobs"],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"link":{"id":"link","description":"Link the current directory with an existing integration.\n\nThis command generates a `.zapierapprc` file in the directory in which it's ran. This file ties this code to an integration and is referenced frequently during `push` and `validate` operations. This file should be checked into source control.\n\nIf you're starting an integration from scratch, use `zapier init` instead.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"login":{"id":"login","description":"Configure your `~/.zapierrc` with a deploy key.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"sso":{"name":"sso","type":"boolean","char":"s","description":"Use this flag if you log into Zapier a Single Sign-On (SSO) button and don't have a Zapier password.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"logout":{"id":"logout","description":"Deactivate your active deploy key and reset `~/.zapierrc`.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"logs":{"id":"logs","description":"Print recent logs.\n\nLogs are created when your integration is run as part of a Zap. They come from explicit calls to `z.console.log()`, usage of `z.request()`, and any runtime errors.\n\nThis won't show logs from running locally with `zapier test`, since those never hit our server.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"version":{"name":"version","type":"option","char":"v","description":"Filter logs to the specified version."},"status":{"name":"status","type":"option","char":"s","description":"Filter logs to only see errors or successes","options":["any","success","error"],"default":"any"},"type":{"name":"type","type":"option","char":"t","description":"See logs of the specified type","options":["console","bundle","http"],"default":"console"},"detailed":{"name":"detailed","type":"boolean","description":"See extra info, like request/response body and headers.","allowNo":false},"user":{"name":"user","type":"option","char":"u","description":"Only show logs for this user. Defaults to your account.","default":"me"},"limit":{"name":"limit","type":"option","description":"Cap the number of logs returned. Max is 50 (also the default)","default":50},"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"migrate":{"id":"migrate","description":"Migrate a percentage of users or a single user from one version of your integration to another.\n\nStart a migration to move users between different versions of your integration. You may also \"revert\" by simply swapping the from/to verion strings in the command line arguments (i.e. `zapier migrate 1.0.1 1.0.0`).\n\n**Only use this command to migrate users between non-breaking versions, use `zapier deprecate` if you have breaking changes!**\n\nMigration time varies based on the number of affected Zaps. Be patient and check `zapier jobs` to track the status. Or use `zapier history` if you want to see older jobs.\n\nSince a migration is only for non-breaking changes, users are not emailed about the update/migration. It will be a transparent process for them.\n\nWe recommend migrating a small subset of users first, via the percent argument, then watching error logs of the new version for any sort of odd behavior. When you feel confident there are no bugs, go ahead and migrate everyone. If you see unexpected errors, you can revert.\n\nYou can migrate a specific user's Zaps by using `--user` (i.e. `zapier migrate 1.0.0 1.0.1 --user=user@example.com`). This will migrate Zaps in any account the user is a member of where the following criteria is met.\n\n - The Zap is owned by the user.\n - The Zap is not shared.\n - The integration auth used is not shared.\n\nAlternatively, you can pass the `--account` flag, (i.e. `zapier migrate 1.0.0 1.0.1 --account=account@example.com`). This will migrate all users' Zaps, Private & Shared, within all accounts for which the specified user is a member.\n\n**The `--account` flag should be used cautiously as it can break shared Zaps for other users in Team or Company accounts.**\n\nYou cannot pass both `PERCENT` and `--user` or `--account`.\n\nYou cannot pass both `--user` and `--account`.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier migrate 1.0.0 1.0.1","zapier migrate 1.0.1 2.0.0 10","zapier migrate 2.0.0 2.0.1 --user=user@example.com","zapier migrate 2.0.0 2.0.1 --account=account@example.com"],"flags":{"user":{"name":"user","type":"option","description":"Migrates all of a users' Private Zaps within all accounts for which the specified user is a member"},"account":{"name":"account","type":"option","description":"Migrates all of a users' Zaps, Private & Shared, within all accounts for which the specified user is a member"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"fromVersion","description":"The version FROM which to migrate users.","required":true},{"name":"toVersion","description":"The version TO which to migrate users.","required":true},{"name":"percent","description":"Percentage (between 1 and 100) of users to migrate.","default":100}]},"promote":{"id":"promote","description":"Promote a specific version to public access.\n\nPromote an integration version into production (non-private) rotation, which means new users can use this integration version.\n\n* This **does** mark the version as the official public version - all other versions & users are grandfathered.\n* This does **NOT** build/upload or deploy a version to Zapier - you should `zapier push` first.\n* This does **NOT** move old users over to this version - `zapier migrate 1.0.0 1.0.1` does that.\n* This does **NOT** recommend old users stop using this version - `zapier deprecate 1.0.0 2017-01-01` does that.\n\nPromotes are an inherently safe operation for all existing users of your integration.\n\nIf your integration is private and passes our integration checks, this will give you a URL to a form where you can fill in additional information for your integration to go public. After reviewing, the Zapier team will approve to make it public if there are no issues or decline with feedback.\n\nCheck `zapier jobs` to track the status of the promotion. Or use `zapier history` if you want to see older jobs.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier promote 1.0.0"],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Automatically answer \"yes\" to any prompts. Useful if you want to avoid interactive prompts to run this command in CI.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"The version you want to promote.","required":true}]},"push":{"id":"push","description":"Build and upload the current integration.\n\nThis command is the same as running `zapier build` and `zapier upload` in sequence. See those for more info.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"disable-dependency-detection":{"name":"disable-dependency-detection","type":"boolean","description":"Disable \"smart\" file inclusion. By default, Zapier only includes files that are required by `index.js`. If you (or your dependencies) require files dynamically (such as with `require(someVar)`), then you may see \"Cannot find module\" errors. Disabling this may make your `build.zip` too large. If that's the case, try using the `includeInBuild` option in your `.zapierapprc`. See the docs about `includeInBuild` for more info.","allowNo":false},"skip-npm-install":{"name":"skip-npm-install","type":"boolean","description":"Skips installing a fresh copy of npm dependencies on build. Helpful for using `yarn` or local copies of dependencies.","hidden":true,"allowNo":false},"skip-validation":{"name":"skip-validation","type":"boolean","description":"Skips local pre-push validation checks, and remote validation check of the CLI app's schema and AppVersion integrity.","hidden":true,"allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"register":{"id":"register","description":"Register a new integration in your account, or update the existing one if a `.zapierapprc` file is found.\n\nThis command creates a new integration and links it in the `./.zapierapprc` file. If `.zapierapprc` already exists, it will ask you if you want to update the currently-linked integration, as opposed to creating a new one.\n\nAfter registering a new integration, you can run `zapier push` to build and upload your integration for use in the Zapier editor. This will change `.zapierapprc`, which identifies this directory as holding code for a specific integration.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier register","zapier register \"My Cool Integration\"","zapier register \"My Cool Integration\" --desc \"My Cool Integration helps you integrate your apps with the apps that you need.\" --no-subscribe","zapier register \"My Cool Integration\" --url \"https://www.zapier.com\" --audience private --role employee --category marketing-automation","zapier register --subscribe"],"flags":{"desc":{"name":"desc","type":"option","char":"D","description":"A sentence describing your app in 140 characters or less, e.g. \"Trello is a team collaboration tool to organize tasks and keep projects on track.\""},"url":{"name":"url","type":"option","char":"u","description":"The homepage URL of your app, e.g., https://example.com."},"audience":{"name":"audience","type":"option","char":"a","description":"Are you building a public or private integration?"},"role":{"name":"role","type":"option","char":"r","description":"What is your relationship with the app you're integrating with Zapier?"},"category":{"name":"category","type":"option","char":"c","description":"How would you categorize your app? Choose the most appropriate option for your app's core features."},"subscribe":{"name":"subscribe","type":"boolean","char":"s","description":"Get tips and recommendations about this integration along with our monthly newsletter that details the performance of your integration and the latest Zapier news.","allowNo":true},"yes":{"name":"yes","type":"boolean","char":"y","description":"Assume yes for all yes/no prompts. This flag will also update an existing integration (as opposed to registering a new one) if a .zapierapprc file is found.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"title","description":"Your integrations's public title. Asked interactively if not present."}]},"scaffold":{"id":"scaffold","description":"Add a starting trigger, create, search, or resource to your integration.\n\nThe first argument should be one of `trigger|search|create|resource` followed by the noun that this will act on (something like \"contact\" or \"deal\").\n\nThe scaffold command does two general things:\n\n* Creates a new file (such as `triggers/contact.js`)\n* Imports and registers it inside your `index.js`\n\nYou can mix and match several options to customize the created scaffold for your project.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier scaffold trigger contact","zapier scaffold search contact --dest=my_src/searches","zapier scaffold create contact --entry=src/index.js","zapier scaffold resource contact --force"],"flags":{"dest":{"name":"dest","type":"option","char":"d","description":"Specify the new file's directory. Use this flag when you want to create a different folder structure such as `src/triggers` instead of the default `triggers`. Defaults to `[triggers|searches|creates]/{noun}`."},"test-dest":{"name":"test-dest","type":"option","description":"Specify the new test file's directory. Use this flag when you want to create a different folder structure such as `src/triggers` instead of the default `triggers`. Defaults to `test/[triggers|searches|creates]/{noun}`."},"entry":{"name":"entry","type":"option","char":"e","description":"Supply the path to your integration's root (`index.js`). Only needed if your `index.js` is in a subfolder, like `src`.","default":"index.js"},"force":{"name":"force","type":"boolean","char":"f","description":"Should we overwrite an exisiting trigger/search/create file?","allowNo":false},"no-help":{"name":"no-help","type":"boolean","description":"When scaffolding, should we skip adding helpful intro comments? Useful if this isn't your first rodeo.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"actionType","required":true,"options":["trigger","search","create","resource"]},{"name":"noun","required":true}]},"test":{"id":"test","description":"Test your integration via the \"test\" script in your \"package.json\".\n\nThis command is a wrapper around `npm test` that also validates the structure of your integration and sets up extra environment variables.\n\nYou can pass any args/flags after a `--`; they will get forwarded onto your test script.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier test","zapier test --skip-validate -- -t 30000 --grep api","zapier test -- -fo --testNamePattern \"auth pass\""],"flags":{"skip-validate":{"name":"skip-validate","type":"boolean","description":"Forgo running `zapier validate` before tests are run. This will speed up tests if you're modifying functionality of an existing integration rather than adding new actions.","allowNo":false},"yarn":{"name":"yarn","type":"boolean","description":"Use `yarn` instead of `npm`. This happens automatically if there's a `yarn.lock` file, but you can manually force `yarn` if you run tests from a sub-directory.","allowNo":false},"pnpm":{"name":"pnpm","type":"boolean","description":"Use `pnpm` instead of `npm`. This happens automatically if there's a `pnpm-lock.yaml` file, but you can manually force `pnpm` if you run tests from a sub-directory.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"upload":{"id":"upload","description":"Upload the latest build of your integration to Zapier.\n\nThis command sends both build/build.zip and build/source.zip to Zapier for use.\n\nTypically we recommend using `zapier push`, which does a build and upload, rather than `upload` by itself.\n","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"validate":{"id":"validate","description":"Validate your integration.\n\nRun the standard validation routine powered by json-schema that checks your integration for any structural errors. This is the same routine that runs during `zapier build`, `zapier upload`, `zapier push` or even as a test in `zapier test`.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier validate","zapier validate --without-style","zapier validate --format json"],"flags":{"without-style":{"name":"without-style","type":"boolean","description":"Forgo pinging the Zapier server to run further checks.","allowNo":false},"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"versions":{"id":"versions","description":"List the versions of your integration available for use in the Zapier editor.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"cache:clear":{"id":"cache:clear","description":"Clear the cache data for a major version. \n\nThis command clears the cache data for a major version of your integration.\nThe job will be run in the background and may take some time to complete.\nYou can check `zapier history` to see the job status.\n","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier cache:clear","zapier cache:clear 2"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"majorVersion","description":"(Optional) The cache data will be deleted for this major version. If not provided, you must pick from a list of major versions for this integration.","required":false}]},"delete:integration":{"id":"delete:integration","description":"Delete your integration (including all versions).\n\nThis only works if there are no active users or Zaps on any version. If you only want to delete certain versions, use the `zapier delete:version` command instead. It's unlikely that you'll be able to run this on an app that you've pushed publicly, since there are usually still users.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["delete:app"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"delete:version":{"id":"delete:version","description":"Delete a specific version of your integration.\n\nThis only works if there are no users or Zaps on that version. You will probably need to have run `zapier migrate` and `zapier deprecate` before this command will work.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"Specify the version to delete. It must have no users or Zaps.","required":true}]},"env:get":{"id":"env:get","description":"Get environment variables for a version.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier env:get 1.2.3"],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"The version to get the environment for.","required":true}]},"env:set":{"id":"env:set","description":"Set environment variables for a version.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier env:set 1.2.3 SECRET=12345 OTHER=4321"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"The version to set the environment for. Values are copied forward when a new version is created, but this command will only ever affect the specified version.","required":true},{"name":"key-value pairs...","description":"The key-value pairs to set. Keys are case-insensitive. Each pair should be space separated and pairs should be separated by an `=`. For example: `A=123 B=456`"}]},"env:unset":{"id":"env:unset","description":"Unset environment variables for a version.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier env:unset 1.2.3 SECRET OTHER"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"The version to set the environment for.","required":true},{"name":"keys...","description":"The keys to unset. Keys are case-insensitive."}]},"team:add":{"id":"team:add","description":"Add a team member to your integration.\n\nThese users come in three levels:\n\n * `admin`, who can edit everything about the integration\n * `collaborator`, who has read-only access for the app, and will receive periodic email updates. These updates include quarterly health scores and more.\n * `subscriber`, who can't directly access the app, but will receive periodic email updates. These updates include quarterly health scores and more.\n\nTeam members can be freely added and removed.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["team:invite"],"examples":["zapier team:add bruce@wayne.com admin","zapier team:add robin@wayne.com collaborator \"Hey Robin, check out this app.\"","zapier team:add alfred@wayne.com subscriber \"Hey Alfred, check out this app.\""],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"email","description":"The user to be invited. If they don't have a Zapier account, they'll be prompted to create one.","required":true},{"name":"role","description":"The level the invited team member should be at. Admins can edit everything and get email updates. Collaborators have read-access to the app and get email updates. Subscribers only get email updates.","required":true,"options":["admin","collaborator","subscriber"]},{"name":"message","description":"A message sent in the email to your team member, if you need to provide context. Wrap the message in quotes to ensure spaces get saved."}]},"team:get":{"id":"team:get","description":"Get team members involved with your integration.\n\nThese users come in three levels:\n\n * `admin`, who can edit everything about the integration\n * `collaborator`, who has read-only access for the app, and will receive periodic email updates. These updates include quarterly health scores and more.\n * `subscriber`, who can't directly access the app, but will receive periodic email updates. These updates include quarterly health scores and more.\n\nUse the `zapier team:add` and `zapier team:remove` commands to modify your team.\n","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["team:list"],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"team:remove":{"id":"team:remove","description":"Remove a team member from all versions of your integration.\n\nAdmins will immediately lose write access to the integration.\nCollaborators will immediately lose read access to the integration.\nSubscribers won't receive future email updates.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["team:delete"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"users:add":{"id":"users:add","description":"Add a user to some or all versions of your integration.\n\nWhen this command is run, we'll send an email to the user inviting them to try your integration. You can track the status of that invite using the `zapier users:get` command.\n\nInvited users will be able to see your integration's name, logo, and description. They'll also be able to create Zaps using any available triggers and actions.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["users:invite"],"examples":["zapier users:add bruce@wayne.com","zapier users:add alfred@wayne.com 1.2.3"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Skip confirmation. Useful for running programatically.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"email","description":"The user to be invited. If they don't have a Zapier account, they'll be prompted to create one.","required":true},{"name":"version","description":"A version string (like 1.2.3). Optional, used only if you want to invite a user to a specific version instead of all versions."}]},"users:get":{"id":"users:get","description":"Get a list of users who have been invited to your integration.\n\nNote that this list of users is NOT a comprehensive list of everyone who is using your integration. It only includes users who were invited directly by email (using the `\u001b[36mzapier users:add\u001b[39m` command or the web UI). Users who joined by clicking links generated using the `\u001b[36mzapier user:links\u001b[39m` command won't show up here.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["users:list"],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"users:links":{"id":"users:links","description":"Get a list of links that are used to invite users to your integration.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"users:remove":{"id":"users:remove","description":"Remove a user from all versions of your integration.\n\nWhen this command is run, their Zaps will immediately turn off. They won't be able to use your app again until they're re-invited or it has gone public. In practice, this command isn't run often as it's very disruptive to users.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["users:delete"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Skips confirmation. Useful for running programatically.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"email","description":"The user to be removed.","required":true}]}}}
|
|
1
|
+
{"version":"15.0.1","commands":{"analytics":{"id":"analytics","description":"Show the status of the analytics that are collected. Also used to change what is collected.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier analytics --mode enabled"],"flags":{"mode":{"name":"mode","type":"option","char":"m","description":"Choose how much information to share. Anonymous mode drops the OS type and Zapier user id, but keeps command info. Identifying information is used only for debugging purposes.","options":["enabled","anonymous","disabled"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"build":{"id":"build","description":"Build a pushable zip from the current directory.\n\nThis command does the following:\n\n* Creates a temporary folder\n* Copies all code into the temporary folder\n* Adds an entry point: `zapierwrapper.js`\n* Generates and validates app definition.\n* Detects dependencies via browserify (optional, on by default)\n* Zips up all needed `.js` files. If you want to include more files, add a \"includeInBuild\" property (array with strings of regexp paths) to your `.zapierapprc`.\n* Moves the zip to `build/build.zip` and `build/source.zip` and deletes the temp folder\n\nThis command is typically followed by `zapier upload`.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"disable-dependency-detection":{"name":"disable-dependency-detection","type":"boolean","description":"Disable \"smart\" file inclusion. By default, Zapier only includes files that are required by `index.js`. If you (or your dependencies) require files dynamically (such as with `require(someVar)`), then you may see \"Cannot find module\" errors. Disabling this may make your `build.zip` too large. If that's the case, try using the `includeInBuild` option in your `.zapierapprc`. See the docs about `includeInBuild` for more info.","allowNo":false},"skip-npm-install":{"name":"skip-npm-install","type":"boolean","description":"Skips installing a fresh copy of npm dependencies on build. Helpful for using `yarn` or local copies of dependencies.","hidden":true,"allowNo":false},"skip-validation":{"name":"skip-validation","type":"boolean","description":"Skips local pre-push validation checks, and remote validation check of the CLI app's schema and AppVersion integrity.","hidden":true,"allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"convert":{"id":"convert","description":"Convert a Visual Builder integration to a CLI integration.\n\nThe resulting CLI integration will be identical to its Visual Builder version and ready to push and use immediately!\n\nIf you re-run this command on an existing directory it will leave existing files alone and not clobber them.\n\nYou'll need to do a `zapier push` before the new version is visible in the editor, but otherwise you're good to go.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"version":{"name":"version","type":"option","char":"v","description":"Convert a specific version. Required when converting a Visual Builder integration.","required":true},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"integrationId","description":"To get the integration/app ID, go to \"https://developer.zapier.com\", click on an integration, and copy the number directly after \"/app/\" in the URL.","required":true},{"name":"path","description":"Relative to your current path - IE: `.` for current directory.","required":true}]},"deprecate":{"id":"deprecate","description":"Mark a non-production version of your integration as deprecated, with removal by a certain date.\n\nUse this when an integration version will not be supported or start breaking at a known date.\n\nZapier will send an email warning users of the deprecation once a date is set, they'll start seeing it as \"Deprecated\" in the UI, and once the deprecation date arrives, if the Zaps weren't updated, they'll be paused and the users will be emailed again explaining what happened.\n\nAfter the deprecation date has passed it will be safe to delete that integration version.\n\nDo not use this if you have non-breaking changes, such as fixing help text.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier deprecate 1.2.3 2011-10-01"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"The version to deprecate.","required":true},{"name":"date","description":"The date (YYYY-MM-DD) when Zapier will make the specified version unavailable.","required":true}]},"describe":{"id":"describe","description":"Describe the current integration.\n\nThis command prints a human readable enumeration of your integrations's\ntriggers, searches, and creates as seen by Zapier. Useful to understand how your\nresources convert and relate to different actions.\n\n* **Noun**: your action's noun\n* **Label**: your action's label\n* **Resource**: the resource (if any) this action is tied to\n* **Available Methods**: testable methods for this action","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"history":{"id":"history","description":"Get the history of your integration.\n\nHistory includes all the changes made over the lifetime of your integration. This includes everything from creation, updates, migrations, admins, and invitee changes, as well as who made the change and when.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"init":{"id":"init","description":"Initialize a new Zapier integration with a project template.\n\nAfter running this, you'll have a new integration in the specified directory. If you re-run this command on an existing directory, it will prompt before overwriting any existing files.\n\nThis doesn't register or deploy the integration with Zapier - try the `zapier register` and `zapier push` commands for that!","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier init myapp","zapier init ./path/myapp --template oauth2"],"flags":{"template":{"name":"template","type":"option","char":"t","description":"The template to start your integration with.","options":["basic-auth","callback","custom-auth","digest-auth","dynamic-dropdown","files","minimal","oauth1-trello","oauth2","search-or-create","session-auth","typescript"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"path","description":"Where to create the new integration. If the directory doesn't exist, it will be created. If the directory isn't empty, we'll ask for confirmation","required":true}]},"integrations":{"id":"integrations","description":"List integrations you have admin access to.\n\nThis command also checks the current directory for a linked integration.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["apps"],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"jobs":{"id":"jobs","description":"Lists ongoing migration or promotion jobs for the current integration.\n\nA job represents a background process that will be queued up when users execute a \"migrate\" or \"promote\" command for the current integration.\n\nEach job will be added to the end of a queue of \"promote\" and \"migration\" jobs where the \"Job Stage\" will then be initialized with \"requested\".\n\nJob stages will then move to \"estimating\", \"in_progress\" and finally one of four \"end\" stages: \"complete\", \"aborted\", \"errored\" or \"paused\".\n\nJob times will vary as it depends on the size of the queue and how many users your integration has.\n\nJobs are returned from oldest to newest.\n","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier jobs"],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"link":{"id":"link","description":"Link the current directory with an existing integration.\n\nThis command generates a `.zapierapprc` file in the directory in which it's ran. This file ties this code to an integration and is referenced frequently during `push` and `validate` operations. This file should be checked into source control.\n\nIf you're starting an integration from scratch, use `zapier init` instead.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"login":{"id":"login","description":"Configure your `~/.zapierrc` with a deploy key.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"sso":{"name":"sso","type":"boolean","char":"s","description":"Use this flag if you log into Zapier a Single Sign-On (SSO) button and don't have a Zapier password.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"logout":{"id":"logout","description":"Deactivate your active deploy key and reset `~/.zapierrc`.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"logs":{"id":"logs","description":"Print recent logs.\n\nLogs are created when your integration is run as part of a Zap. They come from explicit calls to `z.console.log()`, usage of `z.request()`, and any runtime errors.\n\nThis won't show logs from running locally with `zapier test`, since those never hit our server.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"version":{"name":"version","type":"option","char":"v","description":"Filter logs to the specified version."},"status":{"name":"status","type":"option","char":"s","description":"Filter logs to only see errors or successes","options":["any","success","error"],"default":"any"},"type":{"name":"type","type":"option","char":"t","description":"See logs of the specified type","options":["console","bundle","http"],"default":"console"},"detailed":{"name":"detailed","type":"boolean","description":"See extra info, like request/response body and headers.","allowNo":false},"user":{"name":"user","type":"option","char":"u","description":"Only show logs for this user. Defaults to your account.","default":"me"},"limit":{"name":"limit","type":"option","description":"Cap the number of logs returned. Max is 50 (also the default)","default":50},"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"migrate":{"id":"migrate","description":"Migrate a percentage of users or a single user from one version of your integration to another.\n\nStart a migration to move users between different versions of your integration. You may also \"revert\" by simply swapping the from/to verion strings in the command line arguments (i.e. `zapier migrate 1.0.1 1.0.0`).\n\n**Only use this command to migrate users between non-breaking versions, use `zapier deprecate` if you have breaking changes!**\n\nMigration time varies based on the number of affected Zaps. Be patient and check `zapier jobs` to track the status. Or use `zapier history` if you want to see older jobs.\n\nSince a migration is only for non-breaking changes, users are not emailed about the update/migration. It will be a transparent process for them.\n\nWe recommend migrating a small subset of users first, via the percent argument, then watching error logs of the new version for any sort of odd behavior. When you feel confident there are no bugs, go ahead and migrate everyone. If you see unexpected errors, you can revert.\n\nYou can migrate a specific user's Zaps by using `--user` (i.e. `zapier migrate 1.0.0 1.0.1 --user=user@example.com`). This will migrate Zaps in any account the user is a member of where the following criteria is met.\n\n - The Zap is owned by the user.\n - The Zap is not shared.\n - The integration auth used is not shared.\n\nAlternatively, you can pass the `--account` flag, (i.e. `zapier migrate 1.0.0 1.0.1 --account=account@example.com`). This will migrate all users' Zaps, Private & Shared, within all accounts for which the specified user is a member.\n\n**The `--account` flag should be used cautiously as it can break shared Zaps for other users in Team or Company accounts.**\n\nYou cannot pass both `PERCENT` and `--user` or `--account`.\n\nYou cannot pass both `--user` and `--account`.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier migrate 1.0.0 1.0.1","zapier migrate 1.0.1 2.0.0 10","zapier migrate 2.0.0 2.0.1 --user=user@example.com","zapier migrate 2.0.0 2.0.1 --account=account@example.com"],"flags":{"user":{"name":"user","type":"option","description":"Migrates all of a users' Private Zaps within all accounts for which the specified user is a member"},"account":{"name":"account","type":"option","description":"Migrates all of a users' Zaps, Private & Shared, within all accounts for which the specified user is a member"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"fromVersion","description":"The version FROM which to migrate users.","required":true},{"name":"toVersion","description":"The version TO which to migrate users.","required":true},{"name":"percent","description":"Percentage (between 1 and 100) of users to migrate.","default":100}]},"promote":{"id":"promote","description":"Promote a specific version to public access.\n\nPromote an integration version into production (non-private) rotation, which means new users can use this integration version.\n\n* This **does** mark the version as the official public version - all other versions & users are grandfathered.\n* This does **NOT** build/upload or deploy a version to Zapier - you should `zapier push` first.\n* This does **NOT** move old users over to this version - `zapier migrate 1.0.0 1.0.1` does that.\n* This does **NOT** recommend old users stop using this version - `zapier deprecate 1.0.0 2017-01-01` does that.\n\nPromotes are an inherently safe operation for all existing users of your integration.\n\nIf your integration is private and passes our integration checks, this will give you a URL to a form where you can fill in additional information for your integration to go public. After reviewing, the Zapier team will approve to make it public if there are no issues or decline with feedback.\n\nCheck `zapier jobs` to track the status of the promotion. Or use `zapier history` if you want to see older jobs.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier promote 1.0.0"],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Automatically answer \"yes\" to any prompts. Useful if you want to avoid interactive prompts to run this command in CI.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"The version you want to promote.","required":true}]},"push":{"id":"push","description":"Build and upload the current integration.\n\nThis command is the same as running `zapier build` and `zapier upload` in sequence. See those for more info.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"disable-dependency-detection":{"name":"disable-dependency-detection","type":"boolean","description":"Disable \"smart\" file inclusion. By default, Zapier only includes files that are required by `index.js`. If you (or your dependencies) require files dynamically (such as with `require(someVar)`), then you may see \"Cannot find module\" errors. Disabling this may make your `build.zip` too large. If that's the case, try using the `includeInBuild` option in your `.zapierapprc`. See the docs about `includeInBuild` for more info.","allowNo":false},"skip-npm-install":{"name":"skip-npm-install","type":"boolean","description":"Skips installing a fresh copy of npm dependencies on build. Helpful for using `yarn` or local copies of dependencies.","hidden":true,"allowNo":false},"skip-validation":{"name":"skip-validation","type":"boolean","description":"Skips local pre-push validation checks, and remote validation check of the CLI app's schema and AppVersion integrity.","hidden":true,"allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"register":{"id":"register","description":"Register a new integration in your account, or update the existing one if a `.zapierapprc` file is found.\n\nThis command creates a new integration and links it in the `./.zapierapprc` file. If `.zapierapprc` already exists, it will ask you if you want to update the currently-linked integration, as opposed to creating a new one.\n\nAfter registering a new integration, you can run `zapier push` to build and upload your integration for use in the Zapier editor. This will change `.zapierapprc`, which identifies this directory as holding code for a specific integration.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier register","zapier register \"My Cool Integration\"","zapier register \"My Cool Integration\" --desc \"My Cool Integration helps you integrate your apps with the apps that you need.\" --no-subscribe","zapier register \"My Cool Integration\" --url \"https://www.zapier.com\" --audience private --role employee --category marketing-automation","zapier register --subscribe"],"flags":{"desc":{"name":"desc","type":"option","char":"D","description":"A sentence describing your app in 140 characters or less, e.g. \"Trello is a team collaboration tool to organize tasks and keep projects on track.\""},"url":{"name":"url","type":"option","char":"u","description":"The homepage URL of your app, e.g., https://example.com."},"audience":{"name":"audience","type":"option","char":"a","description":"Are you building a public or private integration?"},"role":{"name":"role","type":"option","char":"r","description":"What is your relationship with the app you're integrating with Zapier?"},"category":{"name":"category","type":"option","char":"c","description":"How would you categorize your app? Choose the most appropriate option for your app's core features."},"subscribe":{"name":"subscribe","type":"boolean","char":"s","description":"Get tips and recommendations about this integration along with our monthly newsletter that details the performance of your integration and the latest Zapier news.","allowNo":true},"yes":{"name":"yes","type":"boolean","char":"y","description":"Assume yes for all yes/no prompts. This flag will also update an existing integration (as opposed to registering a new one) if a .zapierapprc file is found.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"title","description":"Your integrations's public title. Asked interactively if not present."}]},"scaffold":{"id":"scaffold","description":"Add a starting trigger, create, search, or resource to your integration.\n\nThe first argument should be one of `trigger|search|create|resource` followed by the noun that this will act on (something like \"contact\" or \"deal\").\n\nThe scaffold command does two general things:\n\n* Creates a new file (such as `triggers/contact.js`)\n* Imports and registers it inside your `index.js`\n\nYou can mix and match several options to customize the created scaffold for your project.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier scaffold trigger contact","zapier scaffold search contact --dest=my_src/searches","zapier scaffold create contact --entry=src/index.js","zapier scaffold resource contact --force"],"flags":{"dest":{"name":"dest","type":"option","char":"d","description":"Specify the new file's directory. Use this flag when you want to create a different folder structure such as `src/triggers` instead of the default `triggers`. Defaults to `[triggers|searches|creates]/{noun}`."},"test-dest":{"name":"test-dest","type":"option","description":"Specify the new test file's directory. Use this flag when you want to create a different folder structure such as `src/triggers` instead of the default `triggers`. Defaults to `test/[triggers|searches|creates]/{noun}`."},"entry":{"name":"entry","type":"option","char":"e","description":"Supply the path to your integration's root (`index.js`). Only needed if your `index.js` is in a subfolder, like `src`.","default":"index.js"},"force":{"name":"force","type":"boolean","char":"f","description":"Should we overwrite an exisiting trigger/search/create file?","allowNo":false},"no-help":{"name":"no-help","type":"boolean","description":"When scaffolding, should we skip adding helpful intro comments? Useful if this isn't your first rodeo.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"actionType","required":true,"options":["trigger","search","create","resource"]},{"name":"noun","required":true}]},"test":{"id":"test","description":"Test your integration via the \"test\" script in your \"package.json\".\n\nThis command is a wrapper around `npm test` that also validates the structure of your integration and sets up extra environment variables.\n\nYou can pass any args/flags after a `--`; they will get forwarded onto your test script.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier test","zapier test --skip-validate -- -t 30000 --grep api","zapier test -- -fo --testNamePattern \"auth pass\""],"flags":{"skip-validate":{"name":"skip-validate","type":"boolean","description":"Forgo running `zapier validate` before tests are run. This will speed up tests if you're modifying functionality of an existing integration rather than adding new actions.","allowNo":false},"yarn":{"name":"yarn","type":"boolean","description":"Use `yarn` instead of `npm`. This happens automatically if there's a `yarn.lock` file, but you can manually force `yarn` if you run tests from a sub-directory.","allowNo":false},"pnpm":{"name":"pnpm","type":"boolean","description":"Use `pnpm` instead of `npm`. This happens automatically if there's a `pnpm-lock.yaml` file, but you can manually force `pnpm` if you run tests from a sub-directory.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"upload":{"id":"upload","description":"Upload the latest build of your integration to Zapier.\n\nThis command sends both build/build.zip and build/source.zip to Zapier for use.\n\nTypically we recommend using `zapier push`, which does a build and upload, rather than `upload` by itself.\n","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"validate":{"id":"validate","description":"Validate your integration.\n\nRun the standard validation routine powered by json-schema that checks your integration for any structural errors. This is the same routine that runs during `zapier build`, `zapier upload`, `zapier push` or even as a test in `zapier test`.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier validate","zapier validate --without-style","zapier validate --format json"],"flags":{"without-style":{"name":"without-style","type":"boolean","description":"Forgo pinging the Zapier server to run further checks.","allowNo":false},"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"versions":{"id":"versions","description":"List the versions of your integration available for use in the Zapier editor.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"cache:clear":{"id":"cache:clear","description":"Clear the cache data for a major version. \n\nThis command clears the cache data for a major version of your integration.\nThe job will be run in the background and may take some time to complete.\nYou can check `zapier history` to see the job status.\n","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier cache:clear","zapier cache:clear 2"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"majorVersion","description":"(Optional) The cache data will be deleted for this major version. If not provided, you must pick from a list of major versions for this integration.","required":false}]},"delete:integration":{"id":"delete:integration","description":"Delete your integration (including all versions).\n\nThis only works if there are no active users or Zaps on any version. If you only want to delete certain versions, use the `zapier delete:version` command instead. It's unlikely that you'll be able to run this on an app that you've pushed publicly, since there are usually still users.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["delete:app"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"delete:version":{"id":"delete:version","description":"Delete a specific version of your integration.\n\nThis only works if there are no users or Zaps on that version. You will probably need to have run `zapier migrate` and `zapier deprecate` before this command will work.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"Specify the version to delete. It must have no users or Zaps.","required":true}]},"env:get":{"id":"env:get","description":"Get environment variables for a version.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier env:get 1.2.3"],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"The version to get the environment for.","required":true}]},"env:set":{"id":"env:set","description":"Set environment variables for a version.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier env:set 1.2.3 SECRET=12345 OTHER=4321"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"The version to set the environment for. Values are copied forward when a new version is created, but this command will only ever affect the specified version.","required":true},{"name":"key-value pairs...","description":"The key-value pairs to set. Keys are case-insensitive. Each pair should be space separated and pairs should be separated by an `=`. For example: `A=123 B=456`"}]},"env:unset":{"id":"env:unset","description":"Unset environment variables for a version.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier env:unset 1.2.3 SECRET OTHER"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"version","description":"The version to set the environment for.","required":true},{"name":"keys...","description":"The keys to unset. Keys are case-insensitive."}]},"team:add":{"id":"team:add","description":"Add a team member to your integration.\n\nThese users come in three levels:\n\n * `admin`, who can edit everything about the integration\n * `collaborator`, who has read-only access for the app, and will receive periodic email updates. These updates include quarterly health scores and more.\n * `subscriber`, who can't directly access the app, but will receive periodic email updates. These updates include quarterly health scores and more.\n\nTeam members can be freely added and removed.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["team:invite"],"examples":["zapier team:add bruce@wayne.com admin","zapier team:add robin@wayne.com collaborator \"Hey Robin, check out this app.\"","zapier team:add alfred@wayne.com subscriber \"Hey Alfred, check out this app.\""],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"email","description":"The user to be invited. If they don't have a Zapier account, they'll be prompted to create one.","required":true},{"name":"role","description":"The level the invited team member should be at. Admins can edit everything and get email updates. Collaborators have read-access to the app and get email updates. Subscribers only get email updates.","required":true,"options":["admin","collaborator","subscriber"]},{"name":"message","description":"A message sent in the email to your team member, if you need to provide context. Wrap the message in quotes to ensure spaces get saved."}]},"team:get":{"id":"team:get","description":"Get team members involved with your integration.\n\nThese users come in three levels:\n\n * `admin`, who can edit everything about the integration\n * `collaborator`, who has read-only access for the app, and will receive periodic email updates. These updates include quarterly health scores and more.\n * `subscriber`, who can't directly access the app, but will receive periodic email updates. These updates include quarterly health scores and more.\n\nUse the `zapier team:add` and `zapier team:remove` commands to modify your team.\n","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["team:list"],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"team:remove":{"id":"team:remove","description":"Remove a team member from all versions of your integration.\n\nAdmins will immediately lose write access to the integration.\nCollaborators will immediately lose read access to the integration.\nSubscribers won't receive future email updates.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["team:delete"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"users:add":{"id":"users:add","description":"Add a user to some or all versions of your integration.\n\nWhen this command is run, we'll send an email to the user inviting them to try your integration. You can track the status of that invite using the `zapier users:get` command.\n\nInvited users will be able to see your integration's name, logo, and description. They'll also be able to create Zaps using any available triggers and actions.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["users:invite"],"examples":["zapier users:add bruce@wayne.com","zapier users:add alfred@wayne.com 1.2.3"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Skip confirmation. Useful for running programatically.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"email","description":"The user to be invited. If they don't have a Zapier account, they'll be prompted to create one.","required":true},{"name":"version","description":"A version string (like 1.2.3). Optional, used only if you want to invite a user to a specific version instead of all versions."}]},"users:get":{"id":"users:get","description":"Get a list of users who have been invited to your integration.\n\nNote that this list of users is NOT a comprehensive list of everyone who is using your integration. It only includes users who were invited directly by email (using the `\u001b[36mzapier users:add\u001b[39m` command or the web UI). Users who joined by clicking links generated using the `\u001b[36mzapier user:links\u001b[39m` command won't show up here.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["users:list"],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"users:links":{"id":"users:links","description":"Get a list of links that are used to invite users to your integration.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"flags":{"format":{"name":"format","type":"option","char":"f","description":"Change the way structured data is presented. If \"json\" or \"raw\", you can pipe the output of the command into other tools, such as jq.","options":["plain","json","raw","row","table"],"default":"table"},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[]},"users:remove":{"id":"users:remove","description":"Remove a user from all versions of your integration.\n\nWhen this command is run, their Zaps will immediately turn off. They won't be able to use your app again until they're re-invited or it has gone public. In practice, this command isn't run often as it's very disruptive to users.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":["users:delete"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Skips confirmation. Useful for running programatically.","allowNo":false},"debug":{"name":"debug","type":"boolean","char":"d","description":"Show extra debugging output.","allowNo":false},"invokedFromAnotherCommand":{"name":"invokedFromAnotherCommand","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"email","description":"The user to be removed.","required":true}]}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zapier-platform-cli",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.1",
|
|
4
4
|
"description": "The CLI for managing integrations in Zapier Developer Platform.",
|
|
5
5
|
"repository": "zapier/zapier-platform",
|
|
6
6
|
"homepage": "https://platform.zapier.com/",
|
|
@@ -64,10 +64,11 @@
|
|
|
64
64
|
"parse-gitignore": "0.5.1",
|
|
65
65
|
"prettier": "2.8.8",
|
|
66
66
|
"read": "2.1.0",
|
|
67
|
-
"semver": "7.5.
|
|
67
|
+
"semver": "7.5.2",
|
|
68
68
|
"string-length": "4.0.2",
|
|
69
69
|
"through2": "4.0.2",
|
|
70
70
|
"tmp": "0.2.1",
|
|
71
|
+
"traverse": "0.6.7",
|
|
71
72
|
"update-notifier": "5.1.0",
|
|
72
73
|
"yeoman-environment": "3.3.0",
|
|
73
74
|
"yeoman-generator": "5.9.0"
|
package/src/generators/index.js
CHANGED
package/src/utils/convert.js
CHANGED
|
@@ -3,6 +3,7 @@ const path = require('path');
|
|
|
3
3
|
const _ = require('lodash');
|
|
4
4
|
const prettier = require('prettier');
|
|
5
5
|
const semver = require('semver');
|
|
6
|
+
const traverse = require('traverse');
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
PACKAGE_VERSION,
|
|
@@ -16,7 +17,8 @@ const { snakeCase } = require('./misc');
|
|
|
16
17
|
const { getPackageLatestVersion } = require('./npm');
|
|
17
18
|
let { startSpinner, endSpinner } = require('./display');
|
|
18
19
|
|
|
19
|
-
const
|
|
20
|
+
const SCAFFOLD_TEMPLATE_DIR = path.join(__dirname, '../../scaffold');
|
|
21
|
+
const GENERATORS_TEMPLATE_DIR = path.join(__dirname, '../generators/templates');
|
|
20
22
|
|
|
21
23
|
// A placeholder that can be used to identify this is something we need to replace
|
|
22
24
|
// before generating the final code. See replacePlaceholders function. Make it really
|
|
@@ -29,10 +31,6 @@ const makePlaceholder = (replacement) => `${REPLACE_DIRECTIVE}${replacement}`;
|
|
|
29
31
|
const replacePlaceholders = (str) =>
|
|
30
32
|
str.replace(new RegExp(`"${REPLACE_DIRECTIVE}([^"]+)"`, 'g'), '$1');
|
|
31
33
|
|
|
32
|
-
const quote = (s) => `'${s}'`;
|
|
33
|
-
|
|
34
|
-
const escapeSpecialChars = (s) => s.replace(/\n/g, '\\n').replace(/'/g, "\\'");
|
|
35
|
-
|
|
36
34
|
const createFile = async (content, filename, dir) => {
|
|
37
35
|
const destFile = path.join(dir, filename);
|
|
38
36
|
await ensureDir(path.dirname(destFile));
|
|
@@ -139,7 +137,7 @@ const renderPackageJson = async (appInfo, appDefinition) => {
|
|
|
139
137
|
description,
|
|
140
138
|
main: 'index.js',
|
|
141
139
|
scripts: {
|
|
142
|
-
test: '
|
|
140
|
+
test: 'jest --testTimeout 10000',
|
|
143
141
|
},
|
|
144
142
|
engines: {
|
|
145
143
|
node: `>=${LAMBDA_VERSION}`,
|
|
@@ -147,8 +145,7 @@ const renderPackageJson = async (appInfo, appDefinition) => {
|
|
|
147
145
|
},
|
|
148
146
|
dependencies,
|
|
149
147
|
devDependencies: {
|
|
150
|
-
|
|
151
|
-
should: '^13.2.0',
|
|
148
|
+
jest: '^29.6.0',
|
|
152
149
|
},
|
|
153
150
|
private: true,
|
|
154
151
|
zapier: zapierMeta,
|
|
@@ -157,171 +154,65 @@ const renderPackageJson = async (appInfo, appDefinition) => {
|
|
|
157
154
|
return prettifyJSON(pkg);
|
|
158
155
|
};
|
|
159
156
|
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
exportBlock.operation[funcName] = makePlaceholder(funcName);
|
|
157
|
+
const renderSource = (definition, functions = {}) => {
|
|
158
|
+
traverse(definition).forEach(function (source) {
|
|
159
|
+
if (this.key === 'source') {
|
|
160
|
+
const args = this.parent.node.args || ['z', 'bundle'];
|
|
161
|
+
// Find first parent that is not an array (applies to inputFields)
|
|
162
|
+
const funcNameBase = this.path
|
|
163
|
+
.slice(0, -1)
|
|
164
|
+
.reverse()
|
|
165
|
+
.find((key) => !/^\d+$/.test(key));
|
|
166
|
+
let funcName = funcNameBase;
|
|
167
|
+
let funcNum = 0;
|
|
168
|
+
while (functions[funcName]) {
|
|
169
|
+
funcNum++;
|
|
170
|
+
funcName = `${funcNameBase}${funcNum}`;
|
|
176
171
|
}
|
|
177
|
-
|
|
178
|
-
|
|
172
|
+
functions[funcName] = `const ${funcName} = async (${args.join(
|
|
173
|
+
', '
|
|
174
|
+
)}) => {\n${source}\n};`;
|
|
179
175
|
|
|
180
|
-
|
|
181
|
-
const fields = definition.operation[key];
|
|
182
|
-
if (Array.isArray(fields) && fields.length > 0) {
|
|
183
|
-
// Godzilla currently doesn't allow mutliple dynamic fields (see PDE-948) but when it does, this will account for it
|
|
184
|
-
let funcNum = 0;
|
|
185
|
-
fields.forEach((maybeFunc, index) => {
|
|
186
|
-
if (maybeFunc.source) {
|
|
187
|
-
const args = maybeFunc.args || ['z', 'bundle'];
|
|
188
|
-
// always increment the number, but only return a value if it's > 0
|
|
189
|
-
const funcName = `get${_.upperFirst(key)}${
|
|
190
|
-
funcNum ? funcNum++ : ++funcNum && ''
|
|
191
|
-
}`;
|
|
192
|
-
functionBlock.push(
|
|
193
|
-
`const ${funcName} = async (${args.join(', ')}) => {\n${
|
|
194
|
-
maybeFunc.source
|
|
195
|
-
}\n};`
|
|
196
|
-
);
|
|
197
|
-
|
|
198
|
-
exportBlock.operation[key][index] = makePlaceholder(funcName);
|
|
199
|
-
}
|
|
200
|
-
});
|
|
176
|
+
this.parent.update(makePlaceholder(funcName));
|
|
201
177
|
}
|
|
202
178
|
});
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const renderDefinitionSlice = (definitionSlice) => {
|
|
182
|
+
let exportBlock = _.cloneDeep(definitionSlice);
|
|
183
|
+
let functionBlock = {};
|
|
184
|
+
|
|
185
|
+
renderSource(exportBlock, functionBlock);
|
|
203
186
|
|
|
204
187
|
exportBlock = `module.exports = ${replacePlaceholders(
|
|
205
188
|
JSON.stringify(exportBlock)
|
|
206
189
|
)};\n`;
|
|
207
190
|
|
|
208
|
-
functionBlock = functionBlock.join('\n\n');
|
|
191
|
+
functionBlock = Object.values(functionBlock).join('\n\n');
|
|
209
192
|
|
|
210
193
|
return prettifyJs(functionBlock + '\n\n' + exportBlock);
|
|
211
194
|
};
|
|
212
195
|
|
|
213
|
-
|
|
214
|
-
const renderAuthData = (appDefinition) => {
|
|
215
|
-
const fieldKeys = getAuthFieldKeys(appDefinition);
|
|
216
|
-
const lines = _.map(fieldKeys, (key) => {
|
|
217
|
-
const upperKey = _.snakeCase(key).toUpperCase();
|
|
218
|
-
return `"${key}": process.env.${upperKey}`;
|
|
219
|
-
});
|
|
220
|
-
if (_.isEmpty(lines)) {
|
|
221
|
-
return `{
|
|
222
|
-
// TODO: Put your custom auth data here
|
|
223
|
-
}`;
|
|
224
|
-
}
|
|
225
|
-
return '{' + lines.join(',\n') + '}';
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const renderDefaultInputData = (definition) => {
|
|
229
|
-
const lines = [];
|
|
230
|
-
|
|
231
|
-
if (definition.inputFields) {
|
|
232
|
-
definition.inputFields.forEach((field) => {
|
|
233
|
-
if (field.default || field.required) {
|
|
234
|
-
const defaultValue = field.default
|
|
235
|
-
? quote(escapeSpecialChars(field.default))
|
|
236
|
-
: null;
|
|
237
|
-
lines.push(`'${field.key}': ${defaultValue}`);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
if (lines.length === 0) {
|
|
243
|
-
return '{}';
|
|
244
|
-
}
|
|
245
|
-
return `{
|
|
246
|
-
// TODO: Pulled from input fields' default values. Edit if necessary.
|
|
247
|
-
${lines.join(',\n')}
|
|
248
|
-
}`;
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
const renderStepTest = async (stepType, definition, appDefinition) => {
|
|
252
|
-
const templateName = {
|
|
253
|
-
triggers: 'trigger-test.template.js',
|
|
254
|
-
creates: 'create-test.template.js',
|
|
255
|
-
searches: 'search-test.template.js',
|
|
256
|
-
}[stepType];
|
|
257
|
-
|
|
196
|
+
const renderStepTest = async (stepType, definition) => {
|
|
258
197
|
const templateContext = {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
198
|
+
ACTION_PLURAL: stepType,
|
|
199
|
+
KEY: definition.key,
|
|
200
|
+
MAYBE_RESOURCE: '',
|
|
262
201
|
};
|
|
263
202
|
|
|
264
|
-
const templateFile = path.join(
|
|
203
|
+
const templateFile = path.join(SCAFFOLD_TEMPLATE_DIR, 'test.template.js');
|
|
265
204
|
return renderTemplate(templateFile, templateContext);
|
|
266
205
|
};
|
|
267
206
|
|
|
268
|
-
const renderAuth = async (appDefinition) =>
|
|
269
|
-
|
|
270
|
-
let functionBlock = [];
|
|
207
|
+
const renderAuth = async (appDefinition) =>
|
|
208
|
+
renderDefinitionSlice(appDefinition.authentication);
|
|
271
209
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
connectionLabel: 'getConnectionLabel',
|
|
275
|
-
test: 'testAuth',
|
|
276
|
-
},
|
|
277
|
-
(funcName, key) => {
|
|
278
|
-
const func = appDefinition.authentication[key];
|
|
279
|
-
if (func && func.source) {
|
|
280
|
-
const args = func.args || ['z', 'bundle'];
|
|
281
|
-
functionBlock.push(
|
|
282
|
-
`const ${funcName} = async (${args.join(', ')}) => {${func.source}};`
|
|
283
|
-
);
|
|
284
|
-
|
|
285
|
-
exportBlock[key] = makePlaceholder(funcName);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
);
|
|
289
|
-
|
|
290
|
-
exportBlock = `module.exports = ${replacePlaceholders(
|
|
291
|
-
JSON.stringify(exportBlock)
|
|
292
|
-
)};\n`;
|
|
293
|
-
|
|
294
|
-
functionBlock = functionBlock.join('\n\n');
|
|
295
|
-
|
|
296
|
-
return prettifyJs(functionBlock + '\n\n' + exportBlock);
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
const renderHydrators = async (appDefinition) => {
|
|
300
|
-
let exportBlock = _.cloneDeep(appDefinition.hydrators);
|
|
301
|
-
let functionBlock = [];
|
|
302
|
-
|
|
303
|
-
_.each(appDefinition.hydrators, (func, funcName) => {
|
|
304
|
-
if (func && func.source) {
|
|
305
|
-
const args = func.args || ['z', 'bundle'];
|
|
306
|
-
functionBlock.push(
|
|
307
|
-
`const ${funcName} = async (${args.join(', ')}) => {${func.source}};`
|
|
308
|
-
);
|
|
309
|
-
exportBlock[funcName] = makePlaceholder(funcName);
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
exportBlock = `module.exports = ${replacePlaceholders(
|
|
314
|
-
JSON.stringify(exportBlock)
|
|
315
|
-
)};\n`;
|
|
316
|
-
|
|
317
|
-
functionBlock = functionBlock.join('\n\n');
|
|
318
|
-
|
|
319
|
-
return prettifyJs(functionBlock + '\n\n' + exportBlock);
|
|
320
|
-
};
|
|
210
|
+
const renderHydrators = async (appDefinition) =>
|
|
211
|
+
renderDefinitionSlice(appDefinition.hydrators);
|
|
321
212
|
|
|
322
213
|
const renderIndex = async (appDefinition) => {
|
|
323
214
|
let exportBlock = _.cloneDeep(appDefinition);
|
|
324
|
-
let functionBlock =
|
|
215
|
+
let functionBlock = {};
|
|
325
216
|
let importBlock = [];
|
|
326
217
|
|
|
327
218
|
// replace version and platformVersion with dynamic reference
|
|
@@ -360,22 +251,7 @@ const renderIndex = async (appDefinition) => {
|
|
|
360
251
|
exportBlock.hydrators = makePlaceholder('hydrators');
|
|
361
252
|
}
|
|
362
253
|
|
|
363
|
-
|
|
364
|
-
const middlewares = appDefinition[middlewareType];
|
|
365
|
-
if (middlewares && middlewares.length > 0) {
|
|
366
|
-
// Backend converter always generates only one middleware
|
|
367
|
-
const func = middlewares[0];
|
|
368
|
-
if (func.source) {
|
|
369
|
-
const args = func.args || ['z', 'bundle'];
|
|
370
|
-
const funcName = middlewareType;
|
|
371
|
-
functionBlock.push(
|
|
372
|
-
`const ${funcName} = async (${args.join(', ')}) => {${func.source}};`
|
|
373
|
-
);
|
|
374
|
-
|
|
375
|
-
exportBlock[middlewareType][0] = makePlaceholder(funcName);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
});
|
|
254
|
+
renderSource(exportBlock, functionBlock);
|
|
379
255
|
|
|
380
256
|
if (appDefinition.legacy && appDefinition.legacy.scriptingSource) {
|
|
381
257
|
importBlock.push("\nconst fs = require('fs');");
|
|
@@ -390,7 +266,7 @@ const renderIndex = async (appDefinition) => {
|
|
|
390
266
|
)};`;
|
|
391
267
|
|
|
392
268
|
importBlock = importBlock.join('\n');
|
|
393
|
-
functionBlock = functionBlock.join('\n\n');
|
|
269
|
+
functionBlock = Object.values(functionBlock).join('\n\n');
|
|
394
270
|
|
|
395
271
|
return prettifyJs(
|
|
396
272
|
importBlock + '\n\n' + functionBlock + '\n\n' + exportBlock
|
|
@@ -408,19 +284,13 @@ const renderEnvironment = (appDefinition) => {
|
|
|
408
284
|
|
|
409
285
|
const writeStep = async (stepType, definition, key, newAppDir) => {
|
|
410
286
|
const filename = `${stepType}/${snakeCase(key)}.js`;
|
|
411
|
-
const content = await
|
|
287
|
+
const content = await renderDefinitionSlice(definition);
|
|
412
288
|
await createFile(content, filename, newAppDir);
|
|
413
289
|
};
|
|
414
290
|
|
|
415
|
-
const writeStepTest = async (
|
|
416
|
-
stepType
|
|
417
|
-
definition
|
|
418
|
-
key,
|
|
419
|
-
appDefinition,
|
|
420
|
-
newAppDir
|
|
421
|
-
) => {
|
|
422
|
-
const filename = `test/${stepType}/${snakeCase(key)}.js`;
|
|
423
|
-
const content = await renderStepTest(stepType, definition, appDefinition);
|
|
291
|
+
const writeStepTest = async (stepType, definition, key, newAppDir) => {
|
|
292
|
+
const filename = `test/${stepType}/${snakeCase(key)}.test.js`;
|
|
293
|
+
const content = await renderStepTest(stepType, definition);
|
|
424
294
|
await createFile(content, filename, newAppDir);
|
|
425
295
|
};
|
|
426
296
|
|
|
@@ -458,7 +328,7 @@ const writeEnvironment = async (appDefinition, newAppDir) => {
|
|
|
458
328
|
};
|
|
459
329
|
|
|
460
330
|
const writeGitIgnore = async (newAppDir) => {
|
|
461
|
-
const srcPath = path.join(
|
|
331
|
+
const srcPath = path.join(GENERATORS_TEMPLATE_DIR, '/gitignore');
|
|
462
332
|
const destPath = path.join(newAppDir, '/.gitignore');
|
|
463
333
|
await copyFile(srcPath, destPath);
|
|
464
334
|
};
|
|
@@ -489,7 +359,7 @@ const convertApp = async (appInfo, appDefinition, newAppDir) => {
|
|
|
489
359
|
_.each(appDefinition[stepType], (definition, key) => {
|
|
490
360
|
promises.push(
|
|
491
361
|
writeStep(stepType, definition, key, newAppDir),
|
|
492
|
-
writeStepTest(stepType, definition, key,
|
|
362
|
+
writeStepTest(stepType, definition, key, newAppDir)
|
|
493
363
|
);
|
|
494
364
|
});
|
|
495
365
|
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
require('should');
|
|
2
|
-
|
|
3
|
-
const zapier = require('zapier-platform-core');
|
|
4
|
-
|
|
5
|
-
const App = require('../../index');
|
|
6
|
-
const appTester = zapier.createAppTester(App);
|
|
7
|
-
|
|
8
|
-
describe('Create - <%= key %>', () => {
|
|
9
|
-
zapier.tools.env.inject();
|
|
10
|
-
|
|
11
|
-
it('should create an object', async () => {
|
|
12
|
-
const bundle = {
|
|
13
|
-
authData: <%= authData %>,
|
|
14
|
-
<% if (inputData) { %>
|
|
15
|
-
inputData: <%= inputData %>
|
|
16
|
-
<% } %>
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const result = await appTester(App.creates['<%= key %>'].operation.perform, bundle);
|
|
20
|
-
result.should.not.be.an.Array();
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
npm-debug.log*
|
|
5
|
-
yarn-debug.log*
|
|
6
|
-
yarn-error.log*
|
|
7
|
-
|
|
8
|
-
# Runtime data
|
|
9
|
-
pids
|
|
10
|
-
*.pid
|
|
11
|
-
*.seed
|
|
12
|
-
*.pid.lock
|
|
13
|
-
|
|
14
|
-
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
15
|
-
lib-cov
|
|
16
|
-
|
|
17
|
-
# Coverage directory used by tools like istanbul
|
|
18
|
-
coverage
|
|
19
|
-
|
|
20
|
-
# nyc test coverage
|
|
21
|
-
.nyc_output
|
|
22
|
-
|
|
23
|
-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
24
|
-
.grunt
|
|
25
|
-
|
|
26
|
-
# Bower dependency directory (https://bower.io/)
|
|
27
|
-
bower_components
|
|
28
|
-
|
|
29
|
-
# node-waf configuration
|
|
30
|
-
.lock-wscript
|
|
31
|
-
|
|
32
|
-
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
33
|
-
build/
|
|
34
|
-
|
|
35
|
-
# Dependency directories
|
|
36
|
-
node_modules/
|
|
37
|
-
jspm_packages/
|
|
38
|
-
|
|
39
|
-
# Typescript v1 declaration files
|
|
40
|
-
typings/
|
|
41
|
-
|
|
42
|
-
# Optional npm cache directory
|
|
43
|
-
.npm
|
|
44
|
-
|
|
45
|
-
# Optional eslint cache
|
|
46
|
-
.eslintcache
|
|
47
|
-
|
|
48
|
-
# Optional REPL history
|
|
49
|
-
.node_repl_history
|
|
50
|
-
|
|
51
|
-
# Output of 'npm pack'
|
|
52
|
-
*.tgz
|
|
53
|
-
|
|
54
|
-
# Yarn Integrity file
|
|
55
|
-
.yarn-integrity
|
|
56
|
-
|
|
57
|
-
# environment variables file
|
|
58
|
-
.env
|
|
59
|
-
.environment
|
|
60
|
-
|
|
61
|
-
# next.js build output
|
|
62
|
-
.next
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%= name %>",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "<%= description %>",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "mocha --recursive -t 10000"
|
|
8
|
-
},
|
|
9
|
-
"engines": {
|
|
10
|
-
"node": ">=10",
|
|
11
|
-
"npm": ">=5.6.0"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"zapier-platform-core": "<%= coreVersion %>",
|
|
15
|
-
"zapier-platform-legacy-scripting-runner": "<%= runnerVersion %>"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"mocha": "^5.2.0",
|
|
19
|
-
"should": "^13.2.0"
|
|
20
|
-
},
|
|
21
|
-
"private": true,
|
|
22
|
-
"zapier": {
|
|
23
|
-
"convertedFromAppID": <%= appId %>,
|
|
24
|
-
"convertedByCLIVersion": "<%= cliVersion %>"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
require('should');
|
|
2
|
-
|
|
3
|
-
const zapier = require('zapier-platform-core');
|
|
4
|
-
|
|
5
|
-
const App = require('../../index');
|
|
6
|
-
const appTester = zapier.createAppTester(App);
|
|
7
|
-
|
|
8
|
-
describe('Search - <%= key %>', () => {
|
|
9
|
-
zapier.tools.env.inject();
|
|
10
|
-
|
|
11
|
-
it('should get an array', async () => {
|
|
12
|
-
const bundle = {
|
|
13
|
-
authData: <%= authData %>,
|
|
14
|
-
<% if (inputData) { %>
|
|
15
|
-
inputData: <%= inputData %>
|
|
16
|
-
<% } %>
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const results = await appTester(App.searches['<%= key %>'].operation.perform, bundle);
|
|
20
|
-
results.should.be.an.Array();
|
|
21
|
-
results.length.should.be.aboveOrEqual(1);
|
|
22
|
-
results[0].should.have.property('id');
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
require('should');
|
|
2
|
-
|
|
3
|
-
const zapier = require('zapier-platform-core');
|
|
4
|
-
|
|
5
|
-
const App = require('../../index');
|
|
6
|
-
const appTester = zapier.createAppTester(App);
|
|
7
|
-
|
|
8
|
-
describe('Trigger - <%= key %>', () => {
|
|
9
|
-
zapier.tools.env.inject();
|
|
10
|
-
|
|
11
|
-
it('should get an array', async () => {
|
|
12
|
-
const bundle = {
|
|
13
|
-
authData: <%= authData %>,
|
|
14
|
-
<% if (inputData) { %>
|
|
15
|
-
inputData: <%= inputData %>
|
|
16
|
-
<% } %>
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const results = await appTester(App.triggers['<%= key %>'].operation.perform, bundle);
|
|
20
|
-
results.should.be.an.Array();
|
|
21
|
-
});
|
|
22
|
-
});
|