zapier-platform-cli 11.0.0 → 11.2.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/LICENSE +1 -2
- package/README.md +121 -38
- package/oclif.manifest.json +1 -1
- package/package.json +5 -5
- package/src/generators/templates/files/test/creates.test.js +1 -1
- package/src/oclif/commands/describe.js +1 -1
- package/src/oclif/commands/env/set.js +6 -1
- package/src/oclif/commands/env/unset.js +5 -0
- package/src/utils/auth-files-codegen.js +2 -2
- package/src/utils/convert.js +9 -8
- package/src/utils/npm.js +1 -3
package/LICENSE
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
Copyright (c) Zapier, Inc.
|
|
2
2
|
|
|
3
|
-
This repository is part of Zapier Platform, of
|
|
4
|
-
https://zapier.com/platform/tos.
|
|
3
|
+
This repository is part of Zapier Platform. By downloading, installing, accessing, or using any part of the Zapier Platform, including this repository, you agree to the Zapier Platform Agreement, which can be found at: https://zapier.com/platform/tos. If you do not agree to the Zapier Platform Agreement, you may not download, install, access, or use any part of the Zapier Platform, including this repository.
|
package/README.md
CHANGED
|
@@ -22,11 +22,11 @@ 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/master/CHANGELOG.md).
|
|
24
24
|
|
|
25
|
-
This doc describes the latest CLI version (**11.
|
|
25
|
+
This doc describes the latest CLI version (**11.2.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
|
-
- CLI Docs: [9.
|
|
28
|
-
- CLI Reference: [9.
|
|
29
|
-
- Schema Docs: [9.
|
|
27
|
+
- CLI Docs: [10.2.0](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@10.2.0/packages/cli/README.md), [9.6.0](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@9.6.0/packages/cli/README.md), [8.4.2](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@8.4.2/packages/cli/README.md)
|
|
28
|
+
- CLI Reference: [10.2.0](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@10.2.0/packages/cli/docs/cli.md), [9.6.0](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@9.6.0/packages/cli/docs/cli.md), [8.4.2](https://github.com/zapier/zapier-platform/blob/zapier-platform-cli@8.4.2/packages/cli/docs/cli.md)
|
|
29
|
+
- Schema Docs: [10.2.0](https://github.com/zapier/zapier-platform/blob/zapier-platform-schema@10.2.0/packages/schema/docs/build/schema.md), [9.6.0](https://github.com/zapier/zapier-platform/blob/zapier-platform-schema@9.6.0/packages/schema/docs/build/schema.md), [8.4.2](https://github.com/zapier/zapier-platform/blob/zapier-platform-schema@8.4.2/packages/schema/docs/build/schema.md)
|
|
30
30
|
|
|
31
31
|
## Table of Contents
|
|
32
32
|
|
|
@@ -115,8 +115,10 @@ This doc describes the latest CLI version (**11.0.0**), as of this writing. If y
|
|
|
115
115
|
* [Halting Execution](#halting-execution)
|
|
116
116
|
* [Stale Authentication Credentials](#stale-authentication-credentials)
|
|
117
117
|
+ [v10 Breaking Change: Auth Refresh](#v10-breaking-change-auth-refresh)
|
|
118
|
+
* [Handling Throttled Requests](#handling-throttled-requests)
|
|
118
119
|
- [Testing](#testing)
|
|
119
120
|
* [Writing Unit Tests](#writing-unit-tests)
|
|
121
|
+
* [Using the `z` Object in Tests](#using-the-z-object-in-tests)
|
|
120
122
|
* [Mocking Requests](#mocking-requests)
|
|
121
123
|
* [Running Unit Tests](#running-unit-tests)
|
|
122
124
|
* [Testing & Environment Variables](#testing--environment-variables)
|
|
@@ -1000,14 +1002,16 @@ You can find more details on the definition for each by looking at the [Trigger
|
|
|
1000
1002
|
|
|
1001
1003
|
### Return Types
|
|
1002
1004
|
|
|
1003
|
-
Each of the 3 types of function expects a certain type of object. As of core v1.0.11, there are automated checks to let you know when you're trying to pass the wrong type back.
|
|
1005
|
+
Each of the 3 types of function expects a certain type of object. As of core v1.0.11, there are automated checks to let you know when you're trying to pass the wrong type back. For reference, each expects:
|
|
1004
1006
|
|
|
1005
1007
|
| Method | Return Type | Notes |
|
|
1006
1008
|
|---------|-------------|----------------------------------------------------------------------------------------------------------------------|
|
|
1007
|
-
| Trigger | Array | 0 or more objects
|
|
1008
|
-
| Search | Array | 0 or more objects.
|
|
1009
|
+
| Trigger | Array | 0 or more objects; passed to the [deduper](https://zapier.com/developer/documentation/v2/deduplication/) if polling |
|
|
1010
|
+
| Search | Array | 0 or more objects. Only the first object will be returned, so if len > 1, put the best match first |
|
|
1009
1011
|
| Action | Object | Return values are evaluated by [`isPlainObject`](https://lodash.com/docs#isPlainObject) |
|
|
1010
1012
|
|
|
1013
|
+
When a trigger function returns an empty array, the Zap will not trigger. For REST Hook triggers, this can be used to filter data if the available subscription options are not specific enough for the Zap's needs.
|
|
1014
|
+
|
|
1011
1015
|
### Fallback Sample
|
|
1012
1016
|
In cases where Zapier needs to show an example record to the user, but we are unable to get a live example from the API, Zapier will fallback to this hard-coded sample. This should reflect the data structure of the Trigger's perform method, and have dummy values that we can show to any user.
|
|
1013
1017
|
|
|
@@ -1308,24 +1312,21 @@ const App = {
|
|
|
1308
1312
|
issue: {
|
|
1309
1313
|
key: 'new_records',
|
|
1310
1314
|
// ...
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
},
|
|
1327
|
-
],
|
|
1328
|
-
},
|
|
1315
|
+
operation: {
|
|
1316
|
+
inputFields: [
|
|
1317
|
+
{
|
|
1318
|
+
key: 'spreadsheet_id',
|
|
1319
|
+
required: true,
|
|
1320
|
+
label: 'Spreadsheet',
|
|
1321
|
+
dynamic: 'spreadsheet.id.name',
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
key: 'worksheet_id',
|
|
1325
|
+
required: true,
|
|
1326
|
+
label: 'Worksheet',
|
|
1327
|
+
dynamic: 'worksheet.id.name',
|
|
1328
|
+
},
|
|
1329
|
+
],
|
|
1329
1330
|
},
|
|
1330
1331
|
},
|
|
1331
1332
|
},
|
|
@@ -1640,6 +1641,7 @@ The available errors are:
|
|
|
1640
1641
|
* `HaltedError` - Stops current operation, but will never turn off Zap. Read more on [Halting Execution](#halting-execution)
|
|
1641
1642
|
* `ExpiredAuthError` - Turns off Zap and emails user to manually reconnect. Read more on [Stale Authentication Credentials](#stale-authentication-credentials)
|
|
1642
1643
|
* `RefreshAuthError` - (OAuth2 or Session Auth) Tells Zapier to refresh credentials and retry operation. Read more on [Stale Authentication Credentials](#stale-authentication-credentials)
|
|
1644
|
+
* `ThrottledError` (_new in v11.2.0_) - Tells Zapier to retry the current operation after a delay specified in seconds. Read more on [Handling Throttled Requests](#handling-throttled-requests)
|
|
1643
1645
|
|
|
1644
1646
|
For more details on error handling in general, see [here](#error-handling).
|
|
1645
1647
|
|
|
@@ -1713,27 +1715,31 @@ This object holds the user's auth details and the data for the API requests.
|
|
|
1713
1715
|
|
|
1714
1716
|
### `bundle.inputData`
|
|
1715
1717
|
|
|
1716
|
-
`bundle.inputData` is user-provided data for this particular run of the trigger/search/create, as defined by the inputFields
|
|
1718
|
+
`bundle.inputData` is user-provided data for this particular run of the trigger/search/create, as defined by the `inputFields`. For example:
|
|
1717
1719
|
|
|
1718
1720
|
```js
|
|
1719
1721
|
{
|
|
1720
|
-
createdBy: 'his name is Bobby Flay'
|
|
1721
|
-
style: 'he cooks mediterranean'
|
|
1722
|
+
createdBy: 'his name is Bobby Flay',
|
|
1723
|
+
style: 'he cooks mediterranean',
|
|
1724
|
+
scheduledAt: "2021-09-09T09:00:00-07:00"
|
|
1722
1725
|
}
|
|
1723
1726
|
```
|
|
1724
1727
|
|
|
1725
1728
|
### `bundle.inputDataRaw`
|
|
1726
1729
|
|
|
1727
|
-
`bundle.inputDataRaw` is
|
|
1730
|
+
`bundle.inputDataRaw` is like `bundle.inputData`, but before processing such as interpreting friendly datetimes and rendering `{{curlies}}`:
|
|
1728
1731
|
|
|
1729
1732
|
```js
|
|
1730
1733
|
{
|
|
1731
|
-
createdBy: 'his name is {{123__chef_name}}'
|
|
1732
|
-
style: 'he cooks {{456__style}}'
|
|
1734
|
+
createdBy: 'his name is {{123__chef_name}}',
|
|
1735
|
+
style: 'he cooks {{456__style}}',
|
|
1736
|
+
scheduledAt: "today"
|
|
1733
1737
|
}
|
|
1734
1738
|
```
|
|
1735
1739
|
|
|
1736
|
-
> "curlies"
|
|
1740
|
+
> "curlies" represent data mapped in from previous steps. They take the form `{{NODE_ID__key_name}}`.
|
|
1741
|
+
|
|
1742
|
+
You'll usually want to use `bundle.inputData` instead.
|
|
1737
1743
|
|
|
1738
1744
|
### `bundle.meta`
|
|
1739
1745
|
|
|
@@ -1776,9 +1782,9 @@ const perform = async (z, bundle) => {
|
|
|
1776
1782
|
|
|
1777
1783
|
### `bundle.rawRequest`
|
|
1778
1784
|
|
|
1779
|
-
> `bundle.rawRequest` is only available in the `perform` for
|
|
1785
|
+
> `bundle.rawRequest` is only available in the `perform` for webhooks, `getAccessToken` for OAuth authentication methods, and `performResume` in a callback action.
|
|
1780
1786
|
|
|
1781
|
-
`bundle.rawRequest` holds raw information about the HTTP request that triggered the `perform` method or that represents the
|
|
1787
|
+
`bundle.rawRequest` holds raw information about the HTTP request that triggered the `perform` method or that represents the user's browser request that triggered the `getAccessToken` call:
|
|
1782
1788
|
|
|
1783
1789
|
```
|
|
1784
1790
|
{
|
|
@@ -1791,7 +1797,7 @@ const perform = async (z, bundle) => {
|
|
|
1791
1797
|
}
|
|
1792
1798
|
```
|
|
1793
1799
|
|
|
1794
|
-
|
|
1800
|
+
In `bundle.rawRequest`, headers other than `Content-Length` and `Content-Type` will be prefixed with `Http-`, and all headers will be named in Camel-Case. For example, the header `X-Time-GMT` would become `Http-X-Time-Gmt`.
|
|
1795
1801
|
|
|
1796
1802
|
### `bundle.cleanedRequest`
|
|
1797
1803
|
|
|
@@ -1819,7 +1825,7 @@ const perform = async (z, bundle) => {
|
|
|
1819
1825
|
|
|
1820
1826
|
> `bundle.outputData` is only available in the `performResume` in a callback action.
|
|
1821
1827
|
|
|
1822
|
-
`bundle.outputData` will return a whatever data you originally returned in the `perform
|
|
1828
|
+
`bundle.outputData` will return a whatever data you originally returned in the `perform`, allowing you to mix that with `bundle.rawRequest` or `bundle.cleanedRequest`.
|
|
1823
1829
|
|
|
1824
1830
|
|
|
1825
1831
|
### `bundle.targetUrl`
|
|
@@ -2119,6 +2125,7 @@ const handleErrors = (response, z) => {
|
|
|
2119
2125
|
} else if (response.status === 200 && response.data.success === false) {
|
|
2120
2126
|
throw new z.errors.Error(response.data.message, response.data.code);
|
|
2121
2127
|
}
|
|
2128
|
+
return response;
|
|
2122
2129
|
};
|
|
2123
2130
|
|
|
2124
2131
|
// This example only works on core v10+!
|
|
@@ -2618,6 +2625,28 @@ const yourAfterResponse = (resp) => {
|
|
|
2618
2625
|
};
|
|
2619
2626
|
```
|
|
2620
2627
|
|
|
2628
|
+
### Handling Throttled Requests
|
|
2629
|
+
|
|
2630
|
+
Since v11.2.0, there are two types of errors that can cause Zapier to throttle an operation and retry at a later time.
|
|
2631
|
+
This is useful if the API you're interfacing with is reports it is receiving too many requests, often indicated by
|
|
2632
|
+
receiving a response status code of 429.
|
|
2633
|
+
|
|
2634
|
+
If a response receives a status code of 429 and is not caught, Zapier will re-attempt the operation after a delay.
|
|
2635
|
+
The delay can be customized by the server response containing a
|
|
2636
|
+
[Retry-After](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header.
|
|
2637
|
+
|
|
2638
|
+
Another way to request Zapier retry an operation is to throw a `ThrottledError`, which may also optionally specify a
|
|
2639
|
+
delay in seconds:
|
|
2640
|
+
|
|
2641
|
+
```js
|
|
2642
|
+
const yourAfterResponse = (resp) => {
|
|
2643
|
+
if (resp.status === 429) {
|
|
2644
|
+
throw new ThrottledError('message here', 60); // Zapier will retry in 60 seconds
|
|
2645
|
+
}
|
|
2646
|
+
return resp;
|
|
2647
|
+
};
|
|
2648
|
+
```
|
|
2649
|
+
|
|
2621
2650
|
## Testing
|
|
2622
2651
|
|
|
2623
2652
|
You can write unit tests for your Zapier app that run locally, outside of the Zapier editor.
|
|
@@ -2665,6 +2694,60 @@ describe('triggers', () => {
|
|
|
2665
2694
|
|
|
2666
2695
|
```
|
|
2667
2696
|
|
|
2697
|
+
### Using the `z` Object in Tests
|
|
2698
|
+
|
|
2699
|
+
Introduced in `core@11.1.0`, `appTester` can now run arbitrary functions:
|
|
2700
|
+
|
|
2701
|
+
```js
|
|
2702
|
+
/* globals describe, expect, test */
|
|
2703
|
+
|
|
2704
|
+
const zapier = require('zapier-platform-core');
|
|
2705
|
+
|
|
2706
|
+
const App = require('../index');
|
|
2707
|
+
const appTester = zapier.createAppTester(App);
|
|
2708
|
+
|
|
2709
|
+
describe('triggers', () => {
|
|
2710
|
+
test('load recipes', async () => {
|
|
2711
|
+
const adHodResult = await appTester(
|
|
2712
|
+
// your in-line function takes the same [z, bundle] arguments as normal
|
|
2713
|
+
async (z, bundle) => {
|
|
2714
|
+
// requests are made using your integration's actual middleware
|
|
2715
|
+
// make sure to pass the normal `bundle` arg to `appTester` if your requests need auth
|
|
2716
|
+
const response = await z.request(
|
|
2717
|
+
'https://example.com/some/setup/method',
|
|
2718
|
+
{
|
|
2719
|
+
params: {
|
|
2720
|
+
numItems: bundle.inputData.someValue,
|
|
2721
|
+
},
|
|
2722
|
+
}
|
|
2723
|
+
);
|
|
2724
|
+
|
|
2725
|
+
return {
|
|
2726
|
+
// you can use all the functions on the `z` object
|
|
2727
|
+
someHash: z.hash('md5', 'mySecret'),
|
|
2728
|
+
data: response.data,
|
|
2729
|
+
};
|
|
2730
|
+
},
|
|
2731
|
+
{
|
|
2732
|
+
// you must provide auth data for authenticated requests
|
|
2733
|
+
// (just like running a normal trigger)
|
|
2734
|
+
authData: { token: 'some-api-key' },
|
|
2735
|
+
// put arbitrary function params in `inputData`
|
|
2736
|
+
inputData: {
|
|
2737
|
+
someValue: 3,
|
|
2738
|
+
},
|
|
2739
|
+
}
|
|
2740
|
+
);
|
|
2741
|
+
|
|
2742
|
+
expect(adHodResult.someHash).toEqual('a5beb6624e092adf7be31176c3079e64');
|
|
2743
|
+
expect(adHodResult.data).toEqual({ whatever: true });
|
|
2744
|
+
|
|
2745
|
+
// ... rest of test
|
|
2746
|
+
});
|
|
2747
|
+
});
|
|
2748
|
+
|
|
2749
|
+
```
|
|
2750
|
+
|
|
2668
2751
|
### Mocking Requests
|
|
2669
2752
|
|
|
2670
2753
|
While testing, it's useful to test your code without actually hitting any external services. [Nock](https://github.com/node-nock/nock) is a node.js utility that intercepts requests before they ever leave your computer. You can specify a response code, body, headers, and more. It works out of the box with `z.request` by setting up your `nock` before calling `appTester`.
|
|
@@ -3301,7 +3384,7 @@ Broadly speaking, all releases will continue to work indefinitely. While you nev
|
|
|
3301
3384
|
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).
|
|
3302
3385
|
|
|
3303
3386
|
<!-- TODO: if we decouple releases, change this -->
|
|
3304
|
-
The most recently released version of `cli` and `core` is **11.
|
|
3387
|
+
The most recently released version of `cli` and `core` is **11.2.0**. You can see the versions you're working with by running `zapier -v`.
|
|
3305
3388
|
|
|
3306
3389
|
To update `cli`, run `npm install -g zapier-platform-cli`.
|
|
3307
3390
|
|
|
@@ -3317,4 +3400,4 @@ You can get help by either emailing `partners@zapier.com` or by [joining our dev
|
|
|
3317
3400
|
|
|
3318
3401
|
## Developing on the CLI
|
|
3319
3402
|
|
|
3320
|
-
For Zapier employees, see [this quip doc](https://zapier.quip.com/bns4AxqwaMIm/Working-on-the-CLI-Platform-CoreSchemaCLI) for info about creating releases.
|
|
3403
|
+
For Zapier employees, see [this quip doc](https://zapier.quip.com/bns4AxqwaMIm/Working-on-the-CLI-Platform-CoreSchemaCLI) for info about creating releases.
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"11.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 Legacy Web Builder app or Visual Builder integration to a CLI integration.\n\nIf you're converting a **Legacy Web Builder** app: the new integration will have a dependency named zapier-platform-legacy-scripting-runner, a shim used to simulate behaviors that are specific to Legacy Web Builder. There could be differences on how the shim simulates and how Legacy Web Builder actually behaves on some edge cases, especially you have custom scripting code.\n\nIf you're converting a **Visual Builder** app, then it will be identical 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."},"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://zapier.com/app/developer\", 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 integraiton.\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":[]},"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 users 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\nOnly 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 history` to track the status.\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, 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 single user by using `--user` (i.e. `zapier migrate 1.0.0 1.0.1 --user=user@example.com`).","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"],"flags":{"user":{"name":"user","type":"option","description":"Migrate only this user"},"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.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier promote 1.0.0"],"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 you want 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.\n\nAfter running this, you can run `zapier push` to build and upload your integration for use in the Zapier editor.\n\nThis will change the `./.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\""],"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":"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},"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":[]},"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 two levels:\n\n * `admin`, who can edit everything about the integration\n * `subscriber`, who can't directly access the app, but will receive periodic email updates. These updates include quarterly health socores 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 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. Subscribers only get email updates.","required":true,"options":["admin","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 two levels:\n\n * `admin`, who can edit everything about the integration\n * `subscriber`, who can't directly access the app, but will receive periodic email updates. These updates include quarterly health socores 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. Subscribers 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":"11.2.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 Legacy Web Builder app or Visual Builder integration to a CLI integration.\n\nIf you're converting a **Legacy Web Builder** app: the new integration will have a dependency named zapier-platform-legacy-scripting-runner, a shim used to simulate behaviors that are specific to Legacy Web Builder. There could be differences on how the shim simulates and how Legacy Web Builder actually behaves on some edge cases, especially you have custom scripting code.\n\nIf you're converting a **Visual Builder** app, then it will be identical 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."},"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://zapier.com/app/developer\", 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":[]},"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 users 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\nOnly 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 history` to track the status.\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, 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 single user by using `--user` (i.e. `zapier migrate 1.0.0 1.0.1 --user=user@example.com`).","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"],"flags":{"user":{"name":"user","type":"option","description":"Migrate only this user"},"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.","pluginName":"zapier-platform-cli","pluginType":"core","aliases":[],"examples":["zapier promote 1.0.0"],"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 you want 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.\n\nAfter running this, you can run `zapier push` to build and upload your integration for use in the Zapier editor.\n\nThis will change the `./.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\""],"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":"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},"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":[]},"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 two levels:\n\n * `admin`, who can edit everything about the integration\n * `subscriber`, who can't directly access the app, but will receive periodic email updates. These updates include quarterly health socores 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 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. Subscribers only get email updates.","required":true,"options":["admin","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 two levels:\n\n * `admin`, who can edit everything about the integration\n * `subscriber`, who can't directly access the app, but will receive periodic email updates. These updates include quarterly health socores 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. Subscribers 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": "11.
|
|
3
|
+
"version": "11.2.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": ">=12"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"docs": "ZAPIER_BASE_ENDPOINT='' node scripts/docs.js && cp -r docs ../..",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"postversion": "git push && git push --tags",
|
|
32
32
|
"lint": "eslint src snippets",
|
|
33
33
|
"lint:fix": "eslint --fix src snippets",
|
|
34
|
-
"test": "NODE_ENV=test mocha -t 50000 --recursive src/tests",
|
|
35
|
-
"smoke-test": "NODE_ENV=test mocha -t 120000 --recursive src/smoke-tests",
|
|
34
|
+
"test": "cross-env NODE_ENV=test mocha -t 50000 --recursive src/tests",
|
|
35
|
+
"smoke-test": "cross-env NODE_ENV=test mocha -t 120000 --recursive src/smoke-tests",
|
|
36
36
|
"validate-templates": "./scripts/validate-app-templates.js",
|
|
37
37
|
"set-template-versions": "./scripts/set-app-template-versions.js",
|
|
38
38
|
"validate": "yarn test && yarn smoke-test && yarn lint"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"lodash": "4.17.21",
|
|
60
60
|
"marked": "2.0.3",
|
|
61
61
|
"marked-terminal": "4.1.1",
|
|
62
|
-
"node-fetch": "2.6.
|
|
62
|
+
"node-fetch": "2.6.6",
|
|
63
63
|
"ora": "5.4.0",
|
|
64
64
|
"parse-gitignore": "0.4.0",
|
|
65
65
|
"prettier": "2.3.0",
|
|
@@ -14,7 +14,7 @@ const FILE_URL =
|
|
|
14
14
|
// This is what you get when doing `curl <FILE_URL> | sha1sum`
|
|
15
15
|
const EXPECTED_SHA1 = '3cf58b42a0fb1b7cc58de8110096841ece967530';
|
|
16
16
|
|
|
17
|
-
describe('uploadFile', () => {
|
|
17
|
+
describe.skip('uploadFile', () => {
|
|
18
18
|
test('upload file v10', async () => {
|
|
19
19
|
if (CORE_VERSION[0] < 10) {
|
|
20
20
|
console.warn(
|
|
@@ -194,7 +194,7 @@ class DescribeCommand extends BaseCommand {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
DescribeCommand.flags = buildFlags({ opts: { format: true } });
|
|
197
|
-
DescribeCommand.description = `Describe the current
|
|
197
|
+
DescribeCommand.description = `Describe the current integration.
|
|
198
198
|
|
|
199
199
|
This command prints a human readable enumeration of your integrations's
|
|
200
200
|
triggers, searches, and creates as seen by Zapier. Useful to understand how your
|
|
@@ -37,6 +37,11 @@ class SetEnvCommand extends BaseCommand {
|
|
|
37
37
|
}, {});
|
|
38
38
|
|
|
39
39
|
const app = await this.getWritableApp();
|
|
40
|
+
if (!app.all_versions.includes(version)) {
|
|
41
|
+
this.error(
|
|
42
|
+
`Version ${version} doesn't exist on integration "${app.title}"`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
40
45
|
|
|
41
46
|
const url = `/apps/${app.id}/versions/${version}/multi-environment`;
|
|
42
47
|
|
|
@@ -58,7 +63,7 @@ class SetEnvCommand extends BaseCommand {
|
|
|
58
63
|
const failedKeys = e.json.errors[0].split('update: ')[1].split(', ');
|
|
59
64
|
const successfulResult = omit(payload, failedKeys);
|
|
60
65
|
if (!Object.keys(successfulResult).length) {
|
|
61
|
-
this.error(e.json.errors);
|
|
66
|
+
this.error(e.json.errors[0]);
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
this.warn(successMessage(version));
|
|
@@ -34,6 +34,11 @@ class UnsetEnvCommand extends BaseCommand {
|
|
|
34
34
|
}, {});
|
|
35
35
|
|
|
36
36
|
const app = await this.getWritableApp();
|
|
37
|
+
if (!app.all_versions.includes(version)) {
|
|
38
|
+
this.error(
|
|
39
|
+
`Version ${version} doesn't exist on integration "${app.title}"`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
37
42
|
|
|
38
43
|
const url = `/apps/${app.id}/versions/${version}/multi-environment`;
|
|
39
44
|
|
|
@@ -404,13 +404,13 @@ const sessionAuthFile = () => {
|
|
|
404
404
|
obj(
|
|
405
405
|
objProperty('key', strLiteral('username')),
|
|
406
406
|
objProperty('label', strLiteral('Username')),
|
|
407
|
-
objProperty('required',
|
|
407
|
+
objProperty('required', 'true')
|
|
408
408
|
),
|
|
409
409
|
obj(
|
|
410
410
|
objProperty('key', strLiteral('password')),
|
|
411
411
|
objProperty('label', strLiteral('Password')),
|
|
412
412
|
objProperty('required', 'true'),
|
|
413
|
-
comment('this lets the user enter
|
|
413
|
+
comment('this lets the user enter masked data'),
|
|
414
414
|
objProperty('type', strLiteral('password'))
|
|
415
415
|
),
|
|
416
416
|
],
|
package/src/utils/convert.js
CHANGED
|
@@ -167,7 +167,9 @@ const renderStep = (type, definition) => {
|
|
|
167
167
|
if (func && func.source) {
|
|
168
168
|
const args = func.args || ['z', 'bundle'];
|
|
169
169
|
functionBlock.push(
|
|
170
|
-
`const ${funcName} = (${args.join(', ')}) => {\n${
|
|
170
|
+
`const ${funcName} = async (${args.join(', ')}) => {\n${
|
|
171
|
+
func.source
|
|
172
|
+
}\n};`
|
|
171
173
|
);
|
|
172
174
|
|
|
173
175
|
exportBlock.operation[funcName] = makePlaceholder(funcName);
|
|
@@ -188,7 +190,7 @@ const renderStep = (type, definition) => {
|
|
|
188
190
|
funcNum ? funcNum++ : ++funcNum && ''
|
|
189
191
|
}`;
|
|
190
192
|
functionBlock.push(
|
|
191
|
-
`const ${funcName} = (${args.join(', ')}) => {\n${
|
|
193
|
+
`const ${funcName} = async (${args.join(', ')}) => {\n${
|
|
192
194
|
maybeFunc.source
|
|
193
195
|
}\n};`
|
|
194
196
|
);
|
|
@@ -277,7 +279,7 @@ const renderAuth = async (appDefinition) => {
|
|
|
277
279
|
if (func && func.source) {
|
|
278
280
|
const args = func.args || ['z', 'bundle'];
|
|
279
281
|
functionBlock.push(
|
|
280
|
-
`const ${funcName} = (${args.join(', ')}) => {${func.source}};`
|
|
282
|
+
`const ${funcName} = async (${args.join(', ')}) => {${func.source}};`
|
|
281
283
|
);
|
|
282
284
|
|
|
283
285
|
exportBlock[key] = makePlaceholder(funcName);
|
|
@@ -302,7 +304,7 @@ const renderHydrators = async (appDefinition) => {
|
|
|
302
304
|
if (func && func.source) {
|
|
303
305
|
const args = func.args || ['z', 'bundle'];
|
|
304
306
|
functionBlock.push(
|
|
305
|
-
`const ${funcName} = (${args.join(', ')}) => {${func.source}};`
|
|
307
|
+
`const ${funcName} = async (${args.join(', ')}) => {${func.source}};`
|
|
306
308
|
);
|
|
307
309
|
exportBlock[funcName] = makePlaceholder(funcName);
|
|
308
310
|
}
|
|
@@ -347,9 +349,8 @@ const renderIndex = async (appDefinition) => {
|
|
|
347
349
|
importBlock.push(`const ${importName} = require('${filepath}');`);
|
|
348
350
|
|
|
349
351
|
delete exportBlock[stepType][key];
|
|
350
|
-
exportBlock[stepType][
|
|
351
|
-
makePlaceholder(
|
|
352
|
-
] = makePlaceholder(importName);
|
|
352
|
+
exportBlock[stepType][makePlaceholder(`[${importName}.key]`)] =
|
|
353
|
+
makePlaceholder(importName);
|
|
353
354
|
});
|
|
354
355
|
}
|
|
355
356
|
);
|
|
@@ -368,7 +369,7 @@ const renderIndex = async (appDefinition) => {
|
|
|
368
369
|
const args = func.args || ['z', 'bundle'];
|
|
369
370
|
const funcName = middlewareType;
|
|
370
371
|
functionBlock.push(
|
|
371
|
-
`const ${funcName} = (${args.join(', ')}) => {${func.source}};`
|
|
372
|
+
`const ${funcName} = async (${args.join(', ')}) => {${func.source}};`
|
|
372
373
|
);
|
|
373
374
|
|
|
374
375
|
exportBlock[middlewareType][0] = makePlaceholder(funcName);
|
package/src/utils/npm.js
CHANGED
|
@@ -11,9 +11,7 @@ const getPackageLatestVersion = async (name) => {
|
|
|
11
11
|
|
|
12
12
|
const getPackageSize = async (name, version) => {
|
|
13
13
|
const baseUrl = `${BASE_URL}/${name}`;
|
|
14
|
-
const res = await fetch(`${baseUrl}/-/${name}-${version}.tgz
|
|
15
|
-
method: 'HEAD',
|
|
16
|
-
});
|
|
14
|
+
const res = await fetch(`${baseUrl}/-/${name}-${version}.tgz`);
|
|
17
15
|
return res.headers.get('content-length');
|
|
18
16
|
};
|
|
19
17
|
|