@valoranchi/riot-client 0.4.0 → 0.5.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 (130) hide show
  1. package/README.md +14 -0
  2. package/dist/RiotClient.d.ts +4 -1
  3. package/dist/RiotClient.d.ts.map +1 -1
  4. package/dist/RiotClient.js +7 -1
  5. package/dist/RiotClient.js.map +1 -1
  6. package/dist/analysis/wishlist.d.ts +5 -0
  7. package/dist/analysis/wishlist.d.ts.map +1 -0
  8. package/dist/analysis/wishlist.js +122 -0
  9. package/dist/analysis/wishlist.js.map +1 -0
  10. package/dist/catalogue/Catalogue.d.ts +1 -0
  11. package/dist/catalogue/Catalogue.d.ts.map +1 -1
  12. package/dist/catalogue/Catalogue.js +11 -0
  13. package/dist/catalogue/Catalogue.js.map +1 -1
  14. package/dist/cli.d.ts +8 -9
  15. package/dist/cli.d.ts.map +1 -1
  16. package/dist/cli.js +188 -36
  17. package/dist/cli.js.map +1 -1
  18. package/dist/client/AccountService.d.ts.map +1 -1
  19. package/dist/client/AccountService.js.map +1 -1
  20. package/dist/client/ClientContext.d.ts +4 -0
  21. package/dist/client/ClientContext.d.ts.map +1 -1
  22. package/dist/client/ClientContext.js.map +1 -1
  23. package/dist/client/OfficialService.d.ts +35 -0
  24. package/dist/client/OfficialService.d.ts.map +1 -0
  25. package/dist/client/OfficialService.js +141 -0
  26. package/dist/client/OfficialService.js.map +1 -0
  27. package/dist/client/StoreService.d.ts +5 -1
  28. package/dist/client/StoreService.d.ts.map +1 -1
  29. package/dist/client/StoreService.js +59 -5
  30. package/dist/client/StoreService.js.map +1 -1
  31. package/dist/client/api.d.ts +31 -1
  32. package/dist/client/api.d.ts.map +1 -1
  33. package/dist/errors.d.ts +5 -1
  34. package/dist/errors.d.ts.map +1 -1
  35. package/dist/errors.js +8 -1
  36. package/dist/errors.js.map +1 -1
  37. package/dist/formatError.d.ts +10 -0
  38. package/dist/formatError.d.ts.map +1 -0
  39. package/dist/formatError.js +29 -0
  40. package/dist/formatError.js.map +1 -0
  41. package/dist/index.d.ts +7 -5
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +4 -2
  44. package/dist/index.js.map +1 -1
  45. package/dist/local/RiotSocket.d.ts.map +1 -1
  46. package/dist/local/RiotSocket.js.map +1 -1
  47. package/dist/mcp/McpServer.d.ts +21 -0
  48. package/dist/mcp/McpServer.d.ts.map +1 -0
  49. package/dist/mcp/McpServer.js +135 -0
  50. package/dist/mcp/McpServer.js.map +1 -0
  51. package/dist/mcp/index.d.ts +4 -0
  52. package/dist/mcp/index.d.ts.map +1 -0
  53. package/dist/mcp/index.js +3 -0
  54. package/dist/mcp/index.js.map +1 -0
  55. package/dist/mcp/tools.d.ts +9 -0
  56. package/dist/mcp/tools.d.ts.map +1 -0
  57. package/dist/mcp/tools.js +83 -0
  58. package/dist/mcp/tools.js.map +1 -0
  59. package/dist/mcp/types.d.ts +46 -0
  60. package/dist/mcp/types.d.ts.map +1 -0
  61. package/dist/mcp/types.js +2 -0
  62. package/dist/mcp/types.js.map +1 -0
  63. package/dist/model/index.d.ts +38 -0
  64. package/dist/model/index.d.ts.map +1 -1
  65. package/dist/official/OfficialApi.d.ts +35 -0
  66. package/dist/official/OfficialApi.d.ts.map +1 -0
  67. package/dist/official/OfficialApi.js +148 -0
  68. package/dist/official/OfficialApi.js.map +1 -0
  69. package/dist/official/OfficialMatchAdapter.d.ts +11 -0
  70. package/dist/official/OfficialMatchAdapter.d.ts.map +1 -0
  71. package/dist/official/OfficialMatchAdapter.js +157 -0
  72. package/dist/official/OfficialMatchAdapter.js.map +1 -0
  73. package/dist/official/RateLimiter.d.ts +20 -0
  74. package/dist/official/RateLimiter.d.ts.map +1 -0
  75. package/dist/official/RateLimiter.js +56 -0
  76. package/dist/official/RateLimiter.js.map +1 -0
  77. package/dist/official/types.d.ts +214 -0
  78. package/dist/official/types.d.ts.map +1 -0
  79. package/dist/official/types.js +2 -0
  80. package/dist/official/types.js.map +1 -0
  81. package/dist/raw.d.ts +4 -0
  82. package/dist/raw.d.ts.map +1 -1
  83. package/dist/raw.js +4 -0
  84. package/dist/raw.js.map +1 -1
  85. package/dist/riot/HttpGateway.d.ts.map +1 -1
  86. package/dist/riot/HttpGateway.js +9 -2
  87. package/dist/riot/HttpGateway.js.map +1 -1
  88. package/dist/riot/ResponseCache.d.ts +2 -0
  89. package/dist/riot/ResponseCache.d.ts.map +1 -1
  90. package/dist/riot/ResponseCache.js +8 -2
  91. package/dist/riot/ResponseCache.js.map +1 -1
  92. package/dist/serve/index.d.ts +1 -1
  93. package/dist/serve/index.d.ts.map +1 -1
  94. package/dist/serve/openapi.d.ts.map +1 -1
  95. package/dist/serve/openapi.js +11 -0
  96. package/dist/serve/openapi.js.map +1 -1
  97. package/dist/serve/routes.d.ts +4 -2
  98. package/dist/serve/routes.d.ts.map +1 -1
  99. package/dist/serve/routes.js +424 -0
  100. package/dist/serve/routes.js.map +1 -1
  101. package/dist/serve/server.js +1 -1
  102. package/dist/serve/server.js.map +1 -1
  103. package/dist/serve/types.d.ts +8 -0
  104. package/dist/serve/types.d.ts.map +1 -1
  105. package/dist/version.d.ts +2 -0
  106. package/dist/version.d.ts.map +1 -0
  107. package/dist/version.js +12 -0
  108. package/dist/version.js.map +1 -0
  109. package/dist/watch/MatchWatcher.d.ts.map +1 -1
  110. package/dist/watch/MatchWatcher.js.map +1 -1
  111. package/dist/watch/StoreWatcher.d.ts +27 -0
  112. package/dist/watch/StoreWatcher.d.ts.map +1 -0
  113. package/dist/watch/StoreWatcher.js +116 -0
  114. package/dist/watch/StoreWatcher.js.map +1 -0
  115. package/dist/watch/WebhookNotifier.d.ts +8 -0
  116. package/dist/watch/WebhookNotifier.d.ts.map +1 -0
  117. package/dist/watch/WebhookNotifier.js +42 -0
  118. package/dist/watch/WebhookNotifier.js.map +1 -0
  119. package/dist/watch/index.d.ts +9 -3
  120. package/dist/watch/index.d.ts.map +1 -1
  121. package/dist/watch/index.js +12 -1
  122. package/dist/watch/index.js.map +1 -1
  123. package/dist/watch/types.d.ts +17 -1
  124. package/dist/watch/types.d.ts.map +1 -1
  125. package/package.json +1 -1
  126. package/schema/OfficialAccount.json +25 -0
  127. package/schema/OfficialProfile.json +354 -0
  128. package/schema/Wishlist.json +35 -0
  129. package/schema/WishlistCheck.json +67 -0
  130. package/schema/WishlistHit.json +51 -0
@@ -23,6 +23,13 @@ export const ROUTE_DEFINITIONS = [
23
23
  path: "/api/account/ownedItems",
24
24
  summary: "Get owned inventory collection",
25
25
  responseSchema: "OwnedItems",
26
+ params: [
27
+ {
28
+ name: "language",
29
+ type: "string",
30
+ description: "Locale code for localized item names (e.g. en-US)",
31
+ },
32
+ ],
26
33
  },
27
34
  {
28
35
  method: "GET",
@@ -241,6 +248,13 @@ export const ROUTE_DEFINITIONS = [
241
248
  path: "/api/social/messages",
242
249
  summary: "Get chat messages",
243
250
  responseSchema: "Message",
251
+ params: [
252
+ {
253
+ name: "cid",
254
+ type: "string",
255
+ description: "Conversation ID to filter messages",
256
+ },
257
+ ],
244
258
  },
245
259
  {
246
260
  method: "GET",
@@ -249,6 +263,13 @@ export const ROUTE_DEFINITIONS = [
249
263
  path: "/api/social/participants",
250
264
  summary: "Get chat participants",
251
265
  responseSchema: "Participant",
266
+ params: [
267
+ {
268
+ name: "cid",
269
+ type: "string",
270
+ description: "Conversation ID to filter participants",
271
+ },
272
+ ],
252
273
  },
253
274
  {
254
275
  method: "POST",
@@ -321,6 +342,13 @@ export const ROUTE_DEFINITIONS = [
321
342
  path: "/api/store/current",
322
343
  summary: "Get current store offers and storefront",
323
344
  responseSchema: "Store",
345
+ params: [
346
+ {
347
+ name: "language",
348
+ type: "string",
349
+ description: "Locale code for localized item names",
350
+ },
351
+ ],
324
352
  },
325
353
  {
326
354
  method: "GET",
@@ -328,7 +356,15 @@ export const ROUTE_DEFINITIONS = [
328
356
  action: "store",
329
357
  path: "/api/store/store",
330
358
  summary: "Get storefront alias",
359
+ alias: true,
331
360
  responseSchema: "Store",
361
+ params: [
362
+ {
363
+ name: "language",
364
+ type: "string",
365
+ description: "Locale code for localized item names",
366
+ },
367
+ ],
332
368
  },
333
369
  {
334
370
  method: "GET",
@@ -345,6 +381,14 @@ export const ROUTE_DEFINITIONS = [
345
381
  path: "/api/store/order",
346
382
  summary: "Get store order details",
347
383
  responseSchema: "Order",
384
+ params: [
385
+ {
386
+ name: "id",
387
+ type: "string",
388
+ description: "Order ID",
389
+ required: true,
390
+ },
391
+ ],
348
392
  },
349
393
  {
350
394
  method: "GET",
@@ -353,6 +397,13 @@ export const ROUTE_DEFINITIONS = [
353
397
  path: "/api/store/history",
354
398
  summary: "Get recorded store rotation history",
355
399
  responseSchema: "StoreHistory",
400
+ params: [
401
+ {
402
+ name: "days",
403
+ type: "number",
404
+ description: "Number of past days to query",
405
+ },
406
+ ],
356
407
  },
357
408
  {
358
409
  method: "GET",
@@ -360,6 +411,14 @@ export const ROUTE_DEFINITIONS = [
360
411
  action: "seen",
361
412
  path: "/api/store/seen",
362
413
  summary: "Get when a skin was last seen in store",
414
+ params: [
415
+ {
416
+ name: "skin",
417
+ type: "string",
418
+ description: "Skin name or UUID to check",
419
+ required: true,
420
+ },
421
+ ],
363
422
  },
364
423
  {
365
424
  method: "POST",
@@ -378,6 +437,54 @@ export const ROUTE_DEFINITIONS = [
378
437
  isConfirmGated: true,
379
438
  responseSchema: "Order",
380
439
  },
440
+ {
441
+ method: "GET",
442
+ namespace: "store",
443
+ action: "wishlist",
444
+ path: "/api/store/wishlist",
445
+ summary: "Get current skin wishlist",
446
+ responseSchema: "Wishlist",
447
+ },
448
+ {
449
+ method: "GET",
450
+ namespace: "store",
451
+ action: "wishlistCheck",
452
+ path: "/api/store/wishlistCheck",
453
+ summary: "Check current store offers against wishlist",
454
+ responseSchema: "WishlistCheck",
455
+ },
456
+ {
457
+ method: "POST",
458
+ namespace: "store",
459
+ action: "wishlistAdd",
460
+ path: "/api/store/wishlistAdd",
461
+ summary: "Add skin to wishlist",
462
+ responseSchema: "Wishlist",
463
+ params: [
464
+ {
465
+ name: "skin",
466
+ type: "string",
467
+ description: "Skin name or UUID to add",
468
+ required: true,
469
+ },
470
+ ],
471
+ },
472
+ {
473
+ method: "POST",
474
+ namespace: "store",
475
+ action: "wishlistRemove",
476
+ path: "/api/store/wishlistRemove",
477
+ summary: "Remove skin from wishlist",
478
+ responseSchema: "Wishlist",
479
+ params: [
480
+ {
481
+ name: "skin",
482
+ type: "string",
483
+ description: "Skin name or UUID to remove",
484
+ required: true,
485
+ },
486
+ ],
487
+ },
381
488
  {
382
489
  method: "GET",
383
490
  namespace: "matches",
@@ -385,6 +492,18 @@ export const ROUTE_DEFINITIONS = [
385
492
  path: "/api/matches/list",
386
493
  summary: "List recent match summaries",
387
494
  responseSchema: "MatchSummary",
495
+ params: [
496
+ {
497
+ name: "count",
498
+ type: "number",
499
+ description: "Number of matches to return",
500
+ },
501
+ {
502
+ name: "queue",
503
+ type: "string",
504
+ description: "Match queue type (e.g. competitive, unrated)",
505
+ },
506
+ ],
388
507
  },
389
508
  {
390
509
  method: "GET",
@@ -392,7 +511,20 @@ export const ROUTE_DEFINITIONS = [
392
511
  action: "matches",
393
512
  path: "/api/matches/matches",
394
513
  summary: "List match summaries alias",
514
+ alias: true,
395
515
  responseSchema: "MatchSummary",
516
+ params: [
517
+ {
518
+ name: "count",
519
+ type: "number",
520
+ description: "Number of matches to return",
521
+ },
522
+ {
523
+ name: "queue",
524
+ type: "string",
525
+ description: "Match queue type (e.g. competitive, unrated)",
526
+ },
527
+ ],
396
528
  },
397
529
  {
398
530
  method: "GET",
@@ -401,6 +533,13 @@ export const ROUTE_DEFINITIONS = [
401
533
  path: "/api/matches/sync",
402
534
  summary: "Synchronize matches into cache",
403
535
  responseSchema: "MatchSyncResult",
536
+ params: [
537
+ {
538
+ name: "maxPages",
539
+ type: "number",
540
+ description: "Maximum number of history pages to fetch",
541
+ },
542
+ ],
404
543
  },
405
544
  {
406
545
  method: "GET",
@@ -409,6 +548,13 @@ export const ROUTE_DEFINITIONS = [
409
548
  path: "/api/matches/known",
410
549
  summary: "Get cached match summaries",
411
550
  responseSchema: "MatchSummary",
551
+ params: [
552
+ {
553
+ name: "puuid",
554
+ type: "string",
555
+ description: "Target player PUUID (defaults to signed-in player)",
556
+ },
557
+ ],
412
558
  },
413
559
  {
414
560
  method: "GET",
@@ -417,6 +563,14 @@ export const ROUTE_DEFINITIONS = [
417
563
  path: "/api/matches/get",
418
564
  summary: "Get full match details by ID",
419
565
  responseSchema: "Match",
566
+ params: [
567
+ {
568
+ name: "id",
569
+ type: "string",
570
+ description: "Match ID",
571
+ required: true,
572
+ },
573
+ ],
420
574
  },
421
575
  {
422
576
  method: "GET",
@@ -424,7 +578,16 @@ export const ROUTE_DEFINITIONS = [
424
578
  action: "match",
425
579
  path: "/api/matches/match",
426
580
  summary: "Get match details alias",
581
+ alias: true,
427
582
  responseSchema: "Match",
583
+ params: [
584
+ {
585
+ name: "id",
586
+ type: "string",
587
+ description: "Match ID",
588
+ required: true,
589
+ },
590
+ ],
428
591
  },
429
592
  {
430
593
  method: "GET",
@@ -441,6 +604,13 @@ export const ROUTE_DEFINITIONS = [
441
604
  path: "/api/matches/rankHistory",
442
605
  summary: "Get competitive rating updates",
443
606
  responseSchema: "RankChange",
607
+ params: [
608
+ {
609
+ name: "count",
610
+ type: "number",
611
+ description: "Number of rank updates to return",
612
+ },
613
+ ],
444
614
  },
445
615
  {
446
616
  method: "GET",
@@ -449,6 +619,18 @@ export const ROUTE_DEFINITIONS = [
449
619
  path: "/api/matches/live",
450
620
  summary: "Get live pregame or coregame lobby",
451
621
  responseSchema: "LiveMatch",
622
+ params: [
623
+ {
624
+ name: "ranks",
625
+ type: "boolean",
626
+ description: "Include player competitive ranks",
627
+ },
628
+ {
629
+ name: "loadouts",
630
+ type: "boolean",
631
+ description: "Include player loadout details",
632
+ },
633
+ ],
452
634
  },
453
635
  {
454
636
  method: "GET",
@@ -457,6 +639,24 @@ export const ROUTE_DEFINITIONS = [
457
639
  path: "/api/matches/listFor",
458
640
  summary: "List matches for specific player",
459
641
  responseSchema: "MatchSummary",
642
+ params: [
643
+ {
644
+ name: "puuid",
645
+ type: "string",
646
+ description: "Target player PUUID",
647
+ required: true,
648
+ },
649
+ {
650
+ name: "count",
651
+ type: "number",
652
+ description: "Number of matches to return",
653
+ },
654
+ {
655
+ name: "queue",
656
+ type: "string",
657
+ description: "Match queue type",
658
+ },
659
+ ],
460
660
  },
461
661
  {
462
662
  method: "GET",
@@ -465,6 +665,14 @@ export const ROUTE_DEFINITIONS = [
465
665
  path: "/api/matches/mmrFor",
466
666
  summary: "Get MMR for specific player",
467
667
  responseSchema: "Mmr",
668
+ params: [
669
+ {
670
+ name: "puuid",
671
+ type: "string",
672
+ description: "Target player PUUID",
673
+ required: true,
674
+ },
675
+ ],
468
676
  },
469
677
  {
470
678
  method: "GET",
@@ -473,6 +681,19 @@ export const ROUTE_DEFINITIONS = [
473
681
  path: "/api/matches/rankHistoryFor",
474
682
  summary: "Get rank history for player",
475
683
  responseSchema: "RankChange",
684
+ params: [
685
+ {
686
+ name: "puuid",
687
+ type: "string",
688
+ description: "Target player PUUID",
689
+ required: true,
690
+ },
691
+ {
692
+ name: "count",
693
+ type: "number",
694
+ description: "Number of rank updates to return",
695
+ },
696
+ ],
476
697
  },
477
698
  {
478
699
  method: "GET",
@@ -481,6 +702,28 @@ export const ROUTE_DEFINITIONS = [
481
702
  path: "/api/matches/leaderboard",
482
703
  summary: "Get competitive leaderboard",
483
704
  responseSchema: "Leaderboard",
705
+ params: [
706
+ {
707
+ name: "season",
708
+ type: "string",
709
+ description: "Season or act UUID",
710
+ },
711
+ {
712
+ name: "start",
713
+ type: "number",
714
+ description: "Starting rank offset (0-indexed)",
715
+ },
716
+ {
717
+ name: "size",
718
+ type: "number",
719
+ description: "Number of players to return",
720
+ },
721
+ {
722
+ name: "query",
723
+ type: "string",
724
+ description: "Search query for player name",
725
+ },
726
+ ],
484
727
  },
485
728
  {
486
729
  method: "GET",
@@ -505,6 +748,18 @@ export const ROUTE_DEFINITIONS = [
505
748
  path: "/api/matches/trend",
506
749
  summary: "Get competitive rating trend",
507
750
  responseSchema: "RatingTrend",
751
+ params: [
752
+ {
753
+ name: "count",
754
+ type: "number",
755
+ description: "Number of matches to evaluate",
756
+ },
757
+ {
758
+ name: "puuid",
759
+ type: "string",
760
+ description: "Target player PUUID",
761
+ },
762
+ ],
508
763
  },
509
764
  {
510
765
  method: "GET",
@@ -513,6 +768,23 @@ export const ROUTE_DEFINITIONS = [
513
768
  path: "/api/matches/summary",
514
769
  summary: "Get recent performance summary",
515
770
  responseSchema: "PerformanceSummary",
771
+ params: [
772
+ {
773
+ name: "count",
774
+ type: "number",
775
+ description: "Number of matches to summarize",
776
+ },
777
+ {
778
+ name: "queue",
779
+ type: "string",
780
+ description: "Match queue type",
781
+ },
782
+ {
783
+ name: "puuid",
784
+ type: "string",
785
+ description: "Target player PUUID",
786
+ },
787
+ ],
516
788
  },
517
789
  {
518
790
  method: "GET",
@@ -521,6 +793,13 @@ export const ROUTE_DEFINITIONS = [
521
793
  path: "/api/matches/assess",
522
794
  summary: "Assess player rank anomalies",
523
795
  responseSchema: "PlayerAssessment",
796
+ params: [
797
+ {
798
+ name: "puuid",
799
+ type: "string",
800
+ description: "Target player PUUID (defaults to signed-in player)",
801
+ },
802
+ ],
524
803
  },
525
804
  {
526
805
  method: "POST",
@@ -568,6 +847,7 @@ export const ROUTE_DEFINITIONS = [
568
847
  action: "party",
569
848
  path: "/api/party/party",
570
849
  summary: "Get party alias",
850
+ alias: true,
571
851
  responseSchema: "Party",
572
852
  },
573
853
  {
@@ -799,6 +1079,107 @@ export const ROUTE_DEFINITIONS = [
799
1079
  summary: "Refresh party state",
800
1080
  responseSchema: "Party",
801
1081
  },
1082
+ {
1083
+ method: "GET",
1084
+ namespace: "official",
1085
+ action: "account",
1086
+ path: "/api/official/account",
1087
+ summary: "Resolve any player's account and shard through Riot's official API",
1088
+ responseSchema: "OfficialAccount",
1089
+ params: [
1090
+ { name: "riotId", type: "string", description: "Riot ID as Name#Tag", required: true },
1091
+ ],
1092
+ },
1093
+ {
1094
+ method: "GET",
1095
+ namespace: "official",
1096
+ action: "matches",
1097
+ path: "/api/official/matches",
1098
+ summary: "Recent match summaries of any player through Riot's official API",
1099
+ responseSchema: "MatchSummary",
1100
+ params: [
1101
+ { name: "riotId", type: "string", description: "Riot ID as Name#Tag", required: true },
1102
+ { name: "queue", type: "string", description: "Queue id filter, e.g. competitive" },
1103
+ { name: "count", type: "number", description: "Number of matches, default 10" },
1104
+ ],
1105
+ },
1106
+ {
1107
+ method: "GET",
1108
+ namespace: "official",
1109
+ action: "match",
1110
+ path: "/api/official/match",
1111
+ summary: "Full match details through Riot's official API",
1112
+ responseSchema: "Match",
1113
+ params: [
1114
+ { name: "matchId", type: "string", description: "Match id", required: true },
1115
+ {
1116
+ name: "shard",
1117
+ type: "string",
1118
+ description: "Shard: na, latam, br, eu, ap or kr",
1119
+ required: true,
1120
+ },
1121
+ { name: "self", type: "string", description: "Puuid whose point of view to use" },
1122
+ ],
1123
+ },
1124
+ {
1125
+ method: "GET",
1126
+ namespace: "official",
1127
+ action: "summary",
1128
+ path: "/api/official/summary",
1129
+ summary: "Performance summary of any player through Riot's official API",
1130
+ responseSchema: "PerformanceSummary",
1131
+ params: [
1132
+ { name: "riotId", type: "string", description: "Riot ID as Name#Tag", required: true },
1133
+ { name: "queue", type: "string", description: "Queue id, default competitive" },
1134
+ { name: "count", type: "number", description: "Number of matches, default 10" },
1135
+ ],
1136
+ },
1137
+ {
1138
+ method: "GET",
1139
+ namespace: "official",
1140
+ action: "profile",
1141
+ path: "/api/official/profile",
1142
+ summary: "Level, rank and performance of any player through Riot's official API",
1143
+ responseSchema: "OfficialProfile",
1144
+ params: [
1145
+ { name: "riotId", type: "string", description: "Riot ID as Name#Tag", required: true },
1146
+ { name: "count", type: "number", description: "Number of matches, default 10" },
1147
+ ],
1148
+ },
1149
+ {
1150
+ method: "GET",
1151
+ namespace: "official",
1152
+ action: "leaderboard",
1153
+ path: "/api/official/leaderboard",
1154
+ summary: "Ranked leaderboard of a shard through Riot's official API",
1155
+ responseSchema: "Leaderboard",
1156
+ params: [
1157
+ {
1158
+ name: "shard",
1159
+ type: "string",
1160
+ description: "Shard: na, latam, br, eu, ap or kr",
1161
+ required: true,
1162
+ },
1163
+ { name: "act", type: "string", description: "Act id, default the active act" },
1164
+ { name: "start", type: "number", description: "Start index, default 0" },
1165
+ { name: "size", type: "number", description: "Page size, default 50" },
1166
+ ],
1167
+ },
1168
+ {
1169
+ method: "GET",
1170
+ namespace: "official",
1171
+ action: "status",
1172
+ path: "/api/official/status",
1173
+ summary: "Platform status of a shard through Riot's official API",
1174
+ params: [
1175
+ {
1176
+ name: "shard",
1177
+ type: "string",
1178
+ description: "Shard: na, latam, br, eu, ap or kr",
1179
+ required: true,
1180
+ },
1181
+ ],
1182
+ },
802
1183
  ];
803
1184
  function isDryRun(query, body, headers) {
804
1185
  if (query.dryRun !== undefined) {
@@ -1000,6 +1381,14 @@ export async function dispatchApiRoute(client, namespace, methodName, query, bod
1000
1381
  ? client.store.validateBuy(target, { confirm: true })
1001
1382
  : client.store.buy(target, { confirm: true });
1002
1383
  }
1384
+ case "wishlist":
1385
+ return client.store.wishlist();
1386
+ case "wishlistCheck":
1387
+ return client.store.wishlistCheck();
1388
+ case "wishlistAdd":
1389
+ return client.store.wishlistAdd(String(body.skin ?? query.skin));
1390
+ case "wishlistRemove":
1391
+ return client.store.wishlistRemove(String(body.skin ?? query.skin));
1003
1392
  }
1004
1393
  }
1005
1394
  if (namespace === "matches") {
@@ -1202,6 +1591,41 @@ export async function dispatchApiRoute(client, namespace, methodName, query, bod
1202
1591
  return dryRun ? client.party.validateRefresh() : client.party.refresh();
1203
1592
  }
1204
1593
  }
1594
+ const official = namespace === "official" && dispatchOfficialRoute(client, normMethod, query);
1595
+ if (official)
1596
+ return official;
1205
1597
  throw new ValidationError("route-not-found", `Unknown endpoint: ${req.method} /api/${namespace}/${methodName}`);
1206
1598
  }
1599
+ function optionalNumber(value) {
1600
+ return value === undefined ? undefined : Number(value);
1601
+ }
1602
+ function dispatchOfficialRoute(client, method, query) {
1603
+ const count = optionalNumber(query.count);
1604
+ switch (method) {
1605
+ case "account":
1606
+ return client.official.account(query.riotId ?? "");
1607
+ case "matches":
1608
+ return client.official.matches(query.riotId ?? "", { queue: query.queue, count });
1609
+ case "match":
1610
+ return client.official.match(query.matchId ?? "", {
1611
+ shard: query.shard ?? "",
1612
+ self: query.self,
1613
+ });
1614
+ case "summary":
1615
+ return client.official.summary(query.riotId ?? "", { queue: query.queue, count });
1616
+ case "profile":
1617
+ return client.official.profile(query.riotId ?? "", { count });
1618
+ case "leaderboard":
1619
+ return client.official.leaderboard({
1620
+ shard: query.shard ?? "",
1621
+ act: query.act,
1622
+ start: optionalNumber(query.start),
1623
+ size: optionalNumber(query.size),
1624
+ });
1625
+ case "status":
1626
+ return client.official.status(query.shard ?? "");
1627
+ default:
1628
+ return undefined;
1629
+ }
1630
+ }
1207
1631
  //# sourceMappingURL=routes.js.map