@nuskin/ns-product-lib 2.5.1-cx24-3503.2.1 → 2.5.2

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,27 +1,47 @@
1
- ## [2.5.1-cx24-3503.2.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0...v2.5.1-cx24-3503.2.1) (2023-03-07)
1
+ ## [2.5.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.1...v2.5.2) (2023-03-09)
2
2
 
3
3
 
4
4
  ### Fix
5
5
 
6
- * update dependencies #CX24-3503 ([53cea8d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/53cea8d5eb39ebaf9ff21b45d2310f02db98e25d)), closes [#CX24-3503](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3503)
6
+ * CORS error in MySite when IsEquinoxEnabled = true ([3f66250](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3f66250de211a63906ca0aa50f60257f63e3bc56))
7
7
 
8
- # [2.5.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.4.1...v2.5.0) (2023-02-22)
8
+ ## [2.5.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0...v2.5.1) (2023-03-07)
9
9
 
10
10
 
11
- ### New
11
+ ### Fix
12
12
 
13
- * equinox API integration (#CX24) ([a169d58](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/a169d5806f20737fae42d0ebe18a7c746861a4fb)), closes [#CX24](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24)
13
+ * update getConfiguration call to work with new version of configuration-sdk #CX24-3503 ([8be370e](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/8be370ebfda910deea01fc562d28c199ed520467)), closes [#CX24-3503](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3503)
14
14
 
15
- # [2.5.0-cx24-2179.2.19](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2179.2.18...v2.5.0-cx24-2179.2.19) (2023-01-27)
15
+ # [2.6.0-cx24-3503.2.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0-cx24-3503.1...v2.6.0-cx24-3503.2.1) (2023-03-07)
16
16
 
17
17
 
18
18
  ### Fix
19
19
 
20
- * parent product customer types (#CX24-3175) ([411b2cc](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/411b2cc5a7cf687152dc346579766c8f923b795a)), closes [#CX24-3175](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3175)
20
+ * update dependencies #CX24-3503 ([0ea7523](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/0ea752306f8e64d5f73d397d5ddf3cf1839865c3)), closes [#CX24-3503](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3503)
21
+ * update dependencies #CX24-3503 ([53cea8d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/53cea8d5eb39ebaf9ff21b45d2310f02db98e25d)), closes [#CX24-3503](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3503)
22
+ * update dependencies #CX24-3503 ([dd38c23](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/dd38c23b0094dea202fce7c6407c06c917d61676)), closes [#CX24-3503](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3503)
23
+ * update dependencies #CX24-3503 ([ca67042](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/ca670420a7ed79e7c6fabeb4b7c722abc5811a18)), closes [#CX24-3503](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3503)
24
+ * update dependencies #CX24-3503 ([2ac0b65](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/2ac0b652f84937d37716e861504ad8c424b20beb)), closes [#CX24-3503](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3503)
25
+ * update dependencies #CX24-3503 ([682078f](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/682078f703ccb8a0e84a559e828543f31f53ccd8)), closes [#CX24-3503](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3503)
26
+ * update dependencies #CX24-3503 ([d48fb1a](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/d48fb1ac5e29dc7477be7b65522f25a2bbf25250)), closes [#CX24-3503](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3503)
21
27
 
22
- ### Update
28
+ ### Release
29
+
30
+ * Automated changes by GitLab pipeline [skip ci] ([fa35816](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/fa35816ef50672ceaac01173d55615d88cb2c75b))
31
+
32
+ ## [2.5.1-cx24-3503.2.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0...v2.5.1-cx24-3503.2.1) (2023-03-07)
23
33
 
24
- * clean ups - expose customerTypes (#CX24-3175) ([3b7d9b1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3b7d9b12a9cf815b11a8af61621ab9ebc76c37b5)), closes [#CX24-3175](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3175)
34
+
35
+ ### Fix
36
+
37
+ * update dependencies #CX24-3503 ([53cea8d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/53cea8d5eb39ebaf9ff21b45d2310f02db98e25d)), closes [#CX24-3503](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3503)
38
+
39
+ # [2.5.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.4.1...v2.5.0) (2023-02-22)
40
+
41
+
42
+ ### New
43
+
44
+ * equinox API integration (#CX24) ([a169d58](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/a169d5806f20737fae42d0ebe18a7c746861a4fb)), closes [#CX24](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24)
25
45
 
26
46
  # [2.5.0-cx24-2179.2.18](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2179.2.17...v2.5.0-cx24-2179.2.18) (2023-01-26)
27
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.5.1-cx24-3503.2.1",
3
+ "version": "2.5.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": {
@@ -31,9 +31,9 @@
31
31
  "prettier": "1.19.1"
32
32
  },
33
33
  "dependencies": {
34
- "@nuskin/configuration-sdk": "1.0.1",
34
+ "@nuskin/configuration-sdk": "2.2.3",
35
35
  "@nuskin/ns-common-lib": "1.4.5",
36
- "@nuskin/ns-util": "3.107.0",
36
+ "@nuskin/ns-util": "4.2.4",
37
37
  "axios": "0.27.2",
38
38
  "qs": "6.11.0"
39
39
  },
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  const { getConfiguration } = require('@nuskin/configuration-sdk');
3
- const { getEnvironmentFromUrl } = require('@nuskin/ns-common-lib');
4
3
  const axios = require("axios");
5
4
  const contentstack = require('./contentstack/contentstack');
6
5
  const Product = require("./product");
@@ -18,14 +17,9 @@ const ProductData = {
18
17
  const localeMarket = `${locale}_${market}`;
19
18
 
20
19
  if (isEquinoxEnabled) {
21
- let config = (await getConfiguration({
22
- configMapNames: ['Equinox_Markets'],
23
- country: market,
24
- environment: contentstackEnv(),
25
- clientId: '735b1eb810304bba966af0891ab54053'
26
- }));
27
-
28
- if (config.Equinox_Markets.country_code === market && config.Equinox_Markets.active) {
20
+ const config = (await getConfiguration(['Equinox_Markets'])).Equinox_Markets;
21
+
22
+ if (config.country_code === market && config.active) {
29
23
  return await this.getProductFromEquinox(skus, localeMarket, config);
30
24
  }
31
25
  }
@@ -34,19 +28,19 @@ const ProductData = {
34
28
 
35
29
  getProductFromEquinox: async function (skus, locale, config) {
36
30
  const filter = `{"filters": [{"field": "index_key_skuId","operation": "IN", "value": "${skus.toString()}"}]}`;
37
- axios.defaults.withCredentials = true;
38
31
 
39
- const url = `${config.Equinox_Markets.API_Base_URLs}/orchestrationservices/storefront/catalogs/search/`;
32
+ const url = `${config.API_Base_URLs}/orchestrationservices/storefront/catalogs/search/`;
40
33
  const href = `${url}?filter=${encodeURI(filter)}`;
41
34
  const response = await axios.request({
42
35
  method: 'get',
43
36
  url: href,
44
37
  params: {
45
38
  locale,
46
- storeId: config.Equinox_Markets.store_id
39
+ storeId: config.store_id
47
40
  },
48
41
  headers: this.getEquinoxRequestHeaders(),
49
- responseType: 'json'
42
+ responseType: 'json',
43
+ withCredentials: true
50
44
  });
51
45
 
52
46
  if (response.data.product) {
@@ -602,12 +596,4 @@ const ProductData = {
602
596
  }
603
597
  }
604
598
 
605
- function contentstackEnv() {
606
- if (typeof window === 'undefined') {
607
- return 'test';
608
- }
609
-
610
- return (getEnvironmentFromUrl(window.location.host) != "prod") ? "test" : "prod";
611
- }
612
-
613
599
  module.exports = ProductData;