@nuskin/ns-product-lib 1.4.0 → 1.4.2-cx15-4839.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## [1.4.2-cx15-4839.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.4.2-cx15-4839.1...v1.4.2-cx15-4839.2) (2022-04-07)
2
+
3
+
4
+ ### Fix
5
+
6
+ * made restrictedMarkets default to [] (#CX15-4839) ([110db9d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/110db9d30a38727ff42931b840c9325380638b4c)), closes [#CX15-4839](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX15-4839)
7
+
8
+ ## [1.4.2-cx15-4839.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.4.1...v1.4.2-cx15-4839.1) (2022-04-07)
9
+
10
+
11
+ ### Fix
12
+
13
+ * added support for restrictedMarkets and addOns fields to product data response (#CX15-4839) ([43c0346](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/43c03462950d655aa1dab096143b2e1d909bc6f6)), closes [#CX15-4839](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX15-4839)
14
+
15
+ ## [1.4.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.4.0...v1.4.1) (2022-03-31)
16
+
17
+
18
+ ### Fix
19
+
20
+ * adding locallyProduced flag to mapper (#CX16-5842) ([b5a31ca](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b5a31cab7cbaaba51af23f29bd70d8b0b495af44)), closes [#CX16-5842](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX16-5842)
21
+ * adding locallyProduced flag to mapper (#CX16-5842) ([c50407d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/c50407d90270e017a37d3427e43752da34002c11)), closes [#CX16-5842](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX16-5842)
22
+
1
23
  # [1.4.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.3.7...v1.4.0) (2022-03-31)
2
24
 
3
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "1.4.0",
3
+ "version": "1.4.2-cx15-4839.2",
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": {
package/src/product.js CHANGED
@@ -16,6 +16,7 @@ const Product = function(productData) {
16
16
  this.childSkus = [];
17
17
  this.custTypes = [];
18
18
  this.addOns = [];
19
+ this.restrictedMarkets = [];
19
20
  this.productCarouselImages = [];
20
21
  this.locallyProduced = false;
21
22
 
@@ -514,6 +515,8 @@ const Product = function(productData) {
514
515
  retData.searchScore = this.searchScore;
515
516
  retData.isExclusive = this.isExclusive;
516
517
  retData.marketAttributes = this.marketAttributes;
518
+ retData.restrictedMarkets = this.restrictedMarkets;
519
+ retData.addOns = this.addOns;
517
520
 
518
521
  return retData;
519
522
  };
@@ -621,6 +624,7 @@ const Product = function(productData) {
621
624
  this.searchScore = productData.searchScore ? productData.searchScore : 0;
622
625
  this.marketAttributes = productData.marketAttributes;
623
626
  this.addOns = productData.addOns || [];
627
+ this.restrictedMarkets = productData.restrictedMarkets || [];
624
628
 
625
629
  if (data.priceType) {
626
630
  this.addPricing(data.priceType, data.price);
@@ -51,6 +51,10 @@ const ProductContentMapper = {
51
51
  if (restrictedMarkets) {
52
52
  product.restrictedMarkets = restrictedMarkets;
53
53
  }
54
+
55
+ if (marketData.addOns) {
56
+ product.addOns = marketData.addOns;
57
+ }
54
58
  }
55
59
 
56
60
  // set product values
@@ -36,6 +36,7 @@ const ProductStatusMapper = {
36
36
  globalProductID: productStatusV2.globalProductID,
37
37
  backordered: productStatusV2.backordered,
38
38
  backorderedAvailableDate: productStatusV2.backorderedAvailableDate,
39
+ locallyProduced: productStatusV2.locallyProduced,
39
40
  availableQuantity: productStatusV2.availableQuantity,
40
41
  webEnabled: productStatusV2.webEnabled,
41
42
  status: getStatusPartFromV2(productStatusV2),