speedruncom.js 1.3.1 → 2.0.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/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 +1 -1
- package/lib/responses.d.ts +553 -0
- package/package.json +5 -6
- 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 +1 -1
- 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/README.md
CHANGED
|
@@ -1,49 +1,13 @@
|
|
|
1
|
-
## `npm i retrozy1/speedruncom.js`
|
|
2
|
-
|
|
3
1
|
# About
|
|
4
2
|
|
|
5
3
|
Speedrun.com has two API versions. Version 1 is officially documented, REST, public and directly exposed to users. Version 2 is a pre-production RPC API designed only for internal use of site functions, and is much more complicated and less user-friendly, especially regarding authentication and browser CORS.
|
|
6
4
|
|
|
7
5
|
Version 1 is mainly read-only, and when it isn't read only it may just be broken. If you want to use any of the modern features of the site now, you'll use version 2. This is a NodeJS wrapper for Speedrun API version 2, with parameters and responses all documented in TypeScript and JSDoc.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
**`npm i retrozy1/speedruncom.js`**
|
|
14
|
-
|
|
15
|
-
## Importing
|
|
16
|
-
|
|
17
|
-
`Client` is the default export, and enums and interfaces are available in named exports for TypeScript users.
|
|
7
|
+
This module isn't intended to give any helper functions to the user; it's more of an index of the params and responses of the site endpoints, to be used for type checking on a more user-friendly module.
|
|
18
8
|
|
|
19
|
-
|
|
20
|
-
import SpeedrunClient from 'speedruncom.js';
|
|
21
|
-
|
|
22
|
-
const client = new SpeedrunClient({
|
|
23
|
-
userAgent: 'RunCollabGetter'
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const getCollabs = async (userUrl) => {
|
|
27
|
-
// Fetch user summary
|
|
28
|
-
const {
|
|
29
|
-
user: { id: userId, name }
|
|
30
|
-
} = await client.GetUserSummary({ url: userUrl });
|
|
31
|
-
|
|
32
|
-
// Fetch leaderboard and extract player names
|
|
33
|
-
const { players } = await client.GetUserLeaderboard({ userId });
|
|
34
|
-
const otherPlayerNames = players.map(player => player.name).filter(n => n !== name); // Exclude self
|
|
35
|
-
|
|
36
|
-
if (otherPlayerNames.length === 0) {
|
|
37
|
-
return `${name} hasn't ran with anyone.`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const formattedNames =
|
|
41
|
-
otherPlayerNames.length === 1
|
|
42
|
-
? otherPlayerNames[0]
|
|
43
|
-
: `${otherPlayerNames.slice(0, -1).join(', ')} and ${otherPlayerNames.slice(-1)}`;
|
|
9
|
+
# Usage
|
|
44
10
|
|
|
45
|
-
|
|
46
|
-
};
|
|
11
|
+
**`npm i speedruncom.js`**
|
|
47
12
|
|
|
48
|
-
|
|
49
|
-
```
|
|
13
|
+
`Client` is the default export, and enums and interfaces are the named exports for TypeScript users.
|
package/lib/Client.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import GETEndpoints from './endpoints/endpoints.get';
|
|
3
|
+
import POSTEndpoints from './endpoints/endpoints.post';
|
|
4
|
+
import Responses from './responses';
|
|
5
|
+
type Endpoints = GETEndpoints & POSTEndpoints;
|
|
6
|
+
export default class Client {
|
|
7
|
+
axiosClient: import("axios").AxiosInstance;
|
|
8
|
+
get<T extends keyof GETEndpoints, A extends GETEndpoints[T]>(endpoint: T, params: A, axiosConfig?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<Responses[T], any>>;
|
|
9
|
+
post<T extends keyof Endpoints, A extends Endpoints[T]>(endpoint: T, params: A, axiosConfig?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<T extends keyof Responses ? Responses[T] : void, any>>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
package/lib/Client.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
const objectToBase64 = (obj) => {
|
|
3
|
+
const jsonString = JSON.stringify(obj).replace(/\s+/g, '');
|
|
4
|
+
return Buffer.from(jsonString).toString('base64');
|
|
5
|
+
};
|
|
6
|
+
export default class Client {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.axiosClient = axios.create({
|
|
9
|
+
baseURL: 'https://www.speedrun.com/api/v2/',
|
|
10
|
+
headers: {
|
|
11
|
+
'Accept-Language': 'en',
|
|
12
|
+
'Accept': 'application/json'
|
|
13
|
+
},
|
|
14
|
+
withCredentials: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async get(endpoint, params, axiosConfig) {
|
|
18
|
+
return await this.axiosClient.get(`${endpoint}?_r=${objectToBase64(params)}`, axiosConfig);
|
|
19
|
+
}
|
|
20
|
+
async post(endpoint, params, axiosConfig) {
|
|
21
|
+
return await this.axiosClient.post(endpoint, params, axiosConfig);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
import * as Enums from '../enums';
|
|
2
|
+
import * as Interfaces from '../interfaces';
|
|
3
|
+
export default interface GETEndpoints {
|
|
4
|
+
/**
|
|
5
|
+
* Gets a leaderboard, with Players included.
|
|
6
|
+
*
|
|
7
|
+
* `GetGameLeaderboard` can fetch twice as many runs, and also fetches Games, Platforms, Regions, Values, and Variables.
|
|
8
|
+
*/
|
|
9
|
+
GetGameLeaderboard2: {
|
|
10
|
+
/**
|
|
11
|
+
* The leaderboard to fetch.
|
|
12
|
+
*/
|
|
13
|
+
params: Interfaces.LeaderboardParams;
|
|
14
|
+
/**
|
|
15
|
+
* The maximum amount of `Run`s per page.
|
|
16
|
+
*
|
|
17
|
+
* @max 100
|
|
18
|
+
* @default 100
|
|
19
|
+
*/
|
|
20
|
+
limit?: number;
|
|
21
|
+
/**
|
|
22
|
+
* The leaderboard page, in relation to `limit`.
|
|
23
|
+
*/
|
|
24
|
+
page?: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Gets a specific site article.
|
|
28
|
+
*/
|
|
29
|
+
GetArticle: {
|
|
30
|
+
/**
|
|
31
|
+
* ID of the article to fetch.
|
|
32
|
+
*/
|
|
33
|
+
id: string;
|
|
34
|
+
} | {
|
|
35
|
+
/**
|
|
36
|
+
* Slug of the article to fetch.
|
|
37
|
+
*/
|
|
38
|
+
slug: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Gets a leaderboard, with all relevant items included.
|
|
42
|
+
*
|
|
43
|
+
* `GetGameLeaderboard2` only includes Runs and Players, and has half the maximum `limit`.
|
|
44
|
+
*/
|
|
45
|
+
GetGameLeaderboard: {
|
|
46
|
+
/**
|
|
47
|
+
* The leaderboard to fetch.
|
|
48
|
+
*/
|
|
49
|
+
params: Interfaces.LeaderboardParams;
|
|
50
|
+
/**
|
|
51
|
+
* The limit of Runs per page.
|
|
52
|
+
*
|
|
53
|
+
* @max 200
|
|
54
|
+
* @default 100
|
|
55
|
+
*/
|
|
56
|
+
limit?: number;
|
|
57
|
+
/**
|
|
58
|
+
* The leaderboard page, in relation to `limit`.
|
|
59
|
+
*/
|
|
60
|
+
page?: number;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Gets the world record history of a game leaderboard.
|
|
64
|
+
*/
|
|
65
|
+
GetGameRecordHistory: {
|
|
66
|
+
/**
|
|
67
|
+
* Leaderboard to fetch record history of.
|
|
68
|
+
*/
|
|
69
|
+
params?: Interfaces.LeaderboardParams;
|
|
70
|
+
/**
|
|
71
|
+
* The limit of Runs per page.
|
|
72
|
+
*
|
|
73
|
+
* @max 200
|
|
74
|
+
* @default 100
|
|
75
|
+
*/
|
|
76
|
+
limit?: number;
|
|
77
|
+
/**
|
|
78
|
+
* The leaderboard page, in relation to `limit`.
|
|
79
|
+
*/
|
|
80
|
+
page?: number;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Searches for site items with a query.
|
|
84
|
+
*/
|
|
85
|
+
GetSearch: {
|
|
86
|
+
/**
|
|
87
|
+
* The text you are searching.
|
|
88
|
+
*/
|
|
89
|
+
query?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Useless parameter, there is no affect on what is fetched based on the value.
|
|
92
|
+
*/
|
|
93
|
+
favorExactMatches?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Whether or not you are searching for games.
|
|
96
|
+
*/
|
|
97
|
+
includeGames?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Whether or not you are searching for news.
|
|
100
|
+
*/
|
|
101
|
+
includeNews?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Whether or not you are searching for pages.
|
|
104
|
+
*/
|
|
105
|
+
includePages?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Whether or not you are searching for series.
|
|
108
|
+
*/
|
|
109
|
+
includeSeries?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Whether or not you are searching for users.
|
|
112
|
+
*/
|
|
113
|
+
includeUsers?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Whether or not you are searching for challenges.
|
|
116
|
+
*/
|
|
117
|
+
includeChallenges?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* The maximum amount of items to fetch in each `[item]List` array.
|
|
120
|
+
*
|
|
121
|
+
* @max 100
|
|
122
|
+
* @default 100
|
|
123
|
+
*/
|
|
124
|
+
limit?: number;
|
|
125
|
+
/**
|
|
126
|
+
* The leaderboard page, in relation to `limit`.
|
|
127
|
+
*/
|
|
128
|
+
page?: number;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Gets non-obsolete latest runs of a game.
|
|
132
|
+
*
|
|
133
|
+
* When `seriesId` and `gameId` are exempted,
|
|
134
|
+
*/
|
|
135
|
+
GetLatestLeaderboard: {
|
|
136
|
+
/**
|
|
137
|
+
* ID of the game.
|
|
138
|
+
*
|
|
139
|
+
* When exempted, lists in the responses will be empty.
|
|
140
|
+
*/
|
|
141
|
+
gameId?: string;
|
|
142
|
+
/**
|
|
143
|
+
* ID of a series
|
|
144
|
+
*/
|
|
145
|
+
seriesId?: string;
|
|
146
|
+
/**
|
|
147
|
+
* The maximum amount of Runs to fetch.
|
|
148
|
+
*
|
|
149
|
+
* Warning: Obsolete runs are not included, but still count to the limit.
|
|
150
|
+
*
|
|
151
|
+
* If this is `20` and 5 out of the 20 latest runs are obsolete, it will only return the 15 non-obsolete runs.
|
|
152
|
+
*
|
|
153
|
+
* @max Around 99999, however it varies with caching-related factors.
|
|
154
|
+
* @default 25
|
|
155
|
+
*/
|
|
156
|
+
limit?: number;
|
|
157
|
+
/**
|
|
158
|
+
* The run list page, in relation to `limit`.
|
|
159
|
+
*/
|
|
160
|
+
page?: number;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Gets a single run.
|
|
164
|
+
*/
|
|
165
|
+
GetRun: {
|
|
166
|
+
/**
|
|
167
|
+
* ID of the run.
|
|
168
|
+
*/
|
|
169
|
+
runId: string;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Gets non-run related data of a user.
|
|
173
|
+
*/
|
|
174
|
+
GetUserSummary: {
|
|
175
|
+
/**
|
|
176
|
+
* Subpath URL of the user.
|
|
177
|
+
*/
|
|
178
|
+
url: string;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Gets comments posted by a user.
|
|
182
|
+
*/
|
|
183
|
+
GetUserComments: {
|
|
184
|
+
/**
|
|
185
|
+
* ID of the user.
|
|
186
|
+
*/
|
|
187
|
+
userId: string;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Gets threads created by a specific user.
|
|
191
|
+
*/
|
|
192
|
+
GetUserThreads: {
|
|
193
|
+
/**
|
|
194
|
+
* ID of the user.
|
|
195
|
+
*/
|
|
196
|
+
userId: string;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Gets data for user popovers (when you hover over a username).
|
|
200
|
+
*/
|
|
201
|
+
GetUserPopoverData: {
|
|
202
|
+
/**
|
|
203
|
+
* ID of the user.
|
|
204
|
+
*/
|
|
205
|
+
userId: string;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Gets all Titles in the site.
|
|
209
|
+
*/
|
|
210
|
+
GetTitleList: {};
|
|
211
|
+
/**
|
|
212
|
+
* Gets a specific Title.
|
|
213
|
+
*/
|
|
214
|
+
GetTitle: {
|
|
215
|
+
/**
|
|
216
|
+
* ID of the title.
|
|
217
|
+
*/
|
|
218
|
+
titleId: string;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Gets site articles.
|
|
222
|
+
*/
|
|
223
|
+
GetArticleList: {
|
|
224
|
+
/**
|
|
225
|
+
* Whether or not the article is published (verified by admin).
|
|
226
|
+
*/
|
|
227
|
+
published?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Whether or not the article is rejected.
|
|
230
|
+
*/
|
|
231
|
+
rejected?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* A query to search for articles.
|
|
234
|
+
*/
|
|
235
|
+
search?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Tags an article has.
|
|
238
|
+
*/
|
|
239
|
+
tags?: string[];
|
|
240
|
+
/**
|
|
241
|
+
* The target of an article, either being `news` or a path URL for site information articles.
|
|
242
|
+
*/
|
|
243
|
+
target?: string;
|
|
244
|
+
/**
|
|
245
|
+
* The maximum amount of Articles to fetch.
|
|
246
|
+
*
|
|
247
|
+
* @max 500
|
|
248
|
+
* @default 500
|
|
249
|
+
*/
|
|
250
|
+
limit?: number;
|
|
251
|
+
/**
|
|
252
|
+
* The article list page, in relation to `limit`.
|
|
253
|
+
*/
|
|
254
|
+
page?: number;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Gets a list of games.
|
|
258
|
+
*/
|
|
259
|
+
GetGameList: {
|
|
260
|
+
/**
|
|
261
|
+
* ID of a series to filter by.
|
|
262
|
+
*/
|
|
263
|
+
seriesId?: string;
|
|
264
|
+
/**
|
|
265
|
+
* ID of a platform to filter by.
|
|
266
|
+
*/
|
|
267
|
+
platformId?: string;
|
|
268
|
+
/**
|
|
269
|
+
* Search query for game names or game subpath URLs.
|
|
270
|
+
*/
|
|
271
|
+
search?: string;
|
|
272
|
+
/**
|
|
273
|
+
* `GameOrderType` to filter games by.
|
|
274
|
+
*/
|
|
275
|
+
orderType?: Enums.GameOrderType;
|
|
276
|
+
/**
|
|
277
|
+
* The maximum amount of Games to fetch.
|
|
278
|
+
*
|
|
279
|
+
* @max 500
|
|
280
|
+
* @default 500
|
|
281
|
+
*/
|
|
282
|
+
limit?: number;
|
|
283
|
+
/**
|
|
284
|
+
* The game list page, in relation to `limit`.
|
|
285
|
+
*/
|
|
286
|
+
page?: number;
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* Gets a list of Platforms in the site.
|
|
290
|
+
*/
|
|
291
|
+
GetPlatformList: {};
|
|
292
|
+
/**
|
|
293
|
+
* Gets information for the home page.
|
|
294
|
+
*/
|
|
295
|
+
GetHomeSummary: {};
|
|
296
|
+
/**
|
|
297
|
+
* Gets a list of series on the site.
|
|
298
|
+
*/
|
|
299
|
+
GetSeriesList: {
|
|
300
|
+
/**
|
|
301
|
+
* A query to search for, of series names or subpath URLs.
|
|
302
|
+
*/
|
|
303
|
+
search?: string;
|
|
304
|
+
/**
|
|
305
|
+
* `GameOrderType` to filter series by.
|
|
306
|
+
*/
|
|
307
|
+
orderType?: Enums.GameOrderType;
|
|
308
|
+
/**
|
|
309
|
+
* The maximum amount of Series to fetch.
|
|
310
|
+
*
|
|
311
|
+
* @max 500
|
|
312
|
+
* @default 500
|
|
313
|
+
*/
|
|
314
|
+
limit?: number;
|
|
315
|
+
/**
|
|
316
|
+
* The leaderboard page, in relation to `limit`.
|
|
317
|
+
*/
|
|
318
|
+
page?: number;
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Gets most information pertinent to a series.
|
|
322
|
+
*/
|
|
323
|
+
GetSeriesSummary: {
|
|
324
|
+
/**
|
|
325
|
+
* Subpath URL of the series.
|
|
326
|
+
*/
|
|
327
|
+
seriesUrl: string;
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* Gets the top 3 runs from all levels under a level category.
|
|
331
|
+
*/
|
|
332
|
+
GetGameLevelSummary: {
|
|
333
|
+
/**
|
|
334
|
+
* The game leaderboard to fetch level summaries from.
|
|
335
|
+
*
|
|
336
|
+
* When not included, `runList[]` will be empty.
|
|
337
|
+
*/
|
|
338
|
+
params?: Interfaces.LeaderboardParams;
|
|
339
|
+
/**
|
|
340
|
+
* The limit of Runs per page.
|
|
341
|
+
*
|
|
342
|
+
* @max Unknown - likely around 99999.
|
|
343
|
+
* @default Unknown - likely around 99999.
|
|
344
|
+
*/
|
|
345
|
+
limit?: number;
|
|
346
|
+
/**
|
|
347
|
+
* The leaderboard page, in relation to `limit`.
|
|
348
|
+
*/
|
|
349
|
+
page?: number;
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* Gets a random Game.
|
|
353
|
+
*/
|
|
354
|
+
GetGameRandom: {};
|
|
355
|
+
/**
|
|
356
|
+
* Gets all guides on a game.
|
|
357
|
+
*/
|
|
358
|
+
GetGuideList: {
|
|
359
|
+
/**
|
|
360
|
+
* ID of the game.
|
|
361
|
+
*/
|
|
362
|
+
gameId: string;
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* Get a specific guide.
|
|
366
|
+
*/
|
|
367
|
+
GetGuide: {
|
|
368
|
+
/**
|
|
369
|
+
* ID of the guide.
|
|
370
|
+
*/
|
|
371
|
+
id: string;
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* Gets news posts in a game.
|
|
375
|
+
*/
|
|
376
|
+
GetNewsList: {
|
|
377
|
+
/**
|
|
378
|
+
* ID of the game.
|
|
379
|
+
*/
|
|
380
|
+
gameId: string;
|
|
381
|
+
};
|
|
382
|
+
/**
|
|
383
|
+
* Gets a specific game news post.
|
|
384
|
+
*/
|
|
385
|
+
GetNews: {
|
|
386
|
+
/**
|
|
387
|
+
* ID of the news post.
|
|
388
|
+
*/
|
|
389
|
+
id: string;
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* Gets a single resource.
|
|
393
|
+
*/
|
|
394
|
+
GetResource: {
|
|
395
|
+
/**
|
|
396
|
+
* ID of the resource.
|
|
397
|
+
*/
|
|
398
|
+
resourceId: string;
|
|
399
|
+
};
|
|
400
|
+
/**
|
|
401
|
+
* Get a list of a game's resources.
|
|
402
|
+
*/
|
|
403
|
+
GetResourceList: {
|
|
404
|
+
/**
|
|
405
|
+
* ID of the game.
|
|
406
|
+
*/
|
|
407
|
+
gameId: string;
|
|
408
|
+
};
|
|
409
|
+
/**
|
|
410
|
+
* Gets a list of live streams on twitch that have the `Speedrun` tag.
|
|
411
|
+
*
|
|
412
|
+
* A stream is assigned to a game when the Twitch game is the Game's `GameSettings.twitchName`.
|
|
413
|
+
*/
|
|
414
|
+
GetStreamList: {
|
|
415
|
+
/**
|
|
416
|
+
* ID of a series.
|
|
417
|
+
*/
|
|
418
|
+
seriesId?: string;
|
|
419
|
+
/**
|
|
420
|
+
* ID of a game.
|
|
421
|
+
*/
|
|
422
|
+
gameId?: string;
|
|
423
|
+
};
|
|
424
|
+
/**
|
|
425
|
+
* Get threads on a forum.
|
|
426
|
+
*/
|
|
427
|
+
GetThreadList: {
|
|
428
|
+
/**
|
|
429
|
+
* ID of the forum.
|
|
430
|
+
*/
|
|
431
|
+
forumId: string;
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* Gets a comment post's Thread and Forum by `commentId`.
|
|
435
|
+
*/
|
|
436
|
+
GetThreadStateByCommentId: {
|
|
437
|
+
/**
|
|
438
|
+
* ID of the comment.
|
|
439
|
+
*/
|
|
440
|
+
commentId: string;
|
|
441
|
+
};
|
|
442
|
+
/**
|
|
443
|
+
* Get a specific Challenge.
|
|
444
|
+
*/
|
|
445
|
+
GetChallenge: {
|
|
446
|
+
/**
|
|
447
|
+
* ID of the challenge.
|
|
448
|
+
*/
|
|
449
|
+
id: string;
|
|
450
|
+
};
|
|
451
|
+
/**
|
|
452
|
+
* Get runs from a Challenge board.
|
|
453
|
+
*/
|
|
454
|
+
GetChallengeLeaderboard: {
|
|
455
|
+
/**
|
|
456
|
+
* ID of the challenge you are getting the leaderboard from.
|
|
457
|
+
*/
|
|
458
|
+
challengeId: string;
|
|
459
|
+
};
|
|
460
|
+
/**
|
|
461
|
+
* Get a sitewide leaderboard for users who have won the most in Challenges.
|
|
462
|
+
*/
|
|
463
|
+
GetChallengeGlobalRankingList: {};
|
|
464
|
+
/**
|
|
465
|
+
* Get a specific Challenge run (not the same as a normal run!)
|
|
466
|
+
*/
|
|
467
|
+
GetChallengeRun: {
|
|
468
|
+
/**
|
|
469
|
+
* ID of the challenge.
|
|
470
|
+
*/
|
|
471
|
+
id: string;
|
|
472
|
+
};
|
|
473
|
+
/**
|
|
474
|
+
* Get a user's runs for display on their profile.
|
|
475
|
+
*/
|
|
476
|
+
GetUserLeaderboard: {
|
|
477
|
+
/**
|
|
478
|
+
* ID of the user.
|
|
479
|
+
*/
|
|
480
|
+
userId: string;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* Gets game and series moderation stats for any user.
|
|
484
|
+
*/
|
|
485
|
+
GetUserModeration: {
|
|
486
|
+
/**
|
|
487
|
+
* ID of the user.
|
|
488
|
+
*/
|
|
489
|
+
userId: string;
|
|
490
|
+
};
|
|
491
|
+
/**
|
|
492
|
+
* Get a list of comments on an item, and data of the parent.
|
|
493
|
+
*/
|
|
494
|
+
GetCommentList: {
|
|
495
|
+
/**
|
|
496
|
+
* ID of the parent item to fetch.
|
|
497
|
+
*/
|
|
498
|
+
itemId: string;
|
|
499
|
+
/**
|
|
500
|
+
* `ItemType` of the item referenced in `itemId`.
|
|
501
|
+
*/
|
|
502
|
+
itemType: Enums.ItemType;
|
|
503
|
+
/**
|
|
504
|
+
* The maximum amount of `Comment`s per page.
|
|
505
|
+
*
|
|
506
|
+
* When this is >= 500 but <= 1000, it will fetch a maximum of 500 `Run`s, but when over 1000 it will return a maximum of 20 runs.
|
|
507
|
+
* @max 500
|
|
508
|
+
* @default 20
|
|
509
|
+
*/
|
|
510
|
+
limit?: number;
|
|
511
|
+
/**
|
|
512
|
+
* The comment page, in relation to `limit`.
|
|
513
|
+
*/
|
|
514
|
+
page?: number;
|
|
515
|
+
};
|
|
516
|
+
/**
|
|
517
|
+
* Get a specific thread.
|
|
518
|
+
*/
|
|
519
|
+
GetThread: {
|
|
520
|
+
/**
|
|
521
|
+
* ID of the thread.
|
|
522
|
+
*/
|
|
523
|
+
id: string;
|
|
524
|
+
};
|
|
525
|
+
/**
|
|
526
|
+
* Get static data for the site.
|
|
527
|
+
*/
|
|
528
|
+
GetStaticData: {};
|
|
529
|
+
/**
|
|
530
|
+
* Get a list of site-wide forums. When logged in, may include forums of followed games.
|
|
531
|
+
*/
|
|
532
|
+
GetForumList: {};
|
|
533
|
+
/**
|
|
534
|
+
* Gets the latest announcement, if there is one active.
|
|
535
|
+
*/
|
|
536
|
+
GetAnnouncementLatest: {};
|
|
537
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
//Endpoints that don't give the "Method Not Allowed" error when called with GET
|
|
1
|
+
//Endpoints that don't give the "Method Not Allowed" error when called with `GET`.
|
|
2
2
|
export {};
|