speedruncom.js 1.2.5 → 1.2.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/dist/Client.d.ts CHANGED
@@ -193,13 +193,13 @@ export default class Client {
193
193
  GetUserBlocks(): Promise<Readonly<Responses.GetUserBlocks>>;
194
194
  PutUserBlock(params: PostEndpoints.PutUserBlock): Promise<void>;
195
195
  PutGame(params: PostEndpoints.PutGame): Promise<Readonly<Responses.PutGame>>;
196
- PutGameModerator(): Promise<void>;
196
+ PutGameModerator(params: PostEndpoints.PutGameModerator): Promise<void>;
197
197
  PutGameModeratorDelete(params: PostEndpoints.PutGameModeratorDelete): Promise<void>;
198
198
  PutSeriesGame(params: PostEndpoints.PutSeriesGame): Promise<void>;
199
199
  PutSeriesGameDelete(params: PostEndpoints.PutSeriesGameDelete): Promise<void>;
200
- PutSeriesModerator(): Promise<void>;
201
- PutSeriesModeratorUpdate(): Promise<void>;
202
- PutSeriesModeratorDelete(): Promise<void>;
200
+ PutSeriesModerator(params: PostEndpoints.PutSeriesModerator): Promise<void>;
201
+ PutSeriesModeratorUpdate(params: PostEndpoints.PutSeriesModeratorUpdate): Promise<void>;
202
+ PutSeriesModeratorDelete(params: PostEndpoints.PutSeriesModeratorDelete): Promise<void>;
203
203
  PutSeriesSettings(params: PostEndpoints.PutSeriesSettings): Promise<void>;
204
204
  PutTicket(params: PostEndpoints.PutTicket): Promise<Readonly<Responses.PutTicket>>;
205
205
  PutTicketNote(params: PostEndpoints.PutTicketNote): Promise<void>;
package/dist/Client.js CHANGED
@@ -556,8 +556,8 @@ class Client {
556
556
  async PutGame(params) {
557
557
  return await this.request('PutGame', params);
558
558
  }
559
- async PutGameModerator() {
560
- return await this.request('PutGameModerator');
559
+ async PutGameModerator(params) {
560
+ return await this.request('PutGameModerator', params);
561
561
  }
562
562
  async PutGameModeratorDelete(params) {
563
563
  return await this.request('PutGameModeratorDelete', params);
@@ -568,14 +568,14 @@ class Client {
568
568
  async PutSeriesGameDelete(params) {
569
569
  return await this.request('PutSeriesGameDelete', params);
570
570
  }
571
- async PutSeriesModerator() {
572
- return await this.request('PutSeriesModerator');
571
+ async PutSeriesModerator(params) {
572
+ return await this.request('PutSeriesModerator', params);
573
573
  }
574
- async PutSeriesModeratorUpdate() {
575
- return await this.request('PutSeriesModeratorUpdate');
574
+ async PutSeriesModeratorUpdate(params) {
575
+ return await this.request('PutSeriesModeratorUpdate', params);
576
576
  }
577
- async PutSeriesModeratorDelete() {
578
- return await this.request('PutSeriesModeratorDelete');
577
+ async PutSeriesModeratorDelete(params) {
578
+ return await this.request('PutSeriesModeratorDelete', params);
579
579
  }
580
580
  async PutSeriesSettings(params) {
581
581
  return await this.request('PutSeriesSettings', params);
@@ -1,4 +1,4 @@
1
- import { Project } from 'ts-morph';
1
+ import { Project, Node } from 'ts-morph';
2
2
  const project = new Project({
3
3
  tsConfigFilePath: "tsconfig.json",
4
4
  });
@@ -7,15 +7,16 @@ const isInterfaceEmpty = (interfaceName, sourceFile) => {
7
7
  if (!declarations || declarations.length === 0)
8
8
  return false;
9
9
  const decl = declarations[0];
10
- if (!decl || !decl.getKindName || decl.getKindName() !== "InterfaceDeclaration")
10
+ if (!Node.isInterfaceDeclaration(decl))
11
11
  return false;
12
- const props = decl.getProperties();
13
- return props.length === 0;
12
+ const type = decl.getType();
13
+ const allProperties = type.getProperties();
14
+ return allProperties.length === 0;
14
15
  };
15
16
  const isInterfaceAllOptional = (name, sourceFile) => {
16
17
  const iface = sourceFile.getInterface(name);
17
18
  if (iface) {
18
- return iface.getProperties().every(p => p.hasQuestionToken());
19
+ return iface.getType().getProperties().every(p => p.isOptional());
19
20
  }
20
21
  const typeNode = sourceFile.getTypeAliasOrThrow(name).getType();
21
22
  return typeNode
@@ -81,52 +81,10 @@ export type GetGameSummary = AtLeastOne<GetGameSummary_Base, 'gameId' | 'gameUrl
81
81
  * Gets the world record history of a game leaderboard.
82
82
  */
83
83
  export interface GetGameRecordHistory {
84
- params?: {
85
- /**
86
- * ID of the leaderboard's category.
87
- */
88
- categoryId?: string;
89
- /**
90
- * `EmulatorFilter` to filter the leaderboard by.
91
- */
92
- emulator?: Enums.EmulatorFilter;
93
- /**
94
- * ID of the game. When exempted, the lists will be empty arrays.
95
- */
96
- gameId?: string;
97
- /**
98
- * `ObsoleteFilter` to filter the leaderboard by.
99
- */
100
- obsolete?: Enums.ObsoleteFilter;
101
- /**
102
- * IDs of platforms to filter the leaderboard by.
103
- *
104
- * All Platforms can be fetched with `GetPlatformList`.
105
- */
106
- platformIds?: string[];
107
- /**
108
- * IDs of regions to filter the leaderboard by.
109
- *
110
- * All Regions can be fetched with `GetStaticData.regionList`.
111
- */
112
- regionIds?: string[];
113
- /**
114
- * `TimingMethod` to filter the leaderboard by.
115
- */
116
- timer?: Enums.TimingMethod;
117
- /**
118
- * `RunStatus` to filter the leaderboard by.
119
- */
120
- verified?: Enums.RunStatus;
121
- /**
122
- * `VariableValues` to filter the leaderboard by.
123
- */
124
- values?: Interfaces.VariableValues[];
125
- /**
126
- * `VideoState` of runs to filter the leaderboard by.
127
- */
128
- video?: Enums.VideoState;
129
- };
84
+ /**
85
+ * Leaderboard to fetch record history of.
86
+ */
87
+ params?: Interfaces.LeaderboardParams;
130
88
  /**
131
89
  * The limit of Runs per page.
132
90
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speedruncom.js",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "WIP NodeJS module for Speedrun's version 2 API.",
5
5
  "type": "module",
6
6
  "author": {
@@ -17,7 +17,8 @@
17
17
  "scripts": {
18
18
  "clean": "rimraf dist src/Client.ts",
19
19
  "build": "tsc",
20
- "prepare": "tsx src/build-client.ts && npm run build"
20
+ "render": "tsx src/build-client.ts",
21
+ "prepare": "npm run render && npm run build"
21
22
  },
22
23
  "devDependencies": {
23
24
  "@types/node": "^22.15.24",
@@ -1,4 +1,4 @@
1
- import { Project, SourceFile, InterfaceDeclaration, OptionalKind, MethodDeclarationStructure, SyntaxKind } from 'ts-morph';
1
+ import { Project, SourceFile, Node, OptionalKind, MethodDeclarationStructure } from 'ts-morph';
2
2
 
3
3
  const project = new Project({
4
4
  tsConfigFilePath: "tsconfig.json",
@@ -9,16 +9,19 @@ const isInterfaceEmpty = (interfaceName: string, sourceFile: SourceFile) => {
9
9
  if (!declarations || declarations.length === 0) return false;
10
10
 
11
11
  const decl = declarations[0];
12
- if (!decl || !decl.getKindName || decl.getKindName() !== "InterfaceDeclaration") return false;
12
+ if (!Node.isInterfaceDeclaration(decl)) return false;
13
13
 
14
- const props = (decl as InterfaceDeclaration).getProperties();
15
- return props.length === 0;
14
+ const type = decl.getType();
15
+ const allProperties = type.getProperties();
16
+
17
+ return allProperties.length === 0;
16
18
  };
17
19
 
20
+
18
21
  const isInterfaceAllOptional = (name: string, sourceFile: SourceFile) => {
19
22
  const iface = sourceFile.getInterface(name);
20
23
  if (iface) {
21
- return iface.getProperties().every(p => p.hasQuestionToken());
24
+ return iface.getType().getProperties().every(p => p.isOptional());
22
25
  }
23
26
 
24
27
  const typeNode = sourceFile.getTypeAliasOrThrow(name).getType();
@@ -101,62 +101,11 @@ export type GetGameSummary = AtLeastOne<GetGameSummary_Base, 'gameId' | 'gameUrl
101
101
  * Gets the world record history of a game leaderboard.
102
102
  */
103
103
  export interface GetGameRecordHistory {
104
- params?: {
105
-
106
- /**
107
- * ID of the leaderboard's category.
108
- */
109
- categoryId?: string;
110
-
111
- /**
112
- * `EmulatorFilter` to filter the leaderboard by.
113
- */
114
- emulator?: Enums.EmulatorFilter;
115
-
116
- /**
117
- * ID of the game. When exempted, the lists will be empty arrays.
118
- */
119
- gameId?: string;
120
-
121
- /**
122
- * `ObsoleteFilter` to filter the leaderboard by.
123
- */
124
- obsolete?: Enums.ObsoleteFilter;
125
-
126
- /**
127
- * IDs of platforms to filter the leaderboard by.
128
- *
129
- * All Platforms can be fetched with `GetPlatformList`.
130
- */
131
- platformIds?: string[];
132
-
133
- /**
134
- * IDs of regions to filter the leaderboard by.
135
- *
136
- * All Regions can be fetched with `GetStaticData.regionList`.
137
- */
138
- regionIds?: string[];
139
-
140
- /**
141
- * `TimingMethod` to filter the leaderboard by.
142
- */
143
- timer?: Enums.TimingMethod;
144
-
145
- /**
146
- * `RunStatus` to filter the leaderboard by.
147
- */
148
- verified?: Enums.RunStatus,
149
-
150
- /**
151
- * `VariableValues` to filter the leaderboard by.
152
- */
153
- values?: Interfaces.VariableValues[];
154
-
155
- /**
156
- * `VideoState` of runs to filter the leaderboard by.
157
- */
158
- video?: Enums.VideoState;
159
- }
104
+
105
+ /**
106
+ * Leaderboard to fetch record history of.
107
+ */
108
+ params?: Interfaces.LeaderboardParams;
160
109
 
161
110
  /**
162
111
  * The limit of Runs per page.