moons-ta-client 1.2.4 → 1.3.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.
@@ -1,7 +1,6 @@
1
1
  import { WireType } from "@protobuf-ts/runtime";
2
2
  import { UnknownFieldHandler } from "@protobuf-ts/runtime";
3
3
  import { reflectionMergePartial } from "@protobuf-ts/runtime";
4
- import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
5
4
  import { MessageType } from "@protobuf-ts/runtime";
6
5
  import { LeaderboardEntry } from './models.js';
7
6
  import { State } from './models.js';
@@ -76,12 +75,15 @@ class Response$Type extends MessageType {
76
75
  { no: 26, name: "get_bot_tokens_for_user", kind: "message", oneof: "details", T: () => Response_GetBotTokensForUser },
77
76
  { no: 27, name: "generate_bot_token", kind: "message", oneof: "details", T: () => Response_GenerateBotToken },
78
77
  { no: 28, name: "revoke_bot_token", kind: "message", oneof: "details", T: () => Response_RevokeBotToken },
79
- { no: 29, name: "refund_attempts", kind: "message", oneof: "details", T: () => Response_RefundAttempts }
78
+ { no: 29, name: "refund_attempts", kind: "message", oneof: "details", T: () => Response_RefundAttempts },
79
+ { no: 30, name: "permission_error", kind: "message", oneof: "details", T: () => Response_PermissionError }
80
80
  ]);
81
81
  }
82
82
  create(value) {
83
- const message = { type: 0, respondingToPacketId: "", details: { oneofKind: undefined } };
84
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
83
+ const message = globalThis.Object.create((this.messagePrototype));
84
+ message.type = 0;
85
+ message.respondingToPacketId = "";
86
+ message.details = { oneofKind: undefined };
85
87
  if (value !== undefined)
86
88
  reflectionMergePartial(this, message, value);
87
89
  return message;
@@ -259,6 +261,12 @@ class Response$Type extends MessageType {
259
261
  refundAttempts: Response_RefundAttempts.internalBinaryRead(reader, reader.uint32(), options, message.details.refundAttempts)
260
262
  };
261
263
  break;
264
+ case /* proto.packets.Response.PermissionError permission_error */ 30:
265
+ message.details = {
266
+ oneofKind: "permissionError",
267
+ permissionError: Response_PermissionError.internalBinaryRead(reader, reader.uint32(), options, message.details.permissionError)
268
+ };
269
+ break;
262
270
  default:
263
271
  let u = options.readUnknownField;
264
272
  if (u === "throw")
@@ -298,21 +306,6 @@ class Response$Type extends MessageType {
298
306
  /* proto.packets.Response.DeleteQualifierEvent delete_qualifier_event = 9; */
299
307
  if (message.details.oneofKind === "deleteQualifierEvent")
300
308
  Response_DeleteQualifierEvent.internalBinaryWrite(message.details.deleteQualifierEvent, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
301
- /* proto.packets.Response.AddAuthorizedUser add_authorized_user = 21; */
302
- if (message.details.oneofKind === "addAuthorizedUser")
303
- Response_AddAuthorizedUser.internalBinaryWrite(message.details.addAuthorizedUser, writer.tag(21, WireType.LengthDelimited).fork(), options).join();
304
- /* proto.packets.Response.UpdateAuthorizedUser update_authorized_user = 22; */
305
- if (message.details.oneofKind === "updateAuthorizedUser")
306
- Response_UpdateAuthorizedUser.internalBinaryWrite(message.details.updateAuthorizedUser, writer.tag(22, WireType.LengthDelimited).fork(), options).join();
307
- /* proto.packets.Response.RemoveAuthorizedUser remove_authorized_user = 23; */
308
- if (message.details.oneofKind === "removeAuthorizedUser")
309
- Response_RemoveAuthorizedUser.internalBinaryWrite(message.details.removeAuthorizedUser, writer.tag(23, WireType.LengthDelimited).fork(), options).join();
310
- /* proto.packets.Response.GetAuthorizedUsers get_authorized_users = 24; */
311
- if (message.details.oneofKind === "getAuthorizedUsers")
312
- Response_GetAuthorizedUsers.internalBinaryWrite(message.details.getAuthorizedUsers, writer.tag(24, WireType.LengthDelimited).fork(), options).join();
313
- /* proto.packets.Response.GetDiscordInfo get_discord_info = 25; */
314
- if (message.details.oneofKind === "getDiscordInfo")
315
- Response_GetDiscordInfo.internalBinaryWrite(message.details.getDiscordInfo, writer.tag(25, WireType.LengthDelimited).fork(), options).join();
316
309
  /* proto.packets.Response.CreateTournament create_tournament = 10; */
317
310
  if (message.details.oneofKind === "createTournament")
318
311
  Response_CreateTournament.internalBinaryWrite(message.details.createTournament, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
@@ -346,6 +339,21 @@ class Response$Type extends MessageType {
346
339
  /* proto.packets.Response.RemainingAttempts remaining_attempts = 20; */
347
340
  if (message.details.oneofKind === "remainingAttempts")
348
341
  Response_RemainingAttempts.internalBinaryWrite(message.details.remainingAttempts, writer.tag(20, WireType.LengthDelimited).fork(), options).join();
342
+ /* proto.packets.Response.AddAuthorizedUser add_authorized_user = 21; */
343
+ if (message.details.oneofKind === "addAuthorizedUser")
344
+ Response_AddAuthorizedUser.internalBinaryWrite(message.details.addAuthorizedUser, writer.tag(21, WireType.LengthDelimited).fork(), options).join();
345
+ /* proto.packets.Response.UpdateAuthorizedUser update_authorized_user = 22; */
346
+ if (message.details.oneofKind === "updateAuthorizedUser")
347
+ Response_UpdateAuthorizedUser.internalBinaryWrite(message.details.updateAuthorizedUser, writer.tag(22, WireType.LengthDelimited).fork(), options).join();
348
+ /* proto.packets.Response.RemoveAuthorizedUser remove_authorized_user = 23; */
349
+ if (message.details.oneofKind === "removeAuthorizedUser")
350
+ Response_RemoveAuthorizedUser.internalBinaryWrite(message.details.removeAuthorizedUser, writer.tag(23, WireType.LengthDelimited).fork(), options).join();
351
+ /* proto.packets.Response.GetAuthorizedUsers get_authorized_users = 24; */
352
+ if (message.details.oneofKind === "getAuthorizedUsers")
353
+ Response_GetAuthorizedUsers.internalBinaryWrite(message.details.getAuthorizedUsers, writer.tag(24, WireType.LengthDelimited).fork(), options).join();
354
+ /* proto.packets.Response.GetDiscordInfo get_discord_info = 25; */
355
+ if (message.details.oneofKind === "getDiscordInfo")
356
+ Response_GetDiscordInfo.internalBinaryWrite(message.details.getDiscordInfo, writer.tag(25, WireType.LengthDelimited).fork(), options).join();
349
357
  /* proto.packets.Response.GetBotTokensForUser get_bot_tokens_for_user = 26; */
350
358
  if (message.details.oneofKind === "getBotTokensForUser")
351
359
  Response_GetBotTokensForUser.internalBinaryWrite(message.details.getBotTokensForUser, writer.tag(26, WireType.LengthDelimited).fork(), options).join();
@@ -358,6 +366,9 @@ class Response$Type extends MessageType {
358
366
  /* proto.packets.Response.RefundAttempts refund_attempts = 29; */
359
367
  if (message.details.oneofKind === "refundAttempts")
360
368
  Response_RefundAttempts.internalBinaryWrite(message.details.refundAttempts, writer.tag(29, WireType.LengthDelimited).fork(), options).join();
369
+ /* proto.packets.Response.PermissionError permission_error = 30; */
370
+ if (message.details.oneofKind === "permissionError")
371
+ Response_PermissionError.internalBinaryWrite(message.details.permissionError, writer.tag(30, WireType.LengthDelimited).fork(), options).join();
361
372
  let u = options.writeUnknownFields;
362
373
  if (u !== false)
363
374
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -377,8 +388,8 @@ class Response_UpdateUser$Type extends MessageType {
377
388
  ]);
378
389
  }
379
390
  create(value) {
380
- const message = { message: "" };
381
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
391
+ const message = globalThis.Object.create((this.messagePrototype));
392
+ message.message = "";
382
393
  if (value !== undefined)
383
394
  reflectionMergePartial(this, message, value);
384
395
  return message;
@@ -431,8 +442,8 @@ class Response_CreateMatch$Type extends MessageType {
431
442
  ]);
432
443
  }
433
444
  create(value) {
434
- const message = { message: "" };
435
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
445
+ const message = globalThis.Object.create((this.messagePrototype));
446
+ message.message = "";
436
447
  if (value !== undefined)
437
448
  reflectionMergePartial(this, message, value);
438
449
  return message;
@@ -485,8 +496,8 @@ class Response_UpdateMatch$Type extends MessageType {
485
496
  ]);
486
497
  }
487
498
  create(value) {
488
- const message = { message: "" };
489
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
499
+ const message = globalThis.Object.create((this.messagePrototype));
500
+ message.message = "";
490
501
  if (value !== undefined)
491
502
  reflectionMergePartial(this, message, value);
492
503
  return message;
@@ -539,8 +550,8 @@ class Response_DeleteMatch$Type extends MessageType {
539
550
  ]);
540
551
  }
541
552
  create(value) {
542
- const message = { message: "" };
543
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
553
+ const message = globalThis.Object.create((this.messagePrototype));
554
+ message.message = "";
544
555
  if (value !== undefined)
545
556
  reflectionMergePartial(this, message, value);
546
557
  return message;
@@ -593,8 +604,8 @@ class Response_CreateQualifierEvent$Type extends MessageType {
593
604
  ]);
594
605
  }
595
606
  create(value) {
596
- const message = { message: "" };
597
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
607
+ const message = globalThis.Object.create((this.messagePrototype));
608
+ message.message = "";
598
609
  if (value !== undefined)
599
610
  reflectionMergePartial(this, message, value);
600
611
  return message;
@@ -647,8 +658,8 @@ class Response_UpdateQualifierEvent$Type extends MessageType {
647
658
  ]);
648
659
  }
649
660
  create(value) {
650
- const message = { message: "" };
651
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
661
+ const message = globalThis.Object.create((this.messagePrototype));
662
+ message.message = "";
652
663
  if (value !== undefined)
653
664
  reflectionMergePartial(this, message, value);
654
665
  return message;
@@ -701,8 +712,8 @@ class Response_DeleteQualifierEvent$Type extends MessageType {
701
712
  ]);
702
713
  }
703
714
  create(value) {
704
- const message = { message: "" };
705
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
715
+ const message = globalThis.Object.create((this.messagePrototype));
716
+ message.message = "";
706
717
  if (value !== undefined)
707
718
  reflectionMergePartial(this, message, value);
708
719
  return message;
@@ -756,8 +767,10 @@ class Response_AddAuthorizedUser$Type extends MessageType {
756
767
  ]);
757
768
  }
758
769
  create(value) {
759
- const message = { tournamentId: "", discordId: "", roles: [] };
760
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
770
+ const message = globalThis.Object.create((this.messagePrototype));
771
+ message.tournamentId = "";
772
+ message.discordId = "";
773
+ message.roles = [];
761
774
  if (value !== undefined)
762
775
  reflectionMergePartial(this, message, value);
763
776
  return message;
@@ -817,8 +830,10 @@ class Response_UpdateAuthorizedUser$Type extends MessageType {
817
830
  ]);
818
831
  }
819
832
  create(value) {
820
- const message = { tournamentId: "", discordId: "", roles: [] };
821
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
833
+ const message = globalThis.Object.create((this.messagePrototype));
834
+ message.tournamentId = "";
835
+ message.discordId = "";
836
+ message.roles = [];
822
837
  if (value !== undefined)
823
838
  reflectionMergePartial(this, message, value);
824
839
  return message;
@@ -878,8 +893,10 @@ class Response_RemoveAuthorizedUser$Type extends MessageType {
878
893
  ]);
879
894
  }
880
895
  create(value) {
881
- const message = { tournamentId: "", discordId: "", roles: [] };
882
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
896
+ const message = globalThis.Object.create((this.messagePrototype));
897
+ message.tournamentId = "";
898
+ message.discordId = "";
899
+ message.roles = [];
883
900
  if (value !== undefined)
884
901
  reflectionMergePartial(this, message, value);
885
902
  return message;
@@ -934,12 +951,13 @@ class Response_GetAuthorizedUsers$Type extends MessageType {
934
951
  constructor() {
935
952
  super("proto.packets.Response.GetAuthorizedUsers", [
936
953
  { no: 1, name: "tournament_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
937
- { no: 2, name: "authorized_users", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Response_GetAuthorizedUsers_AuthroizedUser }
954
+ { no: 2, name: "authorized_users", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Response_GetAuthorizedUsers_AuthroizedUser }
938
955
  ]);
939
956
  }
940
957
  create(value) {
941
- const message = { tournamentId: "", authorizedUsers: [] };
942
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
958
+ const message = globalThis.Object.create((this.messagePrototype));
959
+ message.tournamentId = "";
960
+ message.authorizedUsers = [];
943
961
  if (value !== undefined)
944
962
  reflectionMergePartial(this, message, value);
945
963
  return message;
@@ -994,8 +1012,11 @@ class Response_GetAuthorizedUsers_AuthroizedUser$Type extends MessageType {
994
1012
  ]);
995
1013
  }
996
1014
  create(value) {
997
- const message = { discordId: "", discordUsername: "", discordAvatarUrl: "", roles: [] };
998
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1015
+ const message = globalThis.Object.create((this.messagePrototype));
1016
+ message.discordId = "";
1017
+ message.discordUsername = "";
1018
+ message.discordAvatarUrl = "";
1019
+ message.roles = [];
999
1020
  if (value !== undefined)
1000
1021
  reflectionMergePartial(this, message, value);
1001
1022
  return message;
@@ -1061,8 +1082,10 @@ class Response_GetDiscordInfo$Type extends MessageType {
1061
1082
  ]);
1062
1083
  }
1063
1084
  create(value) {
1064
- const message = { discordId: "", discordUsername: "", discordAvatarUrl: "" };
1065
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1085
+ const message = globalThis.Object.create((this.messagePrototype));
1086
+ message.discordId = "";
1087
+ message.discordUsername = "";
1088
+ message.discordAvatarUrl = "";
1066
1089
  if (value !== undefined)
1067
1090
  reflectionMergePartial(this, message, value);
1068
1091
  return message;
@@ -1121,8 +1144,8 @@ class Response_CreateTournament$Type extends MessageType {
1121
1144
  ]);
1122
1145
  }
1123
1146
  create(value) {
1124
- const message = { message: "" };
1125
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1147
+ const message = globalThis.Object.create((this.messagePrototype));
1148
+ message.message = "";
1126
1149
  if (value !== undefined)
1127
1150
  reflectionMergePartial(this, message, value);
1128
1151
  return message;
@@ -1175,8 +1198,8 @@ class Response_UpdateTournament$Type extends MessageType {
1175
1198
  ]);
1176
1199
  }
1177
1200
  create(value) {
1178
- const message = { message: "" };
1179
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1201
+ const message = globalThis.Object.create((this.messagePrototype));
1202
+ message.message = "";
1180
1203
  if (value !== undefined)
1181
1204
  reflectionMergePartial(this, message, value);
1182
1205
  return message;
@@ -1229,8 +1252,8 @@ class Response_DeleteTournament$Type extends MessageType {
1229
1252
  ]);
1230
1253
  }
1231
1254
  create(value) {
1232
- const message = { message: "" };
1233
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1255
+ const message = globalThis.Object.create((this.messagePrototype));
1256
+ message.message = "";
1234
1257
  if (value !== undefined)
1235
1258
  reflectionMergePartial(this, message, value);
1236
1259
  return message;
@@ -1283,8 +1306,8 @@ class Response_AddServer$Type extends MessageType {
1283
1306
  ]);
1284
1307
  }
1285
1308
  create(value) {
1286
- const message = { message: "" };
1287
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1309
+ const message = globalThis.Object.create((this.messagePrototype));
1310
+ message.message = "";
1288
1311
  if (value !== undefined)
1289
1312
  reflectionMergePartial(this, message, value);
1290
1313
  return message;
@@ -1339,8 +1362,10 @@ class Response_Connect$Type extends MessageType {
1339
1362
  ]);
1340
1363
  }
1341
1364
  create(value) {
1342
- const message = { serverVersion: 0, message: "", reason: 0 };
1343
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1365
+ const message = globalThis.Object.create((this.messagePrototype));
1366
+ message.serverVersion = 0;
1367
+ message.message = "";
1368
+ message.reason = 0;
1344
1369
  if (value !== undefined)
1345
1370
  reflectionMergePartial(this, message, value);
1346
1371
  return message;
@@ -1408,8 +1433,11 @@ class Response_Join$Type extends MessageType {
1408
1433
  ]);
1409
1434
  }
1410
1435
  create(value) {
1411
- const message = { selfGuid: "", tournamentId: "", message: "", reason: 0 };
1412
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1436
+ const message = globalThis.Object.create((this.messagePrototype));
1437
+ message.selfGuid = "";
1438
+ message.tournamentId = "";
1439
+ message.message = "";
1440
+ message.reason = 0;
1413
1441
  if (value !== undefined)
1414
1442
  reflectionMergePartial(this, message, value);
1415
1443
  return message;
@@ -1475,12 +1503,12 @@ export const Response_Join = new Response_Join$Type();
1475
1503
  class Response_LeaderboardEntries$Type extends MessageType {
1476
1504
  constructor() {
1477
1505
  super("proto.packets.Response.LeaderboardEntries", [
1478
- { no: 1, name: "scores", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => LeaderboardEntry }
1506
+ { no: 1, name: "scores", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => LeaderboardEntry }
1479
1507
  ]);
1480
1508
  }
1481
1509
  create(value) {
1482
- const message = { scores: [] };
1483
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1510
+ const message = globalThis.Object.create((this.messagePrototype));
1511
+ message.scores = [];
1484
1512
  if (value !== undefined)
1485
1513
  reflectionMergePartial(this, message, value);
1486
1514
  return message;
@@ -1527,8 +1555,9 @@ class Response_LoadSong$Type extends MessageType {
1527
1555
  ]);
1528
1556
  }
1529
1557
  create(value) {
1530
- const message = { levelId: "", message: "" };
1531
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1558
+ const message = globalThis.Object.create((this.messagePrototype));
1559
+ message.levelId = "";
1560
+ message.message = "";
1532
1561
  if (value !== undefined)
1533
1562
  reflectionMergePartial(this, message, value);
1534
1563
  return message;
@@ -1580,8 +1609,8 @@ class Response_PreloadImageForStreamSync$Type extends MessageType {
1580
1609
  ]);
1581
1610
  }
1582
1611
  create(value) {
1583
- const message = { fileId: "" };
1584
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1612
+ const message = globalThis.Object.create((this.messagePrototype));
1613
+ message.fileId = "";
1585
1614
  if (value !== undefined)
1586
1615
  reflectionMergePartial(this, message, value);
1587
1616
  return message;
@@ -1627,8 +1656,8 @@ class Response_ShowPrompt$Type extends MessageType {
1627
1656
  ]);
1628
1657
  }
1629
1658
  create(value) {
1630
- const message = { value: "" };
1631
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1659
+ const message = globalThis.Object.create((this.messagePrototype));
1660
+ message.value = "";
1632
1661
  if (value !== undefined)
1633
1662
  reflectionMergePartial(this, message, value);
1634
1663
  return message;
@@ -1674,8 +1703,8 @@ class Response_RemainingAttempts$Type extends MessageType {
1674
1703
  ]);
1675
1704
  }
1676
1705
  create(value) {
1677
- const message = { remainingAttempts: 0 };
1678
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1706
+ const message = globalThis.Object.create((this.messagePrototype));
1707
+ message.remainingAttempts = 0;
1679
1708
  if (value !== undefined)
1680
1709
  reflectionMergePartial(this, message, value);
1681
1710
  return message;
@@ -1717,12 +1746,12 @@ export const Response_RemainingAttempts = new Response_RemainingAttempts$Type();
1717
1746
  class Response_GetBotTokensForUser$Type extends MessageType {
1718
1747
  constructor() {
1719
1748
  super("proto.packets.Response.GetBotTokensForUser", [
1720
- { no: 1, name: "bot_users", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Response_GetBotTokensForUser_BotUser }
1749
+ { no: 1, name: "bot_users", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Response_GetBotTokensForUser_BotUser }
1721
1750
  ]);
1722
1751
  }
1723
1752
  create(value) {
1724
- const message = { botUsers: [] };
1725
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1753
+ const message = globalThis.Object.create((this.messagePrototype));
1754
+ message.botUsers = [];
1726
1755
  if (value !== undefined)
1727
1756
  reflectionMergePartial(this, message, value);
1728
1757
  return message;
@@ -1770,8 +1799,10 @@ class Response_GetBotTokensForUser_BotUser$Type extends MessageType {
1770
1799
  ]);
1771
1800
  }
1772
1801
  create(value) {
1773
- const message = { guid: "", username: "", ownerDiscordId: "" };
1774
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1802
+ const message = globalThis.Object.create((this.messagePrototype));
1803
+ message.guid = "";
1804
+ message.username = "";
1805
+ message.ownerDiscordId = "";
1775
1806
  if (value !== undefined)
1776
1807
  reflectionMergePartial(this, message, value);
1777
1808
  return message;
@@ -1829,8 +1860,8 @@ class Response_GenerateBotToken$Type extends MessageType {
1829
1860
  ]);
1830
1861
  }
1831
1862
  create(value) {
1832
- const message = { botToken: "" };
1833
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1863
+ const message = globalThis.Object.create((this.messagePrototype));
1864
+ message.botToken = "";
1834
1865
  if (value !== undefined)
1835
1866
  reflectionMergePartial(this, message, value);
1836
1867
  return message;
@@ -1876,8 +1907,8 @@ class Response_RevokeBotToken$Type extends MessageType {
1876
1907
  ]);
1877
1908
  }
1878
1909
  create(value) {
1879
- const message = { message: "" };
1880
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1910
+ const message = globalThis.Object.create((this.messagePrototype));
1911
+ message.message = "";
1881
1912
  if (value !== undefined)
1882
1913
  reflectionMergePartial(this, message, value);
1883
1914
  return message;
@@ -1923,8 +1954,8 @@ class Response_RefundAttempts$Type extends MessageType {
1923
1954
  ]);
1924
1955
  }
1925
1956
  create(value) {
1926
- const message = { message: "" };
1927
- globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
1957
+ const message = globalThis.Object.create((this.messagePrototype));
1958
+ message.message = "";
1928
1959
  if (value !== undefined)
1929
1960
  reflectionMergePartial(this, message, value);
1930
1961
  return message;
@@ -1962,3 +1993,66 @@ class Response_RefundAttempts$Type extends MessageType {
1962
1993
  * @generated MessageType for protobuf message proto.packets.Response.RefundAttempts
1963
1994
  */
1964
1995
  export const Response_RefundAttempts = new Response_RefundAttempts$Type();
1996
+ // @generated message type with reflection information, may provide speed optimized methods
1997
+ class Response_PermissionError$Type extends MessageType {
1998
+ constructor() {
1999
+ super("proto.packets.Response.PermissionError", [
2000
+ { no: 1, name: "required_permission", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
2001
+ { no: 2, name: "current_roles", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
2002
+ { no: 3, name: "current_permissions", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
2003
+ ]);
2004
+ }
2005
+ create(value) {
2006
+ const message = globalThis.Object.create((this.messagePrototype));
2007
+ message.requiredPermission = "";
2008
+ message.currentRoles = "";
2009
+ message.currentPermissions = "";
2010
+ if (value !== undefined)
2011
+ reflectionMergePartial(this, message, value);
2012
+ return message;
2013
+ }
2014
+ internalBinaryRead(reader, length, options, target) {
2015
+ let message = target ?? this.create(), end = reader.pos + length;
2016
+ while (reader.pos < end) {
2017
+ let [fieldNo, wireType] = reader.tag();
2018
+ switch (fieldNo) {
2019
+ case /* string required_permission */ 1:
2020
+ message.requiredPermission = reader.string();
2021
+ break;
2022
+ case /* string current_roles */ 2:
2023
+ message.currentRoles = reader.string();
2024
+ break;
2025
+ case /* string current_permissions */ 3:
2026
+ message.currentPermissions = reader.string();
2027
+ break;
2028
+ default:
2029
+ let u = options.readUnknownField;
2030
+ if (u === "throw")
2031
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
2032
+ let d = reader.skip(wireType);
2033
+ if (u !== false)
2034
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
2035
+ }
2036
+ }
2037
+ return message;
2038
+ }
2039
+ internalBinaryWrite(message, writer, options) {
2040
+ /* string required_permission = 1; */
2041
+ if (message.requiredPermission !== "")
2042
+ writer.tag(1, WireType.LengthDelimited).string(message.requiredPermission);
2043
+ /* string current_roles = 2; */
2044
+ if (message.currentRoles !== "")
2045
+ writer.tag(2, WireType.LengthDelimited).string(message.currentRoles);
2046
+ /* string current_permissions = 3; */
2047
+ if (message.currentPermissions !== "")
2048
+ writer.tag(3, WireType.LengthDelimited).string(message.currentPermissions);
2049
+ let u = options.writeUnknownFields;
2050
+ if (u !== false)
2051
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
2052
+ return writer;
2053
+ }
2054
+ }
2055
+ /**
2056
+ * @generated MessageType for protobuf message proto.packets.Response.PermissionError
2057
+ */
2058
+ export const Response_PermissionError = new Response_PermissionError$Type();
@@ -108,11 +108,12 @@ export declare class TAClient extends CustomEventEmitter<TAClientEvents> {
108
108
  getBotTokensForUser: (ownerDiscordId: string) => Promise<Response>;
109
109
  generateBotToken: (username: string) => Promise<Response>;
110
110
  revokeBotToken: (botTokenGuid: string) => Promise<Response>;
111
- createTournament: (serverAddress: string, serverName: string, serverPort: string, serverWebsocketPort: string, name: string, tournamentImage?: Uint8Array, enableTeams?: boolean, enablePools?: boolean, showTournamentButton?: boolean, showQualifierButton?: boolean, roles?: Role[], teams?: Tournament_TournamentSettings_Team[], scoreUpdateFrequency?: number, bannedMods?: string[], pools?: Tournament_TournamentSettings_Pool[], allowUnauthorizedView?: boolean) => Promise<Response>;
111
+ createTournament: (serverAddress: string, serverName: string, serverPort: string, serverWebsocketPort: string, name: string, tournamentImage?: Uint8Array, enableTeams?: boolean, enablePools?: boolean, showTournamentButton?: boolean, showQualifierButton?: boolean, roles?: Role[], teams?: Tournament_TournamentSettings_Team[], scoreUpdateFrequency?: number, bannedMods?: string[], pools?: Tournament_TournamentSettings_Pool[], allowUnauthorizedView?: boolean, enableReplayStreaming?: boolean) => Promise<Response>;
112
112
  setTournamentName: (tournamentId: string, tournamentName: string) => Promise<Response>;
113
113
  setTournamentImage: (tournamentId: string, tournamentImage: Uint8Array) => Promise<Response>;
114
114
  setTournamentEnableTeams: (tournamentId: string, enableTeams: boolean) => Promise<Response>;
115
115
  setTournamentEnablePools: (tournamentId: string, enablePools: boolean) => Promise<Response>;
116
+ setTournamentEnableReplayStreaming: (tournamentId: string, enableReplayStreaming: boolean) => Promise<Response>;
116
117
  setTournamentShowTournamentButton: (tournamentId: string, showTournamentButton: boolean) => Promise<Response>;
117
118
  setTournamentShowQualifierButton: (tournamentId: string, showQualifierButton: boolean) => Promise<Response>;
118
119
  setTournamentAllowUnauthorizedView: (tournamentId: string, allowUnauthorizedView: boolean) => Promise<Response>;
@@ -1016,7 +1016,7 @@ export class TAClient extends CustomEventEmitter {
1016
1016
  }
1017
1017
  return response[0].response;
1018
1018
  };
1019
- createTournament = async (serverAddress, serverName, serverPort, serverWebsocketPort, name, tournamentImage = new Uint8Array([1]), enableTeams = false, enablePools = false, showTournamentButton = true, showQualifierButton = true, roles = [], teams = [], scoreUpdateFrequency = 30, bannedMods = [], pools = [], allowUnauthorizedView = false) => {
1019
+ createTournament = async (serverAddress, serverName, serverPort, serverWebsocketPort, name, tournamentImage = new Uint8Array([1]), enableTeams = false, enablePools = false, showTournamentButton = true, showQualifierButton = true, roles = [], teams = [], scoreUpdateFrequency = 30, bannedMods = [], pools = [], allowUnauthorizedView = false, enableReplayStreaming = false) => {
1020
1020
  const response = await this.sendRequest({
1021
1021
  type: {
1022
1022
  oneofKind: "createTournament",
@@ -1031,6 +1031,7 @@ export class TAClient extends CustomEventEmitter {
1031
1031
  tournamentImage: await this.uploadImage(tournamentImage),
1032
1032
  enableTeams,
1033
1033
  enablePools,
1034
+ enableReplayStreaming,
1034
1035
  showTournamentButton,
1035
1036
  showQualifierButton,
1036
1037
  roles,
@@ -1116,6 +1117,21 @@ export class TAClient extends CustomEventEmitter {
1116
1117
  }
1117
1118
  return response[0].response;
1118
1119
  };
1120
+ setTournamentEnableReplayStreaming = async (tournamentId, enableReplayStreaming) => {
1121
+ const response = await this.sendRequest({
1122
+ type: {
1123
+ oneofKind: "setTournamentEnableReplayStreaming",
1124
+ setTournamentEnableReplayStreaming: {
1125
+ tournamentId,
1126
+ enableReplayStreaming,
1127
+ },
1128
+ },
1129
+ });
1130
+ if (response.length <= 0) {
1131
+ throw new Error("Server timed out");
1132
+ }
1133
+ return response[0].response;
1134
+ };
1119
1135
  setTournamentShowTournamentButton = async (tournamentId, showTournamentButton) => {
1120
1136
  const response = await this.sendRequest({
1121
1137
  type: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moons-ta-client",
3
- "version": "1.2.4",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",