@nuskin/ns-shop 7.3.1-td-1017.2.1 → 7.4.0-pa-1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-shop",
3
- "version": "7.3.1-td-1017.2.1",
3
+ "version": "7.4.0-pa-1.2",
4
4
  "description": "The description that will amaze and astound your audience when they read it",
5
5
  "main": "src/shop.js",
6
6
  "scripts": {
@@ -43,7 +43,7 @@
43
43
  "@nuskin/ns-account": "5.9.2",
44
44
  "@nuskin/ns-jsanalyzer": "1.0.1",
45
45
  "@nuskin/ns-product": "3.50.8",
46
- "@nuskin/ns-util": "4.6.1",
46
+ "@nuskin/ns-util": "4.7.2",
47
47
  "axios-mock-adapter": "1.22.0",
48
48
  "babel-cli": "6.26.0",
49
49
  "babel-core": "6.26.3",
@@ -0,0 +1,49 @@
1
+ import {UrlService} from "@nuskin/ns-util";
2
+ import axios from 'axios'
3
+
4
+ const downConvertAgreedToTerms = async (sapId) => {
5
+ let retVal = true;
6
+ const oktaTokens = sessionStorage.getItem("oktaTokens");
7
+ const { accessToken } = JSON.parse(oktaTokens);
8
+
9
+ if (accessToken) {
10
+ try {
11
+ const result = await axios.get(
12
+ `${UrlService.getApisUrl()}/account-enrollment/agreement-terms/${sapId}`,
13
+ { headers: { Authorization: `Bearer ${accessToken}` } }
14
+ )
15
+ retVal = result?.data?.agreedTerms;
16
+ } catch (e) {
17
+ console.error('agreement-terms check failed', e)
18
+ }
19
+ }
20
+
21
+ return retVal
22
+ }
23
+
24
+ const setDownConvertAgreedToTerms = async (sapId) => {
25
+ let succeeded = true
26
+ const oktaTokens = sessionStorage.getItem("oktaTokens");
27
+ const { accessToken } = JSON.parse(oktaTokens);
28
+
29
+ if (accessToken) {
30
+ try {
31
+ await axios.post(`${UrlService.getApisUrl()}/account-enrollment/agreement-terms`,
32
+ {
33
+ agreedTerms: true,
34
+ sapId
35
+ },
36
+ {headers: {Authorization: `Bearer ${accessToken}`}}
37
+ )
38
+ } catch (e) {
39
+ console.error('Failed setting agreement to terms', e);
40
+ succeeded = false;
41
+ }
42
+ }
43
+ return succeeded;
44
+ }
45
+
46
+ export default {
47
+ downConvertAgreedToTerms,
48
+ setDownConvertAgreedToTerms
49
+ };
@@ -456,8 +456,7 @@ function _assembleAdrProperties(requestData, options) {
456
456
  isBackOrdered: requestData.skus && requestData.skus[requestData.skus.length - 1].backOrdered || false,
457
457
  imageURL: options.product.fullImage || '',
458
458
  name: options.product.title,
459
- productId: options.product.equinoxProductId || '',
460
- productionBom: options.product && options.product.properties && options.product.properties.productionBom || false
459
+ productId: options.product.equinoxProductId || ''
461
460
  };
462
461
  }
463
462
 
package/src/shop.js CHANGED
@@ -65,6 +65,7 @@ export {default as AccertifyFraudService} from './payment/accertifyFraudService.
65
65
  export {default as EquinoxCartService} from './cart/equinoxCartService.js';
66
66
  export {default as eidLogin} from './eidLogin';
67
67
  export {default as Receiver} from './receiver';
68
+ export {default as AgreementService} from './account/agreementService.js'
68
69
 
69
70
  export {PriceType, Agelocme, Product, ProductStatus} from '@nuskin/ns-product-lib';
70
71