@decocms/apps-wake 7.66.0

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 (56) hide show
  1. package/package.json +58 -0
  2. package/src/actions/cart/addCoupon.ts +43 -0
  3. package/src/actions/cart/addItem.ts +10 -0
  4. package/src/actions/cart/addItems.ts +50 -0
  5. package/src/actions/cart/addKit.ts +53 -0
  6. package/src/actions/cart/partnerAssociate.ts +48 -0
  7. package/src/actions/cart/partnerDisassociate.ts +43 -0
  8. package/src/actions/cart/removeCoupon.ts +39 -0
  9. package/src/actions/cart/removeKit.ts +56 -0
  10. package/src/actions/cart/updateItemQuantity.ts +69 -0
  11. package/src/actions/newsletter/register.ts +32 -0
  12. package/src/actions/notifyme.ts +28 -0
  13. package/src/actions/review/create.ts +30 -0
  14. package/src/actions/shippingSimulation.ts +60 -0
  15. package/src/actions/submmitForm.ts +25 -0
  16. package/src/actions/wishlist/addProduct.ts +43 -0
  17. package/src/actions/wishlist/removeProduct.ts +45 -0
  18. package/src/client.ts +123 -0
  19. package/src/commerceLoaders.ts +137 -0
  20. package/src/handlers/sitemap.ts +61 -0
  21. package/src/index.ts +58 -0
  22. package/src/loaders/cart.ts +46 -0
  23. package/src/loaders/partners.ts +58 -0
  24. package/src/loaders/productDetailsPage.ts +174 -0
  25. package/src/loaders/productList.ts +262 -0
  26. package/src/loaders/productListingPage.ts +333 -0
  27. package/src/loaders/proxy.ts +79 -0
  28. package/src/loaders/recommendations.ts +84 -0
  29. package/src/loaders/shop.ts +37 -0
  30. package/src/loaders/suggestion.ts +67 -0
  31. package/src/loaders/user.ts +48 -0
  32. package/src/loaders/wishlist.ts +40 -0
  33. package/src/manifest.gen.ts +69 -0
  34. package/src/mod.ts +88 -0
  35. package/src/registry.ts +9 -0
  36. package/src/utils/authError.ts +107 -0
  37. package/src/utils/authenticate.ts +42 -0
  38. package/src/utils/capitalize.ts +9 -0
  39. package/src/utils/cart.ts +33 -0
  40. package/src/utils/client.ts +11 -0
  41. package/src/utils/cookies.ts +82 -0
  42. package/src/utils/getVariations.ts +47 -0
  43. package/src/utils/graphql/queries.ts +1363 -0
  44. package/src/utils/graphql/storefront.graphql.gen.ts +10233 -0
  45. package/src/utils/graphql.ts +88 -0
  46. package/src/utils/graphqlOperationName.ts +67 -0
  47. package/src/utils/httpError.ts +15 -0
  48. package/src/utils/instrumentedFetch.ts +46 -0
  49. package/src/utils/operationRouter.ts +51 -0
  50. package/src/utils/parseHeaders.ts +19 -0
  51. package/src/utils/partner.ts +34 -0
  52. package/src/utils/requestCtx.ts +41 -0
  53. package/src/utils/transform.ts +460 -0
  54. package/src/utils/types.ts +6 -0
  55. package/src/utils/user.ts +9 -0
  56. package/tsconfig.json +7 -0
@@ -0,0 +1,1363 @@
1
+ import { gql } from "../graphql";
2
+
3
+ const Checkout = gql`
4
+ fragment Checkout on Checkout {
5
+ checkoutId
6
+ shippingFee
7
+ subtotal
8
+ total
9
+ completed
10
+ coupon
11
+ customer {
12
+ customerId
13
+ }
14
+ products {
15
+ imageUrl
16
+ brand
17
+ ajustedPrice
18
+ listPrice
19
+ totalListPrice
20
+ totalAdjustedPrice
21
+ seller {
22
+ sellerName
23
+ distributionCenterId
24
+ }
25
+ productAttributes {
26
+ name
27
+ type
28
+ value
29
+ }
30
+ adjustments {
31
+ observation
32
+ type
33
+ value
34
+ }
35
+ price
36
+ name
37
+ productId
38
+ productVariantId
39
+ quantity
40
+ sku
41
+ url
42
+ category
43
+ kit
44
+ gift
45
+ subscription {
46
+ availableSubscriptions {
47
+ name
48
+ recurringDays
49
+ recurringTypeId
50
+ selected
51
+ subscriptionGroupDiscount
52
+ subscriptionGroupId
53
+ }
54
+ selected {
55
+ selected
56
+ name
57
+ recurringDays
58
+ recurringTypeId
59
+ subscriptionGroupDiscount
60
+ subscriptionGroupId
61
+ }
62
+ }
63
+ customization {
64
+ availableCustomizations {
65
+ cost
66
+ customizationId
67
+ groupName
68
+ id
69
+ maxLength
70
+ name
71
+ order
72
+ type
73
+ values
74
+ }
75
+ id
76
+ values {
77
+ cost
78
+ name
79
+ value
80
+ }
81
+ }
82
+ attributeSelections {
83
+ selectedVariant {
84
+ id
85
+ alias
86
+ available
87
+ images {
88
+ fileName
89
+ url
90
+ }
91
+ prices {
92
+ listPrice
93
+ price
94
+ discountPercentage
95
+ installmentPlans {
96
+ displayName
97
+ name
98
+ installments {
99
+ discount
100
+ fees
101
+ number
102
+ value
103
+ }
104
+ }
105
+ bestInstallment {
106
+ name
107
+ displayName
108
+ discount
109
+ fees
110
+ number
111
+ value
112
+ }
113
+ wholesalePrices {
114
+ price
115
+ quantity
116
+ }
117
+ }
118
+ productId
119
+ productVariantId
120
+ stock
121
+ }
122
+ selections {
123
+ attributeId
124
+ displayType
125
+ name
126
+ varyByParent
127
+ values {
128
+ alias
129
+ available
130
+ printUrl
131
+ selected
132
+ value
133
+ }
134
+ }
135
+ }
136
+ }
137
+ selectedAddress {
138
+ addressNumber
139
+ cep
140
+ city
141
+ complement
142
+ id
143
+ neighborhood
144
+ referencePoint
145
+ state
146
+ street
147
+ }
148
+ selectedShipping {
149
+ deadline
150
+ deadlineInHours
151
+ deliverySchedule {
152
+ date
153
+ endDateTime
154
+ endTime
155
+ startDateTime
156
+ startTime
157
+ }
158
+ name
159
+ shippingQuoteId
160
+ type
161
+ value
162
+ }
163
+ selectedPaymentMethod {
164
+ html
165
+ id
166
+ installments {
167
+ adjustment
168
+ number
169
+ total
170
+ value
171
+ }
172
+ paymentMethodId
173
+ scripts
174
+ selectedInstallment {
175
+ adjustment
176
+ number
177
+ total
178
+ value
179
+ }
180
+ suggestedCards {
181
+ brand
182
+ key
183
+ name
184
+ number
185
+ }
186
+ }
187
+ orders {
188
+ adjustments {
189
+ name
190
+ type
191
+ value
192
+ }
193
+ date
194
+ delivery {
195
+ address {
196
+ address
197
+ cep
198
+ city
199
+ complement
200
+ isPickupStore
201
+ name
202
+ neighborhood
203
+ pickupStoreText
204
+ }
205
+ cost
206
+ deliveryTime
207
+ deliveryTimeInHours
208
+ name
209
+ }
210
+ discountValue
211
+ dispatchTimeText
212
+ interestValue
213
+ orderId
214
+ orderStatus
215
+ payment {
216
+ card {
217
+ brand
218
+ cardInterest
219
+ installments
220
+ name
221
+ number
222
+ }
223
+ invoice {
224
+ digitableLine
225
+ paymentLink
226
+ }
227
+ name
228
+ pix {
229
+ qrCode
230
+ qrCodeExpirationDate
231
+ qrCodeUrl
232
+ }
233
+ }
234
+ products {
235
+ adjustments {
236
+ additionalInformation
237
+ name
238
+ type
239
+ value
240
+ }
241
+ attributes {
242
+ name
243
+ value
244
+ }
245
+ imageUrl
246
+ name
247
+ productVariantId
248
+ quantity
249
+ unitValue
250
+ value
251
+ }
252
+ shippingValue
253
+ totalValue
254
+
255
+ }
256
+ kits {
257
+ kitId
258
+ kitGroupId
259
+ alias
260
+ imageUrl
261
+ listPrice
262
+ price
263
+ totalListPrice
264
+ totalAdjustedPrice
265
+ name
266
+ quantity
267
+ products {
268
+ productId
269
+ productVariantId
270
+ imageUrl
271
+ name
272
+ url
273
+ quantity
274
+ productAttributes {
275
+ name
276
+ value
277
+ }
278
+ }
279
+ }
280
+ }
281
+ `;
282
+
283
+ const Product = gql`
284
+ fragment Product on Product {
285
+ mainVariant
286
+ productName
287
+ productId
288
+ alias
289
+ attributes {
290
+ id
291
+ type
292
+ value
293
+ name
294
+ }
295
+ productCategories {
296
+ id
297
+ name
298
+ url
299
+ hierarchy
300
+ main
301
+ googleCategories
302
+ }
303
+ informations {
304
+ title
305
+ value
306
+ type
307
+ }
308
+ available
309
+ averageRating
310
+ condition
311
+ createdAt
312
+ ean
313
+ id
314
+ images {
315
+ url
316
+ fileName
317
+ print
318
+ }
319
+ minimumOrderQuantity
320
+ prices {
321
+ bestInstallment {
322
+ discount
323
+ displayName
324
+ fees
325
+ name
326
+ number
327
+ value
328
+ }
329
+ discountPercentage
330
+ discounted
331
+ installmentPlans {
332
+ displayName
333
+ installments {
334
+ discount
335
+ fees
336
+ number
337
+ value
338
+ }
339
+ name
340
+ }
341
+ listPrice
342
+ multiplicationFactor
343
+ price
344
+ priceTables {
345
+ discountPercentage
346
+ id
347
+ listPrice
348
+ price
349
+ }
350
+ wholesalePrices {
351
+ price
352
+ quantity
353
+ }
354
+ }
355
+ productBrand {
356
+ fullUrlLogo
357
+ logoUrl
358
+ name
359
+ alias
360
+ }
361
+ productVariantId
362
+ seller {
363
+ name
364
+ }
365
+ parentId
366
+ sku
367
+ numberOfVotes
368
+ stock
369
+ variantName
370
+ variantStock
371
+ collection
372
+ urlVideo
373
+ similarProducts {
374
+ alias
375
+ image
376
+ imageUrl
377
+ name
378
+ }
379
+ promotions {
380
+ content
381
+ disclosureType
382
+ id
383
+ fullStampUrl
384
+ stamp
385
+ title
386
+ }
387
+ # parallelOptions
388
+ }
389
+ `;
390
+
391
+ const ProductVariant = gql`
392
+ fragment ProductVariant on ProductVariant {
393
+
394
+ aggregatedStock
395
+ alias
396
+ available
397
+ attributes {
398
+ attributeId
399
+ displayType
400
+ id
401
+ name
402
+ type
403
+ value
404
+ }
405
+ ean
406
+ id
407
+ images {
408
+ fileName
409
+ mini
410
+ order
411
+ print
412
+ url
413
+ }
414
+ productId
415
+ productVariantId
416
+ productVariantName
417
+ sku
418
+ stock
419
+ prices {
420
+ discountPercentage
421
+ discounted
422
+ installmentPlans {
423
+ displayName
424
+ name
425
+ installments {
426
+ discount
427
+ fees
428
+ number
429
+ value
430
+ }
431
+ }
432
+ listPrice
433
+ multiplicationFactor
434
+ price
435
+ priceTables {
436
+ discountPercentage
437
+ id
438
+ listPrice
439
+ price
440
+ }
441
+ wholesalePrices {
442
+ price
443
+ quantity
444
+ }
445
+ bestInstallment {
446
+ discount
447
+ displayName
448
+ fees
449
+ name
450
+ number
451
+ value
452
+ }
453
+ }
454
+ offers {
455
+ name
456
+ prices {
457
+ installmentPlans {
458
+ displayName
459
+ installments {
460
+ discount
461
+ fees
462
+ number
463
+ value
464
+ }
465
+ }
466
+ listPrice
467
+ price
468
+ }
469
+ productVariantId
470
+ }
471
+ promotions {
472
+ content
473
+ disclosureType
474
+ id
475
+ fullStampUrl
476
+ stamp
477
+ title
478
+ }
479
+ }`;
480
+
481
+ const BuyList = gql`
482
+ fragment BuyList on BuyList {
483
+
484
+ mainVariant
485
+ productName
486
+ productId
487
+ alias
488
+ collection
489
+ kit
490
+ attributes {
491
+ name
492
+ type
493
+ value
494
+ attributeId
495
+ displayType
496
+ id
497
+ }
498
+ numberOfVotes
499
+ productCategories {
500
+ id
501
+ name
502
+ url
503
+ hierarchy
504
+ main
505
+ googleCategories
506
+ }
507
+ informations {
508
+ title
509
+ value
510
+ type
511
+ }
512
+ available
513
+ averageRating
514
+ breadcrumbs {
515
+ text
516
+ link
517
+ }
518
+ condition
519
+ createdAt
520
+ ean
521
+ id
522
+ images {
523
+ url
524
+ fileName
525
+ print
526
+ }
527
+ minimumOrderQuantity
528
+ prices {
529
+ bestInstallment {
530
+ discount
531
+ displayName
532
+ fees
533
+ name
534
+ number
535
+ value
536
+ }
537
+ discountPercentage
538
+ discounted
539
+ installmentPlans {
540
+ displayName
541
+ installments {
542
+ discount
543
+ fees
544
+ number
545
+ value
546
+ }
547
+ name
548
+ }
549
+ listPrice
550
+ multiplicationFactor
551
+ price
552
+ priceTables {
553
+ discountPercentage
554
+ id
555
+ listPrice
556
+ price
557
+ }
558
+ wholesalePrices {
559
+ price
560
+ quantity
561
+ }
562
+ }
563
+ productBrand {
564
+ fullUrlLogo
565
+ logoUrl
566
+ name
567
+ alias
568
+ }
569
+ productVariantId
570
+ seller {
571
+ name
572
+ }
573
+ seo {
574
+ name
575
+ scheme
576
+ type
577
+ httpEquiv
578
+ content
579
+ }
580
+ sku
581
+ stock
582
+ variantName
583
+ parallelOptions
584
+ urlVideo
585
+ reviews {
586
+ rating
587
+ review
588
+ reviewDate
589
+ email
590
+ customer
591
+ }
592
+ similarProducts {
593
+ alias
594
+ image
595
+ imageUrl
596
+ name
597
+ }
598
+ attributeSelections {
599
+ selections {
600
+ attributeId
601
+ displayType
602
+ name
603
+ varyByParent
604
+ values {
605
+ alias
606
+ available
607
+ value
608
+ selected
609
+ printUrl
610
+ }
611
+ }
612
+ canBeMatrix
613
+ matrix {
614
+ column {
615
+ displayType
616
+ name
617
+ values {
618
+ value
619
+ }
620
+ }
621
+ data {
622
+ available
623
+ productVariantId
624
+ stock
625
+ }
626
+ row {
627
+ displayType
628
+ name
629
+ values {
630
+ value
631
+ printUrl
632
+ }
633
+ }
634
+ }
635
+ },
636
+ buyTogether {
637
+ productId
638
+ }
639
+ promotions {
640
+ content
641
+ disclosureType
642
+ id
643
+ fullStampUrl
644
+ stamp
645
+ title
646
+ }
647
+ alias
648
+ buyListId
649
+ kit
650
+ available
651
+ variantName
652
+ buyListProducts {
653
+ productId
654
+ quantity
655
+ includeSameParent
656
+ }
657
+ images{
658
+ url
659
+ fileName
660
+ print
661
+ }
662
+ informations{
663
+ id
664
+ title
665
+ type
666
+ value
667
+ }
668
+ promotions{
669
+ content
670
+ id
671
+ stamp
672
+ fullStampUrl
673
+ title
674
+ disclosureType
675
+ }
676
+ productName
677
+ prices {
678
+ listPrice
679
+ price
680
+ discountPercentage
681
+ installmentPlans{
682
+ displayName
683
+ name
684
+ installments{
685
+ discount
686
+ fees
687
+ number
688
+ value
689
+ }
690
+ }
691
+ bestInstallment {
692
+ name
693
+ displayName
694
+ discount
695
+ fees
696
+ number
697
+ value
698
+ }
699
+ }
700
+
701
+ }
702
+ `;
703
+
704
+ const SingleProductPart = gql`
705
+ fragment SingleProductPart on SingleProduct {
706
+ mainVariant
707
+ productName
708
+ productId
709
+ alias
710
+ collection
711
+ attributes {
712
+ name
713
+ type
714
+ value
715
+ attributeId
716
+ displayType
717
+ id
718
+ }
719
+ numberOfVotes
720
+ productCategories {
721
+ id
722
+ name
723
+ url
724
+ hierarchy
725
+ main
726
+ googleCategories
727
+ }
728
+ informations {
729
+ title
730
+ value
731
+ type
732
+ }
733
+ available
734
+ averageRating
735
+ breadcrumbs {
736
+ text
737
+ link
738
+ }
739
+ condition
740
+ createdAt
741
+ ean
742
+ id
743
+ images {
744
+ url
745
+ fileName
746
+ print
747
+ }
748
+ minimumOrderQuantity
749
+ prices {
750
+ bestInstallment {
751
+ discount
752
+ displayName
753
+ fees
754
+ name
755
+ number
756
+ value
757
+ }
758
+ discountPercentage
759
+ discounted
760
+ installmentPlans {
761
+ displayName
762
+ installments {
763
+ discount
764
+ fees
765
+ number
766
+ value
767
+ }
768
+ name
769
+ }
770
+ listPrice
771
+ multiplicationFactor
772
+ price
773
+ priceTables {
774
+ discountPercentage
775
+ id
776
+ listPrice
777
+ price
778
+ }
779
+ wholesalePrices {
780
+ price
781
+ quantity
782
+ }
783
+ }
784
+ productBrand {
785
+ fullUrlLogo
786
+ logoUrl
787
+ name
788
+ alias
789
+ }
790
+ productVariantId
791
+ seller {
792
+ name
793
+ }
794
+ seo {
795
+ name
796
+ scheme
797
+ type
798
+ httpEquiv
799
+ content
800
+ }
801
+ sku
802
+ stock
803
+ variantName
804
+ parallelOptions
805
+ urlVideo
806
+ reviews {
807
+ rating
808
+ review
809
+ reviewDate
810
+ email
811
+ customer
812
+ }
813
+ similarProducts {
814
+ alias
815
+ image
816
+ imageUrl
817
+ name
818
+ }
819
+ attributeSelections(includeParentIdVariants: $includeParentIdVariants) {
820
+ selections {
821
+ attributeId
822
+ displayType
823
+ name
824
+ varyByParent
825
+ values {
826
+ alias
827
+ available
828
+ value
829
+ selected
830
+ printUrl
831
+ }
832
+ }
833
+ canBeMatrix
834
+ matrix {
835
+ column {
836
+ displayType
837
+ name
838
+ values {
839
+ value
840
+ }
841
+ }
842
+ data {
843
+ available
844
+ productVariantId
845
+ stock
846
+ }
847
+ row {
848
+ displayType
849
+ name
850
+ values {
851
+ value
852
+ printUrl
853
+ }
854
+ }
855
+ }
856
+ selectedVariant {
857
+ ...ProductVariant
858
+ }
859
+ candidateVariant {
860
+ ...ProductVariant
861
+ }
862
+ },
863
+ promotions {
864
+ content
865
+ disclosureType
866
+ id
867
+ fullStampUrl
868
+ stamp
869
+ title
870
+ }
871
+
872
+ }
873
+ `;
874
+
875
+ const SingleProduct = gql`
876
+ fragment SingleProduct on SingleProduct {
877
+ ...SingleProductPart,
878
+ buyTogether {
879
+ productId
880
+ }
881
+ }
882
+
883
+ `;
884
+
885
+ const RestockAlertNode = gql`
886
+ fragment RestockAlertNode on RestockAlertNode {
887
+ email,
888
+ name,
889
+ productVariantId,
890
+ requestDate
891
+ }
892
+ `;
893
+
894
+ const NewsletterNode = gql`
895
+ fragment NewsletterNode on NewsletterNode {
896
+ email,
897
+ name,
898
+ createDate,
899
+ updateDate
900
+ }
901
+ `;
902
+
903
+ const ShippingQuote = gql`
904
+ fragment ShippingQuote on ShippingQuote {
905
+ id
906
+ type
907
+ name
908
+ value
909
+ deadline
910
+ shippingQuoteId
911
+ deliverySchedules {
912
+ date
913
+ periods {
914
+ end
915
+ id
916
+ start
917
+ }
918
+ }
919
+ products {
920
+ productVariantId
921
+ value
922
+ }
923
+ }
924
+ `;
925
+
926
+ export const Customer = gql`
927
+ fragment Customer on Customer {
928
+ id
929
+ email
930
+ gender
931
+ customerId
932
+ companyName
933
+ customerName
934
+ customerType
935
+ responsibleName
936
+ informationGroups {
937
+ exibitionName
938
+ name
939
+ }
940
+ }
941
+ `;
942
+
943
+ export const WishlistReducedProduct = gql`
944
+ fragment WishlistReducedProduct on Product {
945
+ productId
946
+ productName
947
+ }
948
+ `;
949
+
950
+ export const GetProduct = {
951
+ fragments: [SingleProductPart, SingleProduct, ProductVariant],
952
+ query: gql`query GetProduct($productId: Long!, $includeParentIdVariants: Boolean, $partnerAccessToken: String) {
953
+ product(productId: $productId , partnerAccessToken: $partnerAccessToken) {
954
+ ...SingleProduct
955
+ }
956
+ }`,
957
+ };
958
+
959
+ export const GetCart = {
960
+ fragments: [Checkout],
961
+ query: gql`query GetCart($checkoutId: String!) {
962
+ checkout(checkoutId: $checkoutId) { ...Checkout }
963
+ }`,
964
+ };
965
+
966
+ export const CreateCart = {
967
+ fragments: [Checkout],
968
+ query: gql`mutation CreateCart { checkout: createCheckout { ...Checkout } }`,
969
+ };
970
+
971
+ export const GetProducts = {
972
+ fragments: [Product],
973
+ query: gql`query GetProducts($filters: ProductExplicitFiltersInput!, $first: Int!, $sortDirection: SortDirection!, $sortKey: ProductSortKeys, $after: String, $partnerAccessToken: String) { products(filters: $filters, first: $first, sortDirection: $sortDirection, sortKey: $sortKey, after: $after, partnerAccessToken: $partnerAccessToken) {
974
+ nodes { ...Product }
975
+ totalCount
976
+ pageInfo{
977
+ hasNextPage,
978
+ endCursor,
979
+ hasPreviousPage,
980
+ startCursor
981
+ }
982
+ }}`,
983
+ };
984
+
985
+ export const Search = {
986
+ fragments: [Product],
987
+ query: gql`query Search($operation: Operation!, $query: String, $onlyMainVariant: Boolean, $minimumPrice: Decimal, $maximumPrice: Decimal , $limit: Int, $offset: Int, $sortDirection: SortDirection, $sortKey: ProductSearchSortKeys, $filters: [ProductFilterInput], $partnerAccessToken: String) {
988
+ result: search(query: $query, operation: $operation, partnerAccessToken: $partnerAccessToken) {
989
+ aggregations {
990
+ maximumPrice
991
+ minimumPrice
992
+ priceRanges {
993
+ quantity
994
+ range
995
+ }
996
+ filters {
997
+ field
998
+ origin
999
+ values {
1000
+ quantity
1001
+ name
1002
+ }
1003
+ }
1004
+ }
1005
+ breadcrumbs {
1006
+ link
1007
+ text
1008
+ }
1009
+ forbiddenTerm {
1010
+ text
1011
+ suggested
1012
+ }
1013
+ pageSize
1014
+ redirectUrl
1015
+ searchTime
1016
+ productsByOffset(
1017
+ filters: $filters,
1018
+ limit: $limit,
1019
+ maximumPrice: $maximumPrice,
1020
+ minimumPrice: $minimumPrice,
1021
+ onlyMainVariant: $onlyMainVariant
1022
+ offset: $offset,
1023
+ sortDirection: $sortDirection,
1024
+ sortKey: $sortKey
1025
+ ) {
1026
+ items {
1027
+ ...Product
1028
+ }
1029
+ page
1030
+ pageSize
1031
+ totalCount
1032
+ }
1033
+
1034
+ }
1035
+ }`,
1036
+ };
1037
+
1038
+ export const AddCoupon = {
1039
+ fragments: [Checkout],
1040
+ query: gql`mutation AddCoupon($checkoutId: Uuid!, $coupon: String!) {
1041
+ checkout: checkoutAddCoupon(
1042
+ checkoutId: $checkoutId
1043
+ coupon: $coupon
1044
+ ) { ...Checkout }
1045
+ }`,
1046
+ };
1047
+
1048
+ export const AddItemToCart = {
1049
+ fragments: [Checkout],
1050
+ query: gql`mutation AddItemToCart($input: CheckoutProductInput!) {
1051
+ checkout: checkoutAddProduct(input: $input) { ...Checkout }
1052
+ }`,
1053
+ };
1054
+
1055
+ export const RemoveCoupon = {
1056
+ fragments: [Checkout],
1057
+ query: gql`mutation RemoveCoupon($checkoutId: Uuid!) {
1058
+ checkout: checkoutRemoveCoupon(checkoutId: $checkoutId) {
1059
+ ...Checkout
1060
+ }
1061
+ }`,
1062
+ };
1063
+
1064
+ export const RemoveItemFromCart = {
1065
+ fragments: [Checkout],
1066
+ query: gql`mutation RemoveItemFromCart($input: CheckoutProductInput!) {
1067
+ checkout: checkoutRemoveProduct(input: $input) { ...Checkout }
1068
+ }`,
1069
+ };
1070
+
1071
+ export const ProductRestockAlert = {
1072
+ fragments: [RestockAlertNode],
1073
+ query: gql`mutation ProductRestockAlert($input: RestockAlertInput!) {
1074
+ productRestockAlert(input: $input) { ...RestockAlertNode }
1075
+ }`,
1076
+ };
1077
+
1078
+ export const WishlistAddProduct = {
1079
+ fragments: [Product],
1080
+ query: gql`mutation WishlistAddProduct($customerAccessToken: String!, $productId: Long!) {
1081
+ wishlistAddProduct(customerAccessToken: $customerAccessToken, productId: $productId) { ...Product }
1082
+ }`,
1083
+ };
1084
+
1085
+ export const WishlistRemoveProduct = {
1086
+ fragments: [Product],
1087
+ query: gql`mutation WishlistRemoveProduct($customerAccessToken: String!, $productId: Long!) {
1088
+ wishlistRemoveProduct(customerAccessToken: $customerAccessToken, productId: $productId) { ...Product }
1089
+ }`,
1090
+ };
1091
+
1092
+ export const CreateNewsletterRegister = {
1093
+ fragments: [NewsletterNode],
1094
+ query: gql`mutation CreateNewsletterRegister($input: NewsletterInput!) {
1095
+ createNewsletterRegister(input: $input) { ...NewsletterNode }
1096
+ }`,
1097
+ };
1098
+
1099
+ export const Autocomplete = {
1100
+ fragments: [Product],
1101
+ query: gql`query Autocomplete($limit: Int, $query: String, $partnerAccessToken: String) {
1102
+ autocomplete(limit: $limit, query: $query , partnerAccessToken: $partnerAccessToken ) {
1103
+ suggestions,
1104
+ products {
1105
+ ...Product
1106
+ }
1107
+ }
1108
+ }`,
1109
+ };
1110
+
1111
+ export const ProductRecommendations = {
1112
+ fragments: [Product],
1113
+ query: gql`query ProductRecommendations(
1114
+ $productId: Long!,
1115
+ $algorithm: ProductRecommendationAlgorithm!,
1116
+ $partnerAccessToken: String,
1117
+ $quantity: Int!
1118
+ ) {
1119
+ productRecommendations(productId: $productId, algorithm: $algorithm, partnerAccessToken: $partnerAccessToken, quantity: $quantity) {
1120
+ ...Product
1121
+ }
1122
+ }`,
1123
+ };
1124
+
1125
+ export const ShippingQuotes = {
1126
+ fragments: [ShippingQuote],
1127
+ query: gql`query ShippingQuotes($cep: CEP,$checkoutId: Uuid, $productVariantId: Long,$quantity: Int = 1, $useSelectedAddress: Boolean){
1128
+ shippingQuotes(cep: $cep,checkoutId: $checkoutId,productVariantId: $productVariantId,quantity: $quantity, useSelectedAddress: $useSelectedAddress){
1129
+ ...ShippingQuote
1130
+ }
1131
+ }`,
1132
+ };
1133
+
1134
+ export const GetUser = {
1135
+ fragments: [Customer],
1136
+ query: gql`query getUser($customerAccessToken: String){
1137
+ customer(customerAccessToken: $customerAccessToken) {
1138
+ ...Customer
1139
+ }
1140
+ }`,
1141
+ };
1142
+
1143
+ export const GetWishlist = {
1144
+ fragments: [WishlistReducedProduct],
1145
+ query: gql`query getWishlist($customerAccessToken: String){
1146
+ customer(customerAccessToken: $customerAccessToken) {
1147
+ wishlist {
1148
+ products {
1149
+ ...WishlistReducedProduct
1150
+ }
1151
+ }
1152
+ }
1153
+ }`,
1154
+ };
1155
+
1156
+ export const GetURL = {
1157
+ query: gql`query getURL($url: String!) {
1158
+ uri(url: $url) {
1159
+ hotsiteSubtype
1160
+ kind
1161
+ partnerSubtype
1162
+ productAlias
1163
+ productCategoriesIds
1164
+ redirectCode
1165
+ redirectUrl
1166
+ }
1167
+ }`,
1168
+ };
1169
+
1170
+ export const CreateProductReview = {
1171
+ query: gql`mutation createProductReview ($email: String!, $name: String!, $productVariantId: Long!, $rating: Int!, $review: String!){
1172
+ createProductReview(input: {email: $email, name: $name, productVariantId: $productVariantId, rating: $rating, review: $review}) {
1173
+ customer
1174
+ email
1175
+ rating
1176
+ review
1177
+ reviewDate
1178
+ }}`,
1179
+ };
1180
+
1181
+ export const SendGenericForm = {
1182
+ query: gql`mutation sendGenericForm ($body: Any, $file: Upload, $recaptchaToken: String){
1183
+ sendGenericForm(body: $body, file: $file, recaptchaToken: $recaptchaToken) {
1184
+ isSuccess
1185
+ }}`,
1186
+ };
1187
+
1188
+ export const Hotsite = {
1189
+ fragments: [Product],
1190
+ query: gql`query Hotsite($url: String,
1191
+ $filters: [ProductFilterInput],
1192
+ $limit: Int,
1193
+ $maximumPrice: Decimal,
1194
+ $minimumPrice: Decimal,
1195
+ $onlyMainVariant: Boolean
1196
+ $offset: Int,
1197
+ $sortDirection: SortDirection,
1198
+ $sortKey: ProductSortKeys,
1199
+ $partnerAccessToken: String) {
1200
+ result: hotsite(url: $url, partnerAccessToken: $partnerAccessToken) {
1201
+ aggregations {
1202
+ filters {
1203
+ field
1204
+ origin
1205
+ values {
1206
+ name
1207
+ quantity
1208
+ }
1209
+ }
1210
+ maximumPrice
1211
+ minimumPrice
1212
+ priceRanges {
1213
+ quantity
1214
+ range
1215
+ }
1216
+ }
1217
+ productsByOffset(
1218
+ filters: $filters,
1219
+ limit: $limit,
1220
+ maximumPrice: $maximumPrice,
1221
+ minimumPrice: $minimumPrice,
1222
+ onlyMainVariant: $onlyMainVariant
1223
+ offset: $offset,
1224
+ sortDirection: $sortDirection,
1225
+ sortKey: $sortKey
1226
+ ) {
1227
+ items {
1228
+ ...Product
1229
+ }
1230
+ page
1231
+ pageSize
1232
+ totalCount
1233
+ }
1234
+ breadcrumbs {
1235
+ link
1236
+ text
1237
+ }
1238
+ endDate
1239
+ expression
1240
+ id
1241
+ name
1242
+ pageSize
1243
+ seo {
1244
+ content
1245
+ httpEquiv
1246
+ name
1247
+ scheme
1248
+ type
1249
+ }
1250
+ sorting {
1251
+ direction
1252
+ field
1253
+ }
1254
+ startDate
1255
+ subtype
1256
+ template
1257
+ url
1258
+ hotsiteId
1259
+ }
1260
+ }
1261
+ `,
1262
+ };
1263
+
1264
+ export const productOptions = {
1265
+ query: gql`query productOptions ($productId: Long!){
1266
+ productOptions(productId: $productId) {
1267
+ attributes {
1268
+ attributeId
1269
+ displayType
1270
+ id
1271
+ name
1272
+ type
1273
+ values {
1274
+ productVariants {
1275
+ ...ProductVariant
1276
+ }
1277
+ value
1278
+ }
1279
+ }
1280
+ id
1281
+ }
1282
+ }`,
1283
+ };
1284
+
1285
+ export const Shop = {
1286
+ query: gql`query shop{
1287
+ shop {
1288
+ checkoutUrl
1289
+ mainUrl
1290
+ mobileCheckoutUrl
1291
+ mobileUrl
1292
+ modifiedName
1293
+ name
1294
+ }
1295
+ }`,
1296
+ };
1297
+
1298
+ export const GetBuyList = {
1299
+ fragments: [BuyList],
1300
+ query: gql`query BuyList($id: Long!, $partnerAccessToken: String) {
1301
+ buyList(id: $id, partnerAccessToken: $partnerAccessToken){
1302
+ ...BuyList
1303
+ }
1304
+ }`,
1305
+ };
1306
+
1307
+ export const AddKit = {
1308
+ fragments: [Checkout],
1309
+ query: gql`mutation AddKit($input: CheckoutKitInput!, $customerAccessToken: String, $recaptchaToken: String) {
1310
+ checkout: checkoutAddKit(input: $input, customerAccessToken: $customerAccessToken, recaptchaToken: $recaptchaToken) {
1311
+ ...Checkout
1312
+ }
1313
+ }`,
1314
+ };
1315
+
1316
+ export const RemoveKit = {
1317
+ fragments: [Checkout],
1318
+ query: gql`mutation RemoveKit($input: CheckoutKitInput!, $customerAccessToken: String, $recaptchaToken: String) {
1319
+ checkout: checkoutRemoveKit(input: $input, customerAccessToken: $customerAccessToken, recaptchaToken: $recaptchaToken) {
1320
+ ...Checkout
1321
+ }
1322
+ }`,
1323
+ };
1324
+
1325
+ export const GetPartners = {
1326
+ query: gql`query GetPartners($first: Int,$last: Int,$names: [String],$priceTableIds: [Int!],$sortDirection: SortDirection! = ASC,$sortKey: PartnerSortKeys! = ID,$before: String,$alias: [String],$after: String) {
1327
+ partners(first:$first,last:$last,names:$names,priceTableIds:$priceTableIds,sortDirection:$sortDirection,sortKey:$sortKey ,before:$before,alias:$alias,after:$after){
1328
+ edges{
1329
+ node{
1330
+ partnerId
1331
+ priceTableId
1332
+ portfolioId
1333
+ type
1334
+ startDate
1335
+ endDate
1336
+ name
1337
+ alias
1338
+ fullUrlLogo
1339
+ origin
1340
+ partnerAccessToken
1341
+ }
1342
+ }
1343
+ }
1344
+ }`,
1345
+ };
1346
+
1347
+ export const CheckoutPartnerAssociate = {
1348
+ fragments: [Checkout],
1349
+ query: gql`mutation CheckoutPartnerAssociate($checkoutId: Uuid!,$customerAccessToken: String, $partnerAccessToken: String!){
1350
+ checkout: checkoutPartnerAssociate(checkoutId: $checkoutId ,customerAccessToken: $customerAccessToken ,partnerAccessToken: $partnerAccessToken ){
1351
+ ...Checkout
1352
+ }
1353
+ }`,
1354
+ };
1355
+
1356
+ export const CheckoutPartnerDisassociate = {
1357
+ fragments: [Checkout],
1358
+ query: gql`mutation CheckoutPartnerDisassociate($checkoutId: Uuid!, $customerAccessToken: String){
1359
+ checkout: checkoutPartnerDisassociate(checkoutId: $checkoutId , customerAccessToken: $customerAccessToken ){
1360
+ ...Checkout
1361
+ }
1362
+ }`,
1363
+ };