@nuskin/ns-product-lib 2.11.0-cx24-5092.2 → 2.11.0-cx24-5092.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/productData.js +4 -5
- package/src/productGraphQL.js +29 -26
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# [2.11.0-cx24-5092.4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.3...v2.11.0-cx24-5092.4) (2023-09-08)
|
2
|
+
|
3
|
+
|
4
|
+
### New
|
5
|
+
|
6
|
+
* Moving from AEM to CS for EQ markets ([af5acd8](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/af5acd8dca1c73004b6ee634faf90d6e47f974fd))
|
7
|
+
|
8
|
+
# [2.11.0-cx24-5092.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.2...v2.11.0-cx24-5092.3) (2023-09-08)
|
9
|
+
|
10
|
+
|
11
|
+
### New
|
12
|
+
|
13
|
+
* Moving from AEM to CS for EQ markets ([1c61841](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/1c6184105b06c7a04846f78d2e4d939c3ff67e93))
|
14
|
+
|
1
15
|
# [2.11.0-cx24-5092.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.11.0-cx24-5092.1...v2.11.0-cx24-5092.2) (2023-09-08)
|
2
16
|
|
3
17
|
|
package/package.json
CHANGED
package/src/productData.js
CHANGED
@@ -27,11 +27,10 @@ const ProductData = {
|
|
27
27
|
|
28
28
|
|
29
29
|
const config = (await getConfiguration(['Equinox_Markets'])).Equinox_Markets;
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
})
|
30
|
+
const graphQLResponse = ProductGraphQL.getProductFromGraphQL(skus)
|
31
|
+
console.log(graphQLResponse)
|
32
|
+
console.log(isEquinoxEnabled)
|
33
|
+
|
35
34
|
|
36
35
|
|
37
36
|
if (config.active) {
|
package/src/productGraphQL.js
CHANGED
@@ -6,35 +6,38 @@ const getProductGql = require('./graphQl/query')
|
|
6
6
|
|
7
7
|
|
8
8
|
const ProductGraphQL = {
|
9
|
-
getProductFromGraphQL: async function (
|
9
|
+
getProductFromGraphQL: async function (skus) {
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
skus.forEach(sku => {
|
12
|
+
let data = JSON.stringify({
|
13
|
+
query: getProductGql,
|
14
|
+
variables: { "market": "us", "language": "en", "id": sku, "useContentSource": null, "quantity": 1, "okta": null }
|
15
|
+
});
|
16
|
+
|
17
|
+
let axiosGqlConfig = {
|
18
|
+
method: 'post',
|
19
|
+
url: 'https://product.api.test.nuskin.com/graphql',
|
20
|
+
headers: {
|
21
|
+
'authority': 'product.api.test.nuskin.com',
|
22
|
+
'accept': '*/*',
|
23
|
+
'accept-language': 'en-US,en;q=0.9',
|
24
|
+
'content-type': 'application/json',
|
25
|
+
'origin': 'https://mysite.test.mynuskin.com',
|
26
|
+
'referer': 'https://mysite.test.mynuskin.com/'
|
27
|
+
|
28
|
+
},
|
29
|
+
data: data
|
30
|
+
};
|
31
|
+
|
32
|
+
axios.request(axiosGqlConfig)
|
33
|
+
.then((response) => {
|
34
|
+
return response.data
|
35
|
+
})
|
36
|
+
.catch((error) => {
|
37
|
+
console.log(error);
|
38
|
+
});
|
14
39
|
});
|
15
40
|
|
16
|
-
let axiosGqlConfig = {
|
17
|
-
method: 'post',
|
18
|
-
url: 'https://product.api.test.nuskin.com/graphql',
|
19
|
-
headers: {
|
20
|
-
'authority': 'product.api.test.nuskin.com',
|
21
|
-
'accept': '*/*',
|
22
|
-
'accept-language': 'en-US,en;q=0.9',
|
23
|
-
'content-type': 'application/json',
|
24
|
-
'origin': 'https://mysite.test.mynuskin.com',
|
25
|
-
'referer': 'https://mysite.test.mynuskin.com/'
|
26
|
-
|
27
|
-
},
|
28
|
-
data: data
|
29
|
-
};
|
30
|
-
|
31
|
-
axios.request(axiosGqlConfig)
|
32
|
-
.then((response) => {
|
33
|
-
return response.data
|
34
|
-
})
|
35
|
-
.catch((error) => {
|
36
|
-
console.log(error);
|
37
|
-
});
|
38
41
|
|
39
42
|
}
|
40
43
|
|