speedruncom.js 2.0.5 → 2.0.7
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/.github/workflows/publish.yml +16 -19
- package/bun.lock +68 -0
- package/lib/Client.d.ts +3 -3
- package/lib/Client.js +4 -2
- package/lib/endpoints/endpoints.get.d.ts +2 -2
- package/lib/interfaces.d.ts +436 -436
- package/lib/responses.d.ts +1 -1
- package/package.json +9 -13
- package/src/Client.ts +6 -3
- package/src/endpoints/endpoints.get.ts +2 -2
- package/src/interfaces.ts +436 -436
- package/src/responses.ts +1 -1
- package/LICENSE +0 -504
package/lib/responses.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export default interface Responses {
|
|
|
21
21
|
moderators: Interfaces.GameModerator[];
|
|
22
22
|
platforms: Interfaces.Platform[];
|
|
23
23
|
regions: Interfaces.Region[];
|
|
24
|
-
theme?: Interfaces.Theme
|
|
24
|
+
theme?: Interfaces.Theme;
|
|
25
25
|
users: Interfaces.User[];
|
|
26
26
|
values: Interfaces.Value[];
|
|
27
27
|
variables: Interfaces.Variable[];
|
package/package.json
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "speedruncom.js",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "WIP NodeJS module for Speedrun's version 2 API.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
"engines": {
|
|
10
|
-
"node": ">=18"
|
|
11
|
-
},
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "retrozy",
|
|
12
8
|
"dependencies": {
|
|
13
9
|
"axios": "^1.9.0"
|
|
14
10
|
},
|
|
15
11
|
"types": "lib/index.d.ts",
|
|
16
12
|
"scripts": {
|
|
17
|
-
"
|
|
18
|
-
"build": "tsc",
|
|
19
|
-
"prepare": "npm run build"
|
|
13
|
+
"build": "tsc"
|
|
20
14
|
},
|
|
21
15
|
"devDependencies": {
|
|
22
|
-
"@types/node": "^
|
|
23
|
-
"rimraf": "^6.0.1",
|
|
16
|
+
"@types/node": "^25.5.0",
|
|
24
17
|
"typescript": "^5.8.3"
|
|
25
18
|
},
|
|
26
|
-
"main": "lib/index.js"
|
|
19
|
+
"main": "lib/index.js",
|
|
20
|
+
"repository": {
|
|
21
|
+
"url": "https://github.com/retrozy1/speedruncom.js"
|
|
22
|
+
}
|
|
27
23
|
}
|
package/src/Client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import axios, { AxiosRequestConfig
|
|
1
|
+
import axios, { AxiosRequestConfig } from 'axios';
|
|
2
2
|
import GETEndpoints from './endpoints/endpoints.get.js';
|
|
3
3
|
import POSTEndpoints from './endpoints/endpoints.post.js'
|
|
4
4
|
import Responses from './responses.js';
|
|
@@ -15,11 +15,14 @@ export default class Client {
|
|
|
15
15
|
baseURL: 'https://www.speedrun.com/api/v2/',
|
|
16
16
|
headers: {
|
|
17
17
|
'Accept-Language': 'en',
|
|
18
|
-
'
|
|
18
|
+
'_': '',
|
|
19
|
+
'User-Agent': null
|
|
19
20
|
},
|
|
20
|
-
withCredentials: true
|
|
21
|
+
withCredentials: true,
|
|
22
|
+
transformRequest: [data => typeof data === 'string' ? data : JSON.stringify(data)]
|
|
21
23
|
});
|
|
22
24
|
|
|
25
|
+
|
|
23
26
|
async get<E extends keyof GETEndpoints, P extends GETEndpoints[E]>(endpoint: E, params: P, axiosConfig?: AxiosRequestConfig) {
|
|
24
27
|
return await this.axiosClient.get<Responses[E]>(`${endpoint}?_r=${objectToBase64(params)}`, axiosConfig);
|
|
25
28
|
}
|
|
@@ -635,7 +635,7 @@ export default interface GETEndpoints {
|
|
|
635
635
|
/**
|
|
636
636
|
* The thread page, in relation to `limit`.
|
|
637
637
|
*/
|
|
638
|
-
page
|
|
638
|
+
page?: number;
|
|
639
639
|
|
|
640
640
|
/**
|
|
641
641
|
* The maximum amount of `Thread`s to fetch.
|
|
@@ -643,7 +643,7 @@ export default interface GETEndpoints {
|
|
|
643
643
|
* @default 30
|
|
644
644
|
* @max 100
|
|
645
645
|
*/
|
|
646
|
-
limit
|
|
646
|
+
limit?: number;
|
|
647
647
|
};
|
|
648
648
|
|
|
649
649
|
/**
|