@nuskin/ns-product-lib 2.5.0-cx24-2685.3 → 2.5.0-cx24-2931.1.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,24 +1,13 @@
1
- # [2.5.0-cx24-2685.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2685.2...v2.5.0-cx24-2685.3) (2022-12-09)
1
+ # [2.5.0-cx24-2931.1.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-CX24.3.1...v2.5.0-cx24-2931.1.1) (2022-12-13)
2
2
 
3
3
 
4
- ### New
5
-
6
- * Added equinoxProductId for eqproductMapper and eqProductVariantMapper ([ec9db8d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/ec9db8d922f844b89457d680f170bf07a19a41e2))
7
-
8
- # [2.5.0-cx24-2685.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2685.1...v2.5.0-cx24-2685.2) (2022-12-09)
9
-
10
-
11
- ### New
12
-
13
- * Added equinoxProductId for eqproductMapper and eqProductVariantMapper ([37d77c6](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/37d77c68379403db7ca1289b800f593f981b2710))
14
-
15
- # [2.5.0-cx24-2685.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-CX24.3.1...v2.5.0-cx24-2685.1) (2022-12-09)
16
-
17
-
18
- ### New
4
+ ### Update
19
5
 
20
- * Added equinoxProductId for eqproductMapper and eqProductVariantMapper ([30a4905](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/30a4905d3a64cba3fe54a8f0759ceb0860560914))
21
- * Added equinoxProductId for eqproductMapper and eqProductVariantMapper ([7bc7f8b](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/7bc7f8be0ff48127bb3f7db3d38a161877fb2e6f))
6
+ * use configuration-sdk to pull the configurations (CX24-2931) ([e8931ac](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/e8931aca51591c59b401c4c386f23c8f7d4c5a90))
7
+ * use configuration-sdk to pull the configurations (CX24-2931) ([4a1949a](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/4a1949a20213478994ff51e4b035f52271b7a840))
8
+ * use configuration-sdk to pull the configurations (CX24-2931) ([9a0c9cb](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9a0c9cb75a39cd1b77bd6272ac573d4f9b628975))
9
+ * use configuration-sdk to pull the configurations (CX24-2931) ([622c608](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/622c60867b07f0fccd316423cba1500a8470e9e2))
10
+ * use configuration-sdk to pull the configurations (CX24-2931) ([c276e62](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/c276e6223953cf72b791887274a5f11d218696e0))
22
11
 
23
12
  # [2.5.0-CX24.3.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.4.2-CX24.2.1...v2.5.0-CX24.3.1) (2022-12-06)
24
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.5.0-cx24-2685.3",
3
+ "version": "2.5.0-cx24-2931.1.1",
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": {
@@ -31,6 +31,7 @@
31
31
  "prettier": "1.19.1"
32
32
  },
33
33
  "dependencies": {
34
+ "@nuskin/configuration-sdk": "1.0.1",
34
35
  "@nuskin/ns-common-lib": "1.4.5",
35
36
  "@nuskin/ns-util": "3.107.0",
36
37
  "axios": "0.27.2",
package/src/product.js CHANGED
@@ -75,7 +75,6 @@ const Product = function(productData) {
75
75
  //equinox inventory / stock label
76
76
  //@example "IN STOCK"
77
77
  this.inventory = "";
78
- this.equinoxProductId = "";
79
78
 
80
79
  this.setMarketAttributes = function(productStatus) {
81
80
  if (productStatus.marketAttributes) {
@@ -533,7 +532,6 @@ const Product = function(productData) {
533
532
  retData.restrictedMarkets = this.restrictedMarkets;
534
533
  retData.addOns = this.addOns;
535
534
  retData.inventory = this.inventory;
536
- retData.equinoxProductId = this.equinoxProductId;
537
535
 
538
536
  return retData;
539
537
  };
@@ -673,8 +671,6 @@ const Product = function(productData) {
673
671
  if (data.agelocme) {
674
672
  this.agelocme = new Agelocme(data.agelocme);
675
673
  }
676
-
677
- this.equinoxProductId = data.equinoxProductId;
678
674
  }
679
675
  };
680
676
 
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ const { getPartialConfig } = require('@nuskin/configuration-sdk');
3
+ // import { ConfigService } from '@nuskin/ns-util';
2
4
  const axios = require("axios");
3
5
  const contentstack = require('./contentstack/contentstack');
4
6
  const Product = require("./product");
@@ -15,10 +17,21 @@ const ProductData = {
15
17
  const localeMarket = `${locale}_${market}`;
16
18
 
17
19
  if (isEquinoxEnabled) {
18
- const marketConfig = await contentstack.isMarketEnabled(market);
19
-
20
- if (marketConfig !== null) {
21
- return await this.getProductFromEquinox(skus, localeMarket, marketConfig.store_id);
20
+ const { Dev_Markets, Kong_Subdomain, store_id } = (
21
+ await getPartialConfig({
22
+ queryFields: {
23
+ Equinox_Markets: ["Dev_Markets", "Kong_Subdomain", "store_id"]
24
+ },
25
+ country: market,
26
+ environment: 'test',
27
+ clientId: '735b1eb810304bba966af0891ab54053'
28
+ // clientId: ConfigService.getMarketConfig().checkout.clientId
29
+ })
30
+ ).Equinox_Markets;
31
+ console.log(Dev_Markets, Kong_Subdomain, store_id);
32
+
33
+ if (store_id !== null) {
34
+ return await this.getProductFromEquinox(skus, localeMarket, store_id);
22
35
  }
23
36
  }
24
37
 
@@ -198,8 +211,7 @@ const ProductData = {
198
211
  "earn": true
199
212
  },
200
213
  "restrictedMarkets": [],
201
- "addOns": [],
202
- "equinoxProductId": eqVariant.identifier
214
+ "addOns": []
203
215
  };
204
216
  },
205
217
 
@@ -357,8 +369,8 @@ const ProductData = {
357
369
  },
358
370
  "restrictedMarkets": [],
359
371
  "addOns": [],
360
- "inventory": data.sku[count].inventory || "", //inventory label
361
- "equinoxProductId": data.identifier
372
+ "inventory": data.sku[count].inventory || "" //inventory label
373
+
362
374
  };
363
375
  let newProduct = new Product(prod);
364
376
  return newProduct