zapier-platform-cli 18.6.0 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/package.json +1 -2
- package/src/bin/run +0 -24
- package/src/generators/templates/dynamic-dropdown/README.md +2 -2
- package/src/generators/templates/openai/README.md +1 -1
- package/src/oclif/hooks/getAppRegistrationFieldChoices.js +1 -1
- package/src/utils/analytics.js +1 -1
- package/src/utils/api.js +10 -10
- package/src/utils/build.js +5 -5
- package/src/utils/check-missing-app-info.js +1 -1
- package/src/utils/local.js +1 -1
- package/src/version-store.js +1 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zapier Platform CLI
|
|
2
2
|
|
|
3
|
-
This is the `zapier` CLI, which you can use to build integrations with Zapier.
|
|
3
|
+
This is the `zapier-platform` CLI, which you can use to build integrations with Zapier.
|
|
4
4
|
|
|
5
5
|
For documentation:
|
|
6
6
|
|
|
@@ -10,4 +10,6 @@ For documentation:
|
|
|
10
10
|
|
|
11
11
|
## Development
|
|
12
12
|
|
|
13
|
+
The published CLI exposes the **`zapier-platform`** command only (as of v19). The legacy **`zapier`** binary has been removed.
|
|
14
|
+
|
|
13
15
|
See [CONTRIBUTING.md](https://github.com/zapier/zapier-platform/blob/main/CONTRIBUTING.md) and [ARCHITECTURE.md](https://github.com/zapier/zapier-platform/blob/main/packages/cli/ARCHITECTURE.md) of this package in particular.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zapier-platform-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
4
4
|
"description": "The CLI for managing integrations in Zapier Developer Platform.",
|
|
5
5
|
"repository": "zapier/zapier-platform",
|
|
6
6
|
"homepage": "https://platform.zapier.com/",
|
|
@@ -72,7 +72,6 @@
|
|
|
72
72
|
"yamljs": "0.3.0"
|
|
73
73
|
},
|
|
74
74
|
"bin": {
|
|
75
|
-
"zapier": "./src/bin/run",
|
|
76
75
|
"zapier-platform": "./src/bin/run"
|
|
77
76
|
},
|
|
78
77
|
"oclif": {
|
package/src/bin/run
CHANGED
|
@@ -1,30 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const path = require('node:path');
|
|
4
|
-
|
|
5
3
|
(async () => {
|
|
6
4
|
const oclif = await import('@oclif/core');
|
|
7
5
|
await oclif.execute({ development: false, dir: __dirname });
|
|
8
|
-
|
|
9
|
-
// Show deprecation warning for the old "zapier" binary name
|
|
10
|
-
// Users can suppress this warning by setting ZAPIER_SUPPRESS_DEPRECATION_WARNING
|
|
11
|
-
if (!process.env.ZAPIER_SUPPRESS_DEPRECATION_WARNING) {
|
|
12
|
-
const msg =
|
|
13
|
-
'The "zapier" command is deprecated and will be removed in a future version. ' +
|
|
14
|
-
'Please use "zapier-platform" instead.\n' +
|
|
15
|
-
'To suppress this warning, set ZAPIER_SUPPRESS_DEPRECATION_WARNING in your environment.\n';
|
|
16
|
-
|
|
17
|
-
if (process.platform === 'win32') {
|
|
18
|
-
// On Windows, we cannot reliably detect which wrapper was invoked (zapier vs zapier-platform)
|
|
19
|
-
// because both wrappers point to the same script. Show a generic deprecation notice instead of a warning..
|
|
20
|
-
console.warn('\n[DEPRECATION NOTICE] ' + msg);
|
|
21
|
-
} else {
|
|
22
|
-
// On Unix, we can detect which symlink was used
|
|
23
|
-
const scriptPath = process.argv[1] || '';
|
|
24
|
-
const binName = path.basename(scriptPath, path.extname(scriptPath));
|
|
25
|
-
if (binName === 'zapier') {
|
|
26
|
-
console.warn('\n[DEPRECATION WARNING] ' + msg);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
6
|
})();
|
|
@@ -98,10 +98,10 @@ This integration uses the [Star Wars API](https://swapi.dev/) to demonstrate:
|
|
|
98
98
|
npm install
|
|
99
99
|
|
|
100
100
|
# Run tests
|
|
101
|
-
zapier test
|
|
101
|
+
zapier-platform test
|
|
102
102
|
|
|
103
103
|
# Push to Zapier
|
|
104
|
-
zapier push
|
|
104
|
+
zapier-platform push
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
Find out more on the latest docs: https://docs.zapier.com/platform
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# OpenAI
|
|
2
2
|
|
|
3
|
-
This Zapier integration project is generated by the `zapier init` CLI command. This integration in particular is using the OpenAI API to generate responses to prompts from users. For this integration, there is a `constants.js` file that will allow you to swap out the base URL and version of the API to swap if you are using an OpenAI compatible API to get started.
|
|
3
|
+
This Zapier integration project is generated by the `zapier-platform init` CLI command. This integration in particular is using the OpenAI API to generate responses to prompts from users. For this integration, there is a `constants.js` file that will allow you to swap out the base URL and version of the API to swap if you are using an OpenAI compatible API to get started.
|
|
@@ -23,7 +23,7 @@ module.exports = async function (options) {
|
|
|
23
23
|
|
|
24
24
|
this.config.enumFieldChoices = enumFieldChoices;
|
|
25
25
|
|
|
26
|
-
// This enables us to see all available options when running `zapier register --help`
|
|
26
|
+
// This enables us to see all available options when running `zapier-platform register --help`
|
|
27
27
|
const cmd = options.config.findCommand('register');
|
|
28
28
|
if (cmd && cmd.flags) {
|
|
29
29
|
if (cmd.flags.audience) {
|
package/src/utils/analytics.js
CHANGED
|
@@ -37,7 +37,7 @@ const recordAnalytics = async (command, isValidCommand, args, flags) => {
|
|
|
37
37
|
);
|
|
38
38
|
const integrationID = integrationIDKey ? args[integrationIDKey] : undefined;
|
|
39
39
|
|
|
40
|
-
// Some commands ( like "zapier convert" ) won't have an app directory when called.
|
|
40
|
+
// Some commands ( like "zapier-platform convert" ) won't have an app directory when called.
|
|
41
41
|
// Instead, having the app ID in the arguments.
|
|
42
42
|
// In this case, we fallback to using "integrationid" in arguments ( if it's there )
|
|
43
43
|
// and don't want to "explode" if appID is missing
|
package/src/utils/api.js
CHANGED
|
@@ -31,7 +31,7 @@ const readCredentials = (explodeIfMissing = true) => {
|
|
|
31
31
|
return Promise.resolve(
|
|
32
32
|
readFile(
|
|
33
33
|
constants.AUTH_LOCATION,
|
|
34
|
-
`Please run \`${colors.cyan('zapier login')}\`.`,
|
|
34
|
+
`Please run \`${colors.cyan('zapier-platform login')}\`.`,
|
|
35
35
|
)
|
|
36
36
|
.then((buf) => {
|
|
37
37
|
return JSON.parse(buf.toString());
|
|
@@ -236,9 +236,9 @@ const getWritableApp = async () => {
|
|
|
236
236
|
if (!linkedAppConfig.id) {
|
|
237
237
|
throw new Error(
|
|
238
238
|
`This project hasn't yet been associated with an existing Zapier integration.\n\nIf it's a brand new integration, run \`${colors.cyan(
|
|
239
|
-
'zapier register',
|
|
239
|
+
'zapier-platform register',
|
|
240
240
|
)}\`.\n\nIf this project already exists in your Zapier account, run \`${colors.cyan(
|
|
241
|
-
'zapier link',
|
|
241
|
+
'zapier-platform link',
|
|
242
242
|
)}\` instead.`,
|
|
243
243
|
);
|
|
244
244
|
}
|
|
@@ -255,7 +255,7 @@ const getWritableApp = async () => {
|
|
|
255
255
|
throw new Error(
|
|
256
256
|
`Your credentials are present, but invalid${
|
|
257
257
|
process.env.ZAPIER_BASE_ENDPOINT ? ' in this environment' : ''
|
|
258
|
-
}. Please run \`${colors.cyan('zapier login')}\` to resolve.`,
|
|
258
|
+
}. Please run \`${colors.cyan('zapier-platform login')}\` to resolve.`,
|
|
259
259
|
);
|
|
260
260
|
} else if (errOrRejectedResponse.status === 404) {
|
|
261
261
|
// if this fails, we know the issue is they can't see this app
|
|
@@ -263,12 +263,12 @@ const getWritableApp = async () => {
|
|
|
263
263
|
linkedAppConfig.id
|
|
264
264
|
} (or it doesn't exist${
|
|
265
265
|
process.env.ZAPIER_BASE_ENDPOINT ? ' in this environment.' : ''
|
|
266
|
-
}). Try running \`${colors.cyan('zapier link')}\` to correct that.${
|
|
266
|
+
}). Try running \`${colors.cyan('zapier-platform link')}\` to correct that.${
|
|
267
267
|
process.env.ZAPIER_BASE_ENDPOINT
|
|
268
268
|
? `\n\nFor local dev: make sure you've run \`${colors.cyan(
|
|
269
|
-
'zapier login',
|
|
269
|
+
'zapier-platform login',
|
|
270
270
|
)}\` and \`${colors.cyan(
|
|
271
|
-
'zapier register',
|
|
271
|
+
'zapier-platform register',
|
|
272
272
|
)}\` while providing ZAPIER_BASE_ENDPOINT.`
|
|
273
273
|
: ''
|
|
274
274
|
}`;
|
|
@@ -400,9 +400,9 @@ const downloadSourceZip = async (dst) => {
|
|
|
400
400
|
if (!linkedAppConfig.id) {
|
|
401
401
|
throw new Error(
|
|
402
402
|
`This project hasn't yet been associated with an existing Zapier integration.\n\nIf it's a brand new integration, run \`${colors.cyan(
|
|
403
|
-
'zapier register',
|
|
403
|
+
'zapier-platform register',
|
|
404
404
|
)}\`.\n\nIf this project already exists in your Zapier account, run \`${colors.cyan(
|
|
405
|
-
'zapier link',
|
|
405
|
+
'zapier-platform link',
|
|
406
406
|
)}\` instead.`,
|
|
407
407
|
);
|
|
408
408
|
}
|
|
@@ -439,7 +439,7 @@ const upload = async (
|
|
|
439
439
|
|
|
440
440
|
if (!fs.existsSync(fullZipPath)) {
|
|
441
441
|
throw new Error(
|
|
442
|
-
'Missing a built integration. Try running `zapier build` first.\nAlternatively, run `zapier push`, which will build and upload in one command.',
|
|
442
|
+
'Missing a built integration. Try running `zapier-platform build` first.\nAlternatively, run `zapier-platform push`, which will build and upload in one command.',
|
|
443
443
|
);
|
|
444
444
|
}
|
|
445
445
|
|
package/src/utils/build.js
CHANGED
|
@@ -492,7 +492,7 @@ const maybeNotifyAboutOutdated = async () => {
|
|
|
492
492
|
'package.json',
|
|
493
493
|
)} (${colors.grey(notifier.update.current)} → ${colors.green(
|
|
494
494
|
notifier.update.latest,
|
|
495
|
-
)}) and then running ${colors.red('zapier test')}.`,
|
|
495
|
+
)}) and then running ${colors.red('zapier-platform test')}.`,
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
498
|
}
|
|
@@ -707,12 +707,12 @@ const _buildFunc = async (
|
|
|
707
707
|
if (validationErrors.length) {
|
|
708
708
|
debug('\nErrors:\n', validationErrors, '\n');
|
|
709
709
|
throw new Error(
|
|
710
|
-
'We hit some validation errors, try running `zapier validate` to see them!',
|
|
710
|
+
'We hit some validation errors, try running `zapier-platform validate` to see them!',
|
|
711
711
|
);
|
|
712
712
|
}
|
|
713
713
|
|
|
714
714
|
// No need to mention specifically we're validating style checks as that's
|
|
715
|
-
// implied from `zapier validate`, though it happens as a separate process
|
|
715
|
+
// implied from `zapier-platform validate`, though it happens as a separate process
|
|
716
716
|
const styleChecksResponse = await validateApp(rawDefinition);
|
|
717
717
|
|
|
718
718
|
if (_.get(styleChecksResponse, ['errors', 'total_failures'])) {
|
|
@@ -722,7 +722,7 @@ const _buildFunc = async (
|
|
|
722
722
|
'\n',
|
|
723
723
|
);
|
|
724
724
|
throw new Error(
|
|
725
|
-
'We hit some style validation errors, try running `zapier validate` to see them!',
|
|
725
|
+
'We hit some style validation errors, try running `zapier-platform validate` to see them!',
|
|
726
726
|
);
|
|
727
727
|
}
|
|
728
728
|
|
|
@@ -736,7 +736,7 @@ const _buildFunc = async (
|
|
|
736
736
|
console.log(colors.yellow(`- ${issue.description}`));
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
|
-
console.log(colors.yellow('Run `zapier validate` for more details.'));
|
|
739
|
+
console.log(colors.yellow('Run `zapier-platform validate` for more details.'));
|
|
740
740
|
}
|
|
741
741
|
} else {
|
|
742
742
|
debug('\nWarning: Skipping Validation');
|
|
@@ -18,7 +18,7 @@ module.exports = (app) => {
|
|
|
18
18
|
throw new Error(
|
|
19
19
|
`Your integration is missing required info (${missingRequiredFields
|
|
20
20
|
.map((field) => field.cliName ?? field.apiName)
|
|
21
|
-
.join(', ')}). Please, run "zapier register" to add it.`,
|
|
21
|
+
.join(', ')}). Please, run "zapier-platform register" to add it.`,
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
|
package/src/utils/local.js
CHANGED
|
@@ -290,7 +290,7 @@ const getLocalAppHandler = async ({
|
|
|
290
290
|
);
|
|
291
291
|
} catch (err) {
|
|
292
292
|
err.message =
|
|
293
|
-
'Your ESM integration requires a compiled `dist/` directory. Run `zapier build` to compile your code first.\n\n' +
|
|
293
|
+
'Your ESM integration requires a compiled `dist/` directory. Run `zapier-platform build` to compile your code first.\n\n' +
|
|
294
294
|
err.message;
|
|
295
295
|
throw err;
|
|
296
296
|
}
|
package/src/version-store.js
CHANGED