auth0-deploy-cli 7.11.0 → 7.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [7.11.1] - 2022-05-04
11
+
12
+ ### Fixed
13
+
14
+ - Deployment of newly-created actions always failing due to "A draft must be in the 'built' state" error [#524]
15
+ - Undefined `updateRule` Auth0 SDK alias replaced with operational `rules.update` [#526]
16
+
10
17
  ## [7.11.0] - 2022-04-28
11
18
 
12
19
  ### Added
@@ -714,7 +721,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
714
721
  [#509]: https://github.com/auth0/auth0-deploy-cli/issues/509
715
722
  [#512]: https://github.com/auth0/auth0-deploy-cli/issues/512
716
723
  [#517]: https://github.com/auth0/auth0-deploy-cli/issues/517
717
- [unreleased]: https://github.com/auth0/auth0-deploy-cli/compare/v7.11.0...HEAD
724
+ [#524]: https://github.com/auth0/auth0-deploy-cli/issues/524
725
+ [#526]: https://github.com/auth0/auth0-deploy-cli/issues/526
726
+ [unreleased]: https://github.com/auth0/auth0-deploy-cli/compare/v7.11.1...HEAD
727
+ [7.11.1]: https://github.com/auth0/auth0-deploy-cli/compare/v7.11.0...v7.11.1
718
728
  [7.11.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.10.0...v7.11.0
719
729
  [7.10.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.9.0...v7.10.0
720
730
  [7.9.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.8.0...v7.9.0
@@ -46,7 +46,7 @@ const lodash_1 = __importDefault(require("lodash"));
46
46
  const default_1 = __importStar(require("./default"));
47
47
  const logger_1 = __importDefault(require("../../../logger"));
48
48
  const utils_1 = require("../../utils");
49
- const MAX_ACTION_DEPLOY_RETRY = 60;
49
+ const MAX_ACTION_DEPLOY_RETRY_ATTEMPTS = 60; // 60 * 2s => 2 min timeout
50
50
  // With this schema, we can only validate property types but not valid properties on per type basis
51
51
  exports.schema = {
52
52
  type: 'array',
@@ -162,10 +162,10 @@ class ActionHandler extends default_1.default {
162
162
  logger_1.default.info(`[${this.type}]: Waiting for build to complete ${this.objString(action)}`);
163
163
  action.retry_count = 1;
164
164
  }
165
- if (action.retry_count > MAX_ACTION_DEPLOY_RETRY) {
165
+ if (action.retry_count > MAX_ACTION_DEPLOY_RETRY_ATTEMPTS) {
166
166
  throw err;
167
167
  }
168
- yield sleep(1000);
168
+ yield sleep(2000);
169
169
  action.retry_count += 1;
170
170
  yield this.deployAction(action);
171
171
  }
@@ -233,9 +233,25 @@ class ActionHandler extends default_1.default {
233
233
  return;
234
234
  const changes = yield this.calcChanges(assets);
235
235
  yield _super.processChanges.call(this, assets, changes);
236
+ const postProcessedActions = yield (() => __awaiter(this, void 0, void 0, function* () {
237
+ this.existing = null; //Clear the cache
238
+ const actions = yield this.getType();
239
+ return actions;
240
+ }))();
236
241
  // Deploy actions
237
242
  const deployActions = [
238
- ...changes.create.filter((action) => action.deployed),
243
+ ...changes.create
244
+ .filter((action) => action.deployed)
245
+ .map((actionWithoutId) => {
246
+ var _a;
247
+ // Add IDs to just-created actions
248
+ const actionId = (_a = postProcessedActions === null || postProcessedActions === void 0 ? void 0 : postProcessedActions.find((postProcessedAction) => {
249
+ return postProcessedAction.name === actionWithoutId.name;
250
+ })) === null || _a === void 0 ? void 0 : _a.id;
251
+ const actionWithId = Object.assign(Object.assign({}, actionWithoutId), { id: actionId });
252
+ return actionWithId;
253
+ })
254
+ .filter((action) => !!action.id),
239
255
  ...changes.update.filter((action) => action.deployed),
240
256
  ];
241
257
  yield this.deployActions(deployActions);
@@ -175,8 +175,8 @@ class RulesHandler extends default_1.default {
175
175
  yield this.client.pool
176
176
  .addEachTask({
177
177
  data: changes.reOrder,
178
- generator: (rule) => this.client
179
- .updateRule({ id: rule.id }, (0, utils_1.stripFields)(rule, this.stripUpdateFields))
178
+ generator: (rule) => this.client.rules
179
+ .update({ id: rule.id }, (0, utils_1.stripFields)(rule, this.stripUpdateFields))
180
180
  .then(() => {
181
181
  const updated = {
182
182
  name: rule.name,
package/lib/types.d.ts CHANGED
@@ -156,9 +156,6 @@ export declare type BaseAuth0APIClient = {
156
156
  triggers: APIClientBaseFunctions & {
157
157
  getTriggerBindings: () => Promise<Asset>;
158
158
  };
159
- updateRule: (arg0: {
160
- id: string;
161
- }, arg1: Asset) => Promise<Asset>;
162
159
  };
163
160
  export declare type Auth0APIClient = BaseAuth0APIClient & {
164
161
  pool: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth0-deploy-cli",
3
- "version": "7.11.0",
3
+ "version": "7.11.1",
4
4
  "description": "A command line tool for deploying updates to your Auth0 tenant",
5
5
  "main": "lib/index.js",
6
6
  "bin": {