zapier-platform-cli 14.1.2 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-source.md +10 -2
- package/README.md +19 -11
- package/oclif.manifest.json +1 -1
- package/package.json +12 -12
- package/src/constants.js +25 -1
- package/src/oclif/commands/login.js +7 -1
- package/src/oclif/commands/promote.js +104 -17
- package/src/utils/changelog.js +40 -17
- package/src/utils/metadata.js +67 -0
- package/src/version-store.js +1 -0
package/README-source.md
CHANGED
|
@@ -413,6 +413,8 @@ The OAuth2 flow looks like this:
|
|
|
413
413
|
4. Zapier stores the `access_token` and uses it to make calls on behalf of the user.
|
|
414
414
|
5. (Optionally) Zapier can refresh the token if it expires.
|
|
415
415
|
|
|
416
|
+
> Note: When [building a public integration](https://platform.zapier.com/private_integrations/private-vs-public-integrations), the `redirect_uri` will change once the app is approved for publishing, to be more consistent with your app’s branding. Depending on your API, you may need to add this new `redirect_uri` to an allow list in order for users to continue connecting to your app on Zapier. To access the new `redirect_uri`, run `zapier describe` again once the app is published.
|
|
417
|
+
|
|
416
418
|
You are required to define:
|
|
417
419
|
|
|
418
420
|
* `authorizeUrl`: The authorization URL
|
|
@@ -770,14 +772,20 @@ When your action needs to accept an array of items, you can include an input fie
|
|
|
770
772
|
|
|
771
773
|
## Output Fields
|
|
772
774
|
|
|
773
|
-
On each trigger, search, or create in the operation directive - you can provide an array of objects as fields under the `outputFields`. Output Fields are what
|
|
775
|
+
On each trigger, search, or create in the operation directive - you can provide an array of objects as fields under the `outputFields`. Output Fields are what users see when they select a field provided by your trigger, search or create to map it to another.
|
|
774
776
|
|
|
775
777
|
Output Fields are optional, but can be used to:
|
|
776
778
|
|
|
779
|
+
|
|
777
780
|
- Define friendly labels for the returned fields. By default, we will *humanize* for example `my_key` as *My Key*.
|
|
778
781
|
- Make sure that custom fields that may not be found in every live sample and - since they're custom to the connected account - cannot be defined in the static sample, can still be mapped.
|
|
779
782
|
|
|
780
|
-
The [schema](https://github.com/zapier/zapier-platform/blob/main/packages/schema/docs/build/schema.md#fieldschema) for `outputFields` is shared with `inputFields` but only the `key` and `required` properties are relevant
|
|
783
|
+
The [schema](https://github.com/zapier/zapier-platform/blob/main/packages/schema/docs/build/schema.md#fieldschema) for `outputFields` is shared with `inputFields` but only the `key`, `label`, `type`, and `required` properties are relevant:
|
|
784
|
+
|
|
785
|
+
- `key` - includes the field when not present in the live sample. When no `label` property is provided, `key` will be *humanized* and displayed as the field name.
|
|
786
|
+
- `label` - defines the field name displayed to users.
|
|
787
|
+
- `type` - defines the type for static sample data. A [validation warning](https://platform.zapier.com/docs/integration-checks-reference#d024---static-sample-respects-output-field-definition) will be displayed if the static sample does not match the specified type.
|
|
788
|
+
- `required` - defines whether the field is required in static sample data. A [validation warning](https://platform.zapier.com/docs/integration-checks-reference#d024---static-sample-respects-output-field-definition) will be displayed if the value is true and the static sample does not contain the field.
|
|
781
789
|
|
|
782
790
|
Custom/Dynamic Output Fields are defined in the same way as [Custom/Dynamic Input Fields](#customdynamic-fields).
|
|
783
791
|
|
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 (**
|
|
25
|
+
This doc describes the latest CLI version (**15.0.0**), 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)
|
|
@@ -188,15 +188,15 @@ Zapier Platform CLI is designed to be used by development teams who collaborate
|
|
|
188
188
|
|
|
189
189
|
### Requirements
|
|
190
190
|
|
|
191
|
-
All Zapier CLI apps are run using Node.js `
|
|
191
|
+
All Zapier CLI apps are run using Node.js `v18`.
|
|
192
192
|
|
|
193
|
-
You can develop using any version of Node you'd like, but your eventual code must be compatible with `
|
|
193
|
+
You can develop using any version of Node you'd like, but your eventual code must be compatible with `v18`. If you're using features not yet available in `v18`, you can transpile your code to a compatible format with [Babel](https://babeljs.io/) (or similar).
|
|
194
194
|
|
|
195
|
-
To ensure stability for our users, we strongly encourage you run tests on `
|
|
195
|
+
To ensure stability for our users, we strongly encourage you run tests on `v18` sometime before your code reaches users. This can be done multiple ways.
|
|
196
196
|
|
|
197
197
|
Firstly, by using a CI tool (like [Travis CI](https://travis-ci.org/) or [Circle CI](https://circleci.com/), which are free for open source projects). We provide a sample [.travis.yml](https://github.com/zapier/zapier-platform/blob/main/example-apps/trigger/.travis.yml) file in our template apps to get you started.
|
|
198
198
|
|
|
199
|
-
Alternatively, you can change your local node version with tools such as [nvm](https://github.com/nvm-sh/nvm#installation-and-update). Then you can either swap to that version with `nvm use
|
|
199
|
+
Alternatively, you can change your local node version with tools such as [nvm](https://github.com/nvm-sh/nvm#installation-and-update). Then you can either swap to that version with `nvm use v18`, or do `nvm exec v18 zapier test` so you can run tests without having to switch versions while developing.
|
|
200
200
|
|
|
201
201
|
|
|
202
202
|
### Quick Setup Guide
|
|
@@ -771,6 +771,8 @@ The OAuth2 flow looks like this:
|
|
|
771
771
|
4. Zapier stores the `access_token` and uses it to make calls on behalf of the user.
|
|
772
772
|
5. (Optionally) Zapier can refresh the token if it expires.
|
|
773
773
|
|
|
774
|
+
> Note: When [building a public integration](https://platform.zapier.com/private_integrations/private-vs-public-integrations), the `redirect_uri` will change once the app is approved for publishing, to be more consistent with your app’s branding. Depending on your API, you may need to add this new `redirect_uri` to an allow list in order for users to continue connecting to your app on Zapier. To access the new `redirect_uri`, run `zapier describe` again once the app is published.
|
|
775
|
+
|
|
774
776
|
You are required to define:
|
|
775
777
|
|
|
776
778
|
* `authorizeUrl`: The authorization URL
|
|
@@ -1660,14 +1662,20 @@ const App = {
|
|
|
1660
1662
|
|
|
1661
1663
|
## Output Fields
|
|
1662
1664
|
|
|
1663
|
-
On each trigger, search, or create in the operation directive - you can provide an array of objects as fields under the `outputFields`. Output Fields are what
|
|
1665
|
+
On each trigger, search, or create in the operation directive - you can provide an array of objects as fields under the `outputFields`. Output Fields are what users see when they select a field provided by your trigger, search or create to map it to another.
|
|
1664
1666
|
|
|
1665
1667
|
Output Fields are optional, but can be used to:
|
|
1666
1668
|
|
|
1669
|
+
|
|
1667
1670
|
- Define friendly labels for the returned fields. By default, we will *humanize* for example `my_key` as *My Key*.
|
|
1668
1671
|
- Make sure that custom fields that may not be found in every live sample and - since they're custom to the connected account - cannot be defined in the static sample, can still be mapped.
|
|
1669
1672
|
|
|
1670
|
-
The [schema](https://github.com/zapier/zapier-platform/blob/main/packages/schema/docs/build/schema.md#fieldschema) for `outputFields` is shared with `inputFields` but only the `key` and `required` properties are relevant
|
|
1673
|
+
The [schema](https://github.com/zapier/zapier-platform/blob/main/packages/schema/docs/build/schema.md#fieldschema) for `outputFields` is shared with `inputFields` but only the `key`, `label`, `type`, and `required` properties are relevant:
|
|
1674
|
+
|
|
1675
|
+
- `key` - includes the field when not present in the live sample. When no `label` property is provided, `key` will be *humanized* and displayed as the field name.
|
|
1676
|
+
- `label` - defines the field name displayed to users.
|
|
1677
|
+
- `type` - defines the type for static sample data. A [validation warning](https://platform.zapier.com/docs/integration-checks-reference#d024---static-sample-respects-output-field-definition) will be displayed if the static sample does not match the specified type.
|
|
1678
|
+
- `required` - defines whether the field is required in static sample data. A [validation warning](https://platform.zapier.com/docs/integration-checks-reference#d024---static-sample-respects-output-field-definition) will be displayed if the value is true and the static sample does not contain the field.
|
|
1671
1679
|
|
|
1672
1680
|
Custom/Dynamic Output Fields are defined in the same way as [Custom/Dynamic Input Fields](#customdynamic-fields).
|
|
1673
1681
|
|
|
@@ -2386,7 +2394,7 @@ This behavior has changed periodically across major versions, which changes how/
|
|
|
2386
2394
|
|
|
2387
2395
|

|
|
2388
2396
|
|
|
2389
|
-
Ensure you're handling errors correctly for your platform version. The latest released version is **
|
|
2397
|
+
Ensure you're handling errors correctly for your platform version. The latest released version is **15.0.0**.
|
|
2390
2398
|
|
|
2391
2399
|
### HTTP Request Options
|
|
2392
2400
|
|
|
@@ -3041,7 +3049,7 @@ This makes it straightforward to integrate into your testing interface. For exam
|
|
|
3041
3049
|
```yaml
|
|
3042
3050
|
language: node_js
|
|
3043
3051
|
node_js:
|
|
3044
|
-
- "
|
|
3052
|
+
- "v18"
|
|
3045
3053
|
before_script: npm install -g zapier-platform-cli
|
|
3046
3054
|
script: CLIENT_ID=1234 CLIENT_SECRET=abcd zapier test
|
|
3047
3055
|
```
|
|
@@ -3513,7 +3521,7 @@ InvalidParameterValueException An error occurred (InvalidParameterValueException
|
|
|
3513
3521
|
|
|
3514
3522
|
1. Edit `package.json` to depend on a later major version of `zapier-platform-core`. There's a list of all breaking changes (marked with a :exclamation:) in the [changelog](https://github.com/zapier/zapier-platform/blob/main/CHANGELOG.md).
|
|
3515
3523
|
2. Increment the `version` property in `package.json`
|
|
3516
|
-
3. Ensure you're using version `
|
|
3524
|
+
3. Ensure you're using version `v18` (or greater) of node locally (`node -v`). Use [nvm](https://github.com/nvm-sh/nvm) to use a different one if need be.
|
|
3517
3525
|
4. Run `rm -rf node_modules && npm i` to get a fresh copy of everything
|
|
3518
3526
|
5. Run `zapier test` to ensure your tests still pass
|
|
3519
3527
|
6. Run `zapier push`
|
|
@@ -3579,7 +3587,7 @@ Broadly speaking, all releases will continue to work indefinitely. While you nev
|
|
|
3579
3587
|
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).
|
|
3580
3588
|
|
|
3581
3589
|
<!-- TODO: if we decouple releases, change this -->
|
|
3582
|
-
The most recently released version of `cli` and `core` is **
|
|
3590
|
+
The most recently released version of `cli` and `core` is **15.0.0**. You can see the versions you're working with by running `zapier -v`.
|
|
3583
3591
|
|
|
3584
3592
|
To update `cli`, run `npm install -g zapier-platform-cli`.
|
|
3585
3593
|
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"14.1.2","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.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}]}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zapier-platform-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
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/",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"/oclif.manifest.json"
|
|
20
20
|
],
|
|
21
21
|
"engines": {
|
|
22
|
-
"node": ">=
|
|
22
|
+
"node": ">=16"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"docs": "ZAPIER_BASE_ENDPOINT='' node scripts/docs.js && cp -r docs ../..",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"validate": "yarn test && yarn smoke-test && yarn lint"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@oclif/command": "1.8.
|
|
42
|
-
"@oclif/config": "1.18.
|
|
41
|
+
"@oclif/command": "1.8.27",
|
|
42
|
+
"@oclif/config": "1.18.10",
|
|
43
43
|
"@oclif/plugin-autocomplete": "0.3.0",
|
|
44
44
|
"@oclif/plugin-help": "3.2.2",
|
|
45
45
|
"@oclif/plugin-not-found": "1.2.4",
|
|
@@ -49,28 +49,28 @@
|
|
|
49
49
|
"cli-table3": "0.6.3",
|
|
50
50
|
"colors": "1.4.0",
|
|
51
51
|
"debug": "4.3.4",
|
|
52
|
-
"fs-extra": "
|
|
52
|
+
"fs-extra": "11.1.1",
|
|
53
53
|
"gulp-filter": "7.0.0",
|
|
54
54
|
"gulp-prettier": "4.0.0",
|
|
55
55
|
"ignore": "5.2.4",
|
|
56
56
|
"inquirer": "8.2.5",
|
|
57
|
-
"jscodeshift": "0.
|
|
57
|
+
"jscodeshift": "0.15.0",
|
|
58
58
|
"klaw": "4.1.0",
|
|
59
59
|
"lodash": "4.17.21",
|
|
60
60
|
"marked": "4.2.12",
|
|
61
|
-
"marked-terminal": "5.
|
|
61
|
+
"marked-terminal": "5.2.0",
|
|
62
62
|
"node-fetch": "2.6.7",
|
|
63
63
|
"ora": "5.4.0",
|
|
64
64
|
"parse-gitignore": "0.5.1",
|
|
65
|
-
"prettier": "2.8.
|
|
66
|
-
"read": "2.
|
|
67
|
-
"semver": "7.
|
|
65
|
+
"prettier": "2.8.8",
|
|
66
|
+
"read": "2.1.0",
|
|
67
|
+
"semver": "7.5.1",
|
|
68
68
|
"string-length": "4.0.2",
|
|
69
69
|
"through2": "4.0.2",
|
|
70
70
|
"tmp": "0.2.1",
|
|
71
71
|
"update-notifier": "5.1.0",
|
|
72
72
|
"yeoman-environment": "3.3.0",
|
|
73
|
-
"yeoman-generator": "5.
|
|
73
|
+
"yeoman-generator": "5.9.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@oclif/dev-cli": "^1.26.10",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"litdoc": "1.5.6",
|
|
81
81
|
"markdown-toc": "^1",
|
|
82
82
|
"mock-fs": "^5.2.0",
|
|
83
|
-
"nock": "^13.3.
|
|
83
|
+
"nock": "^13.3.1",
|
|
84
84
|
"stdout-stderr": "0.1.13",
|
|
85
85
|
"yamljs": "0.3.0"
|
|
86
86
|
},
|
package/src/constants.js
CHANGED
|
@@ -26,7 +26,7 @@ const BLACKLISTED_PATHS = [
|
|
|
26
26
|
];
|
|
27
27
|
const NODE_VERSION = versionStore[versionStore.length - 1].nodeVersion;
|
|
28
28
|
const LAMBDA_VERSION = `v${NODE_VERSION}`;
|
|
29
|
-
const NODE_VERSION_CLI_REQUIRES = '>=
|
|
29
|
+
const NODE_VERSION_CLI_REQUIRES = '>=16'; // should be the oldest non-ETL version
|
|
30
30
|
const AUTH_KEY = 'deployKey';
|
|
31
31
|
const ANALYTICS_KEY = 'analyticsMode';
|
|
32
32
|
const ANALYTICS_MODES = {
|
|
@@ -59,6 +59,29 @@ const IS_TESTING =
|
|
|
59
59
|
|
|
60
60
|
const MAX_DESCRIPTION_LENGTH = 140;
|
|
61
61
|
|
|
62
|
+
const EXAMPLE_CHANGELOG = `
|
|
63
|
+
## 3.0.0
|
|
64
|
+
|
|
65
|
+
Made some changes that affect app actions
|
|
66
|
+
|
|
67
|
+
1. Update the trigger/pr_review action, as well as changes for #456
|
|
68
|
+
2. Fix trigger/new_card #208
|
|
69
|
+
3. New action! create/add_contact
|
|
70
|
+
|
|
71
|
+
However, we also addressed fixed open issues!
|
|
72
|
+
|
|
73
|
+
- Fix #123 and an issue with create/send_message
|
|
74
|
+
|
|
75
|
+
## 2.0.0
|
|
76
|
+
|
|
77
|
+
* Fix some bugs.
|
|
78
|
+
* Major docs fixes.
|
|
79
|
+
|
|
80
|
+
## 1.0.0
|
|
81
|
+
|
|
82
|
+
Initial release to public.
|
|
83
|
+
`;
|
|
84
|
+
|
|
62
85
|
module.exports = {
|
|
63
86
|
ANALYTICS_KEY,
|
|
64
87
|
ANALYTICS_MODES,
|
|
@@ -87,4 +110,5 @@ module.exports = {
|
|
|
87
110
|
SOURCE_PATH,
|
|
88
111
|
STARTER_REPO,
|
|
89
112
|
UPDATE_NOTIFICATION_INTERVAL,
|
|
113
|
+
EXAMPLE_CHANGELOG,
|
|
90
114
|
};
|
|
@@ -19,7 +19,13 @@ const { writeFile } = require('../../utils/files');
|
|
|
19
19
|
const { prettyJSONstringify } = require('../../utils/display');
|
|
20
20
|
const { isSamlEmail } = require('../../utils/credentials');
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const getDeployKeyUrl = () => {
|
|
23
|
+
const url = new URL(BASE_ENDPOINT);
|
|
24
|
+
url.hostname = `developer.${url.hostname}`;
|
|
25
|
+
url.pathname = 'partner-settings/deploy-keys/';
|
|
26
|
+
return url.href;
|
|
27
|
+
};
|
|
28
|
+
const DEPLOY_KEY_DASH_URL = getDeployKeyUrl();
|
|
23
29
|
|
|
24
30
|
const isValidTotpCode = (i) => {
|
|
25
31
|
const num = parseInt(i, 10);
|
|
@@ -8,6 +8,13 @@ const { callAPI } = require('../../utils/api');
|
|
|
8
8
|
const { flattenCheckResult } = require('../../utils/display');
|
|
9
9
|
const { getVersionChangelog } = require('../../utils/changelog');
|
|
10
10
|
const checkMissingAppInfo = require('../../utils/check-missing-app-info');
|
|
11
|
+
const { EXAMPLE_CHANGELOG } = require('../../constants');
|
|
12
|
+
|
|
13
|
+
const ACTION_TYPE_MAPPING = {
|
|
14
|
+
read: 'trigger',
|
|
15
|
+
write: 'create',
|
|
16
|
+
search: 'search',
|
|
17
|
+
};
|
|
11
18
|
|
|
12
19
|
const serializeErrors = (errors) => {
|
|
13
20
|
const opener = 'Promotion failed for the following reasons:\n\n';
|
|
@@ -25,6 +32,16 @@ const serializeErrors = (errors) => {
|
|
|
25
32
|
);
|
|
26
33
|
};
|
|
27
34
|
|
|
35
|
+
const hasAppChangeType = (metadata, changeType) => {
|
|
36
|
+
return Boolean(
|
|
37
|
+
metadata?.some(
|
|
38
|
+
// Existing property name
|
|
39
|
+
// eslint-disable-next-line camelcase
|
|
40
|
+
({ app_change_type }) => app_change_type === changeType
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
28
45
|
class PromoteCommand extends BaseCommand {
|
|
29
46
|
async perform() {
|
|
30
47
|
const app = await this.getWritableApp();
|
|
@@ -35,29 +52,88 @@ class PromoteCommand extends BaseCommand {
|
|
|
35
52
|
const assumeYes = 'yes' in this.flags;
|
|
36
53
|
|
|
37
54
|
let shouldContinue;
|
|
38
|
-
const changelog = await getVersionChangelog(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.log(`\n---\n${changelog}\n---\n`);
|
|
55
|
+
const { changelog, appMetadata, issueMetadata } = await getVersionChangelog(
|
|
56
|
+
version
|
|
57
|
+
);
|
|
42
58
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
const metadataPromptHelper = `Issues are indicated by ${colors.bold.underline(
|
|
60
|
+
'#<issueId>'
|
|
61
|
+
)}, and actions by ${colors.bold.underline(
|
|
62
|
+
'<trigger|create|search>/<key>'
|
|
63
|
+
)}. Note issue IDs must be numeric and action identifiers are case sensitive.`;
|
|
64
|
+
|
|
65
|
+
if (!changelog) {
|
|
66
|
+
this.error(`${colors.yellow(
|
|
67
|
+
'Warning!'
|
|
68
|
+
)} Changelog not found. Please create a CHANGELOG.md file with user-facing descriptions. Example:
|
|
69
|
+
${colors.cyan(EXAMPLE_CHANGELOG)}
|
|
70
|
+
If bugfixes or updates to actions are present, then should be marked on a line that begins with "Update" or "Fix" (case insensitive) and information that contains the identifier.
|
|
71
|
+
${metadataPromptHelper}`);
|
|
48
72
|
} else {
|
|
49
|
-
this.log(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
73
|
+
this.log(colors.green(`Changelog found for ${version}`));
|
|
74
|
+
this.log(`\n---\n${changelog}\n---`);
|
|
75
|
+
/* eslint-disable camelcase */
|
|
76
|
+
this.log(`\nParsed metadata:\n`);
|
|
77
|
+
|
|
78
|
+
const appFeatureUpdates =
|
|
79
|
+
appMetadata &&
|
|
80
|
+
appMetadata
|
|
81
|
+
.filter(({ app_change_type }) => app_change_type === 'FEATURE_UPDATE')
|
|
82
|
+
.map(
|
|
83
|
+
({ action_type, action_key }) =>
|
|
84
|
+
`${action_key}/${ACTION_TYPE_MAPPING[action_type]}`
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const issueFeatureUpdates =
|
|
88
|
+
issueMetadata &&
|
|
89
|
+
issueMetadata
|
|
90
|
+
.filter(({ app_change_type }) => app_change_type === 'FEATURE_UPDATE')
|
|
91
|
+
.map(({ issue_id }) => `#${issue_id}`);
|
|
92
|
+
|
|
93
|
+
if (appFeatureUpdates || issueFeatureUpdates) {
|
|
94
|
+
this.log(
|
|
95
|
+
`Feature updates: ${[
|
|
96
|
+
...appFeatureUpdates,
|
|
97
|
+
...issueFeatureUpdates,
|
|
98
|
+
].join(', ')}`
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const appBugfixes =
|
|
103
|
+
appMetadata &&
|
|
104
|
+
appMetadata
|
|
105
|
+
.filter(({ app_change_type }) => app_change_type === 'BUGFIX')
|
|
106
|
+
.map(
|
|
107
|
+
({ action_type, action_key }) =>
|
|
108
|
+
`${action_key}/${ACTION_TYPE_MAPPING[action_type]}`
|
|
109
|
+
);
|
|
110
|
+
const issueBugfixes =
|
|
111
|
+
issueMetadata &&
|
|
112
|
+
issueMetadata
|
|
113
|
+
.filter(({ app_change_type }) => app_change_type === 'BUGFIX')
|
|
114
|
+
.map(({ issue_id }) => `#${issue_id}`);
|
|
115
|
+
|
|
116
|
+
if (appBugfixes || issueBugfixes) {
|
|
117
|
+
this.log(`Bug fixes: ${[...appBugfixes, issueBugfixes].join(', ')}`);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (
|
|
121
|
+
!appFeatureUpdates &&
|
|
122
|
+
!issueFeatureUpdates &&
|
|
123
|
+
!appBugfixes &&
|
|
124
|
+
!issueBugfixes
|
|
125
|
+
) {
|
|
126
|
+
this.log(
|
|
127
|
+
`No metadata was found in the changelog. Remember, you can associate the changelog with issues or triggers/actions.\n\n${metadataPromptHelper}`
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
this.log();
|
|
131
|
+
/* eslint-enable camelcase */
|
|
56
132
|
|
|
57
133
|
shouldContinue =
|
|
58
134
|
assumeYes ||
|
|
59
135
|
(await this.confirm(
|
|
60
|
-
'Would you like to continue promoting
|
|
136
|
+
'Would you like to continue promoting with this changelog?'
|
|
61
137
|
));
|
|
62
138
|
}
|
|
63
139
|
|
|
@@ -69,11 +145,22 @@ class PromoteCommand extends BaseCommand {
|
|
|
69
145
|
`Preparing to promote version ${version} of your integration "${app.title}".`
|
|
70
146
|
);
|
|
71
147
|
|
|
148
|
+
const isFeatureUpdate =
|
|
149
|
+
hasAppChangeType(appMetadata, 'FEATURE_UPDATE') ||
|
|
150
|
+
hasAppChangeType(issueMetadata, 'FEATURE_UPDATE');
|
|
151
|
+
const isBugfix =
|
|
152
|
+
hasAppChangeType(appMetadata, 'BUGFIX') ||
|
|
153
|
+
hasAppChangeType(issueMetadata, 'BUGFIX');
|
|
72
154
|
const body = {
|
|
73
155
|
job: {
|
|
74
156
|
name: 'promote',
|
|
75
157
|
to_version: version,
|
|
76
158
|
changelog,
|
|
159
|
+
app_metadata: appMetadata,
|
|
160
|
+
loki_metadata: issueMetadata,
|
|
161
|
+
is_feature_update: isFeatureUpdate,
|
|
162
|
+
is_bugfix: isBugfix,
|
|
163
|
+
is_other: !isFeatureUpdate && !isBugfix,
|
|
77
164
|
},
|
|
78
165
|
};
|
|
79
166
|
|
package/src/utils/changelog.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
const _ = require('lodash');
|
|
2
1
|
const path = require('path');
|
|
3
2
|
|
|
4
3
|
const { readFile } = require('./files');
|
|
4
|
+
const { getMetadata } = require('./metadata');
|
|
5
|
+
|
|
6
|
+
const isAppMetadata = (obj) =>
|
|
7
|
+
obj?.app_change_type && obj?.action_key && obj?.action_type;
|
|
8
|
+
|
|
9
|
+
const isIssueMetadata = (obj) => obj?.app_change_type && obj?.issue_id;
|
|
10
|
+
|
|
11
|
+
// Turns an empty array into undefined so it will not be present in the body when sent
|
|
12
|
+
const absentIfEmpty = (arr) => (arr.length === 0 ? undefined : arr);
|
|
5
13
|
|
|
6
14
|
const getChangelogFromMarkdown = (version, markdown) => {
|
|
7
15
|
const lines = markdown
|
|
@@ -9,41 +17,56 @@ const getChangelogFromMarkdown = (version, markdown) => {
|
|
|
9
17
|
.replace(/\r/g, '\n')
|
|
10
18
|
.split('\n');
|
|
11
19
|
|
|
12
|
-
let startingLine =
|
|
13
|
-
RegExp(
|
|
20
|
+
let startingLine = lines.findIndex((line) =>
|
|
21
|
+
RegExp(`^#{1,4} .*${version.split('.').join('\\.')}`).test(line)
|
|
14
22
|
);
|
|
15
23
|
|
|
16
24
|
if (startingLine === -1) {
|
|
17
|
-
|
|
25
|
+
throw new Error(`Version '${version}' not found in changelog`);
|
|
18
26
|
}
|
|
19
27
|
|
|
20
|
-
|
|
21
|
-
startingLine += 2;
|
|
28
|
+
startingLine++;
|
|
22
29
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
);
|
|
30
|
+
// Find the next line that starts with one or more '#' chars
|
|
31
|
+
let endingLine = lines
|
|
32
|
+
.slice(startingLine)
|
|
33
|
+
.findIndex((line) => /^#{1,4} /.test(line));
|
|
28
34
|
|
|
29
35
|
if (endingLine === -1) {
|
|
30
36
|
endingLine = lines.length;
|
|
31
37
|
}
|
|
32
|
-
|
|
33
|
-
// Skip the line before the next version (expected blank)
|
|
34
|
-
endingLine -= 1;
|
|
38
|
+
endingLine += startingLine;
|
|
35
39
|
|
|
36
40
|
const changelogLines = lines.slice(startingLine, endingLine);
|
|
41
|
+
const changelog = [];
|
|
42
|
+
const appMetadata = [];
|
|
43
|
+
const issueMetadata = [];
|
|
44
|
+
|
|
45
|
+
for (const line of changelogLines) {
|
|
46
|
+
for (const metadata of getMetadata(line)) {
|
|
47
|
+
if (isAppMetadata(metadata)) {
|
|
48
|
+
appMetadata.push(metadata);
|
|
49
|
+
} else if (isIssueMetadata(metadata)) {
|
|
50
|
+
issueMetadata.push(metadata);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
changelog.push(line);
|
|
55
|
+
}
|
|
37
56
|
|
|
38
|
-
return
|
|
57
|
+
return {
|
|
58
|
+
changelog: changelog.join('\n').trim(),
|
|
59
|
+
appMetadata: absentIfEmpty(appMetadata),
|
|
60
|
+
issueMetadata: absentIfEmpty(issueMetadata),
|
|
61
|
+
};
|
|
39
62
|
};
|
|
40
63
|
|
|
41
|
-
const getVersionChangelog = (version, appDir = '.') => {
|
|
64
|
+
const getVersionChangelog = async (version, appDir = '.') => {
|
|
42
65
|
const file = path.resolve(appDir, 'CHANGELOG.md');
|
|
43
66
|
|
|
44
67
|
return readFile(file)
|
|
45
68
|
.then((buffer) => getChangelogFromMarkdown(version, buffer.toString()))
|
|
46
|
-
.catch(() => ''); // We're ignoring files that don't exist or that aren't readable
|
|
69
|
+
.catch(() => ({ changelog: '' })); // We're ignoring files that don't exist or that aren't readable
|
|
47
70
|
};
|
|
48
71
|
|
|
49
72
|
module.exports = {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const ACTION_TYPE_MAPPING = {
|
|
2
|
+
trigger: 'read',
|
|
3
|
+
create: 'write',
|
|
4
|
+
search: 'search',
|
|
5
|
+
};
|
|
6
|
+
const isValidActionType = (type) => type in ACTION_TYPE_MAPPING;
|
|
7
|
+
|
|
8
|
+
const bugfixMatches = new Set(['fix', 'fixed', 'fixes']);
|
|
9
|
+
const featureUpdateMatches = new Set([
|
|
10
|
+
'add',
|
|
11
|
+
'adds',
|
|
12
|
+
'added',
|
|
13
|
+
'improve',
|
|
14
|
+
'improves',
|
|
15
|
+
'improved',
|
|
16
|
+
'improvement',
|
|
17
|
+
'improvements',
|
|
18
|
+
'update',
|
|
19
|
+
'updates',
|
|
20
|
+
'updated',
|
|
21
|
+
'new',
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
const extractMetadata = (token, context) => {
|
|
25
|
+
if (!context) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const issueMetadata = token.match(/#(?<issueId>\d+)/);
|
|
29
|
+
if (Number.isInteger(Number(issueMetadata?.groups?.issueId))) {
|
|
30
|
+
return {
|
|
31
|
+
app_change_type: context,
|
|
32
|
+
issue_id: Number(issueMetadata?.groups?.issueId),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const appMetadata = token.match(
|
|
36
|
+
/(?<actionType>(trigger|create|search))\/(?<actionKey>\w+)/
|
|
37
|
+
);
|
|
38
|
+
if (
|
|
39
|
+
appMetadata?.groups?.actionKey &&
|
|
40
|
+
isValidActionType(appMetadata.groups.actionType)
|
|
41
|
+
) {
|
|
42
|
+
return {
|
|
43
|
+
app_change_type: context,
|
|
44
|
+
action_key: appMetadata.groups.actionKey,
|
|
45
|
+
action_type: ACTION_TYPE_MAPPING[appMetadata.groups.actionType],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function* metadataWalker(line) {
|
|
51
|
+
let context;
|
|
52
|
+
for (const token of line.split(' ')) {
|
|
53
|
+
if (bugfixMatches.has(token.toLowerCase())) {
|
|
54
|
+
context = 'BUGFIX';
|
|
55
|
+
} else if (featureUpdateMatches.has(token.toLowerCase())) {
|
|
56
|
+
context = 'FEATURE_UPDATE';
|
|
57
|
+
}
|
|
58
|
+
const metadata = extractMetadata(token, context);
|
|
59
|
+
if (metadata) {
|
|
60
|
+
yield metadata;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const getMetadata = (content) => Array.from(metadataWalker(content));
|
|
66
|
+
|
|
67
|
+
module.exports = { getMetadata };
|
package/src/version-store.js
CHANGED