@nuskin/ns-product-lib 1.5.0-cx24-1810.16 → 1.5.0-cx24-1810.19

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.5.0-cx24-1810.19](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.5.0-cx24-1810.18...v1.5.0-cx24-1810.19) (2022-08-10)
2
+
3
+
4
+ ### New
5
+
6
+ * Get Product Data from Equinox (#CX24-1810) ([4fb495c](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/4fb495c36ef972e6c76f832ee3426982b02bc152)), closes [#CX24-1810](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-1810)
7
+
8
+ # [1.5.0-cx24-1810.18](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.5.0-cx24-1810.17...v1.5.0-cx24-1810.18) (2022-08-10)
9
+
10
+
11
+ ### New
12
+
13
+ * Get Product Data from Equinox (#CX24-1810) ([e891f07](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/e891f07e19ece0b3b23f4b6dd8e4d9d9a68fbeea)), closes [#CX24-1810](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-1810)
14
+
15
+ # [1.5.0-cx24-1810.17](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.5.0-cx24-1810.16...v1.5.0-cx24-1810.17) (2022-08-10)
16
+
17
+
18
+ ### New
19
+
20
+ * Get Product Data from Equinox (#CX24-1810) ([f3c98a5](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/f3c98a58fd69e157fc8c98c546f7300a0a40cba0)), closes [#CX24-1810](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-1810)
21
+ * Get Product Data from Equinox (#CX24-1810) ([f219567](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/f219567ab2193d1b0f5d13ff1e09e3dda8735bb4)), closes [#CX24-1810](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-1810)
22
+
1
23
  # [1.5.0-cx24-1810.16](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.5.0-cx24-1810.15...v1.5.0-cx24-1810.16) (2022-08-04)
2
24
 
3
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "1.5.0-cx24-1810.16",
3
+ "version": "1.5.0-cx24-1810.19",
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": {
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  const axios = require("axios");
3
+ const product = require("./product")
3
4
 
4
5
  const ProductData = {
5
6
  getProductData: async function (skus, runConfig, marketConfig, isEqEnabled) {
@@ -9,15 +10,17 @@ const ProductData = {
9
10
  let filter = '{"filters":[{"field":"index_key_skuId","operation":"IN","value":"' +
10
11
  skus.toString() +
11
12
  '"}]}'
12
- axios.defaults.withCredentials = true
13
+ axios.defaults.withCredentials = true;
13
14
  let productDataResponse = await axios.request({
14
15
  method: 'get',
15
- url: 'https://storefront.api.wts.nuskin.io/orchestrationservices/storefront/catalogs/search/',
16
+ url: `https://storefront.api.wts.nuskin.io/orchestrationservices/storefront/catalogs/search/`,
16
17
  params: {
17
18
  locale: locale,
18
19
  storeId: '406',
19
20
  filter: filter
20
- }
21
+ },
22
+ headers: this.getProductDataRequestHeaders(marketConfig),
23
+ responseType: "json"
21
24
  });
22
25
  productResponse = this.eqProductMapper(productDataResponse.data.product)
23
26
 
@@ -45,10 +48,12 @@ const ProductData = {
45
48
 
46
49
  eqProductMapper: function (productDataResponse) {
47
50
  let prodArr = [];
51
+ let prod = [];
48
52
  let count = 0;
49
53
  productDataResponse.forEach((data, index) => {
50
54
  count++
51
- prodArr[index] = {
55
+
56
+ prod = {
52
57
  "sku": data.sku[0].identifier,
53
58
  "globalProductID": data.identifier,
54
59
  "title": data.properties.name,
@@ -155,6 +160,9 @@ const ProductData = {
155
160
  "restrictedMarkets": [],
156
161
  "addOns": []
157
162
  };
163
+ let newProduct = new product(prod);
164
+ prodArr[index] = newProduct;
165
+
158
166
  });
159
167
 
160
168
  let data = {