pim-import 6.1.10 → 6.2.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.
@@ -4,7 +4,7 @@ export declare const publishTopicProduct: (productEntry: Entry) => Promise<void>
4
4
  export declare const publishAllProductDrafts: (filters: {
5
5
  catalog?: AvailableCatalogs;
6
6
  destination?: string;
7
- }, limit?: number) => Promise<{
7
+ }, limit?: number, reindexProducts?: boolean) => Promise<{
8
8
  completed: boolean;
9
9
  total: number;
10
10
  }>;
@@ -21,7 +21,7 @@ const publishTopicProduct = async (productEntry) => {
21
21
  await productEntry.publish();
22
22
  };
23
23
  exports.publishTopicProduct = publishTopicProduct;
24
- const publishAllProductDrafts = async (filters, limit = 100) => {
24
+ const publishAllProductDrafts = async (filters, limit = 100, reindexProducts = true) => {
25
25
  let logMsg = `publishAllProductDrafts limit: ${limit} filters: ${JSON.stringify(filters)}`;
26
26
  (0, logs_1.log)(logMsg);
27
27
  if (logs_1.serverUtils) {
@@ -65,11 +65,13 @@ const publishAllProductDrafts = async (filters, limit = 100) => {
65
65
  logs_1.serverUtils.log(logMsg);
66
66
  }
67
67
  await (0, exports.publishTopicProduct)(item);
68
- logMsg = `Reindex product: ${item.sys.id}`;
69
- if (logs_1.serverUtils) {
70
- logs_1.serverUtils.log(logMsg);
68
+ if (reindexProducts) {
69
+ logMsg = `Reindex product: ${item.sys.id}`;
70
+ if (logs_1.serverUtils) {
71
+ logs_1.serverUtils.log(logMsg);
72
+ }
73
+ await (0, products_2.reindexProduct)(item.sys.id, true);
71
74
  }
72
- await (0, products_2.reindexProduct)(item.sys.id, true);
73
75
  if (logs_1.serverUtils) {
74
76
  const progress = Math.floor((count / items.length) * 100);
75
77
  logs_1.serverUtils.updateProgress(progress);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pim-import",
3
- "version": "6.1.10",
3
+ "version": "6.2.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",