goods-exporter 1.2.6 → 1.2.8

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/dist/bundle.d.ts CHANGED
@@ -241,6 +241,15 @@ interface Product {
241
241
  * Поле указывает, есть ли товар в наличии.
242
242
  */
243
243
  available?: boolean;
244
+ /**
245
+ * **Время доставки**
246
+ *
247
+ * Указывает на время доставки в днях, от и до скольких.
248
+ */
249
+ timeDelivery?: {
250
+ min?: number;
251
+ max?: number;
252
+ };
244
253
  /**
245
254
  * **Минимальное количество товара**
246
255
  *
@@ -78,6 +78,8 @@ class CSVFormatter {
78
78
  "category",
79
79
  "images",
80
80
  "videos",
81
+ "timeDeliveryMin",
82
+ "timeDeliveryMax",
81
83
  "price",
82
84
  "oldPrice",
83
85
  "purchasePrice",
@@ -110,7 +112,9 @@ class CSVFormatter {
110
112
  properties: product.properties?.map(({ key, value }) => `${key}=${value}`).join(", "),
111
113
  sizes: product.sizes?.map(({ name, value }) => `${name}=${value}`).join(", "),
112
114
  keywords: product.keywords?.join(","),
113
- relatedProducts: product.relatedProducts?.join(",")
115
+ relatedProducts: product.relatedProducts?.join(","),
116
+ timeDeliveryMin: product.timeDelivery?.min,
117
+ timeDeliveryMax: product.timeDelivery?.max
114
118
  };
115
119
  csvStream.addRow(row);
116
120
  });
@@ -142,6 +146,8 @@ class ExcelFormatter {
142
146
  "category",
143
147
  "images",
144
148
  "videos",
149
+ "timeDeliveryMin",
150
+ "timeDeliveryMax",
145
151
  "price",
146
152
  "oldPrice",
147
153
  "purchasePrice",
@@ -181,7 +187,9 @@ class ExcelFormatter {
181
187
  codesTN: product.codesTN?.join(", "),
182
188
  params: product.params?.map(({ key, value }) => `${key}=${value}`).join(", "),
183
189
  properties: product.properties?.map(({ key, value }) => `${key}=${value}`).join(", "),
184
- sizes: product.sizes?.map(({ name, value }) => `${name}=${value}`).join(", ")
190
+ sizes: product.sizes?.map(({ name, value }) => `${name}=${value}`).join(", "),
191
+ timeDeliveryMin: product.timeDelivery?.min,
192
+ timeDeliveryMax: product.timeDelivery?.max
185
193
  };
186
194
  worksheet.addRow(row).commit();
187
195
  });
@@ -249,6 +257,8 @@ class InsalesFormatter {
249
257
  "\u041F\u043E\u0434\u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F 1",
250
258
  "\u041F\u043E\u0434\u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F 2",
251
259
  "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438\u043B\u0438 \u0443\u0441\u043B\u0443\u0433\u0438",
260
+ "\u0412\u0440\u0435\u043C\u044F \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438: \u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435",
261
+ "\u0412\u0440\u0435\u043C\u044F \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438: \u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435",
252
262
  "\u0421\u0442\u0430\u0440\u0430\u044F \u0446\u0435\u043D\u0430",
253
263
  "\u0426\u0435\u043D\u0430 \u043F\u0440\u043E\u0434\u0430\u0436\u0438",
254
264
  "C\u0435\u0431\u0435\u0441\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C",
@@ -294,6 +304,8 @@ class InsalesFormatter {
294
304
  "\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 \u0442\u043E\u0432\u0430\u0440": product.url,
295
305
  \u0410\u0440\u0442\u0438\u043A\u0443\u043B: product.vendorCode,
296
306
  "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438\u043B\u0438 \u0443\u0441\u043B\u0443\u0433\u0438": product.title,
307
+ "\u0412\u0440\u0435\u043C\u044F \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438: \u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435": product.timeDelivery?.min,
308
+ "\u0412\u0440\u0435\u043C\u044F \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438: \u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435": product.timeDelivery?.max,
297
309
  "\u0421\u0442\u0430\u0440\u0430\u044F \u0446\u0435\u043D\u0430": product.oldPrice,
298
310
  "\u0426\u0435\u043D\u0430 \u043F\u0440\u043E\u0434\u0430\u0436\u0438": product.price,
299
311
  C\u0435\u0431\u0435\u0441\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C: product.purchasePrice,
@@ -692,6 +704,7 @@ class WooCommerceFormatter {
692
704
  const columns = new Set(this.DEFAULT_COLUMNS);
693
705
  const attributes = this.extractAttributes(products);
694
706
  const variationsByParentId = /* @__PURE__ */ new Map();
707
+ const imagesByParentId = /* @__PURE__ */ new Map();
695
708
  const variations = products.map((product, index) => {
696
709
  const pathsArray = categoriePaths.get(product.categoryId)?.map((category) => category.name);
697
710
  let row = {
@@ -707,9 +720,13 @@ class WooCommerceFormatter {
707
720
  Position: index + 1,
708
721
  Categories: pathsArray?.join(" > "),
709
722
  Tags: product.keywords?.join(","),
710
- Images: product.images?.map(urlQueryEncode).join(",")
723
+ Images: ""
711
724
  };
712
725
  const productParams = attributes.params.get(product.variantId) ?? {};
726
+ if (!imagesByParentId.has(row.Parent)) {
727
+ const images = product.images?.map(urlQueryEncode).join(",");
728
+ imagesByParentId.set(row.Parent, images);
729
+ }
713
730
  this.removeVisibleFromAttributes(productParams);
714
731
  row = { ...row, ...productParams };
715
732
  if (variationsByParentId.has(row.Parent)) {
@@ -729,7 +746,8 @@ class WooCommerceFormatter {
729
746
  SKU: product.Parent,
730
747
  Position: 0,
731
748
  Parent: "",
732
- "Regular price": ""
749
+ "Regular price": "",
750
+ Images: imagesByParentId.get(product.Parent) ?? ""
733
751
  };
734
752
  row.Stock = (currentParent?.Stock || 0) + (product?.Stock || 0);
735
753
  const productParams = attributes.params.get(product.SKU) ?? {};
@@ -854,6 +872,11 @@ class YMLFormatter {
854
872
  picture: product.images,
855
873
  video: product.videos,
856
874
  available: product.available,
875
+ "time-delivery": product.timeDelivery ? {
876
+ "@_min": product.timeDelivery.min,
877
+ "@_max": product.timeDelivery.max,
878
+ "#text": `${product.timeDelivery.min}-${product.timeDelivery.max}`
879
+ } : void 0,
857
880
  series: product.seriesName,
858
881
  "min-quantity": product.minQuantity,
859
882
  "step-quantity": product.stepQuantity,