@voxary/valorant-client 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +122 -3
- package/dist/index.cjs +2625 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +11856 -0
- package/dist/index.d.ts +11856 -0
- package/dist/index.js +2569 -0
- package/dist/index.js.map +1 -0
- package/package.json +67 -4
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2625 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/index.ts
|
|
32
|
+
var index_exports = {};
|
|
33
|
+
__export(index_exports, {
|
|
34
|
+
MissingContextError: () => MissingContextError,
|
|
35
|
+
MissingParameterError: () => MissingParameterError,
|
|
36
|
+
ValorantApiError: () => ValorantApiError,
|
|
37
|
+
ValorantAuthError: () => ValorantAuthError,
|
|
38
|
+
ValorantClient: () => ValorantClient,
|
|
39
|
+
ValorantContext: () => ValorantContext,
|
|
40
|
+
ValorantError: () => ValorantError,
|
|
41
|
+
ValorantNetworkError: () => ValorantNetworkError,
|
|
42
|
+
ValorantRateLimitError: () => ValorantRateLimitError,
|
|
43
|
+
ValorantValidationError: () => ValorantValidationError,
|
|
44
|
+
fetchTransport: () => fetchTransport,
|
|
45
|
+
isRegion: () => isRegion,
|
|
46
|
+
localTransport: () => localTransport,
|
|
47
|
+
parseAuthRedirect: () => parseAuthRedirect,
|
|
48
|
+
parseLockfile: () => parseLockfile,
|
|
49
|
+
readLockfile: () => readLockfile,
|
|
50
|
+
registry: () => registry,
|
|
51
|
+
shardForRegion: () => shardForRegion
|
|
52
|
+
});
|
|
53
|
+
module.exports = __toCommonJS(index_exports);
|
|
54
|
+
|
|
55
|
+
// src/api/groups/pvp.ts
|
|
56
|
+
var import_valorant_api_types = require("valorant-api-types");
|
|
57
|
+
|
|
58
|
+
// src/endpoints/riot/account.ts
|
|
59
|
+
var import_zod = require("zod");
|
|
60
|
+
|
|
61
|
+
// src/endpoints/riot/shared.ts
|
|
62
|
+
var player = { token: true, entitlement: true, clientVersion: true, clientPlatform: true };
|
|
63
|
+
|
|
64
|
+
// src/endpoints/riot/account.ts
|
|
65
|
+
var dailyTicketEndpoint = {
|
|
66
|
+
name: "Daily Ticket",
|
|
67
|
+
description: "Daily ticket rewards and the matches already counted.",
|
|
68
|
+
category: "Account Endpoints",
|
|
69
|
+
type: "pd",
|
|
70
|
+
suffix: "daily-ticket/v1/{puuid}",
|
|
71
|
+
riotRequirements: player,
|
|
72
|
+
responses: { "200": import_zod.z.object({
|
|
73
|
+
Version: import_zod.z.number(),
|
|
74
|
+
DailyRewards: import_zod.z.object({
|
|
75
|
+
RemainingLifetimeSeconds: import_zod.z.number(),
|
|
76
|
+
BonusMilestonesPending: import_zod.z.number(),
|
|
77
|
+
Milestones: import_zod.z.array(import_zod.z.object({
|
|
78
|
+
Progress: import_zod.z.number(),
|
|
79
|
+
BonusApplied: import_zod.z.boolean()
|
|
80
|
+
}))
|
|
81
|
+
}),
|
|
82
|
+
ProcessedMatches: import_zod.z.array(import_zod.z.object({
|
|
83
|
+
ID: import_zod.z.string(),
|
|
84
|
+
CreatedAt: import_zod.z.string(),
|
|
85
|
+
DailyExpireTime: import_zod.z.string(),
|
|
86
|
+
PreviousDailyExpireTime: import_zod.z.string(),
|
|
87
|
+
ProgressBefore: import_zod.z.number(),
|
|
88
|
+
ProgressAfter: import_zod.z.number(),
|
|
89
|
+
XP: import_zod.z.number(),
|
|
90
|
+
SoftCurrency: import_zod.z.number(),
|
|
91
|
+
WasPenalized: import_zod.z.boolean(),
|
|
92
|
+
BonusesApplied: import_zod.z.number(),
|
|
93
|
+
DailyBonusState: import_zod.z.array(import_zod.z.boolean())
|
|
94
|
+
}))
|
|
95
|
+
}) }
|
|
96
|
+
};
|
|
97
|
+
var dailyTicketQueueConfigEndpoint = {
|
|
98
|
+
name: "Daily Ticket Queue Config",
|
|
99
|
+
description: "Which queues count for the daily ticket.",
|
|
100
|
+
category: "Account Endpoints",
|
|
101
|
+
type: "pd",
|
|
102
|
+
suffix: "daily-ticket/v1/queue-config",
|
|
103
|
+
riotRequirements: player,
|
|
104
|
+
responses: { "200": import_zod.z.object({
|
|
105
|
+
default: import_zod.z.object({
|
|
106
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
107
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
108
|
+
}),
|
|
109
|
+
queueOverrides: import_zod.z.object({
|
|
110
|
+
abilitydraftarena: import_zod.z.object({
|
|
111
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
112
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
113
|
+
}),
|
|
114
|
+
competitive: import_zod.z.object({
|
|
115
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
116
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
117
|
+
}),
|
|
118
|
+
console_abilitydraftarena: import_zod.z.object({
|
|
119
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
120
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
121
|
+
}),
|
|
122
|
+
console_competitive: import_zod.z.object({
|
|
123
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
124
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
125
|
+
}),
|
|
126
|
+
console_dodgeball: import_zod.z.object({
|
|
127
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
128
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
129
|
+
}),
|
|
130
|
+
console_fortcollins: import_zod.z.object({
|
|
131
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
132
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
133
|
+
}),
|
|
134
|
+
console_hurm: import_zod.z.object({
|
|
135
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
136
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
137
|
+
}),
|
|
138
|
+
console_newmap: import_zod.z.object({
|
|
139
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
140
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
141
|
+
}),
|
|
142
|
+
console_skirmish2v2: import_zod.z.object({
|
|
143
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
144
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
145
|
+
}),
|
|
146
|
+
console_skirmishascension1v1: import_zod.z.object({
|
|
147
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
148
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
149
|
+
}),
|
|
150
|
+
console_skirmishascension2v2: import_zod.z.object({
|
|
151
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
152
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
153
|
+
}),
|
|
154
|
+
console_snowball: import_zod.z.object({
|
|
155
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
156
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
157
|
+
}),
|
|
158
|
+
console_spikerush: import_zod.z.object({
|
|
159
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
160
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
161
|
+
}),
|
|
162
|
+
console_swiftplay: import_zod.z.object({
|
|
163
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
164
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
165
|
+
}),
|
|
166
|
+
console_unrated: import_zod.z.object({
|
|
167
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
168
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
169
|
+
}),
|
|
170
|
+
console_valaram: import_zod.z.object({
|
|
171
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
172
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
173
|
+
}),
|
|
174
|
+
dodgeball: import_zod.z.object({
|
|
175
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
176
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
177
|
+
}),
|
|
178
|
+
fortcollins: import_zod.z.object({
|
|
179
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
180
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
181
|
+
}),
|
|
182
|
+
ggteam: import_zod.z.object({
|
|
183
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
184
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
185
|
+
}),
|
|
186
|
+
hurm: import_zod.z.object({
|
|
187
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
188
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
189
|
+
}),
|
|
190
|
+
newmap: import_zod.z.object({
|
|
191
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
192
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
193
|
+
}),
|
|
194
|
+
premier: import_zod.z.object({
|
|
195
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
196
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
197
|
+
}),
|
|
198
|
+
skirmish2v2: import_zod.z.object({
|
|
199
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
200
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
201
|
+
}),
|
|
202
|
+
skirmishascension1v1: import_zod.z.object({
|
|
203
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
204
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
205
|
+
}),
|
|
206
|
+
skirmishascension2v2: import_zod.z.object({
|
|
207
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
208
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
209
|
+
}),
|
|
210
|
+
snowball: import_zod.z.object({
|
|
211
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
212
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
213
|
+
}),
|
|
214
|
+
spikerush: import_zod.z.object({
|
|
215
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
216
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
217
|
+
}),
|
|
218
|
+
swiftplay: import_zod.z.object({
|
|
219
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
220
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
221
|
+
}),
|
|
222
|
+
unrated: import_zod.z.object({
|
|
223
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
224
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
225
|
+
}),
|
|
226
|
+
valaram: import_zod.z.object({
|
|
227
|
+
flatProgressPerMatch: import_zod.z.number(),
|
|
228
|
+
progressPerRoundWin: import_zod.z.boolean()
|
|
229
|
+
})
|
|
230
|
+
})
|
|
231
|
+
}) }
|
|
232
|
+
};
|
|
233
|
+
var favoritesEndpoint = {
|
|
234
|
+
name: "Favorites",
|
|
235
|
+
description: "Favorited store content of the player.",
|
|
236
|
+
category: "Account Endpoints",
|
|
237
|
+
type: "pd",
|
|
238
|
+
suffix: "favorites/v1/players/{puuid}/favorites",
|
|
239
|
+
riotRequirements: player,
|
|
240
|
+
responses: { "200": import_zod.z.object({
|
|
241
|
+
Subject: import_zod.z.string(),
|
|
242
|
+
FavoritedContent: import_zod.z.record(import_zod.z.string(), import_zod.z.object({
|
|
243
|
+
FavoriteID: import_zod.z.string(),
|
|
244
|
+
ItemID: import_zod.z.string()
|
|
245
|
+
}))
|
|
246
|
+
}) }
|
|
247
|
+
};
|
|
248
|
+
var goldstarsEndpoint = {
|
|
249
|
+
name: "Goldstars",
|
|
250
|
+
description: "Goldstar definitions. Field names are obfuscated by the game.",
|
|
251
|
+
category: "Account Endpoints",
|
|
252
|
+
type: "pd",
|
|
253
|
+
suffix: "goldstars/v1/goldstars",
|
|
254
|
+
riotRequirements: player,
|
|
255
|
+
responses: { "200": import_zod.z.array(import_zod.z.object({
|
|
256
|
+
id: import_zod.z.string(),
|
|
257
|
+
tempT: import_zod.z.number()
|
|
258
|
+
})) }
|
|
259
|
+
};
|
|
260
|
+
var goldstarsPlayerEndpoint = {
|
|
261
|
+
name: "Goldstars Player",
|
|
262
|
+
description: "Goldstars of a player. Field names are obfuscated by the game.",
|
|
263
|
+
category: "Account Endpoints",
|
|
264
|
+
type: "pd",
|
|
265
|
+
suffix: "goldstars/v1/players/{puuid}",
|
|
266
|
+
riotRequirements: player,
|
|
267
|
+
responses: { "200": import_zod.z.object({
|
|
268
|
+
puuid: import_zod.z.string(),
|
|
269
|
+
version: import_zod.z.number(),
|
|
270
|
+
tempS: import_zod.z.object({
|
|
271
|
+
"00000000-0000-0000-0000-000000000000": import_zod.z.object({
|
|
272
|
+
tempS: import_zod.z.string(),
|
|
273
|
+
tempA: import_zod.z.record(import_zod.z.string(), import_zod.z.object({
|
|
274
|
+
id: import_zod.z.string(),
|
|
275
|
+
tempC: import_zod.z.number(),
|
|
276
|
+
tempB: import_zod.z.number()
|
|
277
|
+
}))
|
|
278
|
+
}),
|
|
279
|
+
"8102cd81-43a0-d0d7-bd59-47b8fe9bed1b": import_zod.z.object({
|
|
280
|
+
tempS: import_zod.z.string(),
|
|
281
|
+
tempA: import_zod.z.record(import_zod.z.string(), import_zod.z.object({
|
|
282
|
+
id: import_zod.z.string(),
|
|
283
|
+
tempC: import_zod.z.number(),
|
|
284
|
+
tempB: import_zod.z.number()
|
|
285
|
+
}))
|
|
286
|
+
})
|
|
287
|
+
}),
|
|
288
|
+
tempM: import_zod.z.array(import_zod.z.object({
|
|
289
|
+
id: import_zod.z.string(),
|
|
290
|
+
tempG: import_zod.z.number(),
|
|
291
|
+
tempP: import_zod.z.record(import_zod.z.string(), import_zod.z.object({
|
|
292
|
+
tempA: import_zod.z.record(import_zod.z.string(), import_zod.z.object({
|
|
293
|
+
id: import_zod.z.string(),
|
|
294
|
+
tempV: import_zod.z.number(),
|
|
295
|
+
tempB: import_zod.z.boolean()
|
|
296
|
+
}))
|
|
297
|
+
}))
|
|
298
|
+
}))
|
|
299
|
+
}) }
|
|
300
|
+
};
|
|
301
|
+
var bloomlineQueuesEndpoint = {
|
|
302
|
+
name: "Bloomline Queues",
|
|
303
|
+
description: "Queues handled by the `bloomline` service. The purpose of the service is not documented.",
|
|
304
|
+
category: "Account Endpoints",
|
|
305
|
+
type: "pd",
|
|
306
|
+
suffix: "bloomline/v0/config/valid-queues",
|
|
307
|
+
riotRequirements: player,
|
|
308
|
+
responses: { "200": import_zod.z.object({
|
|
309
|
+
ProcessedQueues: import_zod.z.array(import_zod.z.string()),
|
|
310
|
+
PerformanceScoreQueues: import_zod.z.array(import_zod.z.string())
|
|
311
|
+
}) }
|
|
312
|
+
};
|
|
313
|
+
var bloomlinePlayerEndpoint = {
|
|
314
|
+
name: "Bloomline Player",
|
|
315
|
+
description: "Per-player data of the `bloomline` service. The purpose of the service is not documented.",
|
|
316
|
+
category: "Account Endpoints",
|
|
317
|
+
type: "pd",
|
|
318
|
+
suffix: "bloomline/v0/players/{puuid}",
|
|
319
|
+
riotRequirements: player,
|
|
320
|
+
responses: { "200": import_zod.z.object({
|
|
321
|
+
Subject: import_zod.z.string(),
|
|
322
|
+
Bonsais: import_zod.z.array(import_zod.z.object({
|
|
323
|
+
BonsaiID: import_zod.z.string(),
|
|
324
|
+
HypeID: import_zod.z.string().optional(),
|
|
325
|
+
BackgroundID: import_zod.z.string().optional(),
|
|
326
|
+
ClipID: import_zod.z.string().optional(),
|
|
327
|
+
BorderID: import_zod.z.string().optional(),
|
|
328
|
+
Flourish: import_zod.z.object({
|
|
329
|
+
ShortLevel: import_zod.z.number().optional(),
|
|
330
|
+
PreviousShortLevel: import_zod.z.number().optional(),
|
|
331
|
+
LongLevel: import_zod.z.number().optional(),
|
|
332
|
+
FlourishID: import_zod.z.string().optional(),
|
|
333
|
+
Points: import_zod.z.number().optional(),
|
|
334
|
+
PointsVersion: import_zod.z.number().optional()
|
|
335
|
+
}),
|
|
336
|
+
TrackProgressList: import_zod.z.array(import_zod.z.object({
|
|
337
|
+
TrackID: import_zod.z.string(),
|
|
338
|
+
TrackLevel: import_zod.z.number().optional()
|
|
339
|
+
}))
|
|
340
|
+
})),
|
|
341
|
+
LongGroupVersion: import_zod.z.number()
|
|
342
|
+
}) }
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
// src/endpoints/riot/chat.ts
|
|
346
|
+
var import_zod2 = require("zod");
|
|
347
|
+
var chatSettingsEndpoint = {
|
|
348
|
+
name: "Settings",
|
|
349
|
+
description: "Get chat settings",
|
|
350
|
+
category: "Local Endpoints - Chat",
|
|
351
|
+
type: "local",
|
|
352
|
+
suffix: "chat/v1/settings",
|
|
353
|
+
riotRequirements: { localAuth: true },
|
|
354
|
+
responses: { "200": import_zod2.z.object({
|
|
355
|
+
bounceDockIconEnabled: import_zod2.z.boolean(),
|
|
356
|
+
"chat-status-message": import_zod2.z.string(),
|
|
357
|
+
chatFilterDisabled: import_zod2.z.boolean(),
|
|
358
|
+
chatGBG: import_zod2.z.boolean(),
|
|
359
|
+
chatGroupDiscord: import_zod2.z.boolean(),
|
|
360
|
+
chatGroupMobile: import_zod2.z.boolean(),
|
|
361
|
+
chatGroupOffline: import_zod2.z.boolean(),
|
|
362
|
+
chatWindow: import_zod2.z.object({
|
|
363
|
+
detached: import_zod2.z.boolean(),
|
|
364
|
+
height: import_zod2.z.number(),
|
|
365
|
+
left: import_zod2.z.number(),
|
|
366
|
+
top: import_zod2.z.number(),
|
|
367
|
+
width: import_zod2.z.number()
|
|
368
|
+
}),
|
|
369
|
+
chatWindowDockedHeight: import_zod2.z.number(),
|
|
370
|
+
"closed-conversations": import_zod2.z.object({
|
|
371
|
+
"ff822fdf-71a3-54ac-814e-7ac752ba428d@eu1.pvp.net": import_zod2.z.number()
|
|
372
|
+
}),
|
|
373
|
+
friendRequestToastsDisabled: import_zod2.z.boolean(),
|
|
374
|
+
"hidden-conversations": import_zod2.z.object({}),
|
|
375
|
+
linkClickWarningEnabled: import_zod2.z.boolean(),
|
|
376
|
+
messageNotificationsEnabled: import_zod2.z.boolean(),
|
|
377
|
+
moreUnreadsEnabled: import_zod2.z.boolean(),
|
|
378
|
+
"muted-conversations": import_zod2.z.object({}),
|
|
379
|
+
recentlyPlayedFirstOpen: import_zod2.z.boolean(),
|
|
380
|
+
recentlyPlayedOpen: import_zod2.z.boolean(),
|
|
381
|
+
"roster-group-collapsed": import_zod2.z.object({}),
|
|
382
|
+
showWhenTypingEnabled: import_zod2.z.boolean(),
|
|
383
|
+
sortBy: import_zod2.z.string(),
|
|
384
|
+
usePlayerPreferences: import_zod2.z.boolean()
|
|
385
|
+
}) }
|
|
386
|
+
};
|
|
387
|
+
var chatTournamentInfoEndpoint = {
|
|
388
|
+
name: "Tournament Info",
|
|
389
|
+
description: "Get in-tournament conversations",
|
|
390
|
+
category: "Local Endpoints - Chat",
|
|
391
|
+
type: "local",
|
|
392
|
+
suffix: "chat/v6/conversations/ares-tournaments",
|
|
393
|
+
riotRequirements: { localAuth: true },
|
|
394
|
+
responses: { "200": import_zod2.z.object({}) }
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
// src/endpoints/riot/contracts.ts
|
|
398
|
+
var import_zod3 = require("zod");
|
|
399
|
+
var activeRecruitmentEventEndpoint = {
|
|
400
|
+
name: "Active Recruitment Event",
|
|
401
|
+
description: "The current agent recruitment event.",
|
|
402
|
+
category: "Contract Endpoints",
|
|
403
|
+
type: "pd",
|
|
404
|
+
suffix: "contracts/v1/agents/activeRecruitmentEvent",
|
|
405
|
+
riotRequirements: player,
|
|
406
|
+
responses: { "200": import_zod3.z.object({
|
|
407
|
+
AgentID: import_zod3.z.string(),
|
|
408
|
+
CounterID: import_zod3.z.string(),
|
|
409
|
+
MilestoneThreshold: import_zod3.z.number(),
|
|
410
|
+
StartDate: import_zod3.z.string(),
|
|
411
|
+
EndDate: import_zod3.z.string(),
|
|
412
|
+
IsActive: import_zod3.z.boolean(),
|
|
413
|
+
includedPlatforms: import_zod3.z.object({
|
|
414
|
+
console: import_zod3.z.object({
|
|
415
|
+
developmentOnly: import_zod3.z.boolean()
|
|
416
|
+
}),
|
|
417
|
+
mobile: import_zod3.z.object({
|
|
418
|
+
developmentOnly: import_zod3.z.boolean()
|
|
419
|
+
}),
|
|
420
|
+
pc: import_zod3.z.object({
|
|
421
|
+
developmentOnly: import_zod3.z.boolean()
|
|
422
|
+
})
|
|
423
|
+
})
|
|
424
|
+
}) }
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
// src/endpoints/riot/esports.ts
|
|
428
|
+
var import_zod4 = require("zod");
|
|
429
|
+
var esportsLiveEventTimesEndpoint = {
|
|
430
|
+
name: "Esports Live Event Times",
|
|
431
|
+
description: "Live and upcoming esports matches, pick blocks and tournaments.",
|
|
432
|
+
category: "Esports Endpoints",
|
|
433
|
+
type: "pd",
|
|
434
|
+
suffix: "esports-service/v2/liveEventTimes",
|
|
435
|
+
riotRequirements: player,
|
|
436
|
+
responses: { "200": import_zod4.z.object({
|
|
437
|
+
Tournaments: import_zod4.z.array(import_zod4.z.object({
|
|
438
|
+
ID: import_zod4.z.string(),
|
|
439
|
+
StartTimeUTC: import_zod4.z.string(),
|
|
440
|
+
EndTimeUTC: import_zod4.z.string()
|
|
441
|
+
}))
|
|
442
|
+
}) }
|
|
443
|
+
};
|
|
444
|
+
var esportsUpcomingMatchesEndpoint = {
|
|
445
|
+
name: "Esports Upcoming Matches",
|
|
446
|
+
description: "Upcoming esports matches.",
|
|
447
|
+
category: "Esports Endpoints",
|
|
448
|
+
type: "pd",
|
|
449
|
+
suffix: "esports-service/v2/upcomingMatches",
|
|
450
|
+
riotRequirements: player,
|
|
451
|
+
responses: { "200": import_zod4.z.object({}) }
|
|
452
|
+
};
|
|
453
|
+
var esportsPickemLeaguesEndpoint = {
|
|
454
|
+
name: "Esports Pickem Leagues",
|
|
455
|
+
description: "Pick'em leagues.",
|
|
456
|
+
category: "Esports Endpoints",
|
|
457
|
+
type: "pd",
|
|
458
|
+
suffix: "esports-service/v1/pickem/leagues",
|
|
459
|
+
riotRequirements: player,
|
|
460
|
+
responses: { "200": import_zod4.z.object({
|
|
461
|
+
PickemLeagues: import_zod4.z.array(import_zod4.z.object({
|
|
462
|
+
LeagueID: import_zod4.z.string(),
|
|
463
|
+
EldsLeagueID: import_zod4.z.string(),
|
|
464
|
+
Tournament: import_zod4.z.object({
|
|
465
|
+
ID: import_zod4.z.string(),
|
|
466
|
+
EldsTournamentID: import_zod4.z.string(),
|
|
467
|
+
LeagueID: import_zod4.z.string(),
|
|
468
|
+
PickBlocks: import_zod4.z.array(import_zod4.z.object({
|
|
469
|
+
ID: import_zod4.z.string(),
|
|
470
|
+
EldsTournamentID: import_zod4.z.string(),
|
|
471
|
+
Slug: import_zod4.z.object({
|
|
472
|
+
Slug: import_zod4.z.string()
|
|
473
|
+
}),
|
|
474
|
+
PickOpenTime: import_zod4.z.string(),
|
|
475
|
+
PickCloseTime: import_zod4.z.string(),
|
|
476
|
+
State: import_zod4.z.string(),
|
|
477
|
+
OpenLevel: import_zod4.z.string(),
|
|
478
|
+
BlockType: import_zod4.z.string(),
|
|
479
|
+
PickBlockElements: import_zod4.z.array(import_zod4.z.object({
|
|
480
|
+
ID: import_zod4.z.string(),
|
|
481
|
+
PickBlockID: import_zod4.z.string(),
|
|
482
|
+
Section: import_zod4.z.object({
|
|
483
|
+
ID: import_zod4.z.string(),
|
|
484
|
+
EldsSectionID: import_zod4.z.string(),
|
|
485
|
+
CorrectPick: import_zod4.z.object({
|
|
486
|
+
Entries: import_zod4.z.array(import_zod4.z.object({
|
|
487
|
+
Index: import_zod4.z.number(),
|
|
488
|
+
Correctness: import_zod4.z.string(),
|
|
489
|
+
ParticipantID: import_zod4.z.string(),
|
|
490
|
+
Points: import_zod4.z.number(),
|
|
491
|
+
Rank: import_zod4.z.number()
|
|
492
|
+
})).nullable()
|
|
493
|
+
})
|
|
494
|
+
}),
|
|
495
|
+
Match: import_zod4.z.object({
|
|
496
|
+
ID: import_zod4.z.string(),
|
|
497
|
+
EldsMatchID: import_zod4.z.string(),
|
|
498
|
+
BaselinePoints: import_zod4.z.number(),
|
|
499
|
+
CorrectPick: import_zod4.z.string(),
|
|
500
|
+
ResultState: import_zod4.z.string()
|
|
501
|
+
}),
|
|
502
|
+
PickOpenTime: import_zod4.z.string(),
|
|
503
|
+
PickCloseTime: import_zod4.z.string(),
|
|
504
|
+
State: import_zod4.z.string(),
|
|
505
|
+
DisplayOrder: import_zod4.z.number()
|
|
506
|
+
})),
|
|
507
|
+
CompletionStatus: import_zod4.z.string()
|
|
508
|
+
})),
|
|
509
|
+
Participants: import_zod4.z.array(import_zod4.z.object({
|
|
510
|
+
ID: import_zod4.z.string(),
|
|
511
|
+
EldsTeamID: import_zod4.z.string()
|
|
512
|
+
}))
|
|
513
|
+
}),
|
|
514
|
+
Published: import_zod4.z.boolean()
|
|
515
|
+
}))
|
|
516
|
+
}) }
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
// src/endpoints/riot/local.ts
|
|
520
|
+
var import_zod5 = require("zod");
|
|
521
|
+
var localLocaleEndpoint = {
|
|
522
|
+
name: "Locale",
|
|
523
|
+
description: "Get the current locale",
|
|
524
|
+
category: "Local Endpoints",
|
|
525
|
+
type: "local",
|
|
526
|
+
suffix: "riotclient/product-locales/products/valorant/patchlines/live",
|
|
527
|
+
riotRequirements: { localAuth: true },
|
|
528
|
+
responses: { "200": import_zod5.z.string() }
|
|
529
|
+
};
|
|
530
|
+
var localAvailableLocalesEndpoint = {
|
|
531
|
+
name: "Available Locales",
|
|
532
|
+
description: "Get available locales",
|
|
533
|
+
category: "Local Endpoints",
|
|
534
|
+
type: "local",
|
|
535
|
+
suffix: "rnet-product-registry/v4/available-product-locales/products/valorant/patchlines/live",
|
|
536
|
+
riotRequirements: { localAuth: true },
|
|
537
|
+
responses: { "200": import_zod5.z.array(import_zod5.z.string()) }
|
|
538
|
+
};
|
|
539
|
+
var localRiotStatusEndpoint = {
|
|
540
|
+
name: "Riot Status",
|
|
541
|
+
description: "Get game status information such as maintenances and incidents Response is an escaped JSON string.",
|
|
542
|
+
category: "Local Endpoints",
|
|
543
|
+
type: "local",
|
|
544
|
+
suffix: "riot-status/v1/products/valorant/patchlines/live/deployments/{region}",
|
|
545
|
+
riotRequirements: { localAuth: true },
|
|
546
|
+
responses: { "200": import_zod5.z.string() }
|
|
547
|
+
};
|
|
548
|
+
var localAccessTokenEndpoint = {
|
|
549
|
+
name: "Access Token",
|
|
550
|
+
description: "Gets a Riot access token",
|
|
551
|
+
category: "Local Endpoints",
|
|
552
|
+
type: "local",
|
|
553
|
+
suffix: "rso-auth/v1/authorization/access-token",
|
|
554
|
+
riotRequirements: { localAuth: true },
|
|
555
|
+
responses: { "200": import_zod5.z.object({
|
|
556
|
+
clientId: import_zod5.z.string(),
|
|
557
|
+
expiry: import_zod5.z.number(),
|
|
558
|
+
scopes: import_zod5.z.array(import_zod5.z.string()),
|
|
559
|
+
token: import_zod5.z.string()
|
|
560
|
+
}) }
|
|
561
|
+
};
|
|
562
|
+
var localPluginStatusEndpoint = {
|
|
563
|
+
name: "Plugin Status",
|
|
564
|
+
description: "Gets plugin status",
|
|
565
|
+
category: "Local Endpoints",
|
|
566
|
+
type: "local",
|
|
567
|
+
suffix: "plugin-manager/v1/status",
|
|
568
|
+
riotRequirements: { localAuth: true },
|
|
569
|
+
responses: { "200": import_zod5.z.object({
|
|
570
|
+
state: import_zod5.z.string()
|
|
571
|
+
}) }
|
|
572
|
+
};
|
|
573
|
+
var localRmsSessionEndpoint = {
|
|
574
|
+
name: "Rms Session",
|
|
575
|
+
description: "Gets the token for Riot Messaging Service",
|
|
576
|
+
category: "Local Endpoints",
|
|
577
|
+
type: "local",
|
|
578
|
+
suffix: "riot-messaging-service/v1/session",
|
|
579
|
+
riotRequirements: { localAuth: true },
|
|
580
|
+
responses: { "200": import_zod5.z.object({
|
|
581
|
+
state: import_zod5.z.string(),
|
|
582
|
+
token: import_zod5.z.string(),
|
|
583
|
+
tokenType: import_zod5.z.string()
|
|
584
|
+
}) }
|
|
585
|
+
};
|
|
586
|
+
var localProcessInfoEndpoint = {
|
|
587
|
+
name: "Process Info",
|
|
588
|
+
description: "Gets the Valorant process ID",
|
|
589
|
+
category: "Local Endpoints",
|
|
590
|
+
type: "local",
|
|
591
|
+
suffix: "process-control/v1/process",
|
|
592
|
+
riotRequirements: { localAuth: true },
|
|
593
|
+
responses: { "200": import_zod5.z.object({
|
|
594
|
+
pid: import_zod5.z.number(),
|
|
595
|
+
status: import_zod5.z.string()
|
|
596
|
+
}) }
|
|
597
|
+
};
|
|
598
|
+
var localLogPathEndpoint = {
|
|
599
|
+
name: "Log Path",
|
|
600
|
+
description: "Gets the Valorant log path",
|
|
601
|
+
category: "Local Endpoints",
|
|
602
|
+
type: "local",
|
|
603
|
+
suffix: "product-session/v1/logs/path/VALORANT",
|
|
604
|
+
riotRequirements: { localAuth: true },
|
|
605
|
+
responses: { "200": import_zod5.z.string() }
|
|
606
|
+
};
|
|
607
|
+
var localEulaEndpoint = {
|
|
608
|
+
name: "Eula",
|
|
609
|
+
description: "Get the EULA",
|
|
610
|
+
category: "Local Endpoints",
|
|
611
|
+
type: "local",
|
|
612
|
+
suffix: "eula/v1/agreement/content",
|
|
613
|
+
riotRequirements: { localAuth: true },
|
|
614
|
+
responses: { "200": import_zod5.z.string() }
|
|
615
|
+
};
|
|
616
|
+
var localPrivacyPolicyEndpoint = {
|
|
617
|
+
name: "Privacy Policy",
|
|
618
|
+
description: "Get privacy policy",
|
|
619
|
+
category: "Local Endpoints",
|
|
620
|
+
type: "local",
|
|
621
|
+
suffix: "eula/v1/privacy-policy/content",
|
|
622
|
+
riotRequirements: { localAuth: true },
|
|
623
|
+
responses: { "200": import_zod5.z.string() }
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
// src/endpoints/riot/premier.ts
|
|
627
|
+
var import_zod6 = require("zod");
|
|
628
|
+
var premierSeasonsEndpoint = {
|
|
629
|
+
name: "Premier Seasons",
|
|
630
|
+
description: "All Premier seasons of the shard. The affinity in the path is the region of the context.",
|
|
631
|
+
category: "Premier Endpoints",
|
|
632
|
+
type: "pd",
|
|
633
|
+
suffix: "premier/v1/affinities/{region}/premier-seasons",
|
|
634
|
+
riotRequirements: player,
|
|
635
|
+
responses: { "200": import_zod6.z.object({
|
|
636
|
+
PremierSeasons: import_zod6.z.array(import_zod6.z.object({
|
|
637
|
+
ID: import_zod6.z.string(),
|
|
638
|
+
Name: import_zod6.z.string(),
|
|
639
|
+
PreviousPremierSeasonID: import_zod6.z.string(),
|
|
640
|
+
NextPremierSeasonID: import_zod6.z.string(),
|
|
641
|
+
IsActive: import_zod6.z.boolean(),
|
|
642
|
+
StartTime: import_zod6.z.string(),
|
|
643
|
+
EndTime: import_zod6.z.string(),
|
|
644
|
+
Events: import_zod6.z.array(import_zod6.z.object({
|
|
645
|
+
ID: import_zod6.z.string(),
|
|
646
|
+
Type: import_zod6.z.string(),
|
|
647
|
+
StartDateTime: import_zod6.z.string(),
|
|
648
|
+
EndDateTime: import_zod6.z.string(),
|
|
649
|
+
MapSelectionStrategy: import_zod6.z.string(),
|
|
650
|
+
MapPoolMapIDs: import_zod6.z.array(import_zod6.z.string()),
|
|
651
|
+
PointsRequiredToParticipate: import_zod6.z.number()
|
|
652
|
+
})),
|
|
653
|
+
ScheduledEvents: import_zod6.z.array(import_zod6.z.object({
|
|
654
|
+
EventID: import_zod6.z.string(),
|
|
655
|
+
EventType: import_zod6.z.string(),
|
|
656
|
+
Conference: import_zod6.z.string(),
|
|
657
|
+
DivisionGroup: import_zod6.z.string(),
|
|
658
|
+
EventPresetName: import_zod6.z.string(),
|
|
659
|
+
StartDateTime: import_zod6.z.string(),
|
|
660
|
+
EndDateTime: import_zod6.z.string(),
|
|
661
|
+
TournamentRoundTimes: import_zod6.z.array(import_zod6.z.object({
|
|
662
|
+
StartDateTime: import_zod6.z.string(),
|
|
663
|
+
EndDateTime: import_zod6.z.string()
|
|
664
|
+
}))
|
|
665
|
+
})),
|
|
666
|
+
Conferences: import_zod6.z.array(import_zod6.z.object({
|
|
667
|
+
id: import_zod6.z.string(),
|
|
668
|
+
key: import_zod6.z.string(),
|
|
669
|
+
isSuper: import_zod6.z.boolean(),
|
|
670
|
+
gamePods: import_zod6.z.array(import_zod6.z.string()),
|
|
671
|
+
timezone: import_zod6.z.string(),
|
|
672
|
+
superConference: import_zod6.z.string().optional(),
|
|
673
|
+
leaderboardPlayoffQualificationDateTime: import_zod6.z.string(),
|
|
674
|
+
leaderboardPromotionFinalizationDateTime: import_zod6.z.string()
|
|
675
|
+
})),
|
|
676
|
+
Divisions: import_zod6.z.array(import_zod6.z.object({
|
|
677
|
+
Division: import_zod6.z.number(),
|
|
678
|
+
DivisionName: import_zod6.z.string(),
|
|
679
|
+
DivisionGroup: import_zod6.z.string(),
|
|
680
|
+
EventPresetName: import_zod6.z.string()
|
|
681
|
+
})),
|
|
682
|
+
DivisionThresholds: import_zod6.z.array(import_zod6.z.object({
|
|
683
|
+
playoffThresholdType: import_zod6.z.string(),
|
|
684
|
+
playoffThresholdValue: import_zod6.z.number(),
|
|
685
|
+
promotionThresholdType: import_zod6.z.string(),
|
|
686
|
+
promotionThresholdValue: import_zod6.z.number(),
|
|
687
|
+
shouldPromoteToSuperConference: import_zod6.z.boolean(),
|
|
688
|
+
skipReseedCriteria: import_zod6.z.string(),
|
|
689
|
+
conference: import_zod6.z.string().optional(),
|
|
690
|
+
division: import_zod6.z.number().optional(),
|
|
691
|
+
promotionConference: import_zod6.z.string().optional(),
|
|
692
|
+
skipReseedCriteriaValue: import_zod6.z.number().optional()
|
|
693
|
+
})),
|
|
694
|
+
EventPresets: import_zod6.z.object({
|
|
695
|
+
PRO: import_zod6.z.object({
|
|
696
|
+
EventPresetsByEventType: import_zod6.z.object({
|
|
697
|
+
LEAGUE: import_zod6.z.object({
|
|
698
|
+
EventPresetName: import_zod6.z.string(),
|
|
699
|
+
eventType: import_zod6.z.string(),
|
|
700
|
+
bestOfN: import_zod6.z.number(),
|
|
701
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
702
|
+
queueID: import_zod6.z.string(),
|
|
703
|
+
pointsConfig: import_zod6.z.object({
|
|
704
|
+
PointsForWin: import_zod6.z.number(),
|
|
705
|
+
PointsForLoss: import_zod6.z.number()
|
|
706
|
+
})
|
|
707
|
+
}),
|
|
708
|
+
SCRIM: import_zod6.z.object({
|
|
709
|
+
EventPresetName: import_zod6.z.string(),
|
|
710
|
+
eventType: import_zod6.z.string(),
|
|
711
|
+
bestOfN: import_zod6.z.number(),
|
|
712
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
713
|
+
queueID: import_zod6.z.string(),
|
|
714
|
+
pointsConfig: import_zod6.z.object({
|
|
715
|
+
PointsForWin: import_zod6.z.number(),
|
|
716
|
+
PointsForLoss: import_zod6.z.number()
|
|
717
|
+
})
|
|
718
|
+
}),
|
|
719
|
+
TOURNAMENT: import_zod6.z.object({
|
|
720
|
+
EventPresetName: import_zod6.z.string(),
|
|
721
|
+
eventType: import_zod6.z.string(),
|
|
722
|
+
bestOfN: import_zod6.z.number(),
|
|
723
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
724
|
+
queueID: import_zod6.z.string(),
|
|
725
|
+
pointsConfig: import_zod6.z.object({
|
|
726
|
+
PointsForWin: import_zod6.z.number(),
|
|
727
|
+
PointsForLoss: import_zod6.z.number()
|
|
728
|
+
})
|
|
729
|
+
})
|
|
730
|
+
})
|
|
731
|
+
}),
|
|
732
|
+
REGULAR: import_zod6.z.object({
|
|
733
|
+
EventPresetsByEventType: import_zod6.z.object({
|
|
734
|
+
LEAGUE: import_zod6.z.object({
|
|
735
|
+
EventPresetName: import_zod6.z.string(),
|
|
736
|
+
eventType: import_zod6.z.string(),
|
|
737
|
+
bestOfN: import_zod6.z.number(),
|
|
738
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
739
|
+
queueID: import_zod6.z.string(),
|
|
740
|
+
pointsConfig: import_zod6.z.object({
|
|
741
|
+
PointsForWin: import_zod6.z.number(),
|
|
742
|
+
PointsForLoss: import_zod6.z.number()
|
|
743
|
+
})
|
|
744
|
+
}),
|
|
745
|
+
SCRIM: import_zod6.z.object({
|
|
746
|
+
EventPresetName: import_zod6.z.string(),
|
|
747
|
+
eventType: import_zod6.z.string(),
|
|
748
|
+
bestOfN: import_zod6.z.number(),
|
|
749
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
750
|
+
queueID: import_zod6.z.string(),
|
|
751
|
+
pointsConfig: import_zod6.z.object({
|
|
752
|
+
PointsForWin: import_zod6.z.number(),
|
|
753
|
+
PointsForLoss: import_zod6.z.number()
|
|
754
|
+
})
|
|
755
|
+
}),
|
|
756
|
+
TOURNAMENT: import_zod6.z.object({
|
|
757
|
+
EventPresetName: import_zod6.z.string(),
|
|
758
|
+
eventType: import_zod6.z.string(),
|
|
759
|
+
bestOfN: import_zod6.z.number(),
|
|
760
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
761
|
+
queueID: import_zod6.z.string(),
|
|
762
|
+
pointsConfig: import_zod6.z.object({
|
|
763
|
+
PointsForWin: import_zod6.z.number(),
|
|
764
|
+
PointsForLoss: import_zod6.z.number()
|
|
765
|
+
})
|
|
766
|
+
})
|
|
767
|
+
})
|
|
768
|
+
})
|
|
769
|
+
}),
|
|
770
|
+
FlawlessPointRequirement: import_zod6.z.number(),
|
|
771
|
+
ChampionshipPointRequirement: import_zod6.z.number(),
|
|
772
|
+
ChampionshipEventID: import_zod6.z.string(),
|
|
773
|
+
EnrollmentPhaseStartDateTime: import_zod6.z.string(),
|
|
774
|
+
EnrollmentPhaseEndDateTime: import_zod6.z.string(),
|
|
775
|
+
LeaderboardPlayoffQualificationDateTime: import_zod6.z.string(),
|
|
776
|
+
LeaderboardPromotionFinalizationDateTime: import_zod6.z.string(),
|
|
777
|
+
LeaderboardFinalizationDateTime: import_zod6.z.string(),
|
|
778
|
+
ContenderEligibilityExpiryDateTime: import_zod6.z.string(),
|
|
779
|
+
StageLockTime: import_zod6.z.string(),
|
|
780
|
+
ParticipationRewardsActIDs: import_zod6.z.array(import_zod6.z.string()),
|
|
781
|
+
ParticipationRewards: import_zod6.z.object({
|
|
782
|
+
EntitlementRewards: import_zod6.z.array(import_zod6.z.object({
|
|
783
|
+
ItemTypeID: import_zod6.z.string(),
|
|
784
|
+
ItemID: import_zod6.z.string(),
|
|
785
|
+
Amount: import_zod6.z.number()
|
|
786
|
+
}))
|
|
787
|
+
}),
|
|
788
|
+
TournamentWinnerRewards: import_zod6.z.object({}),
|
|
789
|
+
DivisionWinnerRewards: import_zod6.z.object({
|
|
790
|
+
ADVANCED: import_zod6.z.object({
|
|
791
|
+
EntitlementRewards: import_zod6.z.array(import_zod6.z.object({
|
|
792
|
+
ItemTypeID: import_zod6.z.string(),
|
|
793
|
+
ItemID: import_zod6.z.string(),
|
|
794
|
+
Amount: import_zod6.z.number()
|
|
795
|
+
}))
|
|
796
|
+
}).optional(),
|
|
797
|
+
CONTENDER: import_zod6.z.object({
|
|
798
|
+
EntitlementRewards: import_zod6.z.array(import_zod6.z.object({
|
|
799
|
+
ItemTypeID: import_zod6.z.string(),
|
|
800
|
+
ItemID: import_zod6.z.string(),
|
|
801
|
+
Amount: import_zod6.z.number()
|
|
802
|
+
}))
|
|
803
|
+
}).optional(),
|
|
804
|
+
ELITE: import_zod6.z.object({
|
|
805
|
+
EntitlementRewards: import_zod6.z.array(import_zod6.z.object({
|
|
806
|
+
ItemTypeID: import_zod6.z.string(),
|
|
807
|
+
ItemID: import_zod6.z.string(),
|
|
808
|
+
Amount: import_zod6.z.number()
|
|
809
|
+
}))
|
|
810
|
+
}).optional(),
|
|
811
|
+
INTERMEDIATE: import_zod6.z.object({
|
|
812
|
+
EntitlementRewards: import_zod6.z.array(import_zod6.z.object({
|
|
813
|
+
ItemTypeID: import_zod6.z.string(),
|
|
814
|
+
ItemID: import_zod6.z.string(),
|
|
815
|
+
Amount: import_zod6.z.number()
|
|
816
|
+
}))
|
|
817
|
+
}).optional(),
|
|
818
|
+
OPEN: import_zod6.z.object({
|
|
819
|
+
EntitlementRewards: import_zod6.z.array(import_zod6.z.object({
|
|
820
|
+
ItemTypeID: import_zod6.z.string(),
|
|
821
|
+
ItemID: import_zod6.z.string(),
|
|
822
|
+
Amount: import_zod6.z.number()
|
|
823
|
+
}))
|
|
824
|
+
}).optional(),
|
|
825
|
+
INVITE: import_zod6.z.object({
|
|
826
|
+
EntitlementRewards: import_zod6.z.array(import_zod6.z.object({
|
|
827
|
+
ItemTypeID: import_zod6.z.string(),
|
|
828
|
+
ItemID: import_zod6.z.string(),
|
|
829
|
+
Amount: import_zod6.z.number()
|
|
830
|
+
}))
|
|
831
|
+
}).optional()
|
|
832
|
+
}),
|
|
833
|
+
RosterRecentActivityNumSeasons: import_zod6.z.number()
|
|
834
|
+
}))
|
|
835
|
+
}) }
|
|
836
|
+
};
|
|
837
|
+
var premierActiveSeasonEndpoint = {
|
|
838
|
+
name: "Premier Active Season",
|
|
839
|
+
description: "The Premier season that is running now.",
|
|
840
|
+
category: "Premier Endpoints",
|
|
841
|
+
type: "pd",
|
|
842
|
+
suffix: "premier/v1/affinities/{region}/premier-seasons/active",
|
|
843
|
+
riotRequirements: player,
|
|
844
|
+
responses: { "200": import_zod6.z.object({
|
|
845
|
+
ID: import_zod6.z.string(),
|
|
846
|
+
Name: import_zod6.z.string(),
|
|
847
|
+
PreviousPremierSeasonID: import_zod6.z.string(),
|
|
848
|
+
NextPremierSeasonID: import_zod6.z.string(),
|
|
849
|
+
IsActive: import_zod6.z.boolean(),
|
|
850
|
+
StartTime: import_zod6.z.string(),
|
|
851
|
+
EndTime: import_zod6.z.string(),
|
|
852
|
+
Events: import_zod6.z.array(import_zod6.z.object({
|
|
853
|
+
ID: import_zod6.z.string(),
|
|
854
|
+
Type: import_zod6.z.string(),
|
|
855
|
+
StartDateTime: import_zod6.z.string(),
|
|
856
|
+
EndDateTime: import_zod6.z.string(),
|
|
857
|
+
MapSelectionStrategy: import_zod6.z.string(),
|
|
858
|
+
MapPoolMapIDs: import_zod6.z.array(import_zod6.z.string()),
|
|
859
|
+
PointsRequiredToParticipate: import_zod6.z.number()
|
|
860
|
+
})),
|
|
861
|
+
ScheduledEvents: import_zod6.z.array(import_zod6.z.object({
|
|
862
|
+
EventID: import_zod6.z.string(),
|
|
863
|
+
EventType: import_zod6.z.string(),
|
|
864
|
+
Conference: import_zod6.z.string(),
|
|
865
|
+
DivisionGroup: import_zod6.z.string(),
|
|
866
|
+
EventPresetName: import_zod6.z.string(),
|
|
867
|
+
StartDateTime: import_zod6.z.string(),
|
|
868
|
+
EndDateTime: import_zod6.z.string(),
|
|
869
|
+
TournamentRoundTimes: import_zod6.z.array(import_zod6.z.object({
|
|
870
|
+
StartDateTime: import_zod6.z.string(),
|
|
871
|
+
EndDateTime: import_zod6.z.string()
|
|
872
|
+
}))
|
|
873
|
+
})),
|
|
874
|
+
Conferences: import_zod6.z.array(import_zod6.z.object({
|
|
875
|
+
id: import_zod6.z.string(),
|
|
876
|
+
key: import_zod6.z.string(),
|
|
877
|
+
isSuper: import_zod6.z.boolean(),
|
|
878
|
+
gamePods: import_zod6.z.array(import_zod6.z.string()),
|
|
879
|
+
timezone: import_zod6.z.string(),
|
|
880
|
+
superConference: import_zod6.z.string().optional(),
|
|
881
|
+
leaderboardPlayoffQualificationDateTime: import_zod6.z.string(),
|
|
882
|
+
leaderboardPromotionFinalizationDateTime: import_zod6.z.string()
|
|
883
|
+
})),
|
|
884
|
+
Divisions: import_zod6.z.array(import_zod6.z.object({
|
|
885
|
+
Division: import_zod6.z.number(),
|
|
886
|
+
DivisionName: import_zod6.z.string(),
|
|
887
|
+
DivisionGroup: import_zod6.z.string(),
|
|
888
|
+
EventPresetName: import_zod6.z.string()
|
|
889
|
+
})),
|
|
890
|
+
DivisionThresholds: import_zod6.z.array(import_zod6.z.object({
|
|
891
|
+
playoffThresholdType: import_zod6.z.string(),
|
|
892
|
+
playoffThresholdValue: import_zod6.z.number(),
|
|
893
|
+
promotionThresholdType: import_zod6.z.string(),
|
|
894
|
+
promotionThresholdValue: import_zod6.z.number(),
|
|
895
|
+
shouldPromoteToSuperConference: import_zod6.z.boolean(),
|
|
896
|
+
skipReseedCriteria: import_zod6.z.string(),
|
|
897
|
+
conference: import_zod6.z.string().optional(),
|
|
898
|
+
division: import_zod6.z.number().optional(),
|
|
899
|
+
promotionConference: import_zod6.z.string().optional(),
|
|
900
|
+
skipReseedCriteriaValue: import_zod6.z.number().optional()
|
|
901
|
+
})),
|
|
902
|
+
EventPresets: import_zod6.z.object({
|
|
903
|
+
PRO: import_zod6.z.object({
|
|
904
|
+
EventPresetsByEventType: import_zod6.z.object({
|
|
905
|
+
LEAGUE: import_zod6.z.object({
|
|
906
|
+
EventPresetName: import_zod6.z.string(),
|
|
907
|
+
eventType: import_zod6.z.string(),
|
|
908
|
+
bestOfN: import_zod6.z.number(),
|
|
909
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
910
|
+
queueID: import_zod6.z.string(),
|
|
911
|
+
pointsConfig: import_zod6.z.object({
|
|
912
|
+
PointsForWin: import_zod6.z.number(),
|
|
913
|
+
PointsForLoss: import_zod6.z.number()
|
|
914
|
+
})
|
|
915
|
+
}),
|
|
916
|
+
SCRIM: import_zod6.z.object({
|
|
917
|
+
EventPresetName: import_zod6.z.string(),
|
|
918
|
+
eventType: import_zod6.z.string(),
|
|
919
|
+
bestOfN: import_zod6.z.number(),
|
|
920
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
921
|
+
queueID: import_zod6.z.string(),
|
|
922
|
+
pointsConfig: import_zod6.z.object({
|
|
923
|
+
PointsForWin: import_zod6.z.number(),
|
|
924
|
+
PointsForLoss: import_zod6.z.number()
|
|
925
|
+
})
|
|
926
|
+
}),
|
|
927
|
+
TOURNAMENT: import_zod6.z.object({
|
|
928
|
+
EventPresetName: import_zod6.z.string(),
|
|
929
|
+
eventType: import_zod6.z.string(),
|
|
930
|
+
bestOfN: import_zod6.z.number(),
|
|
931
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
932
|
+
queueID: import_zod6.z.string(),
|
|
933
|
+
pointsConfig: import_zod6.z.object({
|
|
934
|
+
PointsForWin: import_zod6.z.number(),
|
|
935
|
+
PointsForLoss: import_zod6.z.number()
|
|
936
|
+
})
|
|
937
|
+
})
|
|
938
|
+
})
|
|
939
|
+
}),
|
|
940
|
+
REGULAR: import_zod6.z.object({
|
|
941
|
+
EventPresetsByEventType: import_zod6.z.object({
|
|
942
|
+
LEAGUE: import_zod6.z.object({
|
|
943
|
+
EventPresetName: import_zod6.z.string(),
|
|
944
|
+
eventType: import_zod6.z.string(),
|
|
945
|
+
bestOfN: import_zod6.z.number(),
|
|
946
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
947
|
+
queueID: import_zod6.z.string(),
|
|
948
|
+
pointsConfig: import_zod6.z.object({
|
|
949
|
+
PointsForWin: import_zod6.z.number(),
|
|
950
|
+
PointsForLoss: import_zod6.z.number()
|
|
951
|
+
})
|
|
952
|
+
}),
|
|
953
|
+
SCRIM: import_zod6.z.object({
|
|
954
|
+
EventPresetName: import_zod6.z.string(),
|
|
955
|
+
eventType: import_zod6.z.string(),
|
|
956
|
+
bestOfN: import_zod6.z.number(),
|
|
957
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
958
|
+
queueID: import_zod6.z.string(),
|
|
959
|
+
pointsConfig: import_zod6.z.object({
|
|
960
|
+
PointsForWin: import_zod6.z.number(),
|
|
961
|
+
PointsForLoss: import_zod6.z.number()
|
|
962
|
+
})
|
|
963
|
+
}),
|
|
964
|
+
TOURNAMENT: import_zod6.z.object({
|
|
965
|
+
EventPresetName: import_zod6.z.string(),
|
|
966
|
+
eventType: import_zod6.z.string(),
|
|
967
|
+
bestOfN: import_zod6.z.number(),
|
|
968
|
+
matchmakingStrategy: import_zod6.z.string(),
|
|
969
|
+
queueID: import_zod6.z.string(),
|
|
970
|
+
pointsConfig: import_zod6.z.object({
|
|
971
|
+
PointsForWin: import_zod6.z.number(),
|
|
972
|
+
PointsForLoss: import_zod6.z.number()
|
|
973
|
+
})
|
|
974
|
+
})
|
|
975
|
+
})
|
|
976
|
+
})
|
|
977
|
+
}),
|
|
978
|
+
FlawlessPointRequirement: import_zod6.z.number(),
|
|
979
|
+
ChampionshipPointRequirement: import_zod6.z.number(),
|
|
980
|
+
ChampionshipEventID: import_zod6.z.string(),
|
|
981
|
+
EnrollmentPhaseStartDateTime: import_zod6.z.string(),
|
|
982
|
+
EnrollmentPhaseEndDateTime: import_zod6.z.string(),
|
|
983
|
+
LeaderboardPlayoffQualificationDateTime: import_zod6.z.string(),
|
|
984
|
+
LeaderboardPromotionFinalizationDateTime: import_zod6.z.string(),
|
|
985
|
+
LeaderboardFinalizationDateTime: import_zod6.z.string(),
|
|
986
|
+
ContenderEligibilityExpiryDateTime: import_zod6.z.string(),
|
|
987
|
+
StageLockTime: import_zod6.z.string(),
|
|
988
|
+
ParticipationRewards: import_zod6.z.object({}),
|
|
989
|
+
TournamentWinnerRewards: import_zod6.z.object({}),
|
|
990
|
+
DivisionWinnerRewards: import_zod6.z.object({}),
|
|
991
|
+
RosterRecentActivityNumSeasons: import_zod6.z.number()
|
|
992
|
+
}) }
|
|
993
|
+
};
|
|
994
|
+
var premierConferencesEndpoint = {
|
|
995
|
+
name: "Premier Conferences",
|
|
996
|
+
description: "Premier conferences of the region.",
|
|
997
|
+
category: "Premier Endpoints",
|
|
998
|
+
type: "pd",
|
|
999
|
+
suffix: "premier/v1/affinities/{region}/conferences",
|
|
1000
|
+
riotRequirements: player,
|
|
1001
|
+
responses: { "200": import_zod6.z.object({
|
|
1002
|
+
PremierConferences: import_zod6.z.array(import_zod6.z.object({
|
|
1003
|
+
id: import_zod6.z.string(),
|
|
1004
|
+
key: import_zod6.z.string(),
|
|
1005
|
+
isSuper: import_zod6.z.boolean(),
|
|
1006
|
+
gamePods: import_zod6.z.array(import_zod6.z.string()),
|
|
1007
|
+
timezone: import_zod6.z.string(),
|
|
1008
|
+
superConference: import_zod6.z.string().optional(),
|
|
1009
|
+
leaderboardPlayoffQualificationDateTime: import_zod6.z.string(),
|
|
1010
|
+
leaderboardPromotionFinalizationDateTime: import_zod6.z.string()
|
|
1011
|
+
}))
|
|
1012
|
+
}) }
|
|
1013
|
+
};
|
|
1014
|
+
var premierMatchLimitEndpoint = {
|
|
1015
|
+
name: "Premier Match Limit",
|
|
1016
|
+
description: "How many Premier matches can still be played and when the limit resets.",
|
|
1017
|
+
category: "Premier Endpoints",
|
|
1018
|
+
type: "pd",
|
|
1019
|
+
suffix: "premier/v1/matchlimitinfo",
|
|
1020
|
+
riotRequirements: player,
|
|
1021
|
+
responses: { "200": import_zod6.z.object({
|
|
1022
|
+
leagueMatchLimit: import_zod6.z.number(),
|
|
1023
|
+
tournamentLimit: import_zod6.z.number(),
|
|
1024
|
+
timeUntilNextResetSeconds: import_zod6.z.number()
|
|
1025
|
+
}) }
|
|
1026
|
+
};
|
|
1027
|
+
var premierEligibilityEndpoint = {
|
|
1028
|
+
name: "Premier Eligibility",
|
|
1029
|
+
description: "Whether the player can join a Premier roster.",
|
|
1030
|
+
category: "Premier Endpoints",
|
|
1031
|
+
type: "pd",
|
|
1032
|
+
suffix: "premier/v1/player/eligibility",
|
|
1033
|
+
riotRequirements: player,
|
|
1034
|
+
responses: { "200": import_zod6.z.object({
|
|
1035
|
+
subject: import_zod6.z.string(),
|
|
1036
|
+
accountVerificationStatus: import_zod6.z.boolean(),
|
|
1037
|
+
rankedPlacementCompletionStatus: import_zod6.z.boolean(),
|
|
1038
|
+
matchLimitReached: import_zod6.z.boolean(),
|
|
1039
|
+
isOnProvidedRoster: import_zod6.z.boolean()
|
|
1040
|
+
}) }
|
|
1041
|
+
};
|
|
1042
|
+
var premierPlayerV2Endpoint = {
|
|
1043
|
+
name: "Premier Player V2",
|
|
1044
|
+
description: "Premier membership of a player: roster id and pending invites.",
|
|
1045
|
+
category: "Premier Endpoints",
|
|
1046
|
+
type: "pd",
|
|
1047
|
+
suffix: "premier/v2/players/{puuid}",
|
|
1048
|
+
riotRequirements: player,
|
|
1049
|
+
responses: { "200": import_zod6.z.object({
|
|
1050
|
+
puuid: import_zod6.z.string(),
|
|
1051
|
+
rosterId: import_zod6.z.string(),
|
|
1052
|
+
version: import_zod6.z.number(),
|
|
1053
|
+
createdAt: import_zod6.z.number(),
|
|
1054
|
+
updatedAt: import_zod6.z.number()
|
|
1055
|
+
}) }
|
|
1056
|
+
};
|
|
1057
|
+
var premierPlayerV3Endpoint = {
|
|
1058
|
+
name: "Premier Player V3",
|
|
1059
|
+
description: "Like v2, with prestige and contender eligibility.",
|
|
1060
|
+
category: "Premier Endpoints",
|
|
1061
|
+
type: "pd",
|
|
1062
|
+
suffix: "premier/v3/players/{puuid}",
|
|
1063
|
+
riotRequirements: player,
|
|
1064
|
+
responses: { "200": import_zod6.z.object({
|
|
1065
|
+
puuid: import_zod6.z.string(),
|
|
1066
|
+
rosterId: import_zod6.z.string(),
|
|
1067
|
+
prestige: import_zod6.z.object({
|
|
1068
|
+
earnedPrestige: import_zod6.z.boolean(),
|
|
1069
|
+
earnedAura: import_zod6.z.boolean(),
|
|
1070
|
+
showTag: import_zod6.z.boolean(),
|
|
1071
|
+
showPlating: import_zod6.z.boolean(),
|
|
1072
|
+
showAura: import_zod6.z.boolean()
|
|
1073
|
+
}),
|
|
1074
|
+
contenderEligibilityExpiry: import_zod6.z.string(),
|
|
1075
|
+
socialVersion: import_zod6.z.number(),
|
|
1076
|
+
premierVersion: import_zod6.z.number(),
|
|
1077
|
+
updatedAt: import_zod6.z.number(),
|
|
1078
|
+
seasons: import_zod6.z.object({
|
|
1079
|
+
"08d281c5-4426-3aaa-3316-ebaf5f2c858a": import_zod6.z.object({
|
|
1080
|
+
seasonId: import_zod6.z.string(),
|
|
1081
|
+
hasEarnedPrestigeAura: import_zod6.z.boolean(),
|
|
1082
|
+
hasEarnedParticipation: import_zod6.z.boolean(),
|
|
1083
|
+
hasEarnedDivisionWinner: import_zod6.z.boolean()
|
|
1084
|
+
}),
|
|
1085
|
+
"91be4c20-439d-8e24-f577-4ca8a98e8dc8": import_zod6.z.object({
|
|
1086
|
+
seasonId: import_zod6.z.string(),
|
|
1087
|
+
hasEarnedPrestigeAura: import_zod6.z.boolean(),
|
|
1088
|
+
hasEarnedParticipation: import_zod6.z.boolean(),
|
|
1089
|
+
hasEarnedDivisionWinner: import_zod6.z.boolean()
|
|
1090
|
+
})
|
|
1091
|
+
})
|
|
1092
|
+
}) }
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
// src/endpoints/riot/pvp.ts
|
|
1096
|
+
var import_zod7 = require("zod");
|
|
1097
|
+
var playerLoadoutV3Endpoint = {
|
|
1098
|
+
name: "Player Loadout V3",
|
|
1099
|
+
description: "Current loadout. The v2 route used by `pvp.playerLoadout` answers 404 on current clients.",
|
|
1100
|
+
category: "PVP Endpoints",
|
|
1101
|
+
type: "pd",
|
|
1102
|
+
suffix: "personalization/v3/players/{puuid}/playerloadout",
|
|
1103
|
+
riotRequirements: player,
|
|
1104
|
+
responses: { "200": import_zod7.z.object({
|
|
1105
|
+
Subject: import_zod7.z.string(),
|
|
1106
|
+
Version: import_zod7.z.number(),
|
|
1107
|
+
Guns: import_zod7.z.array(import_zod7.z.object({
|
|
1108
|
+
ID: import_zod7.z.string(),
|
|
1109
|
+
SkinID: import_zod7.z.string(),
|
|
1110
|
+
SkinLevelID: import_zod7.z.string(),
|
|
1111
|
+
ChromaID: import_zod7.z.string(),
|
|
1112
|
+
CharmInstanceID: import_zod7.z.string().optional(),
|
|
1113
|
+
CharmID: import_zod7.z.string().optional(),
|
|
1114
|
+
CharmLevelID: import_zod7.z.string().optional()
|
|
1115
|
+
})),
|
|
1116
|
+
ActiveExpressions: import_zod7.z.array(import_zod7.z.object({
|
|
1117
|
+
TypeID: import_zod7.z.string(),
|
|
1118
|
+
AssetID: import_zod7.z.string()
|
|
1119
|
+
})),
|
|
1120
|
+
DynamicOptions: import_zod7.z.object({}),
|
|
1121
|
+
Identity: import_zod7.z.object({
|
|
1122
|
+
PlayerCardID: import_zod7.z.string(),
|
|
1123
|
+
PlayerTitleID: import_zod7.z.string(),
|
|
1124
|
+
AccountLevel: import_zod7.z.number(),
|
|
1125
|
+
PreferredLevelBorderID: import_zod7.z.string(),
|
|
1126
|
+
HideAccountLevel: import_zod7.z.boolean()
|
|
1127
|
+
}),
|
|
1128
|
+
Incognito: import_zod7.z.boolean()
|
|
1129
|
+
}) }
|
|
1130
|
+
};
|
|
1131
|
+
|
|
1132
|
+
// src/endpoints/riot/restrictions.ts
|
|
1133
|
+
var import_zod8 = require("zod");
|
|
1134
|
+
var avoidListEndpoint = {
|
|
1135
|
+
name: "Avoid List",
|
|
1136
|
+
description: "Players the account avoids in matchmaking.",
|
|
1137
|
+
category: "Restriction Endpoints",
|
|
1138
|
+
type: "pd",
|
|
1139
|
+
suffix: "restrictions/v1/avoidList",
|
|
1140
|
+
riotRequirements: player,
|
|
1141
|
+
responses: { "200": import_zod8.z.object({
|
|
1142
|
+
Subject: import_zod8.z.string()
|
|
1143
|
+
}) }
|
|
1144
|
+
};
|
|
1145
|
+
var activeFutureInterventionsEndpoint = {
|
|
1146
|
+
name: "Active Future Interventions",
|
|
1147
|
+
description: "Upcoming or active restrictions of the account, by category.",
|
|
1148
|
+
category: "Restriction Endpoints",
|
|
1149
|
+
type: "pd",
|
|
1150
|
+
suffix: "restrictions/v1/activeFutureInterventions",
|
|
1151
|
+
riotRequirements: player,
|
|
1152
|
+
responses: { "200": import_zod8.z.object({
|
|
1153
|
+
Subject: import_zod8.z.string()
|
|
1154
|
+
}) }
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
// src/endpoints/riot/store.ts
|
|
1158
|
+
var import_zod9 = require("zod");
|
|
1159
|
+
var agentStoreEndpoint = {
|
|
1160
|
+
name: "Agent Store",
|
|
1161
|
+
description: "Agents offered in the store.",
|
|
1162
|
+
category: "Store Endpoints",
|
|
1163
|
+
type: "pd",
|
|
1164
|
+
suffix: "store/v1/storefronts/agent",
|
|
1165
|
+
riotRequirements: player,
|
|
1166
|
+
responses: { "200": import_zod9.z.object({
|
|
1167
|
+
AgentStore: import_zod9.z.object({
|
|
1168
|
+
AgentStoreOffers: import_zod9.z.array(import_zod9.z.object({
|
|
1169
|
+
AgentID: import_zod9.z.string(),
|
|
1170
|
+
StoreOffers: import_zod9.z.array(import_zod9.z.object({
|
|
1171
|
+
OfferID: import_zod9.z.string(),
|
|
1172
|
+
IsDirectPurchase: import_zod9.z.boolean(),
|
|
1173
|
+
StartDate: import_zod9.z.string(),
|
|
1174
|
+
Cost: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.number()),
|
|
1175
|
+
Rewards: import_zod9.z.array(import_zod9.z.object({
|
|
1176
|
+
ItemTypeID: import_zod9.z.string(),
|
|
1177
|
+
ItemID: import_zod9.z.string(),
|
|
1178
|
+
Quantity: import_zod9.z.number()
|
|
1179
|
+
}))
|
|
1180
|
+
}))
|
|
1181
|
+
})),
|
|
1182
|
+
CurrentFeaturedAgent: import_zod9.z.string(),
|
|
1183
|
+
NextFeaturedAgent: import_zod9.z.string()
|
|
1184
|
+
})
|
|
1185
|
+
}) }
|
|
1186
|
+
};
|
|
1187
|
+
var allEntitlementsEndpoint = {
|
|
1188
|
+
name: "All Entitlements",
|
|
1189
|
+
description: "Everything the player owns, grouped by item type. This is the call without an item type, which is the shape `store.ownedItems` describes.",
|
|
1190
|
+
category: "Store Endpoints",
|
|
1191
|
+
type: "pd",
|
|
1192
|
+
suffix: "store/v1/entitlements/{puuid}",
|
|
1193
|
+
riotRequirements: player,
|
|
1194
|
+
responses: { "200": import_zod9.z.object({
|
|
1195
|
+
EntitlementsByTypes: import_zod9.z.array(import_zod9.z.object({
|
|
1196
|
+
ItemTypeID: import_zod9.z.string(),
|
|
1197
|
+
Entitlements: import_zod9.z.array(import_zod9.z.object({
|
|
1198
|
+
TypeID: import_zod9.z.string(),
|
|
1199
|
+
ItemID: import_zod9.z.string(),
|
|
1200
|
+
InstanceID: import_zod9.z.string().optional()
|
|
1201
|
+
}))
|
|
1202
|
+
}))
|
|
1203
|
+
}) }
|
|
1204
|
+
};
|
|
1205
|
+
|
|
1206
|
+
// src/endpoints/riot/storefront.ts
|
|
1207
|
+
var import_zod10 = require("zod");
|
|
1208
|
+
var storefrontV3Endpoint = {
|
|
1209
|
+
name: "Storefront V3",
|
|
1210
|
+
description: "Get the current storefront of the player: featured bundles, the daily skin offers, accessories and night market plugins. Replaces the v2 storefront endpoint, which now answers 404.",
|
|
1211
|
+
category: "Store Endpoints",
|
|
1212
|
+
type: "pd",
|
|
1213
|
+
method: "POST",
|
|
1214
|
+
suffix: "store/v3/storefront/{puuid}",
|
|
1215
|
+
headers: /* @__PURE__ */ new Map([["Content-Type", "application/json"]]),
|
|
1216
|
+
riotRequirements: player,
|
|
1217
|
+
responses: { "200": import_zod10.z.object({
|
|
1218
|
+
FeaturedBundle: import_zod10.z.object({
|
|
1219
|
+
Bundle: import_zod10.z.object({
|
|
1220
|
+
ID: import_zod10.z.string(),
|
|
1221
|
+
DataAssetID: import_zod10.z.string(),
|
|
1222
|
+
CurrencyID: import_zod10.z.string(),
|
|
1223
|
+
Items: import_zod10.z.array(import_zod10.z.object({
|
|
1224
|
+
Item: import_zod10.z.object({
|
|
1225
|
+
ItemTypeID: import_zod10.z.string(),
|
|
1226
|
+
ItemID: import_zod10.z.string(),
|
|
1227
|
+
Amount: import_zod10.z.number()
|
|
1228
|
+
}),
|
|
1229
|
+
BasePrice: import_zod10.z.number(),
|
|
1230
|
+
CurrencyID: import_zod10.z.string(),
|
|
1231
|
+
DiscountPercent: import_zod10.z.number(),
|
|
1232
|
+
DiscountedPrice: import_zod10.z.number(),
|
|
1233
|
+
IsPromoItem: import_zod10.z.boolean()
|
|
1234
|
+
})),
|
|
1235
|
+
ItemOffers: import_zod10.z.array(import_zod10.z.object({
|
|
1236
|
+
BundleItemOfferID: import_zod10.z.string(),
|
|
1237
|
+
Offer: import_zod10.z.object({
|
|
1238
|
+
OfferID: import_zod10.z.string(),
|
|
1239
|
+
IsDirectPurchase: import_zod10.z.boolean(),
|
|
1240
|
+
StartDate: import_zod10.z.string(),
|
|
1241
|
+
Cost: import_zod10.z.object({
|
|
1242
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1243
|
+
}),
|
|
1244
|
+
Rewards: import_zod10.z.array(import_zod10.z.object({
|
|
1245
|
+
ItemTypeID: import_zod10.z.string(),
|
|
1246
|
+
ItemID: import_zod10.z.string(),
|
|
1247
|
+
Quantity: import_zod10.z.number()
|
|
1248
|
+
}))
|
|
1249
|
+
}),
|
|
1250
|
+
DiscountPercent: import_zod10.z.number(),
|
|
1251
|
+
DiscountedCost: import_zod10.z.object({
|
|
1252
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1253
|
+
})
|
|
1254
|
+
})),
|
|
1255
|
+
TotalBaseCost: import_zod10.z.object({
|
|
1256
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1257
|
+
}),
|
|
1258
|
+
TotalDiscountedCost: import_zod10.z.object({
|
|
1259
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1260
|
+
}),
|
|
1261
|
+
TotalDiscountPercent: import_zod10.z.number(),
|
|
1262
|
+
DurationRemainingInSeconds: import_zod10.z.number(),
|
|
1263
|
+
WholesaleOnly: import_zod10.z.boolean(),
|
|
1264
|
+
IsGiftable: import_zod10.z.number()
|
|
1265
|
+
}),
|
|
1266
|
+
Bundles: import_zod10.z.array(import_zod10.z.object({
|
|
1267
|
+
ID: import_zod10.z.string(),
|
|
1268
|
+
DataAssetID: import_zod10.z.string(),
|
|
1269
|
+
CurrencyID: import_zod10.z.string(),
|
|
1270
|
+
Items: import_zod10.z.array(import_zod10.z.object({
|
|
1271
|
+
Item: import_zod10.z.object({
|
|
1272
|
+
ItemTypeID: import_zod10.z.string(),
|
|
1273
|
+
ItemID: import_zod10.z.string(),
|
|
1274
|
+
Amount: import_zod10.z.number()
|
|
1275
|
+
}),
|
|
1276
|
+
BasePrice: import_zod10.z.number(),
|
|
1277
|
+
CurrencyID: import_zod10.z.string(),
|
|
1278
|
+
DiscountPercent: import_zod10.z.number(),
|
|
1279
|
+
DiscountedPrice: import_zod10.z.number(),
|
|
1280
|
+
IsPromoItem: import_zod10.z.boolean()
|
|
1281
|
+
})),
|
|
1282
|
+
ItemOffers: import_zod10.z.array(import_zod10.z.object({
|
|
1283
|
+
BundleItemOfferID: import_zod10.z.string(),
|
|
1284
|
+
Offer: import_zod10.z.object({
|
|
1285
|
+
OfferID: import_zod10.z.string(),
|
|
1286
|
+
IsDirectPurchase: import_zod10.z.boolean(),
|
|
1287
|
+
StartDate: import_zod10.z.string(),
|
|
1288
|
+
Cost: import_zod10.z.object({
|
|
1289
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1290
|
+
}),
|
|
1291
|
+
Rewards: import_zod10.z.array(import_zod10.z.object({
|
|
1292
|
+
ItemTypeID: import_zod10.z.string(),
|
|
1293
|
+
ItemID: import_zod10.z.string(),
|
|
1294
|
+
Quantity: import_zod10.z.number()
|
|
1295
|
+
}))
|
|
1296
|
+
}),
|
|
1297
|
+
DiscountPercent: import_zod10.z.number(),
|
|
1298
|
+
DiscountedCost: import_zod10.z.object({
|
|
1299
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1300
|
+
})
|
|
1301
|
+
})),
|
|
1302
|
+
TotalBaseCost: import_zod10.z.object({
|
|
1303
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1304
|
+
}),
|
|
1305
|
+
TotalDiscountedCost: import_zod10.z.object({
|
|
1306
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1307
|
+
}),
|
|
1308
|
+
TotalDiscountPercent: import_zod10.z.number(),
|
|
1309
|
+
DurationRemainingInSeconds: import_zod10.z.number(),
|
|
1310
|
+
WholesaleOnly: import_zod10.z.boolean(),
|
|
1311
|
+
IsGiftable: import_zod10.z.number()
|
|
1312
|
+
})),
|
|
1313
|
+
FeaturedTileEntries: import_zod10.z.array(import_zod10.z.object({
|
|
1314
|
+
Type: import_zod10.z.number(),
|
|
1315
|
+
Entry: import_zod10.z.object({
|
|
1316
|
+
Bundle: import_zod10.z.object({
|
|
1317
|
+
ID: import_zod10.z.string(),
|
|
1318
|
+
DataAssetID: import_zod10.z.string(),
|
|
1319
|
+
CurrencyID: import_zod10.z.string(),
|
|
1320
|
+
Items: import_zod10.z.array(import_zod10.z.object({
|
|
1321
|
+
Item: import_zod10.z.object({
|
|
1322
|
+
ItemTypeID: import_zod10.z.string(),
|
|
1323
|
+
ItemID: import_zod10.z.string(),
|
|
1324
|
+
Amount: import_zod10.z.number()
|
|
1325
|
+
}),
|
|
1326
|
+
BasePrice: import_zod10.z.number(),
|
|
1327
|
+
CurrencyID: import_zod10.z.string(),
|
|
1328
|
+
DiscountPercent: import_zod10.z.number(),
|
|
1329
|
+
DiscountedPrice: import_zod10.z.number(),
|
|
1330
|
+
IsPromoItem: import_zod10.z.boolean()
|
|
1331
|
+
})),
|
|
1332
|
+
ItemOffers: import_zod10.z.array(import_zod10.z.object({
|
|
1333
|
+
BundleItemOfferID: import_zod10.z.string(),
|
|
1334
|
+
Offer: import_zod10.z.object({
|
|
1335
|
+
OfferID: import_zod10.z.string(),
|
|
1336
|
+
IsDirectPurchase: import_zod10.z.boolean(),
|
|
1337
|
+
StartDate: import_zod10.z.string(),
|
|
1338
|
+
Cost: import_zod10.z.object({
|
|
1339
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1340
|
+
}),
|
|
1341
|
+
Rewards: import_zod10.z.array(import_zod10.z.object({
|
|
1342
|
+
ItemTypeID: import_zod10.z.string(),
|
|
1343
|
+
ItemID: import_zod10.z.string(),
|
|
1344
|
+
Quantity: import_zod10.z.number()
|
|
1345
|
+
}))
|
|
1346
|
+
}),
|
|
1347
|
+
DiscountPercent: import_zod10.z.number(),
|
|
1348
|
+
DiscountedCost: import_zod10.z.object({
|
|
1349
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1350
|
+
})
|
|
1351
|
+
})),
|
|
1352
|
+
TotalBaseCost: import_zod10.z.object({
|
|
1353
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1354
|
+
}),
|
|
1355
|
+
TotalDiscountedCost: import_zod10.z.object({
|
|
1356
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1357
|
+
}),
|
|
1358
|
+
TotalDiscountPercent: import_zod10.z.number(),
|
|
1359
|
+
DurationRemainingInSeconds: import_zod10.z.number(),
|
|
1360
|
+
WholesaleOnly: import_zod10.z.boolean(),
|
|
1361
|
+
IsGiftable: import_zod10.z.number()
|
|
1362
|
+
})
|
|
1363
|
+
})
|
|
1364
|
+
})),
|
|
1365
|
+
BundleRemainingDurationInSeconds: import_zod10.z.number()
|
|
1366
|
+
}),
|
|
1367
|
+
SkinsPanelLayout: import_zod10.z.object({
|
|
1368
|
+
SingleItemOffers: import_zod10.z.array(import_zod10.z.string()),
|
|
1369
|
+
SingleItemStoreOffers: import_zod10.z.array(import_zod10.z.object({
|
|
1370
|
+
OfferID: import_zod10.z.string(),
|
|
1371
|
+
IsDirectPurchase: import_zod10.z.boolean(),
|
|
1372
|
+
StartDate: import_zod10.z.string(),
|
|
1373
|
+
Cost: import_zod10.z.object({
|
|
1374
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1375
|
+
}),
|
|
1376
|
+
Rewards: import_zod10.z.array(import_zod10.z.object({
|
|
1377
|
+
ItemTypeID: import_zod10.z.string(),
|
|
1378
|
+
ItemID: import_zod10.z.string(),
|
|
1379
|
+
Quantity: import_zod10.z.number()
|
|
1380
|
+
}))
|
|
1381
|
+
})),
|
|
1382
|
+
SingleItemOffersRemainingDurationInSeconds: import_zod10.z.number()
|
|
1383
|
+
}),
|
|
1384
|
+
UpgradeCurrencyStore: import_zod10.z.object({
|
|
1385
|
+
UpgradeCurrencyOffers: import_zod10.z.array(import_zod10.z.object({
|
|
1386
|
+
OfferID: import_zod10.z.string(),
|
|
1387
|
+
StorefrontItemID: import_zod10.z.string(),
|
|
1388
|
+
Offer: import_zod10.z.object({
|
|
1389
|
+
OfferID: import_zod10.z.string(),
|
|
1390
|
+
IsDirectPurchase: import_zod10.z.boolean(),
|
|
1391
|
+
StartDate: import_zod10.z.string(),
|
|
1392
|
+
Cost: import_zod10.z.object({
|
|
1393
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1394
|
+
}),
|
|
1395
|
+
Rewards: import_zod10.z.array(import_zod10.z.object({
|
|
1396
|
+
ItemTypeID: import_zod10.z.string(),
|
|
1397
|
+
ItemID: import_zod10.z.string(),
|
|
1398
|
+
Quantity: import_zod10.z.number()
|
|
1399
|
+
}))
|
|
1400
|
+
}),
|
|
1401
|
+
DiscountedPercent: import_zod10.z.number()
|
|
1402
|
+
}))
|
|
1403
|
+
}),
|
|
1404
|
+
AccessoryStore: import_zod10.z.object({
|
|
1405
|
+
AccessoryStoreOffers: import_zod10.z.array(import_zod10.z.object({
|
|
1406
|
+
Offer: import_zod10.z.object({
|
|
1407
|
+
OfferID: import_zod10.z.string(),
|
|
1408
|
+
IsDirectPurchase: import_zod10.z.boolean(),
|
|
1409
|
+
StartDate: import_zod10.z.string(),
|
|
1410
|
+
Cost: import_zod10.z.object({
|
|
1411
|
+
"85ca954a-41f2-ce94-9b45-8ca3dd39a00d": import_zod10.z.number()
|
|
1412
|
+
}),
|
|
1413
|
+
Rewards: import_zod10.z.array(import_zod10.z.object({
|
|
1414
|
+
ItemTypeID: import_zod10.z.string(),
|
|
1415
|
+
ItemID: import_zod10.z.string(),
|
|
1416
|
+
Quantity: import_zod10.z.number()
|
|
1417
|
+
}))
|
|
1418
|
+
}),
|
|
1419
|
+
ContractID: import_zod10.z.string()
|
|
1420
|
+
})),
|
|
1421
|
+
AccessoryStoreRemainingDurationInSeconds: import_zod10.z.number(),
|
|
1422
|
+
StorefrontID: import_zod10.z.string()
|
|
1423
|
+
}),
|
|
1424
|
+
PluginStores: import_zod10.z.array(import_zod10.z.object({
|
|
1425
|
+
PluginID: import_zod10.z.string(),
|
|
1426
|
+
PluginOffers: import_zod10.z.object({
|
|
1427
|
+
StoreOffers: import_zod10.z.array(import_zod10.z.object({
|
|
1428
|
+
PurchaseInformation: import_zod10.z.object({
|
|
1429
|
+
DataAssetID: import_zod10.z.string(),
|
|
1430
|
+
OfferID: import_zod10.z.string(),
|
|
1431
|
+
OfferType: import_zod10.z.number(),
|
|
1432
|
+
StartDate: import_zod10.z.string(),
|
|
1433
|
+
PrimaryCurrencyID: import_zod10.z.string(),
|
|
1434
|
+
Cost: import_zod10.z.object({
|
|
1435
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1436
|
+
}),
|
|
1437
|
+
DiscountedCost: import_zod10.z.object({
|
|
1438
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1439
|
+
}),
|
|
1440
|
+
DiscountedPercentage: import_zod10.z.number(),
|
|
1441
|
+
WholesaleOnly: import_zod10.z.boolean(),
|
|
1442
|
+
IsGiftable: import_zod10.z.number()
|
|
1443
|
+
}),
|
|
1444
|
+
SubOffers: import_zod10.z.array(import_zod10.z.object({
|
|
1445
|
+
PurchaseInformation: import_zod10.z.object({
|
|
1446
|
+
DataAssetID: import_zod10.z.string(),
|
|
1447
|
+
OfferID: import_zod10.z.string(),
|
|
1448
|
+
OfferType: import_zod10.z.number(),
|
|
1449
|
+
StartDate: import_zod10.z.string(),
|
|
1450
|
+
PrimaryCurrencyID: import_zod10.z.string(),
|
|
1451
|
+
Cost: import_zod10.z.object({
|
|
1452
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1453
|
+
}),
|
|
1454
|
+
DiscountedCost: import_zod10.z.object({
|
|
1455
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": import_zod10.z.number()
|
|
1456
|
+
}),
|
|
1457
|
+
DiscountedPercentage: import_zod10.z.number(),
|
|
1458
|
+
Rewards: import_zod10.z.array(import_zod10.z.object({
|
|
1459
|
+
ItemTypeID: import_zod10.z.string(),
|
|
1460
|
+
ItemID: import_zod10.z.string(),
|
|
1461
|
+
Quantity: import_zod10.z.number()
|
|
1462
|
+
})),
|
|
1463
|
+
WholesaleOnly: import_zod10.z.boolean(),
|
|
1464
|
+
IsGiftable: import_zod10.z.number()
|
|
1465
|
+
})
|
|
1466
|
+
}))
|
|
1467
|
+
})),
|
|
1468
|
+
RemainingDurationInSeconds: import_zod10.z.number()
|
|
1469
|
+
}),
|
|
1470
|
+
StartDate: import_zod10.z.string()
|
|
1471
|
+
}))
|
|
1472
|
+
}) }
|
|
1473
|
+
};
|
|
1474
|
+
|
|
1475
|
+
// src/endpoints/riot/voice.ts
|
|
1476
|
+
var import_zod11 = require("zod");
|
|
1477
|
+
var voiceAudioPropertiesEndpoint = {
|
|
1478
|
+
name: "Audio Properties",
|
|
1479
|
+
description: "Get audio properties such as if the microphone is in use",
|
|
1480
|
+
category: "Local Endpoints - Voice",
|
|
1481
|
+
type: "local",
|
|
1482
|
+
suffix: "voice-chat/v1/audio-properties",
|
|
1483
|
+
riotRequirements: { localAuth: true },
|
|
1484
|
+
responses: { "200": import_zod11.z.object({
|
|
1485
|
+
fastEnergyMeter: import_zod11.z.number(),
|
|
1486
|
+
isLoopbackEnabled: import_zod11.z.boolean(),
|
|
1487
|
+
isMicActive: import_zod11.z.boolean(),
|
|
1488
|
+
isSpeakerActive: import_zod11.z.boolean(),
|
|
1489
|
+
micEnergy: import_zod11.z.number(),
|
|
1490
|
+
micVolume: import_zod11.z.number(),
|
|
1491
|
+
noiseFloorMeter: import_zod11.z.number(),
|
|
1492
|
+
speakerEnergy: import_zod11.z.number(),
|
|
1493
|
+
speakerVolume: import_zod11.z.number(),
|
|
1494
|
+
speechThresholdMeter: import_zod11.z.number()
|
|
1495
|
+
}) }
|
|
1496
|
+
};
|
|
1497
|
+
var voiceCaptureDevicesEndpoint = {
|
|
1498
|
+
name: "Capture Devices",
|
|
1499
|
+
description: "Get microphone input device info",
|
|
1500
|
+
category: "Local Endpoints - Voice",
|
|
1501
|
+
type: "local",
|
|
1502
|
+
suffix: "voice-chat/v2/devices/capture",
|
|
1503
|
+
riotRequirements: { localAuth: true },
|
|
1504
|
+
responses: { "200": import_zod11.z.array(import_zod11.z.object({
|
|
1505
|
+
handle: import_zod11.z.string(),
|
|
1506
|
+
is_current_device: import_zod11.z.boolean(),
|
|
1507
|
+
is_default: import_zod11.z.boolean(),
|
|
1508
|
+
is_effective_device: import_zod11.z.boolean(),
|
|
1509
|
+
name: import_zod11.z.string()
|
|
1510
|
+
})) }
|
|
1511
|
+
};
|
|
1512
|
+
var voiceRenderDevicesEndpoint = {
|
|
1513
|
+
name: "Render Devices",
|
|
1514
|
+
description: "Get audio output devices",
|
|
1515
|
+
category: "Local Endpoints - Voice",
|
|
1516
|
+
type: "local",
|
|
1517
|
+
suffix: "voice-chat/v2/devices/render",
|
|
1518
|
+
riotRequirements: { localAuth: true },
|
|
1519
|
+
responses: { "200": import_zod11.z.array(import_zod11.z.object({
|
|
1520
|
+
handle: import_zod11.z.string(),
|
|
1521
|
+
is_current_device: import_zod11.z.boolean(),
|
|
1522
|
+
is_default: import_zod11.z.boolean(),
|
|
1523
|
+
is_effective_device: import_zod11.z.boolean(),
|
|
1524
|
+
name: import_zod11.z.string()
|
|
1525
|
+
})) }
|
|
1526
|
+
};
|
|
1527
|
+
|
|
1528
|
+
// src/api/groups/pvp.ts
|
|
1529
|
+
var pvp = {
|
|
1530
|
+
content: import_valorant_api_types.endpoints.fetchContentEndpoint,
|
|
1531
|
+
accountXp: import_valorant_api_types.endpoints.accountXPEndpoint,
|
|
1532
|
+
playerLoadout: import_valorant_api_types.endpoints.playerLoadoutEndpoint,
|
|
1533
|
+
setPlayerLoadout: import_valorant_api_types.endpoints.setPlayerLoadoutEndpoint,
|
|
1534
|
+
playerMmr: import_valorant_api_types.endpoints.playerMMREndpoint,
|
|
1535
|
+
matchHistory: import_valorant_api_types.endpoints.matchHistoryEndpoint,
|
|
1536
|
+
matchDetails: import_valorant_api_types.endpoints.matchDetailsEndpoint,
|
|
1537
|
+
competitiveUpdates: import_valorant_api_types.endpoints.competitiveUpdatesEndpoint,
|
|
1538
|
+
leaderboard: import_valorant_api_types.endpoints.leaderboardEndpoint,
|
|
1539
|
+
penalties: import_valorant_api_types.endpoints.penaltiesEndpoint,
|
|
1540
|
+
config: import_valorant_api_types.endpoints.configEndpoint,
|
|
1541
|
+
nameService: import_valorant_api_types.endpoints.nameServiceEndpoint,
|
|
1542
|
+
playerLoadoutV3: playerLoadoutV3Endpoint
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1545
|
+
// src/api/groups/party.ts
|
|
1546
|
+
var import_valorant_api_types2 = require("valorant-api-types");
|
|
1547
|
+
var party = {
|
|
1548
|
+
get: import_valorant_api_types2.endpoints.partyEndpoint,
|
|
1549
|
+
player: import_valorant_api_types2.endpoints.partyPlayerEndpoint,
|
|
1550
|
+
removePlayer: import_valorant_api_types2.endpoints.partyRemovePlayerEndpoint,
|
|
1551
|
+
setMemberReady: import_valorant_api_types2.endpoints.partySetMemberReadyEndpoint,
|
|
1552
|
+
refreshCompetitiveTier: import_valorant_api_types2.endpoints.refreshCompetitiveTierEndpoint,
|
|
1553
|
+
refreshPlayerIdentity: import_valorant_api_types2.endpoints.refreshPlayerIdentityEndpoint,
|
|
1554
|
+
refreshPings: import_valorant_api_types2.endpoints.refreshPingsEndpoint,
|
|
1555
|
+
changeQueue: import_valorant_api_types2.endpoints.changeQueueEndpoint,
|
|
1556
|
+
startCustomGame: import_valorant_api_types2.endpoints.startCustomGameEndpoint,
|
|
1557
|
+
enterMatchmakingQueue: import_valorant_api_types2.endpoints.enterMatchmakingQueueEndpoint,
|
|
1558
|
+
leaveMatchmakingQueue: import_valorant_api_types2.endpoints.leaveMatchmakingQueueEndpoint,
|
|
1559
|
+
setAccessibility: import_valorant_api_types2.endpoints.setPartyAccessibilityEndpoint,
|
|
1560
|
+
setCustomGameSettings: import_valorant_api_types2.endpoints.setCustomGameSettingsEndpoint,
|
|
1561
|
+
invite: import_valorant_api_types2.endpoints.partyInviteEndpoint,
|
|
1562
|
+
requestToJoin: import_valorant_api_types2.endpoints.partyRequestEndpoint,
|
|
1563
|
+
declineRequest: import_valorant_api_types2.endpoints.partyDeclineEndpoint,
|
|
1564
|
+
customGameConfigs: import_valorant_api_types2.endpoints.customGameConfigsEndpoint,
|
|
1565
|
+
chatToken: import_valorant_api_types2.endpoints.partyChatTokenEndpoint,
|
|
1566
|
+
voiceToken: import_valorant_api_types2.endpoints.partyVoiceTokenEndpoint,
|
|
1567
|
+
disableCode: import_valorant_api_types2.endpoints.partyDisableCodeEndpoint,
|
|
1568
|
+
generateCode: import_valorant_api_types2.endpoints.partyGenerateCodeEndpoint,
|
|
1569
|
+
joinByCode: import_valorant_api_types2.endpoints.partyJoinByCodeEndpoint
|
|
1570
|
+
};
|
|
1571
|
+
|
|
1572
|
+
// src/api/groups/store.ts
|
|
1573
|
+
var import_valorant_api_types3 = require("valorant-api-types");
|
|
1574
|
+
var store = {
|
|
1575
|
+
prices: import_valorant_api_types3.endpoints.pricesEndpoint,
|
|
1576
|
+
storefront: import_valorant_api_types3.endpoints.storefrontEndpoint,
|
|
1577
|
+
wallet: import_valorant_api_types3.endpoints.walletEndpoint,
|
|
1578
|
+
ownedItems: import_valorant_api_types3.endpoints.ownedItemsEndpoint,
|
|
1579
|
+
storefrontV3: storefrontV3Endpoint,
|
|
1580
|
+
agentStore: agentStoreEndpoint,
|
|
1581
|
+
allEntitlements: allEntitlementsEndpoint
|
|
1582
|
+
};
|
|
1583
|
+
|
|
1584
|
+
// src/api/groups/pregame.ts
|
|
1585
|
+
var import_valorant_api_types4 = require("valorant-api-types");
|
|
1586
|
+
var pregame = {
|
|
1587
|
+
player: import_valorant_api_types4.endpoints.pregamePlayerEndpoint,
|
|
1588
|
+
match: import_valorant_api_types4.endpoints.pregameMatchEndpoint,
|
|
1589
|
+
loadouts: import_valorant_api_types4.endpoints.pregameLoadoutsEndpoint,
|
|
1590
|
+
selectCharacter: import_valorant_api_types4.endpoints.selectCharacterEndpoint,
|
|
1591
|
+
lockCharacter: import_valorant_api_types4.endpoints.lockCharacterEndpoint,
|
|
1592
|
+
quit: import_valorant_api_types4.endpoints.pregameQuitEndpoint
|
|
1593
|
+
};
|
|
1594
|
+
|
|
1595
|
+
// src/api/groups/currentGame.ts
|
|
1596
|
+
var import_valorant_api_types5 = require("valorant-api-types");
|
|
1597
|
+
var currentGame = {
|
|
1598
|
+
player: import_valorant_api_types5.endpoints.currentGamePlayerEndpoint,
|
|
1599
|
+
match: import_valorant_api_types5.endpoints.currentGameMatchEndpoint,
|
|
1600
|
+
loadouts: import_valorant_api_types5.endpoints.currentGameLoadoutsEndpoint,
|
|
1601
|
+
quit: import_valorant_api_types5.endpoints.currentGameQuitEndpoint
|
|
1602
|
+
};
|
|
1603
|
+
|
|
1604
|
+
// src/api/groups/contracts.ts
|
|
1605
|
+
var import_valorant_api_types6 = require("valorant-api-types");
|
|
1606
|
+
var contracts = {
|
|
1607
|
+
itemUpgrades: import_valorant_api_types6.endpoints.itemUpgradesEndpoint,
|
|
1608
|
+
list: import_valorant_api_types6.endpoints.contractsEndpoint,
|
|
1609
|
+
activate: import_valorant_api_types6.endpoints.activateContractEndpoint,
|
|
1610
|
+
activeRecruitmentEvent: activeRecruitmentEventEndpoint
|
|
1611
|
+
};
|
|
1612
|
+
|
|
1613
|
+
// src/api/groups/local.ts
|
|
1614
|
+
var import_valorant_api_types7 = require("valorant-api-types");
|
|
1615
|
+
var local = {
|
|
1616
|
+
help: import_valorant_api_types7.endpoints.localHelpEndpoint,
|
|
1617
|
+
sessions: import_valorant_api_types7.endpoints.sessionsEndpoint,
|
|
1618
|
+
rsoUserInfo: import_valorant_api_types7.endpoints.rsoUserInfoEndpoint,
|
|
1619
|
+
clientRegion: import_valorant_api_types7.endpoints.clientRegionEndpoint,
|
|
1620
|
+
accountAlias: import_valorant_api_types7.endpoints.accountAliasEndpoint,
|
|
1621
|
+
entitlementsToken: import_valorant_api_types7.endpoints.entitlementsTokenEndpoint,
|
|
1622
|
+
chatSession: import_valorant_api_types7.endpoints.chatSessionEndpoint,
|
|
1623
|
+
friends: import_valorant_api_types7.endpoints.friendsEndpoint,
|
|
1624
|
+
sendFriendRequest: import_valorant_api_types7.endpoints.sendFriendRequestEndpoint,
|
|
1625
|
+
removeFriendRequest: import_valorant_api_types7.endpoints.removeFriendRequestEndpoint,
|
|
1626
|
+
presence: import_valorant_api_types7.endpoints.presenceEndpoint,
|
|
1627
|
+
friendRequests: import_valorant_api_types7.endpoints.friendRequestsEndpoint,
|
|
1628
|
+
swaggerDocs: import_valorant_api_types7.endpoints.localSwaggerDocsEndpoint,
|
|
1629
|
+
eula: localEulaEndpoint,
|
|
1630
|
+
privacyPolicy: localPrivacyPolicyEndpoint,
|
|
1631
|
+
availableLocales: localAvailableLocalesEndpoint,
|
|
1632
|
+
locale: localLocaleEndpoint,
|
|
1633
|
+
riotStatus: localRiotStatusEndpoint,
|
|
1634
|
+
accessToken: localAccessTokenEndpoint,
|
|
1635
|
+
pluginStatus: localPluginStatusEndpoint,
|
|
1636
|
+
rmsSession: localRmsSessionEndpoint,
|
|
1637
|
+
processInfo: localProcessInfoEndpoint,
|
|
1638
|
+
logPath: localLogPathEndpoint
|
|
1639
|
+
};
|
|
1640
|
+
|
|
1641
|
+
// src/api/groups/chat.ts
|
|
1642
|
+
var import_valorant_api_types8 = require("valorant-api-types");
|
|
1643
|
+
var chat = {
|
|
1644
|
+
partyInfo: import_valorant_api_types8.endpoints.partyChatInfoEndpoint,
|
|
1645
|
+
pregameInfo: import_valorant_api_types8.endpoints.pregameChatInfoEndpoint,
|
|
1646
|
+
currentGameInfo: import_valorant_api_types8.endpoints.currentGameChatInfoEndpoint,
|
|
1647
|
+
allInfo: import_valorant_api_types8.endpoints.allChatInfoEndpoint,
|
|
1648
|
+
participants: import_valorant_api_types8.endpoints.chatParticipantsEndpoint,
|
|
1649
|
+
send: import_valorant_api_types8.endpoints.sendChatEndpoint,
|
|
1650
|
+
history: import_valorant_api_types8.endpoints.chatHistoryEndpoint,
|
|
1651
|
+
settings: chatSettingsEndpoint,
|
|
1652
|
+
tournamentInfo: chatTournamentInfoEndpoint
|
|
1653
|
+
};
|
|
1654
|
+
|
|
1655
|
+
// src/api/groups/voice.ts
|
|
1656
|
+
var voice = {
|
|
1657
|
+
audioProperties: voiceAudioPropertiesEndpoint,
|
|
1658
|
+
captureDevices: voiceCaptureDevicesEndpoint,
|
|
1659
|
+
renderDevices: voiceRenderDevicesEndpoint
|
|
1660
|
+
};
|
|
1661
|
+
|
|
1662
|
+
// src/api/groups/premier.ts
|
|
1663
|
+
var premier = {
|
|
1664
|
+
seasons: premierSeasonsEndpoint,
|
|
1665
|
+
activeSeason: premierActiveSeasonEndpoint,
|
|
1666
|
+
conferences: premierConferencesEndpoint,
|
|
1667
|
+
matchLimit: premierMatchLimitEndpoint,
|
|
1668
|
+
eligibility: premierEligibilityEndpoint,
|
|
1669
|
+
playerV2: premierPlayerV2Endpoint,
|
|
1670
|
+
playerV3: premierPlayerV3Endpoint
|
|
1671
|
+
};
|
|
1672
|
+
|
|
1673
|
+
// src/api/groups/esports.ts
|
|
1674
|
+
var esports = {
|
|
1675
|
+
liveEventTimes: esportsLiveEventTimesEndpoint,
|
|
1676
|
+
upcomingMatches: esportsUpcomingMatchesEndpoint,
|
|
1677
|
+
pickemLeagues: esportsPickemLeaguesEndpoint
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1680
|
+
// src/api/groups/restrictions.ts
|
|
1681
|
+
var restrictions = {
|
|
1682
|
+
avoidList: avoidListEndpoint,
|
|
1683
|
+
activeFutureInterventions: activeFutureInterventionsEndpoint
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1686
|
+
// src/api/groups/account.ts
|
|
1687
|
+
var account = {
|
|
1688
|
+
dailyTicket: dailyTicketEndpoint,
|
|
1689
|
+
dailyTicketQueueConfig: dailyTicketQueueConfigEndpoint,
|
|
1690
|
+
favorites: favoritesEndpoint,
|
|
1691
|
+
goldstars: goldstarsEndpoint,
|
|
1692
|
+
goldstarsPlayer: goldstarsPlayerEndpoint,
|
|
1693
|
+
bloomlineQueues: bloomlineQueuesEndpoint,
|
|
1694
|
+
bloomlinePlayer: bloomlinePlayerEndpoint
|
|
1695
|
+
};
|
|
1696
|
+
|
|
1697
|
+
// src/api/groups/auth.ts
|
|
1698
|
+
var import_valorant_api_types9 = require("valorant-api-types");
|
|
1699
|
+
var auth = {
|
|
1700
|
+
cookies: import_valorant_api_types9.endpoints.authCookiesEndpoint,
|
|
1701
|
+
request: import_valorant_api_types9.endpoints.authRequestEndpoint,
|
|
1702
|
+
multiFactor: import_valorant_api_types9.endpoints.multiFactorAuthenticationEndpoint,
|
|
1703
|
+
cookieReauth: import_valorant_api_types9.endpoints.cookieReauthEndpoint,
|
|
1704
|
+
entitlement: import_valorant_api_types9.endpoints.entitlementEndpoint,
|
|
1705
|
+
playerInfo: import_valorant_api_types9.endpoints.playerInfoEndpoint,
|
|
1706
|
+
riotGeo: import_valorant_api_types9.endpoints.riotGeoEndpoint,
|
|
1707
|
+
pasToken: import_valorant_api_types9.endpoints.pasTokenEndpoint,
|
|
1708
|
+
riotClientConfig: import_valorant_api_types9.endpoints.riotClientConfigEndpoint
|
|
1709
|
+
};
|
|
1710
|
+
|
|
1711
|
+
// src/endpoints/catalog/index.ts
|
|
1712
|
+
var import_zod14 = require("zod");
|
|
1713
|
+
|
|
1714
|
+
// src/endpoints/catalog/factory.ts
|
|
1715
|
+
var import_zod12 = require("zod");
|
|
1716
|
+
|
|
1717
|
+
// src/envelope.ts
|
|
1718
|
+
var enveloped = /* @__PURE__ */ new WeakSet();
|
|
1719
|
+
function markEnveloped(endpoint2) {
|
|
1720
|
+
enveloped.add(endpoint2);
|
|
1721
|
+
return endpoint2;
|
|
1722
|
+
}
|
|
1723
|
+
function unwrapEnvelope(endpoint2, body) {
|
|
1724
|
+
if (enveloped.has(endpoint2) && typeof body === "object" && body !== null && "data" in body) {
|
|
1725
|
+
return body.data;
|
|
1726
|
+
}
|
|
1727
|
+
return body;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
// src/endpoints/catalog/factory.ts
|
|
1731
|
+
var BASE = "https://valorant-api.com/v1/";
|
|
1732
|
+
function query(queryParams = []) {
|
|
1733
|
+
return new Map([
|
|
1734
|
+
["language", import_zod12.z.string().optional().describe("Language code such as `fr-FR`. Defaults to `en-US`.")],
|
|
1735
|
+
...queryParams
|
|
1736
|
+
]);
|
|
1737
|
+
}
|
|
1738
|
+
function endpoint(name, description, path, schema, queryParams = []) {
|
|
1739
|
+
return markEnveloped({
|
|
1740
|
+
name,
|
|
1741
|
+
description,
|
|
1742
|
+
category: "Valorant-API.com",
|
|
1743
|
+
type: "other",
|
|
1744
|
+
suffix: `${BASE}${path}`,
|
|
1745
|
+
query: query(queryParams),
|
|
1746
|
+
responses: { "200": schema }
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
function collection(title, singular, path, schema, queryParams = []) {
|
|
1750
|
+
return {
|
|
1751
|
+
list: endpoint(title, `List of ${title.toLowerCase()}`, path, import_zod12.z.array(schema), queryParams),
|
|
1752
|
+
one: endpoint(singular, `One ${singular.toLowerCase()} by UUID`, `${path}/{uuid}`, schema)
|
|
1753
|
+
};
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
// src/endpoints/catalog/schemas.ts
|
|
1757
|
+
var import_zod13 = require("zod");
|
|
1758
|
+
var text = import_zod13.z.string().nullish();
|
|
1759
|
+
var asset = import_zod13.z.object({
|
|
1760
|
+
uuid: import_zod13.z.string(),
|
|
1761
|
+
displayName: text,
|
|
1762
|
+
displayIcon: text,
|
|
1763
|
+
assetPath: text
|
|
1764
|
+
}).passthrough();
|
|
1765
|
+
var agentSchema = asset.extend({
|
|
1766
|
+
description: text,
|
|
1767
|
+
developerName: text,
|
|
1768
|
+
characterTags: import_zod13.z.array(import_zod13.z.string()).nullish(),
|
|
1769
|
+
displayIconSmall: text,
|
|
1770
|
+
bustPortrait: text,
|
|
1771
|
+
fullPortrait: text,
|
|
1772
|
+
killfeedPortrait: text,
|
|
1773
|
+
background: text,
|
|
1774
|
+
isPlayableCharacter: import_zod13.z.boolean(),
|
|
1775
|
+
role: import_zod13.z.object({ uuid: import_zod13.z.string(), displayName: text, description: text, displayIcon: text }).passthrough().nullish(),
|
|
1776
|
+
abilities: import_zod13.z.array(import_zod13.z.object({ slot: import_zod13.z.string(), displayName: text, description: text, displayIcon: text }).passthrough()).nullish()
|
|
1777
|
+
});
|
|
1778
|
+
var mapSchema = asset.extend({
|
|
1779
|
+
coordinates: text,
|
|
1780
|
+
listViewIcon: text,
|
|
1781
|
+
splash: text,
|
|
1782
|
+
mapUrl: text,
|
|
1783
|
+
xMultiplier: import_zod13.z.number(),
|
|
1784
|
+
yMultiplier: import_zod13.z.number(),
|
|
1785
|
+
xScalarToAdd: import_zod13.z.number(),
|
|
1786
|
+
yScalarToAdd: import_zod13.z.number(),
|
|
1787
|
+
callouts: import_zod13.z.array(import_zod13.z.object({ regionName: import_zod13.z.string(), superRegionName: import_zod13.z.string(), location: import_zod13.z.object({ x: import_zod13.z.number(), y: import_zod13.z.number() }) }).passthrough()).nullish()
|
|
1788
|
+
});
|
|
1789
|
+
var weaponSchema = asset.extend({
|
|
1790
|
+
category: import_zod13.z.string(),
|
|
1791
|
+
defaultSkinUuid: import_zod13.z.string(),
|
|
1792
|
+
killStreamIcon: text,
|
|
1793
|
+
weaponStats: import_zod13.z.object({}).passthrough().nullish(),
|
|
1794
|
+
shopData: import_zod13.z.object({}).passthrough().nullish(),
|
|
1795
|
+
skins: import_zod13.z.array(import_zod13.z.object({}).passthrough())
|
|
1796
|
+
});
|
|
1797
|
+
var skinSchema = asset.extend({
|
|
1798
|
+
themeUuid: import_zod13.z.string(),
|
|
1799
|
+
contentTierUuid: text,
|
|
1800
|
+
wallpaper: text,
|
|
1801
|
+
chromas: import_zod13.z.array(asset.passthrough()),
|
|
1802
|
+
levels: import_zod13.z.array(asset.passthrough())
|
|
1803
|
+
});
|
|
1804
|
+
var seasonSchema = import_zod13.z.object({
|
|
1805
|
+
uuid: import_zod13.z.string(),
|
|
1806
|
+
displayName: text,
|
|
1807
|
+
type: text,
|
|
1808
|
+
startTime: import_zod13.z.string(),
|
|
1809
|
+
endTime: import_zod13.z.string(),
|
|
1810
|
+
parentUuid: text,
|
|
1811
|
+
assetPath: text
|
|
1812
|
+
}).passthrough();
|
|
1813
|
+
var versionSchema = import_zod13.z.object({
|
|
1814
|
+
manifestId: import_zod13.z.string(),
|
|
1815
|
+
branch: import_zod13.z.string(),
|
|
1816
|
+
version: import_zod13.z.string(),
|
|
1817
|
+
buildVersion: import_zod13.z.string(),
|
|
1818
|
+
engineVersion: import_zod13.z.string(),
|
|
1819
|
+
riotClientVersion: import_zod13.z.string().describe("Value of the X-Riot-ClientVersion header"),
|
|
1820
|
+
riotClientBuild: import_zod13.z.string(),
|
|
1821
|
+
buildDate: import_zod13.z.string()
|
|
1822
|
+
}).passthrough();
|
|
1823
|
+
|
|
1824
|
+
// src/endpoints/catalog/index.ts
|
|
1825
|
+
var playable = [["isPlayableCharacter", import_zod14.z.boolean().optional().describe("Only return playable agents. Skips the duplicate Sova.")]];
|
|
1826
|
+
var agents = collection("Agents", "Agent", "agents", agentSchema, playable);
|
|
1827
|
+
var buddies = collection("Buddies", "Buddy", "buddies", asset);
|
|
1828
|
+
var buddyLevels = collection("Buddy Levels", "Buddy Level", "buddies/levels", asset);
|
|
1829
|
+
var bundles = collection("Bundles", "Bundle", "bundles", asset);
|
|
1830
|
+
var ceremonies = collection("Ceremonies", "Ceremony", "ceremonies", asset);
|
|
1831
|
+
var competitiveTiers = collection("Competitive Tiers", "Competitive Tier Set", "competitivetiers", import_zod14.z.object({ uuid: import_zod14.z.string(), tiers: import_zod14.z.array(import_zod14.z.object({ tier: import_zod14.z.number(), tierName: text, division: text, color: text }).passthrough()) }).passthrough());
|
|
1832
|
+
var contentTiers = collection("Content Tiers", "Content Tier", "contenttiers", asset);
|
|
1833
|
+
var contracts2 = collection("Contracts", "Contract", "contracts", asset);
|
|
1834
|
+
var currencies = collection("Currencies", "Currency", "currencies", asset);
|
|
1835
|
+
var events = collection("Events", "Event", "events", asset);
|
|
1836
|
+
var flex = collection("Flex", "Flex Item", "flex", asset);
|
|
1837
|
+
var gamemodes = collection("Gamemodes", "Gamemode", "gamemodes", asset);
|
|
1838
|
+
var gamemodeEquippables = collection("Gamemode Equippables", "Gamemode Equippable", "gamemodes/equippables", asset);
|
|
1839
|
+
var gear = collection("Gear", "Gear Item", "gear", asset);
|
|
1840
|
+
var levelBorders = collection("Level Borders", "Level Border", "levelborders", asset);
|
|
1841
|
+
var maps = collection("Maps", "Map", "maps", mapSchema);
|
|
1842
|
+
var missions = collection("Missions", "Mission", "missions", import_zod14.z.object({ uuid: import_zod14.z.string(), displayName: text }).passthrough());
|
|
1843
|
+
var playerCards = collection("Player Cards", "Player Card", "playercards", asset);
|
|
1844
|
+
var playerTitles = collection("Player Titles", "Player Title", "playertitles", import_zod14.z.object({ uuid: import_zod14.z.string(), displayName: text, titleText: text }).passthrough());
|
|
1845
|
+
var seasons = collection("Seasons", "Season", "seasons", seasonSchema);
|
|
1846
|
+
var competitiveSeasons = collection("Competitive Seasons", "Competitive Season", "seasons/competitive", import_zod14.z.object({ uuid: import_zod14.z.string(), seasonUuid: import_zod14.z.string(), startTime: import_zod14.z.string(), endTime: import_zod14.z.string() }).passthrough());
|
|
1847
|
+
var sprays = collection("Sprays", "Spray", "sprays", asset);
|
|
1848
|
+
var sprayLevels = collection("Spray Levels", "Spray Level", "sprays/levels", asset);
|
|
1849
|
+
var themes = collection("Themes", "Theme", "themes", asset);
|
|
1850
|
+
var weapons = collection("Weapons", "Weapon", "weapons", weaponSchema);
|
|
1851
|
+
var weaponSkins = collection("Weapon Skins", "Weapon Skin", "weapons/skins", skinSchema);
|
|
1852
|
+
var weaponSkinChromas = collection("Weapon Skin Chromas", "Weapon Skin Chroma", "weapons/skinchromas", asset);
|
|
1853
|
+
var weaponSkinLevels = collection("Weapon Skin Levels", "Weapon Skin Level", "weapons/skinlevels", asset);
|
|
1854
|
+
var catalogEndpoints = {
|
|
1855
|
+
agents: agents.list,
|
|
1856
|
+
agent: agents.one,
|
|
1857
|
+
buddies: buddies.list,
|
|
1858
|
+
buddy: buddies.one,
|
|
1859
|
+
buddyLevels: buddyLevels.list,
|
|
1860
|
+
buddyLevel: buddyLevels.one,
|
|
1861
|
+
bundles: bundles.list,
|
|
1862
|
+
bundle: bundles.one,
|
|
1863
|
+
ceremonies: ceremonies.list,
|
|
1864
|
+
ceremony: ceremonies.one,
|
|
1865
|
+
competitiveTiers: competitiveTiers.list,
|
|
1866
|
+
competitiveTier: competitiveTiers.one,
|
|
1867
|
+
contentTiers: contentTiers.list,
|
|
1868
|
+
contentTier: contentTiers.one,
|
|
1869
|
+
contracts: contracts2.list,
|
|
1870
|
+
contract: contracts2.one,
|
|
1871
|
+
currencies: currencies.list,
|
|
1872
|
+
currency: currencies.one,
|
|
1873
|
+
events: events.list,
|
|
1874
|
+
event: events.one,
|
|
1875
|
+
flex: flex.list,
|
|
1876
|
+
flexItem: flex.one,
|
|
1877
|
+
gamemodes: gamemodes.list,
|
|
1878
|
+
gamemode: gamemodes.one,
|
|
1879
|
+
gamemodeEquippables: gamemodeEquippables.list,
|
|
1880
|
+
gamemodeEquippable: gamemodeEquippables.one,
|
|
1881
|
+
gear: gear.list,
|
|
1882
|
+
gearItem: gear.one,
|
|
1883
|
+
levelBorders: levelBorders.list,
|
|
1884
|
+
levelBorder: levelBorders.one,
|
|
1885
|
+
maps: maps.list,
|
|
1886
|
+
map: maps.one,
|
|
1887
|
+
missions: missions.list,
|
|
1888
|
+
mission: missions.one,
|
|
1889
|
+
playerCards: playerCards.list,
|
|
1890
|
+
playerCard: playerCards.one,
|
|
1891
|
+
playerTitles: playerTitles.list,
|
|
1892
|
+
playerTitle: playerTitles.one,
|
|
1893
|
+
seasons: seasons.list,
|
|
1894
|
+
season: seasons.one,
|
|
1895
|
+
competitiveSeasons: competitiveSeasons.list,
|
|
1896
|
+
competitiveSeason: competitiveSeasons.one,
|
|
1897
|
+
sprays: sprays.list,
|
|
1898
|
+
spray: sprays.one,
|
|
1899
|
+
sprayLevels: sprayLevels.list,
|
|
1900
|
+
sprayLevel: sprayLevels.one,
|
|
1901
|
+
themes: themes.list,
|
|
1902
|
+
theme: themes.one,
|
|
1903
|
+
version: endpoint("Version", "Current game version and the matching client version", "version", versionSchema),
|
|
1904
|
+
weapons: weapons.list,
|
|
1905
|
+
weapon: weapons.one,
|
|
1906
|
+
weaponSkins: weaponSkins.list,
|
|
1907
|
+
weaponSkin: weaponSkins.one,
|
|
1908
|
+
weaponSkinChromas: weaponSkinChromas.list,
|
|
1909
|
+
weaponSkinChroma: weaponSkinChromas.one,
|
|
1910
|
+
weaponSkinLevels: weaponSkinLevels.list,
|
|
1911
|
+
weaponSkinLevel: weaponSkinLevels.one
|
|
1912
|
+
};
|
|
1913
|
+
|
|
1914
|
+
// src/api/groups/catalog.ts
|
|
1915
|
+
var catalog = catalogEndpoints;
|
|
1916
|
+
|
|
1917
|
+
// src/api/registry.ts
|
|
1918
|
+
var registry = {
|
|
1919
|
+
pvp,
|
|
1920
|
+
party,
|
|
1921
|
+
store,
|
|
1922
|
+
pregame,
|
|
1923
|
+
currentGame,
|
|
1924
|
+
contracts,
|
|
1925
|
+
local,
|
|
1926
|
+
chat,
|
|
1927
|
+
voice,
|
|
1928
|
+
premier,
|
|
1929
|
+
esports,
|
|
1930
|
+
restrictions,
|
|
1931
|
+
account,
|
|
1932
|
+
auth,
|
|
1933
|
+
catalog
|
|
1934
|
+
};
|
|
1935
|
+
|
|
1936
|
+
// src/auth.ts
|
|
1937
|
+
var import_valorant_api_types10 = require("valorant-api-types");
|
|
1938
|
+
|
|
1939
|
+
// src/errors.ts
|
|
1940
|
+
var ValorantError = class extends Error {
|
|
1941
|
+
constructor(message, options) {
|
|
1942
|
+
super(message, options);
|
|
1943
|
+
this.name = new.target.name;
|
|
1944
|
+
}
|
|
1945
|
+
};
|
|
1946
|
+
var MissingContextError = class extends ValorantError {
|
|
1947
|
+
constructor(key) {
|
|
1948
|
+
super(`Context value "${key}" is required for this request but is not set`);
|
|
1949
|
+
this.key = key;
|
|
1950
|
+
}
|
|
1951
|
+
key;
|
|
1952
|
+
};
|
|
1953
|
+
var MissingParameterError = class extends ValorantError {
|
|
1954
|
+
constructor(parameter, endpoint2) {
|
|
1955
|
+
super(`Path parameter "${parameter}" is required for "${endpoint2}"`);
|
|
1956
|
+
this.parameter = parameter;
|
|
1957
|
+
this.endpoint = endpoint2;
|
|
1958
|
+
}
|
|
1959
|
+
parameter;
|
|
1960
|
+
endpoint;
|
|
1961
|
+
};
|
|
1962
|
+
var ValorantNetworkError = class extends ValorantError {
|
|
1963
|
+
constructor(message, url, options) {
|
|
1964
|
+
super(message, options);
|
|
1965
|
+
this.url = url;
|
|
1966
|
+
}
|
|
1967
|
+
url;
|
|
1968
|
+
};
|
|
1969
|
+
var ValorantValidationError = class extends ValorantError {
|
|
1970
|
+
constructor(target, endpoint2, issues, data) {
|
|
1971
|
+
super(`Invalid ${target} for "${endpoint2}": ${issues.issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`).slice(0, 5).join("; ")}`);
|
|
1972
|
+
this.target = target;
|
|
1973
|
+
this.endpoint = endpoint2;
|
|
1974
|
+
this.issues = issues;
|
|
1975
|
+
this.data = data;
|
|
1976
|
+
}
|
|
1977
|
+
target;
|
|
1978
|
+
endpoint;
|
|
1979
|
+
issues;
|
|
1980
|
+
data;
|
|
1981
|
+
};
|
|
1982
|
+
var ValorantApiError = class extends ValorantError {
|
|
1983
|
+
constructor(status, endpoint2, url, body, headers) {
|
|
1984
|
+
const code = extractErrorCode(body);
|
|
1985
|
+
super(`${endpoint2} failed with HTTP ${status}${code ? ` (${code})` : ""}`);
|
|
1986
|
+
this.status = status;
|
|
1987
|
+
this.endpoint = endpoint2;
|
|
1988
|
+
this.url = url;
|
|
1989
|
+
this.body = body;
|
|
1990
|
+
this.headers = headers;
|
|
1991
|
+
this.errorCode = code;
|
|
1992
|
+
}
|
|
1993
|
+
status;
|
|
1994
|
+
endpoint;
|
|
1995
|
+
url;
|
|
1996
|
+
body;
|
|
1997
|
+
headers;
|
|
1998
|
+
errorCode;
|
|
1999
|
+
};
|
|
2000
|
+
var ValorantAuthError = class extends ValorantApiError {
|
|
2001
|
+
};
|
|
2002
|
+
var ValorantRateLimitError = class extends ValorantApiError {
|
|
2003
|
+
constructor(status, endpoint2, url, body, headers, retryAfterMs) {
|
|
2004
|
+
super(status, endpoint2, url, body, headers);
|
|
2005
|
+
this.retryAfterMs = retryAfterMs;
|
|
2006
|
+
}
|
|
2007
|
+
retryAfterMs;
|
|
2008
|
+
};
|
|
2009
|
+
function extractErrorCode(body) {
|
|
2010
|
+
if (typeof body === "object" && body !== null && "errorCode" in body) {
|
|
2011
|
+
const code = body.errorCode;
|
|
2012
|
+
return typeof code === "string" ? code : void 0;
|
|
2013
|
+
}
|
|
2014
|
+
return void 0;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
// src/auth.ts
|
|
2018
|
+
function parseAuthRedirect(location) {
|
|
2019
|
+
const fragment = location.split("#")[1];
|
|
2020
|
+
if (fragment === void 0) return void 0;
|
|
2021
|
+
const params = new URLSearchParams(fragment);
|
|
2022
|
+
const accessToken = params.get("access_token");
|
|
2023
|
+
const idToken = params.get("id_token");
|
|
2024
|
+
if (accessToken === null || idToken === null) return void 0;
|
|
2025
|
+
const expiresIn = Number(params.get("expires_in"));
|
|
2026
|
+
return { accessToken, idToken, expiresIn: Number.isFinite(expiresIn) && expiresIn > 0 ? expiresIn : void 0 };
|
|
2027
|
+
}
|
|
2028
|
+
var AUTH_COOKIES_BODY = {
|
|
2029
|
+
client_id: "play-valorant-web-prod",
|
|
2030
|
+
nonce: "1",
|
|
2031
|
+
redirect_uri: "https://playvalorant.com/opt_in",
|
|
2032
|
+
response_type: "token id_token",
|
|
2033
|
+
scope: "account openid"
|
|
2034
|
+
};
|
|
2035
|
+
function createAuthFlows(client) {
|
|
2036
|
+
const ctx = client.context;
|
|
2037
|
+
function applyTokens(tokens) {
|
|
2038
|
+
if (tokens) ctx.update({ accessToken: tokens.accessToken, idToken: tokens.idToken });
|
|
2039
|
+
}
|
|
2040
|
+
function toLoginResult(data) {
|
|
2041
|
+
const body = data ?? {};
|
|
2042
|
+
if (body.type === "multifactor") return { status: "multifactor", email: body.multifactor?.email ?? "" };
|
|
2043
|
+
const redirect = body.success?.redirect_url ?? JSON.stringify(data);
|
|
2044
|
+
const tokens = parseAuthRedirect(redirect.replaceAll("\\u0026", "&"));
|
|
2045
|
+
applyTokens(tokens);
|
|
2046
|
+
return { status: "success", tokens };
|
|
2047
|
+
}
|
|
2048
|
+
return {
|
|
2049
|
+
async login(options) {
|
|
2050
|
+
await client.auth.cookies({ body: AUTH_COOKIES_BODY });
|
|
2051
|
+
const data = await client.auth.request({
|
|
2052
|
+
body: {
|
|
2053
|
+
type: "auth",
|
|
2054
|
+
language: "en_US",
|
|
2055
|
+
remember: options.remember ?? true,
|
|
2056
|
+
riot_identity: { captcha: options.captcha, username: options.username, password: options.password }
|
|
2057
|
+
}
|
|
2058
|
+
});
|
|
2059
|
+
return toLoginResult(data);
|
|
2060
|
+
},
|
|
2061
|
+
async submitMfa(code, rememberDevice = true) {
|
|
2062
|
+
const data = await client.auth.multiFactor({ body: { type: "multifactor", multifactor: { otp: code, rememberDevice } } });
|
|
2063
|
+
return toLoginResult(data);
|
|
2064
|
+
},
|
|
2065
|
+
async reauthenticate(options) {
|
|
2066
|
+
const response = await client.send(import_valorant_api_types10.endpoints.cookieReauthEndpoint);
|
|
2067
|
+
const tokens = parseAuthRedirect(response.headers.get("location") ?? "");
|
|
2068
|
+
if (tokens === void 0) throw new ValorantError("Cookie reauthentication failed: the session cookies are missing or expired, log in again");
|
|
2069
|
+
applyTokens(tokens);
|
|
2070
|
+
await this.establishSession(options);
|
|
2071
|
+
return tokens;
|
|
2072
|
+
},
|
|
2073
|
+
async establishSession(options) {
|
|
2074
|
+
const { entitlements_token } = await client.auth.entitlement();
|
|
2075
|
+
ctx.set("entitlementToken", entitlements_token);
|
|
2076
|
+
const info = await client.auth.playerInfo();
|
|
2077
|
+
ctx.set("puuid", info.sub);
|
|
2078
|
+
const geo = await client.auth.riotGeo({ body: { id_token: ctx.require("idToken") } });
|
|
2079
|
+
ctx.applyAffinity(geo.affinities.live);
|
|
2080
|
+
if (options?.fetchClientVersion) await this.fetchClientVersion();
|
|
2081
|
+
},
|
|
2082
|
+
async fetchClientVersion() {
|
|
2083
|
+
const response = await client.transport({
|
|
2084
|
+
method: "GET",
|
|
2085
|
+
url: "https://valorant-api.com/v1/version",
|
|
2086
|
+
headers: { Accept: "application/json" },
|
|
2087
|
+
signal: AbortSignal.timeout(15e3)
|
|
2088
|
+
});
|
|
2089
|
+
const version = JSON.parse(response.text).data?.riotClientVersion;
|
|
2090
|
+
if (!version) throw new ValorantError("valorant-api.com did not return a client version");
|
|
2091
|
+
ctx.set("clientVersion", version);
|
|
2092
|
+
return version;
|
|
2093
|
+
}
|
|
2094
|
+
};
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
// src/context.ts
|
|
2098
|
+
var DEFAULT_PLATFORM = btoa(JSON.stringify({
|
|
2099
|
+
platformType: "PC",
|
|
2100
|
+
platformOS: "Windows",
|
|
2101
|
+
platformOSVersion: "10.0.19042.1.256.64bit",
|
|
2102
|
+
platformChipset: "Unknown"
|
|
2103
|
+
}));
|
|
2104
|
+
var SECRET_KEYS = ["accessToken", "entitlementToken", "idToken", "pasToken", "cookies", "localPassword"];
|
|
2105
|
+
var REGION_TO_SHARD = { na: "na", latam: "na", br: "na", eu: "eu", ap: "ap", kr: "kr" };
|
|
2106
|
+
function isRegion(value) {
|
|
2107
|
+
return Object.hasOwn(REGION_TO_SHARD, value);
|
|
2108
|
+
}
|
|
2109
|
+
function shardForRegion(region) {
|
|
2110
|
+
return REGION_TO_SHARD[region];
|
|
2111
|
+
}
|
|
2112
|
+
var ValorantContext = class {
|
|
2113
|
+
#state;
|
|
2114
|
+
#listeners = /* @__PURE__ */ new Set();
|
|
2115
|
+
constructor(initial = {}) {
|
|
2116
|
+
this.#state = Object.freeze({ clientPlatform: DEFAULT_PLATFORM, ...stripUndefined(initial) });
|
|
2117
|
+
}
|
|
2118
|
+
get(key) {
|
|
2119
|
+
return this.#state[key];
|
|
2120
|
+
}
|
|
2121
|
+
/** Like {@link get}, but throws {@link MissingContextError} when the value is not set. */
|
|
2122
|
+
require(key) {
|
|
2123
|
+
const value = this.#state[key];
|
|
2124
|
+
if (value === void 0) throw new MissingContextError(key);
|
|
2125
|
+
return value;
|
|
2126
|
+
}
|
|
2127
|
+
has(key) {
|
|
2128
|
+
return this.#state[key] !== void 0;
|
|
2129
|
+
}
|
|
2130
|
+
/** Sets one value. `undefined` removes it. */
|
|
2131
|
+
set(key, value) {
|
|
2132
|
+
this.update({ [key]: value });
|
|
2133
|
+
}
|
|
2134
|
+
/** Merges a patch into the state. Keys set to `undefined` are removed. */
|
|
2135
|
+
update(patch) {
|
|
2136
|
+
this.#commit({ ...this.#state, ...patch });
|
|
2137
|
+
}
|
|
2138
|
+
/** Replaces the whole state. The default client platform is kept unless provided. */
|
|
2139
|
+
replace(next) {
|
|
2140
|
+
this.#commit({ clientPlatform: DEFAULT_PLATFORM, ...next });
|
|
2141
|
+
}
|
|
2142
|
+
/** Removes everything except the default client platform. */
|
|
2143
|
+
clear() {
|
|
2144
|
+
this.replace({});
|
|
2145
|
+
}
|
|
2146
|
+
/** Sets region and the matching shard from a Riot affinity (`eu`, `latam`, ...). Unknown values are ignored. */
|
|
2147
|
+
applyAffinity(affinity) {
|
|
2148
|
+
if (!isRegion(affinity)) return false;
|
|
2149
|
+
this.update({ region: affinity, shard: shardForRegion(affinity) });
|
|
2150
|
+
return true;
|
|
2151
|
+
}
|
|
2152
|
+
setCookie(name, value) {
|
|
2153
|
+
const cookies = { ...this.#state.cookies };
|
|
2154
|
+
if (value === void 0) delete cookies[name];
|
|
2155
|
+
else cookies[name] = value;
|
|
2156
|
+
this.update({ cookies });
|
|
2157
|
+
}
|
|
2158
|
+
cookieHeader() {
|
|
2159
|
+
const entries = Object.entries(this.#state.cookies ?? {});
|
|
2160
|
+
return entries.length === 0 ? void 0 : entries.map(([name, value]) => `${name}=${value}`).join("; ");
|
|
2161
|
+
}
|
|
2162
|
+
/** Immutable copy of the current state. Contains secrets. */
|
|
2163
|
+
snapshot() {
|
|
2164
|
+
return this.#state;
|
|
2165
|
+
}
|
|
2166
|
+
/** Calls `listener` after every change. Returns an unsubscribe function. */
|
|
2167
|
+
subscribe(listener) {
|
|
2168
|
+
this.#listeners.add(listener);
|
|
2169
|
+
return () => void this.#listeners.delete(listener);
|
|
2170
|
+
}
|
|
2171
|
+
/** State with secrets masked, safe to log. */
|
|
2172
|
+
redacted() {
|
|
2173
|
+
const out = { ...this.#state };
|
|
2174
|
+
for (const key of SECRET_KEYS) {
|
|
2175
|
+
if (out[key] !== void 0) out[key] = "[redacted]";
|
|
2176
|
+
}
|
|
2177
|
+
return out;
|
|
2178
|
+
}
|
|
2179
|
+
toJSON() {
|
|
2180
|
+
return this.redacted();
|
|
2181
|
+
}
|
|
2182
|
+
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
|
|
2183
|
+
return this.redacted();
|
|
2184
|
+
}
|
|
2185
|
+
#commit(next) {
|
|
2186
|
+
const previous = this.#state;
|
|
2187
|
+
const clean = Object.freeze(stripUndefined(next));
|
|
2188
|
+
const keys = /* @__PURE__ */ new Set([...Object.keys(previous), ...Object.keys(clean)]);
|
|
2189
|
+
const changed = [...keys].filter((key) => !sameValue(previous[key], clean[key]));
|
|
2190
|
+
if (changed.length === 0) return;
|
|
2191
|
+
this.#state = clean;
|
|
2192
|
+
for (const listener of [...this.#listeners]) listener(clean, changed);
|
|
2193
|
+
}
|
|
2194
|
+
};
|
|
2195
|
+
function stripUndefined(value) {
|
|
2196
|
+
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0));
|
|
2197
|
+
}
|
|
2198
|
+
function sameValue(a, b) {
|
|
2199
|
+
if (Object.is(a, b)) return true;
|
|
2200
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
|
|
2201
|
+
const aEntries = Object.entries(a);
|
|
2202
|
+
const bEntries = Object.entries(b);
|
|
2203
|
+
return aEntries.length === bEntries.length && aEntries.every(([key, value]) => Object.is(b[key], value));
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
// src/http.ts
|
|
2207
|
+
var fetchTransport = async (request) => {
|
|
2208
|
+
const response = await fetch(request.url, {
|
|
2209
|
+
method: request.method,
|
|
2210
|
+
headers: request.headers,
|
|
2211
|
+
body: request.body,
|
|
2212
|
+
signal: request.signal,
|
|
2213
|
+
redirect: "manual"
|
|
2214
|
+
});
|
|
2215
|
+
return {
|
|
2216
|
+
status: response.status,
|
|
2217
|
+
headers: response.headers,
|
|
2218
|
+
setCookies: response.headers.getSetCookie(),
|
|
2219
|
+
text: await response.text()
|
|
2220
|
+
};
|
|
2221
|
+
};
|
|
2222
|
+
var localTransport = async (request) => {
|
|
2223
|
+
const { request: httpsRequest } = await import("https");
|
|
2224
|
+
const url = new URL(request.url);
|
|
2225
|
+
if (url.hostname !== "127.0.0.1" && url.hostname !== "localhost") {
|
|
2226
|
+
throw new Error(`localTransport only talks to loopback hosts, got ${url.hostname}`);
|
|
2227
|
+
}
|
|
2228
|
+
return new Promise((resolve, reject) => {
|
|
2229
|
+
const req = httpsRequest(url, {
|
|
2230
|
+
method: request.method,
|
|
2231
|
+
headers: request.headers,
|
|
2232
|
+
rejectUnauthorized: false,
|
|
2233
|
+
signal: request.signal
|
|
2234
|
+
}, (res) => {
|
|
2235
|
+
const chunks = [];
|
|
2236
|
+
res.on("data", (chunk) => chunks.push(chunk));
|
|
2237
|
+
res.on("error", reject);
|
|
2238
|
+
res.on("end", () => {
|
|
2239
|
+
const headers = new Headers();
|
|
2240
|
+
for (const [name, value] of Object.entries(res.headers)) {
|
|
2241
|
+
if (Array.isArray(value)) value.forEach((v) => headers.append(name, v));
|
|
2242
|
+
else if (value !== void 0) headers.set(name, value);
|
|
2243
|
+
}
|
|
2244
|
+
resolve({
|
|
2245
|
+
status: res.statusCode ?? 0,
|
|
2246
|
+
headers,
|
|
2247
|
+
setCookies: res.headers["set-cookie"] ?? [],
|
|
2248
|
+
text: Buffer.concat(chunks).toString("utf8")
|
|
2249
|
+
});
|
|
2250
|
+
});
|
|
2251
|
+
});
|
|
2252
|
+
req.on("error", reject);
|
|
2253
|
+
req.end(request.body);
|
|
2254
|
+
});
|
|
2255
|
+
};
|
|
2256
|
+
|
|
2257
|
+
// src/internal/body.ts
|
|
2258
|
+
var import_zod15 = require("zod");
|
|
2259
|
+
function parseBody(text2) {
|
|
2260
|
+
if (text2 === "") return void 0;
|
|
2261
|
+
try {
|
|
2262
|
+
return JSON.parse(text2);
|
|
2263
|
+
} catch {
|
|
2264
|
+
return text2;
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
function safeParse(schema, data) {
|
|
2268
|
+
try {
|
|
2269
|
+
return schema.safeParse(data);
|
|
2270
|
+
} catch (thrown) {
|
|
2271
|
+
if (thrown instanceof import_zod15.ZodError) return { success: false, error: thrown };
|
|
2272
|
+
const message = thrown instanceof Error ? thrown.message : String(thrown);
|
|
2273
|
+
return { success: false, error: new import_zod15.ZodError([{ code: "custom", path: [], message: `Schema transform threw: ${message}` }]) };
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
// src/internal/cookies.ts
|
|
2278
|
+
function storeCookies(context, setCookies) {
|
|
2279
|
+
for (const line of setCookies) {
|
|
2280
|
+
const [pair = "", ...attributes] = line.split(";").map((part) => part.trim());
|
|
2281
|
+
const separator = pair.indexOf("=");
|
|
2282
|
+
if (separator <= 0) continue;
|
|
2283
|
+
const name = pair.slice(0, separator);
|
|
2284
|
+
const value = pair.slice(separator + 1);
|
|
2285
|
+
const expired = value === "" || attributes.some((a) => a.toLowerCase() === "max-age=0");
|
|
2286
|
+
context.setCookie(name, expired ? void 0 : value);
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
// src/internal/retry.ts
|
|
2291
|
+
var RETRYABLE_STATUS = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
|
|
2292
|
+
var IDEMPOTENT = /* @__PURE__ */ new Set(["GET", "HEAD", "PUT", "DELETE"]);
|
|
2293
|
+
function isIdempotent(method) {
|
|
2294
|
+
return IDEMPOTENT.has(method);
|
|
2295
|
+
}
|
|
2296
|
+
function isRetryableStatus(status, method) {
|
|
2297
|
+
return RETRYABLE_STATUS.has(status) && (status === 429 || isIdempotent(method));
|
|
2298
|
+
}
|
|
2299
|
+
function parseRetryAfter(value) {
|
|
2300
|
+
if (value === null) return void 0;
|
|
2301
|
+
const seconds = Number(value);
|
|
2302
|
+
if (Number.isFinite(seconds)) return seconds * 1e3;
|
|
2303
|
+
const date = Date.parse(value);
|
|
2304
|
+
return Number.isNaN(date) ? void 0 : Math.max(0, date - Date.now());
|
|
2305
|
+
}
|
|
2306
|
+
function backoff(attempt, retry) {
|
|
2307
|
+
const base = retry?.baseDelayMs ?? 500;
|
|
2308
|
+
const max = retry?.maxDelayMs ?? 8e3;
|
|
2309
|
+
return Math.min(max, base * 2 ** attempt) * (0.5 + Math.random() / 2);
|
|
2310
|
+
}
|
|
2311
|
+
function sleep(ms, signal) {
|
|
2312
|
+
return new Promise((resolve) => {
|
|
2313
|
+
const timer = setTimeout(done, ms);
|
|
2314
|
+
signal?.addEventListener("abort", done, { once: true });
|
|
2315
|
+
function done() {
|
|
2316
|
+
clearTimeout(timer);
|
|
2317
|
+
signal?.removeEventListener("abort", done);
|
|
2318
|
+
resolve();
|
|
2319
|
+
}
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
// src/internal/failure.ts
|
|
2324
|
+
function toApiError(endpoint2, request, response) {
|
|
2325
|
+
const body = parseBody(response.text);
|
|
2326
|
+
const args = [response.status, endpoint2.name, request.url, body, response.headers];
|
|
2327
|
+
if (response.status === 429) return new ValorantRateLimitError(...args, parseRetryAfter(response.headers.get("retry-after")));
|
|
2328
|
+
const needsToken = endpoint2.riotRequirements?.token === true;
|
|
2329
|
+
const badClaims = typeof body === "object" && body !== null && body.errorCode === "BAD_CLAIMS";
|
|
2330
|
+
if (needsToken && (response.status === 401 || response.status === 400 && badClaims)) return new ValorantAuthError(...args);
|
|
2331
|
+
return new ValorantApiError(...args);
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
// src/local.ts
|
|
2335
|
+
function parseLockfile(content) {
|
|
2336
|
+
const [name, pid, port, password, protocol] = content.trim().split(":");
|
|
2337
|
+
if (!name || !pid || !port || !password || !protocol) throw new ValorantError("Malformed lockfile");
|
|
2338
|
+
return { name, pid: Number(pid), port: Number(port), password, protocol };
|
|
2339
|
+
}
|
|
2340
|
+
async function readLockfile(path) {
|
|
2341
|
+
const { readFile } = await import("fs/promises");
|
|
2342
|
+
const { join } = await import("path");
|
|
2343
|
+
const file = path ?? join(process.env["LOCALAPPDATA"] ?? "", "Riot Games", "Riot Client", "Config", "lockfile");
|
|
2344
|
+
try {
|
|
2345
|
+
return parseLockfile(await readFile(file, "utf8"));
|
|
2346
|
+
} catch (cause) {
|
|
2347
|
+
throw new ValorantError(`Could not read the Riot Client lockfile at "${file}". Is the Riot Client running?`, { cause });
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
function createLocalFlows(client) {
|
|
2351
|
+
const ctx = client.context;
|
|
2352
|
+
return {
|
|
2353
|
+
async connect(options) {
|
|
2354
|
+
const lockfile = await readLockfile(options?.lockfilePath);
|
|
2355
|
+
ctx.update({ localPort: lockfile.port, localPassword: lockfile.password });
|
|
2356
|
+
const tokens = await client.local.entitlementsToken();
|
|
2357
|
+
ctx.update({ accessToken: tokens.accessToken, entitlementToken: tokens.token, puuid: tokens.subject });
|
|
2358
|
+
const sessions = await client.local.sessions();
|
|
2359
|
+
const valorant = Object.values(sessions).find((session) => session.productId === "valorant");
|
|
2360
|
+
if (valorant) {
|
|
2361
|
+
ctx.set("clientVersion", valorant.version);
|
|
2362
|
+
const region = launchArgument(valorant.launchConfiguration.arguments, "ares-deployment");
|
|
2363
|
+
if (region !== void 0 && isRegion(region)) ctx.update({ region, shard: shardForRegion(region) });
|
|
2364
|
+
}
|
|
2365
|
+
if (!ctx.has("region")) {
|
|
2366
|
+
const info = await client.auth.playerInfo();
|
|
2367
|
+
const affinity = Object.values(info.affinity ?? {}).find(isRegion);
|
|
2368
|
+
if (affinity !== void 0) ctx.applyAffinity(affinity);
|
|
2369
|
+
}
|
|
2370
|
+
if (!ctx.has("clientVersion") && options?.fetchClientVersion !== false) {
|
|
2371
|
+
await client.auth.fetchClientVersion().catch(() => void 0);
|
|
2372
|
+
}
|
|
2373
|
+
},
|
|
2374
|
+
async events() {
|
|
2375
|
+
return openEventStream(ctx);
|
|
2376
|
+
}
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2379
|
+
function launchArgument(args, name) {
|
|
2380
|
+
const prefix = `-${name}=`;
|
|
2381
|
+
return args.find((arg) => arg.startsWith(prefix))?.slice(prefix.length);
|
|
2382
|
+
}
|
|
2383
|
+
async function openEventStream(ctx) {
|
|
2384
|
+
let WebSocket;
|
|
2385
|
+
try {
|
|
2386
|
+
WebSocket = (await import("ws")).WebSocket;
|
|
2387
|
+
} catch (cause) {
|
|
2388
|
+
throw new ValorantError('The local event stream needs the optional "ws" package: npm install ws', { cause });
|
|
2389
|
+
}
|
|
2390
|
+
const socket = new WebSocket(`wss://127.0.0.1:${ctx.require("localPort")}`, {
|
|
2391
|
+
headers: { Authorization: `Basic ${btoa(`riot:${ctx.require("localPassword")}`)}` },
|
|
2392
|
+
rejectUnauthorized: false
|
|
2393
|
+
});
|
|
2394
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
2395
|
+
socket.on("message", (raw) => {
|
|
2396
|
+
const text2 = raw.toString();
|
|
2397
|
+
if (text2 === "") return;
|
|
2398
|
+
const message = JSON.parse(text2);
|
|
2399
|
+
if (!Array.isArray(message) || message[0] !== 8) return;
|
|
2400
|
+
for (const listener of [...listeners]) listener(String(message[1]), message[2]);
|
|
2401
|
+
});
|
|
2402
|
+
await new Promise((resolve, reject) => {
|
|
2403
|
+
socket.once("open", resolve);
|
|
2404
|
+
socket.once("error", reject);
|
|
2405
|
+
});
|
|
2406
|
+
return {
|
|
2407
|
+
onEvent(listener) {
|
|
2408
|
+
listeners.add(listener);
|
|
2409
|
+
return () => void listeners.delete(listener);
|
|
2410
|
+
},
|
|
2411
|
+
subscribe: (eventName) => socket.send(JSON.stringify([5, eventName])),
|
|
2412
|
+
unsubscribe: (eventName) => socket.send(JSON.stringify([6, eventName])),
|
|
2413
|
+
close: () => socket.close()
|
|
2414
|
+
};
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
// src/request.ts
|
|
2418
|
+
var import_valorant_api_types11 = require("valorant-api-types");
|
|
2419
|
+
|
|
2420
|
+
// src/types.ts
|
|
2421
|
+
function paramName(variable) {
|
|
2422
|
+
const [first = "", ...rest] = variable.replaceAll("-", " ").split(" ");
|
|
2423
|
+
return first.charAt(0).toLowerCase() + first.slice(1) + rest.map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
// src/request.ts
|
|
2427
|
+
var AUTH_HOST = "auth.riotgames.com";
|
|
2428
|
+
function applyQuirks(path, ctx) {
|
|
2429
|
+
const hardcoded = "/leaderboards/affinity/na/";
|
|
2430
|
+
return path.includes(hardcoded) ? path.replace(hardcoded, `/leaderboards/affinity/${ctx.require("shard")}/`) : path;
|
|
2431
|
+
}
|
|
2432
|
+
function resolvePath(endpoint2, input, ctx) {
|
|
2433
|
+
const suffix = applyQuirks(endpoint2.suffix, ctx);
|
|
2434
|
+
return suffix.replace(/\{([^}]+)\}/g, (_, variable) => {
|
|
2435
|
+
const name = paramName(variable);
|
|
2436
|
+
const value = input.params?.[name] ?? (name === "puuid" || name === "region" ? ctx.require(name) : void 0);
|
|
2437
|
+
if (value === void 0) throw new MissingParameterError(name, endpoint2.name);
|
|
2438
|
+
return encodeURIComponent(value);
|
|
2439
|
+
});
|
|
2440
|
+
}
|
|
2441
|
+
function resolveBase(endpoint2, ctx) {
|
|
2442
|
+
switch (endpoint2.type) {
|
|
2443
|
+
case "pd":
|
|
2444
|
+
case "shared":
|
|
2445
|
+
return (0, import_valorant_api_types11.typeToPrefix)({ type: endpoint2.type, shard: ctx.require("shard") });
|
|
2446
|
+
case "glz":
|
|
2447
|
+
return (0, import_valorant_api_types11.typeToPrefix)({ type: "glz", shard: ctx.require("shard"), region: ctx.require("region") });
|
|
2448
|
+
case "local":
|
|
2449
|
+
return (0, import_valorant_api_types11.typeToPrefix)({ type: "local", port: ctx.require("localPort") });
|
|
2450
|
+
case "other":
|
|
2451
|
+
return "";
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
function appendQuery(url, query2) {
|
|
2455
|
+
if (!query2) return url;
|
|
2456
|
+
const params = new URLSearchParams();
|
|
2457
|
+
for (const [key, value] of Object.entries(query2)) {
|
|
2458
|
+
if (value !== void 0 && value !== null) params.append(key, String(value));
|
|
2459
|
+
}
|
|
2460
|
+
const encoded = params.toString();
|
|
2461
|
+
if (encoded === "") return url;
|
|
2462
|
+
return url + (url.includes("?") ? "&" : "?") + encoded;
|
|
2463
|
+
}
|
|
2464
|
+
function resolveHeaders(endpoint2, input, ctx, url) {
|
|
2465
|
+
const headers = { Accept: "application/json" };
|
|
2466
|
+
const need = endpoint2.riotRequirements ?? {};
|
|
2467
|
+
const userAgent = ctx.get("userAgent");
|
|
2468
|
+
if (userAgent) headers["User-Agent"] = userAgent;
|
|
2469
|
+
if (need.token) headers["Authorization"] = `Bearer ${ctx.require("accessToken")}`;
|
|
2470
|
+
if (need.localAuth) headers["Authorization"] = `Basic ${btoa(`riot:${ctx.require("localPassword")}`)}`;
|
|
2471
|
+
if (need.entitlement) headers["X-Riot-Entitlements-JWT"] = ctx.require("entitlementToken");
|
|
2472
|
+
if (need.clientVersion) headers["X-Riot-ClientVersion"] = ctx.require("clientVersion");
|
|
2473
|
+
if (need.clientPlatform) headers["X-Riot-ClientPlatform"] = ctx.require("clientPlatform");
|
|
2474
|
+
for (const [name, value] of endpoint2.headers ?? []) headers[name] = value;
|
|
2475
|
+
if (input.body !== void 0 && !Object.keys(headers).some((h) => h.toLowerCase() === "content-type")) {
|
|
2476
|
+
headers["Content-Type"] = "application/json";
|
|
2477
|
+
}
|
|
2478
|
+
if (new URL(url).hostname === AUTH_HOST) {
|
|
2479
|
+
const cookie = ctx.cookieHeader();
|
|
2480
|
+
if (cookie) headers["Cookie"] = cookie;
|
|
2481
|
+
}
|
|
2482
|
+
return { ...headers, ...input.headers };
|
|
2483
|
+
}
|
|
2484
|
+
function isAuthHost(url) {
|
|
2485
|
+
return new URL(url).hostname === AUTH_HOST;
|
|
2486
|
+
}
|
|
2487
|
+
function buildRequest(endpoint2, input, ctx) {
|
|
2488
|
+
const path = resolvePath(endpoint2, input, ctx);
|
|
2489
|
+
const base = resolveBase(endpoint2, ctx);
|
|
2490
|
+
const url = appendQuery(base + (base === "" ? path : path.replace(/^\/+/, "")), input.query);
|
|
2491
|
+
const method = endpoint2.method ?? "GET";
|
|
2492
|
+
const headers = resolveHeaders(endpoint2, input, ctx, url);
|
|
2493
|
+
const declaresJson = [...endpoint2.headers?.keys() ?? []].some((h) => h.toLowerCase() === "content-type");
|
|
2494
|
+
const body = input.body !== void 0 ? JSON.stringify(input.body) : method !== "GET" && declaresJson ? "{}" : void 0;
|
|
2495
|
+
return { method, url, headers, body };
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
// src/client.ts
|
|
2499
|
+
var ValorantClient = class {
|
|
2500
|
+
context;
|
|
2501
|
+
#options;
|
|
2502
|
+
#warned = /* @__PURE__ */ new Set();
|
|
2503
|
+
#refreshing;
|
|
2504
|
+
constructor(options = {}) {
|
|
2505
|
+
this.#options = options;
|
|
2506
|
+
this.context = options.context instanceof ValorantContext ? options.context : new ValorantContext(options.context);
|
|
2507
|
+
Object.assign(this, this.#createApi());
|
|
2508
|
+
}
|
|
2509
|
+
/** Sends a request and returns status, headers and the parsed body. */
|
|
2510
|
+
async send(endpoint2, options = {}) {
|
|
2511
|
+
const input = options;
|
|
2512
|
+
const validation = input.validation ?? this.#options.validation ?? "loose";
|
|
2513
|
+
if (validation === "strict" && endpoint2.body !== void 0 && input.body !== void 0) {
|
|
2514
|
+
const parsed = endpoint2.body.safeParse(input.body);
|
|
2515
|
+
if (!parsed.success) throw new ValorantValidationError("request", endpoint2.name, parsed.error, input.body);
|
|
2516
|
+
}
|
|
2517
|
+
const retry = this.#options.retry === false ? void 0 : this.#options.retry ?? {};
|
|
2518
|
+
const maxRetries = retry ? retry.retries ?? 2 : 0;
|
|
2519
|
+
let refreshed = false;
|
|
2520
|
+
for (let attempt = 0; ; attempt++) {
|
|
2521
|
+
const request = buildRequest(endpoint2, input, this.context);
|
|
2522
|
+
const canRetry = attempt < maxRetries && input.signal?.aborted !== true;
|
|
2523
|
+
let response;
|
|
2524
|
+
try {
|
|
2525
|
+
response = await this.#transportFor(endpoint2)({ ...request, signal: this.#signal(input) });
|
|
2526
|
+
} catch (cause) {
|
|
2527
|
+
if (canRetry && isIdempotent(request.method) && input.signal?.aborted !== true) {
|
|
2528
|
+
await sleep(backoff(attempt, retry), input.signal);
|
|
2529
|
+
continue;
|
|
2530
|
+
}
|
|
2531
|
+
throw new ValorantNetworkError(`${endpoint2.name} could not reach ${new URL(request.url).host}`, request.url, { cause });
|
|
2532
|
+
}
|
|
2533
|
+
if (isAuthHost(request.url)) storeCookies(this.context, response.setCookies);
|
|
2534
|
+
this.#options.logger?.debug?.(`${request.method} ${request.url} -> ${response.status}`);
|
|
2535
|
+
if (response.status < 400) {
|
|
2536
|
+
return {
|
|
2537
|
+
status: response.status,
|
|
2538
|
+
headers: response.headers,
|
|
2539
|
+
data: this.#parseResponse(endpoint2, response, validation)
|
|
2540
|
+
};
|
|
2541
|
+
}
|
|
2542
|
+
const error = toApiError(endpoint2, request, response);
|
|
2543
|
+
if (error instanceof ValorantAuthError && this.#options.refreshTokens && !refreshed) {
|
|
2544
|
+
refreshed = true;
|
|
2545
|
+
await this.#refreshOnce();
|
|
2546
|
+
continue;
|
|
2547
|
+
}
|
|
2548
|
+
if (canRetry && isRetryableStatus(response.status, request.method)) {
|
|
2549
|
+
const retryAfter = error instanceof ValorantRateLimitError ? error.retryAfterMs : void 0;
|
|
2550
|
+
await sleep(retryAfter ?? backoff(attempt, retry), input.signal);
|
|
2551
|
+
continue;
|
|
2552
|
+
}
|
|
2553
|
+
throw error;
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
#createApi() {
|
|
2557
|
+
const api = {};
|
|
2558
|
+
for (const [group, endpoints] of Object.entries(registry)) {
|
|
2559
|
+
api[group] = Object.fromEntries(Object.entries(endpoints).map(([name, endpoint2]) => [
|
|
2560
|
+
name,
|
|
2561
|
+
async (options) => (await this.send(endpoint2, options)).data
|
|
2562
|
+
]));
|
|
2563
|
+
}
|
|
2564
|
+
Object.assign(api["auth"], createAuthFlows(this));
|
|
2565
|
+
Object.assign(api["local"], createLocalFlows(this));
|
|
2566
|
+
return api;
|
|
2567
|
+
}
|
|
2568
|
+
#transportFor(endpoint2) {
|
|
2569
|
+
if (endpoint2.type === "local") return this.#options.localTransport ?? localTransport;
|
|
2570
|
+
return this.#options.transport ?? fetchTransport;
|
|
2571
|
+
}
|
|
2572
|
+
/** Transport used for requests to arbitrary remote hosts. */
|
|
2573
|
+
get transport() {
|
|
2574
|
+
return this.#options.transport ?? fetchTransport;
|
|
2575
|
+
}
|
|
2576
|
+
#signal(input) {
|
|
2577
|
+
const timeout = AbortSignal.timeout(input.timeoutMs ?? this.#options.timeoutMs ?? 15e3);
|
|
2578
|
+
return input.signal ? AbortSignal.any([input.signal, timeout]) : timeout;
|
|
2579
|
+
}
|
|
2580
|
+
#parseResponse(endpoint2, response, validation) {
|
|
2581
|
+
const data = unwrapEnvelope(endpoint2, parseBody(response.text));
|
|
2582
|
+
const schema = endpoint2.responses?.[String(response.status)];
|
|
2583
|
+
if (schema === void 0 || validation === "off") return data;
|
|
2584
|
+
const parsed = safeParse(schema, data);
|
|
2585
|
+
if (parsed.success) return parsed.data;
|
|
2586
|
+
if (validation === "strict") throw new ValorantValidationError("response", endpoint2.name, parsed.error, data);
|
|
2587
|
+
if (!this.#warned.has(endpoint2.name)) {
|
|
2588
|
+
this.#warned.add(endpoint2.name);
|
|
2589
|
+
this.#options.logger?.warn(`Response of "${endpoint2.name}" does not match its schema, returning raw data`, parsed.error.issues.slice(0, 5));
|
|
2590
|
+
}
|
|
2591
|
+
return data;
|
|
2592
|
+
}
|
|
2593
|
+
#refreshOnce() {
|
|
2594
|
+
this.#refreshing ??= Promise.resolve(this.#options.refreshTokens(this)).finally(() => {
|
|
2595
|
+
this.#refreshing = void 0;
|
|
2596
|
+
});
|
|
2597
|
+
return this.#refreshing;
|
|
2598
|
+
}
|
|
2599
|
+
};
|
|
2600
|
+
|
|
2601
|
+
// src/index.ts
|
|
2602
|
+
__reExport(index_exports, require("valorant-api-types"), module.exports);
|
|
2603
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2604
|
+
0 && (module.exports = {
|
|
2605
|
+
MissingContextError,
|
|
2606
|
+
MissingParameterError,
|
|
2607
|
+
ValorantApiError,
|
|
2608
|
+
ValorantAuthError,
|
|
2609
|
+
ValorantClient,
|
|
2610
|
+
ValorantContext,
|
|
2611
|
+
ValorantError,
|
|
2612
|
+
ValorantNetworkError,
|
|
2613
|
+
ValorantRateLimitError,
|
|
2614
|
+
ValorantValidationError,
|
|
2615
|
+
fetchTransport,
|
|
2616
|
+
isRegion,
|
|
2617
|
+
localTransport,
|
|
2618
|
+
parseAuthRedirect,
|
|
2619
|
+
parseLockfile,
|
|
2620
|
+
readLockfile,
|
|
2621
|
+
registry,
|
|
2622
|
+
shardForRegion,
|
|
2623
|
+
...require("valorant-api-types")
|
|
2624
|
+
});
|
|
2625
|
+
//# sourceMappingURL=index.cjs.map
|