@voxary/valorant-client 0.1.0 → 0.3.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 -21
- package/README.md +16 -11
- package/dist/index.cjs +2640 -732
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36597 -5649
- package/dist/index.d.ts +36597 -5649
- package/dist/index.js +2627 -728
- package/dist/index.js.map +1 -1
- package/package.json +16 -13
package/dist/index.js
CHANGED
|
@@ -1,771 +1,2419 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
1
|
+
// src/api/groups/pvp.ts
|
|
2
|
+
import { endpoints as e10 } from "valorant-api-types";
|
|
3
3
|
|
|
4
|
-
// src/
|
|
5
|
-
import { endpoints as e } from "valorant-api-types";
|
|
6
|
-
|
|
7
|
-
// src/extra/catalog.ts
|
|
4
|
+
// src/endpoints/riot/account.ts
|
|
8
5
|
import { z } from "zod";
|
|
9
6
|
|
|
10
|
-
// src/
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
return endpoint2;
|
|
7
|
+
// src/endpoints/riot/shared.ts
|
|
8
|
+
var player = { token: true, entitlement: true, clientVersion: true, clientPlatform: true };
|
|
9
|
+
function withResponse(endpoint2, schema) {
|
|
10
|
+
return { ...endpoint2, responses: { "200": schema } };
|
|
15
11
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
return body.data;
|
|
19
|
-
}
|
|
20
|
-
return body;
|
|
12
|
+
function onSharedHost(endpoint2) {
|
|
13
|
+
return { ...endpoint2, type: "shared" };
|
|
21
14
|
}
|
|
22
15
|
|
|
23
|
-
// src/
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
16
|
+
// src/endpoints/riot/account.ts
|
|
17
|
+
var dailyTicketEndpoint = {
|
|
18
|
+
name: "Daily Ticket",
|
|
19
|
+
description: "Daily ticket rewards and the matches already counted.",
|
|
20
|
+
category: "Account Endpoints",
|
|
21
|
+
type: "pd",
|
|
22
|
+
suffix: "daily-ticket/v1/{puuid}",
|
|
23
|
+
riotRequirements: player,
|
|
24
|
+
responses: { "200": z.object({
|
|
25
|
+
Version: z.number(),
|
|
26
|
+
DailyRewards: z.object({
|
|
27
|
+
RemainingLifetimeSeconds: z.number(),
|
|
28
|
+
BonusMilestonesPending: z.number(),
|
|
29
|
+
Milestones: z.array(z.object({
|
|
30
|
+
Progress: z.number(),
|
|
31
|
+
BonusApplied: z.boolean()
|
|
32
|
+
}))
|
|
33
|
+
}),
|
|
34
|
+
ProcessedMatches: z.array(z.object({
|
|
35
|
+
ID: z.string(),
|
|
36
|
+
CreatedAt: z.string(),
|
|
37
|
+
DailyExpireTime: z.string(),
|
|
38
|
+
PreviousDailyExpireTime: z.string(),
|
|
39
|
+
ProgressBefore: z.number(),
|
|
40
|
+
ProgressAfter: z.number(),
|
|
41
|
+
XP: z.number(),
|
|
42
|
+
SoftCurrency: z.number(),
|
|
43
|
+
WasPenalized: z.boolean(),
|
|
44
|
+
BonusesApplied: z.number(),
|
|
45
|
+
DailyBonusState: z.array(z.boolean())
|
|
46
|
+
}))
|
|
47
|
+
}) }
|
|
48
|
+
};
|
|
49
|
+
var dailyTicketQueueConfigEndpoint = {
|
|
50
|
+
name: "Daily Ticket Queue Config",
|
|
51
|
+
description: "Which queues count for the daily ticket.",
|
|
52
|
+
category: "Account Endpoints",
|
|
53
|
+
type: "pd",
|
|
54
|
+
suffix: "daily-ticket/v1/queue-config",
|
|
55
|
+
riotRequirements: player,
|
|
56
|
+
responses: { "200": z.object({
|
|
57
|
+
default: z.object({
|
|
58
|
+
flatProgressPerMatch: z.number(),
|
|
59
|
+
progressPerRoundWin: z.boolean()
|
|
60
|
+
}),
|
|
61
|
+
queueOverrides: z.object({
|
|
62
|
+
abilitydraftarena: z.object({
|
|
63
|
+
flatProgressPerMatch: z.number(),
|
|
64
|
+
progressPerRoundWin: z.boolean()
|
|
65
|
+
}),
|
|
66
|
+
competitive: z.object({
|
|
67
|
+
flatProgressPerMatch: z.number(),
|
|
68
|
+
progressPerRoundWin: z.boolean()
|
|
69
|
+
}),
|
|
70
|
+
console_abilitydraftarena: z.object({
|
|
71
|
+
flatProgressPerMatch: z.number(),
|
|
72
|
+
progressPerRoundWin: z.boolean()
|
|
73
|
+
}),
|
|
74
|
+
console_competitive: z.object({
|
|
75
|
+
flatProgressPerMatch: z.number(),
|
|
76
|
+
progressPerRoundWin: z.boolean()
|
|
77
|
+
}),
|
|
78
|
+
console_dodgeball: z.object({
|
|
79
|
+
flatProgressPerMatch: z.number(),
|
|
80
|
+
progressPerRoundWin: z.boolean()
|
|
81
|
+
}),
|
|
82
|
+
console_fortcollins: z.object({
|
|
83
|
+
flatProgressPerMatch: z.number(),
|
|
84
|
+
progressPerRoundWin: z.boolean()
|
|
85
|
+
}),
|
|
86
|
+
console_hurm: z.object({
|
|
87
|
+
flatProgressPerMatch: z.number(),
|
|
88
|
+
progressPerRoundWin: z.boolean()
|
|
89
|
+
}),
|
|
90
|
+
console_newmap: z.object({
|
|
91
|
+
flatProgressPerMatch: z.number(),
|
|
92
|
+
progressPerRoundWin: z.boolean()
|
|
93
|
+
}),
|
|
94
|
+
console_skirmish2v2: z.object({
|
|
95
|
+
flatProgressPerMatch: z.number(),
|
|
96
|
+
progressPerRoundWin: z.boolean()
|
|
97
|
+
}),
|
|
98
|
+
console_skirmishascension1v1: z.object({
|
|
99
|
+
flatProgressPerMatch: z.number(),
|
|
100
|
+
progressPerRoundWin: z.boolean()
|
|
101
|
+
}),
|
|
102
|
+
console_skirmishascension2v2: z.object({
|
|
103
|
+
flatProgressPerMatch: z.number(),
|
|
104
|
+
progressPerRoundWin: z.boolean()
|
|
105
|
+
}),
|
|
106
|
+
console_snowball: z.object({
|
|
107
|
+
flatProgressPerMatch: z.number(),
|
|
108
|
+
progressPerRoundWin: z.boolean()
|
|
109
|
+
}),
|
|
110
|
+
console_spikerush: z.object({
|
|
111
|
+
flatProgressPerMatch: z.number(),
|
|
112
|
+
progressPerRoundWin: z.boolean()
|
|
113
|
+
}),
|
|
114
|
+
console_swiftplay: z.object({
|
|
115
|
+
flatProgressPerMatch: z.number(),
|
|
116
|
+
progressPerRoundWin: z.boolean()
|
|
117
|
+
}),
|
|
118
|
+
console_unrated: z.object({
|
|
119
|
+
flatProgressPerMatch: z.number(),
|
|
120
|
+
progressPerRoundWin: z.boolean()
|
|
121
|
+
}),
|
|
122
|
+
console_valaram: z.object({
|
|
123
|
+
flatProgressPerMatch: z.number(),
|
|
124
|
+
progressPerRoundWin: z.boolean()
|
|
125
|
+
}),
|
|
126
|
+
dodgeball: z.object({
|
|
127
|
+
flatProgressPerMatch: z.number(),
|
|
128
|
+
progressPerRoundWin: z.boolean()
|
|
129
|
+
}),
|
|
130
|
+
fortcollins: z.object({
|
|
131
|
+
flatProgressPerMatch: z.number(),
|
|
132
|
+
progressPerRoundWin: z.boolean()
|
|
133
|
+
}),
|
|
134
|
+
ggteam: z.object({
|
|
135
|
+
flatProgressPerMatch: z.number(),
|
|
136
|
+
progressPerRoundWin: z.boolean()
|
|
137
|
+
}),
|
|
138
|
+
hurm: z.object({
|
|
139
|
+
flatProgressPerMatch: z.number(),
|
|
140
|
+
progressPerRoundWin: z.boolean()
|
|
141
|
+
}),
|
|
142
|
+
newmap: z.object({
|
|
143
|
+
flatProgressPerMatch: z.number(),
|
|
144
|
+
progressPerRoundWin: z.boolean()
|
|
145
|
+
}),
|
|
146
|
+
premier: z.object({
|
|
147
|
+
flatProgressPerMatch: z.number(),
|
|
148
|
+
progressPerRoundWin: z.boolean()
|
|
149
|
+
}),
|
|
150
|
+
skirmish2v2: z.object({
|
|
151
|
+
flatProgressPerMatch: z.number(),
|
|
152
|
+
progressPerRoundWin: z.boolean()
|
|
153
|
+
}),
|
|
154
|
+
skirmishascension1v1: z.object({
|
|
155
|
+
flatProgressPerMatch: z.number(),
|
|
156
|
+
progressPerRoundWin: z.boolean()
|
|
157
|
+
}),
|
|
158
|
+
skirmishascension2v2: z.object({
|
|
159
|
+
flatProgressPerMatch: z.number(),
|
|
160
|
+
progressPerRoundWin: z.boolean()
|
|
161
|
+
}),
|
|
162
|
+
snowball: z.object({
|
|
163
|
+
flatProgressPerMatch: z.number(),
|
|
164
|
+
progressPerRoundWin: z.boolean()
|
|
165
|
+
}),
|
|
166
|
+
spikerush: z.object({
|
|
167
|
+
flatProgressPerMatch: z.number(),
|
|
168
|
+
progressPerRoundWin: z.boolean()
|
|
169
|
+
}),
|
|
170
|
+
swiftplay: z.object({
|
|
171
|
+
flatProgressPerMatch: z.number(),
|
|
172
|
+
progressPerRoundWin: z.boolean()
|
|
173
|
+
}),
|
|
174
|
+
unrated: z.object({
|
|
175
|
+
flatProgressPerMatch: z.number(),
|
|
176
|
+
progressPerRoundWin: z.boolean()
|
|
177
|
+
}),
|
|
178
|
+
valaram: z.object({
|
|
179
|
+
flatProgressPerMatch: z.number(),
|
|
180
|
+
progressPerRoundWin: z.boolean()
|
|
181
|
+
})
|
|
182
|
+
})
|
|
183
|
+
}) }
|
|
184
|
+
};
|
|
185
|
+
var favoritesEndpoint = {
|
|
186
|
+
name: "Favorites",
|
|
187
|
+
description: "Favorited store content of the player.",
|
|
188
|
+
category: "Account Endpoints",
|
|
189
|
+
type: "pd",
|
|
190
|
+
suffix: "favorites/v1/players/{puuid}/favorites",
|
|
191
|
+
riotRequirements: player,
|
|
192
|
+
responses: { "200": z.object({
|
|
193
|
+
Subject: z.string(),
|
|
194
|
+
FavoritedContent: z.record(z.string(), z.object({
|
|
195
|
+
FavoriteID: z.string(),
|
|
196
|
+
ItemID: z.string()
|
|
197
|
+
}))
|
|
198
|
+
}) }
|
|
199
|
+
};
|
|
200
|
+
var goldstarsEndpoint = {
|
|
201
|
+
name: "Goldstars",
|
|
202
|
+
description: "Goldstar definitions. Field names are obfuscated by the game.",
|
|
203
|
+
category: "Account Endpoints",
|
|
204
|
+
type: "pd",
|
|
205
|
+
suffix: "goldstars/v1/goldstars",
|
|
206
|
+
riotRequirements: player,
|
|
207
|
+
responses: { "200": z.array(z.object({
|
|
208
|
+
id: z.string(),
|
|
209
|
+
tempT: z.number()
|
|
210
|
+
})) }
|
|
211
|
+
};
|
|
212
|
+
var goldstarsPlayerEndpoint = {
|
|
213
|
+
name: "Goldstars Player",
|
|
214
|
+
description: "Goldstars of a player. Field names are obfuscated by the game.",
|
|
215
|
+
category: "Account Endpoints",
|
|
216
|
+
type: "pd",
|
|
217
|
+
suffix: "goldstars/v1/players/{puuid}",
|
|
218
|
+
riotRequirements: player,
|
|
219
|
+
responses: { "200": z.object({
|
|
220
|
+
puuid: z.string(),
|
|
221
|
+
version: z.number(),
|
|
222
|
+
tempS: z.object({
|
|
223
|
+
"00000000-0000-0000-0000-000000000000": z.object({
|
|
224
|
+
tempS: z.string(),
|
|
225
|
+
tempA: z.record(z.string(), z.object({
|
|
226
|
+
id: z.string(),
|
|
227
|
+
tempC: z.number(),
|
|
228
|
+
tempB: z.number()
|
|
229
|
+
}))
|
|
230
|
+
}),
|
|
231
|
+
"8102cd81-43a0-d0d7-bd59-47b8fe9bed1b": z.object({
|
|
232
|
+
tempS: z.string(),
|
|
233
|
+
tempA: z.record(z.string(), z.object({
|
|
234
|
+
id: z.string(),
|
|
235
|
+
tempC: z.number(),
|
|
236
|
+
tempB: z.number()
|
|
237
|
+
}))
|
|
238
|
+
})
|
|
239
|
+
}),
|
|
240
|
+
tempM: z.array(z.object({
|
|
241
|
+
id: z.string(),
|
|
242
|
+
tempG: z.number(),
|
|
243
|
+
tempP: z.record(z.string(), z.object({
|
|
244
|
+
tempA: z.record(z.string(), z.object({
|
|
245
|
+
id: z.string(),
|
|
246
|
+
tempV: z.number(),
|
|
247
|
+
tempB: z.boolean()
|
|
248
|
+
}))
|
|
249
|
+
}))
|
|
250
|
+
}))
|
|
251
|
+
}) }
|
|
252
|
+
};
|
|
253
|
+
var bloomlineQueuesEndpoint = {
|
|
254
|
+
name: "Bloomline Queues",
|
|
255
|
+
description: "Queues handled by the `bloomline` service. The purpose of the service is not documented.",
|
|
256
|
+
category: "Account Endpoints",
|
|
257
|
+
type: "pd",
|
|
258
|
+
suffix: "bloomline/v0/config/valid-queues",
|
|
259
|
+
riotRequirements: player,
|
|
260
|
+
responses: { "200": z.object({
|
|
261
|
+
ProcessedQueues: z.array(z.string()),
|
|
262
|
+
PerformanceScoreQueues: z.array(z.string())
|
|
263
|
+
}) }
|
|
264
|
+
};
|
|
265
|
+
var bloomlinePlayerEndpoint = {
|
|
266
|
+
name: "Bloomline Player",
|
|
267
|
+
description: "Per-player data of the `bloomline` service. The purpose of the service is not documented.",
|
|
268
|
+
category: "Account Endpoints",
|
|
269
|
+
type: "pd",
|
|
270
|
+
suffix: "bloomline/v0/players/{puuid}",
|
|
271
|
+
riotRequirements: player,
|
|
272
|
+
responses: { "200": z.object({
|
|
273
|
+
Subject: z.string(),
|
|
274
|
+
Bonsais: z.array(z.object({
|
|
275
|
+
BonsaiID: z.string(),
|
|
276
|
+
HypeID: z.string().optional(),
|
|
277
|
+
BackgroundID: z.string().optional(),
|
|
278
|
+
ClipID: z.string().optional(),
|
|
279
|
+
BorderID: z.string().optional(),
|
|
280
|
+
Flourish: z.object({
|
|
281
|
+
ShortLevel: z.number().optional(),
|
|
282
|
+
PreviousShortLevel: z.number().optional(),
|
|
283
|
+
LongLevel: z.number().optional(),
|
|
284
|
+
FlourishID: z.string().optional(),
|
|
285
|
+
Points: z.number().optional(),
|
|
286
|
+
PointsVersion: z.number().optional()
|
|
287
|
+
}),
|
|
288
|
+
TrackProgressList: z.array(z.object({
|
|
289
|
+
TrackID: z.string(),
|
|
290
|
+
TrackLevel: z.number().optional()
|
|
291
|
+
}))
|
|
292
|
+
})),
|
|
293
|
+
LongGroupVersion: z.number()
|
|
294
|
+
}) }
|
|
200
295
|
};
|
|
201
296
|
|
|
202
|
-
// src/
|
|
297
|
+
// src/endpoints/riot/agentSelect.ts
|
|
298
|
+
import { endpoints as e } from "valorant-api-types";
|
|
203
299
|
import { z as z2 } from "zod";
|
|
204
|
-
var
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
300
|
+
var agentSelect = z2.object({
|
|
301
|
+
ID: z2.string(),
|
|
302
|
+
Version: z2.number(),
|
|
303
|
+
Teams: z2.array(z2.object({
|
|
304
|
+
TeamID: z2.string(),
|
|
305
|
+
TeamNumber: z2.number(),
|
|
306
|
+
Players: z2.array(z2.object({
|
|
307
|
+
Subject: z2.string(),
|
|
308
|
+
CharacterID: z2.string(),
|
|
309
|
+
CharacterSelectionState: z2.string(),
|
|
310
|
+
PregamePlayerState: z2.string(),
|
|
311
|
+
CompetitiveTier: z2.number(),
|
|
312
|
+
PlayerIdentity: z2.object({
|
|
313
|
+
Subject: z2.string(),
|
|
314
|
+
PlayerCardID: z2.string(),
|
|
315
|
+
PlayerTitleID: z2.string(),
|
|
316
|
+
AccountLevel: z2.number(),
|
|
317
|
+
PreferredLevelBorderID: z2.string(),
|
|
318
|
+
Incognito: z2.boolean(),
|
|
319
|
+
HideAccountLevel: z2.boolean()
|
|
320
|
+
}),
|
|
321
|
+
SeasonalBadgeInfo: z2.object({
|
|
322
|
+
SeasonID: z2.string(),
|
|
323
|
+
NumberOfWins: z2.number(),
|
|
324
|
+
Rank: z2.number(),
|
|
325
|
+
LeaderboardRank: z2.number()
|
|
326
|
+
}),
|
|
327
|
+
IsCaptain: z2.boolean(),
|
|
328
|
+
PlatformType: z2.string(),
|
|
329
|
+
PremierPrestige: z2.object({})
|
|
330
|
+
}))
|
|
331
|
+
})),
|
|
332
|
+
AllyTeam: z2.object({
|
|
333
|
+
TeamID: z2.string(),
|
|
334
|
+
TeamNumber: z2.number(),
|
|
335
|
+
Players: z2.array(z2.object({
|
|
336
|
+
Subject: z2.string(),
|
|
337
|
+
CharacterID: z2.string(),
|
|
338
|
+
CharacterSelectionState: z2.string(),
|
|
339
|
+
PregamePlayerState: z2.string(),
|
|
340
|
+
CompetitiveTier: z2.number(),
|
|
341
|
+
PlayerIdentity: z2.object({
|
|
342
|
+
Subject: z2.string(),
|
|
343
|
+
PlayerCardID: z2.string(),
|
|
344
|
+
PlayerTitleID: z2.string(),
|
|
345
|
+
AccountLevel: z2.number(),
|
|
346
|
+
PreferredLevelBorderID: z2.string(),
|
|
347
|
+
Incognito: z2.boolean(),
|
|
348
|
+
HideAccountLevel: z2.boolean()
|
|
349
|
+
}),
|
|
350
|
+
SeasonalBadgeInfo: z2.object({
|
|
351
|
+
SeasonID: z2.string(),
|
|
352
|
+
NumberOfWins: z2.number(),
|
|
353
|
+
Rank: z2.number(),
|
|
354
|
+
LeaderboardRank: z2.number()
|
|
355
|
+
}),
|
|
356
|
+
IsCaptain: z2.boolean(),
|
|
357
|
+
PlatformType: z2.string(),
|
|
358
|
+
PremierPrestige: z2.object({})
|
|
359
|
+
}))
|
|
360
|
+
}),
|
|
361
|
+
EnemyTeamSize: z2.number(),
|
|
362
|
+
EnemyTeamLockCount: z2.number(),
|
|
363
|
+
PregameState: z2.string(),
|
|
364
|
+
LastUpdated: z2.string(),
|
|
365
|
+
MapID: z2.string(),
|
|
366
|
+
CastedVotes: z2.object({}),
|
|
367
|
+
MapSelectStep: z2.number(),
|
|
368
|
+
Team1: z2.string(),
|
|
369
|
+
GamePodID: z2.string(),
|
|
370
|
+
Mode: z2.string(),
|
|
371
|
+
VoiceSessionID: z2.string(),
|
|
372
|
+
MUCName: z2.string(),
|
|
373
|
+
TeamMatchToken: z2.string(),
|
|
374
|
+
QueueID: z2.string(),
|
|
375
|
+
ProvisioningFlowID: z2.string(),
|
|
376
|
+
IsRanked: z2.boolean(),
|
|
377
|
+
PhaseTimeRemainingNS: z2.number(),
|
|
378
|
+
StepTimeRemainingNS: z2.number(),
|
|
379
|
+
altModesFlagADA: z2.boolean(),
|
|
380
|
+
GameRules: z2.object({
|
|
381
|
+
AccoladesEnabled: z2.string(),
|
|
382
|
+
AllowGameModifiers: z2.string(),
|
|
383
|
+
IsOvertimeWinByTwo: z2.string(),
|
|
384
|
+
PlayOutAllRounds: z2.string(),
|
|
385
|
+
ReplayRecordMatch: z2.string(),
|
|
386
|
+
SkipMatchHistory: z2.string(),
|
|
387
|
+
TournamentMode: z2.string()
|
|
388
|
+
})
|
|
389
|
+
});
|
|
390
|
+
var selectCharacterEndpoint = withResponse(e.selectCharacterEndpoint, agentSelect);
|
|
391
|
+
var lockCharacterEndpoint = withResponse(e.lockCharacterEndpoint, agentSelect);
|
|
392
|
+
|
|
393
|
+
// src/endpoints/riot/chat.ts
|
|
394
|
+
import { endpoints as e2 } from "valorant-api-types";
|
|
395
|
+
import { z as z3 } from "zod";
|
|
396
|
+
var chatSettingsEndpoint = {
|
|
397
|
+
name: "Settings",
|
|
398
|
+
description: "Get chat settings",
|
|
399
|
+
category: "Local Endpoints - Chat",
|
|
239
400
|
type: "local",
|
|
240
|
-
suffix: "
|
|
401
|
+
suffix: "chat/v1/settings",
|
|
241
402
|
riotRequirements: { localAuth: true },
|
|
242
|
-
responses: { "200":
|
|
403
|
+
responses: { "200": z3.object({
|
|
404
|
+
bounceDockIconEnabled: z3.boolean(),
|
|
405
|
+
"chat-status-message": z3.string(),
|
|
406
|
+
chatFilterDisabled: z3.boolean(),
|
|
407
|
+
chatGBG: z3.boolean(),
|
|
408
|
+
chatGroupDiscord: z3.boolean(),
|
|
409
|
+
chatGroupMobile: z3.boolean(),
|
|
410
|
+
chatGroupOffline: z3.boolean(),
|
|
411
|
+
chatWindow: z3.object({
|
|
412
|
+
detached: z3.boolean(),
|
|
413
|
+
height: z3.number(),
|
|
414
|
+
left: z3.number(),
|
|
415
|
+
top: z3.number(),
|
|
416
|
+
width: z3.number()
|
|
417
|
+
}),
|
|
418
|
+
chatWindowDockedHeight: z3.number(),
|
|
419
|
+
"closed-conversations": z3.object({
|
|
420
|
+
"ff822fdf-71a3-54ac-814e-7ac752ba428d@eu1.pvp.net": z3.number()
|
|
421
|
+
}),
|
|
422
|
+
friendRequestToastsDisabled: z3.boolean(),
|
|
423
|
+
"hidden-conversations": z3.object({}),
|
|
424
|
+
linkClickWarningEnabled: z3.boolean(),
|
|
425
|
+
messageNotificationsEnabled: z3.boolean(),
|
|
426
|
+
moreUnreadsEnabled: z3.boolean(),
|
|
427
|
+
"muted-conversations": z3.object({}),
|
|
428
|
+
recentlyPlayedFirstOpen: z3.boolean(),
|
|
429
|
+
recentlyPlayedOpen: z3.boolean(),
|
|
430
|
+
"roster-group-collapsed": z3.object({}),
|
|
431
|
+
showWhenTypingEnabled: z3.boolean(),
|
|
432
|
+
sortBy: z3.string(),
|
|
433
|
+
usePlayerPreferences: z3.boolean()
|
|
434
|
+
}) }
|
|
243
435
|
};
|
|
244
|
-
var
|
|
245
|
-
name: "
|
|
246
|
-
description: "
|
|
247
|
-
|
|
248
|
-
category: "Local Endpoints",
|
|
436
|
+
var chatTournamentInfoEndpoint = {
|
|
437
|
+
name: "Tournament Info",
|
|
438
|
+
description: "Get in-tournament conversations",
|
|
439
|
+
category: "Local Endpoints - Chat",
|
|
249
440
|
type: "local",
|
|
250
|
-
suffix: "
|
|
441
|
+
suffix: "chat/v6/conversations/ares-tournaments",
|
|
251
442
|
riotRequirements: { localAuth: true },
|
|
252
|
-
responses: { "200":
|
|
443
|
+
responses: { "200": z3.object({}) }
|
|
253
444
|
};
|
|
254
|
-
var
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
445
|
+
var chatParticipantsEndpoint = withResponse(e2.chatParticipantsEndpoint, z3.object({
|
|
446
|
+
participants: z3.array(z3.object({
|
|
447
|
+
activePlatform: z3.string().nullable(),
|
|
448
|
+
cid: z3.string(),
|
|
449
|
+
game_name: z3.string(),
|
|
450
|
+
game_tag: z3.string(),
|
|
451
|
+
isInteractionAllowed: z3.boolean(),
|
|
452
|
+
muted: z3.boolean(),
|
|
453
|
+
name: z3.string(),
|
|
454
|
+
pid: z3.string(),
|
|
455
|
+
puuid: z3.string(),
|
|
456
|
+
region: z3.string()
|
|
457
|
+
}))
|
|
458
|
+
}));
|
|
459
|
+
|
|
460
|
+
// src/endpoints/riot/contracts.ts
|
|
461
|
+
import { endpoints as e3 } from "valorant-api-types";
|
|
462
|
+
import { z as z4 } from "zod";
|
|
463
|
+
var activeRecruitmentEventEndpoint = {
|
|
464
|
+
name: "Active Recruitment Event",
|
|
465
|
+
description: "The current agent recruitment event.",
|
|
466
|
+
category: "Contract Endpoints",
|
|
467
|
+
type: "pd",
|
|
468
|
+
suffix: "contracts/v1/agents/activeRecruitmentEvent",
|
|
469
|
+
riotRequirements: player,
|
|
470
|
+
responses: { "200": z4.object({
|
|
471
|
+
AgentID: z4.string(),
|
|
472
|
+
CounterID: z4.string(),
|
|
473
|
+
MilestoneThreshold: z4.number(),
|
|
474
|
+
StartDate: z4.string(),
|
|
475
|
+
EndDate: z4.string(),
|
|
476
|
+
IsActive: z4.boolean(),
|
|
477
|
+
includedPlatforms: z4.object({
|
|
478
|
+
console: z4.object({
|
|
479
|
+
developmentOnly: z4.boolean()
|
|
480
|
+
}),
|
|
481
|
+
mobile: z4.object({
|
|
482
|
+
developmentOnly: z4.boolean()
|
|
483
|
+
}),
|
|
484
|
+
pc: z4.object({
|
|
485
|
+
developmentOnly: z4.boolean()
|
|
486
|
+
})
|
|
487
|
+
})
|
|
488
|
+
}) }
|
|
263
489
|
};
|
|
264
|
-
var
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
490
|
+
var contractsEndpoint = withResponse(e3.contractsEndpoint, z4.object({
|
|
491
|
+
Version: z4.number(),
|
|
492
|
+
Subject: z4.string(),
|
|
493
|
+
Contracts: z4.array(z4.object({
|
|
494
|
+
ContractDefinitionID: z4.string(),
|
|
495
|
+
ContractProgression: z4.object({
|
|
496
|
+
Version: z4.number(),
|
|
497
|
+
TotalProgressionEarned: z4.number()
|
|
498
|
+
}),
|
|
499
|
+
ProgressionLevelReached: z4.number(),
|
|
500
|
+
ProgressionTowardsNextLevel: z4.number()
|
|
501
|
+
})),
|
|
502
|
+
ActiveRecruitmentEventProgress: z4.object({
|
|
503
|
+
AgentID: z4.string(),
|
|
504
|
+
Version: z4.number(),
|
|
505
|
+
CounterID: z4.string(),
|
|
506
|
+
ProgressionEarned: z4.number()
|
|
507
|
+
}),
|
|
508
|
+
Missions: z4.array(z4.object({
|
|
509
|
+
ID: z4.string(),
|
|
510
|
+
Objectives: z4.record(z4.string(), z4.number()),
|
|
511
|
+
Complete: z4.boolean(),
|
|
512
|
+
ExpirationTime: z4.string()
|
|
513
|
+
})),
|
|
514
|
+
MissionMetadata: z4.object({
|
|
515
|
+
WeeklyCheckpoint: z4.string(),
|
|
516
|
+
WeeklyRefillTime: z4.string()
|
|
517
|
+
}),
|
|
518
|
+
BTEMilestone: z4.number()
|
|
519
|
+
}));
|
|
520
|
+
|
|
521
|
+
// src/endpoints/riot/currentGame.ts
|
|
522
|
+
import { endpoints as e4 } from "valorant-api-types";
|
|
523
|
+
import { z as z5 } from "zod";
|
|
524
|
+
var currentGameLoadoutsEndpoint = withResponse(e4.currentGameLoadoutsEndpoint, z5.object({
|
|
525
|
+
Loadouts: z5.array(z5.object({
|
|
526
|
+
CharacterID: z5.string(),
|
|
527
|
+
Loadout: z5.object({
|
|
528
|
+
Subject: z5.string(),
|
|
529
|
+
Expressions: z5.object({
|
|
530
|
+
AESSelections: z5.array(z5.object({
|
|
531
|
+
AssetID: z5.string(),
|
|
532
|
+
TypeID: z5.string()
|
|
533
|
+
}))
|
|
534
|
+
}),
|
|
535
|
+
DynamicOptions: z5.object({}),
|
|
536
|
+
Items: z5.record(z5.string(), z5.object({
|
|
537
|
+
ID: z5.string(),
|
|
538
|
+
TypeID: z5.string(),
|
|
539
|
+
Sockets: z5.record(z5.string(), z5.object({
|
|
540
|
+
ID: z5.string(),
|
|
541
|
+
Item: z5.object({
|
|
542
|
+
ID: z5.string(),
|
|
543
|
+
TypeID: z5.string()
|
|
544
|
+
})
|
|
545
|
+
}))
|
|
546
|
+
}))
|
|
547
|
+
}),
|
|
548
|
+
Subject: z5.string()
|
|
549
|
+
}))
|
|
550
|
+
}));
|
|
551
|
+
|
|
552
|
+
// src/endpoints/riot/esports.ts
|
|
553
|
+
import { z as z6 } from "zod";
|
|
554
|
+
var esportsLiveEventTimesEndpoint = {
|
|
555
|
+
name: "Esports Live Event Times",
|
|
556
|
+
description: "Live and upcoming esports matches, pick blocks and tournaments.",
|
|
557
|
+
category: "Esports Endpoints",
|
|
558
|
+
type: "pd",
|
|
559
|
+
suffix: "esports-service/v2/liveEventTimes",
|
|
560
|
+
riotRequirements: player,
|
|
561
|
+
responses: { "200": z6.object({
|
|
562
|
+
Tournaments: z6.array(z6.object({
|
|
563
|
+
ID: z6.string(),
|
|
564
|
+
StartTimeUTC: z6.string(),
|
|
565
|
+
EndTimeUTC: z6.string()
|
|
566
|
+
}))
|
|
567
|
+
}) }
|
|
273
568
|
};
|
|
274
|
-
var
|
|
275
|
-
name: "
|
|
276
|
-
description: "
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
responses: { "200": z2.unknown() }
|
|
569
|
+
var esportsUpcomingMatchesEndpoint = {
|
|
570
|
+
name: "Esports Upcoming Matches",
|
|
571
|
+
description: "Upcoming esports matches.",
|
|
572
|
+
category: "Esports Endpoints",
|
|
573
|
+
type: "pd",
|
|
574
|
+
suffix: "esports-service/v2/upcomingMatches",
|
|
575
|
+
riotRequirements: player,
|
|
576
|
+
responses: { "200": z6.object({}) }
|
|
283
577
|
};
|
|
284
|
-
var
|
|
285
|
-
name: "
|
|
286
|
-
description: "
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
578
|
+
var esportsPickemLeaguesEndpoint = {
|
|
579
|
+
name: "Esports Pickem Leagues",
|
|
580
|
+
description: "Pick'em leagues.",
|
|
581
|
+
category: "Esports Endpoints",
|
|
582
|
+
type: "pd",
|
|
583
|
+
suffix: "esports-service/v1/pickem/leagues",
|
|
584
|
+
riotRequirements: player,
|
|
585
|
+
responses: { "200": z6.object({
|
|
586
|
+
PickemLeagues: z6.array(z6.object({
|
|
587
|
+
LeagueID: z6.string(),
|
|
588
|
+
EldsLeagueID: z6.string(),
|
|
589
|
+
Tournament: z6.object({
|
|
590
|
+
ID: z6.string(),
|
|
591
|
+
EldsTournamentID: z6.string(),
|
|
592
|
+
LeagueID: z6.string(),
|
|
593
|
+
PickBlocks: z6.array(z6.object({
|
|
594
|
+
ID: z6.string(),
|
|
595
|
+
EldsTournamentID: z6.string(),
|
|
596
|
+
Slug: z6.object({
|
|
597
|
+
Slug: z6.string()
|
|
598
|
+
}),
|
|
599
|
+
PickOpenTime: z6.string(),
|
|
600
|
+
PickCloseTime: z6.string(),
|
|
601
|
+
State: z6.string(),
|
|
602
|
+
OpenLevel: z6.string(),
|
|
603
|
+
BlockType: z6.string(),
|
|
604
|
+
PickBlockElements: z6.array(z6.object({
|
|
605
|
+
ID: z6.string(),
|
|
606
|
+
PickBlockID: z6.string(),
|
|
607
|
+
Section: z6.object({
|
|
608
|
+
ID: z6.string(),
|
|
609
|
+
EldsSectionID: z6.string(),
|
|
610
|
+
CorrectPick: z6.object({
|
|
611
|
+
Entries: z6.array(z6.object({
|
|
612
|
+
Index: z6.number(),
|
|
613
|
+
Correctness: z6.string(),
|
|
614
|
+
ParticipantID: z6.string(),
|
|
615
|
+
Points: z6.number(),
|
|
616
|
+
Rank: z6.number()
|
|
617
|
+
})).nullable()
|
|
618
|
+
})
|
|
619
|
+
}),
|
|
620
|
+
Match: z6.object({
|
|
621
|
+
ID: z6.string(),
|
|
622
|
+
EldsMatchID: z6.string(),
|
|
623
|
+
BaselinePoints: z6.number(),
|
|
624
|
+
CorrectPick: z6.string(),
|
|
625
|
+
ResultState: z6.string()
|
|
626
|
+
}),
|
|
627
|
+
PickOpenTime: z6.string(),
|
|
628
|
+
PickCloseTime: z6.string(),
|
|
629
|
+
State: z6.string(),
|
|
630
|
+
DisplayOrder: z6.number()
|
|
631
|
+
})),
|
|
632
|
+
CompletionStatus: z6.string()
|
|
633
|
+
})),
|
|
634
|
+
Participants: z6.array(z6.object({
|
|
635
|
+
ID: z6.string(),
|
|
636
|
+
EldsTeamID: z6.string()
|
|
637
|
+
}))
|
|
638
|
+
}),
|
|
639
|
+
Published: z6.boolean()
|
|
640
|
+
}))
|
|
641
|
+
}) }
|
|
293
642
|
};
|
|
643
|
+
|
|
644
|
+
// src/endpoints/riot/local.ts
|
|
645
|
+
import { z as z7 } from "zod";
|
|
294
646
|
var localLocaleEndpoint = {
|
|
295
647
|
name: "Locale",
|
|
296
648
|
description: "Get the current locale",
|
|
297
|
-
queryName: "LOCALE_RNet_FetchLocale",
|
|
298
649
|
category: "Local Endpoints",
|
|
299
650
|
type: "local",
|
|
300
651
|
suffix: "riotclient/product-locales/products/valorant/patchlines/live",
|
|
301
652
|
riotRequirements: { localAuth: true },
|
|
302
|
-
responses: { "200":
|
|
653
|
+
responses: { "200": z7.string() }
|
|
303
654
|
};
|
|
304
|
-
var
|
|
305
|
-
name: "
|
|
306
|
-
description: "
|
|
307
|
-
queryName: "REPORTER_FEEDBACK_RNet_GetReporterFeedback",
|
|
308
|
-
category: "Local Endpoints",
|
|
309
|
-
type: "local",
|
|
310
|
-
suffix: "player-reporting/v1/reporter-feedback",
|
|
311
|
-
riotRequirements: { localAuth: true },
|
|
312
|
-
responses: { "200": z2.unknown() }
|
|
313
|
-
};
|
|
314
|
-
var localCommandLineArgsEndpoint = {
|
|
315
|
-
name: "Command Line Args",
|
|
316
|
-
description: "Gets the command-line args provided to the Riot client",
|
|
317
|
-
queryName: "Riot Client Command-Line Args",
|
|
655
|
+
var localAvailableLocalesEndpoint = {
|
|
656
|
+
name: "Available Locales",
|
|
657
|
+
description: "Get available locales",
|
|
318
658
|
category: "Local Endpoints",
|
|
319
659
|
type: "local",
|
|
320
|
-
suffix: "
|
|
660
|
+
suffix: "rnet-product-registry/v4/available-product-locales/products/valorant/patchlines/live",
|
|
321
661
|
riotRequirements: { localAuth: true },
|
|
322
|
-
responses: { "200":
|
|
662
|
+
responses: { "200": z7.array(z7.string()) }
|
|
323
663
|
};
|
|
324
664
|
var localRiotStatusEndpoint = {
|
|
325
665
|
name: "Riot Status",
|
|
326
666
|
description: "Get game status information such as maintenances and incidents Response is an escaped JSON string.",
|
|
327
|
-
queryName: "RiotStatus_RNet_FetchStatus",
|
|
328
667
|
category: "Local Endpoints",
|
|
329
668
|
type: "local",
|
|
330
669
|
suffix: "riot-status/v1/products/valorant/patchlines/live/deployments/{region}",
|
|
331
670
|
riotRequirements: { localAuth: true },
|
|
332
|
-
responses: { "200":
|
|
333
|
-
};
|
|
334
|
-
var localRiotWarningEndpoint = {
|
|
335
|
-
name: "Riot Warning",
|
|
336
|
-
description: "GET RIOT_WARNING_RNet_GetRiotWarning",
|
|
337
|
-
queryName: "RIOT_WARNING_RNet_GetRiotWarning",
|
|
338
|
-
category: "Local Endpoints",
|
|
339
|
-
type: "local",
|
|
340
|
-
suffix: "ga-warning/v1/warnings",
|
|
341
|
-
riotRequirements: { localAuth: true },
|
|
342
|
-
responses: { "200": z2.unknown() }
|
|
343
|
-
};
|
|
344
|
-
var localClientAuthorizationsEndpoint = {
|
|
345
|
-
name: "Client Authorizations",
|
|
346
|
-
description: "Gets tokens in use by the client",
|
|
347
|
-
queryName: "RSO_RNet_FetchClientAuthorizations",
|
|
348
|
-
category: "Local Endpoints",
|
|
349
|
-
type: "local",
|
|
350
|
-
suffix: "rso-auth/v2/authorizations/valorant-client",
|
|
351
|
-
riotRequirements: { localAuth: true },
|
|
352
|
-
responses: { "200": z2.unknown() }
|
|
671
|
+
responses: { "200": z7.string() }
|
|
353
672
|
};
|
|
354
673
|
var localAccessTokenEndpoint = {
|
|
355
674
|
name: "Access Token",
|
|
356
675
|
description: "Gets a Riot access token",
|
|
357
|
-
queryName: "RSO_RNet_GetAccessToken",
|
|
358
676
|
category: "Local Endpoints",
|
|
359
677
|
type: "local",
|
|
360
678
|
suffix: "rso-auth/v1/authorization/access-token",
|
|
361
679
|
riotRequirements: { localAuth: true },
|
|
362
|
-
responses: { "200":
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
category: "Local Endpoints",
|
|
369
|
-
type: "local",
|
|
370
|
-
suffix: "rso-auth/v1/userinfo/valorant-client",
|
|
371
|
-
riotRequirements: { localAuth: true },
|
|
372
|
-
responses: { "200": z2.unknown() }
|
|
373
|
-
};
|
|
374
|
-
var chatSettingsEndpoint = {
|
|
375
|
-
name: "Settings",
|
|
376
|
-
description: "Get chat settings",
|
|
377
|
-
queryName: "TEXT_CHAT_RNet_FetchSettings",
|
|
378
|
-
category: "Local Endpoints - Chat",
|
|
379
|
-
type: "local",
|
|
380
|
-
suffix: "chat/v1/settings",
|
|
381
|
-
riotRequirements: { localAuth: true },
|
|
382
|
-
responses: { "200": z2.unknown() }
|
|
383
|
-
};
|
|
384
|
-
var chatTournamentInfoEndpoint = {
|
|
385
|
-
name: "Tournament Info",
|
|
386
|
-
description: "Get in-tournament conversations",
|
|
387
|
-
queryName: "TEXT_CHAT_RNet_GetMUCInfos - tournaments",
|
|
388
|
-
category: "Local Endpoints - Chat",
|
|
389
|
-
type: "local",
|
|
390
|
-
suffix: "chat/v6/conversations/ares-tournaments",
|
|
391
|
-
riotRequirements: { localAuth: true },
|
|
392
|
-
responses: { "200": z2.unknown() }
|
|
680
|
+
responses: { "200": z7.object({
|
|
681
|
+
clientId: z7.string(),
|
|
682
|
+
expiry: z7.number(),
|
|
683
|
+
scopes: z7.array(z7.string()),
|
|
684
|
+
token: z7.string()
|
|
685
|
+
}) }
|
|
393
686
|
};
|
|
394
687
|
var localPluginStatusEndpoint = {
|
|
395
688
|
name: "Plugin Status",
|
|
396
689
|
description: "Gets plugin status",
|
|
397
|
-
queryName: "URNetClient_CheckPluginStatus",
|
|
398
690
|
category: "Local Endpoints",
|
|
399
691
|
type: "local",
|
|
400
692
|
suffix: "plugin-manager/v1/status",
|
|
401
693
|
riotRequirements: { localAuth: true },
|
|
402
|
-
responses: { "200":
|
|
694
|
+
responses: { "200": z7.object({
|
|
695
|
+
state: z7.string()
|
|
696
|
+
}) }
|
|
403
697
|
};
|
|
404
698
|
var localRmsSessionEndpoint = {
|
|
405
699
|
name: "Rms Session",
|
|
406
700
|
description: "Gets the token for Riot Messaging Service",
|
|
407
|
-
queryName: "URNetClient_CheckRMSSession",
|
|
408
701
|
category: "Local Endpoints",
|
|
409
702
|
type: "local",
|
|
410
703
|
suffix: "riot-messaging-service/v1/session",
|
|
411
704
|
riotRequirements: { localAuth: true },
|
|
412
|
-
responses: { "200":
|
|
705
|
+
responses: { "200": z7.object({
|
|
706
|
+
state: z7.string(),
|
|
707
|
+
token: z7.string(),
|
|
708
|
+
tokenType: z7.string()
|
|
709
|
+
}) }
|
|
413
710
|
};
|
|
414
711
|
var localProcessInfoEndpoint = {
|
|
415
712
|
name: "Process Info",
|
|
416
713
|
description: "Gets the Valorant process ID",
|
|
417
|
-
queryName: "URNetClient_GetProcessInfo",
|
|
418
714
|
category: "Local Endpoints",
|
|
419
715
|
type: "local",
|
|
420
716
|
suffix: "process-control/v1/process",
|
|
421
717
|
riotRequirements: { localAuth: true },
|
|
422
|
-
responses: { "200":
|
|
718
|
+
responses: { "200": z7.object({
|
|
719
|
+
pid: z7.number(),
|
|
720
|
+
status: z7.string()
|
|
721
|
+
}) }
|
|
423
722
|
};
|
|
424
723
|
var localLogPathEndpoint = {
|
|
425
724
|
name: "Log Path",
|
|
426
725
|
description: "Gets the Valorant log path",
|
|
427
|
-
queryName: "Valorant Log Path",
|
|
428
726
|
category: "Local Endpoints",
|
|
429
727
|
type: "local",
|
|
430
728
|
suffix: "product-session/v1/logs/path/VALORANT",
|
|
431
729
|
riotRequirements: { localAuth: true },
|
|
432
|
-
responses: { "200":
|
|
730
|
+
responses: { "200": z7.string() }
|
|
731
|
+
};
|
|
732
|
+
var localEulaEndpoint = {
|
|
733
|
+
name: "Eula",
|
|
734
|
+
description: "Get the EULA",
|
|
735
|
+
category: "Local Endpoints",
|
|
736
|
+
type: "local",
|
|
737
|
+
suffix: "eula/v1/agreement/content",
|
|
738
|
+
riotRequirements: { localAuth: true },
|
|
739
|
+
responses: { "200": z7.string() }
|
|
740
|
+
};
|
|
741
|
+
var localPrivacyPolicyEndpoint = {
|
|
742
|
+
name: "Privacy Policy",
|
|
743
|
+
description: "Get privacy policy",
|
|
744
|
+
category: "Local Endpoints",
|
|
745
|
+
type: "local",
|
|
746
|
+
suffix: "eula/v1/privacy-policy/content",
|
|
747
|
+
riotRequirements: { localAuth: true },
|
|
748
|
+
responses: { "200": z7.string() }
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
// src/endpoints/riot/party.ts
|
|
752
|
+
import { endpoints as e5 } from "valorant-api-types";
|
|
753
|
+
import { z as z8 } from "zod";
|
|
754
|
+
var customGameTeam = z8.array(z8.object({ Subject: z8.string().describe("PUUID") }));
|
|
755
|
+
var customGameParty = z8.object({
|
|
756
|
+
ID: z8.string(),
|
|
757
|
+
MUCName: z8.string(),
|
|
758
|
+
VoiceRoomID: z8.string(),
|
|
759
|
+
Version: z8.number(),
|
|
760
|
+
ClientVersion: z8.string(),
|
|
761
|
+
Members: z8.array(z8.object({
|
|
762
|
+
Subject: z8.string(),
|
|
763
|
+
CompetitiveTier: z8.number(),
|
|
764
|
+
PlayerIdentity: z8.object({
|
|
765
|
+
Subject: z8.string(),
|
|
766
|
+
PlayerCardID: z8.string(),
|
|
767
|
+
PlayerTitleID: z8.string(),
|
|
768
|
+
AccountLevel: z8.number(),
|
|
769
|
+
PreferredLevelBorderID: z8.string(),
|
|
770
|
+
Incognito: z8.boolean(),
|
|
771
|
+
HideAccountLevel: z8.boolean()
|
|
772
|
+
}),
|
|
773
|
+
IsOwner: z8.boolean(),
|
|
774
|
+
QueueEligibleRemainingAccountLevels: z8.number(),
|
|
775
|
+
Pings: z8.array(z8.object({
|
|
776
|
+
Ping: z8.number(),
|
|
777
|
+
GamePodID: z8.string()
|
|
778
|
+
})),
|
|
779
|
+
IsReady: z8.boolean(),
|
|
780
|
+
IsModerator: z8.boolean(),
|
|
781
|
+
UseBroadcastHUD: z8.boolean(),
|
|
782
|
+
PlatformType: z8.string(),
|
|
783
|
+
PremierPrestige: z8.object({}),
|
|
784
|
+
JoinedAt: z8.string()
|
|
785
|
+
})),
|
|
786
|
+
State: z8.string(),
|
|
787
|
+
PreviousState: z8.string(),
|
|
788
|
+
StateTransitionReason: z8.string(),
|
|
789
|
+
Accessibility: z8.string(),
|
|
790
|
+
CustomGameData: z8.object({
|
|
791
|
+
Settings: z8.object({
|
|
792
|
+
Map: z8.string(),
|
|
793
|
+
Mode: z8.string(),
|
|
794
|
+
UseBots: z8.boolean(),
|
|
795
|
+
GamePod: z8.string(),
|
|
796
|
+
GameRules: z8.record(z8.string(), z8.string()).nullable(),
|
|
797
|
+
EsportsCustomLobbyName: z8.string()
|
|
798
|
+
}),
|
|
799
|
+
Membership: z8.object({
|
|
800
|
+
teamOne: customGameTeam,
|
|
801
|
+
teamTwo: customGameTeam,
|
|
802
|
+
teamSpectate: customGameTeam,
|
|
803
|
+
teamOneCoaches: customGameTeam,
|
|
804
|
+
teamTwoCoaches: customGameTeam
|
|
805
|
+
}),
|
|
806
|
+
MaxPartySize: z8.number(),
|
|
807
|
+
AutobalanceEnabled: z8.boolean(),
|
|
808
|
+
AutobalanceMinPlayers: z8.number(),
|
|
809
|
+
HasRecoveryData: z8.boolean()
|
|
810
|
+
}),
|
|
811
|
+
MatchmakingData: z8.object({
|
|
812
|
+
QueueID: z8.string(),
|
|
813
|
+
PreferredGamePods: z8.array(z8.string()),
|
|
814
|
+
SkillDisparityRRPenalty: z8.number(),
|
|
815
|
+
MaxPartySize: z8.number()
|
|
816
|
+
}),
|
|
817
|
+
QueueEntryTime: z8.string(),
|
|
818
|
+
EstimatedQueueTimeSeconds: z8.number(),
|
|
819
|
+
ErrorNotification: z8.object({
|
|
820
|
+
ErrorType: z8.string()
|
|
821
|
+
}).optional(),
|
|
822
|
+
RestrictedSeconds: z8.number(),
|
|
823
|
+
EligibleQueues: z8.array(z8.string()),
|
|
824
|
+
CheatData: z8.object({
|
|
825
|
+
GamePodOverride: z8.string(),
|
|
826
|
+
ForcePostGameProcessing: z8.boolean()
|
|
827
|
+
}),
|
|
828
|
+
InviteCode: z8.string()
|
|
829
|
+
});
|
|
830
|
+
var setCustomGameTeamEndpoint = {
|
|
831
|
+
name: "Set Custom Game Team",
|
|
832
|
+
description: "Moves a player to a team of the custom game. Only the party owner can move other players. `team` is `TeamOne` or `TeamTwo`. Resolves to the updated party, whose `CustomGameData.Membership` lists the players of each team.",
|
|
833
|
+
queryName: "Party_ChangeTeamInCustomGame",
|
|
834
|
+
category: "Party Endpoints",
|
|
835
|
+
type: "glz",
|
|
836
|
+
method: "POST",
|
|
837
|
+
suffix: "parties/v1/parties/{party id}/customgamemembership/{team}",
|
|
838
|
+
headers: /* @__PURE__ */ new Map([["Content-Type", "application/json"]]),
|
|
839
|
+
body: z8.object({ playerToPutOnTeam: z8.string().describe("PUUID of the player to move") }),
|
|
840
|
+
riotRequirements: player,
|
|
841
|
+
responses: { "200": customGameParty }
|
|
842
|
+
};
|
|
843
|
+
var customGamePartyEndpoint = {
|
|
844
|
+
name: "Custom Game Party",
|
|
845
|
+
description: "The party of a custom game lobby: members, teams (`CustomGameData.Membership`), map, mode and rules. Typed for custom game lobbies. `party.get` is the general version.",
|
|
846
|
+
queryName: "Party_FetchParty",
|
|
847
|
+
category: "Party Endpoints",
|
|
848
|
+
type: "glz",
|
|
849
|
+
suffix: "parties/v1/parties/{party id}",
|
|
850
|
+
riotRequirements: player,
|
|
851
|
+
responses: { "200": customGameParty }
|
|
852
|
+
};
|
|
853
|
+
var partyResponse = customGameParty.extend({ CustomGameData: customGameParty.shape.CustomGameData.optional() });
|
|
854
|
+
var partyGenerateCodeEndpoint = withResponse(e5.partyGenerateCodeEndpoint, customGameParty);
|
|
855
|
+
var partyDisableCodeEndpoint = withResponse(e5.partyDisableCodeEndpoint, customGameParty);
|
|
856
|
+
var setPartyAccessibilityEndpoint = withResponse(e5.setPartyAccessibilityEndpoint, customGameParty);
|
|
857
|
+
var startCustomGameEndpoint = withResponse(e5.startCustomGameEndpoint, customGameParty);
|
|
858
|
+
var setCustomGameSettingsEndpoint = withResponse(e5.setCustomGameSettingsEndpoint, customGameParty);
|
|
859
|
+
var partyEndpoint = withResponse(e5.partyEndpoint, partyResponse);
|
|
860
|
+
var changeQueueEndpoint = withResponse(e5.changeQueueEndpoint, partyResponse);
|
|
861
|
+
var enterMatchmakingQueueEndpoint = withResponse(e5.enterMatchmakingQueueEndpoint, partyResponse);
|
|
862
|
+
var leaveMatchmakingQueueEndpoint = withResponse(e5.leaveMatchmakingQueueEndpoint, partyResponse);
|
|
863
|
+
var partyDeclineEndpoint = withResponse(e5.partyDeclineEndpoint, partyResponse);
|
|
864
|
+
var partyInviteEndpoint = withResponse(e5.partyInviteEndpoint, partyResponse);
|
|
865
|
+
var partySetMemberReadyEndpoint = withResponse(e5.partySetMemberReadyEndpoint, partyResponse);
|
|
866
|
+
var refreshCompetitiveTierEndpoint = withResponse(e5.refreshCompetitiveTierEndpoint, partyResponse);
|
|
867
|
+
var refreshPlayerIdentityEndpoint = withResponse(e5.refreshPlayerIdentityEndpoint, partyResponse);
|
|
868
|
+
var refreshPingsEndpoint = withResponse(e5.refreshPingsEndpoint, partyResponse);
|
|
869
|
+
|
|
870
|
+
// src/endpoints/riot/pregame.ts
|
|
871
|
+
import { endpoints as e6 } from "valorant-api-types";
|
|
872
|
+
import { z as z9 } from "zod";
|
|
873
|
+
var pregameMatchEndpoint = withResponse(e6.pregameMatchEndpoint, z9.object({
|
|
874
|
+
ID: z9.string(),
|
|
875
|
+
Version: z9.number(),
|
|
876
|
+
Teams: z9.array(z9.object({
|
|
877
|
+
TeamID: z9.string(),
|
|
878
|
+
TeamNumber: z9.number(),
|
|
879
|
+
Players: z9.array(z9.object({
|
|
880
|
+
Subject: z9.string(),
|
|
881
|
+
CharacterID: z9.string(),
|
|
882
|
+
CharacterSelectionState: z9.string(),
|
|
883
|
+
PregamePlayerState: z9.string(),
|
|
884
|
+
CompetitiveTier: z9.number(),
|
|
885
|
+
PlayerIdentity: z9.object({
|
|
886
|
+
Subject: z9.string(),
|
|
887
|
+
PlayerCardID: z9.string(),
|
|
888
|
+
PlayerTitleID: z9.string(),
|
|
889
|
+
AccountLevel: z9.number(),
|
|
890
|
+
PreferredLevelBorderID: z9.string(),
|
|
891
|
+
Incognito: z9.boolean(),
|
|
892
|
+
HideAccountLevel: z9.boolean()
|
|
893
|
+
}),
|
|
894
|
+
SeasonalBadgeInfo: z9.object({
|
|
895
|
+
SeasonID: z9.string(),
|
|
896
|
+
NumberOfWins: z9.number(),
|
|
897
|
+
Rank: z9.number(),
|
|
898
|
+
LeaderboardRank: z9.number()
|
|
899
|
+
}),
|
|
900
|
+
IsCaptain: z9.boolean(),
|
|
901
|
+
PlatformType: z9.string(),
|
|
902
|
+
PremierPrestige: z9.object({})
|
|
903
|
+
}))
|
|
904
|
+
})),
|
|
905
|
+
AllyTeam: z9.object({
|
|
906
|
+
TeamID: z9.string(),
|
|
907
|
+
TeamNumber: z9.number(),
|
|
908
|
+
Players: z9.array(z9.object({
|
|
909
|
+
Subject: z9.string(),
|
|
910
|
+
CharacterID: z9.string(),
|
|
911
|
+
CharacterSelectionState: z9.string(),
|
|
912
|
+
PregamePlayerState: z9.string(),
|
|
913
|
+
CompetitiveTier: z9.number(),
|
|
914
|
+
PlayerIdentity: z9.object({
|
|
915
|
+
Subject: z9.string(),
|
|
916
|
+
PlayerCardID: z9.string(),
|
|
917
|
+
PlayerTitleID: z9.string(),
|
|
918
|
+
AccountLevel: z9.number(),
|
|
919
|
+
PreferredLevelBorderID: z9.string(),
|
|
920
|
+
Incognito: z9.boolean(),
|
|
921
|
+
HideAccountLevel: z9.boolean()
|
|
922
|
+
}),
|
|
923
|
+
SeasonalBadgeInfo: z9.object({
|
|
924
|
+
SeasonID: z9.string(),
|
|
925
|
+
NumberOfWins: z9.number(),
|
|
926
|
+
Rank: z9.number(),
|
|
927
|
+
LeaderboardRank: z9.number()
|
|
928
|
+
}),
|
|
929
|
+
IsCaptain: z9.boolean(),
|
|
930
|
+
PlatformType: z9.string(),
|
|
931
|
+
PremierPrestige: z9.object({})
|
|
932
|
+
}))
|
|
933
|
+
}),
|
|
934
|
+
EnemyTeamSize: z9.number(),
|
|
935
|
+
EnemyTeamLockCount: z9.number(),
|
|
936
|
+
PregameState: z9.string(),
|
|
937
|
+
LastUpdated: z9.string(),
|
|
938
|
+
MapID: z9.string(),
|
|
939
|
+
CastedVotes: z9.object({}),
|
|
940
|
+
MapSelectStep: z9.number(),
|
|
941
|
+
Team1: z9.string(),
|
|
942
|
+
GamePodID: z9.string(),
|
|
943
|
+
Mode: z9.string(),
|
|
944
|
+
VoiceSessionID: z9.string(),
|
|
945
|
+
MUCName: z9.string(),
|
|
946
|
+
TeamMatchToken: z9.string(),
|
|
947
|
+
QueueID: z9.string(),
|
|
948
|
+
ProvisioningFlowID: z9.string(),
|
|
949
|
+
IsRanked: z9.boolean(),
|
|
950
|
+
PhaseTimeRemainingNS: z9.number(),
|
|
951
|
+
StepTimeRemainingNS: z9.number(),
|
|
952
|
+
altModesFlagADA: z9.boolean(),
|
|
953
|
+
/** Rules of the match by name. Only the rules the lobby set are present. */
|
|
954
|
+
GameRules: z9.record(z9.string(), z9.string())
|
|
955
|
+
}));
|
|
956
|
+
var pregameLoadoutsEndpoint = withResponse(e6.pregameLoadoutsEndpoint, z9.object({
|
|
957
|
+
Loadouts: z9.array(z9.object({
|
|
958
|
+
Subject: z9.string(),
|
|
959
|
+
Expressions: z9.object({
|
|
960
|
+
AESSelections: z9.array(z9.object({
|
|
961
|
+
AssetID: z9.string(),
|
|
962
|
+
TypeID: z9.string()
|
|
963
|
+
}))
|
|
964
|
+
}),
|
|
965
|
+
DynamicOptions: z9.object({}),
|
|
966
|
+
Items: z9.record(z9.string(), z9.object({
|
|
967
|
+
ID: z9.string(),
|
|
968
|
+
TypeID: z9.string(),
|
|
969
|
+
Sockets: z9.record(z9.string(), z9.object({
|
|
970
|
+
ID: z9.string(),
|
|
971
|
+
Item: z9.object({
|
|
972
|
+
ID: z9.string(),
|
|
973
|
+
TypeID: z9.string()
|
|
974
|
+
})
|
|
975
|
+
}))
|
|
976
|
+
}))
|
|
977
|
+
})),
|
|
978
|
+
LoadoutsValid: z9.boolean()
|
|
979
|
+
}));
|
|
980
|
+
|
|
981
|
+
// src/endpoints/riot/premier.ts
|
|
982
|
+
import { z as z10 } from "zod";
|
|
983
|
+
var premierSeasonsEndpoint = {
|
|
984
|
+
name: "Premier Seasons",
|
|
985
|
+
description: "All Premier seasons of the shard. The affinity in the path is the region of the context.",
|
|
986
|
+
category: "Premier Endpoints",
|
|
987
|
+
type: "pd",
|
|
988
|
+
suffix: "premier/v1/affinities/{region}/premier-seasons",
|
|
989
|
+
riotRequirements: player,
|
|
990
|
+
responses: { "200": z10.object({
|
|
991
|
+
PremierSeasons: z10.array(z10.object({
|
|
992
|
+
ID: z10.string(),
|
|
993
|
+
Name: z10.string(),
|
|
994
|
+
PreviousPremierSeasonID: z10.string(),
|
|
995
|
+
NextPremierSeasonID: z10.string(),
|
|
996
|
+
IsActive: z10.boolean(),
|
|
997
|
+
StartTime: z10.string(),
|
|
998
|
+
EndTime: z10.string(),
|
|
999
|
+
Events: z10.array(z10.object({
|
|
1000
|
+
ID: z10.string(),
|
|
1001
|
+
Type: z10.string(),
|
|
1002
|
+
StartDateTime: z10.string(),
|
|
1003
|
+
EndDateTime: z10.string(),
|
|
1004
|
+
MapSelectionStrategy: z10.string(),
|
|
1005
|
+
MapPoolMapIDs: z10.array(z10.string()),
|
|
1006
|
+
PointsRequiredToParticipate: z10.number()
|
|
1007
|
+
})),
|
|
1008
|
+
ScheduledEvents: z10.array(z10.object({
|
|
1009
|
+
EventID: z10.string(),
|
|
1010
|
+
EventType: z10.string(),
|
|
1011
|
+
Conference: z10.string(),
|
|
1012
|
+
DivisionGroup: z10.string(),
|
|
1013
|
+
EventPresetName: z10.string(),
|
|
1014
|
+
StartDateTime: z10.string(),
|
|
1015
|
+
EndDateTime: z10.string(),
|
|
1016
|
+
TournamentRoundTimes: z10.array(z10.object({
|
|
1017
|
+
StartDateTime: z10.string(),
|
|
1018
|
+
EndDateTime: z10.string()
|
|
1019
|
+
}))
|
|
1020
|
+
})),
|
|
1021
|
+
Conferences: z10.array(z10.object({
|
|
1022
|
+
id: z10.string(),
|
|
1023
|
+
key: z10.string(),
|
|
1024
|
+
isSuper: z10.boolean(),
|
|
1025
|
+
gamePods: z10.array(z10.string()),
|
|
1026
|
+
timezone: z10.string(),
|
|
1027
|
+
superConference: z10.string().optional(),
|
|
1028
|
+
leaderboardPlayoffQualificationDateTime: z10.string(),
|
|
1029
|
+
leaderboardPromotionFinalizationDateTime: z10.string()
|
|
1030
|
+
})),
|
|
1031
|
+
Divisions: z10.array(z10.object({
|
|
1032
|
+
Division: z10.number(),
|
|
1033
|
+
DivisionName: z10.string(),
|
|
1034
|
+
DivisionGroup: z10.string(),
|
|
1035
|
+
EventPresetName: z10.string()
|
|
1036
|
+
})),
|
|
1037
|
+
DivisionThresholds: z10.array(z10.object({
|
|
1038
|
+
playoffThresholdType: z10.string(),
|
|
1039
|
+
playoffThresholdValue: z10.number(),
|
|
1040
|
+
promotionThresholdType: z10.string(),
|
|
1041
|
+
promotionThresholdValue: z10.number(),
|
|
1042
|
+
shouldPromoteToSuperConference: z10.boolean(),
|
|
1043
|
+
skipReseedCriteria: z10.string(),
|
|
1044
|
+
conference: z10.string().optional(),
|
|
1045
|
+
division: z10.number().optional(),
|
|
1046
|
+
promotionConference: z10.string().optional(),
|
|
1047
|
+
skipReseedCriteriaValue: z10.number().optional()
|
|
1048
|
+
})),
|
|
1049
|
+
EventPresets: z10.object({
|
|
1050
|
+
PRO: z10.object({
|
|
1051
|
+
EventPresetsByEventType: z10.object({
|
|
1052
|
+
LEAGUE: z10.object({
|
|
1053
|
+
EventPresetName: z10.string(),
|
|
1054
|
+
eventType: z10.string(),
|
|
1055
|
+
bestOfN: z10.number(),
|
|
1056
|
+
matchmakingStrategy: z10.string(),
|
|
1057
|
+
queueID: z10.string(),
|
|
1058
|
+
pointsConfig: z10.object({
|
|
1059
|
+
PointsForWin: z10.number(),
|
|
1060
|
+
PointsForLoss: z10.number()
|
|
1061
|
+
})
|
|
1062
|
+
}),
|
|
1063
|
+
SCRIM: z10.object({
|
|
1064
|
+
EventPresetName: z10.string(),
|
|
1065
|
+
eventType: z10.string(),
|
|
1066
|
+
bestOfN: z10.number(),
|
|
1067
|
+
matchmakingStrategy: z10.string(),
|
|
1068
|
+
queueID: z10.string(),
|
|
1069
|
+
pointsConfig: z10.object({
|
|
1070
|
+
PointsForWin: z10.number(),
|
|
1071
|
+
PointsForLoss: z10.number()
|
|
1072
|
+
})
|
|
1073
|
+
}),
|
|
1074
|
+
TOURNAMENT: z10.object({
|
|
1075
|
+
EventPresetName: z10.string(),
|
|
1076
|
+
eventType: z10.string(),
|
|
1077
|
+
bestOfN: z10.number(),
|
|
1078
|
+
matchmakingStrategy: z10.string(),
|
|
1079
|
+
queueID: z10.string(),
|
|
1080
|
+
pointsConfig: z10.object({
|
|
1081
|
+
PointsForWin: z10.number(),
|
|
1082
|
+
PointsForLoss: z10.number()
|
|
1083
|
+
})
|
|
1084
|
+
})
|
|
1085
|
+
})
|
|
1086
|
+
}),
|
|
1087
|
+
REGULAR: z10.object({
|
|
1088
|
+
EventPresetsByEventType: z10.object({
|
|
1089
|
+
LEAGUE: z10.object({
|
|
1090
|
+
EventPresetName: z10.string(),
|
|
1091
|
+
eventType: z10.string(),
|
|
1092
|
+
bestOfN: z10.number(),
|
|
1093
|
+
matchmakingStrategy: z10.string(),
|
|
1094
|
+
queueID: z10.string(),
|
|
1095
|
+
pointsConfig: z10.object({
|
|
1096
|
+
PointsForWin: z10.number(),
|
|
1097
|
+
PointsForLoss: z10.number()
|
|
1098
|
+
})
|
|
1099
|
+
}),
|
|
1100
|
+
SCRIM: z10.object({
|
|
1101
|
+
EventPresetName: z10.string(),
|
|
1102
|
+
eventType: z10.string(),
|
|
1103
|
+
bestOfN: z10.number(),
|
|
1104
|
+
matchmakingStrategy: z10.string(),
|
|
1105
|
+
queueID: z10.string(),
|
|
1106
|
+
pointsConfig: z10.object({
|
|
1107
|
+
PointsForWin: z10.number(),
|
|
1108
|
+
PointsForLoss: z10.number()
|
|
1109
|
+
})
|
|
1110
|
+
}),
|
|
1111
|
+
TOURNAMENT: z10.object({
|
|
1112
|
+
EventPresetName: z10.string(),
|
|
1113
|
+
eventType: z10.string(),
|
|
1114
|
+
bestOfN: z10.number(),
|
|
1115
|
+
matchmakingStrategy: z10.string(),
|
|
1116
|
+
queueID: z10.string(),
|
|
1117
|
+
pointsConfig: z10.object({
|
|
1118
|
+
PointsForWin: z10.number(),
|
|
1119
|
+
PointsForLoss: z10.number()
|
|
1120
|
+
})
|
|
1121
|
+
})
|
|
1122
|
+
})
|
|
1123
|
+
})
|
|
1124
|
+
}),
|
|
1125
|
+
FlawlessPointRequirement: z10.number(),
|
|
1126
|
+
ChampionshipPointRequirement: z10.number(),
|
|
1127
|
+
ChampionshipEventID: z10.string(),
|
|
1128
|
+
EnrollmentPhaseStartDateTime: z10.string(),
|
|
1129
|
+
EnrollmentPhaseEndDateTime: z10.string(),
|
|
1130
|
+
LeaderboardPlayoffQualificationDateTime: z10.string(),
|
|
1131
|
+
LeaderboardPromotionFinalizationDateTime: z10.string(),
|
|
1132
|
+
LeaderboardFinalizationDateTime: z10.string(),
|
|
1133
|
+
ContenderEligibilityExpiryDateTime: z10.string(),
|
|
1134
|
+
StageLockTime: z10.string(),
|
|
1135
|
+
ParticipationRewardsActIDs: z10.array(z10.string()),
|
|
1136
|
+
ParticipationRewards: z10.object({
|
|
1137
|
+
EntitlementRewards: z10.array(z10.object({
|
|
1138
|
+
ItemTypeID: z10.string(),
|
|
1139
|
+
ItemID: z10.string(),
|
|
1140
|
+
Amount: z10.number()
|
|
1141
|
+
}))
|
|
1142
|
+
}),
|
|
1143
|
+
TournamentWinnerRewards: z10.object({}),
|
|
1144
|
+
DivisionWinnerRewards: z10.object({
|
|
1145
|
+
ADVANCED: z10.object({
|
|
1146
|
+
EntitlementRewards: z10.array(z10.object({
|
|
1147
|
+
ItemTypeID: z10.string(),
|
|
1148
|
+
ItemID: z10.string(),
|
|
1149
|
+
Amount: z10.number()
|
|
1150
|
+
}))
|
|
1151
|
+
}).optional(),
|
|
1152
|
+
CONTENDER: z10.object({
|
|
1153
|
+
EntitlementRewards: z10.array(z10.object({
|
|
1154
|
+
ItemTypeID: z10.string(),
|
|
1155
|
+
ItemID: z10.string(),
|
|
1156
|
+
Amount: z10.number()
|
|
1157
|
+
}))
|
|
1158
|
+
}).optional(),
|
|
1159
|
+
ELITE: z10.object({
|
|
1160
|
+
EntitlementRewards: z10.array(z10.object({
|
|
1161
|
+
ItemTypeID: z10.string(),
|
|
1162
|
+
ItemID: z10.string(),
|
|
1163
|
+
Amount: z10.number()
|
|
1164
|
+
}))
|
|
1165
|
+
}).optional(),
|
|
1166
|
+
INTERMEDIATE: z10.object({
|
|
1167
|
+
EntitlementRewards: z10.array(z10.object({
|
|
1168
|
+
ItemTypeID: z10.string(),
|
|
1169
|
+
ItemID: z10.string(),
|
|
1170
|
+
Amount: z10.number()
|
|
1171
|
+
}))
|
|
1172
|
+
}).optional(),
|
|
1173
|
+
OPEN: z10.object({
|
|
1174
|
+
EntitlementRewards: z10.array(z10.object({
|
|
1175
|
+
ItemTypeID: z10.string(),
|
|
1176
|
+
ItemID: z10.string(),
|
|
1177
|
+
Amount: z10.number()
|
|
1178
|
+
}))
|
|
1179
|
+
}).optional(),
|
|
1180
|
+
INVITE: z10.object({
|
|
1181
|
+
EntitlementRewards: z10.array(z10.object({
|
|
1182
|
+
ItemTypeID: z10.string(),
|
|
1183
|
+
ItemID: z10.string(),
|
|
1184
|
+
Amount: z10.number()
|
|
1185
|
+
}))
|
|
1186
|
+
}).optional()
|
|
1187
|
+
}),
|
|
1188
|
+
RosterRecentActivityNumSeasons: z10.number()
|
|
1189
|
+
}))
|
|
1190
|
+
}) }
|
|
1191
|
+
};
|
|
1192
|
+
var premierActiveSeasonEndpoint = {
|
|
1193
|
+
name: "Premier Active Season",
|
|
1194
|
+
description: "The Premier season that is running now.",
|
|
1195
|
+
category: "Premier Endpoints",
|
|
1196
|
+
type: "pd",
|
|
1197
|
+
suffix: "premier/v1/affinities/{region}/premier-seasons/active",
|
|
1198
|
+
riotRequirements: player,
|
|
1199
|
+
responses: { "200": z10.object({
|
|
1200
|
+
ID: z10.string(),
|
|
1201
|
+
Name: z10.string(),
|
|
1202
|
+
PreviousPremierSeasonID: z10.string(),
|
|
1203
|
+
NextPremierSeasonID: z10.string(),
|
|
1204
|
+
IsActive: z10.boolean(),
|
|
1205
|
+
StartTime: z10.string(),
|
|
1206
|
+
EndTime: z10.string(),
|
|
1207
|
+
Events: z10.array(z10.object({
|
|
1208
|
+
ID: z10.string(),
|
|
1209
|
+
Type: z10.string(),
|
|
1210
|
+
StartDateTime: z10.string(),
|
|
1211
|
+
EndDateTime: z10.string(),
|
|
1212
|
+
MapSelectionStrategy: z10.string(),
|
|
1213
|
+
MapPoolMapIDs: z10.array(z10.string()),
|
|
1214
|
+
PointsRequiredToParticipate: z10.number()
|
|
1215
|
+
})),
|
|
1216
|
+
ScheduledEvents: z10.array(z10.object({
|
|
1217
|
+
EventID: z10.string(),
|
|
1218
|
+
EventType: z10.string(),
|
|
1219
|
+
Conference: z10.string(),
|
|
1220
|
+
DivisionGroup: z10.string(),
|
|
1221
|
+
EventPresetName: z10.string(),
|
|
1222
|
+
StartDateTime: z10.string(),
|
|
1223
|
+
EndDateTime: z10.string(),
|
|
1224
|
+
TournamentRoundTimes: z10.array(z10.object({
|
|
1225
|
+
StartDateTime: z10.string(),
|
|
1226
|
+
EndDateTime: z10.string()
|
|
1227
|
+
}))
|
|
1228
|
+
})),
|
|
1229
|
+
Conferences: z10.array(z10.object({
|
|
1230
|
+
id: z10.string(),
|
|
1231
|
+
key: z10.string(),
|
|
1232
|
+
isSuper: z10.boolean(),
|
|
1233
|
+
gamePods: z10.array(z10.string()),
|
|
1234
|
+
timezone: z10.string(),
|
|
1235
|
+
superConference: z10.string().optional(),
|
|
1236
|
+
leaderboardPlayoffQualificationDateTime: z10.string(),
|
|
1237
|
+
leaderboardPromotionFinalizationDateTime: z10.string()
|
|
1238
|
+
})),
|
|
1239
|
+
Divisions: z10.array(z10.object({
|
|
1240
|
+
Division: z10.number(),
|
|
1241
|
+
DivisionName: z10.string(),
|
|
1242
|
+
DivisionGroup: z10.string(),
|
|
1243
|
+
EventPresetName: z10.string()
|
|
1244
|
+
})),
|
|
1245
|
+
DivisionThresholds: z10.array(z10.object({
|
|
1246
|
+
playoffThresholdType: z10.string(),
|
|
1247
|
+
playoffThresholdValue: z10.number(),
|
|
1248
|
+
promotionThresholdType: z10.string(),
|
|
1249
|
+
promotionThresholdValue: z10.number(),
|
|
1250
|
+
shouldPromoteToSuperConference: z10.boolean(),
|
|
1251
|
+
skipReseedCriteria: z10.string(),
|
|
1252
|
+
conference: z10.string().optional(),
|
|
1253
|
+
division: z10.number().optional(),
|
|
1254
|
+
promotionConference: z10.string().optional(),
|
|
1255
|
+
skipReseedCriteriaValue: z10.number().optional()
|
|
1256
|
+
})),
|
|
1257
|
+
EventPresets: z10.object({
|
|
1258
|
+
PRO: z10.object({
|
|
1259
|
+
EventPresetsByEventType: z10.object({
|
|
1260
|
+
LEAGUE: z10.object({
|
|
1261
|
+
EventPresetName: z10.string(),
|
|
1262
|
+
eventType: z10.string(),
|
|
1263
|
+
bestOfN: z10.number(),
|
|
1264
|
+
matchmakingStrategy: z10.string(),
|
|
1265
|
+
queueID: z10.string(),
|
|
1266
|
+
pointsConfig: z10.object({
|
|
1267
|
+
PointsForWin: z10.number(),
|
|
1268
|
+
PointsForLoss: z10.number()
|
|
1269
|
+
})
|
|
1270
|
+
}),
|
|
1271
|
+
SCRIM: z10.object({
|
|
1272
|
+
EventPresetName: z10.string(),
|
|
1273
|
+
eventType: z10.string(),
|
|
1274
|
+
bestOfN: z10.number(),
|
|
1275
|
+
matchmakingStrategy: z10.string(),
|
|
1276
|
+
queueID: z10.string(),
|
|
1277
|
+
pointsConfig: z10.object({
|
|
1278
|
+
PointsForWin: z10.number(),
|
|
1279
|
+
PointsForLoss: z10.number()
|
|
1280
|
+
})
|
|
1281
|
+
}),
|
|
1282
|
+
TOURNAMENT: z10.object({
|
|
1283
|
+
EventPresetName: z10.string(),
|
|
1284
|
+
eventType: z10.string(),
|
|
1285
|
+
bestOfN: z10.number(),
|
|
1286
|
+
matchmakingStrategy: z10.string(),
|
|
1287
|
+
queueID: z10.string(),
|
|
1288
|
+
pointsConfig: z10.object({
|
|
1289
|
+
PointsForWin: z10.number(),
|
|
1290
|
+
PointsForLoss: z10.number()
|
|
1291
|
+
})
|
|
1292
|
+
})
|
|
1293
|
+
})
|
|
1294
|
+
}),
|
|
1295
|
+
REGULAR: z10.object({
|
|
1296
|
+
EventPresetsByEventType: z10.object({
|
|
1297
|
+
LEAGUE: z10.object({
|
|
1298
|
+
EventPresetName: z10.string(),
|
|
1299
|
+
eventType: z10.string(),
|
|
1300
|
+
bestOfN: z10.number(),
|
|
1301
|
+
matchmakingStrategy: z10.string(),
|
|
1302
|
+
queueID: z10.string(),
|
|
1303
|
+
pointsConfig: z10.object({
|
|
1304
|
+
PointsForWin: z10.number(),
|
|
1305
|
+
PointsForLoss: z10.number()
|
|
1306
|
+
})
|
|
1307
|
+
}),
|
|
1308
|
+
SCRIM: z10.object({
|
|
1309
|
+
EventPresetName: z10.string(),
|
|
1310
|
+
eventType: z10.string(),
|
|
1311
|
+
bestOfN: z10.number(),
|
|
1312
|
+
matchmakingStrategy: z10.string(),
|
|
1313
|
+
queueID: z10.string(),
|
|
1314
|
+
pointsConfig: z10.object({
|
|
1315
|
+
PointsForWin: z10.number(),
|
|
1316
|
+
PointsForLoss: z10.number()
|
|
1317
|
+
})
|
|
1318
|
+
}),
|
|
1319
|
+
TOURNAMENT: z10.object({
|
|
1320
|
+
EventPresetName: z10.string(),
|
|
1321
|
+
eventType: z10.string(),
|
|
1322
|
+
bestOfN: z10.number(),
|
|
1323
|
+
matchmakingStrategy: z10.string(),
|
|
1324
|
+
queueID: z10.string(),
|
|
1325
|
+
pointsConfig: z10.object({
|
|
1326
|
+
PointsForWin: z10.number(),
|
|
1327
|
+
PointsForLoss: z10.number()
|
|
1328
|
+
})
|
|
1329
|
+
})
|
|
1330
|
+
})
|
|
1331
|
+
})
|
|
1332
|
+
}),
|
|
1333
|
+
FlawlessPointRequirement: z10.number(),
|
|
1334
|
+
ChampionshipPointRequirement: z10.number(),
|
|
1335
|
+
ChampionshipEventID: z10.string(),
|
|
1336
|
+
EnrollmentPhaseStartDateTime: z10.string(),
|
|
1337
|
+
EnrollmentPhaseEndDateTime: z10.string(),
|
|
1338
|
+
LeaderboardPlayoffQualificationDateTime: z10.string(),
|
|
1339
|
+
LeaderboardPromotionFinalizationDateTime: z10.string(),
|
|
1340
|
+
LeaderboardFinalizationDateTime: z10.string(),
|
|
1341
|
+
ContenderEligibilityExpiryDateTime: z10.string(),
|
|
1342
|
+
StageLockTime: z10.string(),
|
|
1343
|
+
ParticipationRewards: z10.object({}),
|
|
1344
|
+
TournamentWinnerRewards: z10.object({}),
|
|
1345
|
+
DivisionWinnerRewards: z10.object({}),
|
|
1346
|
+
RosterRecentActivityNumSeasons: z10.number()
|
|
1347
|
+
}) }
|
|
1348
|
+
};
|
|
1349
|
+
var premierConferencesEndpoint = {
|
|
1350
|
+
name: "Premier Conferences",
|
|
1351
|
+
description: "Premier conferences of the region.",
|
|
1352
|
+
category: "Premier Endpoints",
|
|
1353
|
+
type: "pd",
|
|
1354
|
+
suffix: "premier/v1/affinities/{region}/conferences",
|
|
1355
|
+
riotRequirements: player,
|
|
1356
|
+
responses: { "200": z10.object({
|
|
1357
|
+
PremierConferences: z10.array(z10.object({
|
|
1358
|
+
id: z10.string(),
|
|
1359
|
+
key: z10.string(),
|
|
1360
|
+
isSuper: z10.boolean(),
|
|
1361
|
+
gamePods: z10.array(z10.string()),
|
|
1362
|
+
timezone: z10.string(),
|
|
1363
|
+
superConference: z10.string().optional(),
|
|
1364
|
+
leaderboardPlayoffQualificationDateTime: z10.string(),
|
|
1365
|
+
leaderboardPromotionFinalizationDateTime: z10.string()
|
|
1366
|
+
}))
|
|
1367
|
+
}) }
|
|
1368
|
+
};
|
|
1369
|
+
var premierMatchLimitEndpoint = {
|
|
1370
|
+
name: "Premier Match Limit",
|
|
1371
|
+
description: "How many Premier matches can still be played and when the limit resets.",
|
|
1372
|
+
category: "Premier Endpoints",
|
|
1373
|
+
type: "pd",
|
|
1374
|
+
suffix: "premier/v1/matchlimitinfo",
|
|
1375
|
+
riotRequirements: player,
|
|
1376
|
+
responses: { "200": z10.object({
|
|
1377
|
+
leagueMatchLimit: z10.number(),
|
|
1378
|
+
tournamentLimit: z10.number(),
|
|
1379
|
+
timeUntilNextResetSeconds: z10.number()
|
|
1380
|
+
}) }
|
|
1381
|
+
};
|
|
1382
|
+
var premierEligibilityEndpoint = {
|
|
1383
|
+
name: "Premier Eligibility",
|
|
1384
|
+
description: "Whether the player can join a Premier roster.",
|
|
1385
|
+
category: "Premier Endpoints",
|
|
1386
|
+
type: "pd",
|
|
1387
|
+
suffix: "premier/v1/player/eligibility",
|
|
1388
|
+
riotRequirements: player,
|
|
1389
|
+
responses: { "200": z10.object({
|
|
1390
|
+
subject: z10.string(),
|
|
1391
|
+
accountVerificationStatus: z10.boolean(),
|
|
1392
|
+
rankedPlacementCompletionStatus: z10.boolean(),
|
|
1393
|
+
matchLimitReached: z10.boolean(),
|
|
1394
|
+
isOnProvidedRoster: z10.boolean()
|
|
1395
|
+
}) }
|
|
1396
|
+
};
|
|
1397
|
+
var premierPlayerV2Endpoint = {
|
|
1398
|
+
name: "Premier Player V2",
|
|
1399
|
+
description: "Premier membership of a player: roster id and pending invites.",
|
|
1400
|
+
category: "Premier Endpoints",
|
|
1401
|
+
type: "pd",
|
|
1402
|
+
suffix: "premier/v2/players/{puuid}",
|
|
1403
|
+
riotRequirements: player,
|
|
1404
|
+
responses: { "200": z10.object({
|
|
1405
|
+
puuid: z10.string(),
|
|
1406
|
+
rosterId: z10.string(),
|
|
1407
|
+
version: z10.number(),
|
|
1408
|
+
createdAt: z10.number(),
|
|
1409
|
+
updatedAt: z10.number()
|
|
1410
|
+
}) }
|
|
1411
|
+
};
|
|
1412
|
+
var premierPlayerV3Endpoint = {
|
|
1413
|
+
name: "Premier Player V3",
|
|
1414
|
+
description: "Like v2, with prestige and contender eligibility.",
|
|
1415
|
+
category: "Premier Endpoints",
|
|
1416
|
+
type: "pd",
|
|
1417
|
+
suffix: "premier/v3/players/{puuid}",
|
|
1418
|
+
riotRequirements: player,
|
|
1419
|
+
responses: { "200": z10.object({
|
|
1420
|
+
puuid: z10.string(),
|
|
1421
|
+
rosterId: z10.string(),
|
|
1422
|
+
prestige: z10.object({
|
|
1423
|
+
earnedPrestige: z10.boolean(),
|
|
1424
|
+
earnedAura: z10.boolean(),
|
|
1425
|
+
showTag: z10.boolean(),
|
|
1426
|
+
showPlating: z10.boolean(),
|
|
1427
|
+
showAura: z10.boolean()
|
|
1428
|
+
}),
|
|
1429
|
+
contenderEligibilityExpiry: z10.string(),
|
|
1430
|
+
socialVersion: z10.number(),
|
|
1431
|
+
premierVersion: z10.number(),
|
|
1432
|
+
updatedAt: z10.number(),
|
|
1433
|
+
seasons: z10.object({
|
|
1434
|
+
"08d281c5-4426-3aaa-3316-ebaf5f2c858a": z10.object({
|
|
1435
|
+
seasonId: z10.string(),
|
|
1436
|
+
hasEarnedPrestigeAura: z10.boolean(),
|
|
1437
|
+
hasEarnedParticipation: z10.boolean(),
|
|
1438
|
+
hasEarnedDivisionWinner: z10.boolean()
|
|
1439
|
+
}),
|
|
1440
|
+
"91be4c20-439d-8e24-f577-4ca8a98e8dc8": z10.object({
|
|
1441
|
+
seasonId: z10.string(),
|
|
1442
|
+
hasEarnedPrestigeAura: z10.boolean(),
|
|
1443
|
+
hasEarnedParticipation: z10.boolean(),
|
|
1444
|
+
hasEarnedDivisionWinner: z10.boolean()
|
|
1445
|
+
})
|
|
1446
|
+
})
|
|
1447
|
+
}) }
|
|
1448
|
+
};
|
|
1449
|
+
|
|
1450
|
+
// src/endpoints/riot/presence.ts
|
|
1451
|
+
import { endpoints as e7 } from "valorant-api-types";
|
|
1452
|
+
import { z as z11 } from "zod";
|
|
1453
|
+
|
|
1454
|
+
// src/internal/base64.ts
|
|
1455
|
+
function toBase64(text2) {
|
|
1456
|
+
return Buffer.from(text2, "utf8").toString("base64");
|
|
1457
|
+
}
|
|
1458
|
+
function fromBase64(encoded) {
|
|
1459
|
+
return Buffer.from(encoded, "base64").toString("utf8");
|
|
1460
|
+
}
|
|
1461
|
+
function basicAuth(user, password) {
|
|
1462
|
+
return `Basic ${toBase64(`${user}:${password}`)}`;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
// src/endpoints/riot/presence.ts
|
|
1466
|
+
var valorantPresence = z11.object({
|
|
1467
|
+
isIdle: z11.boolean(),
|
|
1468
|
+
isValid: z11.boolean(),
|
|
1469
|
+
matchPresenceData: z11.object({
|
|
1470
|
+
gameScoreType: z11.string(),
|
|
1471
|
+
matchMap: z11.string(),
|
|
1472
|
+
provisioningFlow: z11.string(),
|
|
1473
|
+
queueId: z11.string(),
|
|
1474
|
+
sessionLoopState: z11.string()
|
|
1475
|
+
}),
|
|
1476
|
+
maxPartySize: z11.number(),
|
|
1477
|
+
partyId: z11.string(),
|
|
1478
|
+
partyOwnerMatchScoreAllyTeam: z11.number(),
|
|
1479
|
+
partyOwnerMatchScoreEnemyTeam: z11.number(),
|
|
1480
|
+
partyPresenceData: z11.object({
|
|
1481
|
+
customGameName: z11.string(),
|
|
1482
|
+
customGameTeam: z11.string(),
|
|
1483
|
+
isPartyCrossPlayEnabled: z11.boolean(),
|
|
1484
|
+
isPartyOwner: z11.boolean(),
|
|
1485
|
+
isPlayerCrossPlayEnabled: z11.boolean(),
|
|
1486
|
+
maxPartySize: z11.number(),
|
|
1487
|
+
partyAccessibility: z11.string(),
|
|
1488
|
+
partyClientVersion: z11.string(),
|
|
1489
|
+
partyId: z11.string(),
|
|
1490
|
+
partyLFM: z11.boolean(),
|
|
1491
|
+
partyOwnerMatchMap: z11.string(),
|
|
1492
|
+
partyOwnerMatchScoreAllyTeam: z11.number(),
|
|
1493
|
+
partyOwnerMatchScoreEnemyTeam: z11.number(),
|
|
1494
|
+
partyOwnerProvisioningFlow: z11.string(),
|
|
1495
|
+
partyOwnerSessionLoopState: z11.string(),
|
|
1496
|
+
partyPrecisePlatformTypes: z11.number(),
|
|
1497
|
+
partySize: z11.number(),
|
|
1498
|
+
partyState: z11.string(),
|
|
1499
|
+
partyVersion: z11.number(),
|
|
1500
|
+
queueEntryTime: z11.string(),
|
|
1501
|
+
rosterId: z11.string(),
|
|
1502
|
+
tournamentId: z11.string()
|
|
1503
|
+
}),
|
|
1504
|
+
partySize: z11.number(),
|
|
1505
|
+
playerPresenceData: z11.object({
|
|
1506
|
+
accountLevel: z11.number(),
|
|
1507
|
+
competitiveTier: z11.number(),
|
|
1508
|
+
leaderboardPosition: z11.number(),
|
|
1509
|
+
platformOverride: z11.string(),
|
|
1510
|
+
playerCardId: z11.string(),
|
|
1511
|
+
playerTitleId: z11.string(),
|
|
1512
|
+
tempValueAA: z11.number()
|
|
1513
|
+
}),
|
|
1514
|
+
premierPresenceData: z11.object({
|
|
1515
|
+
division: z11.number(),
|
|
1516
|
+
plating: z11.number(),
|
|
1517
|
+
rosterId: z11.string(),
|
|
1518
|
+
rosterName: z11.string(),
|
|
1519
|
+
rosterTag: z11.string(),
|
|
1520
|
+
rosterType: z11.string(),
|
|
1521
|
+
score: z11.number(),
|
|
1522
|
+
showAura: z11.boolean(),
|
|
1523
|
+
showPlating: z11.boolean(),
|
|
1524
|
+
showTag: z11.boolean()
|
|
1525
|
+
}),
|
|
1526
|
+
provisioningFlow: z11.string(),
|
|
1527
|
+
queueId: z11.string()
|
|
1528
|
+
});
|
|
1529
|
+
function decodePresence(raw) {
|
|
1530
|
+
if (!raw) return null;
|
|
1531
|
+
try {
|
|
1532
|
+
return valorantPresence.parse(JSON.parse(fromBase64(raw)));
|
|
1533
|
+
} catch {
|
|
1534
|
+
return null;
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
var presenceEndpoint = withResponse(e7.presenceEndpoint, z11.object({
|
|
1538
|
+
presences: z11.array(z11.object({
|
|
1539
|
+
activePlatform: z11.string().nullable(),
|
|
1540
|
+
basic: z11.string(),
|
|
1541
|
+
game_name: z11.string(),
|
|
1542
|
+
game_tag: z11.string(),
|
|
1543
|
+
msg: z11.string().nullable(),
|
|
1544
|
+
name: z11.string(),
|
|
1545
|
+
packedData: z11.string().nullable(),
|
|
1546
|
+
patchline: z11.string().nullable(),
|
|
1547
|
+
pid: z11.string(),
|
|
1548
|
+
platform: z11.string().nullable(),
|
|
1549
|
+
product: z11.string(),
|
|
1550
|
+
puuid: z11.string(),
|
|
1551
|
+
region: z11.string(),
|
|
1552
|
+
resource: z11.string(),
|
|
1553
|
+
state: z11.string(),
|
|
1554
|
+
summary: z11.string(),
|
|
1555
|
+
time: z11.number(),
|
|
1556
|
+
private: z11.string().nullable().transform(decodePresence)
|
|
1557
|
+
}))
|
|
1558
|
+
}));
|
|
1559
|
+
|
|
1560
|
+
// src/endpoints/riot/pvp.ts
|
|
1561
|
+
import { endpoints as e8 } from "valorant-api-types";
|
|
1562
|
+
import { z as z12 } from "zod";
|
|
1563
|
+
var playerLoadoutV3Endpoint = {
|
|
1564
|
+
name: "Player Loadout V3",
|
|
1565
|
+
description: "Current loadout. The v2 route used by `pvp.playerLoadout` answers 404 on current clients.",
|
|
1566
|
+
category: "PVP Endpoints",
|
|
1567
|
+
type: "pd",
|
|
1568
|
+
suffix: "personalization/v3/players/{puuid}/playerloadout",
|
|
1569
|
+
riotRequirements: player,
|
|
1570
|
+
responses: { "200": z12.object({
|
|
1571
|
+
Subject: z12.string(),
|
|
1572
|
+
Version: z12.number(),
|
|
1573
|
+
Guns: z12.array(z12.object({
|
|
1574
|
+
ID: z12.string(),
|
|
1575
|
+
SkinID: z12.string(),
|
|
1576
|
+
SkinLevelID: z12.string(),
|
|
1577
|
+
ChromaID: z12.string(),
|
|
1578
|
+
CharmInstanceID: z12.string().optional(),
|
|
1579
|
+
CharmID: z12.string().optional(),
|
|
1580
|
+
CharmLevelID: z12.string().optional()
|
|
1581
|
+
})),
|
|
1582
|
+
ActiveExpressions: z12.array(z12.object({
|
|
1583
|
+
TypeID: z12.string(),
|
|
1584
|
+
AssetID: z12.string()
|
|
1585
|
+
})),
|
|
1586
|
+
DynamicOptions: z12.object({}),
|
|
1587
|
+
Identity: z12.object({
|
|
1588
|
+
PlayerCardID: z12.string(),
|
|
1589
|
+
PlayerTitleID: z12.string(),
|
|
1590
|
+
AccountLevel: z12.number(),
|
|
1591
|
+
PreferredLevelBorderID: z12.string(),
|
|
1592
|
+
HideAccountLevel: z12.boolean()
|
|
1593
|
+
}),
|
|
1594
|
+
Incognito: z12.boolean()
|
|
1595
|
+
}) }
|
|
1596
|
+
};
|
|
1597
|
+
var configEndpoint = withResponse(
|
|
1598
|
+
{ ...onSharedHost(e8.configEndpoint), riotRequirements: player },
|
|
1599
|
+
z12.object({
|
|
1600
|
+
LastApplication: z12.string().datetime({ offset: true }).transform((value) => new Date(value)),
|
|
1601
|
+
/** Game settings by name. Every value is a string, and the set of names changes with each patch. */
|
|
1602
|
+
Collapsed: z12.record(z12.string(), z12.string())
|
|
1603
|
+
})
|
|
1604
|
+
);
|
|
1605
|
+
|
|
1606
|
+
// src/endpoints/riot/restrictions.ts
|
|
1607
|
+
import { z as z13 } from "zod";
|
|
1608
|
+
var avoidListEndpoint = {
|
|
1609
|
+
name: "Avoid List",
|
|
1610
|
+
description: "Players the account avoids in matchmaking.",
|
|
1611
|
+
category: "Restriction Endpoints",
|
|
1612
|
+
type: "pd",
|
|
1613
|
+
suffix: "restrictions/v1/avoidList",
|
|
1614
|
+
riotRequirements: player,
|
|
1615
|
+
responses: { "200": z13.object({
|
|
1616
|
+
Subject: z13.string()
|
|
1617
|
+
}) }
|
|
1618
|
+
};
|
|
1619
|
+
var activeFutureInterventionsEndpoint = {
|
|
1620
|
+
name: "Active Future Interventions",
|
|
1621
|
+
description: "Upcoming or active restrictions of the account, by category.",
|
|
1622
|
+
category: "Restriction Endpoints",
|
|
1623
|
+
type: "pd",
|
|
1624
|
+
suffix: "restrictions/v1/activeFutureInterventions",
|
|
1625
|
+
riotRequirements: player,
|
|
1626
|
+
responses: { "200": z13.object({
|
|
1627
|
+
Subject: z13.string()
|
|
1628
|
+
}) }
|
|
433
1629
|
};
|
|
1630
|
+
|
|
1631
|
+
// src/endpoints/riot/store.ts
|
|
1632
|
+
import { endpoints as e9 } from "valorant-api-types";
|
|
1633
|
+
import { z as z14 } from "zod";
|
|
1634
|
+
var agentStoreEndpoint = {
|
|
1635
|
+
name: "Agent Store",
|
|
1636
|
+
description: "Agents offered in the store.",
|
|
1637
|
+
category: "Store Endpoints",
|
|
1638
|
+
type: "pd",
|
|
1639
|
+
suffix: "store/v1/storefronts/agent",
|
|
1640
|
+
riotRequirements: player,
|
|
1641
|
+
responses: { "200": z14.object({
|
|
1642
|
+
AgentStore: z14.object({
|
|
1643
|
+
AgentStoreOffers: z14.array(z14.object({
|
|
1644
|
+
AgentID: z14.string(),
|
|
1645
|
+
StoreOffers: z14.array(z14.object({
|
|
1646
|
+
OfferID: z14.string(),
|
|
1647
|
+
IsDirectPurchase: z14.boolean(),
|
|
1648
|
+
StartDate: z14.string(),
|
|
1649
|
+
Cost: z14.record(z14.string(), z14.number()),
|
|
1650
|
+
Rewards: z14.array(z14.object({
|
|
1651
|
+
ItemTypeID: z14.string(),
|
|
1652
|
+
ItemID: z14.string(),
|
|
1653
|
+
Quantity: z14.number()
|
|
1654
|
+
}))
|
|
1655
|
+
}))
|
|
1656
|
+
})),
|
|
1657
|
+
CurrentFeaturedAgent: z14.string(),
|
|
1658
|
+
NextFeaturedAgent: z14.string()
|
|
1659
|
+
})
|
|
1660
|
+
}) }
|
|
1661
|
+
};
|
|
1662
|
+
var allEntitlementsEndpoint = {
|
|
1663
|
+
name: "All Entitlements",
|
|
1664
|
+
description: "Everything the player owns, grouped by item type. This is the call without an item type, which is the shape `store.ownedItems` describes.",
|
|
1665
|
+
category: "Store Endpoints",
|
|
1666
|
+
type: "pd",
|
|
1667
|
+
suffix: "store/v1/entitlements/{puuid}",
|
|
1668
|
+
riotRequirements: player,
|
|
1669
|
+
responses: { "200": z14.object({
|
|
1670
|
+
EntitlementsByTypes: z14.array(z14.object({
|
|
1671
|
+
ItemTypeID: z14.string(),
|
|
1672
|
+
Entitlements: z14.array(z14.object({
|
|
1673
|
+
TypeID: z14.string(),
|
|
1674
|
+
ItemID: z14.string(),
|
|
1675
|
+
InstanceID: z14.string().optional()
|
|
1676
|
+
}))
|
|
1677
|
+
}))
|
|
1678
|
+
}) }
|
|
1679
|
+
};
|
|
1680
|
+
var ownedItemsEndpoint = withResponse(e9.ownedItemsEndpoint, z14.object({
|
|
1681
|
+
ItemTypeID: z14.string(),
|
|
1682
|
+
Entitlements: z14.array(z14.object({
|
|
1683
|
+
TypeID: z14.string(),
|
|
1684
|
+
ItemID: z14.string()
|
|
1685
|
+
}))
|
|
1686
|
+
}));
|
|
1687
|
+
|
|
1688
|
+
// src/endpoints/riot/storefront.ts
|
|
1689
|
+
import { z as z15 } from "zod";
|
|
1690
|
+
var storefrontV3Endpoint = {
|
|
1691
|
+
name: "Storefront V3",
|
|
1692
|
+
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.",
|
|
1693
|
+
category: "Store Endpoints",
|
|
1694
|
+
type: "pd",
|
|
1695
|
+
method: "POST",
|
|
1696
|
+
suffix: "store/v3/storefront/{puuid}",
|
|
1697
|
+
headers: /* @__PURE__ */ new Map([["Content-Type", "application/json"]]),
|
|
1698
|
+
riotRequirements: player,
|
|
1699
|
+
responses: { "200": z15.object({
|
|
1700
|
+
FeaturedBundle: z15.object({
|
|
1701
|
+
Bundle: z15.object({
|
|
1702
|
+
ID: z15.string(),
|
|
1703
|
+
DataAssetID: z15.string(),
|
|
1704
|
+
CurrencyID: z15.string(),
|
|
1705
|
+
Items: z15.array(z15.object({
|
|
1706
|
+
Item: z15.object({
|
|
1707
|
+
ItemTypeID: z15.string(),
|
|
1708
|
+
ItemID: z15.string(),
|
|
1709
|
+
Amount: z15.number()
|
|
1710
|
+
}),
|
|
1711
|
+
BasePrice: z15.number(),
|
|
1712
|
+
CurrencyID: z15.string(),
|
|
1713
|
+
DiscountPercent: z15.number(),
|
|
1714
|
+
DiscountedPrice: z15.number(),
|
|
1715
|
+
IsPromoItem: z15.boolean()
|
|
1716
|
+
})),
|
|
1717
|
+
ItemOffers: z15.array(z15.object({
|
|
1718
|
+
BundleItemOfferID: z15.string(),
|
|
1719
|
+
Offer: z15.object({
|
|
1720
|
+
OfferID: z15.string(),
|
|
1721
|
+
IsDirectPurchase: z15.boolean(),
|
|
1722
|
+
StartDate: z15.string(),
|
|
1723
|
+
Cost: z15.object({
|
|
1724
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1725
|
+
}),
|
|
1726
|
+
Rewards: z15.array(z15.object({
|
|
1727
|
+
ItemTypeID: z15.string(),
|
|
1728
|
+
ItemID: z15.string(),
|
|
1729
|
+
Quantity: z15.number()
|
|
1730
|
+
}))
|
|
1731
|
+
}),
|
|
1732
|
+
DiscountPercent: z15.number(),
|
|
1733
|
+
DiscountedCost: z15.object({
|
|
1734
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1735
|
+
})
|
|
1736
|
+
})),
|
|
1737
|
+
TotalBaseCost: z15.object({
|
|
1738
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1739
|
+
}),
|
|
1740
|
+
TotalDiscountedCost: z15.object({
|
|
1741
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1742
|
+
}),
|
|
1743
|
+
TotalDiscountPercent: z15.number(),
|
|
1744
|
+
DurationRemainingInSeconds: z15.number(),
|
|
1745
|
+
WholesaleOnly: z15.boolean(),
|
|
1746
|
+
IsGiftable: z15.number()
|
|
1747
|
+
}),
|
|
1748
|
+
Bundles: z15.array(z15.object({
|
|
1749
|
+
ID: z15.string(),
|
|
1750
|
+
DataAssetID: z15.string(),
|
|
1751
|
+
CurrencyID: z15.string(),
|
|
1752
|
+
Items: z15.array(z15.object({
|
|
1753
|
+
Item: z15.object({
|
|
1754
|
+
ItemTypeID: z15.string(),
|
|
1755
|
+
ItemID: z15.string(),
|
|
1756
|
+
Amount: z15.number()
|
|
1757
|
+
}),
|
|
1758
|
+
BasePrice: z15.number(),
|
|
1759
|
+
CurrencyID: z15.string(),
|
|
1760
|
+
DiscountPercent: z15.number(),
|
|
1761
|
+
DiscountedPrice: z15.number(),
|
|
1762
|
+
IsPromoItem: z15.boolean()
|
|
1763
|
+
})),
|
|
1764
|
+
ItemOffers: z15.array(z15.object({
|
|
1765
|
+
BundleItemOfferID: z15.string(),
|
|
1766
|
+
Offer: z15.object({
|
|
1767
|
+
OfferID: z15.string(),
|
|
1768
|
+
IsDirectPurchase: z15.boolean(),
|
|
1769
|
+
StartDate: z15.string(),
|
|
1770
|
+
Cost: z15.object({
|
|
1771
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1772
|
+
}),
|
|
1773
|
+
Rewards: z15.array(z15.object({
|
|
1774
|
+
ItemTypeID: z15.string(),
|
|
1775
|
+
ItemID: z15.string(),
|
|
1776
|
+
Quantity: z15.number()
|
|
1777
|
+
}))
|
|
1778
|
+
}),
|
|
1779
|
+
DiscountPercent: z15.number(),
|
|
1780
|
+
DiscountedCost: z15.object({
|
|
1781
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1782
|
+
})
|
|
1783
|
+
})),
|
|
1784
|
+
TotalBaseCost: z15.object({
|
|
1785
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1786
|
+
}),
|
|
1787
|
+
TotalDiscountedCost: z15.object({
|
|
1788
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1789
|
+
}),
|
|
1790
|
+
TotalDiscountPercent: z15.number(),
|
|
1791
|
+
DurationRemainingInSeconds: z15.number(),
|
|
1792
|
+
WholesaleOnly: z15.boolean(),
|
|
1793
|
+
IsGiftable: z15.number()
|
|
1794
|
+
})),
|
|
1795
|
+
FeaturedTileEntries: z15.array(z15.object({
|
|
1796
|
+
Type: z15.number(),
|
|
1797
|
+
Entry: z15.object({
|
|
1798
|
+
Bundle: z15.object({
|
|
1799
|
+
ID: z15.string(),
|
|
1800
|
+
DataAssetID: z15.string(),
|
|
1801
|
+
CurrencyID: z15.string(),
|
|
1802
|
+
Items: z15.array(z15.object({
|
|
1803
|
+
Item: z15.object({
|
|
1804
|
+
ItemTypeID: z15.string(),
|
|
1805
|
+
ItemID: z15.string(),
|
|
1806
|
+
Amount: z15.number()
|
|
1807
|
+
}),
|
|
1808
|
+
BasePrice: z15.number(),
|
|
1809
|
+
CurrencyID: z15.string(),
|
|
1810
|
+
DiscountPercent: z15.number(),
|
|
1811
|
+
DiscountedPrice: z15.number(),
|
|
1812
|
+
IsPromoItem: z15.boolean()
|
|
1813
|
+
})),
|
|
1814
|
+
ItemOffers: z15.array(z15.object({
|
|
1815
|
+
BundleItemOfferID: z15.string(),
|
|
1816
|
+
Offer: z15.object({
|
|
1817
|
+
OfferID: z15.string(),
|
|
1818
|
+
IsDirectPurchase: z15.boolean(),
|
|
1819
|
+
StartDate: z15.string(),
|
|
1820
|
+
Cost: z15.object({
|
|
1821
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1822
|
+
}),
|
|
1823
|
+
Rewards: z15.array(z15.object({
|
|
1824
|
+
ItemTypeID: z15.string(),
|
|
1825
|
+
ItemID: z15.string(),
|
|
1826
|
+
Quantity: z15.number()
|
|
1827
|
+
}))
|
|
1828
|
+
}),
|
|
1829
|
+
DiscountPercent: z15.number(),
|
|
1830
|
+
DiscountedCost: z15.object({
|
|
1831
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1832
|
+
})
|
|
1833
|
+
})),
|
|
1834
|
+
TotalBaseCost: z15.object({
|
|
1835
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1836
|
+
}),
|
|
1837
|
+
TotalDiscountedCost: z15.object({
|
|
1838
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1839
|
+
}),
|
|
1840
|
+
TotalDiscountPercent: z15.number(),
|
|
1841
|
+
DurationRemainingInSeconds: z15.number(),
|
|
1842
|
+
WholesaleOnly: z15.boolean(),
|
|
1843
|
+
IsGiftable: z15.number()
|
|
1844
|
+
})
|
|
1845
|
+
})
|
|
1846
|
+
})),
|
|
1847
|
+
BundleRemainingDurationInSeconds: z15.number()
|
|
1848
|
+
}),
|
|
1849
|
+
SkinsPanelLayout: z15.object({
|
|
1850
|
+
SingleItemOffers: z15.array(z15.string()),
|
|
1851
|
+
SingleItemStoreOffers: z15.array(z15.object({
|
|
1852
|
+
OfferID: z15.string(),
|
|
1853
|
+
IsDirectPurchase: z15.boolean(),
|
|
1854
|
+
StartDate: z15.string(),
|
|
1855
|
+
Cost: z15.object({
|
|
1856
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1857
|
+
}),
|
|
1858
|
+
Rewards: z15.array(z15.object({
|
|
1859
|
+
ItemTypeID: z15.string(),
|
|
1860
|
+
ItemID: z15.string(),
|
|
1861
|
+
Quantity: z15.number()
|
|
1862
|
+
}))
|
|
1863
|
+
})),
|
|
1864
|
+
SingleItemOffersRemainingDurationInSeconds: z15.number()
|
|
1865
|
+
}),
|
|
1866
|
+
UpgradeCurrencyStore: z15.object({
|
|
1867
|
+
UpgradeCurrencyOffers: z15.array(z15.object({
|
|
1868
|
+
OfferID: z15.string(),
|
|
1869
|
+
StorefrontItemID: z15.string(),
|
|
1870
|
+
Offer: z15.object({
|
|
1871
|
+
OfferID: z15.string(),
|
|
1872
|
+
IsDirectPurchase: z15.boolean(),
|
|
1873
|
+
StartDate: z15.string(),
|
|
1874
|
+
Cost: z15.object({
|
|
1875
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1876
|
+
}),
|
|
1877
|
+
Rewards: z15.array(z15.object({
|
|
1878
|
+
ItemTypeID: z15.string(),
|
|
1879
|
+
ItemID: z15.string(),
|
|
1880
|
+
Quantity: z15.number()
|
|
1881
|
+
}))
|
|
1882
|
+
}),
|
|
1883
|
+
DiscountedPercent: z15.number()
|
|
1884
|
+
}))
|
|
1885
|
+
}),
|
|
1886
|
+
AccessoryStore: z15.object({
|
|
1887
|
+
AccessoryStoreOffers: z15.array(z15.object({
|
|
1888
|
+
Offer: z15.object({
|
|
1889
|
+
OfferID: z15.string(),
|
|
1890
|
+
IsDirectPurchase: z15.boolean(),
|
|
1891
|
+
StartDate: z15.string(),
|
|
1892
|
+
Cost: z15.object({
|
|
1893
|
+
"85ca954a-41f2-ce94-9b45-8ca3dd39a00d": z15.number()
|
|
1894
|
+
}),
|
|
1895
|
+
Rewards: z15.array(z15.object({
|
|
1896
|
+
ItemTypeID: z15.string(),
|
|
1897
|
+
ItemID: z15.string(),
|
|
1898
|
+
Quantity: z15.number()
|
|
1899
|
+
}))
|
|
1900
|
+
}),
|
|
1901
|
+
ContractID: z15.string()
|
|
1902
|
+
})),
|
|
1903
|
+
AccessoryStoreRemainingDurationInSeconds: z15.number(),
|
|
1904
|
+
StorefrontID: z15.string()
|
|
1905
|
+
}),
|
|
1906
|
+
PluginStores: z15.array(z15.object({
|
|
1907
|
+
PluginID: z15.string(),
|
|
1908
|
+
PluginOffers: z15.object({
|
|
1909
|
+
StoreOffers: z15.array(z15.object({
|
|
1910
|
+
PurchaseInformation: z15.object({
|
|
1911
|
+
DataAssetID: z15.string(),
|
|
1912
|
+
OfferID: z15.string(),
|
|
1913
|
+
OfferType: z15.number(),
|
|
1914
|
+
StartDate: z15.string(),
|
|
1915
|
+
PrimaryCurrencyID: z15.string(),
|
|
1916
|
+
Cost: z15.object({
|
|
1917
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1918
|
+
}),
|
|
1919
|
+
DiscountedCost: z15.object({
|
|
1920
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1921
|
+
}),
|
|
1922
|
+
DiscountedPercentage: z15.number(),
|
|
1923
|
+
WholesaleOnly: z15.boolean(),
|
|
1924
|
+
IsGiftable: z15.number()
|
|
1925
|
+
}),
|
|
1926
|
+
SubOffers: z15.array(z15.object({
|
|
1927
|
+
PurchaseInformation: z15.object({
|
|
1928
|
+
DataAssetID: z15.string(),
|
|
1929
|
+
OfferID: z15.string(),
|
|
1930
|
+
OfferType: z15.number(),
|
|
1931
|
+
StartDate: z15.string(),
|
|
1932
|
+
PrimaryCurrencyID: z15.string(),
|
|
1933
|
+
Cost: z15.object({
|
|
1934
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1935
|
+
}),
|
|
1936
|
+
DiscountedCost: z15.object({
|
|
1937
|
+
"85ad13f7-3d1b-5128-9eb2-7cd8ee0b5741": z15.number()
|
|
1938
|
+
}),
|
|
1939
|
+
DiscountedPercentage: z15.number(),
|
|
1940
|
+
Rewards: z15.array(z15.object({
|
|
1941
|
+
ItemTypeID: z15.string(),
|
|
1942
|
+
ItemID: z15.string(),
|
|
1943
|
+
Quantity: z15.number()
|
|
1944
|
+
})),
|
|
1945
|
+
WholesaleOnly: z15.boolean(),
|
|
1946
|
+
IsGiftable: z15.number()
|
|
1947
|
+
})
|
|
1948
|
+
}))
|
|
1949
|
+
})),
|
|
1950
|
+
RemainingDurationInSeconds: z15.number()
|
|
1951
|
+
}),
|
|
1952
|
+
StartDate: z15.string()
|
|
1953
|
+
}))
|
|
1954
|
+
}) }
|
|
1955
|
+
};
|
|
1956
|
+
|
|
1957
|
+
// src/endpoints/riot/voice.ts
|
|
1958
|
+
import { z as z16 } from "zod";
|
|
434
1959
|
var voiceAudioPropertiesEndpoint = {
|
|
435
1960
|
name: "Audio Properties",
|
|
436
1961
|
description: "Get audio properties such as if the microphone is in use",
|
|
437
|
-
queryName: "VOICE_CHAT_RNet_FetchAudioProperties",
|
|
438
1962
|
category: "Local Endpoints - Voice",
|
|
439
1963
|
type: "local",
|
|
440
1964
|
suffix: "voice-chat/v1/audio-properties",
|
|
441
1965
|
riotRequirements: { localAuth: true },
|
|
442
|
-
responses: { "200":
|
|
1966
|
+
responses: { "200": z16.object({
|
|
1967
|
+
fastEnergyMeter: z16.number(),
|
|
1968
|
+
isLoopbackEnabled: z16.boolean(),
|
|
1969
|
+
isMicActive: z16.boolean(),
|
|
1970
|
+
isSpeakerActive: z16.boolean(),
|
|
1971
|
+
micEnergy: z16.number(),
|
|
1972
|
+
micVolume: z16.number(),
|
|
1973
|
+
noiseFloorMeter: z16.number(),
|
|
1974
|
+
speakerEnergy: z16.number(),
|
|
1975
|
+
speakerVolume: z16.number(),
|
|
1976
|
+
speechThresholdMeter: z16.number()
|
|
1977
|
+
}) }
|
|
443
1978
|
};
|
|
444
1979
|
var voiceCaptureDevicesEndpoint = {
|
|
445
1980
|
name: "Capture Devices",
|
|
446
1981
|
description: "Get microphone input device info",
|
|
447
|
-
queryName: "VOICE_CHAT_RNet_FetchCaptureDevices",
|
|
448
1982
|
category: "Local Endpoints - Voice",
|
|
449
1983
|
type: "local",
|
|
450
1984
|
suffix: "voice-chat/v2/devices/capture",
|
|
451
1985
|
riotRequirements: { localAuth: true },
|
|
452
|
-
responses: { "200":
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
type: "local",
|
|
460
|
-
suffix: "voice-chat/v2/push-to-talk/valorant",
|
|
461
|
-
riotRequirements: { localAuth: true },
|
|
462
|
-
responses: { "200": z2.unknown() }
|
|
1986
|
+
responses: { "200": z16.array(z16.object({
|
|
1987
|
+
handle: z16.string(),
|
|
1988
|
+
is_current_device: z16.boolean(),
|
|
1989
|
+
is_default: z16.boolean(),
|
|
1990
|
+
is_effective_device: z16.boolean(),
|
|
1991
|
+
name: z16.string()
|
|
1992
|
+
})) }
|
|
463
1993
|
};
|
|
464
1994
|
var voiceRenderDevicesEndpoint = {
|
|
465
1995
|
name: "Render Devices",
|
|
466
1996
|
description: "Get audio output devices",
|
|
467
|
-
queryName: "VOICE_CHAT_RNet_FetchRenderDevices",
|
|
468
1997
|
category: "Local Endpoints - Voice",
|
|
469
1998
|
type: "local",
|
|
470
1999
|
suffix: "voice-chat/v2/devices/render",
|
|
471
2000
|
riotRequirements: { localAuth: true },
|
|
472
|
-
responses: { "200":
|
|
2001
|
+
responses: { "200": z16.array(z16.object({
|
|
2002
|
+
handle: z16.string(),
|
|
2003
|
+
is_current_device: z16.boolean(),
|
|
2004
|
+
is_default: z16.boolean(),
|
|
2005
|
+
is_effective_device: z16.boolean(),
|
|
2006
|
+
name: z16.string()
|
|
2007
|
+
})) }
|
|
473
2008
|
};
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
2009
|
+
|
|
2010
|
+
// src/api/groups/pvp.ts
|
|
2011
|
+
var pvp = {
|
|
2012
|
+
content: e10.fetchContentEndpoint,
|
|
2013
|
+
accountXp: e10.accountXPEndpoint,
|
|
2014
|
+
setPlayerLoadout: e10.setPlayerLoadoutEndpoint,
|
|
2015
|
+
playerMmr: e10.playerMMREndpoint,
|
|
2016
|
+
matchHistory: e10.matchHistoryEndpoint,
|
|
2017
|
+
matchDetails: e10.matchDetailsEndpoint,
|
|
2018
|
+
competitiveUpdates: e10.competitiveUpdatesEndpoint,
|
|
2019
|
+
leaderboard: e10.leaderboardEndpoint,
|
|
2020
|
+
penalties: e10.penaltiesEndpoint,
|
|
2021
|
+
config: configEndpoint,
|
|
2022
|
+
nameService: e10.nameServiceEndpoint,
|
|
2023
|
+
playerLoadoutV3: playerLoadoutV3Endpoint
|
|
483
2024
|
};
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
2025
|
+
|
|
2026
|
+
// src/api/groups/party.ts
|
|
2027
|
+
import { endpoints as e11 } from "valorant-api-types";
|
|
2028
|
+
var party = {
|
|
2029
|
+
get: partyEndpoint,
|
|
2030
|
+
player: e11.partyPlayerEndpoint,
|
|
2031
|
+
removePlayer: e11.partyRemovePlayerEndpoint,
|
|
2032
|
+
setMemberReady: partySetMemberReadyEndpoint,
|
|
2033
|
+
refreshCompetitiveTier: refreshCompetitiveTierEndpoint,
|
|
2034
|
+
refreshPlayerIdentity: refreshPlayerIdentityEndpoint,
|
|
2035
|
+
refreshPings: refreshPingsEndpoint,
|
|
2036
|
+
changeQueue: changeQueueEndpoint,
|
|
2037
|
+
startCustomGame: startCustomGameEndpoint,
|
|
2038
|
+
enterMatchmakingQueue: enterMatchmakingQueueEndpoint,
|
|
2039
|
+
leaveMatchmakingQueue: leaveMatchmakingQueueEndpoint,
|
|
2040
|
+
setAccessibility: setPartyAccessibilityEndpoint,
|
|
2041
|
+
setCustomGameSettings: setCustomGameSettingsEndpoint,
|
|
2042
|
+
invite: partyInviteEndpoint,
|
|
2043
|
+
requestToJoin: e11.partyRequestEndpoint,
|
|
2044
|
+
declineRequest: partyDeclineEndpoint,
|
|
2045
|
+
customGameConfigs: e11.customGameConfigsEndpoint,
|
|
2046
|
+
disableCode: partyDisableCodeEndpoint,
|
|
2047
|
+
generateCode: partyGenerateCodeEndpoint,
|
|
2048
|
+
joinByCode: e11.partyJoinByCodeEndpoint,
|
|
2049
|
+
setCustomGameTeam: setCustomGameTeamEndpoint,
|
|
2050
|
+
getCustomGame: customGamePartyEndpoint
|
|
493
2051
|
};
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
};
|
|
504
|
-
var pregameVoiceTokenEndpoint = {
|
|
505
|
-
name: "Voice Token",
|
|
506
|
-
description: "Get a voice token",
|
|
507
|
-
queryName: "Pregame_FetchVoiceToken",
|
|
508
|
-
category: "Pre-Game Endpoints",
|
|
509
|
-
type: "glz",
|
|
510
|
-
suffix: "pregame/v1/matches/{pre-game match id}/voicetoken",
|
|
511
|
-
riotRequirements: { entitlement: true, token: true, clientPlatform: true, clientVersion: true },
|
|
512
|
-
responses: { "200": z2.unknown() }
|
|
513
|
-
};
|
|
514
|
-
var sessionGetEndpoint = {
|
|
515
|
-
name: "Get",
|
|
516
|
-
description: "Get information about the current game session",
|
|
517
|
-
queryName: "Session_Get",
|
|
518
|
-
category: "Session Endpoints",
|
|
519
|
-
type: "glz",
|
|
520
|
-
suffix: "session/v1/sessions/{puuid}",
|
|
521
|
-
riotRequirements: { entitlement: true, token: true, clientPlatform: true, clientVersion: true },
|
|
522
|
-
responses: { "200": z2.unknown() }
|
|
523
|
-
};
|
|
524
|
-
var sessionReconnectEndpoint = {
|
|
525
|
-
name: "Reconnect",
|
|
526
|
-
description: "GET Session_ReConnect",
|
|
527
|
-
queryName: "Session_ReConnect",
|
|
528
|
-
category: "Session Endpoints",
|
|
529
|
-
type: "glz",
|
|
530
|
-
suffix: "session/v1/sessions/{puuid}/reconnect",
|
|
531
|
-
riotRequirements: { entitlement: true, token: true, clientPlatform: true, clientVersion: true },
|
|
532
|
-
responses: { "200": z2.unknown() }
|
|
533
|
-
};
|
|
534
|
-
var storeOrderEndpoint = {
|
|
535
|
-
name: "Order",
|
|
536
|
-
description: "GET Store_GetOrder",
|
|
537
|
-
queryName: "Store_GetOrder",
|
|
538
|
-
category: "Store Endpoints",
|
|
539
|
-
type: "pd",
|
|
540
|
-
suffix: "store/v1/order/{order id}",
|
|
541
|
-
riotRequirements: { entitlement: true, token: true, clientPlatform: true, clientVersion: true },
|
|
542
|
-
responses: { "200": z2.unknown() }
|
|
543
|
-
};
|
|
544
|
-
var localPlayerSettingsEndpoint = {
|
|
545
|
-
name: "Player Settings",
|
|
546
|
-
description: "Get client settings",
|
|
547
|
-
queryName: "RiotKV_RNet_GetSettings",
|
|
548
|
-
category: "Local Endpoints",
|
|
549
|
-
type: "local",
|
|
550
|
-
suffix: "player-preferences/v1/data-json/Ares.PlayerSettings",
|
|
551
|
-
riotRequirements: { localAuth: true },
|
|
552
|
-
responses: { "200": z2.unknown() }
|
|
2052
|
+
|
|
2053
|
+
// src/api/groups/store.ts
|
|
2054
|
+
import { endpoints as e12 } from "valorant-api-types";
|
|
2055
|
+
var store = {
|
|
2056
|
+
wallet: e12.walletEndpoint,
|
|
2057
|
+
ownedItems: ownedItemsEndpoint,
|
|
2058
|
+
storefrontV3: storefrontV3Endpoint,
|
|
2059
|
+
agentStore: agentStoreEndpoint,
|
|
2060
|
+
allEntitlements: allEntitlementsEndpoint
|
|
553
2061
|
};
|
|
554
2062
|
|
|
555
|
-
// src/
|
|
556
|
-
import {
|
|
557
|
-
var
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
2063
|
+
// src/api/groups/pregame.ts
|
|
2064
|
+
import { endpoints as e13 } from "valorant-api-types";
|
|
2065
|
+
var pregame = {
|
|
2066
|
+
player: e13.pregamePlayerEndpoint,
|
|
2067
|
+
match: pregameMatchEndpoint,
|
|
2068
|
+
loadouts: pregameLoadoutsEndpoint,
|
|
2069
|
+
selectCharacter: selectCharacterEndpoint,
|
|
2070
|
+
lockCharacter: lockCharacterEndpoint,
|
|
2071
|
+
quit: e13.pregameQuitEndpoint
|
|
2072
|
+
};
|
|
2073
|
+
|
|
2074
|
+
// src/api/groups/currentGame.ts
|
|
2075
|
+
import { endpoints as e14 } from "valorant-api-types";
|
|
2076
|
+
var currentGame = {
|
|
2077
|
+
player: e14.currentGamePlayerEndpoint,
|
|
2078
|
+
match: e14.currentGameMatchEndpoint,
|
|
2079
|
+
loadouts: currentGameLoadoutsEndpoint,
|
|
2080
|
+
quit: e14.currentGameQuitEndpoint
|
|
2081
|
+
};
|
|
2082
|
+
|
|
2083
|
+
// src/api/groups/contracts.ts
|
|
2084
|
+
import { endpoints as e15 } from "valorant-api-types";
|
|
2085
|
+
var contracts = {
|
|
2086
|
+
itemUpgrades: e15.itemUpgradesEndpoint,
|
|
2087
|
+
list: contractsEndpoint,
|
|
2088
|
+
activate: e15.activateContractEndpoint,
|
|
2089
|
+
activeRecruitmentEvent: activeRecruitmentEventEndpoint
|
|
2090
|
+
};
|
|
2091
|
+
|
|
2092
|
+
// src/api/groups/local.ts
|
|
2093
|
+
import { endpoints as e16 } from "valorant-api-types";
|
|
2094
|
+
var local = {
|
|
2095
|
+
help: e16.localHelpEndpoint,
|
|
2096
|
+
sessions: e16.sessionsEndpoint,
|
|
2097
|
+
rsoUserInfo: e16.rsoUserInfoEndpoint,
|
|
2098
|
+
clientRegion: e16.clientRegionEndpoint,
|
|
2099
|
+
accountAlias: e16.accountAliasEndpoint,
|
|
2100
|
+
entitlementsToken: e16.entitlementsTokenEndpoint,
|
|
2101
|
+
chatSession: e16.chatSessionEndpoint,
|
|
2102
|
+
friends: e16.friendsEndpoint,
|
|
2103
|
+
sendFriendRequest: e16.sendFriendRequestEndpoint,
|
|
2104
|
+
removeFriendRequest: e16.removeFriendRequestEndpoint,
|
|
2105
|
+
presence: presenceEndpoint,
|
|
2106
|
+
friendRequests: e16.friendRequestsEndpoint,
|
|
2107
|
+
swaggerDocs: e16.localSwaggerDocsEndpoint,
|
|
2108
|
+
eula: localEulaEndpoint,
|
|
2109
|
+
privacyPolicy: localPrivacyPolicyEndpoint,
|
|
2110
|
+
availableLocales: localAvailableLocalesEndpoint,
|
|
2111
|
+
locale: localLocaleEndpoint,
|
|
2112
|
+
riotStatus: localRiotStatusEndpoint,
|
|
2113
|
+
accessToken: localAccessTokenEndpoint,
|
|
2114
|
+
pluginStatus: localPluginStatusEndpoint,
|
|
2115
|
+
rmsSession: localRmsSessionEndpoint,
|
|
2116
|
+
processInfo: localProcessInfoEndpoint,
|
|
2117
|
+
logPath: localLogPathEndpoint
|
|
2118
|
+
};
|
|
2119
|
+
|
|
2120
|
+
// src/api/groups/chat.ts
|
|
2121
|
+
import { endpoints as e17 } from "valorant-api-types";
|
|
2122
|
+
var chat = {
|
|
2123
|
+
partyInfo: e17.partyChatInfoEndpoint,
|
|
2124
|
+
pregameInfo: e17.pregameChatInfoEndpoint,
|
|
2125
|
+
currentGameInfo: e17.currentGameChatInfoEndpoint,
|
|
2126
|
+
allInfo: e17.allChatInfoEndpoint,
|
|
2127
|
+
participants: chatParticipantsEndpoint,
|
|
2128
|
+
send: e17.sendChatEndpoint,
|
|
2129
|
+
history: e17.chatHistoryEndpoint,
|
|
2130
|
+
settings: chatSettingsEndpoint,
|
|
2131
|
+
tournamentInfo: chatTournamentInfoEndpoint
|
|
2132
|
+
};
|
|
2133
|
+
|
|
2134
|
+
// src/api/groups/voice.ts
|
|
2135
|
+
var voice = {
|
|
2136
|
+
audioProperties: voiceAudioPropertiesEndpoint,
|
|
2137
|
+
captureDevices: voiceCaptureDevicesEndpoint,
|
|
2138
|
+
renderDevices: voiceRenderDevicesEndpoint
|
|
2139
|
+
};
|
|
2140
|
+
|
|
2141
|
+
// src/api/groups/premier.ts
|
|
2142
|
+
var premier = {
|
|
2143
|
+
seasons: premierSeasonsEndpoint,
|
|
2144
|
+
activeSeason: premierActiveSeasonEndpoint,
|
|
2145
|
+
conferences: premierConferencesEndpoint,
|
|
2146
|
+
matchLimit: premierMatchLimitEndpoint,
|
|
2147
|
+
eligibility: premierEligibilityEndpoint,
|
|
2148
|
+
playerV2: premierPlayerV2Endpoint,
|
|
2149
|
+
playerV3: premierPlayerV3Endpoint
|
|
2150
|
+
};
|
|
2151
|
+
|
|
2152
|
+
// src/api/groups/esports.ts
|
|
2153
|
+
var esports = {
|
|
2154
|
+
liveEventTimes: esportsLiveEventTimesEndpoint,
|
|
2155
|
+
upcomingMatches: esportsUpcomingMatchesEndpoint,
|
|
2156
|
+
pickemLeagues: esportsPickemLeaguesEndpoint
|
|
2157
|
+
};
|
|
2158
|
+
|
|
2159
|
+
// src/api/groups/restrictions.ts
|
|
2160
|
+
var restrictions = {
|
|
2161
|
+
avoidList: avoidListEndpoint,
|
|
2162
|
+
activeFutureInterventions: activeFutureInterventionsEndpoint
|
|
2163
|
+
};
|
|
2164
|
+
|
|
2165
|
+
// src/api/groups/account.ts
|
|
2166
|
+
var account = {
|
|
2167
|
+
dailyTicket: dailyTicketEndpoint,
|
|
2168
|
+
dailyTicketQueueConfig: dailyTicketQueueConfigEndpoint,
|
|
2169
|
+
favorites: favoritesEndpoint,
|
|
2170
|
+
goldstars: goldstarsEndpoint,
|
|
2171
|
+
goldstarsPlayer: goldstarsPlayerEndpoint,
|
|
2172
|
+
bloomlineQueues: bloomlineQueuesEndpoint,
|
|
2173
|
+
bloomlinePlayer: bloomlinePlayerEndpoint
|
|
2174
|
+
};
|
|
2175
|
+
|
|
2176
|
+
// src/api/groups/auth.ts
|
|
2177
|
+
import { endpoints as e18 } from "valorant-api-types";
|
|
2178
|
+
var auth = {
|
|
2179
|
+
cookies: e18.authCookiesEndpoint,
|
|
2180
|
+
request: e18.authRequestEndpoint,
|
|
2181
|
+
multiFactor: e18.multiFactorAuthenticationEndpoint,
|
|
2182
|
+
cookieReauth: e18.cookieReauthEndpoint,
|
|
2183
|
+
entitlement: e18.entitlementEndpoint,
|
|
2184
|
+
playerInfo: e18.playerInfoEndpoint,
|
|
2185
|
+
riotGeo: e18.riotGeoEndpoint,
|
|
2186
|
+
pasToken: e18.pasTokenEndpoint,
|
|
2187
|
+
riotClientConfig: e18.riotClientConfigEndpoint
|
|
2188
|
+
};
|
|
2189
|
+
|
|
2190
|
+
// src/endpoints/catalog/index.ts
|
|
2191
|
+
import { z as z19 } from "zod";
|
|
2192
|
+
|
|
2193
|
+
// src/endpoints/catalog/factory.ts
|
|
2194
|
+
import { z as z17 } from "zod";
|
|
2195
|
+
|
|
2196
|
+
// src/envelope.ts
|
|
2197
|
+
var enveloped = /* @__PURE__ */ new WeakSet();
|
|
2198
|
+
function markEnveloped(endpoint2) {
|
|
2199
|
+
enveloped.add(endpoint2);
|
|
2200
|
+
return endpoint2;
|
|
2201
|
+
}
|
|
2202
|
+
function unwrapEnvelope(endpoint2, body) {
|
|
2203
|
+
if (enveloped.has(endpoint2) && typeof body === "object" && body !== null && "data" in body) {
|
|
2204
|
+
return body.data;
|
|
2205
|
+
}
|
|
2206
|
+
return body;
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
// src/endpoints/catalog/factory.ts
|
|
2210
|
+
var BASE = "https://valorant-api.com/v1/";
|
|
2211
|
+
function query(queryParams = []) {
|
|
2212
|
+
return new Map([
|
|
2213
|
+
["language", z17.string().optional().describe("Language code such as `fr-FR`. Defaults to `en-US`.")],
|
|
2214
|
+
...queryParams
|
|
2215
|
+
]);
|
|
2216
|
+
}
|
|
2217
|
+
function endpoint(name, description, path, schema, queryParams = []) {
|
|
2218
|
+
return markEnveloped({
|
|
2219
|
+
name,
|
|
2220
|
+
description,
|
|
2221
|
+
category: "Valorant-API.com",
|
|
2222
|
+
type: "other",
|
|
2223
|
+
suffix: `${BASE}${path}`,
|
|
2224
|
+
query: query(queryParams),
|
|
2225
|
+
responses: { "200": schema }
|
|
2226
|
+
});
|
|
2227
|
+
}
|
|
2228
|
+
function collection(title, singular, path, schema, queryParams = []) {
|
|
2229
|
+
return {
|
|
2230
|
+
list: endpoint(title, `List of ${title.toLowerCase()}`, path, z17.array(schema), queryParams),
|
|
2231
|
+
one: endpoint(singular, `One ${singular.toLowerCase()} by UUID`, `${path}/{uuid}`, schema)
|
|
2232
|
+
};
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
// src/endpoints/catalog/schemas.ts
|
|
2236
|
+
import { z as z18 } from "zod";
|
|
2237
|
+
var text = z18.string().nullish();
|
|
2238
|
+
var asset = z18.object({
|
|
2239
|
+
uuid: z18.string(),
|
|
2240
|
+
displayName: text,
|
|
2241
|
+
displayIcon: text,
|
|
2242
|
+
assetPath: text
|
|
2243
|
+
}).passthrough();
|
|
2244
|
+
var agentSchema = asset.extend({
|
|
2245
|
+
description: text,
|
|
2246
|
+
developerName: text,
|
|
2247
|
+
characterTags: z18.array(z18.string()).nullish(),
|
|
2248
|
+
displayIconSmall: text,
|
|
2249
|
+
bustPortrait: text,
|
|
2250
|
+
fullPortrait: text,
|
|
2251
|
+
killfeedPortrait: text,
|
|
2252
|
+
background: text,
|
|
2253
|
+
isPlayableCharacter: z18.boolean(),
|
|
2254
|
+
role: z18.object({ uuid: z18.string(), displayName: text, description: text, displayIcon: text }).passthrough().nullish(),
|
|
2255
|
+
abilities: z18.array(z18.object({ slot: z18.string(), displayName: text, description: text, displayIcon: text }).passthrough()).nullish()
|
|
2256
|
+
});
|
|
2257
|
+
var mapSchema = asset.extend({
|
|
2258
|
+
coordinates: text,
|
|
2259
|
+
listViewIcon: text,
|
|
2260
|
+
splash: text,
|
|
2261
|
+
mapUrl: text,
|
|
2262
|
+
xMultiplier: z18.number(),
|
|
2263
|
+
yMultiplier: z18.number(),
|
|
2264
|
+
xScalarToAdd: z18.number(),
|
|
2265
|
+
yScalarToAdd: z18.number(),
|
|
2266
|
+
callouts: z18.array(z18.object({ regionName: z18.string(), superRegionName: z18.string(), location: z18.object({ x: z18.number(), y: z18.number() }) }).passthrough()).nullish()
|
|
2267
|
+
});
|
|
2268
|
+
var weaponSchema = asset.extend({
|
|
2269
|
+
category: z18.string(),
|
|
2270
|
+
defaultSkinUuid: z18.string(),
|
|
2271
|
+
killStreamIcon: text,
|
|
2272
|
+
weaponStats: z18.object({}).passthrough().nullish(),
|
|
2273
|
+
shopData: z18.object({}).passthrough().nullish(),
|
|
2274
|
+
skins: z18.array(z18.object({}).passthrough())
|
|
2275
|
+
});
|
|
2276
|
+
var skinSchema = asset.extend({
|
|
2277
|
+
themeUuid: z18.string(),
|
|
2278
|
+
contentTierUuid: text,
|
|
2279
|
+
wallpaper: text,
|
|
2280
|
+
chromas: z18.array(asset.passthrough()),
|
|
2281
|
+
levels: z18.array(asset.passthrough())
|
|
2282
|
+
});
|
|
2283
|
+
var seasonSchema = z18.object({
|
|
2284
|
+
uuid: z18.string(),
|
|
2285
|
+
displayName: text,
|
|
2286
|
+
type: text,
|
|
2287
|
+
startTime: z18.string(),
|
|
2288
|
+
endTime: z18.string(),
|
|
2289
|
+
parentUuid: text,
|
|
2290
|
+
assetPath: text
|
|
567
2291
|
}).passthrough();
|
|
568
|
-
var
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
DurationRemainingInSeconds: z3.number(),
|
|
578
|
-
WholesaleOnly: z3.boolean()
|
|
2292
|
+
var versionSchema = z18.object({
|
|
2293
|
+
manifestId: z18.string(),
|
|
2294
|
+
branch: z18.string(),
|
|
2295
|
+
version: z18.string(),
|
|
2296
|
+
buildVersion: z18.string(),
|
|
2297
|
+
engineVersion: z18.string(),
|
|
2298
|
+
riotClientVersion: z18.string().describe("Value of the X-Riot-ClientVersion header"),
|
|
2299
|
+
riotClientBuild: z18.string(),
|
|
2300
|
+
buildDate: z18.string()
|
|
579
2301
|
}).passthrough();
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
2302
|
+
|
|
2303
|
+
// src/endpoints/catalog/index.ts
|
|
2304
|
+
var playable = [["isPlayableCharacter", z19.boolean().optional().describe("Only return playable agents. Skips the duplicate Sova.")]];
|
|
2305
|
+
var agents = collection("Agents", "Agent", "agents", agentSchema, playable);
|
|
2306
|
+
var buddies = collection("Buddies", "Buddy", "buddies", asset);
|
|
2307
|
+
var buddyLevels = collection("Buddy Levels", "Buddy Level", "buddies/levels", asset);
|
|
2308
|
+
var bundles = collection("Bundles", "Bundle", "bundles", asset);
|
|
2309
|
+
var ceremonies = collection("Ceremonies", "Ceremony", "ceremonies", asset);
|
|
2310
|
+
var competitiveTiers = collection("Competitive Tiers", "Competitive Tier Set", "competitivetiers", z19.object({ uuid: z19.string(), tiers: z19.array(z19.object({ tier: z19.number(), tierName: text, division: text, color: text }).passthrough()) }).passthrough());
|
|
2311
|
+
var contentTiers = collection("Content Tiers", "Content Tier", "contenttiers", asset);
|
|
2312
|
+
var contracts2 = collection("Contracts", "Contract", "contracts", asset);
|
|
2313
|
+
var currencies = collection("Currencies", "Currency", "currencies", asset);
|
|
2314
|
+
var events = collection("Events", "Event", "events", asset);
|
|
2315
|
+
var flex = collection("Flex", "Flex Item", "flex", asset);
|
|
2316
|
+
var gamemodes = collection("Gamemodes", "Gamemode", "gamemodes", asset);
|
|
2317
|
+
var gamemodeEquippables = collection("Gamemode Equippables", "Gamemode Equippable", "gamemodes/equippables", asset);
|
|
2318
|
+
var gear = collection("Gear", "Gear Item", "gear", asset);
|
|
2319
|
+
var levelBorders = collection("Level Borders", "Level Border", "levelborders", asset);
|
|
2320
|
+
var maps = collection("Maps", "Map", "maps", mapSchema);
|
|
2321
|
+
var missions = collection("Missions", "Mission", "missions", z19.object({ uuid: z19.string(), displayName: text }).passthrough());
|
|
2322
|
+
var playerCards = collection("Player Cards", "Player Card", "playercards", asset);
|
|
2323
|
+
var playerTitles = collection("Player Titles", "Player Title", "playertitles", z19.object({ uuid: z19.string(), displayName: text, titleText: text }).passthrough());
|
|
2324
|
+
var seasons = collection("Seasons", "Season", "seasons", seasonSchema);
|
|
2325
|
+
var competitiveSeasons = collection("Competitive Seasons", "Competitive Season", "seasons/competitive", z19.object({ uuid: z19.string(), seasonUuid: z19.string(), startTime: z19.string(), endTime: z19.string() }).passthrough());
|
|
2326
|
+
var sprays = collection("Sprays", "Spray", "sprays", asset);
|
|
2327
|
+
var sprayLevels = collection("Spray Levels", "Spray Level", "sprays/levels", asset);
|
|
2328
|
+
var themes = collection("Themes", "Theme", "themes", asset);
|
|
2329
|
+
var weapons = collection("Weapons", "Weapon", "weapons", weaponSchema);
|
|
2330
|
+
var weaponSkins = collection("Weapon Skins", "Weapon Skin", "weapons/skins", skinSchema);
|
|
2331
|
+
var weaponSkinChromas = collection("Weapon Skin Chromas", "Weapon Skin Chroma", "weapons/skinchromas", asset);
|
|
2332
|
+
var weaponSkinLevels = collection("Weapon Skin Levels", "Weapon Skin Level", "weapons/skinlevels", asset);
|
|
2333
|
+
var catalogEndpoints = {
|
|
2334
|
+
agents: agents.list,
|
|
2335
|
+
agent: agents.one,
|
|
2336
|
+
buddies: buddies.list,
|
|
2337
|
+
buddy: buddies.one,
|
|
2338
|
+
buddyLevels: buddyLevels.list,
|
|
2339
|
+
buddyLevel: buddyLevels.one,
|
|
2340
|
+
bundles: bundles.list,
|
|
2341
|
+
bundle: bundles.one,
|
|
2342
|
+
ceremonies: ceremonies.list,
|
|
2343
|
+
ceremony: ceremonies.one,
|
|
2344
|
+
competitiveTiers: competitiveTiers.list,
|
|
2345
|
+
competitiveTier: competitiveTiers.one,
|
|
2346
|
+
contentTiers: contentTiers.list,
|
|
2347
|
+
contentTier: contentTiers.one,
|
|
2348
|
+
contracts: contracts2.list,
|
|
2349
|
+
contract: contracts2.one,
|
|
2350
|
+
currencies: currencies.list,
|
|
2351
|
+
currency: currencies.one,
|
|
2352
|
+
events: events.list,
|
|
2353
|
+
event: events.one,
|
|
2354
|
+
flex: flex.list,
|
|
2355
|
+
flexItem: flex.one,
|
|
2356
|
+
gamemodes: gamemodes.list,
|
|
2357
|
+
gamemode: gamemodes.one,
|
|
2358
|
+
gamemodeEquippables: gamemodeEquippables.list,
|
|
2359
|
+
gamemodeEquippable: gamemodeEquippables.one,
|
|
2360
|
+
gear: gear.list,
|
|
2361
|
+
gearItem: gear.one,
|
|
2362
|
+
levelBorders: levelBorders.list,
|
|
2363
|
+
levelBorder: levelBorders.one,
|
|
2364
|
+
maps: maps.list,
|
|
2365
|
+
map: maps.one,
|
|
2366
|
+
missions: missions.list,
|
|
2367
|
+
mission: missions.one,
|
|
2368
|
+
playerCards: playerCards.list,
|
|
2369
|
+
playerCard: playerCards.one,
|
|
2370
|
+
playerTitles: playerTitles.list,
|
|
2371
|
+
playerTitle: playerTitles.one,
|
|
2372
|
+
seasons: seasons.list,
|
|
2373
|
+
season: seasons.one,
|
|
2374
|
+
competitiveSeasons: competitiveSeasons.list,
|
|
2375
|
+
competitiveSeason: competitiveSeasons.one,
|
|
2376
|
+
sprays: sprays.list,
|
|
2377
|
+
spray: sprays.one,
|
|
2378
|
+
sprayLevels: sprayLevels.list,
|
|
2379
|
+
sprayLevel: sprayLevels.one,
|
|
2380
|
+
themes: themes.list,
|
|
2381
|
+
theme: themes.one,
|
|
2382
|
+
version: endpoint("Version", "Current game version and the matching client version", "version", versionSchema),
|
|
2383
|
+
weapons: weapons.list,
|
|
2384
|
+
weapon: weapons.one,
|
|
2385
|
+
weaponSkins: weaponSkins.list,
|
|
2386
|
+
weaponSkin: weaponSkins.one,
|
|
2387
|
+
weaponSkinChromas: weaponSkinChromas.list,
|
|
2388
|
+
weaponSkinChroma: weaponSkinChromas.one,
|
|
2389
|
+
weaponSkinLevels: weaponSkinLevels.list,
|
|
2390
|
+
weaponSkinLevel: weaponSkinLevels.one
|
|
622
2391
|
};
|
|
623
2392
|
|
|
2393
|
+
// src/api/groups/catalog.ts
|
|
2394
|
+
var catalog = catalogEndpoints;
|
|
2395
|
+
|
|
624
2396
|
// src/api/registry.ts
|
|
625
2397
|
var registry = {
|
|
626
|
-
pvp
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
get: e.partyEndpoint,
|
|
642
|
-
player: e.partyPlayerEndpoint,
|
|
643
|
-
removePlayer: e.partyRemovePlayerEndpoint,
|
|
644
|
-
setMemberReady: e.partySetMemberReadyEndpoint,
|
|
645
|
-
refreshCompetitiveTier: e.refreshCompetitiveTierEndpoint,
|
|
646
|
-
refreshPlayerIdentity: e.refreshPlayerIdentityEndpoint,
|
|
647
|
-
refreshPings: e.refreshPingsEndpoint,
|
|
648
|
-
changeQueue: e.changeQueueEndpoint,
|
|
649
|
-
startCustomGame: e.startCustomGameEndpoint,
|
|
650
|
-
enterMatchmakingQueue: e.enterMatchmakingQueueEndpoint,
|
|
651
|
-
leaveMatchmakingQueue: e.leaveMatchmakingQueueEndpoint,
|
|
652
|
-
setAccessibility: e.setPartyAccessibilityEndpoint,
|
|
653
|
-
setCustomGameSettings: e.setCustomGameSettingsEndpoint,
|
|
654
|
-
invite: e.partyInviteEndpoint,
|
|
655
|
-
requestToJoin: e.partyRequestEndpoint,
|
|
656
|
-
declineRequest: e.partyDeclineEndpoint,
|
|
657
|
-
customGameConfigs: e.customGameConfigsEndpoint,
|
|
658
|
-
chatToken: e.partyChatTokenEndpoint,
|
|
659
|
-
voiceToken: e.partyVoiceTokenEndpoint,
|
|
660
|
-
disableCode: e.partyDisableCodeEndpoint,
|
|
661
|
-
generateCode: e.partyGenerateCodeEndpoint,
|
|
662
|
-
joinByCode: e.partyJoinByCodeEndpoint
|
|
663
|
-
},
|
|
664
|
-
store: {
|
|
665
|
-
prices: e.pricesEndpoint,
|
|
666
|
-
storefront: e.storefrontEndpoint,
|
|
667
|
-
wallet: e.walletEndpoint,
|
|
668
|
-
ownedItems: e.ownedItemsEndpoint,
|
|
669
|
-
storefrontV3: storefrontV3Endpoint,
|
|
670
|
-
order: storeOrderEndpoint
|
|
671
|
-
},
|
|
672
|
-
pregame: {
|
|
673
|
-
player: e.pregamePlayerEndpoint,
|
|
674
|
-
match: e.pregameMatchEndpoint,
|
|
675
|
-
loadouts: e.pregameLoadoutsEndpoint,
|
|
676
|
-
selectCharacter: e.selectCharacterEndpoint,
|
|
677
|
-
lockCharacter: e.lockCharacterEndpoint,
|
|
678
|
-
quit: e.pregameQuitEndpoint,
|
|
679
|
-
chatToken: pregameChatTokenEndpoint,
|
|
680
|
-
voiceToken: pregameVoiceTokenEndpoint
|
|
681
|
-
},
|
|
682
|
-
currentGame: {
|
|
683
|
-
player: e.currentGamePlayerEndpoint,
|
|
684
|
-
match: e.currentGameMatchEndpoint,
|
|
685
|
-
loadouts: e.currentGameLoadoutsEndpoint,
|
|
686
|
-
quit: e.currentGameQuitEndpoint,
|
|
687
|
-
allChatToken: currentGameAllChatTokenEndpoint,
|
|
688
|
-
teamChatToken: currentGameTeamChatTokenEndpoint
|
|
689
|
-
},
|
|
690
|
-
contracts: {
|
|
691
|
-
itemUpgrades: e.itemUpgradesEndpoint,
|
|
692
|
-
list: e.contractsEndpoint,
|
|
693
|
-
activate: e.activateContractEndpoint,
|
|
694
|
-
activeStory: contractsActiveStoryEndpoint
|
|
695
|
-
},
|
|
696
|
-
local: {
|
|
697
|
-
help: e.localHelpEndpoint,
|
|
698
|
-
sessions: e.sessionsEndpoint,
|
|
699
|
-
rsoUserInfo: e.rsoUserInfoEndpoint,
|
|
700
|
-
clientRegion: e.clientRegionEndpoint,
|
|
701
|
-
accountAlias: e.accountAliasEndpoint,
|
|
702
|
-
entitlementsToken: e.entitlementsTokenEndpoint,
|
|
703
|
-
chatSession: e.chatSessionEndpoint,
|
|
704
|
-
friends: e.friendsEndpoint,
|
|
705
|
-
sendFriendRequest: e.sendFriendRequestEndpoint,
|
|
706
|
-
removeFriendRequest: e.removeFriendRequestEndpoint,
|
|
707
|
-
presence: e.presenceEndpoint,
|
|
708
|
-
friendRequests: e.friendRequestsEndpoint,
|
|
709
|
-
swaggerDocs: e.localSwaggerDocsEndpoint,
|
|
710
|
-
antiAddictionShutdown: localAntiAddictionShutdownEndpoint,
|
|
711
|
-
antiAddictionWarning: localAntiAddictionWarningEndpoint,
|
|
712
|
-
clientConfig: localClientConfigEndpoint,
|
|
713
|
-
eula: localEulaEndpoint,
|
|
714
|
-
privacyPolicy: localPrivacyPolicyEndpoint,
|
|
715
|
-
availableLocales: localAvailableLocalesEndpoint,
|
|
716
|
-
locale: localLocaleEndpoint,
|
|
717
|
-
reporterFeedback: localReporterFeedbackEndpoint,
|
|
718
|
-
commandLineArgs: localCommandLineArgsEndpoint,
|
|
719
|
-
riotStatus: localRiotStatusEndpoint,
|
|
720
|
-
riotWarning: localRiotWarningEndpoint,
|
|
721
|
-
clientAuthorizations: localClientAuthorizationsEndpoint,
|
|
722
|
-
accessToken: localAccessTokenEndpoint,
|
|
723
|
-
userInfoToken: localUserInfoTokenEndpoint,
|
|
724
|
-
pluginStatus: localPluginStatusEndpoint,
|
|
725
|
-
rmsSession: localRmsSessionEndpoint,
|
|
726
|
-
processInfo: localProcessInfoEndpoint,
|
|
727
|
-
logPath: localLogPathEndpoint,
|
|
728
|
-
playerSettings: localPlayerSettingsEndpoint
|
|
729
|
-
},
|
|
730
|
-
chat: {
|
|
731
|
-
partyInfo: e.partyChatInfoEndpoint,
|
|
732
|
-
pregameInfo: e.pregameChatInfoEndpoint,
|
|
733
|
-
currentGameInfo: e.currentGameChatInfoEndpoint,
|
|
734
|
-
allInfo: e.allChatInfoEndpoint,
|
|
735
|
-
participants: e.chatParticipantsEndpoint,
|
|
736
|
-
send: e.sendChatEndpoint,
|
|
737
|
-
history: e.chatHistoryEndpoint,
|
|
738
|
-
settings: chatSettingsEndpoint,
|
|
739
|
-
tournamentInfo: chatTournamentInfoEndpoint
|
|
740
|
-
},
|
|
741
|
-
session: {
|
|
742
|
-
get: sessionGetEndpoint,
|
|
743
|
-
reconnect: sessionReconnectEndpoint
|
|
744
|
-
},
|
|
745
|
-
voice: {
|
|
746
|
-
audioProperties: voiceAudioPropertiesEndpoint,
|
|
747
|
-
captureDevices: voiceCaptureDevicesEndpoint,
|
|
748
|
-
renderDevices: voiceRenderDevicesEndpoint,
|
|
749
|
-
pushToTalk: voicePushToTalkEndpoint,
|
|
750
|
-
sessions: voiceSessionsEndpoint,
|
|
751
|
-
settings: voiceSettingsEndpoint
|
|
752
|
-
},
|
|
753
|
-
auth: {
|
|
754
|
-
cookies: e.authCookiesEndpoint,
|
|
755
|
-
request: e.authRequestEndpoint,
|
|
756
|
-
multiFactor: e.multiFactorAuthenticationEndpoint,
|
|
757
|
-
cookieReauth: e.cookieReauthEndpoint,
|
|
758
|
-
entitlement: e.entitlementEndpoint,
|
|
759
|
-
playerInfo: e.playerInfoEndpoint,
|
|
760
|
-
riotGeo: e.riotGeoEndpoint,
|
|
761
|
-
pasToken: e.pasTokenEndpoint,
|
|
762
|
-
riotClientConfig: e.riotClientConfigEndpoint
|
|
763
|
-
},
|
|
764
|
-
catalog: catalogEndpoints
|
|
2398
|
+
pvp,
|
|
2399
|
+
party,
|
|
2400
|
+
store,
|
|
2401
|
+
pregame,
|
|
2402
|
+
currentGame,
|
|
2403
|
+
contracts,
|
|
2404
|
+
local,
|
|
2405
|
+
chat,
|
|
2406
|
+
voice,
|
|
2407
|
+
premier,
|
|
2408
|
+
esports,
|
|
2409
|
+
restrictions,
|
|
2410
|
+
account,
|
|
2411
|
+
auth,
|
|
2412
|
+
catalog
|
|
765
2413
|
};
|
|
766
2414
|
|
|
767
2415
|
// src/auth.ts
|
|
768
|
-
import { endpoints as
|
|
2416
|
+
import { endpoints as e19 } from "valorant-api-types";
|
|
769
2417
|
|
|
770
2418
|
// src/errors.ts
|
|
771
2419
|
var ValorantError = class extends Error {
|
|
@@ -894,7 +2542,7 @@ function createAuthFlows(client) {
|
|
|
894
2542
|
return toLoginResult(data);
|
|
895
2543
|
},
|
|
896
2544
|
async reauthenticate(options) {
|
|
897
|
-
const response = await client.send(
|
|
2545
|
+
const response = await client.send(e19.cookieReauthEndpoint);
|
|
898
2546
|
const tokens = parseAuthRedirect(response.headers.get("location") ?? "");
|
|
899
2547
|
if (tokens === void 0) throw new ValorantError("Cookie reauthentication failed: the session cookies are missing or expired, log in again");
|
|
900
2548
|
applyTokens(tokens);
|
|
@@ -926,7 +2574,7 @@ function createAuthFlows(client) {
|
|
|
926
2574
|
}
|
|
927
2575
|
|
|
928
2576
|
// src/context.ts
|
|
929
|
-
var DEFAULT_PLATFORM =
|
|
2577
|
+
var DEFAULT_PLATFORM = toBase64(JSON.stringify({
|
|
930
2578
|
platformType: "PC",
|
|
931
2579
|
platformOS: "Windows",
|
|
932
2580
|
platformOSVersion: "10.0.19042.1.256.64bit",
|
|
@@ -1085,6 +2733,258 @@ var localTransport = async (request) => {
|
|
|
1085
2733
|
});
|
|
1086
2734
|
};
|
|
1087
2735
|
|
|
2736
|
+
// src/internal/body.ts
|
|
2737
|
+
import { ZodError } from "zod";
|
|
2738
|
+
function parseBody(text2) {
|
|
2739
|
+
if (text2 === "") return void 0;
|
|
2740
|
+
try {
|
|
2741
|
+
return JSON.parse(text2);
|
|
2742
|
+
} catch {
|
|
2743
|
+
return text2;
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
function safeParse(schema, data) {
|
|
2747
|
+
try {
|
|
2748
|
+
return schema.safeParse(data);
|
|
2749
|
+
} catch (thrown) {
|
|
2750
|
+
if (thrown instanceof ZodError) return { success: false, error: thrown };
|
|
2751
|
+
const message = thrown instanceof Error ? thrown.message : String(thrown);
|
|
2752
|
+
return { success: false, error: new ZodError([{ code: "custom", path: [], message: `Schema transform threw: ${message}` }]) };
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
// src/internal/cookies.ts
|
|
2757
|
+
function storeCookies(context, setCookies) {
|
|
2758
|
+
for (const line of setCookies) {
|
|
2759
|
+
const [pair = "", ...attributes] = line.split(";").map((part) => part.trim());
|
|
2760
|
+
const separator = pair.indexOf("=");
|
|
2761
|
+
if (separator <= 0) continue;
|
|
2762
|
+
const name = pair.slice(0, separator);
|
|
2763
|
+
const value = pair.slice(separator + 1);
|
|
2764
|
+
const expired = value === "" || attributes.some((a) => a.toLowerCase() === "max-age=0");
|
|
2765
|
+
context.setCookie(name, expired ? void 0 : value);
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
// src/internal/retry.ts
|
|
2770
|
+
var RETRYABLE_STATUS = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
|
|
2771
|
+
var IDEMPOTENT = /* @__PURE__ */ new Set(["GET", "HEAD", "PUT", "DELETE"]);
|
|
2772
|
+
function isIdempotent(method) {
|
|
2773
|
+
return IDEMPOTENT.has(method);
|
|
2774
|
+
}
|
|
2775
|
+
function isRetryableStatus(status, method) {
|
|
2776
|
+
return RETRYABLE_STATUS.has(status) && (status === 429 || isIdempotent(method));
|
|
2777
|
+
}
|
|
2778
|
+
function parseRetryAfter(value) {
|
|
2779
|
+
if (value === null) return void 0;
|
|
2780
|
+
const seconds = Number(value);
|
|
2781
|
+
if (Number.isFinite(seconds)) return seconds * 1e3;
|
|
2782
|
+
const date = Date.parse(value);
|
|
2783
|
+
return Number.isNaN(date) ? void 0 : Math.max(0, date - Date.now());
|
|
2784
|
+
}
|
|
2785
|
+
function backoff(attempt, retry) {
|
|
2786
|
+
const base = retry?.baseDelayMs ?? 500;
|
|
2787
|
+
const max = retry?.maxDelayMs ?? 8e3;
|
|
2788
|
+
return Math.min(max, base * 2 ** attempt) * (0.5 + Math.random() / 2);
|
|
2789
|
+
}
|
|
2790
|
+
function sleep(ms, signal) {
|
|
2791
|
+
return new Promise((resolve) => {
|
|
2792
|
+
const timer = setTimeout(done, ms);
|
|
2793
|
+
signal?.addEventListener("abort", done, { once: true });
|
|
2794
|
+
function done() {
|
|
2795
|
+
clearTimeout(timer);
|
|
2796
|
+
signal?.removeEventListener("abort", done);
|
|
2797
|
+
resolve();
|
|
2798
|
+
}
|
|
2799
|
+
});
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
// src/internal/failure.ts
|
|
2803
|
+
function toApiError(endpoint2, request, response) {
|
|
2804
|
+
const body = parseBody(response.text);
|
|
2805
|
+
const args = [response.status, endpoint2.name, request.url, body, response.headers];
|
|
2806
|
+
if (response.status === 429) return new ValorantRateLimitError(...args, parseRetryAfter(response.headers.get("retry-after")));
|
|
2807
|
+
const needsToken = endpoint2.riotRequirements?.token === true;
|
|
2808
|
+
const badClaims = typeof body === "object" && body !== null && body.errorCode === "BAD_CLAIMS";
|
|
2809
|
+
if (needsToken && (response.status === 401 || response.status === 400 && badClaims)) return new ValorantAuthError(...args);
|
|
2810
|
+
return new ValorantApiError(...args);
|
|
2811
|
+
}
|
|
2812
|
+
|
|
2813
|
+
// src/internal/normalize.ts
|
|
2814
|
+
import { z as z20 } from "zod";
|
|
2815
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
2816
|
+
var children = {
|
|
2817
|
+
ZodObject: (def, map) => {
|
|
2818
|
+
const shape = def["shape"]();
|
|
2819
|
+
return { ...def, shape: () => Object.fromEntries(Object.entries(shape).map(([key, value]) => [key, map(value)])) };
|
|
2820
|
+
},
|
|
2821
|
+
ZodArray: (def, map) => ({ ...def, type: map(def["type"]) }),
|
|
2822
|
+
ZodOptional: (def, map) => ({ ...def, innerType: map(def["innerType"]) }),
|
|
2823
|
+
ZodNullable: (def, map) => ({ ...def, innerType: map(def["innerType"]) }),
|
|
2824
|
+
ZodDefault: (def, map) => ({ ...def, innerType: map(def["innerType"]) }),
|
|
2825
|
+
ZodCatch: (def, map) => ({ ...def, innerType: map(def["innerType"]) }),
|
|
2826
|
+
ZodReadonly: (def, map) => ({ ...def, innerType: map(def["innerType"]) }),
|
|
2827
|
+
ZodBranded: (def, map) => ({ ...def, type: map(def["type"]) }),
|
|
2828
|
+
ZodEffects: (def, map) => ({ ...def, schema: map(def["schema"]) }),
|
|
2829
|
+
ZodUnion: (def, map) => ({ ...def, options: def["options"].map(map) }),
|
|
2830
|
+
ZodIntersection: (def, map) => ({ ...def, left: map(def["left"]), right: map(def["right"]) }),
|
|
2831
|
+
ZodRecord: (def, map) => ({ ...def, keyType: map(def["keyType"]), valueType: map(def["valueType"]) }),
|
|
2832
|
+
ZodTuple: (def, map) => ({ ...def, items: def["items"].map(map) }),
|
|
2833
|
+
ZodDiscriminatedUnion: (def, map) => {
|
|
2834
|
+
const optionsMap = new Map([...def["optionsMap"]].map(([key, option]) => [key, map(option)]));
|
|
2835
|
+
return { ...def, options: [...optionsMap.values()], optionsMap };
|
|
2836
|
+
}
|
|
2837
|
+
};
|
|
2838
|
+
function lenientPc(literal) {
|
|
2839
|
+
return z20.preprocess((value) => typeof value === "string" ? value.toUpperCase() : value, literal);
|
|
2840
|
+
}
|
|
2841
|
+
function normalizePlatformLiterals(schema) {
|
|
2842
|
+
const known = cache.get(schema);
|
|
2843
|
+
if (known) return known;
|
|
2844
|
+
const def = schema._def;
|
|
2845
|
+
let result = schema;
|
|
2846
|
+
if (def.typeName === "ZodLiteral" && def["value"] === "PC") {
|
|
2847
|
+
result = lenientPc(schema);
|
|
2848
|
+
} else if (def.typeName === "ZodLazy") {
|
|
2849
|
+
const getter = def["getter"];
|
|
2850
|
+
result = new schema.constructor({ ...def, getter: () => normalizePlatformLiterals(getter()) });
|
|
2851
|
+
} else if (def.typeName && children[def.typeName]) {
|
|
2852
|
+
const Type = schema.constructor;
|
|
2853
|
+
result = new Type(children[def.typeName](def, normalizePlatformLiterals));
|
|
2854
|
+
}
|
|
2855
|
+
cache.set(schema, result);
|
|
2856
|
+
return result;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
// src/lobby/mappings.ts
|
|
2860
|
+
var CustomGameTeam = {
|
|
2861
|
+
Defenders: "TeamOne",
|
|
2862
|
+
Attackers: "TeamTwo",
|
|
2863
|
+
Spectators: "TeamSpectate",
|
|
2864
|
+
DefenderCoaches: "TeamOneCoaches",
|
|
2865
|
+
AttackerCoaches: "TeamTwoCoaches"
|
|
2866
|
+
};
|
|
2867
|
+
var MEMBERSHIP_KEY = {
|
|
2868
|
+
TeamOne: "teamOne",
|
|
2869
|
+
TeamTwo: "teamTwo",
|
|
2870
|
+
TeamSpectate: "teamSpectate",
|
|
2871
|
+
TeamOneCoaches: "teamOneCoaches",
|
|
2872
|
+
TeamTwoCoaches: "teamTwoCoaches"
|
|
2873
|
+
};
|
|
2874
|
+
var CustomGameMap = {
|
|
2875
|
+
Ascent: "/Game/Maps/Ascent/Ascent",
|
|
2876
|
+
Split: "/Game/Maps/Bonsai/Bonsai",
|
|
2877
|
+
Fracture: "/Game/Maps/Canyon/Canyon",
|
|
2878
|
+
Bind: "/Game/Maps/Duality/Duality",
|
|
2879
|
+
Breeze: "/Game/Maps/Foxtrot/Foxtrot",
|
|
2880
|
+
Abyss: "/Game/Maps/Infinity/Infinity",
|
|
2881
|
+
Lotus: "/Game/Maps/Jam/Jam",
|
|
2882
|
+
Sunset: "/Game/Maps/Juliett/Juliett",
|
|
2883
|
+
Pearl: "/Game/Maps/Pitt/Pitt",
|
|
2884
|
+
Summit: "/Game/Maps/Plummet/Plummet",
|
|
2885
|
+
Icebox: "/Game/Maps/Port/Port",
|
|
2886
|
+
Corrode: "/Game/Maps/Rook/Rook",
|
|
2887
|
+
Haven: "/Game/Maps/Triad/Triad"
|
|
2888
|
+
};
|
|
2889
|
+
var CustomGameMode = {
|
|
2890
|
+
Standard: "/Game/GameModes/Bomb/BombGameMode.BombGameMode_C",
|
|
2891
|
+
SpikeRush: "/Game/GameModes/QuickBomb/QuickBombGameMode.QuickBombGameMode_C",
|
|
2892
|
+
Deathmatch: "/Game/GameModes/Deathmatch/DeathmatchGameMode.DeathmatchGameMode_C",
|
|
2893
|
+
Escalation: "/Game/GameModes/GunGame/GunGameTeamsGameMode.GunGameTeamsGameMode_C",
|
|
2894
|
+
Skirmish: "/Game/GameModes/Skirmish/SkirmishGameMode.SkirmishGameMode_C"
|
|
2895
|
+
};
|
|
2896
|
+
var RULE_KEY = {
|
|
2897
|
+
allowGameModifiers: "AllowGameModifiers",
|
|
2898
|
+
playOutAllRounds: "PlayOutAllRounds",
|
|
2899
|
+
skipMatchHistory: "SkipMatchHistory",
|
|
2900
|
+
tournamentMode: "TournamentMode",
|
|
2901
|
+
overtimeWinByTwo: "IsOvertimeWinByTwo"
|
|
2902
|
+
};
|
|
2903
|
+
function reverse(table) {
|
|
2904
|
+
return new Map(Object.entries(table).map(([name, value]) => [value, name]));
|
|
2905
|
+
}
|
|
2906
|
+
var mapNames = reverse(CustomGameMap);
|
|
2907
|
+
var modeNames = reverse(CustomGameMode);
|
|
2908
|
+
function customGameMapName(path) {
|
|
2909
|
+
return mapNames.get(path);
|
|
2910
|
+
}
|
|
2911
|
+
function customGameModeName(path) {
|
|
2912
|
+
return modeNames.get(path);
|
|
2913
|
+
}
|
|
2914
|
+
function teamOfPlayer(membership, puuid) {
|
|
2915
|
+
for (const team of Object.values(CustomGameTeam)) {
|
|
2916
|
+
if (membership[MEMBERSHIP_KEY[team]]?.some((member) => member.Subject === puuid)) return team;
|
|
2917
|
+
}
|
|
2918
|
+
return void 0;
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
// src/lobby/flows.ts
|
|
2922
|
+
var DEFAULT_RULES = {
|
|
2923
|
+
AllowGameModifiers: "false",
|
|
2924
|
+
PlayOutAllRounds: "false",
|
|
2925
|
+
SkipMatchHistory: "false",
|
|
2926
|
+
TournamentMode: "false",
|
|
2927
|
+
IsOvertimeWinByTwo: "false"
|
|
2928
|
+
};
|
|
2929
|
+
function ruleStrings(rules) {
|
|
2930
|
+
const out = {};
|
|
2931
|
+
for (const [name, key] of Object.entries(RULE_KEY)) {
|
|
2932
|
+
const value = rules?.[name];
|
|
2933
|
+
if (value !== void 0) out[key] = value ? "true" : "false";
|
|
2934
|
+
}
|
|
2935
|
+
return out;
|
|
2936
|
+
}
|
|
2937
|
+
function currentRules(gameRules) {
|
|
2938
|
+
const out = {};
|
|
2939
|
+
for (const key of Object.keys(DEFAULT_RULES)) {
|
|
2940
|
+
const value = gameRules?.[key];
|
|
2941
|
+
if (value === "true" || value === "false") out[key] = value;
|
|
2942
|
+
}
|
|
2943
|
+
return out;
|
|
2944
|
+
}
|
|
2945
|
+
function createPartyFlows(client) {
|
|
2946
|
+
async function partyIdOf(target) {
|
|
2947
|
+
if (target.partyId !== void 0) return target.partyId;
|
|
2948
|
+
return (await client.party.player({ validation: "off" })).CurrentPartyID;
|
|
2949
|
+
}
|
|
2950
|
+
return {
|
|
2951
|
+
async assignToTeam(team, options = {}) {
|
|
2952
|
+
const partyId = await partyIdOf(options);
|
|
2953
|
+
const puuid = options.puuid ?? client.context.require("puuid");
|
|
2954
|
+
return client.party.setCustomGameTeam({ params: { partyId, team }, body: { playerToPutOnTeam: puuid } });
|
|
2955
|
+
},
|
|
2956
|
+
async configureLobby(options) {
|
|
2957
|
+
const partyId = await partyIdOf(options);
|
|
2958
|
+
const { Settings: current } = (await client.party.getCustomGame({ params: { partyId }, validation: "off" })).CustomGameData;
|
|
2959
|
+
await client.party.setCustomGameSettings({
|
|
2960
|
+
params: { partyId },
|
|
2961
|
+
validation: "off",
|
|
2962
|
+
body: {
|
|
2963
|
+
Map: options.map ?? current.Map,
|
|
2964
|
+
Mode: options.mode ?? current.Mode,
|
|
2965
|
+
UseBots: current.UseBots,
|
|
2966
|
+
GamePod: options.gamePod ?? current.GamePod,
|
|
2967
|
+
GameRules: { ...DEFAULT_RULES, ...currentRules(current.GameRules), ...ruleStrings(options.rules) }
|
|
2968
|
+
}
|
|
2969
|
+
});
|
|
2970
|
+
return (await client.party.getCustomGame({ params: { partyId } })).CustomGameData.Settings;
|
|
2971
|
+
}
|
|
2972
|
+
};
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2975
|
+
// src/internal/gamelog.ts
|
|
2976
|
+
var VERSION_LINE = /CI server version: (release-[\w.]+-shipping-\d+-\d+)/;
|
|
2977
|
+
async function readInstalledClientVersion(logPath) {
|
|
2978
|
+
const { readFile } = await import("fs/promises");
|
|
2979
|
+
const { join } = await import("path");
|
|
2980
|
+
const file = logPath ?? join(process.env["LOCALAPPDATA"] ?? "", "VALORANT", "Saved", "Logs", "ShooterGame.log");
|
|
2981
|
+
try {
|
|
2982
|
+
return VERSION_LINE.exec(await readFile(file, "latin1"))?.[1];
|
|
2983
|
+
} catch {
|
|
2984
|
+
return void 0;
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
|
|
1088
2988
|
// src/local.ts
|
|
1089
2989
|
function parseLockfile(content) {
|
|
1090
2990
|
const [name, pid, port, password, protocol] = content.trim().split(":");
|
|
@@ -1112,7 +3012,6 @@ function createLocalFlows(client) {
|
|
|
1112
3012
|
const sessions = await client.local.sessions();
|
|
1113
3013
|
const valorant = Object.values(sessions).find((session) => session.productId === "valorant");
|
|
1114
3014
|
if (valorant) {
|
|
1115
|
-
ctx.set("clientVersion", valorant.version);
|
|
1116
3015
|
const region = launchArgument(valorant.launchConfiguration.arguments, "ares-deployment");
|
|
1117
3016
|
if (region !== void 0 && isRegion(region)) ctx.update({ region, shard: shardForRegion(region) });
|
|
1118
3017
|
}
|
|
@@ -1121,9 +3020,9 @@ function createLocalFlows(client) {
|
|
|
1121
3020
|
const affinity = Object.values(info.affinity ?? {}).find(isRegion);
|
|
1122
3021
|
if (affinity !== void 0) ctx.applyAffinity(affinity);
|
|
1123
3022
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
3023
|
+
const installed = await readInstalledClientVersion(options?.gameLogPath);
|
|
3024
|
+
if (installed !== void 0) ctx.set("clientVersion", installed);
|
|
3025
|
+
else if (options?.fetchClientVersion !== false) await client.auth.fetchClientVersion().catch(() => void 0);
|
|
1127
3026
|
},
|
|
1128
3027
|
async events() {
|
|
1129
3028
|
return openEventStream(ctx);
|
|
@@ -1142,7 +3041,7 @@ async function openEventStream(ctx) {
|
|
|
1142
3041
|
throw new ValorantError('The local event stream needs the optional "ws" package: npm install ws', { cause });
|
|
1143
3042
|
}
|
|
1144
3043
|
const socket = new WebSocket(`wss://127.0.0.1:${ctx.require("localPort")}`, {
|
|
1145
|
-
headers: { Authorization:
|
|
3044
|
+
headers: { Authorization: basicAuth("riot", ctx.require("localPassword")) },
|
|
1146
3045
|
rejectUnauthorized: false
|
|
1147
3046
|
});
|
|
1148
3047
|
const listeners = /* @__PURE__ */ new Set();
|
|
@@ -1168,6 +3067,18 @@ async function openEventStream(ctx) {
|
|
|
1168
3067
|
};
|
|
1169
3068
|
}
|
|
1170
3069
|
|
|
3070
|
+
// src/pregame/flows.ts
|
|
3071
|
+
function createPregameFlows(client) {
|
|
3072
|
+
return {
|
|
3073
|
+
async pickAgent(agent, options = {}) {
|
|
3074
|
+
const preGameMatchId = options.matchId ?? (await client.pregame.player({ validation: "off" })).MatchID;
|
|
3075
|
+
const params = { preGameMatchId, agentId: agent };
|
|
3076
|
+
const selected = await client.pregame.selectCharacter({ params });
|
|
3077
|
+
return options.lock ? client.pregame.lockCharacter({ params }) : selected;
|
|
3078
|
+
}
|
|
3079
|
+
};
|
|
3080
|
+
}
|
|
3081
|
+
|
|
1171
3082
|
// src/request.ts
|
|
1172
3083
|
import { typeToPrefix } from "valorant-api-types";
|
|
1173
3084
|
|
|
@@ -1221,7 +3132,7 @@ function resolveHeaders(endpoint2, input, ctx, url) {
|
|
|
1221
3132
|
const userAgent = ctx.get("userAgent");
|
|
1222
3133
|
if (userAgent) headers["User-Agent"] = userAgent;
|
|
1223
3134
|
if (need.token) headers["Authorization"] = `Bearer ${ctx.require("accessToken")}`;
|
|
1224
|
-
if (need.localAuth) headers["Authorization"] =
|
|
3135
|
+
if (need.localAuth) headers["Authorization"] = basicAuth("riot", ctx.require("localPassword"));
|
|
1225
3136
|
if (need.entitlement) headers["X-Riot-Entitlements-JWT"] = ctx.require("entitlementToken");
|
|
1226
3137
|
if (need.clientVersion) headers["X-Riot-ClientVersion"] = ctx.require("clientVersion");
|
|
1227
3138
|
if (need.clientPlatform) headers["X-Riot-ClientPlatform"] = ctx.require("clientPlatform");
|
|
@@ -1250,8 +3161,6 @@ function buildRequest(endpoint2, input, ctx) {
|
|
|
1250
3161
|
}
|
|
1251
3162
|
|
|
1252
3163
|
// src/client.ts
|
|
1253
|
-
var RETRYABLE_STATUS = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
|
|
1254
|
-
var IDEMPOTENT = /* @__PURE__ */ new Set(["GET", "HEAD", "PUT", "DELETE"]);
|
|
1255
3164
|
var ValorantClient = class {
|
|
1256
3165
|
context;
|
|
1257
3166
|
#options;
|
|
@@ -1267,7 +3176,7 @@ var ValorantClient = class {
|
|
|
1267
3176
|
const input = options;
|
|
1268
3177
|
const validation = input.validation ?? this.#options.validation ?? "loose";
|
|
1269
3178
|
if (validation === "strict" && endpoint2.body !== void 0 && input.body !== void 0) {
|
|
1270
|
-
const parsed = endpoint2.body.safeParse(input.body);
|
|
3179
|
+
const parsed = normalizePlatformLiterals(endpoint2.body).safeParse(input.body);
|
|
1271
3180
|
if (!parsed.success) throw new ValorantValidationError("request", endpoint2.name, parsed.error, input.body);
|
|
1272
3181
|
}
|
|
1273
3182
|
const retry = this.#options.retry === false ? void 0 : this.#options.retry ?? {};
|
|
@@ -1280,13 +3189,13 @@ var ValorantClient = class {
|
|
|
1280
3189
|
try {
|
|
1281
3190
|
response = await this.#transportFor(endpoint2)({ ...request, signal: this.#signal(input) });
|
|
1282
3191
|
} catch (cause) {
|
|
1283
|
-
if (canRetry &&
|
|
3192
|
+
if (canRetry && isIdempotent(request.method) && input.signal?.aborted !== true) {
|
|
1284
3193
|
await sleep(backoff(attempt, retry), input.signal);
|
|
1285
3194
|
continue;
|
|
1286
3195
|
}
|
|
1287
3196
|
throw new ValorantNetworkError(`${endpoint2.name} could not reach ${new URL(request.url).host}`, request.url, { cause });
|
|
1288
3197
|
}
|
|
1289
|
-
if (isAuthHost(request.url))
|
|
3198
|
+
if (isAuthHost(request.url)) storeCookies(this.context, response.setCookies);
|
|
1290
3199
|
this.#options.logger?.debug?.(`${request.method} ${request.url} -> ${response.status}`);
|
|
1291
3200
|
if (response.status < 400) {
|
|
1292
3201
|
return {
|
|
@@ -1295,13 +3204,13 @@ var ValorantClient = class {
|
|
|
1295
3204
|
data: this.#parseResponse(endpoint2, response, validation)
|
|
1296
3205
|
};
|
|
1297
3206
|
}
|
|
1298
|
-
const error =
|
|
3207
|
+
const error = toApiError(endpoint2, request, response);
|
|
1299
3208
|
if (error instanceof ValorantAuthError && this.#options.refreshTokens && !refreshed) {
|
|
1300
3209
|
refreshed = true;
|
|
1301
3210
|
await this.#refreshOnce();
|
|
1302
3211
|
continue;
|
|
1303
3212
|
}
|
|
1304
|
-
if (canRetry &&
|
|
3213
|
+
if (canRetry && isRetryableStatus(response.status, request.method)) {
|
|
1305
3214
|
const retryAfter = error instanceof ValorantRateLimitError ? error.retryAfterMs : void 0;
|
|
1306
3215
|
await sleep(retryAfter ?? backoff(attempt, retry), input.signal);
|
|
1307
3216
|
continue;
|
|
@@ -1319,6 +3228,8 @@ var ValorantClient = class {
|
|
|
1319
3228
|
}
|
|
1320
3229
|
Object.assign(api["auth"], createAuthFlows(this));
|
|
1321
3230
|
Object.assign(api["local"], createLocalFlows(this));
|
|
3231
|
+
Object.assign(api["party"], createPartyFlows(this));
|
|
3232
|
+
Object.assign(api["pregame"], createPregameFlows(this));
|
|
1322
3233
|
return api;
|
|
1323
3234
|
}
|
|
1324
3235
|
#transportFor(endpoint2) {
|
|
@@ -1333,20 +3244,10 @@ var ValorantClient = class {
|
|
|
1333
3244
|
const timeout = AbortSignal.timeout(input.timeoutMs ?? this.#options.timeoutMs ?? 15e3);
|
|
1334
3245
|
return input.signal ? AbortSignal.any([input.signal, timeout]) : timeout;
|
|
1335
3246
|
}
|
|
1336
|
-
#storeCookies(setCookies) {
|
|
1337
|
-
for (const line of setCookies) {
|
|
1338
|
-
const [pair = "", ...attributes] = line.split(";").map((part) => part.trim());
|
|
1339
|
-
const separator = pair.indexOf("=");
|
|
1340
|
-
if (separator <= 0) continue;
|
|
1341
|
-
const name = pair.slice(0, separator);
|
|
1342
|
-
const value = pair.slice(separator + 1);
|
|
1343
|
-
const expired = value === "" || attributes.some((a) => a.toLowerCase() === "max-age=0");
|
|
1344
|
-
this.context.setCookie(name, expired ? void 0 : value);
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
3247
|
#parseResponse(endpoint2, response, validation) {
|
|
1348
3248
|
const data = unwrapEnvelope(endpoint2, parseBody(response.text));
|
|
1349
|
-
const
|
|
3249
|
+
const published = endpoint2.responses?.[String(response.status)];
|
|
3250
|
+
const schema = published && normalizePlatformLiterals(published);
|
|
1350
3251
|
if (schema === void 0 || validation === "off") return data;
|
|
1351
3252
|
const parsed = safeParse(schema, data);
|
|
1352
3253
|
if (parsed.success) return parsed.data;
|
|
@@ -1357,15 +3258,6 @@ var ValorantClient = class {
|
|
|
1357
3258
|
}
|
|
1358
3259
|
return data;
|
|
1359
3260
|
}
|
|
1360
|
-
#toError(endpoint2, request, response) {
|
|
1361
|
-
const body = parseBody(response.text);
|
|
1362
|
-
const args = [response.status, endpoint2.name, request.url, body, response.headers];
|
|
1363
|
-
if (response.status === 429) return new ValorantRateLimitError(...args, parseRetryAfter(response.headers.get("retry-after")));
|
|
1364
|
-
const needsToken = endpoint2.riotRequirements?.token === true;
|
|
1365
|
-
const badClaims = typeof body === "object" && body !== null && body.errorCode === "BAD_CLAIMS";
|
|
1366
|
-
if (needsToken && (response.status === 401 || response.status === 400 && badClaims)) return new ValorantAuthError(...args);
|
|
1367
|
-
return new ValorantApiError(...args);
|
|
1368
|
-
}
|
|
1369
3261
|
#refreshOnce() {
|
|
1370
3262
|
this.#refreshing ??= Promise.resolve(this.#options.refreshTokens(this)).finally(() => {
|
|
1371
3263
|
this.#refreshing = void 0;
|
|
@@ -1373,50 +3265,53 @@ var ValorantClient = class {
|
|
|
1373
3265
|
return this.#refreshing;
|
|
1374
3266
|
}
|
|
1375
3267
|
};
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
}
|
|
1414
|
-
});
|
|
3268
|
+
|
|
3269
|
+
// src/pregame/agents.ts
|
|
3270
|
+
var Agent = {
|
|
3271
|
+
Astra: "41fb69c1-4189-7b37-f117-bcaf1e96f1bf",
|
|
3272
|
+
Breach: "5f8d3a7f-467b-97f3-062c-13acf203c006",
|
|
3273
|
+
Brimstone: "9f0d8ba9-4140-b941-57d3-a7ad57c6b417",
|
|
3274
|
+
Chamber: "22697a3d-45bf-8dd7-4fec-84a9e28c69d7",
|
|
3275
|
+
Clove: "1dbf2edd-4729-0984-3115-daa5eed44993",
|
|
3276
|
+
Cypher: "117ed9e3-49f3-6512-3ccf-0cada7e3823b",
|
|
3277
|
+
Deadlock: "cc8b64c8-4b25-4ff9-6e7f-37b4da43d235",
|
|
3278
|
+
Fade: "dade69b4-4f5a-8528-247b-219e5a1facd6",
|
|
3279
|
+
Gekko: "e370fa57-4757-3604-3648-499e1f642d3f",
|
|
3280
|
+
Harbor: "95b78ed7-4637-86d9-7e41-71ba8c293152",
|
|
3281
|
+
Hush: "ddd5a15c-4fbe-42fa-3789-11a55ca5ee04",
|
|
3282
|
+
Iso: "0e38b510-41a8-5780-5e8f-568b2a4f2d6c",
|
|
3283
|
+
Jett: "add6443a-41bd-e414-f6ad-e58d267f4e95",
|
|
3284
|
+
KayO: "601dbbe7-43ce-be57-2a40-4abd24953621",
|
|
3285
|
+
Killjoy: "1e58de9c-4950-5125-93e9-a0aee9f98746",
|
|
3286
|
+
Miks: "7c8a4701-4de6-9355-b254-e09bc2a34b72",
|
|
3287
|
+
Neon: "bb2a4828-46eb-8cd1-e765-15848195d751",
|
|
3288
|
+
Omen: "8e253930-4c05-31dd-1b6c-968525494517",
|
|
3289
|
+
Phoenix: "eb93336a-449b-9c1b-0a54-a891f7921d69",
|
|
3290
|
+
Raze: "f94c3b30-42be-e959-889c-5aa313dba261",
|
|
3291
|
+
Reyna: "a3bfb853-43b2-7238-a4f1-ad90e9e46bcc",
|
|
3292
|
+
Sage: "569fdd95-4d10-43ab-ca70-79becc718b46",
|
|
3293
|
+
Skye: "6f2a04ca-43e0-be17-7f36-b3908627744d",
|
|
3294
|
+
Sova: "320b2a48-4d9b-a075-30f1-1f93a9b638fa",
|
|
3295
|
+
Tejo: "b444168c-4e35-8076-db47-ef9bf368f384",
|
|
3296
|
+
Veto: "92eeef5d-43b5-1d4a-8d03-b3927a09034b",
|
|
3297
|
+
Viper: "707eab51-4836-f488-046a-cda6bf494859",
|
|
3298
|
+
Vyse: "efba5359-4016-a1e5-7626-b1ae76895940",
|
|
3299
|
+
Waylay: "df1cb487-4902-002e-5c17-d28e83e78588",
|
|
3300
|
+
Yoru: "7f94d92c-4234-0a36-9646-3a87eb8b5c89"
|
|
3301
|
+
};
|
|
3302
|
+
var names = new Map(Object.entries(Agent).map(([name, id]) => [id, name]));
|
|
3303
|
+
function agentName(id) {
|
|
3304
|
+
return names.get(id);
|
|
1415
3305
|
}
|
|
1416
3306
|
|
|
1417
3307
|
// src/index.ts
|
|
1418
3308
|
export * from "valorant-api-types";
|
|
1419
3309
|
export {
|
|
3310
|
+
Agent,
|
|
3311
|
+
CustomGameMap,
|
|
3312
|
+
CustomGameMode,
|
|
3313
|
+
CustomGameTeam,
|
|
3314
|
+
MEMBERSHIP_KEY,
|
|
1420
3315
|
MissingContextError,
|
|
1421
3316
|
MissingParameterError,
|
|
1422
3317
|
ValorantApiError,
|
|
@@ -1427,6 +3322,9 @@ export {
|
|
|
1427
3322
|
ValorantNetworkError,
|
|
1428
3323
|
ValorantRateLimitError,
|
|
1429
3324
|
ValorantValidationError,
|
|
3325
|
+
agentName,
|
|
3326
|
+
customGameMapName,
|
|
3327
|
+
customGameModeName,
|
|
1430
3328
|
fetchTransport,
|
|
1431
3329
|
isRegion,
|
|
1432
3330
|
localTransport,
|
|
@@ -1434,6 +3332,7 @@ export {
|
|
|
1434
3332
|
parseLockfile,
|
|
1435
3333
|
readLockfile,
|
|
1436
3334
|
registry,
|
|
1437
|
-
shardForRegion
|
|
3335
|
+
shardForRegion,
|
|
3336
|
+
teamOfPlayer
|
|
1438
3337
|
};
|
|
1439
3338
|
//# sourceMappingURL=index.js.map
|