@nuskin/ns-product-lib 2.5.0-cx24-2685.2 → 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 +7 -11
- package/package.json +2 -1
- package/src/product.js +0 -1
- package/src/productData.js +20 -8
package/CHANGELOG.md
CHANGED
@@ -1,17 +1,13 @@
|
|
1
|
-
# [2.5.0-cx24-
|
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
|
-
###
|
5
|
-
|
6
|
-
* Added equinoxProductId for eqproductMapper and eqProductVariantMapper ([37d77c6](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/37d77c68379403db7ca1289b800f593f981b2710))
|
7
|
-
|
8
|
-
# [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)
|
9
|
-
|
10
|
-
|
11
|
-
### New
|
4
|
+
### Update
|
12
5
|
|
13
|
-
*
|
14
|
-
*
|
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))
|
15
11
|
|
16
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)
|
17
13
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nuskin/ns-product-lib",
|
3
|
-
"version": "2.5.0-cx24-
|
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
@@ -532,7 +532,6 @@ const Product = function(productData) {
|
|
532
532
|
retData.restrictedMarkets = this.restrictedMarkets;
|
533
533
|
retData.addOns = this.addOns;
|
534
534
|
retData.inventory = this.inventory;
|
535
|
-
retData.equinoxProductId = this.equinoxProductId;
|
536
535
|
|
537
536
|
return retData;
|
538
537
|
};
|
package/src/productData.js
CHANGED
@@ -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
|
19
|
-
|
20
|
-
|
21
|
-
|
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 || ""
|
361
|
-
|
372
|
+
"inventory": data.sku[count].inventory || "" //inventory label
|
373
|
+
|
362
374
|
};
|
363
375
|
let newProduct = new Product(prod);
|
364
376
|
return newProduct
|