@nuskin/ns-product-lib 2.7.1 → 2.7.2-cdb-1.1

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,10 @@
1
+ ## [2.7.2-cdb-1.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.1...v2.7.2-cdb-1.1) (2023-04-17)
2
+
3
+
4
+ ### Fix
5
+
6
+ * added some logs (#CDB-1) ([253482b](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/253482ba8825d56d9a7e3d8541a83bbbda03e09b)), closes [#CDB-1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CDB-1)
7
+
1
8
  ## [2.7.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0...v2.7.1) (2023-04-15)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.7.1",
3
+ "version": "2.7.2-cdb-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": {
@@ -21,20 +21,48 @@ const ProductData = {
21
21
  * @param {boolean} isEquinoxEnabled
22
22
  */
23
23
  getProductData: async function (skus, locale, market, isEquinoxEnabled = false) {
24
+ console.trace({
25
+ where: 'productData getProductData',
26
+ skus,
27
+ locale,
28
+ market,
29
+ isEquinoxEnabled
30
+ })
24
31
  const localeMarket = `${locale}_${market}`;
25
32
 
26
33
  if (isEquinoxEnabled) {
27
34
  const config = (await getConfiguration(['Equinox_Markets'])).Equinox_Markets;
35
+ console.trace({
36
+ where: 'productData getProductData',
37
+ config
38
+ })
28
39
 
29
40
  if (config.country_code === market && config.active) {
41
+ console.trace({
42
+ where: 'productData getProductData equinox path',
43
+ config
44
+ })
30
45
  return await this.getProductFromEquinox(skus, localeMarket, config);
31
46
  }
32
47
  }
48
+ console.trace({
49
+ where: 'productData getProductData legacy path'
50
+ })
33
51
  return await this.getProductFromLegacy(skus, localeMarket);
34
52
  },
35
53
 
36
54
  getProductFromEquinox: async function (skus, locale, config) {
55
+ console.trace({
56
+ where: 'productData getProductFromEquinox',
57
+ skus,
58
+ locale,
59
+ config
60
+ })
37
61
  const response = await this.searchEquinoxProduct(skus, locale, config);
62
+ console.trace({
63
+ where: 'productData getProductFromEquinox',
64
+ response
65
+ })
38
66
 
39
67
  if (response.data.product) {
40
68
  return await this.eqProductMapper(response.data.product, skus);
@@ -94,7 +122,16 @@ const ProductData = {
94
122
  },
95
123
 
96
124
  getProductFromLegacy: async function (skus, locale) {
125
+ console.trace({
126
+ where: 'productData getProductFromLegacy',
127
+ skus,
128
+ locale
129
+ })
97
130
  const marketConfig = await contentstack.getAEMConfig();
131
+ console.trace({
132
+ where: 'productData getProductFromLegacy',
133
+ marketConfig
134
+ })
98
135
 
99
136
  if (marketConfig === null) {
100
137
  return null;