@nuskin/ns-util 4.7.0 → 4.7.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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/urlService.js +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-util",
3
- "version": "4.7.0",
3
+ "version": "4.7.2",
4
4
  "baseURL": "/",
5
5
  "main": "src/util.js",
6
6
  "scripts": {
@@ -37,7 +37,7 @@
37
37
  "@babel/preset-env": "7.9.0",
38
38
  "@nuskin/configuration-sdk": "2.2.0",
39
39
  "@nuskin/ns-jsanalyzer": "1.0.1",
40
- "axios": "1.6.7",
40
+ "axios": "1.7.4",
41
41
  "axios-mock-adapter": "1.21.4",
42
42
  "babel-jest": "25.2.6",
43
43
  "bower": "1.8.8",
@@ -66,11 +66,11 @@
66
66
  "watch": "0.17.1"
67
67
  },
68
68
  "peerDependencies": {
69
- "axios": ">=1.6.5",
69
+ "axios": "1.7.4",
70
70
  "@nuskin/configuration-sdk": "2.x"
71
71
  },
72
72
  "resolutions": {
73
73
  "lodash": "4.17.21",
74
- "axios": "1.6.7"
74
+ "axios": "1.7.4"
75
75
  }
76
76
  }
package/src/urlService.js CHANGED
@@ -9,6 +9,7 @@ import RunConfigService from './runConfigService';
9
9
  export default {
10
10
  extractHostURL : extractHostURL,
11
11
  extractDomain: extractDomain,
12
+ getApisUrl,
12
13
  getAwsUrl,
13
14
  getSiteUrl,
14
15
  getSelectors: getSelectors,
@@ -184,6 +185,15 @@ function getAwsUrl() {
184
185
  return `https://${env}api.cloud.nuskin.com`;
185
186
  }
186
187
 
188
+ /**
189
+ * Returns the aws cloud url based on environment
190
+ */
191
+ function getApisUrl() {
192
+ let env = RunConfigService.getEnvironmentCode();
193
+ env = env === 'prod' ? '' : `${env}.`;
194
+ return `https://apis.${env}nuskin.com`;
195
+ }
196
+
187
197
  function getSiteUrl() {
188
198
  let env = RunConfigService.getEnvironmentCode();
189
199
  env = env === 'prod' ? 'www' : env;