speedruncom.js 1.2.4 → 1.2.6
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 +4 -4
- package/dist/Client.js +8 -8
- package/dist/build-client.js +6 -5
- package/dist/interfaces.d.ts +4 -4
- package/package.json +3 -2
- package/src/build-client.ts +8 -5
- package/src/interfaces.ts +4 -4
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);
|
package/dist/build-client.js
CHANGED
|
@@ -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 (!
|
|
10
|
+
if (!Node.isInterfaceDeclaration(decl))
|
|
11
11
|
return false;
|
|
12
|
-
const
|
|
13
|
-
|
|
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.
|
|
19
|
+
return iface.getType().getProperties().every(p => p.isOptional());
|
|
19
20
|
}
|
|
20
21
|
const typeNode = sourceFile.getTypeAliasOrThrow(name).getType();
|
|
21
22
|
return typeNode
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -1044,12 +1044,12 @@ export interface RunSettings {
|
|
|
1044
1044
|
time?: RunTime;
|
|
1045
1045
|
timeWithLoads?: RunTime;
|
|
1046
1046
|
igt?: RunTime;
|
|
1047
|
-
platformId
|
|
1047
|
+
platformId?: string;
|
|
1048
1048
|
emulator: boolean;
|
|
1049
|
-
video
|
|
1050
|
-
comment
|
|
1049
|
+
video?: string;
|
|
1050
|
+
comment?: string;
|
|
1051
1051
|
date: number;
|
|
1052
|
-
values
|
|
1052
|
+
values?: VariableValue[];
|
|
1053
1053
|
}
|
|
1054
1054
|
export interface Series {
|
|
1055
1055
|
readonly id: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "speedruncom.js",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
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
|
-
"
|
|
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",
|
package/src/build-client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Project, SourceFile,
|
|
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 (!
|
|
12
|
+
if (!Node.isInterfaceDeclaration(decl)) return false;
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
|
|
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.
|
|
24
|
+
return iface.getType().getProperties().every(p => p.isOptional());
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
const typeNode = sourceFile.getTypeAliasOrThrow(name).getType();
|
package/src/interfaces.ts
CHANGED
|
@@ -1231,12 +1231,12 @@ export interface RunSettings {
|
|
|
1231
1231
|
time?: RunTime;
|
|
1232
1232
|
timeWithLoads?: RunTime;
|
|
1233
1233
|
igt?: RunTime;
|
|
1234
|
-
platformId
|
|
1234
|
+
platformId?: string;
|
|
1235
1235
|
emulator: boolean;
|
|
1236
|
-
video
|
|
1237
|
-
comment
|
|
1236
|
+
video?: string;
|
|
1237
|
+
comment?: string;
|
|
1238
1238
|
date: number;
|
|
1239
|
-
values
|
|
1239
|
+
values?: VariableValue[];
|
|
1240
1240
|
}
|
|
1241
1241
|
|
|
1242
1242
|
export interface Series {
|