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.
@@ -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.5",
3
+ "version": "2.0.7",
4
4
  "description": "WIP NodeJS module for Speedrun's version 2 API.",
5
5
  "type": "module",
6
- "author": {
7
- "name": "retrozy"
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
- "clean": "rimraf lib",
18
- "build": "tsc",
19
- "prepare": "npm run build"
13
+ "build": "tsc"
20
14
  },
21
15
  "devDependencies": {
22
- "@types/node": "^24.0.13",
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, AxiosResponse } from 'axios';
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
- 'Accept': 'application/json'
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: number;
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: number;
646
+ limit?: number;
647
647
  };
648
648
 
649
649
  /**