@contentstack/cli-cm-import 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/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.18.0 linux-x64 node-v18.20.4
50
+ @contentstack/cli-cm-import/1.19.0 linux-x64 node-v18.20.4
51
51
  $ csdx --help [COMMAND]
52
52
  USAGE
53
53
  $ csdx COMMAND
@@ -333,7 +333,7 @@ class ImportMarketplaceApps {
333
333
  * @returns {Promise<void>}
334
334
  */
335
335
  async installApps(app) {
336
- var _a, _b;
336
+ var _a;
337
337
  let updateParam;
338
338
  const { configuration, server_configuration } = app;
339
339
  const currentStackApp = (0, find_1.default)(this.installedApps, { manifest: { uid: (_a = app === null || app === void 0 ? void 0 : app.manifest) === null || _a === void 0 ? void 0 : _a.uid } });
@@ -347,7 +347,7 @@ class ImportMarketplaceApps {
347
347
  // NOTE if it's private app it should get uid from mapper else will use manifest uid
348
348
  this.appUidMapping[app.manifest.uid] || app.manifest.uid);
349
349
  if (installation.installation_uid) {
350
- const appName = (_b = this.appNameMapping[app.manifest.name]) !== null && _b !== void 0 ? _b : app.manifest.name;
350
+ const appName = this.appNameMapping[app.manifest.name] || app.manifest.name || app.manifest.uid;
351
351
  (0, utils_1.log)(this.importConfig, `${appName} app installed successfully.!`, 'success');
352
352
  await (0, utils_1.makeRedirectUrlCall)(installation, appName, this.importConfig);
353
353
  this.installationUidMapping[app.uid] = installation.installation_uid;
@@ -359,7 +359,8 @@ class ImportMarketplaceApps {
359
359
  }
360
360
  }
361
361
  else if (!(0, isEmpty_1.default)(configuration) || !(0, isEmpty_1.default)(server_configuration)) {
362
- (0, utils_1.log)(this.importConfig, `${app.manifest.name} is already installed`, 'success');
362
+ const appName = app.manifest.name || app.manifest.uid;
363
+ (0, utils_1.log)(this.importConfig, `${appName} is already installed`, 'success');
363
364
  updateParam = await (0, utils_1.ifAppAlreadyExist)(app, currentStackApp, this.importConfig);
364
365
  }
365
366
  if (!this.appUidMapping[app.manifest.uid]) {
@@ -389,7 +390,8 @@ class ImportMarketplaceApps {
389
390
  (0, utils_1.log)(this.importConfig, (0, utils_1.formatError)(data.message), 'success');
390
391
  }
391
392
  else {
392
- (0, utils_1.log)(this.importConfig, `${app.manifest.name} app config updated successfully.!`, 'success');
393
+ const appName = app.manifest.name || app.manifest.uid;
394
+ (0, utils_1.log)(this.importConfig, `${appName} app config updated successfully.!`, 'success');
393
395
  }
394
396
  })
395
397
  .catch((error) => {
@@ -542,11 +542,18 @@ const restoreJsonRteEntryRefs = (entry, sourceStackEntry, ctSchema = [], { uidMa
542
542
  }
543
543
  else {
544
544
  entry[element.uid] = restoreReferenceInJsonRTE(sourceStackEntry[element.uid], uidMapper);
545
- entry[element.uid].children = entry[element.uid].children.map((child) => {
546
- child = setDirtyTrue(child);
547
- child = resolveAssetRefsInEntryRefsForJsonRte(child, mappedAssetUids, mappedAssetUrls);
548
- return child;
549
- });
545
+ if (entry[element.uid].children && entry[element.uid].children.length > 0) {
546
+ entry[element.uid].children = entry[element.uid].children.map((child) => {
547
+ child = setDirtyTrue(child);
548
+ child = resolveAssetRefsInEntryRefsForJsonRte(child, mappedAssetUids, mappedAssetUrls);
549
+ return child;
550
+ });
551
+ }
552
+ else {
553
+ entry[element.uid].children = [
554
+ { type: 'p', attrs: { style: {}, 'redactor-attributes': {}, dir: 'ltr' } },
555
+ ];
556
+ }
550
557
  }
551
558
  }
552
559
  break;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.18.0",
2
+ "version": "1.19.0",
3
3
  "commands": {
4
4
  "cm:stacks:import": {
5
5
  "id": "cm:stacks:import",
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-import",
3
3
  "description": "Contentstack CLI plugin to import content into stack",
4
- "version": "1.18.0",
4
+ "version": "1.19.0",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-audit": "~1.7.0",
9
- "@contentstack/cli-command": "~1.3.0",
10
- "@contentstack/cli-utilities": "~1.7.2",
8
+ "@contentstack/cli-audit": "~1.7.2",
9
+ "@contentstack/cli-command": "~1.3.2",
10
+ "@contentstack/cli-utilities": "~1.8.0",
11
11
  "@contentstack/management": "~1.17.0",
12
- "@contentstack/cli-variants": "~1.0.0",
12
+ "@contentstack/cli-variants": "~1.1.0",
13
13
  "@oclif/core": "^3.26.5",
14
14
  "big-json": "^3.2.0",
15
15
  "bluebird": "^3.7.2",