@nuskin/ns-product-lib 1.5.0-cx24-1810.4 → 1.5.0-cx24-1810.5
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 +7 -0
- package/package.json +1 -1
- package/src/productData.js +138 -22
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [1.5.0-cx24-1810.5](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.5.0-cx24-1810.4...v1.5.0-cx24-1810.5) (2022-07-24)
|
2
|
+
|
3
|
+
|
4
|
+
### New
|
5
|
+
|
6
|
+
* Get Product Data from Equinox (#CX24-1810) ([8e4b094](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/8e4b09404aa98e0b47c2411490268e9e0125772e)), closes [#CX24-1810](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-1810)
|
7
|
+
|
1
8
|
# [1.5.0-cx24-1810.4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v1.5.0-cx24-1810.3...v1.5.0-cx24-1810.4) (2022-07-21)
|
2
9
|
|
3
10
|
|
package/package.json
CHANGED
package/src/productData.js
CHANGED
@@ -6,25 +6,23 @@ const ProductData = {
|
|
6
6
|
let productResponse = {};
|
7
7
|
let locale = `${runConfig.language}_${runConfig.country}`;
|
8
8
|
if (isEqEnabled) {
|
9
|
-
let lambdaUrl = "https://storefront.api.wde.nuskin.io/orchestrationservices/storefront/catalogs/search";
|
10
|
-
const payload = {
|
11
|
-
storeId: "422",
|
12
|
-
filter:
|
13
|
-
'{"filters":[{"field":"index_key_skuId","operation":"IN","value":"' +
|
14
|
-
skus.toString() +
|
15
|
-
'"}]}'
|
16
|
-
|
17
|
-
};
|
18
9
|
let productDataResponse = await axios.request({
|
19
|
-
method:
|
20
|
-
url:
|
21
|
-
|
22
|
-
|
23
|
-
|
10
|
+
method: 'get',
|
11
|
+
url: 'https://storefront.api.wde.nuskin.io/orchestrationservices/storefront/catalogs/search/',
|
12
|
+
headers: {
|
13
|
+
'Cookie': 'x-sk-session-id=5da6d8b24af753cfcefa88f905dfd439'
|
14
|
+
},
|
15
|
+
params: {
|
16
|
+
storeId: '422',
|
17
|
+
filter: '{"filters":[{"field":"index_key_skuId","operation":"IN","value":"' +
|
18
|
+
skus.toString() +
|
19
|
+
'"}]}'
|
20
|
+
}
|
24
21
|
});
|
22
|
+
console.log(productDataResponse.data.product)
|
23
|
+
productResponse = this.eqProductMapper(productDataResponse.data.product)
|
25
24
|
|
26
|
-
|
27
|
-
|
25
|
+
|
28
26
|
} else {
|
29
27
|
let lambdaUrl = `${marketConfig.awsUrl}/productData/v1`;
|
30
28
|
const payload = {
|
@@ -43,14 +41,132 @@ const ProductData = {
|
|
43
41
|
return productResponse;
|
44
42
|
},
|
45
43
|
|
46
|
-
|
47
|
-
return
|
48
|
-
|
49
|
-
);
|
50
|
-
},
|
44
|
+
/* eqProductMapper: function(productDataResponse) {
|
45
|
+
return productDataResponse;
|
46
|
+
}, */
|
51
47
|
|
52
48
|
eqProductMapper: function (productDataResponse) {
|
53
|
-
|
49
|
+
let prodArr = []
|
50
|
+
productDataResponse.forEach((data, index) => {
|
51
|
+
prodArr[index] = {
|
52
|
+
"sku": data.sku[0].identifier,
|
53
|
+
"globalProductID": data.identifier,
|
54
|
+
"title": data.properties.name,
|
55
|
+
"country": data.sku[0].properties.market,
|
56
|
+
"language": "en",
|
57
|
+
"shortDescr": data.properties.description,
|
58
|
+
"longDescr": data.properties.productDetailsDescription,
|
59
|
+
"fullImage": data.properties.imageURL,
|
60
|
+
"imageAltText": data.properties.name,
|
61
|
+
"productCarouselImages": [
|
62
|
+
{
|
63
|
+
"contentType": "img",
|
64
|
+
"src": "/content/products/24/00/35/24003529/jcr:content/fullImage.imgw.1280.1280.png",
|
65
|
+
"alt": ""
|
66
|
+
}
|
67
|
+
],
|
68
|
+
"thumbnail": "/content/products/24/00/35/24003529/jcr:content/fullImage.img.160.160.png/1598425309548-cache.png",
|
69
|
+
"ingredients": "",
|
70
|
+
"benefits": "",
|
71
|
+
"usage": "",
|
72
|
+
"resources": "",
|
73
|
+
"videos": "",
|
74
|
+
"movie": "",
|
75
|
+
"youtube": "",
|
76
|
+
"salesEventText": "",
|
77
|
+
"contentSection": [
|
78
|
+
{
|
79
|
+
"sectionContent": "<div class=\"contentSections\"><div class=\"contentSection section\"><div>\n<h3>BENEFITS</h3>\n<div>\n<div class=\"sectionContent parsys\"><div class=\"text parbase section\">\n<p>Green tea has been used in China for thousands of years for its health-preserving and revitalizing power. Modern science has identified powerful antioxidants in green tea called polyphenols. One group of polyphenols called catechins is particularly potent and is highly effective at neutralizing free radicals at the cellular level. Catechins support healthy cell function while providing antioxidant protection to critical cell structures such as DNA. Clinical studies show catechins interfere with the production of certain enzymes involved in cell damage. Additionally, catechins have been demonstrated to cause a thermogenic effect that enhances the body s metabolic rate. Tegreen 97<sup>®</sup> from Pharmanex is a proprietary, highly concentrated extract of the catechins found in green tea. Tegreen 97<sup>®</sup> is one of the most potent antioxidant supplements on the market with a 97 percent polyphenol content, 65% catechins. Each Tegreen 97<sup>®</sup> capsule contains the catechin equivalent of approximately seven cups of green tea and is 99.5 percent caffeine free.</p>\r\n\n</div>\n\n</div>\n\n</div>\n</div>\n</div>\n<div class=\"contentSection section\"><div>\n<h3>USAGE</h3>\n<div>\n<div class=\"sectionContent parsys\"><div class=\"text parbase section\">\n<p>As a dietary supplement, take one (1) to four (4) capsules daily; preferably one (1) to two (2) each morning and evening with food. Store in a cool, dry place.</p>\r\n\n</div>\n\n</div>\n\n</div>\n</div>\n</div>\n<div class=\"contentSection section\"><div>\n<h3>INGREDIENTS</h3>\n<div>\n<div class=\"sectionContent parsys\"><div class=\"text parbase section\">\n<table border=\"1\" cellspacing=\"1\" cellpadding=\"0\" width=\"360\"><tbody>\r\n<tr>\r\n<td><b>Nutritional Facts</b></td>\r\n<td><b>Amount</b></td>\r\n<td><b>% Daily Value</b></td>\r\n</tr>\r\n<tr>\r\n<td colspan=\"3\"><b>Serving Size: 1 Capsule<br>\r\nServings Per Container: 120</b></td>\r\n</tr>\r\n<tr>\r\n<td width=\"55%\">Green tea leaf (20:1) Extract (<i>Camellia sinensis</i></td>\r\n<td width=\"20%\">250 mg</td>\r\n<td width=\"25%\"> </td>\r\n</tr>\r\n<tr>\r\n<td width=\"55%\" colspan=\"3\">* Daily Value not established</td>\r\n</tr>\r\n<tr>\r\n<td width=\"55%\" colspan=\"3\"><b>Other Ingredients: Gelatin, Silicon Dioxide, Microcrystalline Cellulose, Magnesium Stearate.</b></td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n<p> </p>\r\n\n</div>\n\n</div>\n\n</div>\n</div>\n</div>\n</div>\n"
|
80
|
+
}
|
81
|
+
],
|
82
|
+
"scanQualified": data.properties.scanQualifiedCount,
|
83
|
+
"availableQuantity": 999,
|
84
|
+
"maxQuantity": 999,
|
85
|
+
"points": "",
|
86
|
+
"cv": 99,
|
87
|
+
"pv": 99,
|
88
|
+
"priceType": "WRTL",
|
89
|
+
"price": 9999,
|
90
|
+
"priceMap": {
|
91
|
+
"WRTL": 9999,
|
92
|
+
"WADW-WRTL": 9999,
|
93
|
+
"WADR": 9999,
|
94
|
+
"RTL": 9999,
|
95
|
+
"WWHL": 9998,
|
96
|
+
"WADW": 9998,
|
97
|
+
"WHL": 9998
|
98
|
+
},
|
99
|
+
"cvMap": {
|
100
|
+
"WWHL": 8888,
|
101
|
+
"WADW": 8888,
|
102
|
+
"WHL": 8888
|
103
|
+
},
|
104
|
+
"pvMap": {
|
105
|
+
"WWHL": 99,
|
106
|
+
"WADW": 98,
|
107
|
+
"WHL": 90
|
108
|
+
},
|
109
|
+
"orderTypes": {
|
110
|
+
"adr": true,
|
111
|
+
"order": true,
|
112
|
+
"zpfc": false,
|
113
|
+
"zadp": true,
|
114
|
+
"ars": true,
|
115
|
+
"kiosk": true,
|
116
|
+
"mobile": true,
|
117
|
+
"preferred customer": true,
|
118
|
+
"retail": true,
|
119
|
+
"web": true,
|
120
|
+
"web display": true
|
121
|
+
},
|
122
|
+
"childSkus": [],
|
123
|
+
"custTypes": [
|
124
|
+
"10"
|
125
|
+
],
|
126
|
+
"division": "",
|
127
|
+
"backOrderDate": null,
|
128
|
+
"locallyProduced": false,
|
129
|
+
"agelocme": null,
|
130
|
+
"count": "",
|
131
|
+
"flavor": "",
|
132
|
+
"size": "",
|
133
|
+
"shade": "",
|
134
|
+
"status": "RELEASED_FOR_SALE",
|
135
|
+
"variantType": "",
|
136
|
+
"variantDropdownLabel": "",
|
137
|
+
"variantDropdownPlaceholder": "",
|
138
|
+
"variantsLabel": "",
|
139
|
+
"groupOffer": false,
|
140
|
+
"personalOffer": false,
|
141
|
+
"savedEventName": null,
|
142
|
+
"salesLabel": "",
|
143
|
+
"eventName": null,
|
144
|
+
"sizeWeight": "120 capsules",
|
145
|
+
"nettoWeight": "",
|
146
|
+
"variants": {},
|
147
|
+
"searchScore": 0,
|
148
|
+
"isExclusive": false,
|
149
|
+
"marketAttributes": {
|
150
|
+
"discount": true,
|
151
|
+
"redeem": true,
|
152
|
+
"earn": true
|
153
|
+
},
|
154
|
+
"restrictedMarkets": [],
|
155
|
+
"addOns": []
|
156
|
+
};
|
157
|
+
});
|
158
|
+
let products = [];
|
159
|
+
|
160
|
+
products.push(prodArr);
|
161
|
+
let data = {
|
162
|
+
products: products
|
163
|
+
};
|
164
|
+
return {
|
165
|
+
"status": 200,
|
166
|
+
"messages": [],
|
167
|
+
"data": data
|
168
|
+
}
|
169
|
+
|
54
170
|
},
|
55
171
|
|
56
172
|
getProductDataRequestHeaders: function (marketConfig) {
|