@valoranchi/riot-client 0.3.0 → 0.4.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 (184) hide show
  1. package/README.md +6 -1
  2. package/dist/RiotClient.d.ts +4 -0
  3. package/dist/RiotClient.d.ts.map +1 -1
  4. package/dist/RiotClient.js +12 -3
  5. package/dist/RiotClient.js.map +1 -1
  6. package/dist/analysis/collectionValue.d.ts +4 -0
  7. package/dist/analysis/collectionValue.d.ts.map +1 -0
  8. package/dist/analysis/collectionValue.js +119 -0
  9. package/dist/analysis/collectionValue.js.map +1 -0
  10. package/dist/analysis/loadoutDiff.d.ts +6 -0
  11. package/dist/analysis/loadoutDiff.d.ts.map +1 -0
  12. package/dist/analysis/loadoutDiff.js +258 -0
  13. package/dist/analysis/loadoutDiff.js.map +1 -0
  14. package/dist/analysis/matchSync.d.ts +8 -0
  15. package/dist/analysis/matchSync.d.ts.map +1 -0
  16. package/dist/analysis/matchSync.js +66 -0
  17. package/dist/analysis/matchSync.js.map +1 -0
  18. package/dist/analysis/performanceSummary.d.ts +4 -0
  19. package/dist/analysis/performanceSummary.d.ts.map +1 -0
  20. package/dist/analysis/performanceSummary.js +184 -0
  21. package/dist/analysis/performanceSummary.js.map +1 -0
  22. package/dist/analysis/playerAssessment.d.ts +10 -0
  23. package/dist/analysis/playerAssessment.d.ts.map +1 -0
  24. package/dist/analysis/playerAssessment.js +47 -0
  25. package/dist/analysis/playerAssessment.js.map +1 -0
  26. package/dist/analysis/ratingTrend.d.ts +5 -0
  27. package/dist/analysis/ratingTrend.d.ts.map +1 -0
  28. package/dist/analysis/ratingTrend.js +70 -0
  29. package/dist/analysis/ratingTrend.js.map +1 -0
  30. package/dist/analysis/storeHistory.d.ts +6 -0
  31. package/dist/analysis/storeHistory.d.ts.map +1 -0
  32. package/dist/analysis/storeHistory.js +74 -0
  33. package/dist/analysis/storeHistory.js.map +1 -0
  34. package/dist/bin.js +3 -1
  35. package/dist/bin.js.map +1 -1
  36. package/dist/catalogue/Catalogue.d.ts.map +1 -1
  37. package/dist/catalogue/Catalogue.js.map +1 -1
  38. package/dist/catalogue/ValorantApi.d.ts.map +1 -1
  39. package/dist/catalogue/ValorantApi.js +1 -1
  40. package/dist/catalogue/ValorantApi.js.map +1 -1
  41. package/dist/cli.d.ts +8 -1
  42. package/dist/cli.d.ts.map +1 -1
  43. package/dist/cli.js +192 -19
  44. package/dist/cli.js.map +1 -1
  45. package/dist/client/AccountService.d.ts +6 -1
  46. package/dist/client/AccountService.d.ts.map +1 -1
  47. package/dist/client/AccountService.js +39 -4
  48. package/dist/client/AccountService.js.map +1 -1
  49. package/dist/client/AccountValidator.d.ts.map +1 -1
  50. package/dist/client/AccountValidator.js +9 -3
  51. package/dist/client/AccountValidator.js.map +1 -1
  52. package/dist/client/ChatValidator.d.ts.map +1 -1
  53. package/dist/client/ChatValidator.js +2 -4
  54. package/dist/client/ChatValidator.js.map +1 -1
  55. package/dist/client/ClientContext.d.ts +1 -0
  56. package/dist/client/ClientContext.d.ts.map +1 -1
  57. package/dist/client/ClientContext.js.map +1 -1
  58. package/dist/client/LiveMatchService.d.ts +1 -1
  59. package/dist/client/LiveMatchService.d.ts.map +1 -1
  60. package/dist/client/LiveMatchService.js +30 -20
  61. package/dist/client/LiveMatchService.js.map +1 -1
  62. package/dist/client/LoadoutValidator.d.ts.map +1 -1
  63. package/dist/client/LoadoutValidator.js +1 -3
  64. package/dist/client/LoadoutValidator.js.map +1 -1
  65. package/dist/client/MatchService.d.ts +17 -1
  66. package/dist/client/MatchService.d.ts.map +1 -1
  67. package/dist/client/MatchService.js +123 -2
  68. package/dist/client/MatchService.js.map +1 -1
  69. package/dist/client/MatchValidator.d.ts.map +1 -1
  70. package/dist/client/MatchValidator.js.map +1 -1
  71. package/dist/client/PartyService.d.ts.map +1 -1
  72. package/dist/client/PartyService.js +3 -1
  73. package/dist/client/PartyService.js.map +1 -1
  74. package/dist/client/PartyValidator.d.ts.map +1 -1
  75. package/dist/client/PartyValidator.js +1 -2
  76. package/dist/client/PartyValidator.js.map +1 -1
  77. package/dist/client/SocialService.d.ts.map +1 -1
  78. package/dist/client/SocialService.js +4 -5
  79. package/dist/client/SocialService.js.map +1 -1
  80. package/dist/client/StoreService.d.ts +5 -1
  81. package/dist/client/StoreService.d.ts.map +1 -1
  82. package/dist/client/StoreService.js +36 -2
  83. package/dist/client/StoreService.js.map +1 -1
  84. package/dist/client/StoreValidator.d.ts.map +1 -1
  85. package/dist/client/StoreValidator.js +4 -2
  86. package/dist/client/StoreValidator.js.map +1 -1
  87. package/dist/client/api.d.ts +25 -1
  88. package/dist/client/api.d.ts.map +1 -1
  89. package/dist/collection/CustomGameConfigsBuilder.d.ts.map +1 -1
  90. package/dist/collection/CustomGameConfigsBuilder.js.map +1 -1
  91. package/dist/collection/LiveMatchBuilder.d.ts +2 -2
  92. package/dist/collection/LiveMatchBuilder.d.ts.map +1 -1
  93. package/dist/collection/LiveMatchBuilder.js +10 -8
  94. package/dist/collection/LiveMatchBuilder.js.map +1 -1
  95. package/dist/collection/LoadoutBuilder.d.ts.map +1 -1
  96. package/dist/collection/LoadoutBuilder.js +1 -1
  97. package/dist/collection/LoadoutBuilder.js.map +1 -1
  98. package/dist/collection/LoadoutWriter.d.ts.map +1 -1
  99. package/dist/collection/LoadoutWriter.js +0 -1
  100. package/dist/collection/LoadoutWriter.js.map +1 -1
  101. package/dist/collection/MmrBuilder.d.ts +1 -1
  102. package/dist/collection/MmrBuilder.d.ts.map +1 -1
  103. package/dist/collection/MmrBuilder.js +5 -2
  104. package/dist/collection/MmrBuilder.js.map +1 -1
  105. package/dist/collection/PlayerSettingsBuilder.d.ts.map +1 -1
  106. package/dist/collection/PlayerSettingsBuilder.js +1 -3
  107. package/dist/collection/PlayerSettingsBuilder.js.map +1 -1
  108. package/dist/collection/RankFit.d.ts +11 -0
  109. package/dist/collection/RankFit.d.ts.map +1 -0
  110. package/dist/collection/RankFit.js +56 -0
  111. package/dist/collection/RankFit.js.map +1 -0
  112. package/dist/index.d.ts +11 -2
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/index.js +10 -1
  115. package/dist/index.js.map +1 -1
  116. package/dist/local/ChatApi.d.ts.map +1 -1
  117. package/dist/local/ChatApi.js +3 -1
  118. package/dist/local/ChatApi.js.map +1 -1
  119. package/dist/model/index.d.ts +163 -0
  120. package/dist/model/index.d.ts.map +1 -1
  121. package/dist/riot/ResponseCache.d.ts.map +1 -1
  122. package/dist/riot/ResponseCache.js +1 -3
  123. package/dist/riot/ResponseCache.js.map +1 -1
  124. package/dist/riot/RiotApi.d.ts.map +1 -1
  125. package/dist/riot/RiotApi.js.map +1 -1
  126. package/dist/riot/types.d.ts.map +1 -1
  127. package/dist/serve/index.d.ts +7 -0
  128. package/dist/serve/index.d.ts.map +1 -0
  129. package/dist/serve/index.js +6 -0
  130. package/dist/serve/index.js.map +1 -0
  131. package/dist/serve/indexHtml.d.ts +2 -0
  132. package/dist/serve/indexHtml.d.ts.map +1 -0
  133. package/dist/serve/indexHtml.js +36 -0
  134. package/dist/serve/indexHtml.js.map +1 -0
  135. package/dist/serve/openapi.d.ts +2 -0
  136. package/dist/serve/openapi.d.ts.map +1 -0
  137. package/dist/serve/openapi.js +114 -0
  138. package/dist/serve/openapi.js.map +1 -0
  139. package/dist/serve/routes.d.ts +7 -0
  140. package/dist/serve/routes.d.ts.map +1 -0
  141. package/dist/serve/routes.js +1207 -0
  142. package/dist/serve/routes.js.map +1 -0
  143. package/dist/serve/server.d.ts +6 -0
  144. package/dist/serve/server.d.ts.map +1 -0
  145. package/dist/serve/server.js +149 -0
  146. package/dist/serve/server.js.map +1 -0
  147. package/dist/serve/sse.d.ts +4 -0
  148. package/dist/serve/sse.d.ts.map +1 -0
  149. package/dist/serve/sse.js +89 -0
  150. package/dist/serve/sse.js.map +1 -0
  151. package/dist/serve/types.d.ts +24 -0
  152. package/dist/serve/types.d.ts.map +1 -0
  153. package/dist/serve/types.js +2 -0
  154. package/dist/serve/types.js.map +1 -0
  155. package/dist/watch/AsyncQueue.d.ts +13 -0
  156. package/dist/watch/AsyncQueue.d.ts.map +1 -0
  157. package/dist/watch/AsyncQueue.js +50 -0
  158. package/dist/watch/AsyncQueue.js.map +1 -0
  159. package/dist/watch/FriendsWatcher.d.ts +26 -0
  160. package/dist/watch/FriendsWatcher.d.ts.map +1 -0
  161. package/dist/watch/FriendsWatcher.js +152 -0
  162. package/dist/watch/FriendsWatcher.js.map +1 -0
  163. package/dist/watch/MatchWatcher.d.ts +44 -0
  164. package/dist/watch/MatchWatcher.d.ts.map +1 -0
  165. package/dist/watch/MatchWatcher.js +272 -0
  166. package/dist/watch/MatchWatcher.js.map +1 -0
  167. package/dist/watch/index.d.ts +20 -0
  168. package/dist/watch/index.d.ts.map +1 -0
  169. package/dist/watch/index.js +20 -0
  170. package/dist/watch/index.js.map +1 -0
  171. package/dist/watch/types.d.ts +98 -0
  172. package/dist/watch/types.d.ts.map +1 -0
  173. package/dist/watch/types.js +2 -0
  174. package/dist/watch/types.js.map +1 -0
  175. package/package.json +17 -5
  176. package/schema/CollectionValue.json +153 -0
  177. package/schema/LiveMatch.json +8 -1
  178. package/schema/LoadoutDiff.json +73 -0
  179. package/schema/MatchSyncResult.json +54 -0
  180. package/schema/Mmr.json +38 -1
  181. package/schema/PerformanceSummary.json +284 -0
  182. package/schema/PlayerAssessment.json +48 -0
  183. package/schema/RatingTrend.json +107 -0
  184. package/schema/StoreHistory.json +61 -0
@@ -0,0 +1,1207 @@
1
+ import { ValidationError } from "../errors.js";
2
+ export const CONFIRM_GATED_ROUTES = new Set([
3
+ "matches/dodge",
4
+ "matches/leaveMatch",
5
+ "matches/leave-match",
6
+ "store/buy",
7
+ "account/saveSettings",
8
+ "account/settings-save",
9
+ ]);
10
+ export const ROUTE_DEFINITIONS = [
11
+ {
12
+ method: "GET",
13
+ namespace: "account",
14
+ action: "whoami",
15
+ path: "/api/account/whoami",
16
+ summary: "Get signed-in player profile",
17
+ responseSchema: "Player",
18
+ },
19
+ {
20
+ method: "GET",
21
+ namespace: "account",
22
+ action: "ownedItems",
23
+ path: "/api/account/ownedItems",
24
+ summary: "Get owned inventory collection",
25
+ responseSchema: "OwnedItems",
26
+ },
27
+ {
28
+ method: "GET",
29
+ namespace: "account",
30
+ action: "loadout",
31
+ path: "/api/account/loadout",
32
+ summary: "Get currently equipped loadout",
33
+ responseSchema: "Loadout",
34
+ },
35
+ {
36
+ method: "GET",
37
+ namespace: "account",
38
+ action: "collectionValue",
39
+ path: "/api/account/collectionValue",
40
+ summary: "Calculate estimated value of inventory",
41
+ responseSchema: "CollectionValue",
42
+ },
43
+ {
44
+ method: "GET",
45
+ namespace: "account",
46
+ action: "wallet",
47
+ path: "/api/account/wallet",
48
+ summary: "Get currency balances",
49
+ responseSchema: "Wallet",
50
+ },
51
+ {
52
+ method: "GET",
53
+ namespace: "account",
54
+ action: "xp",
55
+ path: "/api/account/xp",
56
+ summary: "Get account level and XP progression",
57
+ responseSchema: "AccountXp",
58
+ },
59
+ {
60
+ method: "GET",
61
+ namespace: "account",
62
+ action: "contracts",
63
+ path: "/api/account/contracts",
64
+ summary: "Get agent and battlepass contracts progress",
65
+ responseSchema: "ContractProgress",
66
+ },
67
+ {
68
+ method: "GET",
69
+ namespace: "account",
70
+ action: "missions",
71
+ path: "/api/account/missions",
72
+ summary: "Get daily and weekly missions",
73
+ responseSchema: "Mission",
74
+ },
75
+ {
76
+ method: "GET",
77
+ namespace: "account",
78
+ action: "penalties",
79
+ path: "/api/account/penalties",
80
+ summary: "Get active account penalties",
81
+ responseSchema: "Penalty",
82
+ },
83
+ {
84
+ method: "GET",
85
+ namespace: "account",
86
+ action: "favourites",
87
+ path: "/api/account/favourites",
88
+ summary: "Get favorited skins",
89
+ responseSchema: "Favourite",
90
+ },
91
+ {
92
+ method: "GET",
93
+ namespace: "account",
94
+ action: "session",
95
+ path: "/api/account/session",
96
+ summary: "Get client session loop state",
97
+ responseSchema: "GameSession",
98
+ },
99
+ {
100
+ method: "GET",
101
+ namespace: "account",
102
+ action: "config",
103
+ path: "/api/account/config",
104
+ summary: "Get shared client configuration",
105
+ },
106
+ {
107
+ method: "GET",
108
+ namespace: "account",
109
+ action: "settings",
110
+ path: "/api/account/settings",
111
+ summary: "Get cloud player settings",
112
+ responseSchema: "PlayerSettings",
113
+ },
114
+ {
115
+ method: "GET",
116
+ namespace: "account",
117
+ action: "client",
118
+ path: "/api/account/client",
119
+ summary: "Get client identity and locale",
120
+ responseSchema: "ClientInfo",
121
+ },
122
+ {
123
+ method: "GET",
124
+ namespace: "account",
125
+ action: "exportLoadout",
126
+ path: "/api/account/exportLoadout",
127
+ summary: "Export loadout as preset",
128
+ },
129
+ {
130
+ method: "POST",
131
+ namespace: "account",
132
+ action: "equip",
133
+ path: "/api/account/equip",
134
+ summary: "Equip skins, buddies, sprays, or cards",
135
+ responseSchema: "Loadout",
136
+ },
137
+ {
138
+ method: "POST",
139
+ namespace: "account",
140
+ action: "equipCollection",
141
+ path: "/api/account/equipCollection",
142
+ summary: "Equip a skin collection",
143
+ responseSchema: "Loadout",
144
+ },
145
+ {
146
+ method: "POST",
147
+ namespace: "account",
148
+ action: "equipPreset",
149
+ path: "/api/account/equipPreset",
150
+ summary: "Equip a full loadout preset",
151
+ responseSchema: "Loadout",
152
+ },
153
+ {
154
+ method: "POST",
155
+ namespace: "account",
156
+ action: "diffLoadout",
157
+ path: "/api/account/diffLoadout",
158
+ summary: "Compare loadout against preset",
159
+ responseSchema: "LoadoutDiff",
160
+ },
161
+ {
162
+ method: "POST",
163
+ namespace: "account",
164
+ action: "activateContract",
165
+ path: "/api/account/activateContract",
166
+ summary: "Activate an agent contract",
167
+ },
168
+ {
169
+ method: "POST",
170
+ namespace: "account",
171
+ action: "addFavourite",
172
+ path: "/api/account/addFavourite",
173
+ summary: "Add skin to favourites",
174
+ },
175
+ {
176
+ method: "POST",
177
+ namespace: "account",
178
+ action: "removeFavourite",
179
+ path: "/api/account/removeFavourite",
180
+ summary: "Remove skin from favourites",
181
+ },
182
+ {
183
+ method: "POST",
184
+ namespace: "account",
185
+ action: "setActRankBadgeHidden",
186
+ path: "/api/account/setActRankBadgeHidden",
187
+ summary: "Hide or show act rank badge",
188
+ },
189
+ {
190
+ method: "POST",
191
+ namespace: "account",
192
+ action: "setLeaderboardAnonymized",
193
+ path: "/api/account/setLeaderboardAnonymized",
194
+ summary: "Anonymize or reveal leaderboard presence",
195
+ },
196
+ {
197
+ method: "POST",
198
+ namespace: "account",
199
+ action: "saveSettings",
200
+ path: "/api/account/saveSettings",
201
+ summary: "Save cloud player settings",
202
+ isConfirmGated: true,
203
+ responseSchema: "PlayerSettings",
204
+ },
205
+ {
206
+ method: "GET",
207
+ namespace: "social",
208
+ action: "friends",
209
+ path: "/api/social/friends",
210
+ summary: "Get friends list and presence",
211
+ responseSchema: "Friend",
212
+ },
213
+ {
214
+ method: "GET",
215
+ namespace: "social",
216
+ action: "friendRequests",
217
+ path: "/api/social/friendRequests",
218
+ summary: "Get friend requests",
219
+ responseSchema: "FriendRequest",
220
+ },
221
+ {
222
+ method: "GET",
223
+ namespace: "social",
224
+ action: "blocked",
225
+ path: "/api/social/blocked",
226
+ summary: "Get blocked players",
227
+ responseSchema: "BlockedPlayer",
228
+ },
229
+ {
230
+ method: "GET",
231
+ namespace: "social",
232
+ action: "conversations",
233
+ path: "/api/social/conversations",
234
+ summary: "Get chat conversations",
235
+ responseSchema: "Conversation",
236
+ },
237
+ {
238
+ method: "GET",
239
+ namespace: "social",
240
+ action: "messages",
241
+ path: "/api/social/messages",
242
+ summary: "Get chat messages",
243
+ responseSchema: "Message",
244
+ },
245
+ {
246
+ method: "GET",
247
+ namespace: "social",
248
+ action: "participants",
249
+ path: "/api/social/participants",
250
+ summary: "Get chat participants",
251
+ responseSchema: "Participant",
252
+ },
253
+ {
254
+ method: "POST",
255
+ namespace: "social",
256
+ action: "sendMessage",
257
+ path: "/api/social/sendMessage",
258
+ summary: "Send a chat message",
259
+ responseSchema: "Message",
260
+ },
261
+ {
262
+ method: "POST",
263
+ namespace: "social",
264
+ action: "sendFriendRequest",
265
+ path: "/api/social/sendFriendRequest",
266
+ summary: "Send a friend request",
267
+ responseSchema: "FriendRequest",
268
+ },
269
+ {
270
+ method: "POST",
271
+ namespace: "social",
272
+ action: "acceptFriendRequest",
273
+ path: "/api/social/acceptFriendRequest",
274
+ summary: "Accept a friend request",
275
+ responseSchema: "Friend",
276
+ },
277
+ {
278
+ method: "POST",
279
+ namespace: "social",
280
+ action: "declineFriendRequest",
281
+ path: "/api/social/declineFriendRequest",
282
+ summary: "Decline a friend request",
283
+ responseSchema: "FriendRequest",
284
+ },
285
+ {
286
+ method: "POST",
287
+ namespace: "social",
288
+ action: "cancelFriendRequest",
289
+ path: "/api/social/cancelFriendRequest",
290
+ summary: "Cancel an outgoing friend request",
291
+ responseSchema: "FriendRequest",
292
+ },
293
+ {
294
+ method: "POST",
295
+ namespace: "social",
296
+ action: "removeFriend",
297
+ path: "/api/social/removeFriend",
298
+ summary: "Remove a friend",
299
+ responseSchema: "Friend",
300
+ },
301
+ {
302
+ method: "POST",
303
+ namespace: "social",
304
+ action: "blockPlayer",
305
+ path: "/api/social/blockPlayer",
306
+ summary: "Block a player",
307
+ responseSchema: "BlockedPlayer",
308
+ },
309
+ {
310
+ method: "POST",
311
+ namespace: "social",
312
+ action: "unblockPlayer",
313
+ path: "/api/social/unblockPlayer",
314
+ summary: "Unblock a player",
315
+ responseSchema: "BlockedPlayer",
316
+ },
317
+ {
318
+ method: "GET",
319
+ namespace: "store",
320
+ action: "current",
321
+ path: "/api/store/current",
322
+ summary: "Get current store offers and storefront",
323
+ responseSchema: "Store",
324
+ },
325
+ {
326
+ method: "GET",
327
+ namespace: "store",
328
+ action: "store",
329
+ path: "/api/store/store",
330
+ summary: "Get storefront alias",
331
+ responseSchema: "Store",
332
+ },
333
+ {
334
+ method: "GET",
335
+ namespace: "store",
336
+ action: "offers",
337
+ path: "/api/store/offers",
338
+ summary: "Get all item offers and pricing",
339
+ responseSchema: "Offer",
340
+ },
341
+ {
342
+ method: "GET",
343
+ namespace: "store",
344
+ action: "order",
345
+ path: "/api/store/order",
346
+ summary: "Get store order details",
347
+ responseSchema: "Order",
348
+ },
349
+ {
350
+ method: "GET",
351
+ namespace: "store",
352
+ action: "history",
353
+ path: "/api/store/history",
354
+ summary: "Get recorded store rotation history",
355
+ responseSchema: "StoreHistory",
356
+ },
357
+ {
358
+ method: "GET",
359
+ namespace: "store",
360
+ action: "seen",
361
+ path: "/api/store/seen",
362
+ summary: "Get when a skin was last seen in store",
363
+ },
364
+ {
365
+ method: "POST",
366
+ namespace: "store",
367
+ action: "revealNightMarket",
368
+ path: "/api/store/revealNightMarket",
369
+ summary: "Reveal night market cards",
370
+ responseSchema: "Store",
371
+ },
372
+ {
373
+ method: "POST",
374
+ namespace: "store",
375
+ action: "buy",
376
+ path: "/api/store/buy",
377
+ summary: "Purchase store offer or bundle",
378
+ isConfirmGated: true,
379
+ responseSchema: "Order",
380
+ },
381
+ {
382
+ method: "GET",
383
+ namespace: "matches",
384
+ action: "list",
385
+ path: "/api/matches/list",
386
+ summary: "List recent match summaries",
387
+ responseSchema: "MatchSummary",
388
+ },
389
+ {
390
+ method: "GET",
391
+ namespace: "matches",
392
+ action: "matches",
393
+ path: "/api/matches/matches",
394
+ summary: "List match summaries alias",
395
+ responseSchema: "MatchSummary",
396
+ },
397
+ {
398
+ method: "GET",
399
+ namespace: "matches",
400
+ action: "sync",
401
+ path: "/api/matches/sync",
402
+ summary: "Synchronize matches into cache",
403
+ responseSchema: "MatchSyncResult",
404
+ },
405
+ {
406
+ method: "GET",
407
+ namespace: "matches",
408
+ action: "known",
409
+ path: "/api/matches/known",
410
+ summary: "Get cached match summaries",
411
+ responseSchema: "MatchSummary",
412
+ },
413
+ {
414
+ method: "GET",
415
+ namespace: "matches",
416
+ action: "get",
417
+ path: "/api/matches/get",
418
+ summary: "Get full match details by ID",
419
+ responseSchema: "Match",
420
+ },
421
+ {
422
+ method: "GET",
423
+ namespace: "matches",
424
+ action: "match",
425
+ path: "/api/matches/match",
426
+ summary: "Get match details alias",
427
+ responseSchema: "Match",
428
+ },
429
+ {
430
+ method: "GET",
431
+ namespace: "matches",
432
+ action: "mmr",
433
+ path: "/api/matches/mmr",
434
+ summary: "Get current MMR and rating",
435
+ responseSchema: "Mmr",
436
+ },
437
+ {
438
+ method: "GET",
439
+ namespace: "matches",
440
+ action: "rankHistory",
441
+ path: "/api/matches/rankHistory",
442
+ summary: "Get competitive rating updates",
443
+ responseSchema: "RankChange",
444
+ },
445
+ {
446
+ method: "GET",
447
+ namespace: "matches",
448
+ action: "live",
449
+ path: "/api/matches/live",
450
+ summary: "Get live pregame or coregame lobby",
451
+ responseSchema: "LiveMatch",
452
+ },
453
+ {
454
+ method: "GET",
455
+ namespace: "matches",
456
+ action: "listFor",
457
+ path: "/api/matches/listFor",
458
+ summary: "List matches for specific player",
459
+ responseSchema: "MatchSummary",
460
+ },
461
+ {
462
+ method: "GET",
463
+ namespace: "matches",
464
+ action: "mmrFor",
465
+ path: "/api/matches/mmrFor",
466
+ summary: "Get MMR for specific player",
467
+ responseSchema: "Mmr",
468
+ },
469
+ {
470
+ method: "GET",
471
+ namespace: "matches",
472
+ action: "rankHistoryFor",
473
+ path: "/api/matches/rankHistoryFor",
474
+ summary: "Get rank history for player",
475
+ responseSchema: "RankChange",
476
+ },
477
+ {
478
+ method: "GET",
479
+ namespace: "matches",
480
+ action: "leaderboard",
481
+ path: "/api/matches/leaderboard",
482
+ summary: "Get competitive leaderboard",
483
+ responseSchema: "Leaderboard",
484
+ },
485
+ {
486
+ method: "GET",
487
+ namespace: "matches",
488
+ action: "content",
489
+ path: "/api/matches/content",
490
+ summary: "Get seasonal content and acts",
491
+ responseSchema: "Content",
492
+ },
493
+ {
494
+ method: "GET",
495
+ namespace: "matches",
496
+ action: "premier",
497
+ path: "/api/matches/premier",
498
+ summary: "Get premier standings",
499
+ responseSchema: "Premier",
500
+ },
501
+ {
502
+ method: "GET",
503
+ namespace: "matches",
504
+ action: "trend",
505
+ path: "/api/matches/trend",
506
+ summary: "Get competitive rating trend",
507
+ responseSchema: "RatingTrend",
508
+ },
509
+ {
510
+ method: "GET",
511
+ namespace: "matches",
512
+ action: "summary",
513
+ path: "/api/matches/summary",
514
+ summary: "Get recent performance summary",
515
+ responseSchema: "PerformanceSummary",
516
+ },
517
+ {
518
+ method: "GET",
519
+ namespace: "matches",
520
+ action: "assess",
521
+ path: "/api/matches/assess",
522
+ summary: "Assess player rank anomalies",
523
+ responseSchema: "PlayerAssessment",
524
+ },
525
+ {
526
+ method: "POST",
527
+ namespace: "matches",
528
+ action: "selectAgent",
529
+ path: "/api/matches/selectAgent",
530
+ summary: "Select pregame agent",
531
+ responseSchema: "LiveMatch",
532
+ },
533
+ {
534
+ method: "POST",
535
+ namespace: "matches",
536
+ action: "lockAgent",
537
+ path: "/api/matches/lockAgent",
538
+ summary: "Lock pregame agent",
539
+ responseSchema: "LiveMatch",
540
+ },
541
+ {
542
+ method: "POST",
543
+ namespace: "matches",
544
+ action: "dodge",
545
+ path: "/api/matches/dodge",
546
+ summary: "Dodge pregame agent select",
547
+ isConfirmGated: true,
548
+ },
549
+ {
550
+ method: "POST",
551
+ namespace: "matches",
552
+ action: "leaveMatch",
553
+ path: "/api/matches/leaveMatch",
554
+ summary: "Leave active match",
555
+ isConfirmGated: true,
556
+ },
557
+ {
558
+ method: "GET",
559
+ namespace: "party",
560
+ action: "current",
561
+ path: "/api/party/current",
562
+ summary: "Get current party details",
563
+ responseSchema: "Party",
564
+ },
565
+ {
566
+ method: "GET",
567
+ namespace: "party",
568
+ action: "party",
569
+ path: "/api/party/party",
570
+ summary: "Get party alias",
571
+ responseSchema: "Party",
572
+ },
573
+ {
574
+ method: "GET",
575
+ namespace: "party",
576
+ action: "queues",
577
+ path: "/api/party/queues",
578
+ summary: "Get matchmaking queues",
579
+ responseSchema: "QueueConfig",
580
+ },
581
+ {
582
+ method: "GET",
583
+ namespace: "party",
584
+ action: "customGameConfigs",
585
+ path: "/api/party/customGameConfigs",
586
+ summary: "Get custom game configs",
587
+ responseSchema: "CustomGameConfigs",
588
+ },
589
+ {
590
+ method: "GET",
591
+ namespace: "party",
592
+ action: "invites",
593
+ path: "/api/party/invites",
594
+ summary: "Get party invites",
595
+ responseSchema: "PartyInvite",
596
+ },
597
+ {
598
+ method: "GET",
599
+ namespace: "party",
600
+ action: "requests",
601
+ path: "/api/party/requests",
602
+ summary: "Get party join requests",
603
+ responseSchema: "PartyRequest",
604
+ },
605
+ {
606
+ method: "POST",
607
+ namespace: "party",
608
+ action: "invite",
609
+ path: "/api/party/invite",
610
+ summary: "Invite player to party",
611
+ responseSchema: "Party",
612
+ },
613
+ {
614
+ method: "POST",
615
+ namespace: "party",
616
+ action: "kick",
617
+ path: "/api/party/kick",
618
+ summary: "Kick player from party",
619
+ responseSchema: "Party",
620
+ },
621
+ {
622
+ method: "POST",
623
+ namespace: "party",
624
+ action: "promote",
625
+ path: "/api/party/promote",
626
+ summary: "Promote player to party leader",
627
+ responseSchema: "Party",
628
+ },
629
+ {
630
+ method: "POST",
631
+ namespace: "party",
632
+ action: "createInviteCode",
633
+ path: "/api/party/createInviteCode",
634
+ summary: "Generate party code",
635
+ responseSchema: "Party",
636
+ },
637
+ {
638
+ method: "POST",
639
+ namespace: "party",
640
+ action: "revokeInviteCode",
641
+ path: "/api/party/revokeInviteCode",
642
+ summary: "Revoke party code",
643
+ responseSchema: "Party",
644
+ },
645
+ {
646
+ method: "POST",
647
+ namespace: "party",
648
+ action: "joinByCode",
649
+ path: "/api/party/joinByCode",
650
+ summary: "Join party using code",
651
+ responseSchema: "Party",
652
+ },
653
+ {
654
+ method: "POST",
655
+ namespace: "party",
656
+ action: "setReady",
657
+ path: "/api/party/setReady",
658
+ summary: "Set party ready status",
659
+ responseSchema: "Party",
660
+ },
661
+ {
662
+ method: "POST",
663
+ namespace: "party",
664
+ action: "setQueue",
665
+ path: "/api/party/setQueue",
666
+ summary: "Set party matchmaking queue",
667
+ responseSchema: "Party",
668
+ },
669
+ {
670
+ method: "POST",
671
+ namespace: "party",
672
+ action: "setAccessibility",
673
+ path: "/api/party/setAccessibility",
674
+ summary: "Set party accessibility",
675
+ responseSchema: "Party",
676
+ },
677
+ {
678
+ method: "POST",
679
+ namespace: "party",
680
+ action: "startMatchmaking",
681
+ path: "/api/party/startMatchmaking",
682
+ summary: "Start matchmaking queue",
683
+ responseSchema: "Party",
684
+ },
685
+ {
686
+ method: "POST",
687
+ namespace: "party",
688
+ action: "stopMatchmaking",
689
+ path: "/api/party/stopMatchmaking",
690
+ summary: "Stop matchmaking queue",
691
+ responseSchema: "Party",
692
+ },
693
+ {
694
+ method: "POST",
695
+ namespace: "party",
696
+ action: "leave",
697
+ path: "/api/party/leave",
698
+ summary: "Leave party",
699
+ responseSchema: "Party",
700
+ },
701
+ {
702
+ method: "POST",
703
+ namespace: "party",
704
+ action: "join",
705
+ path: "/api/party/join",
706
+ summary: "Join party by ID",
707
+ responseSchema: "Party",
708
+ },
709
+ {
710
+ method: "POST",
711
+ namespace: "party",
712
+ action: "declineInvite",
713
+ path: "/api/party/declineInvite",
714
+ summary: "Decline party invite",
715
+ },
716
+ {
717
+ method: "POST",
718
+ namespace: "party",
719
+ action: "requestToJoin",
720
+ path: "/api/party/requestToJoin",
721
+ summary: "Request to join party",
722
+ },
723
+ {
724
+ method: "POST",
725
+ namespace: "party",
726
+ action: "declineRequest",
727
+ path: "/api/party/declineRequest",
728
+ summary: "Decline join request",
729
+ },
730
+ {
731
+ method: "POST",
732
+ namespace: "party",
733
+ action: "makeCustomGame",
734
+ path: "/api/party/makeCustomGame",
735
+ summary: "Convert party to custom game",
736
+ responseSchema: "Party",
737
+ },
738
+ {
739
+ method: "POST",
740
+ namespace: "party",
741
+ action: "makeDefault",
742
+ path: "/api/party/makeDefault",
743
+ summary: "Set party default queue",
744
+ responseSchema: "Party",
745
+ },
746
+ {
747
+ method: "POST",
748
+ namespace: "party",
749
+ action: "setCustomGameSettings",
750
+ path: "/api/party/setCustomGameSettings",
751
+ summary: "Configure custom game",
752
+ responseSchema: "Party",
753
+ },
754
+ {
755
+ method: "POST",
756
+ namespace: "party",
757
+ action: "setTeam",
758
+ path: "/api/party/setTeam",
759
+ summary: "Set player team in custom game",
760
+ responseSchema: "Party",
761
+ },
762
+ {
763
+ method: "POST",
764
+ namespace: "party",
765
+ action: "startCustomGame",
766
+ path: "/api/party/startCustomGame",
767
+ summary: "Start custom game match",
768
+ responseSchema: "Party",
769
+ },
770
+ {
771
+ method: "POST",
772
+ namespace: "party",
773
+ action: "balanceTeams",
774
+ path: "/api/party/balanceTeams",
775
+ summary: "Auto-balance custom game teams",
776
+ responseSchema: "Party",
777
+ },
778
+ {
779
+ method: "POST",
780
+ namespace: "party",
781
+ action: "setPreferredServers",
782
+ path: "/api/party/setPreferredServers",
783
+ summary: "Set preferred servers",
784
+ responseSchema: "Party",
785
+ },
786
+ {
787
+ method: "POST",
788
+ namespace: "party",
789
+ action: "setModerator",
790
+ path: "/api/party/setModerator",
791
+ summary: "Set moderator status",
792
+ responseSchema: "Party",
793
+ },
794
+ {
795
+ method: "POST",
796
+ namespace: "party",
797
+ action: "refresh",
798
+ path: "/api/party/refresh",
799
+ summary: "Refresh party state",
800
+ responseSchema: "Party",
801
+ },
802
+ ];
803
+ function isDryRun(query, body, headers) {
804
+ if (query.dryRun !== undefined) {
805
+ return query.dryRun === "1" || query.dryRun.toLowerCase() === "true";
806
+ }
807
+ if (headers["x-dry-run"] !== undefined) {
808
+ const val = String(headers["x-dry-run"]).toLowerCase();
809
+ return val === "1" || val === "true";
810
+ }
811
+ if (body.dryRun !== undefined) {
812
+ return Boolean(body.dryRun);
813
+ }
814
+ return true;
815
+ }
816
+ export async function dispatchApiRoute(client, namespace, methodName, query, body, req) {
817
+ const normMethod = methodName.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
818
+ const routeKey = `${namespace}/${normMethod}`;
819
+ const isWrite = req.method === "POST";
820
+ const dryRun = isDryRun(query, body, req.headers);
821
+ if (isWrite && CONFIRM_GATED_ROUTES.has(routeKey)) {
822
+ const hasConfirmHeader = String(req.headers["x-confirm"] ?? "").toLowerCase() === "yes";
823
+ const hasConfirmBody = body.confirm === true;
824
+ if (!dryRun && (!hasConfirmHeader || !hasConfirmBody)) {
825
+ throw new ValidationError("confirm-required", `${normMethod} requires explicit confirmation: header X-Confirm: yes and body { confirm: true }`);
826
+ }
827
+ }
828
+ if (namespace === "account") {
829
+ switch (normMethod) {
830
+ case "whoami":
831
+ return client.account.whoami();
832
+ case "ownedItems":
833
+ return client.account.ownedItems({ language: query.language });
834
+ case "loadout":
835
+ return client.account.loadout();
836
+ case "collectionValue":
837
+ return client.account.collectionValue();
838
+ case "wallet":
839
+ return client.account.wallet();
840
+ case "xp":
841
+ return client.account.xp();
842
+ case "contracts":
843
+ return client.account.contracts();
844
+ case "missions":
845
+ return client.account.missions();
846
+ case "penalties":
847
+ return client.account.penalties();
848
+ case "favourites":
849
+ return client.account.favourites();
850
+ case "session":
851
+ return client.account.session();
852
+ case "config":
853
+ return client.account.config();
854
+ case "settings":
855
+ return client.account.settings();
856
+ case "client":
857
+ return client.account.client();
858
+ case "exportLoadout":
859
+ return client.account.exportLoadout();
860
+ case "diffLoadout":
861
+ return client.account.diffLoadout((body.preset ?? body));
862
+ case "equip":
863
+ return dryRun
864
+ ? client.account.validateEquip(body)
865
+ : client.account.equip(body);
866
+ case "equipCollection": {
867
+ const uuids = (body.skinUuids ?? body);
868
+ return dryRun
869
+ ? client.account.validateEquipCollection(uuids)
870
+ : client.account.equipCollection(uuids);
871
+ }
872
+ case "equipPreset":
873
+ return dryRun
874
+ ? client.account.validateEquipPreset(body)
875
+ : client.account.equipPreset(body);
876
+ case "activateContract": {
877
+ const uuid = String(body.uuid ?? body.contractId ?? query.uuid);
878
+ return dryRun
879
+ ? client.account.validateActivateContract(uuid)
880
+ : client.account.activateContract(uuid);
881
+ }
882
+ case "addFavourite": {
883
+ const skin = String(body.skin ?? body.itemId ?? query.skin);
884
+ return dryRun
885
+ ? client.account.validateAddFavourite(skin)
886
+ : client.account.addFavourite(skin);
887
+ }
888
+ case "removeFavourite": {
889
+ const skin = String(body.skin ?? body.itemId ?? query.skin);
890
+ return dryRun
891
+ ? client.account.validateRemoveFavourite(skin)
892
+ : client.account.removeFavourite(skin);
893
+ }
894
+ case "setActRankBadgeHidden": {
895
+ const hidden = Boolean(body.hidden ?? query.hidden === "true");
896
+ return dryRun
897
+ ? client.account.validateSetActRankBadgeHidden(hidden)
898
+ : client.account.setActRankBadgeHidden(hidden);
899
+ }
900
+ case "setLeaderboardAnonymized": {
901
+ const anon = Boolean(body.anonymized ?? query.anonymized === "true");
902
+ return dryRun
903
+ ? client.account.validateSetLeaderboardAnonymized(anon)
904
+ : client.account.setLeaderboardAnonymized(anon);
905
+ }
906
+ case "saveSettings": {
907
+ const data = body.data ?? body;
908
+ return dryRun
909
+ ? client.account.validateSaveSettings(data, { confirm: true })
910
+ : client.account.saveSettings(data, { confirm: true });
911
+ }
912
+ }
913
+ }
914
+ if (namespace === "social") {
915
+ switch (normMethod) {
916
+ case "friends":
917
+ return client.social.friends();
918
+ case "friendRequests":
919
+ return client.social.friendRequests();
920
+ case "blocked":
921
+ return client.social.blocked();
922
+ case "conversations":
923
+ return client.social.conversations();
924
+ case "messages":
925
+ return client.social.messages(query.cid ?? query.conversationId);
926
+ case "participants":
927
+ return client.social.participants(query.cid ?? query.conversationId);
928
+ case "sendMessage": {
929
+ const target = (body.to ?? {
930
+ puuid: String(body.puuid ?? ""),
931
+ conversationId: String(body.cid ?? ""),
932
+ });
933
+ const text = String(body.text ?? "");
934
+ return dryRun
935
+ ? client.social.validateSendMessage(target, text)
936
+ : client.social.sendMessage(target, text);
937
+ }
938
+ case "sendFriendRequest": {
939
+ const riotId = String(body.riotId ?? query.riotId);
940
+ return dryRun
941
+ ? client.social.validateSendFriendRequest(riotId)
942
+ : client.social.sendFriendRequest(riotId);
943
+ }
944
+ case "acceptFriendRequest": {
945
+ const puuid = String(body.puuid ?? query.puuid);
946
+ return dryRun
947
+ ? client.social.validateAcceptFriendRequest(puuid)
948
+ : client.social.acceptFriendRequest(puuid);
949
+ }
950
+ case "declineFriendRequest": {
951
+ const puuid = String(body.puuid ?? query.puuid);
952
+ return dryRun
953
+ ? client.social.validateDeclineFriendRequest(puuid)
954
+ : client.social.declineFriendRequest(puuid);
955
+ }
956
+ case "cancelFriendRequest": {
957
+ const puuid = String(body.puuid ?? query.puuid);
958
+ return dryRun
959
+ ? client.social.validateCancelFriendRequest(puuid)
960
+ : client.social.cancelFriendRequest(puuid);
961
+ }
962
+ case "removeFriend": {
963
+ const puuid = String(body.puuid ?? query.puuid);
964
+ return dryRun
965
+ ? client.social.validateRemoveFriend(puuid)
966
+ : client.social.removeFriend(puuid);
967
+ }
968
+ case "blockPlayer": {
969
+ const target = String(body.target ?? body.puuid ?? query.target);
970
+ return dryRun
971
+ ? client.social.validateBlockPlayer(target)
972
+ : client.social.blockPlayer(target);
973
+ }
974
+ case "unblockPlayer": {
975
+ const puuid = String(body.puuid ?? query.puuid);
976
+ return dryRun
977
+ ? client.social.validateUnblockPlayer(puuid)
978
+ : client.social.unblockPlayer(puuid);
979
+ }
980
+ }
981
+ }
982
+ if (namespace === "store") {
983
+ switch (normMethod) {
984
+ case "current":
985
+ case "store":
986
+ return client.store.current({ language: query.language });
987
+ case "offers":
988
+ return client.store.offers();
989
+ case "order":
990
+ return client.store.order(query.id);
991
+ case "history":
992
+ return client.store.history({ days: query.days ? Number(query.days) : undefined });
993
+ case "seen":
994
+ return client.store.seen(query.skin);
995
+ case "revealNightMarket":
996
+ return dryRun ? client.store.validateRevealNightMarket() : client.store.revealNightMarket();
997
+ case "buy": {
998
+ const target = (body.target ?? body);
999
+ return dryRun
1000
+ ? client.store.validateBuy(target, { confirm: true })
1001
+ : client.store.buy(target, { confirm: true });
1002
+ }
1003
+ }
1004
+ }
1005
+ if (namespace === "matches") {
1006
+ switch (normMethod) {
1007
+ case "list":
1008
+ case "matches":
1009
+ return client.matches.list({
1010
+ count: query.count ? Number(query.count) : undefined,
1011
+ queue: query.queue,
1012
+ });
1013
+ case "sync":
1014
+ return client.matches.sync({
1015
+ maxPages: query.maxPages
1016
+ ? Number(query.maxPages)
1017
+ : query.pages
1018
+ ? Number(query.pages)
1019
+ : undefined,
1020
+ });
1021
+ case "known":
1022
+ return client.matches.known(query.puuid);
1023
+ case "get":
1024
+ case "match":
1025
+ return client.matches.get(query.id);
1026
+ case "mmr":
1027
+ return client.matches.mmr();
1028
+ case "rankHistory":
1029
+ return client.matches.rankHistory({ count: query.count ? Number(query.count) : undefined });
1030
+ case "live":
1031
+ return client.matches.live({
1032
+ ranks: query.ranks === "true" || query.ranks === "1",
1033
+ loadouts: query.loadouts !== "false" && query.loadouts !== "0",
1034
+ });
1035
+ case "listFor":
1036
+ return client.matches.listFor(query.puuid, {
1037
+ count: query.count ? Number(query.count) : undefined,
1038
+ queue: query.queue,
1039
+ });
1040
+ case "mmrFor":
1041
+ return client.matches.mmrFor(query.puuid);
1042
+ case "rankHistoryFor":
1043
+ return client.matches.rankHistoryFor(query.puuid, {
1044
+ count: query.count ? Number(query.count) : undefined,
1045
+ });
1046
+ case "leaderboard":
1047
+ return client.matches.leaderboard({
1048
+ season: query.season,
1049
+ start: query.start ? Number(query.start) : undefined,
1050
+ size: query.size ? Number(query.size) : undefined,
1051
+ query: query.query,
1052
+ });
1053
+ case "content":
1054
+ return client.matches.content();
1055
+ case "premier":
1056
+ return client.matches.premier();
1057
+ case "trend":
1058
+ return client.matches.trend({
1059
+ count: query.count ? Number(query.count) : undefined,
1060
+ puuid: query.puuid,
1061
+ });
1062
+ case "summary":
1063
+ return client.matches.summary({
1064
+ count: query.count ? Number(query.count) : undefined,
1065
+ queue: query.queue,
1066
+ puuid: query.puuid,
1067
+ });
1068
+ case "assess":
1069
+ return client.matches.assess(query.puuid);
1070
+ case "selectAgent": {
1071
+ const agent = String(body.agent ?? query.agent);
1072
+ return dryRun
1073
+ ? client.matches.validateSelectAgent(agent)
1074
+ : client.matches.selectAgent(agent);
1075
+ }
1076
+ case "lockAgent": {
1077
+ const agent = String(body.agent ?? query.agent);
1078
+ return dryRun ? client.matches.validateLockAgent(agent) : client.matches.lockAgent(agent);
1079
+ }
1080
+ case "dodge":
1081
+ return dryRun
1082
+ ? client.matches.validateDodge({ confirm: true })
1083
+ : client.matches.dodge({ confirm: true });
1084
+ case "leaveMatch":
1085
+ return dryRun
1086
+ ? client.matches.validateLeaveMatch({ confirm: true })
1087
+ : client.matches.leaveMatch({ confirm: true });
1088
+ }
1089
+ }
1090
+ if (namespace === "party") {
1091
+ switch (normMethod) {
1092
+ case "current":
1093
+ case "party":
1094
+ return client.party.current();
1095
+ case "queues":
1096
+ return client.party.queues();
1097
+ case "customGameConfigs":
1098
+ return client.party.customGameConfigs();
1099
+ case "invites":
1100
+ return client.party.invites();
1101
+ case "requests":
1102
+ return client.party.requests();
1103
+ case "invite": {
1104
+ const riotId = String(body.riotId ?? query.riotId);
1105
+ return dryRun ? client.party.validateInvite(riotId) : client.party.invite(riotId);
1106
+ }
1107
+ case "kick": {
1108
+ const puuid = String(body.puuid ?? query.puuid);
1109
+ return dryRun ? client.party.validateKick(puuid) : client.party.kick(puuid);
1110
+ }
1111
+ case "promote": {
1112
+ const puuid = String(body.puuid ?? query.puuid);
1113
+ return dryRun ? client.party.validatePromote(puuid) : client.party.promote(puuid);
1114
+ }
1115
+ case "createInviteCode":
1116
+ return dryRun ? client.party.validateCreateInviteCode() : client.party.createInviteCode();
1117
+ case "revokeInviteCode":
1118
+ return dryRun ? client.party.validateRevokeInviteCode() : client.party.revokeInviteCode();
1119
+ case "joinByCode": {
1120
+ const code = String(body.code ?? query.code);
1121
+ return dryRun ? client.party.validateJoinByCode(code) : client.party.joinByCode(code);
1122
+ }
1123
+ case "setReady": {
1124
+ const ready = Boolean(body.ready ?? query.ready === "true");
1125
+ return dryRun ? client.party.validateSetReady(ready) : client.party.setReady(ready);
1126
+ }
1127
+ case "setQueue": {
1128
+ const queue = String(body.queue ?? query.queue);
1129
+ return dryRun ? client.party.validateSetQueue(queue) : client.party.setQueue(queue);
1130
+ }
1131
+ case "setAccessibility": {
1132
+ const acc = (body.accessibility ?? query.accessibility);
1133
+ return dryRun
1134
+ ? client.party.validateSetAccessibility(acc)
1135
+ : client.party.setAccessibility(acc);
1136
+ }
1137
+ case "startMatchmaking":
1138
+ return dryRun ? client.party.validateStartMatchmaking() : client.party.startMatchmaking();
1139
+ case "stopMatchmaking":
1140
+ return dryRun ? client.party.validateStopMatchmaking() : client.party.stopMatchmaking();
1141
+ case "leave":
1142
+ return dryRun ? client.party.validateLeave() : client.party.leave();
1143
+ case "join": {
1144
+ const partyId = String(body.partyId ?? query.partyId);
1145
+ return dryRun ? client.party.validateJoin(partyId) : client.party.join(partyId);
1146
+ }
1147
+ case "declineInvite": {
1148
+ const inviteId = String(body.inviteId ?? query.inviteId);
1149
+ return dryRun
1150
+ ? client.party.validateDeclineInvite(inviteId)
1151
+ : client.party.declineInvite(inviteId);
1152
+ }
1153
+ case "requestToJoin": {
1154
+ const partyId = String(body.partyId ?? query.partyId);
1155
+ return dryRun
1156
+ ? client.party.validateRequestToJoin(partyId)
1157
+ : client.party.requestToJoin(partyId);
1158
+ }
1159
+ case "declineRequest": {
1160
+ const requestId = String(body.requestId ?? query.requestId);
1161
+ return dryRun
1162
+ ? client.party.validateDeclineRequest(requestId)
1163
+ : client.party.declineRequest(requestId);
1164
+ }
1165
+ case "makeCustomGame":
1166
+ return dryRun ? client.party.validateMakeCustomGame() : client.party.makeCustomGame();
1167
+ case "makeDefault": {
1168
+ const queue = String(body.queue ?? query.queue);
1169
+ return dryRun ? client.party.validateMakeDefault(queue) : client.party.makeDefault(queue);
1170
+ }
1171
+ case "setCustomGameSettings": {
1172
+ const settings = (body.settings ?? body);
1173
+ return dryRun
1174
+ ? client.party.validateSetCustomGameSettings(settings)
1175
+ : client.party.setCustomGameSettings(settings);
1176
+ }
1177
+ case "setTeam": {
1178
+ const puuid = String(body.puuid ?? query.puuid);
1179
+ const team = String(body.team ?? query.team);
1180
+ return dryRun
1181
+ ? client.party.validateSetTeam(puuid, team)
1182
+ : client.party.setTeam(puuid, team);
1183
+ }
1184
+ case "startCustomGame":
1185
+ return dryRun ? client.party.validateStartCustomGame() : client.party.startCustomGame();
1186
+ case "balanceTeams":
1187
+ return dryRun ? client.party.validateBalanceTeams() : client.party.balanceTeams();
1188
+ case "setPreferredServers": {
1189
+ const ids = (body.ids ?? body);
1190
+ return dryRun
1191
+ ? client.party.validateSetPreferredServers(ids)
1192
+ : client.party.setPreferredServers(ids);
1193
+ }
1194
+ case "setModerator": {
1195
+ const puuid = String(body.puuid ?? query.puuid);
1196
+ const isMod = Boolean(body.isModerator ?? query.isModerator === "true");
1197
+ return dryRun
1198
+ ? client.party.validateSetModerator(puuid, isMod)
1199
+ : client.party.setModerator(puuid, isMod);
1200
+ }
1201
+ case "refresh":
1202
+ return dryRun ? client.party.validateRefresh() : client.party.refresh();
1203
+ }
1204
+ }
1205
+ throw new ValidationError("route-not-found", `Unknown endpoint: ${req.method} /api/${namespace}/${methodName}`);
1206
+ }
1207
+ //# sourceMappingURL=routes.js.map