@contentstack/cli-cm-branches 1.0.8 → 1.0.10

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/README.md CHANGED
@@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
37
37
  $ csdx COMMAND
38
38
  running command...
39
39
  $ csdx (--version)
40
- @contentstack/cli-cm-branches/1.0.8 linux-x64 node-v16.20.1
40
+ @contentstack/cli-cm-branches/1.0.10 linux-x64 node-v18.17.0
41
41
  $ csdx --help [COMMAND]
42
42
  USAGE
43
43
  $ csdx COMMAND
@@ -12,6 +12,10 @@ class BranchCreateCommand extends cli_command_1.Command {
12
12
  uid: branchCreateFlags.uid,
13
13
  source: branchCreateFlags.source,
14
14
  };
15
+ if (!(0, cli_utilities_1.isAuthenticated)()) {
16
+ const err = { errorMessage: 'You are not logged in. Please login with command $ csdx auth:login' };
17
+ (0, utils_1.handleErrorMsg)(err);
18
+ }
15
19
  if (!apiKey) {
16
20
  apiKey = await utils_1.interactive.askStackAPIKey();
17
21
  }
@@ -8,6 +8,10 @@ class BranchDeleteCommand extends cli_command_1.Command {
8
8
  async run() {
9
9
  const { flags: branchDeleteFlags } = await this.parse(BranchDeleteCommand);
10
10
  let apiKey = branchDeleteFlags['stack-api-key'];
11
+ if (!(0, cli_utilities_1.isAuthenticated)()) {
12
+ const err = { errorMessage: 'You are not logged in. Please login with command $ csdx auth:login' };
13
+ (0, utils_1.handleErrorMsg)(err);
14
+ }
11
15
  if (!apiKey) {
12
16
  apiKey = await utils_1.interactive.askStackAPIKey();
13
17
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const cli_command_1 = require("@contentstack/cli-command");
4
4
  const cli_utilities_1 = require("@contentstack/cli-utilities");
5
5
  const branch_1 = require("../../../branch");
6
+ const utils_1 = require("../../../utils");
6
7
  class BranchDiffCommand extends cli_command_1.Command {
7
8
  async run() {
8
9
  try {
@@ -15,6 +16,10 @@ class BranchDiffCommand extends cli_command_1.Command {
15
16
  format: branchDiffFlags.format,
16
17
  host: this.cmaHost
17
18
  };
19
+ if (!(0, cli_utilities_1.isAuthenticated)()) {
20
+ const err = { errorMessage: 'You are not logged in. Please login with command $ csdx auth:login' };
21
+ (0, utils_1.handleErrorMsg)(err);
22
+ }
18
23
  const diffHandler = new branch_1.BranchDiffHandler(options);
19
24
  await diffHandler.run();
20
25
  }
@@ -16,6 +16,10 @@ class BranchListCommand extends cli_command_1.Command {
16
16
  if (!stackApiKey) {
17
17
  stackApiKey = await index_1.interactive.askStackAPIKey();
18
18
  }
19
+ if (!(0, cli_utilities_1.isAuthenticated)()) {
20
+ const err = { errorMessage: 'You are not logged in. Please login with command $ csdx auth:login' };
21
+ (0, index_1.handleErrorMsg)(err);
22
+ }
19
23
  const baseBranch = (0, index_1.getbranchConfig)(stackApiKey) || 'main';
20
24
  const listOfBranch = await managementAPIClient
21
25
  .stack({ api_key: stackApiKey })
@@ -9,6 +9,10 @@ class BranchMergeCommand extends cli_command_1.Command {
9
9
  try {
10
10
  let { flags: branchMergeFlags } = await this.parse(BranchMergeCommand);
11
11
  branchMergeFlags = await (0, utils_1.setupMergeInputs)(branchMergeFlags);
12
+ if (!(0, cli_utilities_1.isAuthenticated)()) {
13
+ const err = { errorMessage: 'You are not logged in. Please login with command $ csdx auth:login' };
14
+ (0, utils_1.handleErrorMsg)(err);
15
+ }
12
16
  // display branch status
13
17
  const branchCompareData = await (0, utils_1.displayBranchStatus)({
14
18
  stackAPIKey: branchMergeFlags['stack-api-key'],
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.8",
2
+ "version": "1.0.10",
3
3
  "commands": {
4
4
  "cm:branches:create": {
5
5
  "id": "cm:branches:create",
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-branches",
3
3
  "description": "Contentstack CLI plugin to do branches operations",
4
- "version": "1.0.8",
4
+ "version": "1.0.10",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-command": "^1.2.9",
9
- "@contentstack/cli-utilities": "^1.4.5",
8
+ "@contentstack/cli-command": "^1.2.11",
9
+ "@contentstack/cli-utilities": "^1.5.1",
10
10
  "@oclif/command": "^1.8.16",
11
11
  "@oclif/config": "^1.18.3",
12
- "@oclif/core": "^2.3.0",
12
+ "@oclif/core": "^2.9.3",
13
13
  "async": "^3.2.4",
14
14
  "big-json": "^3.2.0",
15
15
  "bluebird": "^3.7.2",
@@ -27,8 +27,8 @@
27
27
  "winston": "^3.7.2"
28
28
  },
29
29
  "devDependencies": {
30
- "@contentstack/cli-auth": "^1.3.8",
31
- "@contentstack/cli-config": "^1.4.6",
30
+ "@contentstack/cli-auth": "^1.3.11",
31
+ "@contentstack/cli-config": "^1.4.9",
32
32
  "@contentstack/cli-dev-dependencies": "^1.2.3",
33
33
  "@oclif/plugin-help": "^5.1.19",
34
34
  "@oclif/test": "^1.2.6",