@contentstack/cli-utilities 1.20.0 → 1.20.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.
@@ -53,6 +53,11 @@ class AuthenticationHandler {
53
53
  if (error.response && error.response.status) {
54
54
  switch (error.response.status) {
55
55
  case 401:
56
+ if (maxRetryCount >= 2) {
57
+ const errorDetails = (0, index_1.formatError)(error);
58
+ index_1.cliux.print(`Authentication failed after token refresh: ${errorDetails}`, { color: 'red' });
59
+ return;
60
+ }
56
61
  // NOTE: Refresh the token if the type is OAuth.
57
62
  const region = index_1.configHandler.get('region') || {};
58
63
  if (region === null || region === void 0 ? void 0 : region.cma) {
@@ -65,11 +70,10 @@ class AuthenticationHandler {
65
70
  hostName = hostName || region.cma;
66
71
  const refreshed = await this.refreshToken(hostName);
67
72
  if (refreshed) {
68
- return this.refreshAccessToken(error, maxRetryCount); // Retry after refreshing the token
73
+ return this.refreshAccessToken(error, maxRetryCount + 1);
69
74
  }
70
75
  const errorDetails = (0, index_1.formatError)(error);
71
76
  index_1.cliux.print(`Authentication failed: ${errorDetails}`, { color: 'red' });
72
- // For Basic Auth, exit immediately without retrying
73
77
  return;
74
78
  }
75
79
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/cli-utilities",
3
- "version": "1.20.0",
3
+ "version": "1.20.1",
4
4
  "description": "Utilities for contentstack projects",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -27,11 +27,11 @@
27
27
  "author": "contentstack",
28
28
  "license": "MIT",
29
29
  "dependencies": {
30
- "@contentstack/management": "~1.30.1",
31
- "@contentstack/marketplace-sdk": "^1.5.1",
30
+ "@contentstack/management": "~1.31.2",
31
+ "@contentstack/marketplace-sdk": "^1.5.4",
32
32
  "@contentstack/utils": "~1.9.1",
33
33
  "@oclif/core": "^4.11.4",
34
- "axios": "^1.19.0",
34
+ "axios": "^1.20.0",
35
35
  "chalk": "^4.1.2",
36
36
  "cli-cursor": "^3.1.0",
37
37
  "cli-progress": "^3.12.0",
@@ -42,7 +42,7 @@
42
42
  "inquirer": "8.2.7",
43
43
  "inquirer-search-checkbox": "^1.0.0",
44
44
  "inquirer-search-list": "^1.2.6",
45
- "js-yaml": "^4.3.1",
45
+ "js-yaml": "^4.3.2",
46
46
  "klona": "^2.0.6",
47
47
  "lodash": "^4.18.1",
48
48
  "mkdirp": "^1.0.4",
@@ -52,6 +52,7 @@
52
52
  "recheck": "~4.4.5",
53
53
  "rxjs": "^6.6.7",
54
54
  "traverse": "^0.6.11",
55
+ "tslib": "^2.8.1",
55
56
  "tty-table": "^4.2.3",
56
57
  "unique-string": "^2.0.0",
57
58
  "short-uuid": "^6.0.0",
@@ -61,7 +62,7 @@
61
62
  },
62
63
  "overrides": {
63
64
  "@oclif/core": {
64
- "picomatch": "^4.0.4"
65
+ "picomatch": "^4.0.7"
65
66
  }
66
67
  },
67
68
  "devDependencies": {