moons-ta-client 1.1.6 → 1.1.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.
@@ -73,7 +73,10 @@ class Request$Type extends MessageType {
73
73
  { no: 40, name: "load_song", kind: "message", oneof: "type", T: () => Request_LoadSong },
74
74
  { no: 41, name: "preload_image_for_stream_sync", kind: "message", oneof: "type", T: () => Request_PreloadImageForStreamSync },
75
75
  { no: 42, name: "show_prompt", kind: "message", oneof: "type", T: () => Request_ShowPrompt },
76
- { no: 43, name: "remaining_attempts", kind: "message", oneof: "type", T: () => Request_RemainingAttempts }
76
+ { no: 43, name: "remaining_attempts", kind: "message", oneof: "type", T: () => Request_RemainingAttempts },
77
+ { no: 55, name: "get_bot_tokens_for_user", kind: "message", oneof: "type", T: () => Request_GetBotTokensForUser },
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 }
77
80
  ]);
78
81
  }
79
82
  create(value) {
@@ -406,6 +409,24 @@ class Request$Type extends MessageType {
406
409
  remainingAttempts: Request_RemainingAttempts.internalBinaryRead(reader, reader.uint32(), options, message.type.remainingAttempts)
407
410
  };
408
411
  break;
412
+ case /* proto.packets.Request.GetBotTokensForUser get_bot_tokens_for_user */ 55:
413
+ message.type = {
414
+ oneofKind: "getBotTokensForUser",
415
+ getBotTokensForUser: Request_GetBotTokensForUser.internalBinaryRead(reader, reader.uint32(), options, message.type.getBotTokensForUser)
416
+ };
417
+ break;
418
+ case /* proto.packets.Request.GenerateBotToken generate_bot_token */ 56:
419
+ message.type = {
420
+ oneofKind: "generateBotToken",
421
+ generateBotToken: Request_GenerateBotToken.internalBinaryRead(reader, reader.uint32(), options, message.type.generateBotToken)
422
+ };
423
+ break;
424
+ case /* proto.packets.Request.RevokeBotToken revoke_bot_token */ 57:
425
+ message.type = {
426
+ oneofKind: "revokeBotToken",
427
+ revokeBotToken: Request_RevokeBotToken.internalBinaryRead(reader, reader.uint32(), options, message.type.revokeBotToken)
428
+ };
429
+ break;
409
430
  default:
410
431
  let u = options.readUnknownField;
411
432
  if (u === "throw")
@@ -577,6 +598,15 @@ class Request$Type extends MessageType {
577
598
  /* proto.packets.Request.RemainingAttempts remaining_attempts = 43; */
578
599
  if (message.type.oneofKind === "remainingAttempts")
579
600
  Request_RemainingAttempts.internalBinaryWrite(message.type.remainingAttempts, writer.tag(43, WireType.LengthDelimited).fork(), options).join();
601
+ /* proto.packets.Request.GetBotTokensForUser get_bot_tokens_for_user = 55; */
602
+ if (message.type.oneofKind === "getBotTokensForUser")
603
+ Request_GetBotTokensForUser.internalBinaryWrite(message.type.getBotTokensForUser, writer.tag(55, WireType.LengthDelimited).fork(), options).join();
604
+ /* proto.packets.Request.GenerateBotToken generate_bot_token = 56; */
605
+ if (message.type.oneofKind === "generateBotToken")
606
+ Request_GenerateBotToken.internalBinaryWrite(message.type.generateBotToken, writer.tag(56, WireType.LengthDelimited).fork(), options).join();
607
+ /* proto.packets.Request.RevokeBotToken revoke_bot_token = 57; */
608
+ if (message.type.oneofKind === "revokeBotToken")
609
+ Request_RevokeBotToken.internalBinaryWrite(message.type.revokeBotToken, writer.tag(57, WireType.LengthDelimited).fork(), options).join();
580
610
  let u = options.writeUnknownFields;
581
611
  if (u !== false)
582
612
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -3692,3 +3722,144 @@ class Request_RemainingAttempts$Type extends MessageType {
3692
3722
  * @generated MessageType for protobuf message proto.packets.Request.RemainingAttempts
3693
3723
  */
3694
3724
  export const Request_RemainingAttempts = new Request_RemainingAttempts$Type();
3725
+ // @generated message type with reflection information, may provide speed optimized methods
3726
+ class Request_GetBotTokensForUser$Type extends MessageType {
3727
+ constructor() {
3728
+ super("proto.packets.Request.GetBotTokensForUser", [
3729
+ { no: 1, name: "owner_discord_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
3730
+ ]);
3731
+ }
3732
+ create(value) {
3733
+ const message = { ownerDiscordId: "" };
3734
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
3735
+ if (value !== undefined)
3736
+ reflectionMergePartial(this, message, value);
3737
+ return message;
3738
+ }
3739
+ internalBinaryRead(reader, length, options, target) {
3740
+ let message = target ?? this.create(), end = reader.pos + length;
3741
+ while (reader.pos < end) {
3742
+ let [fieldNo, wireType] = reader.tag();
3743
+ switch (fieldNo) {
3744
+ case /* string owner_discord_id */ 1:
3745
+ message.ownerDiscordId = reader.string();
3746
+ break;
3747
+ default:
3748
+ let u = options.readUnknownField;
3749
+ if (u === "throw")
3750
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
3751
+ let d = reader.skip(wireType);
3752
+ if (u !== false)
3753
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
3754
+ }
3755
+ }
3756
+ return message;
3757
+ }
3758
+ internalBinaryWrite(message, writer, options) {
3759
+ /* string owner_discord_id = 1; */
3760
+ if (message.ownerDiscordId !== "")
3761
+ writer.tag(1, WireType.LengthDelimited).string(message.ownerDiscordId);
3762
+ let u = options.writeUnknownFields;
3763
+ if (u !== false)
3764
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
3765
+ return writer;
3766
+ }
3767
+ }
3768
+ /**
3769
+ * @generated MessageType for protobuf message proto.packets.Request.GetBotTokensForUser
3770
+ */
3771
+ export const Request_GetBotTokensForUser = new Request_GetBotTokensForUser$Type();
3772
+ // @generated message type with reflection information, may provide speed optimized methods
3773
+ class Request_GenerateBotToken$Type extends MessageType {
3774
+ constructor() {
3775
+ super("proto.packets.Request.GenerateBotToken", [
3776
+ { no: 1, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
3777
+ ]);
3778
+ }
3779
+ create(value) {
3780
+ const message = { username: "" };
3781
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
3782
+ if (value !== undefined)
3783
+ reflectionMergePartial(this, message, value);
3784
+ return message;
3785
+ }
3786
+ internalBinaryRead(reader, length, options, target) {
3787
+ let message = target ?? this.create(), end = reader.pos + length;
3788
+ while (reader.pos < end) {
3789
+ let [fieldNo, wireType] = reader.tag();
3790
+ switch (fieldNo) {
3791
+ case /* string username */ 1:
3792
+ message.username = reader.string();
3793
+ break;
3794
+ default:
3795
+ let u = options.readUnknownField;
3796
+ if (u === "throw")
3797
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
3798
+ let d = reader.skip(wireType);
3799
+ if (u !== false)
3800
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
3801
+ }
3802
+ }
3803
+ return message;
3804
+ }
3805
+ internalBinaryWrite(message, writer, options) {
3806
+ /* string username = 1; */
3807
+ if (message.username !== "")
3808
+ writer.tag(1, WireType.LengthDelimited).string(message.username);
3809
+ let u = options.writeUnknownFields;
3810
+ if (u !== false)
3811
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
3812
+ return writer;
3813
+ }
3814
+ }
3815
+ /**
3816
+ * @generated MessageType for protobuf message proto.packets.Request.GenerateBotToken
3817
+ */
3818
+ export const Request_GenerateBotToken = new Request_GenerateBotToken$Type();
3819
+ // @generated message type with reflection information, may provide speed optimized methods
3820
+ class Request_RevokeBotToken$Type extends MessageType {
3821
+ constructor() {
3822
+ super("proto.packets.Request.RevokeBotToken", [
3823
+ { no: 1, name: "bot_token_guid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
3824
+ ]);
3825
+ }
3826
+ create(value) {
3827
+ const message = { botTokenGuid: "" };
3828
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
3829
+ if (value !== undefined)
3830
+ reflectionMergePartial(this, message, value);
3831
+ return message;
3832
+ }
3833
+ internalBinaryRead(reader, length, options, target) {
3834
+ let message = target ?? this.create(), end = reader.pos + length;
3835
+ while (reader.pos < end) {
3836
+ let [fieldNo, wireType] = reader.tag();
3837
+ switch (fieldNo) {
3838
+ case /* string bot_token_guid */ 1:
3839
+ message.botTokenGuid = reader.string();
3840
+ break;
3841
+ default:
3842
+ let u = options.readUnknownField;
3843
+ if (u === "throw")
3844
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
3845
+ let d = reader.skip(wireType);
3846
+ if (u !== false)
3847
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
3848
+ }
3849
+ }
3850
+ return message;
3851
+ }
3852
+ internalBinaryWrite(message, writer, options) {
3853
+ /* string bot_token_guid = 1; */
3854
+ if (message.botTokenGuid !== "")
3855
+ writer.tag(1, WireType.LengthDelimited).string(message.botTokenGuid);
3856
+ let u = options.writeUnknownFields;
3857
+ if (u !== false)
3858
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
3859
+ return writer;
3860
+ }
3861
+ }
3862
+ /**
3863
+ * @generated MessageType for protobuf message proto.packets.Request.RevokeBotToken
3864
+ */
3865
+ export const Request_RevokeBotToken = new Request_RevokeBotToken$Type();
@@ -167,6 +167,24 @@ export interface Response {
167
167
  * @generated from protobuf field: proto.packets.Response.RemainingAttempts remaining_attempts = 20;
168
168
  */
169
169
  remainingAttempts: Response_RemainingAttempts;
170
+ } | {
171
+ oneofKind: "getBotTokensForUser";
172
+ /**
173
+ * @generated from protobuf field: proto.packets.Response.GetBotTokensForUser get_bot_tokens_for_user = 26;
174
+ */
175
+ getBotTokensForUser: Response_GetBotTokensForUser;
176
+ } | {
177
+ oneofKind: "generateBotToken";
178
+ /**
179
+ * @generated from protobuf field: proto.packets.Response.GenerateBotToken generate_bot_token = 27;
180
+ */
181
+ generateBotToken: Response_GenerateBotToken;
182
+ } | {
183
+ oneofKind: "revokeBotToken";
184
+ /**
185
+ * @generated from protobuf field: proto.packets.Response.RevokeBotToken revoke_bot_token = 28;
186
+ */
187
+ revokeBotToken: Response_RevokeBotToken;
170
188
  } | {
171
189
  oneofKind: undefined;
172
190
  };
@@ -529,6 +547,50 @@ export interface Response_RemainingAttempts {
529
547
  */
530
548
  remainingAttempts: number;
531
549
  }
550
+ /**
551
+ * @generated from protobuf message proto.packets.Response.GetBotTokensForUser
552
+ */
553
+ export interface Response_GetBotTokensForUser {
554
+ /**
555
+ * @generated from protobuf field: repeated proto.packets.Response.GetBotTokensForUser.BotUser bot_users = 1;
556
+ */
557
+ botUsers: Response_GetBotTokensForUser_BotUser[];
558
+ }
559
+ /**
560
+ * @generated from protobuf message proto.packets.Response.GetBotTokensForUser.BotUser
561
+ */
562
+ export interface Response_GetBotTokensForUser_BotUser {
563
+ /**
564
+ * @generated from protobuf field: string guid = 1;
565
+ */
566
+ guid: string;
567
+ /**
568
+ * @generated from protobuf field: string username = 2;
569
+ */
570
+ username: string;
571
+ /**
572
+ * @generated from protobuf field: string owner_discord_id = 3;
573
+ */
574
+ ownerDiscordId: string;
575
+ }
576
+ /**
577
+ * @generated from protobuf message proto.packets.Response.GenerateBotToken
578
+ */
579
+ export interface Response_GenerateBotToken {
580
+ /**
581
+ * @generated from protobuf field: string bot_token = 1;
582
+ */
583
+ botToken: string;
584
+ }
585
+ /**
586
+ * @generated from protobuf message proto.packets.Response.RevokeBotToken
587
+ */
588
+ export interface Response_RevokeBotToken {
589
+ /**
590
+ * @generated from protobuf field: string message = 1;
591
+ */
592
+ message: string;
593
+ }
532
594
  /**
533
595
  * @generated from protobuf enum proto.packets.Response.ResponseType
534
596
  */
@@ -792,4 +854,44 @@ declare class Response_RemainingAttempts$Type extends MessageType<Response_Remai
792
854
  * @generated MessageType for protobuf message proto.packets.Response.RemainingAttempts
793
855
  */
794
856
  export declare const Response_RemainingAttempts: Response_RemainingAttempts$Type;
857
+ declare class Response_GetBotTokensForUser$Type extends MessageType<Response_GetBotTokensForUser> {
858
+ constructor();
859
+ create(value?: PartialMessage<Response_GetBotTokensForUser>): Response_GetBotTokensForUser;
860
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Response_GetBotTokensForUser): Response_GetBotTokensForUser;
861
+ internalBinaryWrite(message: Response_GetBotTokensForUser, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
862
+ }
863
+ /**
864
+ * @generated MessageType for protobuf message proto.packets.Response.GetBotTokensForUser
865
+ */
866
+ export declare const Response_GetBotTokensForUser: Response_GetBotTokensForUser$Type;
867
+ declare class Response_GetBotTokensForUser_BotUser$Type extends MessageType<Response_GetBotTokensForUser_BotUser> {
868
+ constructor();
869
+ create(value?: PartialMessage<Response_GetBotTokensForUser_BotUser>): Response_GetBotTokensForUser_BotUser;
870
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Response_GetBotTokensForUser_BotUser): Response_GetBotTokensForUser_BotUser;
871
+ internalBinaryWrite(message: Response_GetBotTokensForUser_BotUser, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
872
+ }
873
+ /**
874
+ * @generated MessageType for protobuf message proto.packets.Response.GetBotTokensForUser.BotUser
875
+ */
876
+ export declare const Response_GetBotTokensForUser_BotUser: Response_GetBotTokensForUser_BotUser$Type;
877
+ declare class Response_GenerateBotToken$Type extends MessageType<Response_GenerateBotToken> {
878
+ constructor();
879
+ create(value?: PartialMessage<Response_GenerateBotToken>): Response_GenerateBotToken;
880
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Response_GenerateBotToken): Response_GenerateBotToken;
881
+ internalBinaryWrite(message: Response_GenerateBotToken, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
882
+ }
883
+ /**
884
+ * @generated MessageType for protobuf message proto.packets.Response.GenerateBotToken
885
+ */
886
+ export declare const Response_GenerateBotToken: Response_GenerateBotToken$Type;
887
+ declare class Response_RevokeBotToken$Type extends MessageType<Response_RevokeBotToken> {
888
+ constructor();
889
+ create(value?: PartialMessage<Response_RevokeBotToken>): Response_RevokeBotToken;
890
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Response_RevokeBotToken): Response_RevokeBotToken;
891
+ internalBinaryWrite(message: Response_RevokeBotToken, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
892
+ }
893
+ /**
894
+ * @generated MessageType for protobuf message proto.packets.Response.RevokeBotToken
895
+ */
896
+ export declare const Response_RevokeBotToken: Response_RevokeBotToken$Type;
795
897
  export {};
@@ -73,7 +73,10 @@ class Response$Type extends MessageType {
73
73
  { no: 17, name: "load_song", kind: "message", oneof: "details", T: () => Response_LoadSong },
74
74
  { no: 18, name: "preload_image_for_stream_sync", kind: "message", oneof: "details", T: () => Response_PreloadImageForStreamSync },
75
75
  { no: 19, name: "show_prompt", kind: "message", oneof: "details", T: () => Response_ShowPrompt },
76
- { no: 20, name: "remaining_attempts", kind: "message", oneof: "details", T: () => Response_RemainingAttempts }
76
+ { no: 20, name: "remaining_attempts", kind: "message", oneof: "details", T: () => Response_RemainingAttempts },
77
+ { no: 26, name: "get_bot_tokens_for_user", kind: "message", oneof: "details", T: () => Response_GetBotTokensForUser },
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 }
77
80
  ]);
78
81
  }
79
82
  create(value) {
@@ -232,6 +235,24 @@ class Response$Type extends MessageType {
232
235
  remainingAttempts: Response_RemainingAttempts.internalBinaryRead(reader, reader.uint32(), options, message.details.remainingAttempts)
233
236
  };
234
237
  break;
238
+ case /* proto.packets.Response.GetBotTokensForUser get_bot_tokens_for_user */ 26:
239
+ message.details = {
240
+ oneofKind: "getBotTokensForUser",
241
+ getBotTokensForUser: Response_GetBotTokensForUser.internalBinaryRead(reader, reader.uint32(), options, message.details.getBotTokensForUser)
242
+ };
243
+ break;
244
+ case /* proto.packets.Response.GenerateBotToken generate_bot_token */ 27:
245
+ message.details = {
246
+ oneofKind: "generateBotToken",
247
+ generateBotToken: Response_GenerateBotToken.internalBinaryRead(reader, reader.uint32(), options, message.details.generateBotToken)
248
+ };
249
+ break;
250
+ case /* proto.packets.Response.RevokeBotToken revoke_bot_token */ 28:
251
+ message.details = {
252
+ oneofKind: "revokeBotToken",
253
+ revokeBotToken: Response_RevokeBotToken.internalBinaryRead(reader, reader.uint32(), options, message.details.revokeBotToken)
254
+ };
255
+ break;
235
256
  default:
236
257
  let u = options.readUnknownField;
237
258
  if (u === "throw")
@@ -319,6 +340,15 @@ class Response$Type extends MessageType {
319
340
  /* proto.packets.Response.RemainingAttempts remaining_attempts = 20; */
320
341
  if (message.details.oneofKind === "remainingAttempts")
321
342
  Response_RemainingAttempts.internalBinaryWrite(message.details.remainingAttempts, writer.tag(20, WireType.LengthDelimited).fork(), options).join();
343
+ /* proto.packets.Response.GetBotTokensForUser get_bot_tokens_for_user = 26; */
344
+ if (message.details.oneofKind === "getBotTokensForUser")
345
+ Response_GetBotTokensForUser.internalBinaryWrite(message.details.getBotTokensForUser, writer.tag(26, WireType.LengthDelimited).fork(), options).join();
346
+ /* proto.packets.Response.GenerateBotToken generate_bot_token = 27; */
347
+ if (message.details.oneofKind === "generateBotToken")
348
+ Response_GenerateBotToken.internalBinaryWrite(message.details.generateBotToken, writer.tag(27, WireType.LengthDelimited).fork(), options).join();
349
+ /* proto.packets.Response.RevokeBotToken revoke_bot_token = 28; */
350
+ if (message.details.oneofKind === "revokeBotToken")
351
+ Response_RevokeBotToken.internalBinaryWrite(message.details.revokeBotToken, writer.tag(28, WireType.LengthDelimited).fork(), options).join();
322
352
  let u = options.writeUnknownFields;
323
353
  if (u !== false)
324
354
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -1667,3 +1697,205 @@ class Response_RemainingAttempts$Type extends MessageType {
1667
1697
  * @generated MessageType for protobuf message proto.packets.Response.RemainingAttempts
1668
1698
  */
1669
1699
  export const Response_RemainingAttempts = new Response_RemainingAttempts$Type();
1700
+ // @generated message type with reflection information, may provide speed optimized methods
1701
+ class Response_GetBotTokensForUser$Type extends MessageType {
1702
+ constructor() {
1703
+ super("proto.packets.Response.GetBotTokensForUser", [
1704
+ { no: 1, name: "bot_users", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Response_GetBotTokensForUser_BotUser }
1705
+ ]);
1706
+ }
1707
+ create(value) {
1708
+ const message = { botUsers: [] };
1709
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1710
+ if (value !== undefined)
1711
+ reflectionMergePartial(this, message, value);
1712
+ return message;
1713
+ }
1714
+ internalBinaryRead(reader, length, options, target) {
1715
+ let message = target ?? this.create(), end = reader.pos + length;
1716
+ while (reader.pos < end) {
1717
+ let [fieldNo, wireType] = reader.tag();
1718
+ switch (fieldNo) {
1719
+ case /* repeated proto.packets.Response.GetBotTokensForUser.BotUser bot_users */ 1:
1720
+ message.botUsers.push(Response_GetBotTokensForUser_BotUser.internalBinaryRead(reader, reader.uint32(), options));
1721
+ break;
1722
+ default:
1723
+ let u = options.readUnknownField;
1724
+ if (u === "throw")
1725
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1726
+ let d = reader.skip(wireType);
1727
+ if (u !== false)
1728
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1729
+ }
1730
+ }
1731
+ return message;
1732
+ }
1733
+ internalBinaryWrite(message, writer, options) {
1734
+ /* repeated proto.packets.Response.GetBotTokensForUser.BotUser bot_users = 1; */
1735
+ for (let i = 0; i < message.botUsers.length; i++)
1736
+ Response_GetBotTokensForUser_BotUser.internalBinaryWrite(message.botUsers[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1737
+ let u = options.writeUnknownFields;
1738
+ if (u !== false)
1739
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1740
+ return writer;
1741
+ }
1742
+ }
1743
+ /**
1744
+ * @generated MessageType for protobuf message proto.packets.Response.GetBotTokensForUser
1745
+ */
1746
+ export const Response_GetBotTokensForUser = new Response_GetBotTokensForUser$Type();
1747
+ // @generated message type with reflection information, may provide speed optimized methods
1748
+ class Response_GetBotTokensForUser_BotUser$Type extends MessageType {
1749
+ constructor() {
1750
+ super("proto.packets.Response.GetBotTokensForUser.BotUser", [
1751
+ { no: 1, name: "guid", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1752
+ { no: 2, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1753
+ { no: 3, name: "owner_discord_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1754
+ ]);
1755
+ }
1756
+ create(value) {
1757
+ const message = { guid: "", username: "", ownerDiscordId: "" };
1758
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1759
+ if (value !== undefined)
1760
+ reflectionMergePartial(this, message, value);
1761
+ return message;
1762
+ }
1763
+ internalBinaryRead(reader, length, options, target) {
1764
+ let message = target ?? this.create(), end = reader.pos + length;
1765
+ while (reader.pos < end) {
1766
+ let [fieldNo, wireType] = reader.tag();
1767
+ switch (fieldNo) {
1768
+ case /* string guid */ 1:
1769
+ message.guid = reader.string();
1770
+ break;
1771
+ case /* string username */ 2:
1772
+ message.username = reader.string();
1773
+ break;
1774
+ case /* string owner_discord_id */ 3:
1775
+ message.ownerDiscordId = reader.string();
1776
+ break;
1777
+ default:
1778
+ let u = options.readUnknownField;
1779
+ if (u === "throw")
1780
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1781
+ let d = reader.skip(wireType);
1782
+ if (u !== false)
1783
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1784
+ }
1785
+ }
1786
+ return message;
1787
+ }
1788
+ internalBinaryWrite(message, writer, options) {
1789
+ /* string guid = 1; */
1790
+ if (message.guid !== "")
1791
+ writer.tag(1, WireType.LengthDelimited).string(message.guid);
1792
+ /* string username = 2; */
1793
+ if (message.username !== "")
1794
+ writer.tag(2, WireType.LengthDelimited).string(message.username);
1795
+ /* string owner_discord_id = 3; */
1796
+ if (message.ownerDiscordId !== "")
1797
+ writer.tag(3, WireType.LengthDelimited).string(message.ownerDiscordId);
1798
+ let u = options.writeUnknownFields;
1799
+ if (u !== false)
1800
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1801
+ return writer;
1802
+ }
1803
+ }
1804
+ /**
1805
+ * @generated MessageType for protobuf message proto.packets.Response.GetBotTokensForUser.BotUser
1806
+ */
1807
+ export const Response_GetBotTokensForUser_BotUser = new Response_GetBotTokensForUser_BotUser$Type();
1808
+ // @generated message type with reflection information, may provide speed optimized methods
1809
+ class Response_GenerateBotToken$Type extends MessageType {
1810
+ constructor() {
1811
+ super("proto.packets.Response.GenerateBotToken", [
1812
+ { no: 1, name: "bot_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1813
+ ]);
1814
+ }
1815
+ create(value) {
1816
+ const message = { botToken: "" };
1817
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1818
+ if (value !== undefined)
1819
+ reflectionMergePartial(this, message, value);
1820
+ return message;
1821
+ }
1822
+ internalBinaryRead(reader, length, options, target) {
1823
+ let message = target ?? this.create(), end = reader.pos + length;
1824
+ while (reader.pos < end) {
1825
+ let [fieldNo, wireType] = reader.tag();
1826
+ switch (fieldNo) {
1827
+ case /* string bot_token */ 1:
1828
+ message.botToken = reader.string();
1829
+ break;
1830
+ default:
1831
+ let u = options.readUnknownField;
1832
+ if (u === "throw")
1833
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1834
+ let d = reader.skip(wireType);
1835
+ if (u !== false)
1836
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1837
+ }
1838
+ }
1839
+ return message;
1840
+ }
1841
+ internalBinaryWrite(message, writer, options) {
1842
+ /* string bot_token = 1; */
1843
+ if (message.botToken !== "")
1844
+ writer.tag(1, WireType.LengthDelimited).string(message.botToken);
1845
+ let u = options.writeUnknownFields;
1846
+ if (u !== false)
1847
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1848
+ return writer;
1849
+ }
1850
+ }
1851
+ /**
1852
+ * @generated MessageType for protobuf message proto.packets.Response.GenerateBotToken
1853
+ */
1854
+ export const Response_GenerateBotToken = new Response_GenerateBotToken$Type();
1855
+ // @generated message type with reflection information, may provide speed optimized methods
1856
+ class Response_RevokeBotToken$Type extends MessageType {
1857
+ constructor() {
1858
+ super("proto.packets.Response.RevokeBotToken", [
1859
+ { no: 1, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1860
+ ]);
1861
+ }
1862
+ create(value) {
1863
+ const message = { message: "" };
1864
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1865
+ if (value !== undefined)
1866
+ reflectionMergePartial(this, message, value);
1867
+ return message;
1868
+ }
1869
+ internalBinaryRead(reader, length, options, target) {
1870
+ let message = target ?? this.create(), end = reader.pos + length;
1871
+ while (reader.pos < end) {
1872
+ let [fieldNo, wireType] = reader.tag();
1873
+ switch (fieldNo) {
1874
+ case /* string message */ 1:
1875
+ message.message = reader.string();
1876
+ break;
1877
+ default:
1878
+ let u = options.readUnknownField;
1879
+ if (u === "throw")
1880
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1881
+ let d = reader.skip(wireType);
1882
+ if (u !== false)
1883
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1884
+ }
1885
+ }
1886
+ return message;
1887
+ }
1888
+ internalBinaryWrite(message, writer, options) {
1889
+ /* string message = 1; */
1890
+ if (message.message !== "")
1891
+ writer.tag(1, WireType.LengthDelimited).string(message.message);
1892
+ let u = options.writeUnknownFields;
1893
+ if (u !== false)
1894
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1895
+ return writer;
1896
+ }
1897
+ }
1898
+ /**
1899
+ * @generated MessageType for protobuf message proto.packets.Response.RevokeBotToken
1900
+ */
1901
+ export const Response_RevokeBotToken = new Response_RevokeBotToken$Type();
@@ -89,6 +89,9 @@ export declare class TAClient extends CustomEventEmitter<TAClientEvents> {
89
89
  removeAuthorizedUser: (tournamentId: string, discordId: string) => Promise<Response>;
90
90
  getAuthorizedUsers: (tournamentId: string) => Promise<Response>;
91
91
  getDiscordInfo: (tournamentId: string, discordId: string) => Promise<Response>;
92
+ getBotTokensForUser: (ownerDiscordId: string) => Promise<Response>;
93
+ generateBotToken: (username: string) => Promise<Response>;
94
+ revokeBotToken: (botTokenGuid: string) => Promise<Response>;
92
95
  createTournament: (tournament: Tournament) => Promise<Response>;
93
96
  setTournamentName: (tournamentId: string, tournamentName: string) => Promise<Response>;
94
97
  setTournamentImage: (tournamentId: string, tournamentImage: Uint8Array) => Promise<Response>;
@@ -853,6 +853,48 @@ export class TAClient extends CustomEventEmitter {
853
853
  }
854
854
  return response[0].response;
855
855
  };
856
+ getBotTokensForUser = async (ownerDiscordId) => {
857
+ const response = await this.sendRequest({
858
+ type: {
859
+ oneofKind: "getBotTokensForUser",
860
+ getBotTokensForUser: {
861
+ ownerDiscordId
862
+ },
863
+ },
864
+ });
865
+ if (response.length <= 0) {
866
+ throw new Error("Server timed out");
867
+ }
868
+ return response[0].response;
869
+ };
870
+ generateBotToken = async (username) => {
871
+ const response = await this.sendRequest({
872
+ type: {
873
+ oneofKind: "generateBotToken",
874
+ generateBotToken: {
875
+ username
876
+ },
877
+ },
878
+ });
879
+ if (response.length <= 0) {
880
+ throw new Error("Server timed out");
881
+ }
882
+ return response[0].response;
883
+ };
884
+ revokeBotToken = async (botTokenGuid) => {
885
+ const response = await this.sendRequest({
886
+ type: {
887
+ oneofKind: "revokeBotToken",
888
+ revokeBotToken: {
889
+ botTokenGuid
890
+ },
891
+ },
892
+ });
893
+ if (response.length <= 0) {
894
+ throw new Error("Server timed out");
895
+ }
896
+ return response[0].response;
897
+ };
856
898
  createTournament = async (tournament) => {
857
899
  const response = await this.sendRequest({
858
900
  type: {
package/package.json CHANGED
@@ -1,13 +1,19 @@
1
1
  {
2
2
  "name": "moons-ta-client",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
- "node": "./dist/index.js",
10
- "default": "./dist/index.esm.js"
9
+ "node": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "default": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.esm.js"
16
+ }
11
17
  }
12
18
  },
13
19
  "scripts": {