@lancom/shared 0.0.211 → 0.0.212

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.
@@ -256,6 +256,9 @@ export default {
256
256
  fetchSimpleProducts(params) {
257
257
  return _get('admin/simple-products', params);
258
258
  },
259
+ clearCanonicalProductFromSimpleProduct(product, simpleProduct) {
260
+ return _delete(`admin/products/${product}/simple-products/${simpleProduct}/canonical`);
261
+ },
259
262
  fetchProductTypes(params) {
260
263
  return _get('admin/product-types', params);
261
264
  },
package/nuxt.config.js CHANGED
@@ -151,12 +151,23 @@ module.exports = (config, axios, { raygunClient, publicPath } = {}) => ({
151
151
  review_timestamp: { _text: review.createdAt },
152
152
  title: { _text: product.name },
153
153
  content: { _text: review.text },
154
+ pros: {
155
+ pro: [{ _text: review.pro }]
156
+ },
157
+ cons: {
158
+ con: [{ _text: review.cons }]
159
+ },
154
160
  review_url: {
155
161
  _attributes: {
156
162
  type: 'singleton'
157
163
  },
158
164
  _text: `${productUrl}#review-${review._id}`
159
165
  },
166
+ reviewer_images: {
167
+ reviewer_image: [{
168
+ url: { _text: review.image?.large }
169
+ }]
170
+ },
160
171
  ratings: {
161
172
  overall: {
162
173
  _attributes: {
@@ -169,50 +180,41 @@ module.exports = (config, axios, { raygunClient, publicPath } = {}) => ({
169
180
  products: {
170
181
  product: {
171
182
  product_ids: {
183
+ gtins: {
184
+ gtin: { _text: product.simpleProduct?.gtin }
185
+ },
186
+ skus: {
187
+ sku: { _text: product.simpleProduct?.SKU }
188
+ },
172
189
  brands: {
173
190
  brand: { _text: product.brand.name }
174
191
  },
175
- // mpns: {
176
- // mpn: { _text: '60101-10000' }
177
- // },
178
- // asins: {
179
- // asin: { _text: 'B07YMJ57MB' }
180
- // }
181
192
  },
182
193
  product_name: { _text: product.name },
183
194
  product_url: { _text: productUrl }
184
195
  }
185
- }
196
+ },
197
+ is_spam: { _text: 'false' }
186
198
  };
187
199
 
188
- if (product.simpleProduct?.gtin) {
189
- item.products.product.product_ids.gtins = {
190
- gtin: { _text: product.simpleProduct?.gtin }
191
- };
200
+ if (!product.simpleProduct?.gtin) {
201
+ delete item.products.product.product_ids.gtins;
192
202
  }
193
203
 
194
- if (product.simpleProduct?.SKU) {
195
- item.products.product.product_ids.skus = {
196
- sku: { _text: product.simpleProduct?.SKU }
197
- };
204
+ if (!product.simpleProduct?.SKU) {
205
+ delete item.products.product.product_ids.skus;
198
206
  }
199
207
 
200
- if (review.pro) {
201
- item.pros = {
202
- pro: [{ _text: review.pro }]
203
- };
208
+ if (!review.pro) {
209
+ delete item.pros;
204
210
  }
205
- if (review.cons) {
206
- item.cons = {
207
- con: [{ _text: review.cons }]
208
- };
211
+
212
+ if (!review.cons) {
213
+ delete item.cons;
209
214
  }
210
- if (review.image) {
211
- item.reviewer_images = {
212
- reviewer_image: [{
213
- url: { _text: review.image.large }
214
- }]
215
- };
215
+
216
+ if (!review.image) {
217
+ delete item.reviewer_images;
216
218
  }
217
219
  return item;
218
220
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.211",
3
+ "version": "0.0.212",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {