moons-ta-client 1.1.9 → 1.1.11

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.
@@ -76,7 +76,8 @@ class Request$Type extends MessageType {
76
76
  { no: 43, name: "remaining_attempts", kind: "message", oneof: "type", T: () => Request_RemainingAttempts },
77
77
  { no: 55, name: "get_bot_tokens_for_user", kind: "message", oneof: "type", T: () => Request_GetBotTokensForUser },
78
78
  { no: 56, name: "generate_bot_token", kind: "message", oneof: "type", T: () => Request_GenerateBotToken },
79
- { no: 57, name: "revoke_bot_token", kind: "message", oneof: "type", T: () => Request_RevokeBotToken }
79
+ { no: 57, name: "revoke_bot_token", kind: "message", oneof: "type", T: () => Request_RevokeBotToken },
80
+ { no: 58, name: "refund_attempts", kind: "message", oneof: "type", T: () => Request_RefundAttempts }
80
81
  ]);
81
82
  }
82
83
  create(value) {
@@ -427,6 +428,12 @@ class Request$Type extends MessageType {
427
428
  revokeBotToken: Request_RevokeBotToken.internalBinaryRead(reader, reader.uint32(), options, message.type.revokeBotToken)
428
429
  };
429
430
  break;
431
+ case /* proto.packets.Request.RefundAttempts refund_attempts */ 58:
432
+ message.type = {
433
+ oneofKind: "refundAttempts",
434
+ refundAttempts: Request_RefundAttempts.internalBinaryRead(reader, reader.uint32(), options, message.type.refundAttempts)
435
+ };
436
+ break;
430
437
  default:
431
438
  let u = options.readUnknownField;
432
439
  if (u === "throw")
@@ -607,6 +614,9 @@ class Request$Type extends MessageType {
607
614
  /* proto.packets.Request.RevokeBotToken revoke_bot_token = 57; */
608
615
  if (message.type.oneofKind === "revokeBotToken")
609
616
  Request_RevokeBotToken.internalBinaryWrite(message.type.revokeBotToken, writer.tag(57, WireType.LengthDelimited).fork(), options).join();
617
+ /* proto.packets.Request.RefundAttempts refund_attempts = 58; */
618
+ if (message.type.oneofKind === "refundAttempts")
619
+ Request_RefundAttempts.internalBinaryWrite(message.type.refundAttempts, writer.tag(58, WireType.LengthDelimited).fork(), options).join();
610
620
  let u = options.writeUnknownFields;
611
621
  if (u !== false)
612
622
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -3232,11 +3242,12 @@ class Request_Join$Type extends MessageType {
3232
3242
  constructor() {
3233
3243
  super("proto.packets.Request.Join", [
3234
3244
  { no: 1, name: "tournament_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3235
- { no: 2, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
3245
+ { no: 2, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3246
+ { no: 3, name: "mod_list", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
3236
3247
  ]);
3237
3248
  }
3238
3249
  create(value) {
3239
- const message = { tournamentId: "", password: "" };
3250
+ const message = { tournamentId: "", password: "", modList: [] };
3240
3251
  globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
3241
3252
  if (value !== undefined)
3242
3253
  reflectionMergePartial(this, message, value);
@@ -3253,6 +3264,9 @@ class Request_Join$Type extends MessageType {
3253
3264
  case /* string password */ 2:
3254
3265
  message.password = reader.string();
3255
3266
  break;
3267
+ case /* repeated string mod_list */ 3:
3268
+ message.modList.push(reader.string());
3269
+ break;
3256
3270
  default:
3257
3271
  let u = options.readUnknownField;
3258
3272
  if (u === "throw")
@@ -3271,6 +3285,9 @@ class Request_Join$Type extends MessageType {
3271
3285
  /* string password = 2; */
3272
3286
  if (message.password !== "")
3273
3287
  writer.tag(2, WireType.LengthDelimited).string(message.password);
3288
+ /* repeated string mod_list = 3; */
3289
+ for (let i = 0; i < message.modList.length; i++)
3290
+ writer.tag(3, WireType.LengthDelimited).string(message.modList[i]);
3274
3291
  let u = options.writeUnknownFields;
3275
3292
  if (u !== false)
3276
3293
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -3863,3 +3880,78 @@ class Request_RevokeBotToken$Type extends MessageType {
3863
3880
  * @generated MessageType for protobuf message proto.packets.Request.RevokeBotToken
3864
3881
  */
3865
3882
  export const Request_RevokeBotToken = new Request_RevokeBotToken$Type();
3883
+ // @generated message type with reflection information, may provide speed optimized methods
3884
+ class Request_RefundAttempts$Type extends MessageType {
3885
+ constructor() {
3886
+ super("proto.packets.Request.RefundAttempts", [
3887
+ { no: 1, name: "tournament_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3888
+ { no: 2, name: "event_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3889
+ { no: 3, name: "map_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3890
+ { no: 4, name: "platform_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
3891
+ { no: 5, name: "count", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
3892
+ ]);
3893
+ }
3894
+ create(value) {
3895
+ const message = { tournamentId: "", eventId: "", mapId: "", platformId: "", count: 0 };
3896
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
3897
+ if (value !== undefined)
3898
+ reflectionMergePartial(this, message, value);
3899
+ return message;
3900
+ }
3901
+ internalBinaryRead(reader, length, options, target) {
3902
+ let message = target ?? this.create(), end = reader.pos + length;
3903
+ while (reader.pos < end) {
3904
+ let [fieldNo, wireType] = reader.tag();
3905
+ switch (fieldNo) {
3906
+ case /* string tournament_id */ 1:
3907
+ message.tournamentId = reader.string();
3908
+ break;
3909
+ case /* string event_id */ 2:
3910
+ message.eventId = reader.string();
3911
+ break;
3912
+ case /* string map_id */ 3:
3913
+ message.mapId = reader.string();
3914
+ break;
3915
+ case /* string platform_id */ 4:
3916
+ message.platformId = reader.string();
3917
+ break;
3918
+ case /* int32 count */ 5:
3919
+ message.count = reader.int32();
3920
+ break;
3921
+ default:
3922
+ let u = options.readUnknownField;
3923
+ if (u === "throw")
3924
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
3925
+ let d = reader.skip(wireType);
3926
+ if (u !== false)
3927
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
3928
+ }
3929
+ }
3930
+ return message;
3931
+ }
3932
+ internalBinaryWrite(message, writer, options) {
3933
+ /* string tournament_id = 1; */
3934
+ if (message.tournamentId !== "")
3935
+ writer.tag(1, WireType.LengthDelimited).string(message.tournamentId);
3936
+ /* string event_id = 2; */
3937
+ if (message.eventId !== "")
3938
+ writer.tag(2, WireType.LengthDelimited).string(message.eventId);
3939
+ /* string map_id = 3; */
3940
+ if (message.mapId !== "")
3941
+ writer.tag(3, WireType.LengthDelimited).string(message.mapId);
3942
+ /* string platform_id = 4; */
3943
+ if (message.platformId !== "")
3944
+ writer.tag(4, WireType.LengthDelimited).string(message.platformId);
3945
+ /* int32 count = 5; */
3946
+ if (message.count !== 0)
3947
+ writer.tag(5, WireType.Varint).int32(message.count);
3948
+ let u = options.writeUnknownFields;
3949
+ if (u !== false)
3950
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
3951
+ return writer;
3952
+ }
3953
+ }
3954
+ /**
3955
+ * @generated MessageType for protobuf message proto.packets.Request.RefundAttempts
3956
+ */
3957
+ export const Request_RefundAttempts = new Request_RefundAttempts$Type();
@@ -185,6 +185,12 @@ export interface Response {
185
185
  * @generated from protobuf field: proto.packets.Response.RevokeBotToken revoke_bot_token = 28;
186
186
  */
187
187
  revokeBotToken: Response_RevokeBotToken;
188
+ } | {
189
+ oneofKind: "refundAttempts";
190
+ /**
191
+ * @generated from protobuf field: proto.packets.Response.RefundAttempts refund_attempts = 29;
192
+ */
193
+ refundAttempts: Response_RefundAttempts;
188
194
  } | {
189
195
  oneofKind: undefined;
190
196
  };
@@ -591,6 +597,15 @@ export interface Response_RevokeBotToken {
591
597
  */
592
598
  message: string;
593
599
  }
600
+ /**
601
+ * @generated from protobuf message proto.packets.Response.RefundAttempts
602
+ */
603
+ export interface Response_RefundAttempts {
604
+ /**
605
+ * @generated from protobuf field: string message = 1;
606
+ */
607
+ message: string;
608
+ }
594
609
  /**
595
610
  * @generated from protobuf enum proto.packets.Response.ResponseType
596
611
  */
@@ -894,4 +909,14 @@ declare class Response_RevokeBotToken$Type extends MessageType<Response_RevokeBo
894
909
  * @generated MessageType for protobuf message proto.packets.Response.RevokeBotToken
895
910
  */
896
911
  export declare const Response_RevokeBotToken: Response_RevokeBotToken$Type;
912
+ declare class Response_RefundAttempts$Type extends MessageType<Response_RefundAttempts> {
913
+ constructor();
914
+ create(value?: PartialMessage<Response_RefundAttempts>): Response_RefundAttempts;
915
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Response_RefundAttempts): Response_RefundAttempts;
916
+ internalBinaryWrite(message: Response_RefundAttempts, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
917
+ }
918
+ /**
919
+ * @generated MessageType for protobuf message proto.packets.Response.RefundAttempts
920
+ */
921
+ export declare const Response_RefundAttempts: Response_RefundAttempts$Type;
897
922
  export {};
@@ -76,7 +76,8 @@ class Response$Type extends MessageType {
76
76
  { no: 20, name: "remaining_attempts", kind: "message", oneof: "details", T: () => Response_RemainingAttempts },
77
77
  { no: 26, name: "get_bot_tokens_for_user", kind: "message", oneof: "details", T: () => Response_GetBotTokensForUser },
78
78
  { no: 27, name: "generate_bot_token", kind: "message", oneof: "details", T: () => Response_GenerateBotToken },
79
- { no: 28, name: "revoke_bot_token", kind: "message", oneof: "details", T: () => Response_RevokeBotToken }
79
+ { no: 28, name: "revoke_bot_token", kind: "message", oneof: "details", T: () => Response_RevokeBotToken },
80
+ { no: 29, name: "refund_attempts", kind: "message", oneof: "details", T: () => Response_RefundAttempts }
80
81
  ]);
81
82
  }
82
83
  create(value) {
@@ -253,6 +254,12 @@ class Response$Type extends MessageType {
253
254
  revokeBotToken: Response_RevokeBotToken.internalBinaryRead(reader, reader.uint32(), options, message.details.revokeBotToken)
254
255
  };
255
256
  break;
257
+ case /* proto.packets.Response.RefundAttempts refund_attempts */ 29:
258
+ message.details = {
259
+ oneofKind: "refundAttempts",
260
+ refundAttempts: Response_RefundAttempts.internalBinaryRead(reader, reader.uint32(), options, message.details.refundAttempts)
261
+ };
262
+ break;
256
263
  default:
257
264
  let u = options.readUnknownField;
258
265
  if (u === "throw")
@@ -349,6 +356,9 @@ class Response$Type extends MessageType {
349
356
  /* proto.packets.Response.RevokeBotToken revoke_bot_token = 28; */
350
357
  if (message.details.oneofKind === "revokeBotToken")
351
358
  Response_RevokeBotToken.internalBinaryWrite(message.details.revokeBotToken, writer.tag(28, WireType.LengthDelimited).fork(), options).join();
359
+ /* proto.packets.Response.RefundAttempts refund_attempts = 29; */
360
+ if (message.details.oneofKind === "refundAttempts")
361
+ Response_RefundAttempts.internalBinaryWrite(message.details.refundAttempts, writer.tag(29, WireType.LengthDelimited).fork(), options).join();
352
362
  let u = options.writeUnknownFields;
353
363
  if (u !== false)
354
364
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -1899,3 +1909,50 @@ class Response_RevokeBotToken$Type extends MessageType {
1899
1909
  * @generated MessageType for protobuf message proto.packets.Response.RevokeBotToken
1900
1910
  */
1901
1911
  export const Response_RevokeBotToken = new Response_RevokeBotToken$Type();
1912
+ // @generated message type with reflection information, may provide speed optimized methods
1913
+ class Response_RefundAttempts$Type extends MessageType {
1914
+ constructor() {
1915
+ super("proto.packets.Response.RefundAttempts", [
1916
+ { no: 1, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1917
+ ]);
1918
+ }
1919
+ create(value) {
1920
+ const message = { message: "" };
1921
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1922
+ if (value !== undefined)
1923
+ reflectionMergePartial(this, message, value);
1924
+ return message;
1925
+ }
1926
+ internalBinaryRead(reader, length, options, target) {
1927
+ let message = target ?? this.create(), end = reader.pos + length;
1928
+ while (reader.pos < end) {
1929
+ let [fieldNo, wireType] = reader.tag();
1930
+ switch (fieldNo) {
1931
+ case /* string message */ 1:
1932
+ message.message = reader.string();
1933
+ break;
1934
+ default:
1935
+ let u = options.readUnknownField;
1936
+ if (u === "throw")
1937
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1938
+ let d = reader.skip(wireType);
1939
+ if (u !== false)
1940
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1941
+ }
1942
+ }
1943
+ return message;
1944
+ }
1945
+ internalBinaryWrite(message, writer, options) {
1946
+ /* string message = 1; */
1947
+ if (message.message !== "")
1948
+ writer.tag(1, WireType.LengthDelimited).string(message.message);
1949
+ let u = options.writeUnknownFields;
1950
+ if (u !== false)
1951
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1952
+ return writer;
1953
+ }
1954
+ }
1955
+ /**
1956
+ * @generated MessageType for protobuf message proto.packets.Response.RefundAttempts
1957
+ */
1958
+ export const Response_RefundAttempts = new Response_RefundAttempts$Type();
@@ -3,7 +3,7 @@ import { User, Match, QualifierEvent, CoreServer, Tournament, GameplayParameters
3
3
  import { StateManager } from "./state-manager.js";
4
4
  import { Response, Response_Connect } from "./models/responses.js";
5
5
  import { Request_LoadSong, Request_ShowPrompt_PromptOption } from "./models/requests.js";
6
- import { Channel, Push_SongFinished } from "./models/index.js";
6
+ import { Channel, Push_QualifierScoreSubmitted, Push_SongFinished } from "./models/index.js";
7
7
  export * from "./scraper.js";
8
8
  export * from "./models/models.js";
9
9
  export type ResponseFromUser = {
@@ -19,6 +19,7 @@ type TAClientEvents = {
19
19
  loadSongRequested: [string, string, Request_LoadSong];
20
20
  songFinished: Push_SongFinished;
21
21
  realtimeScore: RealtimeScore;
22
+ qualifierScoreSubmitted: Push_QualifierScoreSubmitted;
22
23
  responseReceived: ResponseFromUser;
23
24
  joinedTournament: {};
24
25
  failedToJoinTournament: {};
@@ -69,6 +70,7 @@ export declare class TAClient extends CustomEventEmitter<TAClientEvents> {
69
70
  loadSong: (levelId: string, userIds: string[], timeout?: number) => Promise<ResponseFromUser[]>;
70
71
  loadImage: (bitmap: Uint8Array, userIds: string[]) => Promise<ResponseFromUser[]>;
71
72
  showPrompt: (userIds: string[], titleText: string, bodyText: string, canClose: boolean, options: Request_ShowPrompt_PromptOption[], timer?: number) => Promise<ResponseFromUser[]>;
73
+ refundAttempts: (tournamentId: string, qualifierId: string, mapId: string, platformId: string, count: number) => Promise<ResponseFromUser[]>;
72
74
  private handlePacket;
73
75
  updateUser: (tournamentId: string, user: User) => Promise<Response>;
74
76
  createMatch: (tournamentId: string, match: Match) => Promise<Response>;