moons-ta-client 1.0.1
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/package.json +40 -0
- package/rollup.config.mjs +16 -0
- package/scripts/esbuild.mjs +24 -0
- package/scripts/fixImports.mjs +44 -0
- package/src/client.ts +101 -0
- package/src/constants.ts +4 -0
- package/src/custom-event-emitter.ts +21 -0
- package/src/index.ts +4 -0
- package/src/models/commands.ts +303 -0
- package/src/models/discord.ts +214 -0
- package/src/models/events.ts +1176 -0
- package/src/models/index.ts +8 -0
- package/src/models/models.ts +2657 -0
- package/src/models/packets.ts +359 -0
- package/src/models/pushes.ts +290 -0
- package/src/models/requests.ts +4773 -0
- package/src/models/responses.ts +2184 -0
- package/src/scraper.ts +137 -0
- package/src/state-manager.ts +308 -0
- package/src/tournament-assistant-client.ts +1553 -0
- package/tsconfig.json +27 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// @generated by protobuf-ts 2.8.2
|
|
2
|
+
// @generated from protobuf file "discord.proto" (package "proto.discord", syntax proto3)
|
|
3
|
+
// tslint:disable
|
|
4
|
+
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
5
|
+
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
6
|
+
import { WireType } from "@protobuf-ts/runtime";
|
|
7
|
+
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
8
|
+
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
9
|
+
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
10
|
+
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
11
|
+
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
12
|
+
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
|
|
13
|
+
import { MessageType } from "@protobuf-ts/runtime";
|
|
14
|
+
/**
|
|
15
|
+
* @generated from protobuf message proto.discord.Channel
|
|
16
|
+
*/
|
|
17
|
+
export interface Channel {
|
|
18
|
+
/**
|
|
19
|
+
* @generated from protobuf field: string id = 1;
|
|
20
|
+
*/
|
|
21
|
+
id: string;
|
|
22
|
+
/**
|
|
23
|
+
* @generated from protobuf field: string name = 2;
|
|
24
|
+
*/
|
|
25
|
+
name: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @generated from protobuf message proto.discord.DiscordUser
|
|
29
|
+
*/
|
|
30
|
+
export interface DiscordUser {
|
|
31
|
+
/**
|
|
32
|
+
* @generated from protobuf field: string id = 1;
|
|
33
|
+
*/
|
|
34
|
+
id: string;
|
|
35
|
+
/**
|
|
36
|
+
* @generated from protobuf field: string name = 2;
|
|
37
|
+
*/
|
|
38
|
+
name: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @generated from protobuf message proto.discord.Guild
|
|
42
|
+
*/
|
|
43
|
+
export interface Guild {
|
|
44
|
+
/**
|
|
45
|
+
* @generated from protobuf field: string id = 1;
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
/**
|
|
49
|
+
* @generated from protobuf field: string name = 2;
|
|
50
|
+
*/
|
|
51
|
+
name: string;
|
|
52
|
+
}
|
|
53
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
54
|
+
class Channel$Type extends MessageType<Channel> {
|
|
55
|
+
constructor() {
|
|
56
|
+
super("proto.discord.Channel", [
|
|
57
|
+
{ no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
58
|
+
{ no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
create(value?: PartialMessage<Channel>): Channel {
|
|
62
|
+
const message = { id: "", name: "" };
|
|
63
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
64
|
+
if (value !== undefined)
|
|
65
|
+
reflectionMergePartial<Channel>(this, message, value);
|
|
66
|
+
return message;
|
|
67
|
+
}
|
|
68
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Channel): Channel {
|
|
69
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
70
|
+
while (reader.pos < end) {
|
|
71
|
+
let [fieldNo, wireType] = reader.tag();
|
|
72
|
+
switch (fieldNo) {
|
|
73
|
+
case /* string id */ 1:
|
|
74
|
+
message.id = reader.string();
|
|
75
|
+
break;
|
|
76
|
+
case /* string name */ 2:
|
|
77
|
+
message.name = reader.string();
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
let u = options.readUnknownField;
|
|
81
|
+
if (u === "throw")
|
|
82
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
83
|
+
let d = reader.skip(wireType);
|
|
84
|
+
if (u !== false)
|
|
85
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return message;
|
|
89
|
+
}
|
|
90
|
+
internalBinaryWrite(message: Channel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
91
|
+
/* string id = 1; */
|
|
92
|
+
if (message.id !== "")
|
|
93
|
+
writer.tag(1, WireType.LengthDelimited).string(message.id);
|
|
94
|
+
/* string name = 2; */
|
|
95
|
+
if (message.name !== "")
|
|
96
|
+
writer.tag(2, WireType.LengthDelimited).string(message.name);
|
|
97
|
+
let u = options.writeUnknownFields;
|
|
98
|
+
if (u !== false)
|
|
99
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
100
|
+
return writer;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @generated MessageType for protobuf message proto.discord.Channel
|
|
105
|
+
*/
|
|
106
|
+
export const Channel = new Channel$Type();
|
|
107
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
108
|
+
class DiscordUser$Type extends MessageType<DiscordUser> {
|
|
109
|
+
constructor() {
|
|
110
|
+
super("proto.discord.DiscordUser", [
|
|
111
|
+
{ no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
112
|
+
{ no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
113
|
+
]);
|
|
114
|
+
}
|
|
115
|
+
create(value?: PartialMessage<DiscordUser>): DiscordUser {
|
|
116
|
+
const message = { id: "", name: "" };
|
|
117
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
118
|
+
if (value !== undefined)
|
|
119
|
+
reflectionMergePartial<DiscordUser>(this, message, value);
|
|
120
|
+
return message;
|
|
121
|
+
}
|
|
122
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiscordUser): DiscordUser {
|
|
123
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
124
|
+
while (reader.pos < end) {
|
|
125
|
+
let [fieldNo, wireType] = reader.tag();
|
|
126
|
+
switch (fieldNo) {
|
|
127
|
+
case /* string id */ 1:
|
|
128
|
+
message.id = reader.string();
|
|
129
|
+
break;
|
|
130
|
+
case /* string name */ 2:
|
|
131
|
+
message.name = reader.string();
|
|
132
|
+
break;
|
|
133
|
+
default:
|
|
134
|
+
let u = options.readUnknownField;
|
|
135
|
+
if (u === "throw")
|
|
136
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
137
|
+
let d = reader.skip(wireType);
|
|
138
|
+
if (u !== false)
|
|
139
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return message;
|
|
143
|
+
}
|
|
144
|
+
internalBinaryWrite(message: DiscordUser, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
145
|
+
/* string id = 1; */
|
|
146
|
+
if (message.id !== "")
|
|
147
|
+
writer.tag(1, WireType.LengthDelimited).string(message.id);
|
|
148
|
+
/* string name = 2; */
|
|
149
|
+
if (message.name !== "")
|
|
150
|
+
writer.tag(2, WireType.LengthDelimited).string(message.name);
|
|
151
|
+
let u = options.writeUnknownFields;
|
|
152
|
+
if (u !== false)
|
|
153
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
154
|
+
return writer;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* @generated MessageType for protobuf message proto.discord.DiscordUser
|
|
159
|
+
*/
|
|
160
|
+
export const DiscordUser = new DiscordUser$Type();
|
|
161
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
162
|
+
class Guild$Type extends MessageType<Guild> {
|
|
163
|
+
constructor() {
|
|
164
|
+
super("proto.discord.Guild", [
|
|
165
|
+
{ no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
166
|
+
{ no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
167
|
+
]);
|
|
168
|
+
}
|
|
169
|
+
create(value?: PartialMessage<Guild>): Guild {
|
|
170
|
+
const message = { id: "", name: "" };
|
|
171
|
+
globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
|
|
172
|
+
if (value !== undefined)
|
|
173
|
+
reflectionMergePartial<Guild>(this, message, value);
|
|
174
|
+
return message;
|
|
175
|
+
}
|
|
176
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Guild): Guild {
|
|
177
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
178
|
+
while (reader.pos < end) {
|
|
179
|
+
let [fieldNo, wireType] = reader.tag();
|
|
180
|
+
switch (fieldNo) {
|
|
181
|
+
case /* string id */ 1:
|
|
182
|
+
message.id = reader.string();
|
|
183
|
+
break;
|
|
184
|
+
case /* string name */ 2:
|
|
185
|
+
message.name = reader.string();
|
|
186
|
+
break;
|
|
187
|
+
default:
|
|
188
|
+
let u = options.readUnknownField;
|
|
189
|
+
if (u === "throw")
|
|
190
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
191
|
+
let d = reader.skip(wireType);
|
|
192
|
+
if (u !== false)
|
|
193
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return message;
|
|
197
|
+
}
|
|
198
|
+
internalBinaryWrite(message: Guild, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
199
|
+
/* string id = 1; */
|
|
200
|
+
if (message.id !== "")
|
|
201
|
+
writer.tag(1, WireType.LengthDelimited).string(message.id);
|
|
202
|
+
/* string name = 2; */
|
|
203
|
+
if (message.name !== "")
|
|
204
|
+
writer.tag(2, WireType.LengthDelimited).string(message.name);
|
|
205
|
+
let u = options.writeUnknownFields;
|
|
206
|
+
if (u !== false)
|
|
207
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
208
|
+
return writer;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* @generated MessageType for protobuf message proto.discord.Guild
|
|
213
|
+
*/
|
|
214
|
+
export const Guild = new Guild$Type();
|