@contentstack/cli-cm-import 1.13.1 → 1.13.3

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
@@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
47
47
  $ csdx COMMAND
48
48
  running command...
49
49
  $ csdx (--version)
50
- @contentstack/cli-cm-import/1.13.1 linux-x64 node-v18.19.0
50
+ @contentstack/cli-cm-import/1.13.3 linux-x64 node-v18.19.0
51
51
  $ csdx --help [COMMAND]
52
52
  USAGE
53
53
  $ csdx COMMAND
@@ -27,7 +27,7 @@ class ImportCommand extends cli_command_1.Command {
27
27
  (0, utils_1.log)(importConfig, `The log has been stored at '${node_path_1.default.join(importConfig.backupDir, 'logs', 'import')}'`, 'success');
28
28
  }
29
29
  catch (error) {
30
- (0, utils_1.log)({ data: backupDir }, `Failed to import stack content - ${(0, utils_1.formatError)(error)}`, 'error');
30
+ (0, utils_1.log)({ data: backupDir !== null && backupDir !== void 0 ? backupDir : node_path_1.default.join(backupDir || __dirname, 'logs', 'import') }, `Failed to import stack content - ${(0, utils_1.formatError)(error)}`, 'error');
31
31
  (0, utils_1.log)({ data: backupDir }, `The log has been stored at ${{ data: backupDir } ? node_path_1.default.join(backupDir || __dirname, 'logs', 'import') : node_path_1.default.join(__dirname, 'logs')}`, 'info');
32
32
  }
33
33
  }
@@ -8,6 +8,8 @@ const config = {
8
8
  // host:'https://azure-na-api.contentstack.com/v3',
9
9
  // use below hosts for azure-eu region
10
10
  // host:'https://azure-eu-api.contentstack.com/v3',
11
+ // use below hosts for gcp-na region
12
+ // host:'https://gcp-na-api.contentstack.com',
11
13
  // pass locale, only to migrate entries from that locale
12
14
  // not passing `locale` will migrate all the locales present
13
15
  // locales: ['fr-fr'],
@@ -18,6 +20,7 @@ const config = {
18
20
  'https://eu-api.contentstack.com': 'https://eu-developerhub-api.contentstack.com',
19
21
  'https://azure-na-api.contentstack.com': 'https://azure-na-developerhub-api.contentstack.com',
20
22
  'https://azure-eu-api.contentstack.com': 'https://azure-eu-developerhub-api.contentstack.com',
23
+ 'https://gcp-na-api.contentstack.com': 'https://gcp-na-developerhub-api.contentstack.com',
21
24
  },
22
25
  modules: {
23
26
  apiConcurrency: 5,
@@ -130,7 +130,7 @@ class ModuleImporter {
130
130
  (await cli_utilities_1.cliux.inquire({
131
131
  type: 'confirm',
132
132
  name: 'confirmation',
133
- message: 'Can you check the fix on the given path and confirm if you would like to proceed with the fix?',
133
+ message: 'Please review and confirm if we can proceed with implementing the fix mentioned in the provided path.?',
134
134
  }))) {
135
135
  return true;
136
136
  }
@@ -338,7 +338,7 @@ function findFileUrls(schema, _entry, assetUrls) {
338
338
  else {
339
339
  text = JSON.stringify(_entry);
340
340
  }
341
- markdownRegEx = new RegExp('(https://(assets|(eu-|azure-na-|azure-eu-)?images).contentstack.(io|com)/v3/assets/(.*?)/(.*?)/(.*?)/(.*?)(?="))', 'g');
341
+ markdownRegEx = new RegExp('(https://(assets|(eu-|azure-na-|azure-eu-|gcp-na-)?images).contentstack.(io|com)/v3/assets/(.*?)/(.*?)/(.*?)/(.*?)(?="))', 'g');
342
342
  while ((markdownMatch = markdownRegEx.exec(text)) !== null) {
343
343
  if (markdownMatch && typeof markdownMatch[0] === 'string') {
344
344
  let assetUrl = markdownMatch[0].replace(/\\/g, '');
@@ -10,6 +10,7 @@ const file_helper_1 = require("./file-helper");
10
10
  const interactive_1 = require("./interactive");
11
11
  const login_handler_1 = tslib_1.__importDefault(require("./login-handler"));
12
12
  const setupConfig = async (importCmdFlags) => {
13
+ var _a;
13
14
  let config = (0, merge_1.default)({}, config_1.default);
14
15
  // setup the config
15
16
  if (importCmdFlags['config']) {
@@ -33,7 +34,7 @@ const setupConfig = async (importCmdFlags) => {
33
34
  }
34
35
  const managementTokenAlias = importCmdFlags['management-token-alias'] || importCmdFlags['alias'];
35
36
  if (managementTokenAlias) {
36
- const { token, apiKey } = cli_utilities_1.configHandler.get(`tokens.${managementTokenAlias}`);
37
+ const { token, apiKey } = (_a = cli_utilities_1.configHandler.get(`tokens.${managementTokenAlias}`)) !== null && _a !== void 0 ? _a : {};
37
38
  config.management_token = token;
38
39
  config.apiKey = apiKey;
39
40
  if (!config.management_token) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.13.1",
2
+ "version": "1.13.3",
3
3
  "commands": {
4
4
  "cm:stacks:import": {
5
5
  "id": "cm:stacks:import",
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-import",
3
3
  "description": "Contentstack CLI plugin to import content into stack",
4
- "version": "1.13.1",
4
+ "version": "1.13.3",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-audit": "^1.3.2",
8
+ "@contentstack/cli-audit": "^1.3.3",
9
9
  "@contentstack/cli-command": "~1.2.16",
10
- "@contentstack/cli-utilities": "~1.5.10",
10
+ "@contentstack/cli-utilities": "~1.5.11",
11
11
  "@contentstack/management": "~1.13.0",
12
12
  "@oclif/core": "^2.9.3",
13
13
  "big-json": "^3.2.0",