@contentstack/cli-cm-clone 1.18.0 → 1.18.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Contentstack
3
+ Copyright (c) 2026 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
@@ -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.17.1 darwin-arm64 node-v22.13.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.18.0",
4
+ "version": "1.18.1",
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.22.0",
10
- "@contentstack/cli-cm-import": "~1.30.0",
11
- "@contentstack/cli-command": "~1.7.0",
12
- "@contentstack/cli-utilities": "~1.15.0",
9
+ "@contentstack/cli-cm-export": "~1.22.2",
10
+ "@contentstack/cli-cm-import": "~1.30.2",
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
- const cloneContext = this.createCloneContext(authenticationMethod);
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);