@contentstack/cli-cm-clone 1.2.0 → 1.4.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Contentstack
3
+ Copyright (c) 2023 Contentstack
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-clone
15
15
  $ csdx COMMAND
16
16
  running command...
17
17
  $ csdx (--version)
18
- @contentstack/cli-cm-clone/1.2.0 linux-x64 node-v16.19.0
18
+ @contentstack/cli-cm-clone/1.4.0 linux-x64 node-v16.20.0
19
19
  $ csdx --help [COMMAND]
20
20
  USAGE
21
21
  $ csdx COMMAND
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.0",
2
+ "version": "1.4.0",
3
3
  "commands": {
4
4
  "cm:stacks:clone": {
5
5
  "id": "cm:stacks:clone",
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-clone",
3
3
  "description": "Contentstack stack clone plugin",
4
- "version": "1.2.0",
4
+ "version": "1.4.0",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-cm-export": "^1.3.0",
9
- "@contentstack/cli-cm-import": "^1.3.0",
10
- "@contentstack/cli-command": "^1.1.0",
11
- "@contentstack/cli-utilities": "^1.1.0",
8
+ "@contentstack/cli-cm-export": "^1.4.1",
9
+ "@contentstack/cli-cm-import": "^1.4.1",
10
+ "@contentstack/cli-command": "^1.2.1",
11
+ "@contentstack/cli-utilities": "^1.2.1",
12
12
  "@contentstack/management": "^1.6.1",
13
13
  "async": "^3.2.4",
14
14
  "chalk": "^4.1.0",
@@ -20,19 +20,19 @@
20
20
  "winston": "^3.7.2"
21
21
  },
22
22
  "devDependencies": {
23
- "oclif": "^3.1.2",
24
23
  "@oclif/test": "^1.2.7",
25
24
  "chai": "^4.2.0",
26
25
  "eslint": "^8.18.0",
27
- "eslint-config-oclif": "^3.1.0",
26
+ "eslint-config-oclif": "^4.0.0",
28
27
  "globby": "^10.0.2",
29
- "jest": "^26.6.3",
28
+ "jest": "^29.4.2",
30
29
  "mocha": "^10.0.0",
31
30
  "nyc": "^15.1.0",
31
+ "oclif": "^3.1.2",
32
32
  "sinon": "^15.0.1"
33
33
  },
34
34
  "engines": {
35
- "node": ">=8.0.0"
35
+ "node": ">=14.0.0"
36
36
  },
37
37
  "files": [
38
38
  "/npm-shrinkwrap.json",
@@ -57,11 +57,16 @@
57
57
  "prepack": "oclif manifest && oclif readme",
58
58
  "test": "nyc --reporter=html mocha --forbid-only \"test/**/*.test.js\"",
59
59
  "posttest": "eslint .",
60
- "version": "oclif readme && git add README.md"
60
+ "version": "oclif readme && git add README.md",
61
+ "clean": "rm -rf ./node_modules tsconfig.build.tsbuildinfo"
61
62
  },
62
63
  "csdxConfig": {
63
64
  "expiredCommands": {
64
65
  "cm:stack-clone": "csdx cm:stacks:clone"
66
+ },
67
+ "shortCommandName": {
68
+ "cm:stacks:clone": "CLN",
69
+ "cm:stack-clone": "O-CLN"
65
70
  }
66
71
  }
67
72
  }
@@ -1,5 +1,5 @@
1
- const { Command, flags } = require('@contentstack/cli-command');
2
- const { configHandler } = require('@contentstack/cli-utilities');
1
+ const { Command } = require('@contentstack/cli-command');
2
+ const { configHandler, flags, isAuthenticated } = require('@contentstack/cli-utilities');
3
3
  const { CloneHandler } = require('../../../lib/util/clone-handler');
4
4
  let config = require('../../../lib/util/dummyConfig.json');
5
5
  const path = require('path');
@@ -11,7 +11,6 @@ class StackCloneCommand extends Command {
11
11
  async run() {
12
12
  try {
13
13
  let self = this;
14
- let _authToken = configHandler.get('authtoken');
15
14
  const { flags: cloneCommandFlags } = await self.parse(StackCloneCommand);
16
15
  const {
17
16
  yes,
@@ -70,7 +69,7 @@ class StackCloneCommand extends Command {
70
69
  await this.removeContentDirIfNotEmptyBeforeClone(pathdir); // NOTE remove if folder not empty before clone
71
70
  this.registerCleanupOnInterrupt(pathdir);
72
71
 
73
- config.auth_token = _authToken;
72
+ config.auth_token = configHandler.get('authtoken');
74
73
  config.host = this.cmaHost;
75
74
  config.cdn = this.cdaHost;
76
75
  config.pathDir = pathdir;
@@ -80,7 +79,7 @@ class StackCloneCommand extends Command {
80
79
 
81
80
  if (sourceManagementTokenAlias && destinationManagementTokenAlias) {
82
81
  if (sourceStackBranch || targetStackBranch) {
83
- if (_authToken) {
82
+ if (isAuthenticated()) {
84
83
  handleClone();
85
84
  } else {
86
85
  console.log('Please login to execute this command, csdx auth:login');
@@ -89,7 +88,7 @@ class StackCloneCommand extends Command {
89
88
  } else {
90
89
  handleClone();
91
90
  }
92
- } else if (_authToken) {
91
+ } else if (isAuthenticated()) {
93
92
  handleClone();
94
93
  } else {
95
94
  console.log('Please login to execute this command, csdx auth:login');