@nuskin/ns-product-lib 2.17.2 → 2.18.0-brw-4218.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,22 +0,0 @@
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 = price ? price : totalPrice;
12
-
13
- if (productPrice.wholesaleSales) {
14
-
15
- return productPrice.wholesaleSales;
16
- }
17
-
18
- return productPrice.wholesaleSubscription;
19
-
20
- }
21
-
22
- module.exports = wholesaleSubscriptionPrice;
@@ -1,543 +0,0 @@
1
- "use strict";
2
-
3
- // eslint-disable-next-line max-len
4
- const getProductByIdQuery = `query getProduct($id: String!, $market: String, $language: String, $okta: String, $quantity: Int) {
5
- productById(
6
- id: $id
7
- market: $market
8
- language: $language
9
-
10
- okta: $okta
11
- quantity: $quantity
12
- ) {
13
- ...Product
14
- bundle {
15
- ...Kit
16
- pricingJson
17
- __typename
18
- }
19
- __typename
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
- retailOriginal
365
- wholesaleOriginal
366
- currencyCode
367
- __typename
368
- }
369
- totalPrice {
370
- retail
371
- wholesale
372
- retailSales
373
- wholesaleSales
374
- retailSubscription
375
- wholesaleSubscription
376
- retailOriginal
377
- wholesaleOriginal
378
- currencyCode
379
- __typename
380
- }
381
- points {
382
- wholesale {
383
- cv
384
- pv
385
- __typename
386
- }
387
- subscription {
388
- cv
389
- pv
390
- __typename
391
- }
392
- __typename
393
- }
394
- totalPoints {
395
- wholesale {
396
- cv
397
- pv
398
- __typename
399
- }
400
- subscription {
401
- cv
402
- pv
403
- __typename
404
- }
405
- __typename
406
- }
407
- pricingJson
408
- availableQuantity
409
- maxQuantity
410
- status {
411
- isBackordered
412
- backorderedAvailableDate
413
- status
414
- __typename
415
- }
416
- purchaseTypes {
417
- buyOnce
418
- subscription
419
- __typename
420
- }
421
- marketAttributes {
422
- redeem
423
- earn
424
- __typename
425
- }
426
- disclaimers
427
- disclaimerWarnings {
428
- icon {
429
- url
430
- alt
431
- __typename
432
- }
433
- markdown
434
- __typename
435
- }
436
- restrictedMarkets
437
- matchingVariant
438
- shadeable
439
- productType
440
- primaryBrand
441
- brandFamily
442
- __typename
443
- }
444
-
445
- fragment Kit on Kit {
446
- id
447
- type
448
- price {
449
- currencyCode
450
- retail
451
- wholesale
452
- retailSales
453
- wholesaleSales
454
- retailSubscription
455
- wholesaleSubscription
456
- retailOriginal
457
- wholesaleOriginal
458
- __typename
459
- }
460
- totalPrice {
461
- currencyCode
462
- retail
463
- wholesale
464
- retailSales
465
- wholesaleSales
466
- retailSubscription
467
- wholesaleSubscription
468
- retailOriginal
469
- wholesaleOriginal
470
- __typename
471
- }
472
- points {
473
- wholesale {
474
- cv
475
- pv
476
- __typename
477
- }
478
- subscription {
479
- cv
480
- pv
481
- __typename
482
- }
483
- __typename
484
- }
485
- totalPoints {
486
- wholesale {
487
- cv
488
- pv
489
- __typename
490
- }
491
- subscription {
492
- cv
493
- pv
494
- __typename
495
- }
496
- __typename
497
- }
498
- retailDiscount
499
- wholesaleDiscount
500
- pvDiscount
501
- cvDiscount
502
- sbDiscount
503
- grpDiscount
504
- availableChannels
505
- customerTypes
506
- purchaseTypes {
507
- buyOnce
508
- subscription
509
- __typename
510
- }
511
- status {
512
- status
513
- isBackordered
514
- backorderedAvailableDate
515
- __typename
516
- }
517
- availableQuantity
518
- chargeShipping
519
- dangerousGoods
520
- excludeFromSearch
521
- isExclusive
522
- marketAttributes {
523
- discount
524
- redeem
525
- earn
526
- __typename
527
- }
528
- restrictedMarkets
529
- scanQualifiedCount
530
- kitProducts {
531
- quantity
532
- isMandatory
533
- product {
534
- ...Product
535
- __typename
536
- }
537
- __typename
538
- }
539
- __typename
540
- }`
541
-
542
-
543
- module.exports = getProductByIdQuery;