@contentstack/cli-cm-import 1.13.0 → 1.13.2

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.0 linux-x64 node-v18.19.0
50
+ @contentstack/cli-cm-import/1.13.2 linux-x64 node-v18.19.0
51
51
  $ csdx --help [COMMAND]
52
52
  USAGE
53
53
  $ csdx COMMAND
@@ -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,
@@ -112,6 +112,13 @@ class ModuleImporter {
112
112
  if (this.importConfig.moduleName) {
113
113
  args.push('--modules', this.importConfig.moduleName);
114
114
  }
115
+ else if (this.importConfig.modules.types.length) {
116
+ this.importConfig.modules.types
117
+ .filter((val) => ['content-types', 'global-fields', 'entries'].includes(val))
118
+ .forEach((val) => {
119
+ args.push('--modules', val);
120
+ });
121
+ }
115
122
  (0, utils_1.log)(this.importConfig, 'Starting audit process', 'info');
116
123
  const result = await cli_audit_1.AuditFix.run(args);
117
124
  (0, utils_1.log)(this.importConfig, 'Audit process completed', 'info');
@@ -123,7 +130,7 @@ class ModuleImporter {
123
130
  (await cli_utilities_1.cliux.inquire({
124
131
  type: 'confirm',
125
132
  name: 'confirmation',
126
- 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.?',
127
134
  }))) {
128
135
  return true;
129
136
  }
@@ -133,7 +140,6 @@ class ModuleImporter {
133
140
  return true;
134
141
  }
135
142
  catch (error) {
136
- (0, utils_1.trace)(error);
137
143
  (0, utils_1.log)(this.importConfig, `Audit failed with following error. ${error}`, 'error');
138
144
  }
139
145
  }
@@ -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, '');
@@ -147,6 +147,15 @@ const removeReferenceFields = async function (schema, flag = { supressed: false
147
147
  flag.supressed = true;
148
148
  schema[i].reference_to = ['sys_assets'];
149
149
  }
150
+ else if (
151
+ // handling entry references in rte
152
+ schema[i].data_type === 'text' &&
153
+ schema[i].field_metadata.rich_text_type &&
154
+ schema[i].field_metadata.embed_entry &&
155
+ schema[i].reference_to.length >= 1) {
156
+ flag.supressed = true;
157
+ schema[i].reference_to = ['sys_assets'];
158
+ }
150
159
  }
151
160
  };
152
161
  exports.removeReferenceFields = removeReferenceFields;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.13.0",
2
+ "version": "1.13.2",
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.0",
4
+ "version": "1.13.2",
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",