@contentstack/cli-cm-import 1.23.0 → 1.24.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.23.0 linux-x64 node-v22.15.0
50
+ @contentstack/cli-cm-import/1.24.0 linux-x64 node-v22.16.0
51
51
  $ csdx --help [COMMAND]
52
52
  USAGE
53
53
  $ csdx COMMAND
@@ -155,7 +155,13 @@ const config = {
155
155
  },
156
156
  personalize: {
157
157
  baseURL: {
158
- NA: 'https://personalize-api.contentstack.com',
158
+ 'AWS-NA': 'https://personalize-api.contentstack.com',
159
+ 'AWS-EU': 'https://eu-personalize-api.contentstack.com',
160
+ 'AWS-AU': 'https://au-personalize-api.contentstack.com',
161
+ 'AZURE-NA': 'https://azure-na-personalize-api.contentstack.com',
162
+ 'AZURE-EU': 'https://azure-eu-personalize-api.contentstack.com',
163
+ 'GCP-NA': 'https://gcp-na-personalize-api.contentstack.com',
164
+ 'GCP-EU': 'https://gcp-eu-personalize-api.contentstack.com',
159
165
  },
160
166
  importData: true,
161
167
  dirName: 'personalize',
@@ -33,11 +33,11 @@ export default class EntriesImport extends BaseClass {
33
33
  taxonomies: Record<string, unknown>;
34
34
  rteCTs: any;
35
35
  rteCTsWithRef: any;
36
- entriesForVariant: {
36
+ entriesForVariant: Array<{
37
37
  content_type: string;
38
38
  locale: string;
39
39
  entry_uid: string;
40
- }[];
40
+ }>;
41
41
  constructor({ importConfig, stackAPIClient }: ModuleClassParams);
42
42
  start(): Promise<any>;
43
43
  /**
@@ -281,7 +281,7 @@ class EntriesImport extends base_class_1.default {
281
281
  var _a, _b;
282
282
  const { title, uid } = entry;
283
283
  // NOTE Remove from list if any entry import failed
284
- (0, lodash_1.remove)(this.entriesForVariant, { locale, entry_uid: uid });
284
+ this.entriesForVariant = this.entriesForVariant.filter((item) => !(item.locale === locale && item.entry_uid === uid));
285
285
  // NOTE: write existing entries into files to handler later
286
286
  if (error.errorCode === 119) {
287
287
  if (((_a = error === null || error === void 0 ? void 0 : error.errors) === null || _a === void 0 ? void 0 : _a.title) || ((_b = error === null || error === void 0 ? void 0 : error.errors) === null || _b === void 0 ? void 0 : _b.uid)) {
@@ -410,7 +410,7 @@ class EntriesImport extends base_class_1.default {
410
410
  };
411
411
  const onReject = ({ error, apiData: { uid, title } }) => {
412
412
  // NOTE Remove from list if any entry import failed
413
- (0, lodash_1.remove)(this.entriesForVariant, { locale, entry_uid: uid });
413
+ this.entriesForVariant = this.entriesForVariant.filter((item) => !(item.locale === locale && item.entry_uid === uid));
414
414
  (0, utils_1.log)(this.importConfig, `${title} entry of content type ${cTUid} in locale ${locale} failed to replace`, 'error');
415
415
  (0, utils_1.log)(this.importConfig, (0, utils_1.formatError)(error), 'error');
416
416
  this.failedEntries.push({
@@ -524,7 +524,7 @@ class EntriesImport extends base_class_1.default {
524
524
  };
525
525
  const onReject = ({ error, apiData: { uid, title } }) => {
526
526
  // NOTE Remove from list if any entry import failed
527
- (0, lodash_1.remove)(this.entriesForVariant, { locale, entry_uid: uid });
527
+ this.entriesForVariant = this.entriesForVariant.filter((item) => !(item.locale === locale && item.entry_uid === uid));
528
528
  (0, utils_1.log)(this.importConfig, `${title} entry of content type ${cTUid} in locale ${locale} failed to update`, 'error');
529
529
  (0, utils_1.log)(this.importConfig, (0, utils_1.formatError)(error), 'error');
530
530
  this.failedEntries.push({
@@ -643,21 +643,13 @@ class EntriesImport extends base_class_1.default {
643
643
  async removeAutoCreatedEntries() {
644
644
  var _a, _b;
645
645
  const onSuccess = ({ response, apiData: { entryUid } }) => {
646
- var _a, _b;
647
646
  // NOTE Remove entry from list
648
- (0, lodash_1.remove)(this.entriesForVariant, {
649
- entry_uid: entryUid,
650
- locale: (_b = (_a = this.importConfig) === null || _a === void 0 ? void 0 : _a.master_locale) === null || _b === void 0 ? void 0 : _b.code,
651
- });
647
+ this.entriesForVariant = this.entriesForVariant.filter((item) => { var _a, _b; return !(item.entry_uid === entryUid && item.locale === ((_b = (_a = this.importConfig) === null || _a === void 0 ? void 0 : _a.master_locale) === null || _b === void 0 ? void 0 : _b.code)); });
652
648
  (0, utils_1.log)(this.importConfig, `Auto created entry in master locale removed - entry uid ${entryUid} `, 'success');
653
649
  };
654
650
  const onReject = ({ error, apiData: { entryUid } }) => {
655
- var _a, _b;
656
651
  // NOTE Remove entry from list
657
- (0, lodash_1.remove)(this.entriesForVariant, {
658
- entry_uid: entryUid,
659
- locale: (_b = (_a = this.importConfig) === null || _a === void 0 ? void 0 : _a.master_locale) === null || _b === void 0 ? void 0 : _b.code,
660
- });
652
+ this.entriesForVariant = this.entriesForVariant.filter((item) => { var _a, _b; return !(item.entry_uid === entryUid && item.locale === ((_b = (_a = this.importConfig) === null || _a === void 0 ? void 0 : _a.master_locale) === null || _b === void 0 ? void 0 : _b.code)); });
661
653
  (0, utils_1.log)(this.importConfig, `Failed to remove auto created entry in master locale - entry uid ${entryUid} \n ${(0, utils_1.formatError)(error)}`, 'error');
662
654
  };
663
655
  return await this.makeConcurrentCall({
@@ -199,5 +199,5 @@
199
199
  ]
200
200
  }
201
201
  },
202
- "version": "1.23.0"
202
+ "version": "1.24.0"
203
203
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-import",
3
3
  "description": "Contentstack CLI plugin to import content into stack",
4
- "version": "1.23.0",
4
+ "version": "1.24.0",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {