@contentstack/cli-command 1.2.0 → 1.2.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/lib/index.js CHANGED
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Command = void 0;
4
4
  const ContentstackDeliverySDK = require("contentstack");
5
- const url = require("url");
5
+ const url_1 = require("url");
6
6
  const cli_utilities_1 = require("@contentstack/cli-utilities");
7
7
  const defaultRateLimit = 5;
8
8
  class ContentstackCommand extends cli_utilities_1.Command {
9
9
  get context() {
10
10
  // @ts-ignore
11
- return this.config.context;
11
+ return this.config.context || {};
12
12
  }
13
13
  get email() {
14
14
  if (this._email)
@@ -40,7 +40,7 @@ class ContentstackCommand extends cli_utilities_1.Command {
40
40
  get cmaHost() {
41
41
  let cma = this.region.cma;
42
42
  if (cma.startsWith('http')) {
43
- const u = url.parse(cma);
43
+ const u = new url_1.URL(cma);
44
44
  if (u.host)
45
45
  return u.host;
46
46
  }
@@ -49,7 +49,7 @@ class ContentstackCommand extends cli_utilities_1.Command {
49
49
  get cdaHost() {
50
50
  let cda = this.region.cda;
51
51
  if (cda.startsWith('http')) {
52
- const u = url.parse(cda);
52
+ const u = new url_1.URL(cda);
53
53
  if (u.host)
54
54
  return u.host;
55
55
  }
@@ -78,15 +78,6 @@ class ContentstackCommand extends cli_utilities_1.Command {
78
78
  }
79
79
  throw new cli_utilities_1.CLIError('No token found');
80
80
  }
81
- isAuthenticated() {
82
- const authtoken = cli_utilities_1.configHandler.get('authtoken');
83
- if (authtoken) {
84
- return true;
85
- }
86
- else {
87
- return false;
88
- }
89
- }
90
81
  }
91
82
  exports.Command = ContentstackCommand;
92
83
  module.exports = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contentstack/cli-command",
3
3
  "description": "Contentstack CLI plugin for configuration",
4
- "version": "1.2.0",
4
+ "version": "1.2.1",
5
5
  "author": "Contentstack",
6
6
  "main": "lib/index.js",
7
7
  "types": "./types/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "format": "eslint src/**/*.ts --fix"
18
18
  },
19
19
  "dependencies": {
20
- "@contentstack/cli-utilities": "^1.2.0",
20
+ "@contentstack/cli-utilities": "^1.2.1",
21
21
  "@contentstack/management": "^1.6.1",
22
22
  "contentstack": "^3.10.1"
23
23
  },
package/types/index.d.ts CHANGED
@@ -17,6 +17,5 @@ declare abstract class ContentstackCommand extends Command {
17
17
  get cmaAPIUrl(): string;
18
18
  get authToken(): string;
19
19
  getToken(alias: any): any;
20
- isAuthenticated(): any;
21
20
  }
22
21
  export { ContentstackCommand as Command };