Skip to content

Commit

Permalink
Merge branch 'main' into zapier-platform-major-release-17.0.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kreddlear committed Jan 31, 2025
2 parents 2d78ac1 + 0d13bba commit b13bd0c
Show file tree
Hide file tree
Showing 39 changed files with 340 additions and 122 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## 16.3.0

_released `2025-01-30`_

### cli

- :scroll: Update `pull` command help text to clarify `ynarxdeiH` options if file conflicts detected [#959](https://github.com/zapier/zapier-platform/pull/959)
- :tada: Add `--overwrite-partner-changes` flag in `push` command to help reduce partner integration clobbering (currently only supported for **internal** use) [#960](https://github.com/zapier/zapier-platform/pull/960)


## 16.2.0

_released `2025-01-21`_

### cli

- :tada: Require `--force` flag when updating production integration version environment variables via `env:set` or `env:unset` [#942](https://github.com/zapier/zapier-platform/pull/942)
- :tada: Run environment variable soft checks (which require user confirmation to proceed) during `promote` and `migrate` [#951](https://github.com/zapier/zapier-platform/pull/951)


## 16.1.1

_released `2025-01-13`_

### cli

- :bug: Fix "integration check reference" doc URL's anchor tags [#947](https://github.com/zapier/zapier-platform/pull/947)

## 16.1.0

Expand Down
2 changes: 1 addition & 1 deletion example-apps/babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"babel-polyfill": "6.26.0",
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"babel-cli": "6.26.0",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/basic-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^25.5.3"
Expand Down
2 changes: 1 addition & 1 deletion example-apps/callback/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^25.5.3"
Expand Down
2 changes: 1 addition & 1 deletion example-apps/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"mocha": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/custom-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^25.5.3"
Expand Down
2 changes: 1 addition & 1 deletion example-apps/digest-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^25.5.3"
Expand Down
2 changes: 1 addition & 1 deletion example-apps/dynamic-dropdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^29.6.0"
Expand Down
2 changes: 1 addition & 1 deletion example-apps/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0",
"zapier-platform-core": "16.3.0",
"form-data": "4.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion example-apps/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^26.6.3",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"lodash": "4.17.19",
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"mocha": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^25.5.3"
Expand Down
2 changes: 1 addition & 1 deletion example-apps/oauth1-trello/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^25.5.3"
Expand Down
2 changes: 1 addition & 1 deletion example-apps/oauth1-tumblr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"mocha": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/oauth1-twitter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"mocha": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/oauth2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^25.5.3"
Expand Down
2 changes: 1 addition & 1 deletion example-apps/onedrive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"content-disposition": "0.5.2",
"lodash": "4.17.11",
"node-fetch": "1.7.1",
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"eslint": "3.19.0",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/resource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"mocha": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/rest-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"mocha": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/search-or-create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^25.5.3"
Expand Down
2 changes: 1 addition & 1 deletion example-apps/search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"mocha": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/session-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "jest --testTimeout 10000"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"jest": "^25.5.3"
Expand Down
2 changes: 1 addition & 1 deletion example-apps/trigger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"mocha": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion example-apps/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"_zapier-build": "npm run build"
},
"dependencies": {
"zapier-platform-core": "16.1.0"
"zapier-platform-core": "16.3.0"
},
"devDependencies": {
"rimraf": "^5.0.10",
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ resources convert and relate to different actions.
* `key-value pairs...` | 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`

**Flags**
* `-f, --force` | Force the update of environment variables regardless if the app version is production or not. Use with caution.
* `-d, --debug` | Show extra debugging output.

**Examples**
Expand All @@ -242,6 +243,7 @@ resources convert and relate to different actions.
* `keys...` | The keys to unset. Keys are case-insensitive.

**Flags**
* `-f, --force` | Force the update of environment variables regardless if the app version is production or not. Use with caution.
* `-d, --debug` | Show extra debugging output.

**Examples**
Expand Down Expand Up @@ -512,6 +514,7 @@ You cannot pass both `--user` and `--account`.
**Flags**
* `--user` | Migrates all of a users' Private Zaps within all accounts for which the specified user is a member
* `--account` | Migrates all of a users' Zaps, Private & Shared, within all accounts for which the specified user is a member
* `-y, --yes` | Automatically answer "yes" to any prompts. Useful if you want to avoid interactive prompts to run this command in CI.
* `-d, --debug` | Show extra debugging output.

**Examples**
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zapier-platform-cli",
"version": "16.1.0",
"version": "16.3.0",
"description": "The CLI for managing integrations in Zapier Developer Platform.",
"repository": "zapier/zapier-platform",
"homepage": "https://platform.zapier.com/",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const PACKAGE_VERSION = packageJson.version;
const UPDATE_NOTIFICATION_INTERVAL = 1000 * 60 * 60 * 24 * 7; // one week

const CHECK_REF_DOC_LINK =
'https://docs.zapier.com/platform/publish/integration-checks-reference#integration-check-reference';
'https://docs.zapier.com/platform/publish/integration-checks-reference';

const ISSUES_URL =
'https://github.com/zapier/zapier-platform/issues/new/choose';
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/src/generators/pull.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ module.exports = class PullGenerator extends Generator {
name: 'confirm',
message: `Warning: You are about to overwrite existing files.
Before proceeding, please make sure you have saved your work. Consider creating a backup or saving your current state in a git branch. During the process, you may abort anytime by pressing 'x'.
Before proceeding, please make sure you have saved your work. Consider creating a backup or saving your current state in a git branch.
If presented with a series of options ('ynarxdeiH'), you may
press Enter to view more details about each option. For example, 'x' will abort the process.
Do you want to continue?`,
default: false,
Expand Down
39 changes: 28 additions & 11 deletions packages/cli/src/oclif/commands/env/set.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Args } = require('@oclif/core');
const { Args, Flags } = require('@oclif/core');
const { cyan } = require('colors/safe');
const { omit } = require('lodash');

Expand Down Expand Up @@ -45,21 +45,30 @@ class SetEnvCommand extends BaseCommand {
}

const url = `/apps/${app.id}/versions/${version}/multi-environment`;
const requestOptions = {
body: payload,
method: 'POST',
};

if (this.flags.force) {
requestOptions.extraHeaders = {
'X-Force-Env-Var-Update': 'true',
};
}

try {
// currently, this returns nothing
await callAPI(
url,
{
body: payload,
method: 'POST',
},
true,
);
await callAPI(url, requestOptions, true);

this.log(successMessage(version));
this.logJSON(payload);
} catch (e) {
if (e.status === 409) {
this.error(
`App version ${version} is the production version. Are you sure you want to set potentially live environment variables?` +
` If so, run this command again with the --force flag.`,
);
}

// comes back as json: { errors: [ 'The following keys failed to update: 3QER, 4WER' ] },
const failedKeys = e.json.errors[0].split('update: ')[1].split(', ');
const successfulResult = omit(payload, failedKeys);
Expand All @@ -85,7 +94,15 @@ SetEnvCommand.args = {
'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`',
}),
};
SetEnvCommand.flags = buildFlags();
SetEnvCommand.flags = buildFlags({
commandFlags: {
force: Flags.boolean({
char: 'f',
description:
'Force the update of environment variables regardless if the app version is production or not. Use with caution.',
}),
},
});
SetEnvCommand.description = `Set environment variables for a version.`;
SetEnvCommand.examples = [`zapier env:set 1.2.3 SECRET=12345 OTHER=4321`];
SetEnvCommand.strict = false;
Expand Down
Loading

0 comments on commit b13bd0c

Please sign in to comment.