@nuskin/ns-product-lib 2.7.0-cx24-3682.21 → 2.7.0-cx24-3682.16

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,38 +1,3 @@
1
- # [2.7.0-cx24-3682.21](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.20...v2.7.0-cx24-3682.21) (2023-03-28)
2
-
3
-
4
- ### New
5
-
6
- * MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([d32293e](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/d32293e08920313b2598e6be21d66c7377713d9e)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
7
-
8
- # [2.7.0-cx24-3682.20](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.19...v2.7.0-cx24-3682.20) (2023-03-28)
9
-
10
-
11
- ### New
12
-
13
- * MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([d008a2e](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/d008a2e625131f66f7f2ea5ed428c0ec4cb28e8b)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
14
-
15
- # [2.7.0-cx24-3682.19](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.18...v2.7.0-cx24-3682.19) (2023-03-28)
16
-
17
-
18
- ### New
19
-
20
- * MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([3adb17f](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3adb17f779126224b3d1264738b128bbbd1428aa)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
21
-
22
- # [2.7.0-cx24-3682.18](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.17...v2.7.0-cx24-3682.18) (2023-03-28)
23
-
24
-
25
- ### New
26
-
27
- * MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([9d1d1dc](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9d1d1dcb2562468a4fcc0419fab0055db1ee5ffd)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
28
-
29
- # [2.7.0-cx24-3682.17](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.16...v2.7.0-cx24-3682.17) (2023-03-28)
30
-
31
-
32
- ### New
33
-
34
- * MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([10a5c8b](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/10a5c8b908558131cee494d67f12ff5125aa444a)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
35
-
36
1
  # [2.7.0-cx24-3682.16](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3682.15...v2.7.0-cx24-3682.16) (2023-03-28)
37
2
 
38
3
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.7.0-cx24-3682.21",
3
+ "version": "2.7.0-cx24-3682.16",
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": {
@@ -48,7 +48,6 @@
48
48
  * @property {string} identifier e.g., Normal - "blt8b757df6dcaa199c" | Kit - "02001076"
49
49
  * @property {EquinoxProductProperties} properties
50
50
  * @property {EquinoxProductVariant[]} sku or varaints - available only when product is a normal product.
51
- * @property {boolean|null} [exists] indicates whethere the SKU exists or not (HTTP 404) e.g., false
52
51
  */
53
52
 
54
53
  /**
@@ -26,7 +26,7 @@ function productNotFoundInterceptor(error) {
26
26
  ...error.response,
27
27
  data: {
28
28
  product: [
29
- productNotFound({ identifier: sku, exists: false }, market)
29
+ productNotFound({ identifier: sku }, market)
30
30
  ]
31
31
  },
32
32
  statusText: getStatusText(error.response)
@@ -9,40 +9,25 @@ const { mapIdentifier, mapProperties, mapVariant } = require('../mappers');
9
9
  function productNotFound(product, market) {
10
10
  /** @type {import('../').EquinoxNormalProduct} */
11
11
  const model = {};
12
- model.identifier = mapIdentifier(` ${product.identifier}`);
12
+ model.identifier = mapIdentifier(product.identifier);
13
13
  model.properties = mapProperties();
14
- model.exists = mapExists(product.exists);
15
14
  model.sku = [mapVariant({
16
- // adding a whitespace allows us to display an SKU with 55
17
- // without initializing the variant selector of ns-product-small
18
- identifier: ` ${product.identifier}`,
15
+ identifier: product.identifier,
19
16
  properties: {
20
17
  availableChannels: 'subscription,arsPhone,kiosk,mobile,web',
21
18
  customerTypes: 'BrandAffiliate,Preferred,Retail',
22
- description: 'not-found',
23
19
  imageURL: 'https://nuskin.com/content/dam/global/images/products/01102730-nu-skin-tri-phasic-white-essence.png',
24
20
  isExclusive: 'false',
25
21
  market,
26
- name: ` ${product.identifier}`,
22
+ name: product.identifier,
27
23
  productStatus: 'Sellable',
28
24
  scanQualifiedCount: '0',
29
25
  status: 'active',
30
- title: ` ${product.identifier}`
26
+ title: product.identifier
31
27
  }
32
28
  })];
33
29
 
34
30
  return model;
35
31
  }
36
32
 
37
- /**
38
- * @param {boolean|null|undefined} exists
39
- */
40
- function mapExists(exists) {
41
- if (exists === undefined) {
42
- return null;
43
- }
44
-
45
- return exists;
46
- }
47
-
48
33
  module.exports = productNotFound;
package/src/product.js CHANGED
@@ -75,14 +75,7 @@ const Product = function(productData) {
75
75
  //equinox inventory / stock label
76
76
  //@example "IN STOCK"
77
77
  this.inventory = "";
78
-
79
- // equinox specific properties
80
78
  this.equinoxProductId = "";
81
- this.equinox = {
82
- sku: {
83
- exists: null
84
- }
85
- };
86
79
 
87
80
  this.setMarketAttributes = function(productStatus) {
88
81
  if (productStatus.marketAttributes) {
@@ -541,11 +534,6 @@ const Product = function(productData) {
541
534
  retData.addOns = this.addOns;
542
535
  retData.inventory = this.inventory;
543
536
  retData.equinoxProductId = this.equinoxProductId;
544
- retData.equinox = {
545
- sku: {
546
- exists: this.equinox.sku.exists
547
- }
548
- };
549
537
 
550
538
  return retData;
551
539
  };
@@ -687,14 +675,6 @@ const Product = function(productData) {
687
675
  }
688
676
 
689
677
  this.equinoxProductId = data.equinoxProductId;
690
-
691
- if (data.equinox && data.equinox.sku) {
692
- this.equinox = {
693
- sku: {
694
- exists: data.equinox.sku.exists
695
- }
696
- };
697
- }
698
678
  }
699
679
  };
700
680
 
@@ -462,12 +462,7 @@ const ProductData = {
462
462
  "restrictedMarkets": [],
463
463
  "addOns": [],
464
464
  "inventory": product.inventory || "", //inventory label
465
- "equinoxProductId": productData.identifier,
466
- equinox: {
467
- sku: {
468
- exists: productData.exists ? productData.exists : false
469
- }
470
- }
465
+ "equinoxProductId": productData.identifier
471
466
  };
472
467
 
473
468
  products.push(new Product(product));