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