moons-ta-client 1.3.3 → 1.4.0
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/constants.d.ts +2 -2
- package/dist/constants.js +2 -2
- package/dist/index.d.ts +453 -6
- package/dist/index.esm.js +1274 -101
- package/dist/models/models.d.ts +126 -2
- package/dist/models/models.js +214 -3
- package/dist/models/pushes.d.ts +40 -0
- package/dist/models/pushes.js +82 -1
- package/dist/models/requests.d.ts +176 -0
- package/dist/models/requests.js +383 -1
- package/dist/models/responses.d.ts +104 -0
- package/dist/models/responses.js +220 -1
- package/dist/tournament-assistant-client.d.ts +8 -2
- package/dist/tournament-assistant-client.js +67 -0
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
|
4
4
|
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
5
5
|
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
6
6
|
import { MessageType } from "@protobuf-ts/runtime";
|
|
7
|
+
import { ReplayRecording } from './models.js';
|
|
7
8
|
import { GlobalConfiguration } from './models.js';
|
|
8
9
|
import { Webhook } from './models.js';
|
|
9
10
|
import { LeaderboardEntry } from './models.js';
|
|
@@ -252,6 +253,24 @@ export interface Response {
|
|
|
252
253
|
* @generated from protobuf field: proto.packets.Response.SetBKTournamentLink set_bk_tournament_link = 39
|
|
253
254
|
*/
|
|
254
255
|
setBkTournamentLink: Response_SetBKTournamentLink;
|
|
256
|
+
} | {
|
|
257
|
+
oneofKind: "submitReplay";
|
|
258
|
+
/**
|
|
259
|
+
* @generated from protobuf field: proto.packets.Response.SubmitReplay submit_replay = 40
|
|
260
|
+
*/
|
|
261
|
+
submitReplay: Response_SubmitReplay;
|
|
262
|
+
} | {
|
|
263
|
+
oneofKind: "getReplays";
|
|
264
|
+
/**
|
|
265
|
+
* @generated from protobuf field: proto.packets.Response.GetReplays get_replays = 41
|
|
266
|
+
*/
|
|
267
|
+
getReplays: Response_GetReplays;
|
|
268
|
+
} | {
|
|
269
|
+
oneofKind: "deleteReplay";
|
|
270
|
+
/**
|
|
271
|
+
* @generated from protobuf field: proto.packets.Response.DeleteReplay delete_replay = 42
|
|
272
|
+
*/
|
|
273
|
+
deleteReplay: Response_DeleteReplay;
|
|
255
274
|
} | {
|
|
256
275
|
oneofKind: undefined;
|
|
257
276
|
};
|
|
@@ -784,6 +803,61 @@ export interface Response_SetBKTournamentLink {
|
|
|
784
803
|
*/
|
|
785
804
|
message: string;
|
|
786
805
|
}
|
|
806
|
+
/**
|
|
807
|
+
* @generated from protobuf message proto.packets.Response.SubmitReplay
|
|
808
|
+
*/
|
|
809
|
+
export interface Response_SubmitReplay {
|
|
810
|
+
/**
|
|
811
|
+
* @generated from protobuf field: string message = 1
|
|
812
|
+
*/
|
|
813
|
+
message: string;
|
|
814
|
+
/**
|
|
815
|
+
* Only set once the last chunk has arrived
|
|
816
|
+
*
|
|
817
|
+
* @generated from protobuf field: proto.models.ReplayRecording replay = 2
|
|
818
|
+
*/
|
|
819
|
+
replay?: ReplayRecording;
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* @generated from protobuf message proto.packets.Response.GetReplays
|
|
823
|
+
*/
|
|
824
|
+
export interface Response_GetReplays {
|
|
825
|
+
/**
|
|
826
|
+
* @generated from protobuf field: repeated proto.models.ReplayRecording replays = 1
|
|
827
|
+
*/
|
|
828
|
+
replays: ReplayRecording[];
|
|
829
|
+
/**
|
|
830
|
+
* @generated from protobuf field: int32 total_count = 2
|
|
831
|
+
*/
|
|
832
|
+
totalCount: number;
|
|
833
|
+
/**
|
|
834
|
+
* @generated from protobuf field: int32 page = 3
|
|
835
|
+
*/
|
|
836
|
+
page: number;
|
|
837
|
+
/**
|
|
838
|
+
* @generated from protobuf field: int32 page_size = 4
|
|
839
|
+
*/
|
|
840
|
+
pageSize: number;
|
|
841
|
+
/**
|
|
842
|
+
* False when the server has no replay storage or cannot reach it
|
|
843
|
+
*
|
|
844
|
+
* @generated from protobuf field: bool storage_available = 5
|
|
845
|
+
*/
|
|
846
|
+
storageAvailable: boolean;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* @generated from protobuf message proto.packets.Response.DeleteReplay
|
|
850
|
+
*/
|
|
851
|
+
export interface Response_DeleteReplay {
|
|
852
|
+
/**
|
|
853
|
+
* @generated from protobuf field: string replay_guid = 1
|
|
854
|
+
*/
|
|
855
|
+
replayGuid: string;
|
|
856
|
+
/**
|
|
857
|
+
* @generated from protobuf field: string message = 2
|
|
858
|
+
*/
|
|
859
|
+
message: string;
|
|
860
|
+
}
|
|
787
861
|
/**
|
|
788
862
|
* @generated from protobuf message proto.packets.Response.CreateBKTournament
|
|
789
863
|
*/
|
|
@@ -1200,6 +1274,36 @@ declare class Response_SetBKTournamentLink$Type extends MessageType<Response_Set
|
|
|
1200
1274
|
* @generated MessageType for protobuf message proto.packets.Response.SetBKTournamentLink
|
|
1201
1275
|
*/
|
|
1202
1276
|
export declare const Response_SetBKTournamentLink: Response_SetBKTournamentLink$Type;
|
|
1277
|
+
declare class Response_SubmitReplay$Type extends MessageType<Response_SubmitReplay> {
|
|
1278
|
+
constructor();
|
|
1279
|
+
create(value?: PartialMessage<Response_SubmitReplay>): Response_SubmitReplay;
|
|
1280
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Response_SubmitReplay): Response_SubmitReplay;
|
|
1281
|
+
internalBinaryWrite(message: Response_SubmitReplay, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
1282
|
+
}
|
|
1283
|
+
/**
|
|
1284
|
+
* @generated MessageType for protobuf message proto.packets.Response.SubmitReplay
|
|
1285
|
+
*/
|
|
1286
|
+
export declare const Response_SubmitReplay: Response_SubmitReplay$Type;
|
|
1287
|
+
declare class Response_GetReplays$Type extends MessageType<Response_GetReplays> {
|
|
1288
|
+
constructor();
|
|
1289
|
+
create(value?: PartialMessage<Response_GetReplays>): Response_GetReplays;
|
|
1290
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Response_GetReplays): Response_GetReplays;
|
|
1291
|
+
internalBinaryWrite(message: Response_GetReplays, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* @generated MessageType for protobuf message proto.packets.Response.GetReplays
|
|
1295
|
+
*/
|
|
1296
|
+
export declare const Response_GetReplays: Response_GetReplays$Type;
|
|
1297
|
+
declare class Response_DeleteReplay$Type extends MessageType<Response_DeleteReplay> {
|
|
1298
|
+
constructor();
|
|
1299
|
+
create(value?: PartialMessage<Response_DeleteReplay>): Response_DeleteReplay;
|
|
1300
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Response_DeleteReplay): Response_DeleteReplay;
|
|
1301
|
+
internalBinaryWrite(message: Response_DeleteReplay, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* @generated MessageType for protobuf message proto.packets.Response.DeleteReplay
|
|
1305
|
+
*/
|
|
1306
|
+
export declare const Response_DeleteReplay: Response_DeleteReplay$Type;
|
|
1203
1307
|
declare class Response_CreateBKTournament$Type extends MessageType<Response_CreateBKTournament> {
|
|
1204
1308
|
constructor();
|
|
1205
1309
|
create(value?: PartialMessage<Response_CreateBKTournament>): Response_CreateBKTournament;
|
package/dist/models/responses.js
CHANGED
|
@@ -2,6 +2,7 @@ import { WireType } from "@protobuf-ts/runtime";
|
|
|
2
2
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
3
3
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
4
4
|
import { MessageType } from "@protobuf-ts/runtime";
|
|
5
|
+
import { ReplayRecording } from './models.js';
|
|
5
6
|
import { GlobalConfiguration } from './models.js';
|
|
6
7
|
import { Webhook } from './models.js';
|
|
7
8
|
import { LeaderboardEntry } from './models.js';
|
|
@@ -87,7 +88,10 @@ class Response$Type extends MessageType {
|
|
|
87
88
|
{ no: 36, name: "get_global_configuration", kind: "message", oneof: "details", T: () => Response_GetGlobalConfiguration },
|
|
88
89
|
{ no: 37, name: "update_global_configuration", kind: "message", oneof: "details", T: () => Response_UpdateGlobalConfiguration },
|
|
89
90
|
{ no: 38, name: "create_bk_tournament", kind: "message", oneof: "details", T: () => Response_CreateBKTournament },
|
|
90
|
-
{ no: 39, name: "set_bk_tournament_link", kind: "message", oneof: "details", T: () => Response_SetBKTournamentLink }
|
|
91
|
+
{ no: 39, name: "set_bk_tournament_link", kind: "message", oneof: "details", T: () => Response_SetBKTournamentLink },
|
|
92
|
+
{ no: 40, name: "submit_replay", kind: "message", oneof: "details", T: () => Response_SubmitReplay },
|
|
93
|
+
{ no: 41, name: "get_replays", kind: "message", oneof: "details", T: () => Response_GetReplays },
|
|
94
|
+
{ no: 42, name: "delete_replay", kind: "message", oneof: "details", T: () => Response_DeleteReplay }
|
|
91
95
|
]);
|
|
92
96
|
}
|
|
93
97
|
create(value) {
|
|
@@ -332,6 +336,24 @@ class Response$Type extends MessageType {
|
|
|
332
336
|
setBkTournamentLink: Response_SetBKTournamentLink.internalBinaryRead(reader, reader.uint32(), options, message.details.setBkTournamentLink)
|
|
333
337
|
};
|
|
334
338
|
break;
|
|
339
|
+
case /* proto.packets.Response.SubmitReplay submit_replay */ 40:
|
|
340
|
+
message.details = {
|
|
341
|
+
oneofKind: "submitReplay",
|
|
342
|
+
submitReplay: Response_SubmitReplay.internalBinaryRead(reader, reader.uint32(), options, message.details.submitReplay)
|
|
343
|
+
};
|
|
344
|
+
break;
|
|
345
|
+
case /* proto.packets.Response.GetReplays get_replays */ 41:
|
|
346
|
+
message.details = {
|
|
347
|
+
oneofKind: "getReplays",
|
|
348
|
+
getReplays: Response_GetReplays.internalBinaryRead(reader, reader.uint32(), options, message.details.getReplays)
|
|
349
|
+
};
|
|
350
|
+
break;
|
|
351
|
+
case /* proto.packets.Response.DeleteReplay delete_replay */ 42:
|
|
352
|
+
message.details = {
|
|
353
|
+
oneofKind: "deleteReplay",
|
|
354
|
+
deleteReplay: Response_DeleteReplay.internalBinaryRead(reader, reader.uint32(), options, message.details.deleteReplay)
|
|
355
|
+
};
|
|
356
|
+
break;
|
|
335
357
|
default:
|
|
336
358
|
let u = options.readUnknownField;
|
|
337
359
|
if (u === "throw")
|
|
@@ -461,6 +483,15 @@ class Response$Type extends MessageType {
|
|
|
461
483
|
/* proto.packets.Response.SetBKTournamentLink set_bk_tournament_link = 39; */
|
|
462
484
|
if (message.details.oneofKind === "setBkTournamentLink")
|
|
463
485
|
Response_SetBKTournamentLink.internalBinaryWrite(message.details.setBkTournamentLink, writer.tag(39, WireType.LengthDelimited).fork(), options).join();
|
|
486
|
+
/* proto.packets.Response.SubmitReplay submit_replay = 40; */
|
|
487
|
+
if (message.details.oneofKind === "submitReplay")
|
|
488
|
+
Response_SubmitReplay.internalBinaryWrite(message.details.submitReplay, writer.tag(40, WireType.LengthDelimited).fork(), options).join();
|
|
489
|
+
/* proto.packets.Response.GetReplays get_replays = 41; */
|
|
490
|
+
if (message.details.oneofKind === "getReplays")
|
|
491
|
+
Response_GetReplays.internalBinaryWrite(message.details.getReplays, writer.tag(41, WireType.LengthDelimited).fork(), options).join();
|
|
492
|
+
/* proto.packets.Response.DeleteReplay delete_replay = 42; */
|
|
493
|
+
if (message.details.oneofKind === "deleteReplay")
|
|
494
|
+
Response_DeleteReplay.internalBinaryWrite(message.details.deleteReplay, writer.tag(42, WireType.LengthDelimited).fork(), options).join();
|
|
464
495
|
let u = options.writeUnknownFields;
|
|
465
496
|
if (u !== false)
|
|
466
497
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -2568,6 +2599,194 @@ class Response_SetBKTournamentLink$Type extends MessageType {
|
|
|
2568
2599
|
*/
|
|
2569
2600
|
export const Response_SetBKTournamentLink = new Response_SetBKTournamentLink$Type();
|
|
2570
2601
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
2602
|
+
class Response_SubmitReplay$Type extends MessageType {
|
|
2603
|
+
constructor() {
|
|
2604
|
+
super("proto.packets.Response.SubmitReplay", [
|
|
2605
|
+
{ no: 1, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
2606
|
+
{ no: 2, name: "replay", kind: "message", T: () => ReplayRecording }
|
|
2607
|
+
]);
|
|
2608
|
+
}
|
|
2609
|
+
create(value) {
|
|
2610
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
2611
|
+
message.message = "";
|
|
2612
|
+
if (value !== undefined)
|
|
2613
|
+
reflectionMergePartial(this, message, value);
|
|
2614
|
+
return message;
|
|
2615
|
+
}
|
|
2616
|
+
internalBinaryRead(reader, length, options, target) {
|
|
2617
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
2618
|
+
while (reader.pos < end) {
|
|
2619
|
+
let [fieldNo, wireType] = reader.tag();
|
|
2620
|
+
switch (fieldNo) {
|
|
2621
|
+
case /* string message */ 1:
|
|
2622
|
+
message.message = reader.string();
|
|
2623
|
+
break;
|
|
2624
|
+
case /* proto.models.ReplayRecording replay */ 2:
|
|
2625
|
+
message.replay = ReplayRecording.internalBinaryRead(reader, reader.uint32(), options, message.replay);
|
|
2626
|
+
break;
|
|
2627
|
+
default:
|
|
2628
|
+
let u = options.readUnknownField;
|
|
2629
|
+
if (u === "throw")
|
|
2630
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
2631
|
+
let d = reader.skip(wireType);
|
|
2632
|
+
if (u !== false)
|
|
2633
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
return message;
|
|
2637
|
+
}
|
|
2638
|
+
internalBinaryWrite(message, writer, options) {
|
|
2639
|
+
/* string message = 1; */
|
|
2640
|
+
if (message.message !== "")
|
|
2641
|
+
writer.tag(1, WireType.LengthDelimited).string(message.message);
|
|
2642
|
+
/* proto.models.ReplayRecording replay = 2; */
|
|
2643
|
+
if (message.replay)
|
|
2644
|
+
ReplayRecording.internalBinaryWrite(message.replay, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
2645
|
+
let u = options.writeUnknownFields;
|
|
2646
|
+
if (u !== false)
|
|
2647
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
2648
|
+
return writer;
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
/**
|
|
2652
|
+
* @generated MessageType for protobuf message proto.packets.Response.SubmitReplay
|
|
2653
|
+
*/
|
|
2654
|
+
export const Response_SubmitReplay = new Response_SubmitReplay$Type();
|
|
2655
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
2656
|
+
class Response_GetReplays$Type extends MessageType {
|
|
2657
|
+
constructor() {
|
|
2658
|
+
super("proto.packets.Response.GetReplays", [
|
|
2659
|
+
{ no: 1, name: "replays", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ReplayRecording },
|
|
2660
|
+
{ no: 2, name: "total_count", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
|
2661
|
+
{ no: 3, name: "page", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
|
2662
|
+
{ no: 4, name: "page_size", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
|
|
2663
|
+
{ no: 5, name: "storage_available", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
2664
|
+
]);
|
|
2665
|
+
}
|
|
2666
|
+
create(value) {
|
|
2667
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
2668
|
+
message.replays = [];
|
|
2669
|
+
message.totalCount = 0;
|
|
2670
|
+
message.page = 0;
|
|
2671
|
+
message.pageSize = 0;
|
|
2672
|
+
message.storageAvailable = false;
|
|
2673
|
+
if (value !== undefined)
|
|
2674
|
+
reflectionMergePartial(this, message, value);
|
|
2675
|
+
return message;
|
|
2676
|
+
}
|
|
2677
|
+
internalBinaryRead(reader, length, options, target) {
|
|
2678
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
2679
|
+
while (reader.pos < end) {
|
|
2680
|
+
let [fieldNo, wireType] = reader.tag();
|
|
2681
|
+
switch (fieldNo) {
|
|
2682
|
+
case /* repeated proto.models.ReplayRecording replays */ 1:
|
|
2683
|
+
message.replays.push(ReplayRecording.internalBinaryRead(reader, reader.uint32(), options));
|
|
2684
|
+
break;
|
|
2685
|
+
case /* int32 total_count */ 2:
|
|
2686
|
+
message.totalCount = reader.int32();
|
|
2687
|
+
break;
|
|
2688
|
+
case /* int32 page */ 3:
|
|
2689
|
+
message.page = reader.int32();
|
|
2690
|
+
break;
|
|
2691
|
+
case /* int32 page_size */ 4:
|
|
2692
|
+
message.pageSize = reader.int32();
|
|
2693
|
+
break;
|
|
2694
|
+
case /* bool storage_available */ 5:
|
|
2695
|
+
message.storageAvailable = reader.bool();
|
|
2696
|
+
break;
|
|
2697
|
+
default:
|
|
2698
|
+
let u = options.readUnknownField;
|
|
2699
|
+
if (u === "throw")
|
|
2700
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
2701
|
+
let d = reader.skip(wireType);
|
|
2702
|
+
if (u !== false)
|
|
2703
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
return message;
|
|
2707
|
+
}
|
|
2708
|
+
internalBinaryWrite(message, writer, options) {
|
|
2709
|
+
/* repeated proto.models.ReplayRecording replays = 1; */
|
|
2710
|
+
for (let i = 0; i < message.replays.length; i++)
|
|
2711
|
+
ReplayRecording.internalBinaryWrite(message.replays[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
2712
|
+
/* int32 total_count = 2; */
|
|
2713
|
+
if (message.totalCount !== 0)
|
|
2714
|
+
writer.tag(2, WireType.Varint).int32(message.totalCount);
|
|
2715
|
+
/* int32 page = 3; */
|
|
2716
|
+
if (message.page !== 0)
|
|
2717
|
+
writer.tag(3, WireType.Varint).int32(message.page);
|
|
2718
|
+
/* int32 page_size = 4; */
|
|
2719
|
+
if (message.pageSize !== 0)
|
|
2720
|
+
writer.tag(4, WireType.Varint).int32(message.pageSize);
|
|
2721
|
+
/* bool storage_available = 5; */
|
|
2722
|
+
if (message.storageAvailable !== false)
|
|
2723
|
+
writer.tag(5, WireType.Varint).bool(message.storageAvailable);
|
|
2724
|
+
let u = options.writeUnknownFields;
|
|
2725
|
+
if (u !== false)
|
|
2726
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
2727
|
+
return writer;
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
/**
|
|
2731
|
+
* @generated MessageType for protobuf message proto.packets.Response.GetReplays
|
|
2732
|
+
*/
|
|
2733
|
+
export const Response_GetReplays = new Response_GetReplays$Type();
|
|
2734
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
2735
|
+
class Response_DeleteReplay$Type extends MessageType {
|
|
2736
|
+
constructor() {
|
|
2737
|
+
super("proto.packets.Response.DeleteReplay", [
|
|
2738
|
+
{ no: 1, name: "replay_guid", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
2739
|
+
{ no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
2740
|
+
]);
|
|
2741
|
+
}
|
|
2742
|
+
create(value) {
|
|
2743
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
2744
|
+
message.replayGuid = "";
|
|
2745
|
+
message.message = "";
|
|
2746
|
+
if (value !== undefined)
|
|
2747
|
+
reflectionMergePartial(this, message, value);
|
|
2748
|
+
return message;
|
|
2749
|
+
}
|
|
2750
|
+
internalBinaryRead(reader, length, options, target) {
|
|
2751
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
2752
|
+
while (reader.pos < end) {
|
|
2753
|
+
let [fieldNo, wireType] = reader.tag();
|
|
2754
|
+
switch (fieldNo) {
|
|
2755
|
+
case /* string replay_guid */ 1:
|
|
2756
|
+
message.replayGuid = reader.string();
|
|
2757
|
+
break;
|
|
2758
|
+
case /* string message */ 2:
|
|
2759
|
+
message.message = reader.string();
|
|
2760
|
+
break;
|
|
2761
|
+
default:
|
|
2762
|
+
let u = options.readUnknownField;
|
|
2763
|
+
if (u === "throw")
|
|
2764
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
2765
|
+
let d = reader.skip(wireType);
|
|
2766
|
+
if (u !== false)
|
|
2767
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
return message;
|
|
2771
|
+
}
|
|
2772
|
+
internalBinaryWrite(message, writer, options) {
|
|
2773
|
+
/* string replay_guid = 1; */
|
|
2774
|
+
if (message.replayGuid !== "")
|
|
2775
|
+
writer.tag(1, WireType.LengthDelimited).string(message.replayGuid);
|
|
2776
|
+
/* string message = 2; */
|
|
2777
|
+
if (message.message !== "")
|
|
2778
|
+
writer.tag(2, WireType.LengthDelimited).string(message.message);
|
|
2779
|
+
let u = options.writeUnknownFields;
|
|
2780
|
+
if (u !== false)
|
|
2781
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
2782
|
+
return writer;
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
/**
|
|
2786
|
+
* @generated MessageType for protobuf message proto.packets.Response.DeleteReplay
|
|
2787
|
+
*/
|
|
2788
|
+
export const Response_DeleteReplay = new Response_DeleteReplay$Type();
|
|
2789
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
2571
2790
|
class Response_CreateBKTournament$Type extends MessageType {
|
|
2572
2791
|
constructor() {
|
|
2573
2792
|
super("proto.packets.Response.CreateBKTournament", [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CustomEventEmitter } from "./custom-event-emitter.js";
|
|
2
|
-
import { User, Match, CoreServer, GameplayParameters, Map, QualifierEvent_EventSettings, QualifierEvent_LeaderboardSort, Tournament_TournamentSettings_Team, Tournament_TournamentSettings_Pool, RealtimeScore, Role, GlobalConfiguration } from "./models/models.js";
|
|
2
|
+
import { User, Match, CoreServer, GameplayParameters, Map, QualifierEvent_EventSettings, QualifierEvent_LeaderboardSort, Tournament_TournamentSettings_Team, Tournament_TournamentSettings_Pool, RealtimeScore, Role, GlobalConfiguration, ReplayRetention } from "./models/models.js";
|
|
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_QualifierScoreSubmitted, Push_SongFinished } from "./models/index.js";
|
|
6
|
+
import { Channel, Push_QualifierScoreSubmitted, Push_ReplaySubmitted, Push_SongFinished } from "./models/index.js";
|
|
7
7
|
export * from "./scraper.js";
|
|
8
8
|
export * from "./models/models.js";
|
|
9
9
|
export type ResponseFromUser = {
|
|
@@ -25,6 +25,7 @@ type TAClientEvents = {
|
|
|
25
25
|
songFinished: Push_SongFinished;
|
|
26
26
|
realtimeScore: RealtimeScore;
|
|
27
27
|
qualifierScoreSubmitted: Push_QualifierScoreSubmitted;
|
|
28
|
+
replaySubmitted: Push_ReplaySubmitted;
|
|
28
29
|
responseReceived: ResponseFromUser;
|
|
29
30
|
joinedTournament: {};
|
|
30
31
|
failedToJoinTournament: {};
|
|
@@ -121,6 +122,11 @@ export declare class TAClient extends CustomEventEmitter<TAClientEvents> {
|
|
|
121
122
|
setTournamentEnableTeams: (tournamentId: string, enableTeams: boolean) => Promise<Response>;
|
|
122
123
|
setTournamentEnablePools: (tournamentId: string, enablePools: boolean) => Promise<Response>;
|
|
123
124
|
setTournamentEnableReplayStreaming: (tournamentId: string, enableReplayStreaming: boolean) => Promise<Response>;
|
|
125
|
+
setTournamentEnableReplayRecording: (tournamentId: string, enableReplayRecording: boolean) => Promise<Response>;
|
|
126
|
+
setTournamentReplayRetention: (tournamentId: string, replayRetention: ReplayRetention) => Promise<Response>;
|
|
127
|
+
getReplays: (tournamentId: string, page: number, pageSize: number) => Promise<Response>;
|
|
128
|
+
deleteReplay: (tournamentId: string, replayGuid: string) => Promise<Response>;
|
|
129
|
+
downloadReplay: (downloadUrl: string) => Promise<Uint8Array>;
|
|
124
130
|
setTournamentAllowMockClients: (tournamentId: string, allowMockClients: boolean) => Promise<Response>;
|
|
125
131
|
setTournamentShowTournamentButton: (tournamentId: string, showTournamentButton: boolean) => Promise<Response>;
|
|
126
132
|
setTournamentShowQualifierButton: (tournamentId: string, showQualifierButton: boolean) => Promise<Response>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Client } from "./client.js";
|
|
2
2
|
import { CustomEventEmitter } from "./custom-event-emitter.js";
|
|
3
3
|
import { v4 as uuidv4 } from "uuid";
|
|
4
|
+
import { ReplayRetention, } from "./models/models.js";
|
|
4
5
|
import { StateManager } from "./state-manager.js";
|
|
5
6
|
import { Response_ResponseType } from "./models/responses.js";
|
|
6
7
|
import { Command_ModifyGameplay_Modifier } from "./models/commands.js";
|
|
@@ -644,6 +645,9 @@ export class TAClient extends CustomEventEmitter {
|
|
|
644
645
|
else if (push.data.oneofKind === "qualifierScoreSubmtited") {
|
|
645
646
|
this.emit("qualifierScoreSubmitted", push.data.qualifierScoreSubmtited);
|
|
646
647
|
}
|
|
648
|
+
else if (push.data.oneofKind === "replaySubmitted") {
|
|
649
|
+
this.emit("replaySubmitted", push.data.replaySubmitted);
|
|
650
|
+
}
|
|
647
651
|
}
|
|
648
652
|
};
|
|
649
653
|
// --- State Actions --- //
|
|
@@ -1124,6 +1128,10 @@ export class TAClient extends CustomEventEmitter {
|
|
|
1124
1128
|
enableTeams,
|
|
1125
1129
|
enablePools,
|
|
1126
1130
|
enableReplayStreaming,
|
|
1131
|
+
enableReplayRecording: false,
|
|
1132
|
+
replayRetention: ReplayRetention.ThirtyDays,
|
|
1133
|
+
updatedAt: 0n,
|
|
1134
|
+
autoHideAt: 0n,
|
|
1127
1135
|
allowMockClients,
|
|
1128
1136
|
isBkTournament: false,
|
|
1129
1137
|
beatKhanaTournamentGuid: "",
|
|
@@ -1227,6 +1235,65 @@ export class TAClient extends CustomEventEmitter {
|
|
|
1227
1235
|
}
|
|
1228
1236
|
return response[0].response;
|
|
1229
1237
|
};
|
|
1238
|
+
setTournamentEnableReplayRecording = async (tournamentId, enableReplayRecording) => {
|
|
1239
|
+
const response = await this.sendRequest({
|
|
1240
|
+
type: {
|
|
1241
|
+
oneofKind: "setTournamentEnableReplayRecording",
|
|
1242
|
+
setTournamentEnableReplayRecording: {
|
|
1243
|
+
tournamentId,
|
|
1244
|
+
enableReplayRecording,
|
|
1245
|
+
},
|
|
1246
|
+
},
|
|
1247
|
+
});
|
|
1248
|
+
if (response.length <= 0) {
|
|
1249
|
+
throw new Error("Server timed out");
|
|
1250
|
+
}
|
|
1251
|
+
return response[0].response;
|
|
1252
|
+
};
|
|
1253
|
+
setTournamentReplayRetention = async (tournamentId, replayRetention) => {
|
|
1254
|
+
const response = await this.sendRequest({
|
|
1255
|
+
type: {
|
|
1256
|
+
oneofKind: "setTournamentReplayRetention",
|
|
1257
|
+
setTournamentReplayRetention: {
|
|
1258
|
+
tournamentId,
|
|
1259
|
+
replayRetention,
|
|
1260
|
+
},
|
|
1261
|
+
},
|
|
1262
|
+
});
|
|
1263
|
+
if (response.length <= 0) {
|
|
1264
|
+
throw new Error("Server timed out");
|
|
1265
|
+
}
|
|
1266
|
+
return response[0].response;
|
|
1267
|
+
};
|
|
1268
|
+
// Pages start at 0, the newest replays come first
|
|
1269
|
+
getReplays = async (tournamentId, page, pageSize) => {
|
|
1270
|
+
const response = await this.sendRequest({
|
|
1271
|
+
type: { oneofKind: "getReplays", getReplays: { tournamentId, page, pageSize } },
|
|
1272
|
+
});
|
|
1273
|
+
if (response.length <= 0)
|
|
1274
|
+
throw new Error("Server timed out");
|
|
1275
|
+
return response[0].response;
|
|
1276
|
+
};
|
|
1277
|
+
deleteReplay = async (tournamentId, replayGuid) => {
|
|
1278
|
+
const response = await this.sendRequest({
|
|
1279
|
+
type: { oneofKind: "deleteReplay", deleteReplay: { tournamentId, replayGuid } },
|
|
1280
|
+
});
|
|
1281
|
+
if (response.length <= 0)
|
|
1282
|
+
throw new Error("Server timed out");
|
|
1283
|
+
return response[0].response;
|
|
1284
|
+
};
|
|
1285
|
+
// Replays can be larger than a packet, so they are downloaded over the REST API with the same token
|
|
1286
|
+
downloadReplay = async (downloadUrl) => {
|
|
1287
|
+
const response = await fetch(downloadUrl, {
|
|
1288
|
+
headers: {
|
|
1289
|
+
Authorization: `Bearer ${this.token}`,
|
|
1290
|
+
},
|
|
1291
|
+
});
|
|
1292
|
+
if (!response.ok) {
|
|
1293
|
+
throw new Error("Download failed: " + (await response.text()));
|
|
1294
|
+
}
|
|
1295
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
1296
|
+
};
|
|
1230
1297
|
setTournamentAllowMockClients = async (tournamentId, allowMockClients) => {
|
|
1231
1298
|
const response = await this.sendRequest({
|
|
1232
1299
|
type: {
|