@contentstack/cli-utilities 1.17.0 → 1.17.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.
@@ -21,7 +21,6 @@ declare class AuthHandler {
21
21
  private authorisationTypeOAUTHValue;
22
22
  private authorisationTypeAUTHValue;
23
23
  private allAuthConfigItems;
24
- private logger;
25
24
  private oauthHandler;
26
25
  private managementAPIClient;
27
26
  private isRefreshingToken;
@@ -29,7 +28,6 @@ declare class AuthHandler {
29
28
  set host(contentStackHost: any);
30
29
  constructor();
31
30
  private getCmaHost;
32
- initLog(): void;
33
31
  setOAuthBaseURL(): Promise<void>;
34
32
  initSDK(): Promise<void>;
35
33
  oauth(): Promise<void>;
@@ -7,7 +7,7 @@ const dotenv_1 = tslib_1.__importDefault(require("dotenv"));
7
7
  const open_1 = tslib_1.__importDefault(require("open"));
8
8
  const http_1 = tslib_1.__importDefault(require("http"));
9
9
  const url_1 = tslib_1.__importDefault(require("url"));
10
- const logger_1 = require("./logger");
10
+ const log_1 = require("./logger/log");
11
11
  const contentstack_management_sdk_1 = tslib_1.__importDefault(require("./contentstack-management-sdk"));
12
12
  const helpers_1 = require("./helpers");
13
13
  dotenv_1.default.config();
@@ -77,9 +77,6 @@ class AuthHandler {
77
77
  }
78
78
  return cma;
79
79
  }
80
- initLog() {
81
- this.logger = new logger_1.LoggerService(process.cwd(), 'cli-log');
82
- }
83
80
  async setOAuthBaseURL() {
84
81
  if (config_handler_1.default.get('region')['uiHost']) {
85
82
  this.OAuthBaseURL = config_handler_1.default.get('region')['uiHost'] || '';
@@ -108,13 +105,12 @@ class AuthHandler {
108
105
  */
109
106
  async oauth() {
110
107
  try {
111
- this.initLog();
112
108
  await this.initSDK();
113
109
  await this.createHTTPServer();
114
110
  await this.openOAuthURL();
115
111
  }
116
112
  catch (error) {
117
- this.logger.error('OAuth login failed!', error.message);
113
+ (0, log_1.handleAndLogError)(error, { module: 'auth-handler' }, 'OAuth login failed!');
118
114
  throw error;
119
115
  }
120
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/cli-utilities",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
4
4
  "description": "Utilities for contentstack projects",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -81,4 +81,4 @@
81
81
  "ts-node": "^10.9.2",
82
82
  "typescript": "^4.9.5"
83
83
  }
84
- }
84
+ }