@nuskin/ns-product-lib 2.19.7-td-1017.3 → 2.19.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.19.7-td-1017.3",
3
+ "version": "2.19.7",
4
4
  "description": "This project contains shared Product models and code between the backend and frontend.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -22,7 +22,7 @@
22
22
  "@nuskin/configuration-sdk": "3.0.0",
23
23
  "@nuskin/ns-common-lib": "1.4.7",
24
24
  "@nuskin/ns-util": "4.5.4",
25
- "@nuskin/product-lib": "2.3.1-td-1017.1",
25
+ "@nuskin/product-lib": "2.2.1",
26
26
  "axios": "1.6.7",
27
27
  "axios-mock-adapter": "1.21.2",
28
28
  "eslint": "^8.56.0",
@@ -72,8 +72,8 @@ async function getProducts(ids, market, locale, config) {
72
72
 
73
73
  try {
74
74
  const data = await productLib.getProductsById(
75
- ids, market, locale,
76
- null, 1, okta,
75
+ ids, market, locale,
76
+ null, 1, okta,
77
77
  config.graphqlUrl.includes('test') ? 'test' : config.graphqlUrl.includes('dev') ? 'dev' : 'prod'
78
78
  );
79
79
  if (data && data.products) {
@@ -257,7 +257,6 @@ function mapProduct(product, market, locale, config) {
257
257
  const points = kitOrVariant.points
258
258
  const isBackOrdered = kitOrVariant.status.inventory === 'backordered'
259
259
  const promoData = mapPromos(kitOrVariant)
260
- const productionBom = product.bundle && product.bundle.isProductionBom ? product.bundle.isProductionBom : false;
261
260
 
262
261
  const productDetail = {
263
262
  "sku": !kitBundleProducts ? defaultVariant.sku : product.id,
@@ -277,8 +276,8 @@ function mapProduct(product, market, locale, config) {
277
276
  "availableQuantity": isBackOrdered ? kitOrVariant.backorderQuantity : kitOrVariant.atpQuantity,
278
277
  "maxQuantity": kitOrVariant.maxQuantity,
279
278
  "points": "",
280
- "cv": points.wholesale ? points.wholesale.cv : 0,
281
- "pv": points.wholesale ? points.wholesale.pv : 0,
279
+ "cv": points && points.wholesale ? points.wholesale.cv : 0,
280
+ "pv": points && points.wholesale ? points.wholesale.pv : 0,
282
281
  "priceType": "WRTL",
283
282
  "price": pricing.retail,
284
283
  "priceMap": {
@@ -295,15 +294,15 @@ function mapProduct(product, market, locale, config) {
295
294
  },
296
295
  "cvMap": {
297
296
  ...promoData.cvMap,
298
- "WWHL": points.wholesale ? points.wholesale.cv : 0,
299
- "WADW": points.subscription ? points.subscription.cv : 0,
300
- "WHL": points.wholesale ? points.wholesale.cv : 0
297
+ "WWHL": points && points.wholesale ? points.wholesale.cv : 0,
298
+ "WADW": points && points.subscription ? points.subscription.cv : 0,
299
+ "WHL": points && points.wholesale ? points.wholesale.cv : 0
301
300
  },
302
301
  "pvMap": {
303
302
  ...promoData.pvMap,
304
- "WWHL": points.wholesale ? points.wholesale.pv : 0,
305
- "WADW": points.subscription ? points.subscription.pv : 0,
306
- "WHL": points.wholesale ? points.wholesale.pv : 0
303
+ "WWHL": points && points.wholesale ? points.wholesale.pv : 0,
304
+ "WADW": points && points.subscription ? points.subscription.pv : 0,
305
+ "WHL": points && points.wholesale ? points.wholesale.pv : 0
307
306
  },
308
307
  "orderTypes": mapOrderTypes(kitOrVariant.availableChannels, kitOrVariant.purchaseTypes),
309
308
  "custTypes": mapCustomerTypes(kitOrVariant.customerTypes),
@@ -328,8 +327,7 @@ function mapProduct(product, market, locale, config) {
328
327
  "properties": {
329
328
  isBackOrdered: isBackOrdered,
330
329
  inventoryStatus: isBackOrdered ? 'BACKORDER' : 'IN STOCK',
331
- productStatus: mapProductStatus(kitOrVariant.status.status),
332
- productionBom: productionBom
330
+ productStatus: mapProductStatus(kitOrVariant.status.status)
333
331
  }
334
332
  }
335
333
 
@@ -400,8 +398,8 @@ function mapVariants(product, isContentStack) {
400
398
  "availableQuantity": variant.availableQuantity,
401
399
  "maxQuantity": variant.maxQuantity,
402
400
  "points": "",
403
- "cv": points.wholesale ? points.wholesale.cv : 0,
404
- "pv": points.wholesale ? points.wholesale.pv : 0,
401
+ "cv": points && points.wholesale ? points.wholesale.cv : 0,
402
+ "pv": points && points.wholesale ? points.wholesale.pv : 0,
405
403
  "priceType": "WRTL",
406
404
  "price": pricing.retail,
407
405
  "priceMap": {
@@ -418,15 +416,15 @@ function mapVariants(product, isContentStack) {
418
416
  },
419
417
  "cvMap": {
420
418
  ...promoData.cvMap,
421
- "WWHL": points.wholesale ? points.wholesale.cv : 0,
422
- "WADW": points.subscription ? points.subscription.cv : 0,
423
- "WHL": points.wholesale ? points.wholesale.cv : 0
419
+ "WWHL": points && points.wholesale ? points.wholesale.cv : 0,
420
+ "WADW": points && points.subscription ? points.subscription.cv : 0,
421
+ "WHL": points && points.wholesale ? points.wholesale.cv : 0
424
422
  },
425
423
  "pvMap": {
426
424
  ...promoData.pvMap,
427
- "WWHL": points.wholesale ? points.wholesale.pv : 0,
428
- "WADW": points.subscription ? points.subscription.pv : 0,
429
- "WHL": points.wholesale ? points.wholesale.pv : 0
425
+ "WWHL": points && points.wholesale ? points.wholesale.pv : 0,
426
+ "WADW": points && points.subscription ? points.subscription.pv : 0,
427
+ "WHL": points && points.wholesale ? points.wholesale.pv : 0
430
428
  },
431
429
  "orderTypes": mapOrderTypes(variant.availableChannels, variant.purchaseTypes),
432
430
  "custTypes": mapCustomerTypes(variant.customerTypes),