speedruncom.js 1.3.1 → 2.0.1
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/README.md +4 -40
- package/lib/Client.d.ts +11 -0
- package/lib/Client.js +23 -0
- package/lib/endpoints/endpoints.get.d.ts +537 -0
- package/{dist → lib}/endpoints/endpoints.get.js +1 -1
- package/lib/endpoints/endpoints.post.d.ts +1055 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/{dist → lib}/interfaces.d.ts +2 -2
- package/lib/responses.d.ts +553 -0
- package/package.json +7 -10
- package/src/Client.ts +30 -0
- package/src/endpoints/endpoints.get.ts +480 -500
- package/src/endpoints/endpoints.post.ts +965 -974
- package/src/index.ts +3 -3
- package/src/interfaces.ts +2 -2
- package/src/responses.ts +649 -716
- package/tsconfig.json +1 -2
- package/dist/BaseClient.d.ts +0 -30
- package/dist/BaseClient.js +0 -78
- package/dist/Client.d.ts +0 -222
- package/dist/Client.js +0 -646
- package/dist/build-client.d.ts +0 -1
- package/dist/build-client.js +0 -64
- package/dist/endpoints/endpoints.get.d.ts +0 -560
- package/dist/endpoints/endpoints.post.d.ts +0 -1066
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -4
- package/dist/responses.d.ts +0 -616
- package/src/BaseClient.ts +0 -108
- package/src/build-client.ts +0 -80
- /package/{dist → lib}/endpoints/endpoints.post.js +0 -0
- /package/{dist → lib}/enums.d.ts +0 -0
- /package/{dist → lib}/enums.js +0 -0
- /package/{dist → lib}/interfaces.js +0 -0
- /package/{dist → lib}/responses.js +0 -0
- /package/{dist → lib}/types.d.ts +0 -0
- /package/{dist → lib}/types.js +0 -0
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as Enums from './enums
|
|
1
|
+
import * as Enums from './enums';
|
|
2
2
|
/**
|
|
3
3
|
* A Category item.
|
|
4
4
|
*/
|
|
@@ -982,7 +982,7 @@ interface Run_Base {
|
|
|
982
982
|
/**
|
|
983
983
|
* Availibility and 'status' of the video of a run.
|
|
984
984
|
*/
|
|
985
|
-
readonly
|
|
985
|
+
readonly videoState: Enums.VideoState;
|
|
986
986
|
}
|
|
987
987
|
/**
|
|
988
988
|
* A game speedrun's public data.
|
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
import * as Interfaces from './interfaces';
|
|
2
|
+
export default interface Responses {
|
|
3
|
+
GetGameLeaderboard2: {
|
|
4
|
+
/**
|
|
5
|
+
* Runs in the leaderboard.
|
|
6
|
+
*/
|
|
7
|
+
runList: Interfaces.GameRun[];
|
|
8
|
+
/**
|
|
9
|
+
* Every Player with a run in a game.
|
|
10
|
+
*/
|
|
11
|
+
playerList: Interfaces.Player[];
|
|
12
|
+
pagination: Interfaces.Pagination;
|
|
13
|
+
};
|
|
14
|
+
GetGameLeaderboard: {
|
|
15
|
+
leaderboard: Interfaces.Leaderboard;
|
|
16
|
+
};
|
|
17
|
+
GetGameData: {
|
|
18
|
+
game: Interfaces.Game;
|
|
19
|
+
categories: Interfaces.Category[];
|
|
20
|
+
levels: Interfaces.Level[];
|
|
21
|
+
moderators: Interfaces.GameModerator[];
|
|
22
|
+
platforms: Interfaces.Platform[];
|
|
23
|
+
regions: Interfaces.Region[];
|
|
24
|
+
theme?: Interfaces.Theme[];
|
|
25
|
+
users: Interfaces.User[];
|
|
26
|
+
values: Interfaces.Value[];
|
|
27
|
+
variables: Interfaces.Variable[];
|
|
28
|
+
};
|
|
29
|
+
GetGameSummary: {
|
|
30
|
+
game: Interfaces.Game;
|
|
31
|
+
gameBoosts: Interfaces.GameBoost[];
|
|
32
|
+
gameModerators: Interfaces.GameModerator[];
|
|
33
|
+
forum: Interfaces.Forum;
|
|
34
|
+
newsList: Interfaces.GameNews[];
|
|
35
|
+
gameStats: Interfaces.GameStats[];
|
|
36
|
+
stats: Interfaces.GameStats;
|
|
37
|
+
relatedGames: Interfaces.Game[];
|
|
38
|
+
seriesList: Interfaces.Series[];
|
|
39
|
+
theme: Interfaces.Theme;
|
|
40
|
+
threadList: Interfaces.Thread[];
|
|
41
|
+
users: Interfaces.User[];
|
|
42
|
+
challengeList: Interfaces.Challenge[];
|
|
43
|
+
challengeCount: number;
|
|
44
|
+
guideCount: number;
|
|
45
|
+
levelCount: number;
|
|
46
|
+
newsCount: number;
|
|
47
|
+
relatedCount: number;
|
|
48
|
+
resourceCount: number;
|
|
49
|
+
streamCount: number;
|
|
50
|
+
threadCount: number;
|
|
51
|
+
};
|
|
52
|
+
GetGameRecordHistory: {
|
|
53
|
+
playerList: Interfaces.Player[];
|
|
54
|
+
runList: Interfaces.GameRun[];
|
|
55
|
+
};
|
|
56
|
+
GetSearch: {
|
|
57
|
+
gameList: Interfaces.Game[];
|
|
58
|
+
newsList: Interfaces.GameNews[];
|
|
59
|
+
pageList: Interfaces.Article[];
|
|
60
|
+
seriesList: Interfaces.Series[];
|
|
61
|
+
userList: Interfaces.User[];
|
|
62
|
+
challengeList: Interfaces.Challenge[] | null;
|
|
63
|
+
};
|
|
64
|
+
GetLatestLeaderboard: {
|
|
65
|
+
categories: Interfaces.Category[];
|
|
66
|
+
games: Interfaces.Game[];
|
|
67
|
+
levels: Interfaces.Level[];
|
|
68
|
+
players: Interfaces.Player[];
|
|
69
|
+
regions: Interfaces.Region[];
|
|
70
|
+
runs: Interfaces.GameRun[];
|
|
71
|
+
values: Interfaces.Value[];
|
|
72
|
+
variables: Interfaces.Variable[];
|
|
73
|
+
platforms: Interfaces.Platform[];
|
|
74
|
+
};
|
|
75
|
+
GetRun: {
|
|
76
|
+
game: Interfaces.Game;
|
|
77
|
+
category: Interfaces.Category;
|
|
78
|
+
level?: Interfaces.Level;
|
|
79
|
+
platform?: Interfaces.Platform;
|
|
80
|
+
players: Interfaces.Player[];
|
|
81
|
+
region?: Interfaces.Region;
|
|
82
|
+
run: Interfaces.GameRun;
|
|
83
|
+
users: Interfaces.User[];
|
|
84
|
+
values: Interfaces.Value[];
|
|
85
|
+
variables: Interfaces.Variable[];
|
|
86
|
+
};
|
|
87
|
+
GetUserSummary: {
|
|
88
|
+
user: Interfaces.User;
|
|
89
|
+
userProfile: Interfaces.UserReducedProfile;
|
|
90
|
+
userStats: Interfaces.UserStats;
|
|
91
|
+
/**
|
|
92
|
+
* Empty list if the user has set game follows to private.
|
|
93
|
+
*/
|
|
94
|
+
userGameFollowerStats: Interfaces.UserGameFollow[];
|
|
95
|
+
userGameModeratorStats: Interfaces.UserModerationStats[];
|
|
96
|
+
userGameRunnerStats: Interfaces.UserGameRunnerStats[];
|
|
97
|
+
userSocialConnectionList: Interfaces.UserSocialConnection[];
|
|
98
|
+
games: Interfaces.Game[];
|
|
99
|
+
theme: Interfaces.Theme;
|
|
100
|
+
titleList: Interfaces.Title[];
|
|
101
|
+
};
|
|
102
|
+
GetUserComments: {
|
|
103
|
+
articleList: Interfaces.Article[];
|
|
104
|
+
commentList: Interfaces.Comment[];
|
|
105
|
+
forumList: Interfaces.Forum[];
|
|
106
|
+
gameList: Interfaces.Game[];
|
|
107
|
+
likeList: Interfaces.Like[];
|
|
108
|
+
newsList: Interfaces.GameNews[];
|
|
109
|
+
runList: Interfaces.GameRun[];
|
|
110
|
+
threadList: Interfaces.Thread[];
|
|
111
|
+
userList: Interfaces.User[];
|
|
112
|
+
pagination: Interfaces.Pagination;
|
|
113
|
+
};
|
|
114
|
+
GetUserPopoverData: {
|
|
115
|
+
user: Interfaces.User;
|
|
116
|
+
userProfile: Interfaces.UserReducedProfile;
|
|
117
|
+
userStats: Interfaces.UserStats;
|
|
118
|
+
userSocialConnectionList: Interfaces.UserSocialConnection[];
|
|
119
|
+
/**
|
|
120
|
+
* Contains games sometimes
|
|
121
|
+
*/
|
|
122
|
+
games: Interfaces.Game[];
|
|
123
|
+
titleList: Interfaces.Title[];
|
|
124
|
+
};
|
|
125
|
+
GetTitle: {
|
|
126
|
+
title: Interfaces.Title;
|
|
127
|
+
};
|
|
128
|
+
GetTitleList: {
|
|
129
|
+
titleList: Interfaces.Title[];
|
|
130
|
+
};
|
|
131
|
+
GetArticleList: {
|
|
132
|
+
articleList: Interfaces.Article[];
|
|
133
|
+
pagination: Interfaces.Pagination;
|
|
134
|
+
gameList: Interfaces.Game[];
|
|
135
|
+
userList: Interfaces.User[];
|
|
136
|
+
};
|
|
137
|
+
GetArticle: {
|
|
138
|
+
article: Interfaces.Article;
|
|
139
|
+
relatedArticleList: Interfaces.Article[];
|
|
140
|
+
gameList: Interfaces.Game[];
|
|
141
|
+
userList: Interfaces.User[];
|
|
142
|
+
};
|
|
143
|
+
GetChallenge: {
|
|
144
|
+
challenge: Interfaces.Challenge;
|
|
145
|
+
game: Interfaces.Game;
|
|
146
|
+
moderatorList: Interfaces.ChallengeModerator[];
|
|
147
|
+
standingList: Interfaces.ChallengeStanding[];
|
|
148
|
+
theme: Interfaces.Theme;
|
|
149
|
+
userList: Interfaces.User[];
|
|
150
|
+
challengeRunCount: number;
|
|
151
|
+
gameFollowerCount: number;
|
|
152
|
+
titleList: Interfaces.Title[];
|
|
153
|
+
};
|
|
154
|
+
GetChallengeLeaderboard: {
|
|
155
|
+
challengeRunList: Interfaces.ChallengeRun[];
|
|
156
|
+
playerList: Interfaces.Player[];
|
|
157
|
+
userList: Interfaces.User[];
|
|
158
|
+
pagination: Interfaces.Pagination;
|
|
159
|
+
};
|
|
160
|
+
GetChallengeRun: {
|
|
161
|
+
challenge: Interfaces.Challenge;
|
|
162
|
+
challengeRun: Interfaces.ChallengeRun;
|
|
163
|
+
game: Interfaces.Game;
|
|
164
|
+
playerList: Interfaces.Player[];
|
|
165
|
+
userList: Interfaces.User[];
|
|
166
|
+
};
|
|
167
|
+
GetChallengeGlobalRankingList: {
|
|
168
|
+
rankingList: Interfaces.GlobalChallengeRanking[];
|
|
169
|
+
userList: Interfaces.User[];
|
|
170
|
+
};
|
|
171
|
+
GetGameList: {
|
|
172
|
+
article: Interfaces.Article;
|
|
173
|
+
relatedArticleList: Interfaces.Article[];
|
|
174
|
+
gameList: Interfaces.Game[];
|
|
175
|
+
userList: Interfaces.User[];
|
|
176
|
+
};
|
|
177
|
+
GetPlatformList: {
|
|
178
|
+
platformList: Interfaces.Platform[];
|
|
179
|
+
};
|
|
180
|
+
GetCommentList: {
|
|
181
|
+
commentable: Interfaces.Commentable;
|
|
182
|
+
commentList: Interfaces.Comment[];
|
|
183
|
+
likeList: Interfaces.Like[];
|
|
184
|
+
userList: Interfaces.User[];
|
|
185
|
+
pagination: Interfaces.Pagination;
|
|
186
|
+
};
|
|
187
|
+
GetForumList: {
|
|
188
|
+
forumList: Interfaces.Forum[];
|
|
189
|
+
gameList: Interfaces.Game[];
|
|
190
|
+
userList: Interfaces.User[];
|
|
191
|
+
};
|
|
192
|
+
GetStaticData: {
|
|
193
|
+
areas: Interfaces.Area[];
|
|
194
|
+
colors: Interfaces.Color[];
|
|
195
|
+
gameTypeList: Interfaces.GameTypeDetails[];
|
|
196
|
+
notificationSettings: Interfaces.NotificationSettingStaticData[];
|
|
197
|
+
regionList: Interfaces.Region[];
|
|
198
|
+
socialNetworkList: Interfaces.SocialNetwork[];
|
|
199
|
+
/**
|
|
200
|
+
* Unknown type
|
|
201
|
+
*/
|
|
202
|
+
supporterPlanList?: null;
|
|
203
|
+
};
|
|
204
|
+
GetHomeSummary: {
|
|
205
|
+
stream?: Interfaces.Stream;
|
|
206
|
+
};
|
|
207
|
+
GetSeriesList: {
|
|
208
|
+
seriesList: Interfaces.Series[];
|
|
209
|
+
pagination: Interfaces.Pagination;
|
|
210
|
+
};
|
|
211
|
+
GetSeriesSummary: {
|
|
212
|
+
series: Interfaces.Series;
|
|
213
|
+
forum: Interfaces.Forum;
|
|
214
|
+
gameList: Interfaces.Game[];
|
|
215
|
+
moderatorList: Interfaces.SeriesModerator[];
|
|
216
|
+
theme: Interfaces.Theme;
|
|
217
|
+
threadList: Interfaces.Thread[];
|
|
218
|
+
userList: Interfaces.User[];
|
|
219
|
+
gameCount: number;
|
|
220
|
+
streamCount: number;
|
|
221
|
+
threadCount: number;
|
|
222
|
+
};
|
|
223
|
+
GetGameLevelSummary: {
|
|
224
|
+
category: Interfaces.Category;
|
|
225
|
+
runList: Interfaces.GameRun[];
|
|
226
|
+
playerList: Interfaces.Player[];
|
|
227
|
+
};
|
|
228
|
+
GetGameRandom: {
|
|
229
|
+
game: Interfaces.Game;
|
|
230
|
+
};
|
|
231
|
+
GetGuideList: {
|
|
232
|
+
guideList: Interfaces.Guide[];
|
|
233
|
+
users: Interfaces.User[];
|
|
234
|
+
};
|
|
235
|
+
GetGuide: {
|
|
236
|
+
guideList: Interfaces.Guide[];
|
|
237
|
+
users: Interfaces.User[];
|
|
238
|
+
};
|
|
239
|
+
GetNewsList: {
|
|
240
|
+
newsList: Interfaces.GameNews[];
|
|
241
|
+
users: Interfaces.User[];
|
|
242
|
+
};
|
|
243
|
+
GetNews: {
|
|
244
|
+
news: Interfaces.GameNews;
|
|
245
|
+
users: Interfaces.User[];
|
|
246
|
+
};
|
|
247
|
+
GetResource: {
|
|
248
|
+
resource: Interfaces.Resource;
|
|
249
|
+
game: Interfaces.Game[];
|
|
250
|
+
users: Interfaces.User[];
|
|
251
|
+
};
|
|
252
|
+
GetResourceList: {
|
|
253
|
+
resourceList: Interfaces.Resource[];
|
|
254
|
+
users: Interfaces.User[];
|
|
255
|
+
};
|
|
256
|
+
GetStreamList: {
|
|
257
|
+
gameList: Interfaces.Game[];
|
|
258
|
+
streamList: Interfaces.Stream[];
|
|
259
|
+
userList: Interfaces.User[];
|
|
260
|
+
pagination: Interfaces.Pagination;
|
|
261
|
+
};
|
|
262
|
+
GetThread: {
|
|
263
|
+
thread: Interfaces.Thread;
|
|
264
|
+
commentList: Interfaces.Comment[];
|
|
265
|
+
userList: Interfaces.User[];
|
|
266
|
+
likeList: Interfaces.Like[];
|
|
267
|
+
pagination: Interfaces.Pagination;
|
|
268
|
+
};
|
|
269
|
+
GetThreadList: {
|
|
270
|
+
threadList: Interfaces.Thread[];
|
|
271
|
+
pagination: Interfaces.Pagination;
|
|
272
|
+
users: Interfaces.User[];
|
|
273
|
+
};
|
|
274
|
+
GetThreadStateByCommentId: {
|
|
275
|
+
forum: Interfaces.Forum;
|
|
276
|
+
thread: Interfaces.Thread;
|
|
277
|
+
commentId: string;
|
|
278
|
+
pagination: Interfaces.Pagination;
|
|
279
|
+
};
|
|
280
|
+
GetUserLeaderboard: {
|
|
281
|
+
categories: Interfaces.Category[];
|
|
282
|
+
games: Interfaces.Game[];
|
|
283
|
+
levels: Interfaces.Level[];
|
|
284
|
+
platforms: Interfaces.Platform[];
|
|
285
|
+
regions: Interfaces.Region[];
|
|
286
|
+
runs: Interfaces.GameRun[];
|
|
287
|
+
user: Interfaces.User;
|
|
288
|
+
userProfile: Interfaces.UserReducedProfile;
|
|
289
|
+
users: [];
|
|
290
|
+
players: Interfaces.Player[];
|
|
291
|
+
values: Interfaces.Value[];
|
|
292
|
+
variables: Interfaces.Variable[];
|
|
293
|
+
/**
|
|
294
|
+
* Unused null key
|
|
295
|
+
*/
|
|
296
|
+
followedGameIds: null;
|
|
297
|
+
challengeList: Interfaces.Challenge[];
|
|
298
|
+
challengeRunList: Interfaces.GameRun[];
|
|
299
|
+
};
|
|
300
|
+
GetUserModeration: {
|
|
301
|
+
gameList: Interfaces.Game[];
|
|
302
|
+
gameModeratorList: Interfaces.GameModerator[];
|
|
303
|
+
platformList: Interfaces.Platform[];
|
|
304
|
+
seriesList: Interfaces.Series[];
|
|
305
|
+
seriesModeratorList: Interfaces.SeriesModerator[];
|
|
306
|
+
userGameModeratorStatsList: Interfaces.UserModerationStats[];
|
|
307
|
+
};
|
|
308
|
+
GetUserThreads: {
|
|
309
|
+
commentList: Interfaces.Comment[];
|
|
310
|
+
forumList: Interfaces.Forum[];
|
|
311
|
+
likeList: Interfaces.Like[];
|
|
312
|
+
threadList: Interfaces.Thread[];
|
|
313
|
+
userList: Interfaces.User[];
|
|
314
|
+
pagination: Interfaces.Pagination;
|
|
315
|
+
};
|
|
316
|
+
GetAuditLogList: {
|
|
317
|
+
auditLogList: Interfaces.AuditLogEntry[];
|
|
318
|
+
userList: Interfaces.User[];
|
|
319
|
+
gameList: Interfaces.Game[];
|
|
320
|
+
categoryList: Interfaces.Category[];
|
|
321
|
+
/**
|
|
322
|
+
* Array of `Level`s referenced in an Audit Log.
|
|
323
|
+
* When empty, this is `null`, not an empty array.
|
|
324
|
+
*/
|
|
325
|
+
levelList: Interfaces.Level[] | null;
|
|
326
|
+
variableList: Interfaces.Variable[];
|
|
327
|
+
valueList: Interfaces.Value[];
|
|
328
|
+
runList: Interfaces.GameRun[];
|
|
329
|
+
pagination: Interfaces.Pagination;
|
|
330
|
+
};
|
|
331
|
+
GetCommentable: {
|
|
332
|
+
commentable: Interfaces.Commentable;
|
|
333
|
+
};
|
|
334
|
+
GetConversationMessages: {
|
|
335
|
+
conversation: Interfaces.Conversation;
|
|
336
|
+
participants: Interfaces.ConversationParticipant[];
|
|
337
|
+
messages: Interfaces.ConversationMessage[];
|
|
338
|
+
users: Interfaces.User[];
|
|
339
|
+
userBlocks: Interfaces.UserBlock[];
|
|
340
|
+
};
|
|
341
|
+
GetConversations: {
|
|
342
|
+
conversations: Interfaces.Conversation[];
|
|
343
|
+
participants: Interfaces.ConversationParticipant[];
|
|
344
|
+
users: Interfaces.User[];
|
|
345
|
+
systemMessages: Interfaces.SystemMessage[];
|
|
346
|
+
};
|
|
347
|
+
GetForumReadStatus: {
|
|
348
|
+
forumReadStatusList: Interfaces.ForumReadStatus[];
|
|
349
|
+
};
|
|
350
|
+
GetGameSettings: {
|
|
351
|
+
settings: Interfaces.GameSettings;
|
|
352
|
+
moderatorList: Interfaces.GameModerator[];
|
|
353
|
+
theme: Interfaces.Theme;
|
|
354
|
+
gameList: Interfaces.Game[];
|
|
355
|
+
userList: Interfaces.User[];
|
|
356
|
+
};
|
|
357
|
+
GetModerationGames: {
|
|
358
|
+
/**
|
|
359
|
+
* List of Games you moderate. `null` when not logged in.
|
|
360
|
+
*/
|
|
361
|
+
games: Interfaces.Game[] | null;
|
|
362
|
+
/**
|
|
363
|
+
* `GameModerationStats` of the games you moderate. `null` when not logged in.
|
|
364
|
+
*/
|
|
365
|
+
gameModerationStats: Interfaces.GameModerationStats[] | null;
|
|
366
|
+
};
|
|
367
|
+
GetModerationRuns: {
|
|
368
|
+
categories: Interfaces.Category[];
|
|
369
|
+
games: Interfaces.Game[];
|
|
370
|
+
levels: Interfaces.Level[];
|
|
371
|
+
pagination: Interfaces.Pagination;
|
|
372
|
+
platforms: Interfaces.Platform[];
|
|
373
|
+
players: Interfaces.Player[];
|
|
374
|
+
regions: Interfaces.Region[];
|
|
375
|
+
runs: Interfaces.GameRun[];
|
|
376
|
+
values: Interfaces.Value[];
|
|
377
|
+
variables: Interfaces.Variable[];
|
|
378
|
+
users: Interfaces.User[];
|
|
379
|
+
};
|
|
380
|
+
GetNotifications: {
|
|
381
|
+
unreadCount: number;
|
|
382
|
+
notifications: Interfaces.Notification[];
|
|
383
|
+
pagination: Interfaces.Pagination;
|
|
384
|
+
};
|
|
385
|
+
GetRunSettings: {
|
|
386
|
+
settings: Interfaces.RunSettings;
|
|
387
|
+
users: Interfaces.User[];
|
|
388
|
+
};
|
|
389
|
+
GetSeriesSettings: {
|
|
390
|
+
settings: Interfaces.SeriesSettings;
|
|
391
|
+
moderatorList: Interfaces.SeriesModerator[];
|
|
392
|
+
gameList: Interfaces.Game[];
|
|
393
|
+
theme: Interfaces.Theme;
|
|
394
|
+
userList: Interfaces.User[];
|
|
395
|
+
};
|
|
396
|
+
GetSession: {
|
|
397
|
+
session: Interfaces.Session;
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* NB: if no theme is set then this response will be empty
|
|
401
|
+
*/
|
|
402
|
+
GetThemeSettings: {
|
|
403
|
+
settings?: Interfaces.ThemeSettings;
|
|
404
|
+
theme?: Interfaces.Theme;
|
|
405
|
+
};
|
|
406
|
+
GetThreadReadStatus: {
|
|
407
|
+
threadReadStatusList: Interfaces.ThreadReadStatus[];
|
|
408
|
+
};
|
|
409
|
+
GetTickets: {
|
|
410
|
+
ticketList: Interfaces.Ticket[];
|
|
411
|
+
/**
|
|
412
|
+
* Admins can see all notes, users can see messages here.
|
|
413
|
+
*/
|
|
414
|
+
ticketNoteList: Interfaces.TicketNote[];
|
|
415
|
+
pagination: Interfaces.Pagination;
|
|
416
|
+
userList: Interfaces.User[];
|
|
417
|
+
gameList: Interfaces.Game[];
|
|
418
|
+
userModCountList: Interfaces.UserCount[];
|
|
419
|
+
userRunCountList: Interfaces.UserCount[];
|
|
420
|
+
};
|
|
421
|
+
GetUserBlocks: {
|
|
422
|
+
userBlocks: Interfaces.UserBlock[];
|
|
423
|
+
};
|
|
424
|
+
GetUserSettings: {
|
|
425
|
+
settings: Interfaces.UserSettings;
|
|
426
|
+
gameFollowerList: Interfaces.GameFollower[];
|
|
427
|
+
gameModeratorList: Interfaces.GameModerator[];
|
|
428
|
+
notificationSettings: Interfaces.NotificationSetting[];
|
|
429
|
+
userSocialConnectionList: Interfaces.UserSocialConnection[];
|
|
430
|
+
gameList: Interfaces.Game[];
|
|
431
|
+
themeList: Interfaces.Theme[];
|
|
432
|
+
titleList: Interfaces.Title[];
|
|
433
|
+
supporterCreditList: Interfaces.SupporterCredit[];
|
|
434
|
+
supporterCodeList: Interfaces.SupporterCode[];
|
|
435
|
+
supporterSubscription?: Interfaces.SupporterSubscription;
|
|
436
|
+
experimentList: any;
|
|
437
|
+
enabledExperimentIds: any;
|
|
438
|
+
};
|
|
439
|
+
GetUserSupporterData: {
|
|
440
|
+
supporterEndDate: number;
|
|
441
|
+
boostEndDate: number;
|
|
442
|
+
};
|
|
443
|
+
PutUserSupporterNewSubscription: {
|
|
444
|
+
subscription: Interfaces.SupporterSubscription;
|
|
445
|
+
paymentIntentClientSecret: string;
|
|
446
|
+
};
|
|
447
|
+
PutAuthLogin: {
|
|
448
|
+
loggedIn: boolean;
|
|
449
|
+
tokenChallengeSent?: boolean;
|
|
450
|
+
};
|
|
451
|
+
PutConversation: {
|
|
452
|
+
ok: true;
|
|
453
|
+
conversationId: string;
|
|
454
|
+
messageId: string;
|
|
455
|
+
};
|
|
456
|
+
PutConversationMessage: {
|
|
457
|
+
ok: true;
|
|
458
|
+
conversationId: string;
|
|
459
|
+
messageId: string;
|
|
460
|
+
};
|
|
461
|
+
PutGame: {
|
|
462
|
+
game: Interfaces.Game;
|
|
463
|
+
};
|
|
464
|
+
PutRunSettings: {
|
|
465
|
+
runId: string;
|
|
466
|
+
};
|
|
467
|
+
PutThread: {
|
|
468
|
+
thread: Interfaces.Thread;
|
|
469
|
+
};
|
|
470
|
+
PutLike: {
|
|
471
|
+
likeList: Interfaces.Like[];
|
|
472
|
+
userList: Interfaces.User[];
|
|
473
|
+
};
|
|
474
|
+
PutTicket: {
|
|
475
|
+
ticketId: string;
|
|
476
|
+
};
|
|
477
|
+
PutUserSettings: {
|
|
478
|
+
settings: Interfaces.UserSettings;
|
|
479
|
+
};
|
|
480
|
+
GetUserApiKey: {
|
|
481
|
+
apiKey: string;
|
|
482
|
+
};
|
|
483
|
+
GetUserFollowers: {
|
|
484
|
+
followerList: Interfaces.UserFollower;
|
|
485
|
+
userList: Interfaces.User;
|
|
486
|
+
pagination: Interfaces.Pagination;
|
|
487
|
+
};
|
|
488
|
+
GetUserFollowingGames: {
|
|
489
|
+
followerList: Interfaces.UserFollower;
|
|
490
|
+
gameList: Interfaces.Game;
|
|
491
|
+
pagination: Interfaces.Pagination;
|
|
492
|
+
};
|
|
493
|
+
GetUserFollowingUsers: {
|
|
494
|
+
followerList: Interfaces.UserFollower;
|
|
495
|
+
userList: Interfaces.User;
|
|
496
|
+
pagination: Interfaces.Pagination;
|
|
497
|
+
};
|
|
498
|
+
GetUserGameBoostData: {
|
|
499
|
+
boostAvailableTokens: number;
|
|
500
|
+
boostDistinctGamesCount: number;
|
|
501
|
+
boostDistinctUsersCount: number;
|
|
502
|
+
boostEndDate: number;
|
|
503
|
+
boostGiftedCount: number;
|
|
504
|
+
boostLastTokenDate: number;
|
|
505
|
+
boostNextTokenAmount: number;
|
|
506
|
+
boostNextTokenDate: number;
|
|
507
|
+
boostReceivedCount: number;
|
|
508
|
+
gameBoostList: Interfaces.GameBoost[];
|
|
509
|
+
gameList: Interfaces.Game[];
|
|
510
|
+
isBoosted: boolean;
|
|
511
|
+
userList: Interfaces.User[];
|
|
512
|
+
};
|
|
513
|
+
GetUserDataExport: {
|
|
514
|
+
articleList: Interfaces.Article[];
|
|
515
|
+
commentList: Interfaces.Comment[];
|
|
516
|
+
conversationList: Interfaces.ConversationLightweight[];
|
|
517
|
+
gameFollowerList: Interfaces.GameFollower[];
|
|
518
|
+
guideList: Interfaces.Guide[];
|
|
519
|
+
likeList: Interfaces.Like[];
|
|
520
|
+
messageList: Interfaces.ConversationMessage[];
|
|
521
|
+
newsList: Interfaces.GameNews[];
|
|
522
|
+
resourceList: Interfaces.Resource[];
|
|
523
|
+
runList: Interfaces.GameRun[];
|
|
524
|
+
threadList: Interfaces.Thread[];
|
|
525
|
+
ticketList: Interfaces.Ticket[];
|
|
526
|
+
ticketNoteList: Interfaces.TicketNote[];
|
|
527
|
+
user: Interfaces.User;
|
|
528
|
+
userFollowerList: Interfaces.UserFollower[];
|
|
529
|
+
userSettings: Interfaces.UserSettings;
|
|
530
|
+
userSocialConnectionList: Interfaces.UserSocialConnection[];
|
|
531
|
+
};
|
|
532
|
+
PutUserUpdateEmail: {
|
|
533
|
+
emailChanged: boolean;
|
|
534
|
+
tokenChallengeSent?: boolean;
|
|
535
|
+
};
|
|
536
|
+
PutUserUpdateName: {
|
|
537
|
+
ok: true;
|
|
538
|
+
};
|
|
539
|
+
GetAnnouncementLatest: {
|
|
540
|
+
id: string;
|
|
541
|
+
title: string;
|
|
542
|
+
message: string;
|
|
543
|
+
/**
|
|
544
|
+
* Site subpath to a related article.
|
|
545
|
+
*/
|
|
546
|
+
link: string;
|
|
547
|
+
enabled: boolean;
|
|
548
|
+
/**
|
|
549
|
+
* UNIX timestamp of when the announcement was created.
|
|
550
|
+
*/
|
|
551
|
+
createDate: number;
|
|
552
|
+
};
|
|
553
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "speedruncom.js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "WIP NodeJS module for Speedrun's version 2 API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -10,21 +10,18 @@
|
|
|
10
10
|
"node": ">=18"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"axios": "^1.9.0"
|
|
14
|
-
"ts-morph": "^26.0.0"
|
|
13
|
+
"axios": "^1.9.0"
|
|
15
14
|
},
|
|
16
|
-
"types": "
|
|
15
|
+
"types": "lib/index.d.ts",
|
|
17
16
|
"scripts": {
|
|
18
|
-
"clean": "rimraf
|
|
17
|
+
"clean": "rimraf lib",
|
|
19
18
|
"build": "tsc",
|
|
20
|
-
"
|
|
21
|
-
"prepare": "npm run render && npm run build"
|
|
19
|
+
"prepare": "npm run build"
|
|
22
20
|
},
|
|
23
21
|
"devDependencies": {
|
|
24
|
-
"@types/node": "^
|
|
22
|
+
"@types/node": "^24.0.13",
|
|
25
23
|
"rimraf": "^6.0.1",
|
|
26
|
-
"tsx": "^4.20.3",
|
|
27
24
|
"typescript": "^5.8.3"
|
|
28
25
|
},
|
|
29
|
-
"main": "
|
|
26
|
+
"main": "lib/index.js"
|
|
30
27
|
}
|
package/src/Client.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import axios, { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import GETEndpoints from './endpoints/endpoints.get';
|
|
3
|
+
import POSTEndpoints from './endpoints/endpoints.post'
|
|
4
|
+
import Responses from './responses';
|
|
5
|
+
|
|
6
|
+
type Endpoints = GETEndpoints & POSTEndpoints;
|
|
7
|
+
|
|
8
|
+
const objectToBase64 = (obj: object) => {
|
|
9
|
+
const jsonString = JSON.stringify(obj).replace(/\s+/g, '');
|
|
10
|
+
return Buffer.from(jsonString).toString('base64');
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default class Client {
|
|
14
|
+
axiosClient = axios.create({
|
|
15
|
+
baseURL: 'https://www.speedrun.com/api/v2/',
|
|
16
|
+
headers: {
|
|
17
|
+
'Accept-Language': 'en',
|
|
18
|
+
'Accept': 'application/json'
|
|
19
|
+
},
|
|
20
|
+
withCredentials: true
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
async get<T extends keyof GETEndpoints, A extends GETEndpoints[T]>(endpoint: T, params: A, axiosConfig?: AxiosRequestConfig) {
|
|
24
|
+
return await this.axiosClient.get<Responses[T]>(`${endpoint}?_r=${objectToBase64(params)}`, axiosConfig);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async post<T extends keyof Endpoints, A extends Endpoints[T]>(endpoint: T, params: A, axiosConfig?: AxiosRequestConfig) {
|
|
28
|
+
return await this.axiosClient.post<T extends keyof Responses ? Responses[T] : void>(endpoint, params, axiosConfig);
|
|
29
|
+
}
|
|
30
|
+
}
|