@valoranchi/riot-client 0.3.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 (261) hide show
  1. package/README.md +20 -1
  2. package/dist/RiotClient.d.ts +8 -1
  3. package/dist/RiotClient.d.ts.map +1 -1
  4. package/dist/RiotClient.js +18 -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/analysis/wishlist.d.ts +5 -0
  35. package/dist/analysis/wishlist.d.ts.map +1 -0
  36. package/dist/analysis/wishlist.js +122 -0
  37. package/dist/analysis/wishlist.js.map +1 -0
  38. package/dist/bin.js +3 -1
  39. package/dist/bin.js.map +1 -1
  40. package/dist/catalogue/Catalogue.d.ts +1 -0
  41. package/dist/catalogue/Catalogue.d.ts.map +1 -1
  42. package/dist/catalogue/Catalogue.js +11 -0
  43. package/dist/catalogue/Catalogue.js.map +1 -1
  44. package/dist/catalogue/ValorantApi.d.ts.map +1 -1
  45. package/dist/catalogue/ValorantApi.js +1 -1
  46. package/dist/catalogue/ValorantApi.js.map +1 -1
  47. package/dist/cli.d.ts +15 -9
  48. package/dist/cli.d.ts.map +1 -1
  49. package/dist/cli.js +371 -46
  50. package/dist/cli.js.map +1 -1
  51. package/dist/client/AccountService.d.ts +6 -1
  52. package/dist/client/AccountService.d.ts.map +1 -1
  53. package/dist/client/AccountService.js +39 -4
  54. package/dist/client/AccountService.js.map +1 -1
  55. package/dist/client/AccountValidator.d.ts.map +1 -1
  56. package/dist/client/AccountValidator.js +9 -3
  57. package/dist/client/AccountValidator.js.map +1 -1
  58. package/dist/client/ChatValidator.d.ts.map +1 -1
  59. package/dist/client/ChatValidator.js +2 -4
  60. package/dist/client/ChatValidator.js.map +1 -1
  61. package/dist/client/ClientContext.d.ts +5 -0
  62. package/dist/client/ClientContext.d.ts.map +1 -1
  63. package/dist/client/ClientContext.js.map +1 -1
  64. package/dist/client/LiveMatchService.d.ts +1 -1
  65. package/dist/client/LiveMatchService.d.ts.map +1 -1
  66. package/dist/client/LiveMatchService.js +30 -20
  67. package/dist/client/LiveMatchService.js.map +1 -1
  68. package/dist/client/LoadoutValidator.d.ts.map +1 -1
  69. package/dist/client/LoadoutValidator.js +1 -3
  70. package/dist/client/LoadoutValidator.js.map +1 -1
  71. package/dist/client/MatchService.d.ts +17 -1
  72. package/dist/client/MatchService.d.ts.map +1 -1
  73. package/dist/client/MatchService.js +123 -2
  74. package/dist/client/MatchService.js.map +1 -1
  75. package/dist/client/MatchValidator.d.ts.map +1 -1
  76. package/dist/client/MatchValidator.js.map +1 -1
  77. package/dist/client/OfficialService.d.ts +35 -0
  78. package/dist/client/OfficialService.d.ts.map +1 -0
  79. package/dist/client/OfficialService.js +141 -0
  80. package/dist/client/OfficialService.js.map +1 -0
  81. package/dist/client/PartyService.d.ts.map +1 -1
  82. package/dist/client/PartyService.js +3 -1
  83. package/dist/client/PartyService.js.map +1 -1
  84. package/dist/client/PartyValidator.d.ts.map +1 -1
  85. package/dist/client/PartyValidator.js +1 -2
  86. package/dist/client/PartyValidator.js.map +1 -1
  87. package/dist/client/SocialService.d.ts.map +1 -1
  88. package/dist/client/SocialService.js +4 -5
  89. package/dist/client/SocialService.js.map +1 -1
  90. package/dist/client/StoreService.d.ts +9 -1
  91. package/dist/client/StoreService.d.ts.map +1 -1
  92. package/dist/client/StoreService.js +90 -2
  93. package/dist/client/StoreService.js.map +1 -1
  94. package/dist/client/StoreValidator.d.ts.map +1 -1
  95. package/dist/client/StoreValidator.js +4 -2
  96. package/dist/client/StoreValidator.js.map +1 -1
  97. package/dist/client/api.d.ts +55 -1
  98. package/dist/client/api.d.ts.map +1 -1
  99. package/dist/collection/CustomGameConfigsBuilder.d.ts.map +1 -1
  100. package/dist/collection/CustomGameConfigsBuilder.js.map +1 -1
  101. package/dist/collection/LiveMatchBuilder.d.ts +2 -2
  102. package/dist/collection/LiveMatchBuilder.d.ts.map +1 -1
  103. package/dist/collection/LiveMatchBuilder.js +10 -8
  104. package/dist/collection/LiveMatchBuilder.js.map +1 -1
  105. package/dist/collection/LoadoutBuilder.d.ts.map +1 -1
  106. package/dist/collection/LoadoutBuilder.js +1 -1
  107. package/dist/collection/LoadoutBuilder.js.map +1 -1
  108. package/dist/collection/LoadoutWriter.d.ts.map +1 -1
  109. package/dist/collection/LoadoutWriter.js +0 -1
  110. package/dist/collection/LoadoutWriter.js.map +1 -1
  111. package/dist/collection/MmrBuilder.d.ts +1 -1
  112. package/dist/collection/MmrBuilder.d.ts.map +1 -1
  113. package/dist/collection/MmrBuilder.js +5 -2
  114. package/dist/collection/MmrBuilder.js.map +1 -1
  115. package/dist/collection/PlayerSettingsBuilder.d.ts.map +1 -1
  116. package/dist/collection/PlayerSettingsBuilder.js +1 -3
  117. package/dist/collection/PlayerSettingsBuilder.js.map +1 -1
  118. package/dist/collection/RankFit.d.ts +11 -0
  119. package/dist/collection/RankFit.d.ts.map +1 -0
  120. package/dist/collection/RankFit.js +56 -0
  121. package/dist/collection/RankFit.js.map +1 -0
  122. package/dist/errors.d.ts +5 -1
  123. package/dist/errors.d.ts.map +1 -1
  124. package/dist/errors.js +8 -1
  125. package/dist/errors.js.map +1 -1
  126. package/dist/formatError.d.ts +10 -0
  127. package/dist/formatError.d.ts.map +1 -0
  128. package/dist/formatError.js +29 -0
  129. package/dist/formatError.js.map +1 -0
  130. package/dist/index.d.ts +15 -4
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +13 -2
  133. package/dist/index.js.map +1 -1
  134. package/dist/local/ChatApi.d.ts.map +1 -1
  135. package/dist/local/ChatApi.js +3 -1
  136. package/dist/local/ChatApi.js.map +1 -1
  137. package/dist/local/RiotSocket.d.ts.map +1 -1
  138. package/dist/local/RiotSocket.js.map +1 -1
  139. package/dist/mcp/McpServer.d.ts +21 -0
  140. package/dist/mcp/McpServer.d.ts.map +1 -0
  141. package/dist/mcp/McpServer.js +135 -0
  142. package/dist/mcp/McpServer.js.map +1 -0
  143. package/dist/mcp/index.d.ts +4 -0
  144. package/dist/mcp/index.d.ts.map +1 -0
  145. package/dist/mcp/index.js +3 -0
  146. package/dist/mcp/index.js.map +1 -0
  147. package/dist/mcp/tools.d.ts +9 -0
  148. package/dist/mcp/tools.d.ts.map +1 -0
  149. package/dist/mcp/tools.js +83 -0
  150. package/dist/mcp/tools.js.map +1 -0
  151. package/dist/mcp/types.d.ts +46 -0
  152. package/dist/mcp/types.d.ts.map +1 -0
  153. package/dist/mcp/types.js +2 -0
  154. package/dist/mcp/types.js.map +1 -0
  155. package/dist/model/index.d.ts +201 -0
  156. package/dist/model/index.d.ts.map +1 -1
  157. package/dist/official/OfficialApi.d.ts +35 -0
  158. package/dist/official/OfficialApi.d.ts.map +1 -0
  159. package/dist/official/OfficialApi.js +148 -0
  160. package/dist/official/OfficialApi.js.map +1 -0
  161. package/dist/official/OfficialMatchAdapter.d.ts +11 -0
  162. package/dist/official/OfficialMatchAdapter.d.ts.map +1 -0
  163. package/dist/official/OfficialMatchAdapter.js +157 -0
  164. package/dist/official/OfficialMatchAdapter.js.map +1 -0
  165. package/dist/official/RateLimiter.d.ts +20 -0
  166. package/dist/official/RateLimiter.d.ts.map +1 -0
  167. package/dist/official/RateLimiter.js +56 -0
  168. package/dist/official/RateLimiter.js.map +1 -0
  169. package/dist/official/types.d.ts +214 -0
  170. package/dist/official/types.d.ts.map +1 -0
  171. package/dist/official/types.js +2 -0
  172. package/dist/official/types.js.map +1 -0
  173. package/dist/raw.d.ts +4 -0
  174. package/dist/raw.d.ts.map +1 -1
  175. package/dist/raw.js +4 -0
  176. package/dist/raw.js.map +1 -1
  177. package/dist/riot/HttpGateway.d.ts.map +1 -1
  178. package/dist/riot/HttpGateway.js +9 -2
  179. package/dist/riot/HttpGateway.js.map +1 -1
  180. package/dist/riot/ResponseCache.d.ts +2 -0
  181. package/dist/riot/ResponseCache.d.ts.map +1 -1
  182. package/dist/riot/ResponseCache.js +9 -5
  183. package/dist/riot/ResponseCache.js.map +1 -1
  184. package/dist/riot/RiotApi.d.ts.map +1 -1
  185. package/dist/riot/RiotApi.js.map +1 -1
  186. package/dist/riot/types.d.ts.map +1 -1
  187. package/dist/serve/index.d.ts +7 -0
  188. package/dist/serve/index.d.ts.map +1 -0
  189. package/dist/serve/index.js +6 -0
  190. package/dist/serve/index.js.map +1 -0
  191. package/dist/serve/indexHtml.d.ts +2 -0
  192. package/dist/serve/indexHtml.d.ts.map +1 -0
  193. package/dist/serve/indexHtml.js +36 -0
  194. package/dist/serve/indexHtml.js.map +1 -0
  195. package/dist/serve/openapi.d.ts +2 -0
  196. package/dist/serve/openapi.d.ts.map +1 -0
  197. package/dist/serve/openapi.js +125 -0
  198. package/dist/serve/openapi.js.map +1 -0
  199. package/dist/serve/routes.d.ts +9 -0
  200. package/dist/serve/routes.d.ts.map +1 -0
  201. package/dist/serve/routes.js +1631 -0
  202. package/dist/serve/routes.js.map +1 -0
  203. package/dist/serve/server.d.ts +6 -0
  204. package/dist/serve/server.d.ts.map +1 -0
  205. package/dist/serve/server.js +149 -0
  206. package/dist/serve/server.js.map +1 -0
  207. package/dist/serve/sse.d.ts +4 -0
  208. package/dist/serve/sse.d.ts.map +1 -0
  209. package/dist/serve/sse.js +89 -0
  210. package/dist/serve/sse.js.map +1 -0
  211. package/dist/serve/types.d.ts +32 -0
  212. package/dist/serve/types.d.ts.map +1 -0
  213. package/dist/serve/types.js +2 -0
  214. package/dist/serve/types.js.map +1 -0
  215. package/dist/version.d.ts +2 -0
  216. package/dist/version.d.ts.map +1 -0
  217. package/dist/version.js +12 -0
  218. package/dist/version.js.map +1 -0
  219. package/dist/watch/AsyncQueue.d.ts +13 -0
  220. package/dist/watch/AsyncQueue.d.ts.map +1 -0
  221. package/dist/watch/AsyncQueue.js +50 -0
  222. package/dist/watch/AsyncQueue.js.map +1 -0
  223. package/dist/watch/FriendsWatcher.d.ts +26 -0
  224. package/dist/watch/FriendsWatcher.d.ts.map +1 -0
  225. package/dist/watch/FriendsWatcher.js +152 -0
  226. package/dist/watch/FriendsWatcher.js.map +1 -0
  227. package/dist/watch/MatchWatcher.d.ts +44 -0
  228. package/dist/watch/MatchWatcher.d.ts.map +1 -0
  229. package/dist/watch/MatchWatcher.js +272 -0
  230. package/dist/watch/MatchWatcher.js.map +1 -0
  231. package/dist/watch/StoreWatcher.d.ts +27 -0
  232. package/dist/watch/StoreWatcher.d.ts.map +1 -0
  233. package/dist/watch/StoreWatcher.js +116 -0
  234. package/dist/watch/StoreWatcher.js.map +1 -0
  235. package/dist/watch/WebhookNotifier.d.ts +8 -0
  236. package/dist/watch/WebhookNotifier.d.ts.map +1 -0
  237. package/dist/watch/WebhookNotifier.js +42 -0
  238. package/dist/watch/WebhookNotifier.js.map +1 -0
  239. package/dist/watch/index.d.ts +26 -0
  240. package/dist/watch/index.d.ts.map +1 -0
  241. package/dist/watch/index.js +31 -0
  242. package/dist/watch/index.js.map +1 -0
  243. package/dist/watch/types.d.ts +114 -0
  244. package/dist/watch/types.d.ts.map +1 -0
  245. package/dist/watch/types.js +2 -0
  246. package/dist/watch/types.js.map +1 -0
  247. package/package.json +17 -5
  248. package/schema/CollectionValue.json +153 -0
  249. package/schema/LiveMatch.json +8 -1
  250. package/schema/LoadoutDiff.json +73 -0
  251. package/schema/MatchSyncResult.json +54 -0
  252. package/schema/Mmr.json +38 -1
  253. package/schema/OfficialAccount.json +25 -0
  254. package/schema/OfficialProfile.json +354 -0
  255. package/schema/PerformanceSummary.json +284 -0
  256. package/schema/PlayerAssessment.json +48 -0
  257. package/schema/RatingTrend.json +107 -0
  258. package/schema/StoreHistory.json +61 -0
  259. package/schema/Wishlist.json +35 -0
  260. package/schema/WishlistCheck.json +67 -0
  261. package/schema/WishlistHit.json +51 -0
@@ -0,0 +1,1631 @@
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
+ params: [
27
+ {
28
+ name: "language",
29
+ type: "string",
30
+ description: "Locale code for localized item names (e.g. en-US)",
31
+ },
32
+ ],
33
+ },
34
+ {
35
+ method: "GET",
36
+ namespace: "account",
37
+ action: "loadout",
38
+ path: "/api/account/loadout",
39
+ summary: "Get currently equipped loadout",
40
+ responseSchema: "Loadout",
41
+ },
42
+ {
43
+ method: "GET",
44
+ namespace: "account",
45
+ action: "collectionValue",
46
+ path: "/api/account/collectionValue",
47
+ summary: "Calculate estimated value of inventory",
48
+ responseSchema: "CollectionValue",
49
+ },
50
+ {
51
+ method: "GET",
52
+ namespace: "account",
53
+ action: "wallet",
54
+ path: "/api/account/wallet",
55
+ summary: "Get currency balances",
56
+ responseSchema: "Wallet",
57
+ },
58
+ {
59
+ method: "GET",
60
+ namespace: "account",
61
+ action: "xp",
62
+ path: "/api/account/xp",
63
+ summary: "Get account level and XP progression",
64
+ responseSchema: "AccountXp",
65
+ },
66
+ {
67
+ method: "GET",
68
+ namespace: "account",
69
+ action: "contracts",
70
+ path: "/api/account/contracts",
71
+ summary: "Get agent and battlepass contracts progress",
72
+ responseSchema: "ContractProgress",
73
+ },
74
+ {
75
+ method: "GET",
76
+ namespace: "account",
77
+ action: "missions",
78
+ path: "/api/account/missions",
79
+ summary: "Get daily and weekly missions",
80
+ responseSchema: "Mission",
81
+ },
82
+ {
83
+ method: "GET",
84
+ namespace: "account",
85
+ action: "penalties",
86
+ path: "/api/account/penalties",
87
+ summary: "Get active account penalties",
88
+ responseSchema: "Penalty",
89
+ },
90
+ {
91
+ method: "GET",
92
+ namespace: "account",
93
+ action: "favourites",
94
+ path: "/api/account/favourites",
95
+ summary: "Get favorited skins",
96
+ responseSchema: "Favourite",
97
+ },
98
+ {
99
+ method: "GET",
100
+ namespace: "account",
101
+ action: "session",
102
+ path: "/api/account/session",
103
+ summary: "Get client session loop state",
104
+ responseSchema: "GameSession",
105
+ },
106
+ {
107
+ method: "GET",
108
+ namespace: "account",
109
+ action: "config",
110
+ path: "/api/account/config",
111
+ summary: "Get shared client configuration",
112
+ },
113
+ {
114
+ method: "GET",
115
+ namespace: "account",
116
+ action: "settings",
117
+ path: "/api/account/settings",
118
+ summary: "Get cloud player settings",
119
+ responseSchema: "PlayerSettings",
120
+ },
121
+ {
122
+ method: "GET",
123
+ namespace: "account",
124
+ action: "client",
125
+ path: "/api/account/client",
126
+ summary: "Get client identity and locale",
127
+ responseSchema: "ClientInfo",
128
+ },
129
+ {
130
+ method: "GET",
131
+ namespace: "account",
132
+ action: "exportLoadout",
133
+ path: "/api/account/exportLoadout",
134
+ summary: "Export loadout as preset",
135
+ },
136
+ {
137
+ method: "POST",
138
+ namespace: "account",
139
+ action: "equip",
140
+ path: "/api/account/equip",
141
+ summary: "Equip skins, buddies, sprays, or cards",
142
+ responseSchema: "Loadout",
143
+ },
144
+ {
145
+ method: "POST",
146
+ namespace: "account",
147
+ action: "equipCollection",
148
+ path: "/api/account/equipCollection",
149
+ summary: "Equip a skin collection",
150
+ responseSchema: "Loadout",
151
+ },
152
+ {
153
+ method: "POST",
154
+ namespace: "account",
155
+ action: "equipPreset",
156
+ path: "/api/account/equipPreset",
157
+ summary: "Equip a full loadout preset",
158
+ responseSchema: "Loadout",
159
+ },
160
+ {
161
+ method: "POST",
162
+ namespace: "account",
163
+ action: "diffLoadout",
164
+ path: "/api/account/diffLoadout",
165
+ summary: "Compare loadout against preset",
166
+ responseSchema: "LoadoutDiff",
167
+ },
168
+ {
169
+ method: "POST",
170
+ namespace: "account",
171
+ action: "activateContract",
172
+ path: "/api/account/activateContract",
173
+ summary: "Activate an agent contract",
174
+ },
175
+ {
176
+ method: "POST",
177
+ namespace: "account",
178
+ action: "addFavourite",
179
+ path: "/api/account/addFavourite",
180
+ summary: "Add skin to favourites",
181
+ },
182
+ {
183
+ method: "POST",
184
+ namespace: "account",
185
+ action: "removeFavourite",
186
+ path: "/api/account/removeFavourite",
187
+ summary: "Remove skin from favourites",
188
+ },
189
+ {
190
+ method: "POST",
191
+ namespace: "account",
192
+ action: "setActRankBadgeHidden",
193
+ path: "/api/account/setActRankBadgeHidden",
194
+ summary: "Hide or show act rank badge",
195
+ },
196
+ {
197
+ method: "POST",
198
+ namespace: "account",
199
+ action: "setLeaderboardAnonymized",
200
+ path: "/api/account/setLeaderboardAnonymized",
201
+ summary: "Anonymize or reveal leaderboard presence",
202
+ },
203
+ {
204
+ method: "POST",
205
+ namespace: "account",
206
+ action: "saveSettings",
207
+ path: "/api/account/saveSettings",
208
+ summary: "Save cloud player settings",
209
+ isConfirmGated: true,
210
+ responseSchema: "PlayerSettings",
211
+ },
212
+ {
213
+ method: "GET",
214
+ namespace: "social",
215
+ action: "friends",
216
+ path: "/api/social/friends",
217
+ summary: "Get friends list and presence",
218
+ responseSchema: "Friend",
219
+ },
220
+ {
221
+ method: "GET",
222
+ namespace: "social",
223
+ action: "friendRequests",
224
+ path: "/api/social/friendRequests",
225
+ summary: "Get friend requests",
226
+ responseSchema: "FriendRequest",
227
+ },
228
+ {
229
+ method: "GET",
230
+ namespace: "social",
231
+ action: "blocked",
232
+ path: "/api/social/blocked",
233
+ summary: "Get blocked players",
234
+ responseSchema: "BlockedPlayer",
235
+ },
236
+ {
237
+ method: "GET",
238
+ namespace: "social",
239
+ action: "conversations",
240
+ path: "/api/social/conversations",
241
+ summary: "Get chat conversations",
242
+ responseSchema: "Conversation",
243
+ },
244
+ {
245
+ method: "GET",
246
+ namespace: "social",
247
+ action: "messages",
248
+ path: "/api/social/messages",
249
+ summary: "Get chat messages",
250
+ responseSchema: "Message",
251
+ params: [
252
+ {
253
+ name: "cid",
254
+ type: "string",
255
+ description: "Conversation ID to filter messages",
256
+ },
257
+ ],
258
+ },
259
+ {
260
+ method: "GET",
261
+ namespace: "social",
262
+ action: "participants",
263
+ path: "/api/social/participants",
264
+ summary: "Get chat participants",
265
+ responseSchema: "Participant",
266
+ params: [
267
+ {
268
+ name: "cid",
269
+ type: "string",
270
+ description: "Conversation ID to filter participants",
271
+ },
272
+ ],
273
+ },
274
+ {
275
+ method: "POST",
276
+ namespace: "social",
277
+ action: "sendMessage",
278
+ path: "/api/social/sendMessage",
279
+ summary: "Send a chat message",
280
+ responseSchema: "Message",
281
+ },
282
+ {
283
+ method: "POST",
284
+ namespace: "social",
285
+ action: "sendFriendRequest",
286
+ path: "/api/social/sendFriendRequest",
287
+ summary: "Send a friend request",
288
+ responseSchema: "FriendRequest",
289
+ },
290
+ {
291
+ method: "POST",
292
+ namespace: "social",
293
+ action: "acceptFriendRequest",
294
+ path: "/api/social/acceptFriendRequest",
295
+ summary: "Accept a friend request",
296
+ responseSchema: "Friend",
297
+ },
298
+ {
299
+ method: "POST",
300
+ namespace: "social",
301
+ action: "declineFriendRequest",
302
+ path: "/api/social/declineFriendRequest",
303
+ summary: "Decline a friend request",
304
+ responseSchema: "FriendRequest",
305
+ },
306
+ {
307
+ method: "POST",
308
+ namespace: "social",
309
+ action: "cancelFriendRequest",
310
+ path: "/api/social/cancelFriendRequest",
311
+ summary: "Cancel an outgoing friend request",
312
+ responseSchema: "FriendRequest",
313
+ },
314
+ {
315
+ method: "POST",
316
+ namespace: "social",
317
+ action: "removeFriend",
318
+ path: "/api/social/removeFriend",
319
+ summary: "Remove a friend",
320
+ responseSchema: "Friend",
321
+ },
322
+ {
323
+ method: "POST",
324
+ namespace: "social",
325
+ action: "blockPlayer",
326
+ path: "/api/social/blockPlayer",
327
+ summary: "Block a player",
328
+ responseSchema: "BlockedPlayer",
329
+ },
330
+ {
331
+ method: "POST",
332
+ namespace: "social",
333
+ action: "unblockPlayer",
334
+ path: "/api/social/unblockPlayer",
335
+ summary: "Unblock a player",
336
+ responseSchema: "BlockedPlayer",
337
+ },
338
+ {
339
+ method: "GET",
340
+ namespace: "store",
341
+ action: "current",
342
+ path: "/api/store/current",
343
+ summary: "Get current store offers and storefront",
344
+ responseSchema: "Store",
345
+ params: [
346
+ {
347
+ name: "language",
348
+ type: "string",
349
+ description: "Locale code for localized item names",
350
+ },
351
+ ],
352
+ },
353
+ {
354
+ method: "GET",
355
+ namespace: "store",
356
+ action: "store",
357
+ path: "/api/store/store",
358
+ summary: "Get storefront alias",
359
+ alias: true,
360
+ responseSchema: "Store",
361
+ params: [
362
+ {
363
+ name: "language",
364
+ type: "string",
365
+ description: "Locale code for localized item names",
366
+ },
367
+ ],
368
+ },
369
+ {
370
+ method: "GET",
371
+ namespace: "store",
372
+ action: "offers",
373
+ path: "/api/store/offers",
374
+ summary: "Get all item offers and pricing",
375
+ responseSchema: "Offer",
376
+ },
377
+ {
378
+ method: "GET",
379
+ namespace: "store",
380
+ action: "order",
381
+ path: "/api/store/order",
382
+ summary: "Get store order details",
383
+ responseSchema: "Order",
384
+ params: [
385
+ {
386
+ name: "id",
387
+ type: "string",
388
+ description: "Order ID",
389
+ required: true,
390
+ },
391
+ ],
392
+ },
393
+ {
394
+ method: "GET",
395
+ namespace: "store",
396
+ action: "history",
397
+ path: "/api/store/history",
398
+ summary: "Get recorded store rotation history",
399
+ responseSchema: "StoreHistory",
400
+ params: [
401
+ {
402
+ name: "days",
403
+ type: "number",
404
+ description: "Number of past days to query",
405
+ },
406
+ ],
407
+ },
408
+ {
409
+ method: "GET",
410
+ namespace: "store",
411
+ action: "seen",
412
+ path: "/api/store/seen",
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
+ ],
422
+ },
423
+ {
424
+ method: "POST",
425
+ namespace: "store",
426
+ action: "revealNightMarket",
427
+ path: "/api/store/revealNightMarket",
428
+ summary: "Reveal night market cards",
429
+ responseSchema: "Store",
430
+ },
431
+ {
432
+ method: "POST",
433
+ namespace: "store",
434
+ action: "buy",
435
+ path: "/api/store/buy",
436
+ summary: "Purchase store offer or bundle",
437
+ isConfirmGated: true,
438
+ responseSchema: "Order",
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
+ },
488
+ {
489
+ method: "GET",
490
+ namespace: "matches",
491
+ action: "list",
492
+ path: "/api/matches/list",
493
+ summary: "List recent match summaries",
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
+ ],
507
+ },
508
+ {
509
+ method: "GET",
510
+ namespace: "matches",
511
+ action: "matches",
512
+ path: "/api/matches/matches",
513
+ summary: "List match summaries alias",
514
+ alias: true,
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
+ ],
528
+ },
529
+ {
530
+ method: "GET",
531
+ namespace: "matches",
532
+ action: "sync",
533
+ path: "/api/matches/sync",
534
+ summary: "Synchronize matches into cache",
535
+ responseSchema: "MatchSyncResult",
536
+ params: [
537
+ {
538
+ name: "maxPages",
539
+ type: "number",
540
+ description: "Maximum number of history pages to fetch",
541
+ },
542
+ ],
543
+ },
544
+ {
545
+ method: "GET",
546
+ namespace: "matches",
547
+ action: "known",
548
+ path: "/api/matches/known",
549
+ summary: "Get cached match summaries",
550
+ responseSchema: "MatchSummary",
551
+ params: [
552
+ {
553
+ name: "puuid",
554
+ type: "string",
555
+ description: "Target player PUUID (defaults to signed-in player)",
556
+ },
557
+ ],
558
+ },
559
+ {
560
+ method: "GET",
561
+ namespace: "matches",
562
+ action: "get",
563
+ path: "/api/matches/get",
564
+ summary: "Get full match details by ID",
565
+ responseSchema: "Match",
566
+ params: [
567
+ {
568
+ name: "id",
569
+ type: "string",
570
+ description: "Match ID",
571
+ required: true,
572
+ },
573
+ ],
574
+ },
575
+ {
576
+ method: "GET",
577
+ namespace: "matches",
578
+ action: "match",
579
+ path: "/api/matches/match",
580
+ summary: "Get match details alias",
581
+ alias: true,
582
+ responseSchema: "Match",
583
+ params: [
584
+ {
585
+ name: "id",
586
+ type: "string",
587
+ description: "Match ID",
588
+ required: true,
589
+ },
590
+ ],
591
+ },
592
+ {
593
+ method: "GET",
594
+ namespace: "matches",
595
+ action: "mmr",
596
+ path: "/api/matches/mmr",
597
+ summary: "Get current MMR and rating",
598
+ responseSchema: "Mmr",
599
+ },
600
+ {
601
+ method: "GET",
602
+ namespace: "matches",
603
+ action: "rankHistory",
604
+ path: "/api/matches/rankHistory",
605
+ summary: "Get competitive rating updates",
606
+ responseSchema: "RankChange",
607
+ params: [
608
+ {
609
+ name: "count",
610
+ type: "number",
611
+ description: "Number of rank updates to return",
612
+ },
613
+ ],
614
+ },
615
+ {
616
+ method: "GET",
617
+ namespace: "matches",
618
+ action: "live",
619
+ path: "/api/matches/live",
620
+ summary: "Get live pregame or coregame lobby",
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
+ ],
634
+ },
635
+ {
636
+ method: "GET",
637
+ namespace: "matches",
638
+ action: "listFor",
639
+ path: "/api/matches/listFor",
640
+ summary: "List matches for specific player",
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
+ ],
660
+ },
661
+ {
662
+ method: "GET",
663
+ namespace: "matches",
664
+ action: "mmrFor",
665
+ path: "/api/matches/mmrFor",
666
+ summary: "Get MMR for specific player",
667
+ responseSchema: "Mmr",
668
+ params: [
669
+ {
670
+ name: "puuid",
671
+ type: "string",
672
+ description: "Target player PUUID",
673
+ required: true,
674
+ },
675
+ ],
676
+ },
677
+ {
678
+ method: "GET",
679
+ namespace: "matches",
680
+ action: "rankHistoryFor",
681
+ path: "/api/matches/rankHistoryFor",
682
+ summary: "Get rank history for player",
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
+ ],
697
+ },
698
+ {
699
+ method: "GET",
700
+ namespace: "matches",
701
+ action: "leaderboard",
702
+ path: "/api/matches/leaderboard",
703
+ summary: "Get competitive leaderboard",
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
+ ],
727
+ },
728
+ {
729
+ method: "GET",
730
+ namespace: "matches",
731
+ action: "content",
732
+ path: "/api/matches/content",
733
+ summary: "Get seasonal content and acts",
734
+ responseSchema: "Content",
735
+ },
736
+ {
737
+ method: "GET",
738
+ namespace: "matches",
739
+ action: "premier",
740
+ path: "/api/matches/premier",
741
+ summary: "Get premier standings",
742
+ responseSchema: "Premier",
743
+ },
744
+ {
745
+ method: "GET",
746
+ namespace: "matches",
747
+ action: "trend",
748
+ path: "/api/matches/trend",
749
+ summary: "Get competitive rating trend",
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
+ ],
763
+ },
764
+ {
765
+ method: "GET",
766
+ namespace: "matches",
767
+ action: "summary",
768
+ path: "/api/matches/summary",
769
+ summary: "Get recent performance summary",
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
+ ],
788
+ },
789
+ {
790
+ method: "GET",
791
+ namespace: "matches",
792
+ action: "assess",
793
+ path: "/api/matches/assess",
794
+ summary: "Assess player rank anomalies",
795
+ responseSchema: "PlayerAssessment",
796
+ params: [
797
+ {
798
+ name: "puuid",
799
+ type: "string",
800
+ description: "Target player PUUID (defaults to signed-in player)",
801
+ },
802
+ ],
803
+ },
804
+ {
805
+ method: "POST",
806
+ namespace: "matches",
807
+ action: "selectAgent",
808
+ path: "/api/matches/selectAgent",
809
+ summary: "Select pregame agent",
810
+ responseSchema: "LiveMatch",
811
+ },
812
+ {
813
+ method: "POST",
814
+ namespace: "matches",
815
+ action: "lockAgent",
816
+ path: "/api/matches/lockAgent",
817
+ summary: "Lock pregame agent",
818
+ responseSchema: "LiveMatch",
819
+ },
820
+ {
821
+ method: "POST",
822
+ namespace: "matches",
823
+ action: "dodge",
824
+ path: "/api/matches/dodge",
825
+ summary: "Dodge pregame agent select",
826
+ isConfirmGated: true,
827
+ },
828
+ {
829
+ method: "POST",
830
+ namespace: "matches",
831
+ action: "leaveMatch",
832
+ path: "/api/matches/leaveMatch",
833
+ summary: "Leave active match",
834
+ isConfirmGated: true,
835
+ },
836
+ {
837
+ method: "GET",
838
+ namespace: "party",
839
+ action: "current",
840
+ path: "/api/party/current",
841
+ summary: "Get current party details",
842
+ responseSchema: "Party",
843
+ },
844
+ {
845
+ method: "GET",
846
+ namespace: "party",
847
+ action: "party",
848
+ path: "/api/party/party",
849
+ summary: "Get party alias",
850
+ alias: true,
851
+ responseSchema: "Party",
852
+ },
853
+ {
854
+ method: "GET",
855
+ namespace: "party",
856
+ action: "queues",
857
+ path: "/api/party/queues",
858
+ summary: "Get matchmaking queues",
859
+ responseSchema: "QueueConfig",
860
+ },
861
+ {
862
+ method: "GET",
863
+ namespace: "party",
864
+ action: "customGameConfigs",
865
+ path: "/api/party/customGameConfigs",
866
+ summary: "Get custom game configs",
867
+ responseSchema: "CustomGameConfigs",
868
+ },
869
+ {
870
+ method: "GET",
871
+ namespace: "party",
872
+ action: "invites",
873
+ path: "/api/party/invites",
874
+ summary: "Get party invites",
875
+ responseSchema: "PartyInvite",
876
+ },
877
+ {
878
+ method: "GET",
879
+ namespace: "party",
880
+ action: "requests",
881
+ path: "/api/party/requests",
882
+ summary: "Get party join requests",
883
+ responseSchema: "PartyRequest",
884
+ },
885
+ {
886
+ method: "POST",
887
+ namespace: "party",
888
+ action: "invite",
889
+ path: "/api/party/invite",
890
+ summary: "Invite player to party",
891
+ responseSchema: "Party",
892
+ },
893
+ {
894
+ method: "POST",
895
+ namespace: "party",
896
+ action: "kick",
897
+ path: "/api/party/kick",
898
+ summary: "Kick player from party",
899
+ responseSchema: "Party",
900
+ },
901
+ {
902
+ method: "POST",
903
+ namespace: "party",
904
+ action: "promote",
905
+ path: "/api/party/promote",
906
+ summary: "Promote player to party leader",
907
+ responseSchema: "Party",
908
+ },
909
+ {
910
+ method: "POST",
911
+ namespace: "party",
912
+ action: "createInviteCode",
913
+ path: "/api/party/createInviteCode",
914
+ summary: "Generate party code",
915
+ responseSchema: "Party",
916
+ },
917
+ {
918
+ method: "POST",
919
+ namespace: "party",
920
+ action: "revokeInviteCode",
921
+ path: "/api/party/revokeInviteCode",
922
+ summary: "Revoke party code",
923
+ responseSchema: "Party",
924
+ },
925
+ {
926
+ method: "POST",
927
+ namespace: "party",
928
+ action: "joinByCode",
929
+ path: "/api/party/joinByCode",
930
+ summary: "Join party using code",
931
+ responseSchema: "Party",
932
+ },
933
+ {
934
+ method: "POST",
935
+ namespace: "party",
936
+ action: "setReady",
937
+ path: "/api/party/setReady",
938
+ summary: "Set party ready status",
939
+ responseSchema: "Party",
940
+ },
941
+ {
942
+ method: "POST",
943
+ namespace: "party",
944
+ action: "setQueue",
945
+ path: "/api/party/setQueue",
946
+ summary: "Set party matchmaking queue",
947
+ responseSchema: "Party",
948
+ },
949
+ {
950
+ method: "POST",
951
+ namespace: "party",
952
+ action: "setAccessibility",
953
+ path: "/api/party/setAccessibility",
954
+ summary: "Set party accessibility",
955
+ responseSchema: "Party",
956
+ },
957
+ {
958
+ method: "POST",
959
+ namespace: "party",
960
+ action: "startMatchmaking",
961
+ path: "/api/party/startMatchmaking",
962
+ summary: "Start matchmaking queue",
963
+ responseSchema: "Party",
964
+ },
965
+ {
966
+ method: "POST",
967
+ namespace: "party",
968
+ action: "stopMatchmaking",
969
+ path: "/api/party/stopMatchmaking",
970
+ summary: "Stop matchmaking queue",
971
+ responseSchema: "Party",
972
+ },
973
+ {
974
+ method: "POST",
975
+ namespace: "party",
976
+ action: "leave",
977
+ path: "/api/party/leave",
978
+ summary: "Leave party",
979
+ responseSchema: "Party",
980
+ },
981
+ {
982
+ method: "POST",
983
+ namespace: "party",
984
+ action: "join",
985
+ path: "/api/party/join",
986
+ summary: "Join party by ID",
987
+ responseSchema: "Party",
988
+ },
989
+ {
990
+ method: "POST",
991
+ namespace: "party",
992
+ action: "declineInvite",
993
+ path: "/api/party/declineInvite",
994
+ summary: "Decline party invite",
995
+ },
996
+ {
997
+ method: "POST",
998
+ namespace: "party",
999
+ action: "requestToJoin",
1000
+ path: "/api/party/requestToJoin",
1001
+ summary: "Request to join party",
1002
+ },
1003
+ {
1004
+ method: "POST",
1005
+ namespace: "party",
1006
+ action: "declineRequest",
1007
+ path: "/api/party/declineRequest",
1008
+ summary: "Decline join request",
1009
+ },
1010
+ {
1011
+ method: "POST",
1012
+ namespace: "party",
1013
+ action: "makeCustomGame",
1014
+ path: "/api/party/makeCustomGame",
1015
+ summary: "Convert party to custom game",
1016
+ responseSchema: "Party",
1017
+ },
1018
+ {
1019
+ method: "POST",
1020
+ namespace: "party",
1021
+ action: "makeDefault",
1022
+ path: "/api/party/makeDefault",
1023
+ summary: "Set party default queue",
1024
+ responseSchema: "Party",
1025
+ },
1026
+ {
1027
+ method: "POST",
1028
+ namespace: "party",
1029
+ action: "setCustomGameSettings",
1030
+ path: "/api/party/setCustomGameSettings",
1031
+ summary: "Configure custom game",
1032
+ responseSchema: "Party",
1033
+ },
1034
+ {
1035
+ method: "POST",
1036
+ namespace: "party",
1037
+ action: "setTeam",
1038
+ path: "/api/party/setTeam",
1039
+ summary: "Set player team in custom game",
1040
+ responseSchema: "Party",
1041
+ },
1042
+ {
1043
+ method: "POST",
1044
+ namespace: "party",
1045
+ action: "startCustomGame",
1046
+ path: "/api/party/startCustomGame",
1047
+ summary: "Start custom game match",
1048
+ responseSchema: "Party",
1049
+ },
1050
+ {
1051
+ method: "POST",
1052
+ namespace: "party",
1053
+ action: "balanceTeams",
1054
+ path: "/api/party/balanceTeams",
1055
+ summary: "Auto-balance custom game teams",
1056
+ responseSchema: "Party",
1057
+ },
1058
+ {
1059
+ method: "POST",
1060
+ namespace: "party",
1061
+ action: "setPreferredServers",
1062
+ path: "/api/party/setPreferredServers",
1063
+ summary: "Set preferred servers",
1064
+ responseSchema: "Party",
1065
+ },
1066
+ {
1067
+ method: "POST",
1068
+ namespace: "party",
1069
+ action: "setModerator",
1070
+ path: "/api/party/setModerator",
1071
+ summary: "Set moderator status",
1072
+ responseSchema: "Party",
1073
+ },
1074
+ {
1075
+ method: "POST",
1076
+ namespace: "party",
1077
+ action: "refresh",
1078
+ path: "/api/party/refresh",
1079
+ summary: "Refresh party state",
1080
+ responseSchema: "Party",
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
+ },
1183
+ ];
1184
+ function isDryRun(query, body, headers) {
1185
+ if (query.dryRun !== undefined) {
1186
+ return query.dryRun === "1" || query.dryRun.toLowerCase() === "true";
1187
+ }
1188
+ if (headers["x-dry-run"] !== undefined) {
1189
+ const val = String(headers["x-dry-run"]).toLowerCase();
1190
+ return val === "1" || val === "true";
1191
+ }
1192
+ if (body.dryRun !== undefined) {
1193
+ return Boolean(body.dryRun);
1194
+ }
1195
+ return true;
1196
+ }
1197
+ export async function dispatchApiRoute(client, namespace, methodName, query, body, req) {
1198
+ const normMethod = methodName.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
1199
+ const routeKey = `${namespace}/${normMethod}`;
1200
+ const isWrite = req.method === "POST";
1201
+ const dryRun = isDryRun(query, body, req.headers);
1202
+ if (isWrite && CONFIRM_GATED_ROUTES.has(routeKey)) {
1203
+ const hasConfirmHeader = String(req.headers["x-confirm"] ?? "").toLowerCase() === "yes";
1204
+ const hasConfirmBody = body.confirm === true;
1205
+ if (!dryRun && (!hasConfirmHeader || !hasConfirmBody)) {
1206
+ throw new ValidationError("confirm-required", `${normMethod} requires explicit confirmation: header X-Confirm: yes and body { confirm: true }`);
1207
+ }
1208
+ }
1209
+ if (namespace === "account") {
1210
+ switch (normMethod) {
1211
+ case "whoami":
1212
+ return client.account.whoami();
1213
+ case "ownedItems":
1214
+ return client.account.ownedItems({ language: query.language });
1215
+ case "loadout":
1216
+ return client.account.loadout();
1217
+ case "collectionValue":
1218
+ return client.account.collectionValue();
1219
+ case "wallet":
1220
+ return client.account.wallet();
1221
+ case "xp":
1222
+ return client.account.xp();
1223
+ case "contracts":
1224
+ return client.account.contracts();
1225
+ case "missions":
1226
+ return client.account.missions();
1227
+ case "penalties":
1228
+ return client.account.penalties();
1229
+ case "favourites":
1230
+ return client.account.favourites();
1231
+ case "session":
1232
+ return client.account.session();
1233
+ case "config":
1234
+ return client.account.config();
1235
+ case "settings":
1236
+ return client.account.settings();
1237
+ case "client":
1238
+ return client.account.client();
1239
+ case "exportLoadout":
1240
+ return client.account.exportLoadout();
1241
+ case "diffLoadout":
1242
+ return client.account.diffLoadout((body.preset ?? body));
1243
+ case "equip":
1244
+ return dryRun
1245
+ ? client.account.validateEquip(body)
1246
+ : client.account.equip(body);
1247
+ case "equipCollection": {
1248
+ const uuids = (body.skinUuids ?? body);
1249
+ return dryRun
1250
+ ? client.account.validateEquipCollection(uuids)
1251
+ : client.account.equipCollection(uuids);
1252
+ }
1253
+ case "equipPreset":
1254
+ return dryRun
1255
+ ? client.account.validateEquipPreset(body)
1256
+ : client.account.equipPreset(body);
1257
+ case "activateContract": {
1258
+ const uuid = String(body.uuid ?? body.contractId ?? query.uuid);
1259
+ return dryRun
1260
+ ? client.account.validateActivateContract(uuid)
1261
+ : client.account.activateContract(uuid);
1262
+ }
1263
+ case "addFavourite": {
1264
+ const skin = String(body.skin ?? body.itemId ?? query.skin);
1265
+ return dryRun
1266
+ ? client.account.validateAddFavourite(skin)
1267
+ : client.account.addFavourite(skin);
1268
+ }
1269
+ case "removeFavourite": {
1270
+ const skin = String(body.skin ?? body.itemId ?? query.skin);
1271
+ return dryRun
1272
+ ? client.account.validateRemoveFavourite(skin)
1273
+ : client.account.removeFavourite(skin);
1274
+ }
1275
+ case "setActRankBadgeHidden": {
1276
+ const hidden = Boolean(body.hidden ?? query.hidden === "true");
1277
+ return dryRun
1278
+ ? client.account.validateSetActRankBadgeHidden(hidden)
1279
+ : client.account.setActRankBadgeHidden(hidden);
1280
+ }
1281
+ case "setLeaderboardAnonymized": {
1282
+ const anon = Boolean(body.anonymized ?? query.anonymized === "true");
1283
+ return dryRun
1284
+ ? client.account.validateSetLeaderboardAnonymized(anon)
1285
+ : client.account.setLeaderboardAnonymized(anon);
1286
+ }
1287
+ case "saveSettings": {
1288
+ const data = body.data ?? body;
1289
+ return dryRun
1290
+ ? client.account.validateSaveSettings(data, { confirm: true })
1291
+ : client.account.saveSettings(data, { confirm: true });
1292
+ }
1293
+ }
1294
+ }
1295
+ if (namespace === "social") {
1296
+ switch (normMethod) {
1297
+ case "friends":
1298
+ return client.social.friends();
1299
+ case "friendRequests":
1300
+ return client.social.friendRequests();
1301
+ case "blocked":
1302
+ return client.social.blocked();
1303
+ case "conversations":
1304
+ return client.social.conversations();
1305
+ case "messages":
1306
+ return client.social.messages(query.cid ?? query.conversationId);
1307
+ case "participants":
1308
+ return client.social.participants(query.cid ?? query.conversationId);
1309
+ case "sendMessage": {
1310
+ const target = (body.to ?? {
1311
+ puuid: String(body.puuid ?? ""),
1312
+ conversationId: String(body.cid ?? ""),
1313
+ });
1314
+ const text = String(body.text ?? "");
1315
+ return dryRun
1316
+ ? client.social.validateSendMessage(target, text)
1317
+ : client.social.sendMessage(target, text);
1318
+ }
1319
+ case "sendFriendRequest": {
1320
+ const riotId = String(body.riotId ?? query.riotId);
1321
+ return dryRun
1322
+ ? client.social.validateSendFriendRequest(riotId)
1323
+ : client.social.sendFriendRequest(riotId);
1324
+ }
1325
+ case "acceptFriendRequest": {
1326
+ const puuid = String(body.puuid ?? query.puuid);
1327
+ return dryRun
1328
+ ? client.social.validateAcceptFriendRequest(puuid)
1329
+ : client.social.acceptFriendRequest(puuid);
1330
+ }
1331
+ case "declineFriendRequest": {
1332
+ const puuid = String(body.puuid ?? query.puuid);
1333
+ return dryRun
1334
+ ? client.social.validateDeclineFriendRequest(puuid)
1335
+ : client.social.declineFriendRequest(puuid);
1336
+ }
1337
+ case "cancelFriendRequest": {
1338
+ const puuid = String(body.puuid ?? query.puuid);
1339
+ return dryRun
1340
+ ? client.social.validateCancelFriendRequest(puuid)
1341
+ : client.social.cancelFriendRequest(puuid);
1342
+ }
1343
+ case "removeFriend": {
1344
+ const puuid = String(body.puuid ?? query.puuid);
1345
+ return dryRun
1346
+ ? client.social.validateRemoveFriend(puuid)
1347
+ : client.social.removeFriend(puuid);
1348
+ }
1349
+ case "blockPlayer": {
1350
+ const target = String(body.target ?? body.puuid ?? query.target);
1351
+ return dryRun
1352
+ ? client.social.validateBlockPlayer(target)
1353
+ : client.social.blockPlayer(target);
1354
+ }
1355
+ case "unblockPlayer": {
1356
+ const puuid = String(body.puuid ?? query.puuid);
1357
+ return dryRun
1358
+ ? client.social.validateUnblockPlayer(puuid)
1359
+ : client.social.unblockPlayer(puuid);
1360
+ }
1361
+ }
1362
+ }
1363
+ if (namespace === "store") {
1364
+ switch (normMethod) {
1365
+ case "current":
1366
+ case "store":
1367
+ return client.store.current({ language: query.language });
1368
+ case "offers":
1369
+ return client.store.offers();
1370
+ case "order":
1371
+ return client.store.order(query.id);
1372
+ case "history":
1373
+ return client.store.history({ days: query.days ? Number(query.days) : undefined });
1374
+ case "seen":
1375
+ return client.store.seen(query.skin);
1376
+ case "revealNightMarket":
1377
+ return dryRun ? client.store.validateRevealNightMarket() : client.store.revealNightMarket();
1378
+ case "buy": {
1379
+ const target = (body.target ?? body);
1380
+ return dryRun
1381
+ ? client.store.validateBuy(target, { confirm: true })
1382
+ : client.store.buy(target, { confirm: true });
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));
1392
+ }
1393
+ }
1394
+ if (namespace === "matches") {
1395
+ switch (normMethod) {
1396
+ case "list":
1397
+ case "matches":
1398
+ return client.matches.list({
1399
+ count: query.count ? Number(query.count) : undefined,
1400
+ queue: query.queue,
1401
+ });
1402
+ case "sync":
1403
+ return client.matches.sync({
1404
+ maxPages: query.maxPages
1405
+ ? Number(query.maxPages)
1406
+ : query.pages
1407
+ ? Number(query.pages)
1408
+ : undefined,
1409
+ });
1410
+ case "known":
1411
+ return client.matches.known(query.puuid);
1412
+ case "get":
1413
+ case "match":
1414
+ return client.matches.get(query.id);
1415
+ case "mmr":
1416
+ return client.matches.mmr();
1417
+ case "rankHistory":
1418
+ return client.matches.rankHistory({ count: query.count ? Number(query.count) : undefined });
1419
+ case "live":
1420
+ return client.matches.live({
1421
+ ranks: query.ranks === "true" || query.ranks === "1",
1422
+ loadouts: query.loadouts !== "false" && query.loadouts !== "0",
1423
+ });
1424
+ case "listFor":
1425
+ return client.matches.listFor(query.puuid, {
1426
+ count: query.count ? Number(query.count) : undefined,
1427
+ queue: query.queue,
1428
+ });
1429
+ case "mmrFor":
1430
+ return client.matches.mmrFor(query.puuid);
1431
+ case "rankHistoryFor":
1432
+ return client.matches.rankHistoryFor(query.puuid, {
1433
+ count: query.count ? Number(query.count) : undefined,
1434
+ });
1435
+ case "leaderboard":
1436
+ return client.matches.leaderboard({
1437
+ season: query.season,
1438
+ start: query.start ? Number(query.start) : undefined,
1439
+ size: query.size ? Number(query.size) : undefined,
1440
+ query: query.query,
1441
+ });
1442
+ case "content":
1443
+ return client.matches.content();
1444
+ case "premier":
1445
+ return client.matches.premier();
1446
+ case "trend":
1447
+ return client.matches.trend({
1448
+ count: query.count ? Number(query.count) : undefined,
1449
+ puuid: query.puuid,
1450
+ });
1451
+ case "summary":
1452
+ return client.matches.summary({
1453
+ count: query.count ? Number(query.count) : undefined,
1454
+ queue: query.queue,
1455
+ puuid: query.puuid,
1456
+ });
1457
+ case "assess":
1458
+ return client.matches.assess(query.puuid);
1459
+ case "selectAgent": {
1460
+ const agent = String(body.agent ?? query.agent);
1461
+ return dryRun
1462
+ ? client.matches.validateSelectAgent(agent)
1463
+ : client.matches.selectAgent(agent);
1464
+ }
1465
+ case "lockAgent": {
1466
+ const agent = String(body.agent ?? query.agent);
1467
+ return dryRun ? client.matches.validateLockAgent(agent) : client.matches.lockAgent(agent);
1468
+ }
1469
+ case "dodge":
1470
+ return dryRun
1471
+ ? client.matches.validateDodge({ confirm: true })
1472
+ : client.matches.dodge({ confirm: true });
1473
+ case "leaveMatch":
1474
+ return dryRun
1475
+ ? client.matches.validateLeaveMatch({ confirm: true })
1476
+ : client.matches.leaveMatch({ confirm: true });
1477
+ }
1478
+ }
1479
+ if (namespace === "party") {
1480
+ switch (normMethod) {
1481
+ case "current":
1482
+ case "party":
1483
+ return client.party.current();
1484
+ case "queues":
1485
+ return client.party.queues();
1486
+ case "customGameConfigs":
1487
+ return client.party.customGameConfigs();
1488
+ case "invites":
1489
+ return client.party.invites();
1490
+ case "requests":
1491
+ return client.party.requests();
1492
+ case "invite": {
1493
+ const riotId = String(body.riotId ?? query.riotId);
1494
+ return dryRun ? client.party.validateInvite(riotId) : client.party.invite(riotId);
1495
+ }
1496
+ case "kick": {
1497
+ const puuid = String(body.puuid ?? query.puuid);
1498
+ return dryRun ? client.party.validateKick(puuid) : client.party.kick(puuid);
1499
+ }
1500
+ case "promote": {
1501
+ const puuid = String(body.puuid ?? query.puuid);
1502
+ return dryRun ? client.party.validatePromote(puuid) : client.party.promote(puuid);
1503
+ }
1504
+ case "createInviteCode":
1505
+ return dryRun ? client.party.validateCreateInviteCode() : client.party.createInviteCode();
1506
+ case "revokeInviteCode":
1507
+ return dryRun ? client.party.validateRevokeInviteCode() : client.party.revokeInviteCode();
1508
+ case "joinByCode": {
1509
+ const code = String(body.code ?? query.code);
1510
+ return dryRun ? client.party.validateJoinByCode(code) : client.party.joinByCode(code);
1511
+ }
1512
+ case "setReady": {
1513
+ const ready = Boolean(body.ready ?? query.ready === "true");
1514
+ return dryRun ? client.party.validateSetReady(ready) : client.party.setReady(ready);
1515
+ }
1516
+ case "setQueue": {
1517
+ const queue = String(body.queue ?? query.queue);
1518
+ return dryRun ? client.party.validateSetQueue(queue) : client.party.setQueue(queue);
1519
+ }
1520
+ case "setAccessibility": {
1521
+ const acc = (body.accessibility ?? query.accessibility);
1522
+ return dryRun
1523
+ ? client.party.validateSetAccessibility(acc)
1524
+ : client.party.setAccessibility(acc);
1525
+ }
1526
+ case "startMatchmaking":
1527
+ return dryRun ? client.party.validateStartMatchmaking() : client.party.startMatchmaking();
1528
+ case "stopMatchmaking":
1529
+ return dryRun ? client.party.validateStopMatchmaking() : client.party.stopMatchmaking();
1530
+ case "leave":
1531
+ return dryRun ? client.party.validateLeave() : client.party.leave();
1532
+ case "join": {
1533
+ const partyId = String(body.partyId ?? query.partyId);
1534
+ return dryRun ? client.party.validateJoin(partyId) : client.party.join(partyId);
1535
+ }
1536
+ case "declineInvite": {
1537
+ const inviteId = String(body.inviteId ?? query.inviteId);
1538
+ return dryRun
1539
+ ? client.party.validateDeclineInvite(inviteId)
1540
+ : client.party.declineInvite(inviteId);
1541
+ }
1542
+ case "requestToJoin": {
1543
+ const partyId = String(body.partyId ?? query.partyId);
1544
+ return dryRun
1545
+ ? client.party.validateRequestToJoin(partyId)
1546
+ : client.party.requestToJoin(partyId);
1547
+ }
1548
+ case "declineRequest": {
1549
+ const requestId = String(body.requestId ?? query.requestId);
1550
+ return dryRun
1551
+ ? client.party.validateDeclineRequest(requestId)
1552
+ : client.party.declineRequest(requestId);
1553
+ }
1554
+ case "makeCustomGame":
1555
+ return dryRun ? client.party.validateMakeCustomGame() : client.party.makeCustomGame();
1556
+ case "makeDefault": {
1557
+ const queue = String(body.queue ?? query.queue);
1558
+ return dryRun ? client.party.validateMakeDefault(queue) : client.party.makeDefault(queue);
1559
+ }
1560
+ case "setCustomGameSettings": {
1561
+ const settings = (body.settings ?? body);
1562
+ return dryRun
1563
+ ? client.party.validateSetCustomGameSettings(settings)
1564
+ : client.party.setCustomGameSettings(settings);
1565
+ }
1566
+ case "setTeam": {
1567
+ const puuid = String(body.puuid ?? query.puuid);
1568
+ const team = String(body.team ?? query.team);
1569
+ return dryRun
1570
+ ? client.party.validateSetTeam(puuid, team)
1571
+ : client.party.setTeam(puuid, team);
1572
+ }
1573
+ case "startCustomGame":
1574
+ return dryRun ? client.party.validateStartCustomGame() : client.party.startCustomGame();
1575
+ case "balanceTeams":
1576
+ return dryRun ? client.party.validateBalanceTeams() : client.party.balanceTeams();
1577
+ case "setPreferredServers": {
1578
+ const ids = (body.ids ?? body);
1579
+ return dryRun
1580
+ ? client.party.validateSetPreferredServers(ids)
1581
+ : client.party.setPreferredServers(ids);
1582
+ }
1583
+ case "setModerator": {
1584
+ const puuid = String(body.puuid ?? query.puuid);
1585
+ const isMod = Boolean(body.isModerator ?? query.isModerator === "true");
1586
+ return dryRun
1587
+ ? client.party.validateSetModerator(puuid, isMod)
1588
+ : client.party.setModerator(puuid, isMod);
1589
+ }
1590
+ case "refresh":
1591
+ return dryRun ? client.party.validateRefresh() : client.party.refresh();
1592
+ }
1593
+ }
1594
+ const official = namespace === "official" && dispatchOfficialRoute(client, normMethod, query);
1595
+ if (official)
1596
+ return official;
1597
+ throw new ValidationError("route-not-found", `Unknown endpoint: ${req.method} /api/${namespace}/${methodName}`);
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
+ }
1631
+ //# sourceMappingURL=routes.js.map