moons-ta-client 1.0.2 → 1.0.4
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 +22 -0
- package/dist/client.js +77 -0
- package/dist/constants.d.ts +4 -0
- package/{src/constants.ts → dist/constants.js} +1 -1
- package/dist/custom-event-emitter.d.ts +7 -0
- package/dist/custom-event-emitter.js +16 -0
- package/dist/index.d.ts +4592 -0
- package/dist/index.esm.js +16502 -0
- package/{src/index.ts → dist/index.js} +1 -1
- package/dist/models/commands.d.ts +116 -0
- package/{src/models/commands.ts → dist/models/commands.js} +17 -102
- package/dist/models/discord.d.ts +76 -0
- package/{src/models/discord.ts → dist/models/discord.js} +15 -62
- package/dist/models/events.d.ts +419 -0
- package/{src/models/events.ts → dist/models/events.js} +89 -354
- package/dist/models/index.js +8 -0
- package/dist/models/models.d.ts +1137 -0
- package/{src/models/models.ts → dist/models/models.js} +200 -799
- package/dist/models/packets.d.ts +144 -0
- package/{src/models/packets.ts → dist/models/packets.js} +26 -126
- package/dist/models/pushes.d.ts +122 -0
- package/{src/models/pushes.ts → dist/models/pushes.js} +24 -96
- package/dist/models/requests.d.ts +1694 -0
- package/{src/models/requests.ts → dist/models/requests.js} +323 -1469
- package/dist/models/responses.d.ts +799 -0
- package/{src/models/responses.ts → dist/models/responses.js} +161 -669
- package/dist/scraper.d.ts +2 -0
- package/dist/scraper.js +87 -0
- package/dist/state-manager.d.ts +50 -0
- package/dist/state-manager.js +196 -0
- package/dist/tournament-assistant-client.d.ts +114 -0
- package/dist/tournament-assistant-client.js +1170 -0
- package/package.json +8 -2
- package/rollup.config.mjs +0 -16
- package/scripts/esbuild.mjs +0 -24
- package/scripts/fixImports.mjs +0 -44
- package/src/client.ts +0 -101
- package/src/custom-event-emitter.ts +0 -21
- package/src/scraper.ts +0 -137
- package/src/state-manager.ts +0 -308
- package/src/tournament-assistant-client.ts +0 -1553
- package/tsconfig.json +0 -27
- /package/{src/models/index.ts → dist/models/index.d.ts} +0 -0
|
@@ -1,103 +1,31 @@
|
|
|
1
|
-
// @generated by protobuf-ts 2.8.2
|
|
2
|
-
// @generated from protobuf file "pushes.proto" (package "proto.packets", syntax proto3)
|
|
3
|
-
// tslint:disable
|
|
4
|
-
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
5
|
-
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
6
1
|
import { WireType } from "@protobuf-ts/runtime";
|
|
7
|
-
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
8
|
-
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
9
2
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
10
|
-
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
11
3
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
12
4
|
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
|
|
13
5
|
import { MessageType } from "@protobuf-ts/runtime";
|
|
14
6
|
import { Beatmap } from './models.js';
|
|
15
7
|
import { User } from './models.js';
|
|
16
8
|
import { RealtimeScore } from './models.js';
|
|
17
|
-
/**
|
|
18
|
-
* ---- Pushes (SUBMIT something!) ---- //
|
|
19
|
-
*
|
|
20
|
-
* @generated from protobuf message proto.packets.Push
|
|
21
|
-
*/
|
|
22
|
-
export interface Push {
|
|
23
|
-
/**
|
|
24
|
-
* @generated from protobuf oneof: data
|
|
25
|
-
*/
|
|
26
|
-
data: {
|
|
27
|
-
oneofKind: "realtimeScore";
|
|
28
|
-
/**
|
|
29
|
-
* @generated from protobuf field: proto.models.RealtimeScore realtime_score = 1;
|
|
30
|
-
*/
|
|
31
|
-
realtimeScore: RealtimeScore;
|
|
32
|
-
} | {
|
|
33
|
-
oneofKind: "songFinished";
|
|
34
|
-
/**
|
|
35
|
-
* @generated from protobuf field: proto.packets.Push.SongFinished song_finished = 2;
|
|
36
|
-
*/
|
|
37
|
-
songFinished: Push_SongFinished;
|
|
38
|
-
} | {
|
|
39
|
-
oneofKind: "discordAuthorized";
|
|
40
|
-
/**
|
|
41
|
-
* @generated from protobuf field: proto.packets.Push.DiscordAuthorized discord_authorized = 3;
|
|
42
|
-
*/
|
|
43
|
-
discordAuthorized: Push_DiscordAuthorized;
|
|
44
|
-
} | {
|
|
45
|
-
oneofKind: undefined;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @generated from protobuf message proto.packets.Push.SongFinished
|
|
50
|
-
*/
|
|
51
|
-
export interface Push_SongFinished {
|
|
52
|
-
/**
|
|
53
|
-
* @generated from protobuf field: proto.models.User player = 1;
|
|
54
|
-
*/
|
|
55
|
-
player?: User;
|
|
56
|
-
/**
|
|
57
|
-
* @generated from protobuf field: proto.models.Beatmap beatmap = 2;
|
|
58
|
-
*/
|
|
59
|
-
beatmap?: Beatmap;
|
|
60
|
-
/**
|
|
61
|
-
* @generated from protobuf field: proto.packets.Push.SongFinished.CompletionType type = 3;
|
|
62
|
-
*/
|
|
63
|
-
type: Push_SongFinished_CompletionType;
|
|
64
|
-
/**
|
|
65
|
-
* @generated from protobuf field: int32 score = 4;
|
|
66
|
-
*/
|
|
67
|
-
score: number;
|
|
68
|
-
}
|
|
69
9
|
/**
|
|
70
10
|
* @generated from protobuf enum proto.packets.Push.SongFinished.CompletionType
|
|
71
11
|
*/
|
|
72
|
-
export
|
|
12
|
+
export var Push_SongFinished_CompletionType;
|
|
13
|
+
(function (Push_SongFinished_CompletionType) {
|
|
73
14
|
/**
|
|
74
15
|
* @generated from protobuf enum value: Passed = 0;
|
|
75
16
|
*/
|
|
76
|
-
Passed = 0
|
|
17
|
+
Push_SongFinished_CompletionType[Push_SongFinished_CompletionType["Passed"] = 0] = "Passed";
|
|
77
18
|
/**
|
|
78
19
|
* @generated from protobuf enum value: Failed = 1;
|
|
79
20
|
*/
|
|
80
|
-
Failed = 1
|
|
21
|
+
Push_SongFinished_CompletionType[Push_SongFinished_CompletionType["Failed"] = 1] = "Failed";
|
|
81
22
|
/**
|
|
82
23
|
* @generated from protobuf enum value: Quit = 2;
|
|
83
24
|
*/
|
|
84
|
-
Quit = 2
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* @generated from protobuf message proto.packets.Push.DiscordAuthorized
|
|
88
|
-
*/
|
|
89
|
-
export interface Push_DiscordAuthorized {
|
|
90
|
-
/**
|
|
91
|
-
* @generated from protobuf field: bool success = 1;
|
|
92
|
-
*/
|
|
93
|
-
success: boolean;
|
|
94
|
-
/**
|
|
95
|
-
* @generated from protobuf field: string token = 2;
|
|
96
|
-
*/
|
|
97
|
-
token: string;
|
|
98
|
-
}
|
|
25
|
+
Push_SongFinished_CompletionType[Push_SongFinished_CompletionType["Quit"] = 2] = "Quit";
|
|
26
|
+
})(Push_SongFinished_CompletionType = Push_SongFinished_CompletionType || (Push_SongFinished_CompletionType = {}));
|
|
99
27
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
100
|
-
class Push$Type extends MessageType
|
|
28
|
+
class Push$Type extends MessageType {
|
|
101
29
|
constructor() {
|
|
102
30
|
super("proto.packets.Push", [
|
|
103
31
|
{ no: 1, name: "realtime_score", kind: "message", oneof: "data", T: () => RealtimeScore },
|
|
@@ -105,14 +33,14 @@ class Push$Type extends MessageType<Push> {
|
|
|
105
33
|
{ no: 3, name: "discord_authorized", kind: "message", oneof: "data", T: () => Push_DiscordAuthorized }
|
|
106
34
|
]);
|
|
107
35
|
}
|
|
108
|
-
create(value
|
|
36
|
+
create(value) {
|
|
109
37
|
const message = { data: { oneofKind: undefined } };
|
|
110
38
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
111
39
|
if (value !== undefined)
|
|
112
|
-
reflectionMergePartial
|
|
40
|
+
reflectionMergePartial(this, message, value);
|
|
113
41
|
return message;
|
|
114
42
|
}
|
|
115
|
-
internalBinaryRead(reader
|
|
43
|
+
internalBinaryRead(reader, length, options, target) {
|
|
116
44
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
117
45
|
while (reader.pos < end) {
|
|
118
46
|
let [fieldNo, wireType] = reader.tag();
|
|
@@ -120,19 +48,19 @@ class Push$Type extends MessageType<Push> {
|
|
|
120
48
|
case /* proto.models.RealtimeScore realtime_score */ 1:
|
|
121
49
|
message.data = {
|
|
122
50
|
oneofKind: "realtimeScore",
|
|
123
|
-
realtimeScore: RealtimeScore.internalBinaryRead(reader, reader.uint32(), options,
|
|
51
|
+
realtimeScore: RealtimeScore.internalBinaryRead(reader, reader.uint32(), options, message.data.realtimeScore)
|
|
124
52
|
};
|
|
125
53
|
break;
|
|
126
54
|
case /* proto.packets.Push.SongFinished song_finished */ 2:
|
|
127
55
|
message.data = {
|
|
128
56
|
oneofKind: "songFinished",
|
|
129
|
-
songFinished: Push_SongFinished.internalBinaryRead(reader, reader.uint32(), options,
|
|
57
|
+
songFinished: Push_SongFinished.internalBinaryRead(reader, reader.uint32(), options, message.data.songFinished)
|
|
130
58
|
};
|
|
131
59
|
break;
|
|
132
60
|
case /* proto.packets.Push.DiscordAuthorized discord_authorized */ 3:
|
|
133
61
|
message.data = {
|
|
134
62
|
oneofKind: "discordAuthorized",
|
|
135
|
-
discordAuthorized: Push_DiscordAuthorized.internalBinaryRead(reader, reader.uint32(), options,
|
|
63
|
+
discordAuthorized: Push_DiscordAuthorized.internalBinaryRead(reader, reader.uint32(), options, message.data.discordAuthorized)
|
|
136
64
|
};
|
|
137
65
|
break;
|
|
138
66
|
default:
|
|
@@ -146,7 +74,7 @@ class Push$Type extends MessageType<Push> {
|
|
|
146
74
|
}
|
|
147
75
|
return message;
|
|
148
76
|
}
|
|
149
|
-
internalBinaryWrite(message
|
|
77
|
+
internalBinaryWrite(message, writer, options) {
|
|
150
78
|
/* proto.models.RealtimeScore realtime_score = 1; */
|
|
151
79
|
if (message.data.oneofKind === "realtimeScore")
|
|
152
80
|
RealtimeScore.internalBinaryWrite(message.data.realtimeScore, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
@@ -167,7 +95,7 @@ class Push$Type extends MessageType<Push> {
|
|
|
167
95
|
*/
|
|
168
96
|
export const Push = new Push$Type();
|
|
169
97
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
170
|
-
class Push_SongFinished$Type extends MessageType
|
|
98
|
+
class Push_SongFinished$Type extends MessageType {
|
|
171
99
|
constructor() {
|
|
172
100
|
super("proto.packets.Push.SongFinished", [
|
|
173
101
|
{ no: 1, name: "player", kind: "message", T: () => User },
|
|
@@ -176,14 +104,14 @@ class Push_SongFinished$Type extends MessageType<Push_SongFinished> {
|
|
|
176
104
|
{ no: 4, name: "score", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
|
|
177
105
|
]);
|
|
178
106
|
}
|
|
179
|
-
create(value
|
|
107
|
+
create(value) {
|
|
180
108
|
const message = { type: 0, score: 0 };
|
|
181
109
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
182
110
|
if (value !== undefined)
|
|
183
|
-
reflectionMergePartial
|
|
111
|
+
reflectionMergePartial(this, message, value);
|
|
184
112
|
return message;
|
|
185
113
|
}
|
|
186
|
-
internalBinaryRead(reader
|
|
114
|
+
internalBinaryRead(reader, length, options, target) {
|
|
187
115
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
188
116
|
while (reader.pos < end) {
|
|
189
117
|
let [fieldNo, wireType] = reader.tag();
|
|
@@ -211,7 +139,7 @@ class Push_SongFinished$Type extends MessageType<Push_SongFinished> {
|
|
|
211
139
|
}
|
|
212
140
|
return message;
|
|
213
141
|
}
|
|
214
|
-
internalBinaryWrite(message
|
|
142
|
+
internalBinaryWrite(message, writer, options) {
|
|
215
143
|
/* proto.models.User player = 1; */
|
|
216
144
|
if (message.player)
|
|
217
145
|
User.internalBinaryWrite(message.player, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
@@ -235,21 +163,21 @@ class Push_SongFinished$Type extends MessageType<Push_SongFinished> {
|
|
|
235
163
|
*/
|
|
236
164
|
export const Push_SongFinished = new Push_SongFinished$Type();
|
|
237
165
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
238
|
-
class Push_DiscordAuthorized$Type extends MessageType
|
|
166
|
+
class Push_DiscordAuthorized$Type extends MessageType {
|
|
239
167
|
constructor() {
|
|
240
168
|
super("proto.packets.Push.DiscordAuthorized", [
|
|
241
169
|
{ no: 1, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
242
170
|
{ no: 2, name: "token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
243
171
|
]);
|
|
244
172
|
}
|
|
245
|
-
create(value
|
|
173
|
+
create(value) {
|
|
246
174
|
const message = { success: false, token: "" };
|
|
247
175
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
248
176
|
if (value !== undefined)
|
|
249
|
-
reflectionMergePartial
|
|
177
|
+
reflectionMergePartial(this, message, value);
|
|
250
178
|
return message;
|
|
251
179
|
}
|
|
252
|
-
internalBinaryRead(reader
|
|
180
|
+
internalBinaryRead(reader, length, options, target) {
|
|
253
181
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
254
182
|
while (reader.pos < end) {
|
|
255
183
|
let [fieldNo, wireType] = reader.tag();
|
|
@@ -271,7 +199,7 @@ class Push_DiscordAuthorized$Type extends MessageType<Push_DiscordAuthorized> {
|
|
|
271
199
|
}
|
|
272
200
|
return message;
|
|
273
201
|
}
|
|
274
|
-
internalBinaryWrite(message
|
|
202
|
+
internalBinaryWrite(message, writer, options) {
|
|
275
203
|
/* bool success = 1; */
|
|
276
204
|
if (message.success !== false)
|
|
277
205
|
writer.tag(1, WireType.Varint).bool(message.success);
|