@contentstack/cli-cm-clone 1.18.0 → 1.19.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 +1 -1
- package/README.md +1 -1
- package/package.json +5 -5
- package/src/commands/cm/stacks/clone.js +12 -5
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-clone
|
|
|
16
16
|
$ csdx COMMAND
|
|
17
17
|
running command...
|
|
18
18
|
$ csdx (--version)
|
|
19
|
-
@contentstack/cli-cm-clone/1.
|
|
19
|
+
@contentstack/cli-cm-clone/1.18.1 darwin-arm64 node-v22.13.1
|
|
20
20
|
$ csdx --help [COMMAND]
|
|
21
21
|
USAGE
|
|
22
22
|
$ csdx COMMAND
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-clone",
|
|
3
3
|
"description": "Contentstack stack clone plugin",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.19.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@colors/colors": "^1.6.0",
|
|
9
|
-
"@contentstack/cli-cm-export": "~1.
|
|
10
|
-
"@contentstack/cli-cm-import": "~1.
|
|
11
|
-
"@contentstack/cli-command": "~1.7.
|
|
12
|
-
"@contentstack/cli-utilities": "~1.
|
|
9
|
+
"@contentstack/cli-cm-export": "~1.23.0",
|
|
10
|
+
"@contentstack/cli-cm-import": "~1.31.0",
|
|
11
|
+
"@contentstack/cli-command": "~1.7.1",
|
|
12
|
+
"@contentstack/cli-utilities": "~1.16.0",
|
|
13
13
|
"@oclif/core": "^4.3.0",
|
|
14
14
|
"@oclif/plugin-help": "^6.2.28",
|
|
15
15
|
"chalk": "^4.1.2",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { Command } = require('@contentstack/cli-command');
|
|
2
|
-
const { configHandler, flags, isAuthenticated, managementSDKClient, log, handleAndLogError } = require('@contentstack/cli-utilities');
|
|
2
|
+
const { configHandler, flags, isAuthenticated, managementSDKClient, log, handleAndLogError, createLogContext } = require('@contentstack/cli-utilities');
|
|
3
3
|
const { CloneHandler } = require('../../../lib/util/clone-handler');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const { rimraf } = require('rimraf');
|
|
@@ -73,7 +73,12 @@ class StackCloneCommand extends Command {
|
|
|
73
73
|
sourceManagementTokenAlias,
|
|
74
74
|
destinationManagementTokenAlias,
|
|
75
75
|
);
|
|
76
|
-
|
|
76
|
+
createLogContext(
|
|
77
|
+
this.context?.info?.command || 'cm:stacks:clone',
|
|
78
|
+
sourceStackApiKey,
|
|
79
|
+
authenticationMethod
|
|
80
|
+
);
|
|
81
|
+
let cloneContext = { module: 'clone' };
|
|
77
82
|
log.debug('Starting clone operation setup', cloneContext);
|
|
78
83
|
|
|
79
84
|
if (externalConfigPath) {
|
|
@@ -136,6 +141,11 @@ class StackCloneCommand extends Command {
|
|
|
136
141
|
config.importWebhookStatus = importWebhookStatus;
|
|
137
142
|
}
|
|
138
143
|
|
|
144
|
+
//Set host and auth BEFORE SDK initialization to ensure correct regional endpoints
|
|
145
|
+
config.host = this.cmaHost;
|
|
146
|
+
config.cdn = this.cdaHost;
|
|
147
|
+
config.auth_token = configHandler.get('authtoken');
|
|
148
|
+
|
|
139
149
|
const managementAPIClient = await managementSDKClient(config);
|
|
140
150
|
log.debug('Management API client initialized successfully', cloneContext);
|
|
141
151
|
|
|
@@ -143,9 +153,6 @@ class StackCloneCommand extends Command {
|
|
|
143
153
|
await this.removeContentDirIfNotEmptyBeforeClone(pathdir, cloneContext); // NOTE remove if folder not empty before clone
|
|
144
154
|
this.registerCleanupOnInterrupt(pathdir, cloneContext);
|
|
145
155
|
|
|
146
|
-
config.auth_token = configHandler.get('authtoken');
|
|
147
|
-
config.host = this.cmaHost;
|
|
148
|
-
config.cdn = this.cdaHost;
|
|
149
156
|
config.pathDir = pathdir;
|
|
150
157
|
config.cloneContext = cloneContext;
|
|
151
158
|
log.debug('Clone configuration finalized', cloneContext);
|