@nuskin/ns-product-lib 2.9.0-mysitedomainfix.4 → 2.9.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,49 +1,44 @@
1
- # [2.9.0-mysitedomainfix.4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.9.0-mysitedomainfix.3...v2.9.0-mysitedomainfix.4) (2023-06-21)
1
+ ## [2.9.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.9.0...v2.9.1) (2023-07-17)
2
2
 
3
3
 
4
4
  ### Fix
5
5
 
6
- * added shopping context checking ([dbfa1b8](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/dbfa1b8cdef76d65c3ea536c3901ae8fb2dde36f))
6
+ * map AEM author url for test and prod (#CX24-4101) ([ade7ecc](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/ade7ecc6a29d4af4a3448a9113c016b5749fb148)), closes [#CX24-4101](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-4101)
7
7
 
8
- # [2.9.0-mysitedomainfix.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.9.0-mysitedomainfix.2...v2.9.0-mysitedomainfix.3) (2023-06-21)
8
+ # [2.9.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.2...v2.9.0) (2023-07-05)
9
9
 
10
10
 
11
11
  ### Update
12
12
 
13
- * added hostname as condition on switching domains ([af0d628](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/af0d6289cb9c722c887f9b027b66db1cacb1dd5a))
13
+ * added showWholeSalePricing flag in search api header (#CX24-4377) ([3fdd834](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3fdd83481637428d9ccf287d3c5d1c0e85fd1f32)), closes [#CX24-4377](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-4377)
14
14
 
15
- # [2.9.0-mysitedomainfix.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.9.0-mysitedomainfix.1...v2.9.0-mysitedomainfix.2) (2023-06-21)
15
+ # [2.9.0-cx24-4377.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.3-cx24-4377.1...v2.9.0-cx24-4377.1) (2023-07-03)
16
16
 
17
17
 
18
- ### Fix
19
-
20
- * for PO use nuskin.com domain ([3596e90](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3596e902ef15e3f2d9d15242edfcc423571e6ca3))
21
-
22
18
  ### Update
23
19
 
24
- * adjust unit testing for searchEquinoxProduct ([30c2732](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/30c2732d9e7dfc793493eb30594abff068ba0207))
20
+ * added showWholesalePrice in the header for product search (#CX24-4377) ([dc18916](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/dc189169241eb869caf69407767c7a6ab3c18438)), closes [#CX24-4377](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-4377)
25
21
 
26
- # [2.9.0-mysitedomainfix.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.9.0-cx24-4460.1...v2.9.0-mysitedomainfix.1) (2023-06-20)
22
+ ## [2.8.3-cx24-4377.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.2...v2.8.3-cx24-4377.1) (2023-06-27)
27
23
 
28
24
 
29
25
  ### Fix
30
26
 
31
- * added the logic to change the domain using the shopping context. ([91449cb](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/91449cb1463eaacb0bc80ba4308c4c8fb6ace777))
32
- * changing the equinox api domain so that it stays on the same domain as the mysite domain ([b3e672a](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b3e672a4dae57012cf61d9a1f4454eaab674c3e7))
33
- * Multiple variants add to cart not adding correct sku ([968ed05](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/968ed055b5f5024579ac256f26c0d58ba409fcb9))
27
+ * adr promotion pricing (#CX24-4377) ([c1ea833](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/c1ea833d5b80da366e3dd0bd45cefcb18d096a34)), closes [#CX24-4377](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-4377)
34
28
 
35
- ### Release
29
+ ## [2.8.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.1...v2.8.2) (2023-06-21)
36
30
 
37
- * Automated changes by GitLab pipeline [skip ci] ([679e474](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/679e474ad639ca2cf57652acc8fe71db85fac6fc))
38
- * Automated changes by GitLab pipeline [skip ci] ([5500a55](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/5500a550253e487b79045a9b5f5403bc93c3ee5a))
39
31
 
40
- # [2.9.0-cx24-4460.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.0...v2.9.0-cx24-4460.1) (2023-06-20)
32
+ ### Fix
41
33
 
34
+ * added shopping context checking ([8714953](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/8714953113f4f1970cacd4f4f6b59ecc61e767eb))
35
+
36
+ ## [2.8.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.0...v2.8.1) (2023-05-23)
42
37
 
43
- ### New
44
38
 
45
- * Change API Base URLs for My Site ([fb2e309](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/fb2e30953e6e9089da20ac367bad9bf63300a89c))
46
- * Change API Base URLs for My Site ([1f9ba11](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/1f9ba11f63ef85e9a444e39080e9277a41fa004d))
39
+ ### Fix
40
+
41
+ * Multiple variants add to cart not adding correct sku ([968ed05](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/968ed055b5f5024579ac256f26c0d58ba409fcb9))
47
42
 
48
43
  # [2.8.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.1...v2.8.0) (2023-05-02)
49
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.9.0-mysitedomainfix.4",
3
+ "version": "2.9.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": {
@@ -19,21 +19,21 @@
19
19
  "license": "ISC",
20
20
  "homepage": "https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/blob/master/README.md",
21
21
  "devDependencies": {
22
- "@babel/preset-env": "^7.22.5",
23
22
  "axios-mock-adapter": "1.21.2",
24
23
  "eslint": "5.16.0",
25
24
  "eslint-config-google": "0.14.0",
26
25
  "eslint-config-prettier": "4.1.0",
27
26
  "eslint-plugin-json": "2.1.1",
28
27
  "eslint-plugin-prettier": "3.1.2",
29
- "jest": "29.5.0",
28
+ "jest": "29.2.2",
30
29
  "jest-environment-jsdom": "29.2.2",
31
30
  "jest-sonar-reporter": "2.0.0",
32
31
  "prettier": "1.19.1"
33
32
  },
34
33
  "dependencies": {
35
34
  "@nuskin/configuration-sdk": "2.2.3",
36
- "@nuskin/ns-common-lib": "1.4.5",
35
+ "@nuskin/ns-common-lib": "1.4.7",
36
+ "@nuskin/ns-util": "4.3.2",
37
37
  "axios": "0.27.2",
38
38
  "qs": "6.11.0"
39
39
  },
@@ -84,7 +84,7 @@ const ProductData = {
84
84
  locale,
85
85
  storeId: config.store_id
86
86
  },
87
- headers: this.getEquinoxRequestHeaders(),
87
+ headers: this.getEquinoxRequestHeaders({shoppingContext}),
88
88
  responseType: 'json',
89
89
  withCredentials: true
90
90
  });
@@ -93,10 +93,16 @@ const ProductData = {
93
93
  return response;
94
94
  },
95
95
 
96
- getEquinoxRequestHeaders() {
97
- return {
96
+ getEquinoxRequestHeaders(option) {
97
+ const header = {
98
98
  'Content-Type': 'application/json'
99
- };
99
+ }
100
+
101
+ if (option.shoppingContext && option.shoppingContext.overrides) {
102
+ header.showwholesalepricing = option.shoppingContext.overrides.showWholeSalePricing;
103
+ }
104
+
105
+ return header;
100
106
  },
101
107
 
102
108
  getProductFromLegacy: async function (skus, locale) {
@@ -260,10 +266,10 @@ const ProductData = {
260
266
  "priceMap": {
261
267
  "WRTL": productPrice,
262
268
  "WADW-WRTL": productPrice,
263
- "WADR": productPrice,
269
+ "WADR": productPrice, //retail ADR (subscription) price
264
270
  "RTL": productPrice,
265
271
  "WWHL": wholeSalePrice,
266
- "WADW": wholeSalePrice,
272
+ "WADW": discountedPrice,//wholesale ADR (subscription price)
267
273
  "WHL": wholeSalePrice
268
274
  },
269
275
  "cvMap": {
@@ -444,9 +450,9 @@ const ProductData = {
444
450
  "priceMap": {
445
451
  "WRTL": productPrice, //regular | retail price
446
452
  "WADW-WRTL": productPrice,
447
- "WADR": productPrice,
453
+ "WADR": productPrice, //retail ADR (subscription price)
448
454
  "RTL": productPrice,
449
- "WADW": wholeSalePrice,
455
+ "WADW": discountedPrice,//wholesale ADR (subscription price)
450
456
  "WHL": wholeSalePrice,
451
457
  "WWHL": wholeSalePrice
452
458
  },