@nuskin/ns-product-lib 2.13.2 → 2.13.3-cx24-5694.1
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 +1 -1
- package/src/graph-ql/mappers/index.js +13 -0
- package/src/graph-ql/mappers/retailPrice.js +22 -0
- package/src/graph-ql/mappers/retailSubscriptionPrice.js +22 -0
- package/src/graph-ql/mappers/wholesalePrice.js +20 -0
- package/src/graph-ql/mappers/wholesaleSubscriptionPrice.js +22 -0
- package/src/graph-ql/product.js +27 -17
- package/src/graph-ql/query/getProductById.js +534 -0
- package/src/graph-ql/query/getProductsById.js +535 -0
- package/src/graph-ql/query/index.js +5 -0
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
const wholesalePrice = require('./wholesalePrice');
|
|
3
|
+
const retailPrice = require('./retailPrice');
|
|
4
|
+
const retailSubscriptionPrice = require('./retailSubscriptionPrice')
|
|
5
|
+
const wholesaleSubscriptionPrice = require('./wholesaleSubscriptionPrice')
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
mapWholesalePrice: wholesalePrice,
|
|
10
|
+
mapRetailPrice: retailPrice,
|
|
11
|
+
mapRetailSubscriptionPrice: retailSubscriptionPrice,
|
|
12
|
+
mapWholesaleSubscriptionPrice: wholesaleSubscriptionPrice
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Map retail price
|
|
5
|
+
* Map retailSales if it has sales/promotions
|
|
6
|
+
* @param {obj} product
|
|
7
|
+
* @return {number} retailPrice
|
|
8
|
+
*/
|
|
9
|
+
function retailPrice(product) {
|
|
10
|
+
const { price, totalPrice } = product;
|
|
11
|
+
const productPrice = totalPrice ? totalPrice : price;
|
|
12
|
+
|
|
13
|
+
if (productPrice.retailSales) {
|
|
14
|
+
|
|
15
|
+
return productPrice.retailSales;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return productPrice.retail;
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = retailPrice;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Map retail subscription price
|
|
5
|
+
* Map retailSales if it has sales/promotions
|
|
6
|
+
* @param {obj} product
|
|
7
|
+
* @return {number} retail subscpription price
|
|
8
|
+
*/
|
|
9
|
+
function retailSubscriptionPrice(product) {
|
|
10
|
+
const { price, totalPrice } = product;
|
|
11
|
+
const productPrice = totalPrice ? totalPrice : price;
|
|
12
|
+
|
|
13
|
+
if (productPrice.retailSales) {
|
|
14
|
+
|
|
15
|
+
return productPrice.retailSales;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return productPrice.retailSubscription;
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = retailSubscriptionPrice;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Map wholesale price
|
|
5
|
+
* Map wholesaleSales if it has sales/promotions
|
|
6
|
+
* @param {*} product
|
|
7
|
+
* @return {number} wholesalePrice
|
|
8
|
+
*/
|
|
9
|
+
function wholeSalePrice(product) {
|
|
10
|
+
const { price, totalPrice } = product;
|
|
11
|
+
const productPrice = totalPrice ? totalPrice : price;
|
|
12
|
+
|
|
13
|
+
if (productPrice.wholesaleSales) {
|
|
14
|
+
return productPrice.wholesaleSales;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return productPrice.wholesale;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = wholeSalePrice;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Map wholesale subscription price
|
|
5
|
+
* Map wholesaleSales if it has sales/promotions
|
|
6
|
+
* @param {obj} product
|
|
7
|
+
* @return {number} wholesale subscription price
|
|
8
|
+
*/
|
|
9
|
+
function wholesaleSubscriptionPrice(product) {
|
|
10
|
+
const { price, totalPrice } = product;
|
|
11
|
+
const productPrice = totalPrice ? totalPrice : price;
|
|
12
|
+
|
|
13
|
+
if (productPrice.wholesaleSales) {
|
|
14
|
+
|
|
15
|
+
return productPrice.wholesaleSales;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return productPrice.wholesaleSubscription;
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = wholesaleSubscriptionPrice;
|
package/src/graph-ql/product.js
CHANGED
|
@@ -3,6 +3,11 @@ const { getProductByIdQuery } = require('./query');
|
|
|
3
3
|
const ProductStatus = require("../models/productStatus");
|
|
4
4
|
const CustomerTypes = require('./customerTypes');
|
|
5
5
|
const Product = require("../product");
|
|
6
|
+
const {
|
|
7
|
+
mapWholesalePrice,
|
|
8
|
+
mapRetailPrice,
|
|
9
|
+
mapRetailSubscriptionPrice,
|
|
10
|
+
mapWholesaleSubscriptionPrice } = require('./mappers');
|
|
6
11
|
|
|
7
12
|
const defaultPayload = {
|
|
8
13
|
operationName: "getProduct",
|
|
@@ -42,7 +47,12 @@ async function getProduct(id, market, locale, config) {
|
|
|
42
47
|
const payload = {
|
|
43
48
|
...defaultPayload,
|
|
44
49
|
query: getProductByIdQuery,
|
|
45
|
-
variables: {
|
|
50
|
+
variables: {
|
|
51
|
+
id,
|
|
52
|
+
market,
|
|
53
|
+
locale,
|
|
54
|
+
quantity: 1 // set defaul to 1
|
|
55
|
+
}
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
try {
|
|
@@ -119,15 +129,15 @@ function mapProduct(product, market, locale, config) {
|
|
|
119
129
|
"cv": (defaultVariant.points) ? defaultVariant.points.wholesale.cv : 0,
|
|
120
130
|
"pv": (defaultVariant.points) ? defaultVariant.points.wholesale.pv : 0,
|
|
121
131
|
"priceType": "WRTL",
|
|
122
|
-
"price": (defaultVariant
|
|
132
|
+
"price": mapRetailPrice(defaultVariant),
|
|
123
133
|
"priceMap": {
|
|
124
|
-
"WRTL": (defaultVariant
|
|
125
|
-
"WADW-WRTL": (defaultVariant
|
|
126
|
-
"WADR": (defaultVariant
|
|
127
|
-
"RTL": (defaultVariant
|
|
128
|
-
"WWHL": (defaultVariant
|
|
129
|
-
"WADW": (defaultVariant
|
|
130
|
-
"WHL": (defaultVariant
|
|
134
|
+
"WRTL": mapRetailPrice(defaultVariant),
|
|
135
|
+
"WADW-WRTL": mapRetailSubscriptionPrice(defaultVariant),
|
|
136
|
+
"WADR": mapRetailSubscriptionPrice(defaultVariant), //retail ADR (subscription) price
|
|
137
|
+
"RTL": mapRetailPrice(defaultVariant),
|
|
138
|
+
"WWHL": mapWholesalePrice(defaultVariant),
|
|
139
|
+
"WADW": mapWholesaleSubscriptionPrice(defaultVariant),//wholesale ADR (subscription price)
|
|
140
|
+
"WHL": mapWholesalePrice(defaultVariant)
|
|
131
141
|
},
|
|
132
142
|
"cvMap": {
|
|
133
143
|
"WWHL": (defaultVariant.points) ? defaultVariant.points.wholesale.cv : 0,
|
|
@@ -229,15 +239,15 @@ function mapVariants(product) {
|
|
|
229
239
|
"cv": (variant.points) ? variant.points.wholesale.cv : 0,
|
|
230
240
|
"pv": (variant.points) ? variant.points.wholesale.pv : 0,
|
|
231
241
|
"priceType": "WRTL",
|
|
232
|
-
"price": (variant
|
|
242
|
+
"price": mapRetailPrice(variant),
|
|
233
243
|
"priceMap": {
|
|
234
|
-
"WRTL": (variant
|
|
235
|
-
"WADW-WRTL": (variant
|
|
236
|
-
"WADR": (variant
|
|
237
|
-
"RTL": (variant
|
|
238
|
-
"WWHL": (variant
|
|
239
|
-
"WADW": (variant
|
|
240
|
-
"WHL": (variant
|
|
244
|
+
"WRTL": mapRetailPrice(variant),
|
|
245
|
+
"WADW-WRTL": mapRetailSubscriptionPrice(variant),
|
|
246
|
+
"WADR": mapRetailSubscriptionPrice(variant), //retail ADR (subscription) price
|
|
247
|
+
"RTL": mapRetailPrice(variant),
|
|
248
|
+
"WWHL": mapWholesalePrice(variant),
|
|
249
|
+
"WADW": mapWholesaleSubscriptionPrice(variant),//wholesale ADR (subscription price)
|
|
250
|
+
"WHL": mapWholesalePrice(variant)
|
|
241
251
|
},
|
|
242
252
|
"cvMap": {
|
|
243
253
|
"WWHL": (variant.points) ? variant.points.wholesale.cv : 0,
|
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line max-len
|
|
4
|
+
const getProductByIdQuery = `query getProduct($id: String!, $market: String, $language: String, $useContentSource: String, $okta: String, $quantity: Int) {
|
|
5
|
+
productById(
|
|
6
|
+
id: $id
|
|
7
|
+
market: $market
|
|
8
|
+
language: $language
|
|
9
|
+
useContentSource: $useContentSource
|
|
10
|
+
okta: $okta
|
|
11
|
+
quantity: $quantity
|
|
12
|
+
) {
|
|
13
|
+
...Product
|
|
14
|
+
bundle {
|
|
15
|
+
...Kit
|
|
16
|
+
__typename
|
|
17
|
+
}
|
|
18
|
+
__typename
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
fragment Product on Product {
|
|
23
|
+
id
|
|
24
|
+
slug
|
|
25
|
+
title
|
|
26
|
+
secondaryTitle
|
|
27
|
+
productImages {
|
|
28
|
+
url
|
|
29
|
+
alt
|
|
30
|
+
thumbnail
|
|
31
|
+
__typename
|
|
32
|
+
}
|
|
33
|
+
salesLabel
|
|
34
|
+
salesText
|
|
35
|
+
description
|
|
36
|
+
salesDisclaimer
|
|
37
|
+
variantSelectLabel
|
|
38
|
+
variants {
|
|
39
|
+
...Variant
|
|
40
|
+
__typename
|
|
41
|
+
}
|
|
42
|
+
features {
|
|
43
|
+
image {
|
|
44
|
+
url
|
|
45
|
+
alt
|
|
46
|
+
thumbnail
|
|
47
|
+
__typename
|
|
48
|
+
}
|
|
49
|
+
subtitle
|
|
50
|
+
features
|
|
51
|
+
backgroundColor
|
|
52
|
+
textColor
|
|
53
|
+
__typename
|
|
54
|
+
}
|
|
55
|
+
productDetails {
|
|
56
|
+
description
|
|
57
|
+
includedItems
|
|
58
|
+
highlights {
|
|
59
|
+
iconUrl
|
|
60
|
+
label
|
|
61
|
+
__typename
|
|
62
|
+
}
|
|
63
|
+
originCountry
|
|
64
|
+
importer
|
|
65
|
+
warnings
|
|
66
|
+
__typename
|
|
67
|
+
}
|
|
68
|
+
benefits {
|
|
69
|
+
benefits
|
|
70
|
+
image {
|
|
71
|
+
url
|
|
72
|
+
alt
|
|
73
|
+
thumbnail
|
|
74
|
+
__typename
|
|
75
|
+
}
|
|
76
|
+
youTubeVideoId
|
|
77
|
+
__typename
|
|
78
|
+
}
|
|
79
|
+
results {
|
|
80
|
+
summary
|
|
81
|
+
results {
|
|
82
|
+
percentage
|
|
83
|
+
text
|
|
84
|
+
__typename
|
|
85
|
+
}
|
|
86
|
+
report {
|
|
87
|
+
url
|
|
88
|
+
text
|
|
89
|
+
__typename
|
|
90
|
+
}
|
|
91
|
+
image {
|
|
92
|
+
url
|
|
93
|
+
alt
|
|
94
|
+
thumbnail
|
|
95
|
+
__typename
|
|
96
|
+
}
|
|
97
|
+
youTubeVideoId
|
|
98
|
+
__typename
|
|
99
|
+
}
|
|
100
|
+
sustainability {
|
|
101
|
+
youTubeVideoId
|
|
102
|
+
image {
|
|
103
|
+
url
|
|
104
|
+
__typename
|
|
105
|
+
}
|
|
106
|
+
description
|
|
107
|
+
highlights {
|
|
108
|
+
image {
|
|
109
|
+
url
|
|
110
|
+
__typename
|
|
111
|
+
}
|
|
112
|
+
description
|
|
113
|
+
__typename
|
|
114
|
+
}
|
|
115
|
+
__typename
|
|
116
|
+
}
|
|
117
|
+
usage {
|
|
118
|
+
steps
|
|
119
|
+
recommendations
|
|
120
|
+
warnings
|
|
121
|
+
additionalText
|
|
122
|
+
image {
|
|
123
|
+
url
|
|
124
|
+
alt
|
|
125
|
+
thumbnail
|
|
126
|
+
__typename
|
|
127
|
+
}
|
|
128
|
+
youTubeVideoId
|
|
129
|
+
markdown
|
|
130
|
+
__typename
|
|
131
|
+
}
|
|
132
|
+
resources {
|
|
133
|
+
title
|
|
134
|
+
url
|
|
135
|
+
image {
|
|
136
|
+
url
|
|
137
|
+
alt
|
|
138
|
+
thumbnail
|
|
139
|
+
__typename
|
|
140
|
+
}
|
|
141
|
+
__typename
|
|
142
|
+
}
|
|
143
|
+
warranty
|
|
144
|
+
faqs {
|
|
145
|
+
question
|
|
146
|
+
answers
|
|
147
|
+
__typename
|
|
148
|
+
}
|
|
149
|
+
ingredients {
|
|
150
|
+
productName
|
|
151
|
+
allIngredients
|
|
152
|
+
otherIngredients
|
|
153
|
+
activeIngredients
|
|
154
|
+
inactiveIngredients
|
|
155
|
+
ingredientDisclaimers
|
|
156
|
+
markdown
|
|
157
|
+
keyIngredients {
|
|
158
|
+
image {
|
|
159
|
+
url
|
|
160
|
+
alt
|
|
161
|
+
thumbnail
|
|
162
|
+
__typename
|
|
163
|
+
}
|
|
164
|
+
name
|
|
165
|
+
description
|
|
166
|
+
__typename
|
|
167
|
+
}
|
|
168
|
+
nutritionInformationImage {
|
|
169
|
+
url
|
|
170
|
+
alt
|
|
171
|
+
__typename
|
|
172
|
+
}
|
|
173
|
+
__typename
|
|
174
|
+
}
|
|
175
|
+
disclaimers
|
|
176
|
+
disclaimerWarnings {
|
|
177
|
+
icon {
|
|
178
|
+
url
|
|
179
|
+
alt
|
|
180
|
+
__typename
|
|
181
|
+
}
|
|
182
|
+
markdown
|
|
183
|
+
__typename
|
|
184
|
+
}
|
|
185
|
+
seoInformation {
|
|
186
|
+
metaDescription
|
|
187
|
+
metaTitle
|
|
188
|
+
canonicalURL
|
|
189
|
+
ogImage {
|
|
190
|
+
url
|
|
191
|
+
alt
|
|
192
|
+
__typename
|
|
193
|
+
}
|
|
194
|
+
__typename
|
|
195
|
+
}
|
|
196
|
+
thirdPartyScripts
|
|
197
|
+
productDataSource {
|
|
198
|
+
source
|
|
199
|
+
webBaseUrl
|
|
200
|
+
apiBaseUrl
|
|
201
|
+
storeId
|
|
202
|
+
__typename
|
|
203
|
+
}
|
|
204
|
+
error {
|
|
205
|
+
name
|
|
206
|
+
errors
|
|
207
|
+
lines
|
|
208
|
+
message
|
|
209
|
+
status
|
|
210
|
+
__typename
|
|
211
|
+
}
|
|
212
|
+
upSellProductIds
|
|
213
|
+
crossProductIds
|
|
214
|
+
__typename
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
fragment Variant on Variant {
|
|
218
|
+
sku
|
|
219
|
+
globalId
|
|
220
|
+
slug
|
|
221
|
+
variantLabel
|
|
222
|
+
variantColor
|
|
223
|
+
availableChannels
|
|
224
|
+
availableQuantity
|
|
225
|
+
customerTypes
|
|
226
|
+
maxQuantity
|
|
227
|
+
title
|
|
228
|
+
size
|
|
229
|
+
productImages {
|
|
230
|
+
url
|
|
231
|
+
alt
|
|
232
|
+
thumbnail
|
|
233
|
+
__typename
|
|
234
|
+
}
|
|
235
|
+
salesLabel
|
|
236
|
+
salesText
|
|
237
|
+
description
|
|
238
|
+
salesDisclaimer
|
|
239
|
+
nettoWeight
|
|
240
|
+
features {
|
|
241
|
+
image {
|
|
242
|
+
url
|
|
243
|
+
alt
|
|
244
|
+
thumbnail
|
|
245
|
+
__typename
|
|
246
|
+
}
|
|
247
|
+
subtitle
|
|
248
|
+
features
|
|
249
|
+
backgroundColor
|
|
250
|
+
textColor
|
|
251
|
+
__typename
|
|
252
|
+
}
|
|
253
|
+
productDetails {
|
|
254
|
+
description
|
|
255
|
+
includedItems
|
|
256
|
+
highlights {
|
|
257
|
+
iconUrl
|
|
258
|
+
label
|
|
259
|
+
__typename
|
|
260
|
+
}
|
|
261
|
+
originCountry
|
|
262
|
+
importer
|
|
263
|
+
warnings
|
|
264
|
+
__typename
|
|
265
|
+
}
|
|
266
|
+
benefits {
|
|
267
|
+
benefits
|
|
268
|
+
image {
|
|
269
|
+
url
|
|
270
|
+
alt
|
|
271
|
+
thumbnail
|
|
272
|
+
__typename
|
|
273
|
+
}
|
|
274
|
+
youTubeVideoId
|
|
275
|
+
__typename
|
|
276
|
+
}
|
|
277
|
+
results {
|
|
278
|
+
summary
|
|
279
|
+
results {
|
|
280
|
+
percentage
|
|
281
|
+
text
|
|
282
|
+
__typename
|
|
283
|
+
}
|
|
284
|
+
report {
|
|
285
|
+
url
|
|
286
|
+
text
|
|
287
|
+
__typename
|
|
288
|
+
}
|
|
289
|
+
image {
|
|
290
|
+
url
|
|
291
|
+
alt
|
|
292
|
+
thumbnail
|
|
293
|
+
__typename
|
|
294
|
+
}
|
|
295
|
+
youTubeVideoId
|
|
296
|
+
__typename
|
|
297
|
+
}
|
|
298
|
+
usage {
|
|
299
|
+
steps
|
|
300
|
+
recommendations
|
|
301
|
+
warnings
|
|
302
|
+
additionalText
|
|
303
|
+
image {
|
|
304
|
+
url
|
|
305
|
+
alt
|
|
306
|
+
thumbnail
|
|
307
|
+
__typename
|
|
308
|
+
}
|
|
309
|
+
youTubeVideoId
|
|
310
|
+
markdown
|
|
311
|
+
__typename
|
|
312
|
+
}
|
|
313
|
+
resources {
|
|
314
|
+
title
|
|
315
|
+
url
|
|
316
|
+
image {
|
|
317
|
+
url
|
|
318
|
+
alt
|
|
319
|
+
thumbnail
|
|
320
|
+
__typename
|
|
321
|
+
}
|
|
322
|
+
__typename
|
|
323
|
+
}
|
|
324
|
+
faqs {
|
|
325
|
+
question
|
|
326
|
+
answers
|
|
327
|
+
__typename
|
|
328
|
+
}
|
|
329
|
+
ingredients {
|
|
330
|
+
productName
|
|
331
|
+
allIngredients
|
|
332
|
+
otherIngredients
|
|
333
|
+
activeIngredients
|
|
334
|
+
inactiveIngredients
|
|
335
|
+
ingredientDisclaimers
|
|
336
|
+
markdown
|
|
337
|
+
keyIngredients {
|
|
338
|
+
image {
|
|
339
|
+
url
|
|
340
|
+
alt
|
|
341
|
+
thumbnail
|
|
342
|
+
__typename
|
|
343
|
+
}
|
|
344
|
+
name
|
|
345
|
+
description
|
|
346
|
+
__typename
|
|
347
|
+
}
|
|
348
|
+
nutritionInformationImage {
|
|
349
|
+
url
|
|
350
|
+
alt
|
|
351
|
+
__typename
|
|
352
|
+
}
|
|
353
|
+
__typename
|
|
354
|
+
}
|
|
355
|
+
isExclusive
|
|
356
|
+
price {
|
|
357
|
+
retail
|
|
358
|
+
wholesale
|
|
359
|
+
retailSales
|
|
360
|
+
wholesaleSales
|
|
361
|
+
retailSubscription
|
|
362
|
+
wholesaleSubscription
|
|
363
|
+
currencyCode
|
|
364
|
+
__typename
|
|
365
|
+
}
|
|
366
|
+
totalPrice {
|
|
367
|
+
retail
|
|
368
|
+
wholesale
|
|
369
|
+
retailSales
|
|
370
|
+
wholesaleSales
|
|
371
|
+
retailSubscription
|
|
372
|
+
wholesaleSubscription
|
|
373
|
+
currencyCode
|
|
374
|
+
__typename
|
|
375
|
+
}
|
|
376
|
+
points {
|
|
377
|
+
wholesale {
|
|
378
|
+
cv
|
|
379
|
+
pv
|
|
380
|
+
__typename
|
|
381
|
+
}
|
|
382
|
+
subscription {
|
|
383
|
+
cv
|
|
384
|
+
pv
|
|
385
|
+
__typename
|
|
386
|
+
}
|
|
387
|
+
__typename
|
|
388
|
+
}
|
|
389
|
+
totalPoints {
|
|
390
|
+
wholesale {
|
|
391
|
+
cv
|
|
392
|
+
pv
|
|
393
|
+
__typename
|
|
394
|
+
}
|
|
395
|
+
subscription {
|
|
396
|
+
cv
|
|
397
|
+
pv
|
|
398
|
+
__typename
|
|
399
|
+
}
|
|
400
|
+
__typename
|
|
401
|
+
}
|
|
402
|
+
pricingJson
|
|
403
|
+
availableQuantity
|
|
404
|
+
maxQuantity
|
|
405
|
+
status {
|
|
406
|
+
isBackordered
|
|
407
|
+
backorderedAvailableDate
|
|
408
|
+
status
|
|
409
|
+
__typename
|
|
410
|
+
}
|
|
411
|
+
purchaseTypes {
|
|
412
|
+
buyOnce
|
|
413
|
+
subscription
|
|
414
|
+
__typename
|
|
415
|
+
}
|
|
416
|
+
marketAttributes {
|
|
417
|
+
redeem
|
|
418
|
+
earn
|
|
419
|
+
__typename
|
|
420
|
+
}
|
|
421
|
+
disclaimers
|
|
422
|
+
disclaimerWarnings {
|
|
423
|
+
icon {
|
|
424
|
+
url
|
|
425
|
+
alt
|
|
426
|
+
__typename
|
|
427
|
+
}
|
|
428
|
+
markdown
|
|
429
|
+
__typename
|
|
430
|
+
}
|
|
431
|
+
restrictedMarkets
|
|
432
|
+
matchingVariant
|
|
433
|
+
shadeable
|
|
434
|
+
productType
|
|
435
|
+
primaryBrand
|
|
436
|
+
brandFamily
|
|
437
|
+
__typename
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
fragment Kit on Kit {
|
|
441
|
+
id
|
|
442
|
+
type
|
|
443
|
+
price {
|
|
444
|
+
currencyCode
|
|
445
|
+
retail
|
|
446
|
+
wholesale
|
|
447
|
+
retailSales
|
|
448
|
+
wholesaleSales
|
|
449
|
+
retailSubscription
|
|
450
|
+
wholesaleSubscription
|
|
451
|
+
__typename
|
|
452
|
+
}
|
|
453
|
+
totalPrice {
|
|
454
|
+
currencyCode
|
|
455
|
+
retail
|
|
456
|
+
wholesale
|
|
457
|
+
retailSales
|
|
458
|
+
wholesaleSales
|
|
459
|
+
retailSubscription
|
|
460
|
+
wholesaleSubscription
|
|
461
|
+
__typename
|
|
462
|
+
}
|
|
463
|
+
points {
|
|
464
|
+
wholesale {
|
|
465
|
+
cv
|
|
466
|
+
pv
|
|
467
|
+
__typename
|
|
468
|
+
}
|
|
469
|
+
subscription {
|
|
470
|
+
cv
|
|
471
|
+
pv
|
|
472
|
+
__typename
|
|
473
|
+
}
|
|
474
|
+
__typename
|
|
475
|
+
}
|
|
476
|
+
totalPoints {
|
|
477
|
+
wholesale {
|
|
478
|
+
cv
|
|
479
|
+
pv
|
|
480
|
+
__typename
|
|
481
|
+
}
|
|
482
|
+
subscription {
|
|
483
|
+
cv
|
|
484
|
+
pv
|
|
485
|
+
__typename
|
|
486
|
+
}
|
|
487
|
+
__typename
|
|
488
|
+
}
|
|
489
|
+
retailDiscount
|
|
490
|
+
wholesaleDiscount
|
|
491
|
+
pvDiscount
|
|
492
|
+
cvDiscount
|
|
493
|
+
sbDiscount
|
|
494
|
+
grpDiscount
|
|
495
|
+
availableChannels
|
|
496
|
+
customerTypes
|
|
497
|
+
purchaseTypes {
|
|
498
|
+
buyOnce
|
|
499
|
+
subscription
|
|
500
|
+
__typename
|
|
501
|
+
}
|
|
502
|
+
status {
|
|
503
|
+
status
|
|
504
|
+
isBackordered
|
|
505
|
+
backorderedAvailableDate
|
|
506
|
+
__typename
|
|
507
|
+
}
|
|
508
|
+
availableQuantity
|
|
509
|
+
chargeShipping
|
|
510
|
+
dangerousGoods
|
|
511
|
+
excludeFromSearch
|
|
512
|
+
isExclusive
|
|
513
|
+
marketAttributes {
|
|
514
|
+
discount
|
|
515
|
+
redeem
|
|
516
|
+
earn
|
|
517
|
+
__typename
|
|
518
|
+
}
|
|
519
|
+
restrictedMarkets
|
|
520
|
+
scanQualifiedCount
|
|
521
|
+
kitProducts {
|
|
522
|
+
quantity
|
|
523
|
+
isMandatory
|
|
524
|
+
product {
|
|
525
|
+
...Product
|
|
526
|
+
__typename
|
|
527
|
+
}
|
|
528
|
+
__typename
|
|
529
|
+
}
|
|
530
|
+
__typename
|
|
531
|
+
}`
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
module.exports = getProductByIdQuery;
|
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line max-len
|
|
4
|
+
const getProductsByIdQuery = `query getProducts($id: String!, $market: String, $language: String, $useContentSource: String, $okta: String, quantity: Int) {
|
|
5
|
+
productsById(
|
|
6
|
+
id: $id
|
|
7
|
+
market: $market
|
|
8
|
+
language: $language
|
|
9
|
+
useContentSource: $useContentSource
|
|
10
|
+
okta: $okta
|
|
11
|
+
quantity: $quantity
|
|
12
|
+
) {
|
|
13
|
+
products {
|
|
14
|
+
...Product
|
|
15
|
+
__typename
|
|
16
|
+
}
|
|
17
|
+
skip
|
|
18
|
+
totalCount
|
|
19
|
+
validCount
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
fragment Product on Product {
|
|
24
|
+
id
|
|
25
|
+
slug
|
|
26
|
+
title
|
|
27
|
+
secondaryTitle
|
|
28
|
+
productImages {
|
|
29
|
+
url
|
|
30
|
+
alt
|
|
31
|
+
thumbnail
|
|
32
|
+
__typename
|
|
33
|
+
}
|
|
34
|
+
salesLabel
|
|
35
|
+
salesText
|
|
36
|
+
description
|
|
37
|
+
salesDisclaimer
|
|
38
|
+
variantSelectLabel
|
|
39
|
+
variants {
|
|
40
|
+
...Variant
|
|
41
|
+
__typename
|
|
42
|
+
}
|
|
43
|
+
features {
|
|
44
|
+
image {
|
|
45
|
+
url
|
|
46
|
+
alt
|
|
47
|
+
thumbnail
|
|
48
|
+
__typename
|
|
49
|
+
}
|
|
50
|
+
subtitle
|
|
51
|
+
features
|
|
52
|
+
backgroundColor
|
|
53
|
+
textColor
|
|
54
|
+
__typename
|
|
55
|
+
}
|
|
56
|
+
productDetails {
|
|
57
|
+
description
|
|
58
|
+
includedItems
|
|
59
|
+
highlights {
|
|
60
|
+
iconUrl
|
|
61
|
+
label
|
|
62
|
+
__typename
|
|
63
|
+
}
|
|
64
|
+
originCountry
|
|
65
|
+
importer
|
|
66
|
+
warnings
|
|
67
|
+
__typename
|
|
68
|
+
}
|
|
69
|
+
benefits {
|
|
70
|
+
benefits
|
|
71
|
+
image {
|
|
72
|
+
url
|
|
73
|
+
alt
|
|
74
|
+
thumbnail
|
|
75
|
+
__typename
|
|
76
|
+
}
|
|
77
|
+
youTubeVideoId
|
|
78
|
+
__typename
|
|
79
|
+
}
|
|
80
|
+
results {
|
|
81
|
+
summary
|
|
82
|
+
results {
|
|
83
|
+
percentage
|
|
84
|
+
text
|
|
85
|
+
__typename
|
|
86
|
+
}
|
|
87
|
+
report {
|
|
88
|
+
url
|
|
89
|
+
text
|
|
90
|
+
__typename
|
|
91
|
+
}
|
|
92
|
+
image {
|
|
93
|
+
url
|
|
94
|
+
alt
|
|
95
|
+
thumbnail
|
|
96
|
+
__typename
|
|
97
|
+
}
|
|
98
|
+
youTubeVideoId
|
|
99
|
+
__typename
|
|
100
|
+
}
|
|
101
|
+
sustainability {
|
|
102
|
+
youTubeVideoId
|
|
103
|
+
image {
|
|
104
|
+
url
|
|
105
|
+
__typename
|
|
106
|
+
}
|
|
107
|
+
description
|
|
108
|
+
highlights {
|
|
109
|
+
image {
|
|
110
|
+
url
|
|
111
|
+
__typename
|
|
112
|
+
}
|
|
113
|
+
description
|
|
114
|
+
__typename
|
|
115
|
+
}
|
|
116
|
+
__typename
|
|
117
|
+
}
|
|
118
|
+
usage {
|
|
119
|
+
steps
|
|
120
|
+
recommendations
|
|
121
|
+
warnings
|
|
122
|
+
additionalText
|
|
123
|
+
image {
|
|
124
|
+
url
|
|
125
|
+
alt
|
|
126
|
+
thumbnail
|
|
127
|
+
__typename
|
|
128
|
+
}
|
|
129
|
+
youTubeVideoId
|
|
130
|
+
markdown
|
|
131
|
+
__typename
|
|
132
|
+
}
|
|
133
|
+
resources {
|
|
134
|
+
title
|
|
135
|
+
url
|
|
136
|
+
image {
|
|
137
|
+
url
|
|
138
|
+
alt
|
|
139
|
+
thumbnail
|
|
140
|
+
__typename
|
|
141
|
+
}
|
|
142
|
+
__typename
|
|
143
|
+
}
|
|
144
|
+
warranty
|
|
145
|
+
faqs {
|
|
146
|
+
question
|
|
147
|
+
answers
|
|
148
|
+
__typename
|
|
149
|
+
}
|
|
150
|
+
ingredients {
|
|
151
|
+
productName
|
|
152
|
+
allIngredients
|
|
153
|
+
otherIngredients
|
|
154
|
+
activeIngredients
|
|
155
|
+
inactiveIngredients
|
|
156
|
+
ingredientDisclaimers
|
|
157
|
+
markdown
|
|
158
|
+
keyIngredients {
|
|
159
|
+
image {
|
|
160
|
+
url
|
|
161
|
+
alt
|
|
162
|
+
thumbnail
|
|
163
|
+
__typename
|
|
164
|
+
}
|
|
165
|
+
name
|
|
166
|
+
description
|
|
167
|
+
__typename
|
|
168
|
+
}
|
|
169
|
+
nutritionInformationImage {
|
|
170
|
+
url
|
|
171
|
+
alt
|
|
172
|
+
__typename
|
|
173
|
+
}
|
|
174
|
+
__typename
|
|
175
|
+
}
|
|
176
|
+
disclaimers
|
|
177
|
+
disclaimerWarnings {
|
|
178
|
+
icon {
|
|
179
|
+
url
|
|
180
|
+
alt
|
|
181
|
+
__typename
|
|
182
|
+
}
|
|
183
|
+
markdown
|
|
184
|
+
__typename
|
|
185
|
+
}
|
|
186
|
+
seoInformation {
|
|
187
|
+
metaDescription
|
|
188
|
+
metaTitle
|
|
189
|
+
canonicalURL
|
|
190
|
+
ogImage {
|
|
191
|
+
url
|
|
192
|
+
alt
|
|
193
|
+
__typename
|
|
194
|
+
}
|
|
195
|
+
__typename
|
|
196
|
+
}
|
|
197
|
+
thirdPartyScripts
|
|
198
|
+
productDataSource {
|
|
199
|
+
source
|
|
200
|
+
webBaseUrl
|
|
201
|
+
apiBaseUrl
|
|
202
|
+
storeId
|
|
203
|
+
__typename
|
|
204
|
+
}
|
|
205
|
+
error {
|
|
206
|
+
name
|
|
207
|
+
errors
|
|
208
|
+
lines
|
|
209
|
+
message
|
|
210
|
+
status
|
|
211
|
+
__typename
|
|
212
|
+
}
|
|
213
|
+
upSellProductIds
|
|
214
|
+
crossProductIds
|
|
215
|
+
__typename
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
fragment Variant on Variant {
|
|
219
|
+
sku
|
|
220
|
+
globalId
|
|
221
|
+
slug
|
|
222
|
+
variantLabel
|
|
223
|
+
variantColor
|
|
224
|
+
availableChannels
|
|
225
|
+
availableQuantity
|
|
226
|
+
customerTypes
|
|
227
|
+
maxQuantity
|
|
228
|
+
title
|
|
229
|
+
size
|
|
230
|
+
productImages {
|
|
231
|
+
url
|
|
232
|
+
alt
|
|
233
|
+
thumbnail
|
|
234
|
+
__typename
|
|
235
|
+
}
|
|
236
|
+
salesLabel
|
|
237
|
+
salesText
|
|
238
|
+
description
|
|
239
|
+
salesDisclaimer
|
|
240
|
+
nettoWeight
|
|
241
|
+
features {
|
|
242
|
+
image {
|
|
243
|
+
url
|
|
244
|
+
alt
|
|
245
|
+
thumbnail
|
|
246
|
+
__typename
|
|
247
|
+
}
|
|
248
|
+
subtitle
|
|
249
|
+
features
|
|
250
|
+
backgroundColor
|
|
251
|
+
textColor
|
|
252
|
+
__typename
|
|
253
|
+
}
|
|
254
|
+
productDetails {
|
|
255
|
+
description
|
|
256
|
+
includedItems
|
|
257
|
+
highlights {
|
|
258
|
+
iconUrl
|
|
259
|
+
label
|
|
260
|
+
__typename
|
|
261
|
+
}
|
|
262
|
+
originCountry
|
|
263
|
+
importer
|
|
264
|
+
warnings
|
|
265
|
+
__typename
|
|
266
|
+
}
|
|
267
|
+
benefits {
|
|
268
|
+
benefits
|
|
269
|
+
image {
|
|
270
|
+
url
|
|
271
|
+
alt
|
|
272
|
+
thumbnail
|
|
273
|
+
__typename
|
|
274
|
+
}
|
|
275
|
+
youTubeVideoId
|
|
276
|
+
__typename
|
|
277
|
+
}
|
|
278
|
+
results {
|
|
279
|
+
summary
|
|
280
|
+
results {
|
|
281
|
+
percentage
|
|
282
|
+
text
|
|
283
|
+
__typename
|
|
284
|
+
}
|
|
285
|
+
report {
|
|
286
|
+
url
|
|
287
|
+
text
|
|
288
|
+
__typename
|
|
289
|
+
}
|
|
290
|
+
image {
|
|
291
|
+
url
|
|
292
|
+
alt
|
|
293
|
+
thumbnail
|
|
294
|
+
__typename
|
|
295
|
+
}
|
|
296
|
+
youTubeVideoId
|
|
297
|
+
__typename
|
|
298
|
+
}
|
|
299
|
+
usage {
|
|
300
|
+
steps
|
|
301
|
+
recommendations
|
|
302
|
+
warnings
|
|
303
|
+
additionalText
|
|
304
|
+
image {
|
|
305
|
+
url
|
|
306
|
+
alt
|
|
307
|
+
thumbnail
|
|
308
|
+
__typename
|
|
309
|
+
}
|
|
310
|
+
youTubeVideoId
|
|
311
|
+
markdown
|
|
312
|
+
__typename
|
|
313
|
+
}
|
|
314
|
+
resources {
|
|
315
|
+
title
|
|
316
|
+
url
|
|
317
|
+
image {
|
|
318
|
+
url
|
|
319
|
+
alt
|
|
320
|
+
thumbnail
|
|
321
|
+
__typename
|
|
322
|
+
}
|
|
323
|
+
__typename
|
|
324
|
+
}
|
|
325
|
+
faqs {
|
|
326
|
+
question
|
|
327
|
+
answers
|
|
328
|
+
__typename
|
|
329
|
+
}
|
|
330
|
+
ingredients {
|
|
331
|
+
productName
|
|
332
|
+
allIngredients
|
|
333
|
+
otherIngredients
|
|
334
|
+
activeIngredients
|
|
335
|
+
inactiveIngredients
|
|
336
|
+
ingredientDisclaimers
|
|
337
|
+
markdown
|
|
338
|
+
keyIngredients {
|
|
339
|
+
image {
|
|
340
|
+
url
|
|
341
|
+
alt
|
|
342
|
+
thumbnail
|
|
343
|
+
__typename
|
|
344
|
+
}
|
|
345
|
+
name
|
|
346
|
+
description
|
|
347
|
+
__typename
|
|
348
|
+
}
|
|
349
|
+
nutritionInformationImage {
|
|
350
|
+
url
|
|
351
|
+
alt
|
|
352
|
+
__typename
|
|
353
|
+
}
|
|
354
|
+
__typename
|
|
355
|
+
}
|
|
356
|
+
isExclusive
|
|
357
|
+
price {
|
|
358
|
+
retail
|
|
359
|
+
wholesale
|
|
360
|
+
retailSales
|
|
361
|
+
wholesaleSales
|
|
362
|
+
retailSubscription
|
|
363
|
+
wholesaleSubscription
|
|
364
|
+
currencyCode
|
|
365
|
+
__typename
|
|
366
|
+
}
|
|
367
|
+
totalPrice {
|
|
368
|
+
retail
|
|
369
|
+
wholesale
|
|
370
|
+
retailSales
|
|
371
|
+
wholesaleSales
|
|
372
|
+
retailSubscription
|
|
373
|
+
wholesaleSubscription
|
|
374
|
+
currencyCode
|
|
375
|
+
__typename
|
|
376
|
+
}
|
|
377
|
+
points {
|
|
378
|
+
wholesale {
|
|
379
|
+
cv
|
|
380
|
+
pv
|
|
381
|
+
__typename
|
|
382
|
+
}
|
|
383
|
+
subscription {
|
|
384
|
+
cv
|
|
385
|
+
pv
|
|
386
|
+
__typename
|
|
387
|
+
}
|
|
388
|
+
__typename
|
|
389
|
+
}
|
|
390
|
+
totalPoints {
|
|
391
|
+
wholesale {
|
|
392
|
+
cv
|
|
393
|
+
pv
|
|
394
|
+
__typename
|
|
395
|
+
}
|
|
396
|
+
subscription {
|
|
397
|
+
cv
|
|
398
|
+
pv
|
|
399
|
+
__typename
|
|
400
|
+
}
|
|
401
|
+
__typename
|
|
402
|
+
}
|
|
403
|
+
pricingJson
|
|
404
|
+
availableQuantity
|
|
405
|
+
maxQuantity
|
|
406
|
+
status {
|
|
407
|
+
isBackordered
|
|
408
|
+
backorderedAvailableDate
|
|
409
|
+
status
|
|
410
|
+
__typename
|
|
411
|
+
}
|
|
412
|
+
purchaseTypes {
|
|
413
|
+
buyOnce
|
|
414
|
+
subscription
|
|
415
|
+
__typename
|
|
416
|
+
}
|
|
417
|
+
marketAttributes {
|
|
418
|
+
redeem
|
|
419
|
+
earn
|
|
420
|
+
__typename
|
|
421
|
+
}
|
|
422
|
+
disclaimers
|
|
423
|
+
disclaimerWarnings {
|
|
424
|
+
icon {
|
|
425
|
+
url
|
|
426
|
+
alt
|
|
427
|
+
__typename
|
|
428
|
+
}
|
|
429
|
+
markdown
|
|
430
|
+
__typename
|
|
431
|
+
}
|
|
432
|
+
restrictedMarkets
|
|
433
|
+
matchingVariant
|
|
434
|
+
shadeable
|
|
435
|
+
productType
|
|
436
|
+
primaryBrand
|
|
437
|
+
brandFamily
|
|
438
|
+
__typename
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
fragment Kit on Kit {
|
|
442
|
+
id
|
|
443
|
+
type
|
|
444
|
+
price {
|
|
445
|
+
currencyCode
|
|
446
|
+
retail
|
|
447
|
+
wholesale
|
|
448
|
+
retailSales
|
|
449
|
+
wholesaleSales
|
|
450
|
+
retailSubscription
|
|
451
|
+
wholesaleSubscription
|
|
452
|
+
__typename
|
|
453
|
+
}
|
|
454
|
+
totalPrice {
|
|
455
|
+
currencyCode
|
|
456
|
+
retail
|
|
457
|
+
wholesale
|
|
458
|
+
retailSales
|
|
459
|
+
wholesaleSales
|
|
460
|
+
retailSubscription
|
|
461
|
+
wholesaleSubscription
|
|
462
|
+
__typename
|
|
463
|
+
}
|
|
464
|
+
points {
|
|
465
|
+
wholesale {
|
|
466
|
+
cv
|
|
467
|
+
pv
|
|
468
|
+
__typename
|
|
469
|
+
}
|
|
470
|
+
subscription {
|
|
471
|
+
cv
|
|
472
|
+
pv
|
|
473
|
+
__typename
|
|
474
|
+
}
|
|
475
|
+
__typename
|
|
476
|
+
}
|
|
477
|
+
totalPoints {
|
|
478
|
+
wholesale {
|
|
479
|
+
cv
|
|
480
|
+
pv
|
|
481
|
+
__typename
|
|
482
|
+
}
|
|
483
|
+
subscription {
|
|
484
|
+
cv
|
|
485
|
+
pv
|
|
486
|
+
__typename
|
|
487
|
+
}
|
|
488
|
+
__typename
|
|
489
|
+
}
|
|
490
|
+
retailDiscount
|
|
491
|
+
wholesaleDiscount
|
|
492
|
+
pvDiscount
|
|
493
|
+
cvDiscount
|
|
494
|
+
sbDiscount
|
|
495
|
+
grpDiscount
|
|
496
|
+
availableChannels
|
|
497
|
+
customerTypes
|
|
498
|
+
purchaseTypes {
|
|
499
|
+
buyOnce
|
|
500
|
+
subscription
|
|
501
|
+
__typename
|
|
502
|
+
}
|
|
503
|
+
status {
|
|
504
|
+
status
|
|
505
|
+
isBackordered
|
|
506
|
+
backorderedAvailableDate
|
|
507
|
+
__typename
|
|
508
|
+
}
|
|
509
|
+
availableQuantity
|
|
510
|
+
chargeShipping
|
|
511
|
+
dangerousGoods
|
|
512
|
+
excludeFromSearch
|
|
513
|
+
isExclusive
|
|
514
|
+
marketAttributes {
|
|
515
|
+
discount
|
|
516
|
+
redeem
|
|
517
|
+
earn
|
|
518
|
+
__typename
|
|
519
|
+
}
|
|
520
|
+
restrictedMarkets
|
|
521
|
+
scanQualifiedCount
|
|
522
|
+
kitProducts {
|
|
523
|
+
quantity
|
|
524
|
+
isMandatory
|
|
525
|
+
product {
|
|
526
|
+
...Product
|
|
527
|
+
__typename
|
|
528
|
+
}
|
|
529
|
+
__typename
|
|
530
|
+
}
|
|
531
|
+
__typename
|
|
532
|
+
}`
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
module.exports = getProductsByIdQuery;
|