moons-ta-client 1.3.2 → 1.3.3
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/custom-event-emitter.js +1 -1
- package/dist/index.d.ts +416 -5
- package/dist/index.esm.js +3368 -2083
- package/dist/models/models.d.ts +90 -0
- package/dist/models/models.js +199 -1
- package/dist/models/requests.d.ts +206 -0
- package/dist/models/requests.js +452 -1
- package/dist/models/responses.d.ts +113 -0
- package/dist/models/responses.js +250 -1
- package/dist/scraper.js +3 -4
- package/dist/tournament-assistant-client.d.ts +4 -1
- package/dist/tournament-assistant-client.js +42 -0
- package/package.json +4 -10
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 { GlobalConfiguration } from './models.js';
|
|
5
6
|
import { Webhook } from './models.js';
|
|
6
7
|
import { LeaderboardEntry } from './models.js';
|
|
7
8
|
import { State } from './models.js';
|
|
@@ -82,7 +83,11 @@ class Response$Type extends MessageType {
|
|
|
82
83
|
{ no: 32, name: "get_webhooks", kind: "message", oneof: "details", T: () => Response_GetWebhooks },
|
|
83
84
|
{ no: 33, name: "create_webhook", kind: "message", oneof: "details", T: () => Response_CreateWebhook },
|
|
84
85
|
{ no: 34, name: "update_webhook", kind: "message", oneof: "details", T: () => Response_UpdateWebhook },
|
|
85
|
-
{ no: 35, name: "delete_webhook", kind: "message", oneof: "details", T: () => Response_DeleteWebhook }
|
|
86
|
+
{ no: 35, name: "delete_webhook", kind: "message", oneof: "details", T: () => Response_DeleteWebhook },
|
|
87
|
+
{ no: 36, name: "get_global_configuration", kind: "message", oneof: "details", T: () => Response_GetGlobalConfiguration },
|
|
88
|
+
{ no: 37, name: "update_global_configuration", kind: "message", oneof: "details", T: () => Response_UpdateGlobalConfiguration },
|
|
89
|
+
{ 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 }
|
|
86
91
|
]);
|
|
87
92
|
}
|
|
88
93
|
create(value) {
|
|
@@ -303,6 +308,30 @@ class Response$Type extends MessageType {
|
|
|
303
308
|
deleteWebhook: Response_DeleteWebhook.internalBinaryRead(reader, reader.uint32(), options, message.details.deleteWebhook)
|
|
304
309
|
};
|
|
305
310
|
break;
|
|
311
|
+
case /* proto.packets.Response.GetGlobalConfiguration get_global_configuration */ 36:
|
|
312
|
+
message.details = {
|
|
313
|
+
oneofKind: "getGlobalConfiguration",
|
|
314
|
+
getGlobalConfiguration: Response_GetGlobalConfiguration.internalBinaryRead(reader, reader.uint32(), options, message.details.getGlobalConfiguration)
|
|
315
|
+
};
|
|
316
|
+
break;
|
|
317
|
+
case /* proto.packets.Response.UpdateGlobalConfiguration update_global_configuration */ 37:
|
|
318
|
+
message.details = {
|
|
319
|
+
oneofKind: "updateGlobalConfiguration",
|
|
320
|
+
updateGlobalConfiguration: Response_UpdateGlobalConfiguration.internalBinaryRead(reader, reader.uint32(), options, message.details.updateGlobalConfiguration)
|
|
321
|
+
};
|
|
322
|
+
break;
|
|
323
|
+
case /* proto.packets.Response.CreateBKTournament create_bk_tournament */ 38:
|
|
324
|
+
message.details = {
|
|
325
|
+
oneofKind: "createBkTournament",
|
|
326
|
+
createBkTournament: Response_CreateBKTournament.internalBinaryRead(reader, reader.uint32(), options, message.details.createBkTournament)
|
|
327
|
+
};
|
|
328
|
+
break;
|
|
329
|
+
case /* proto.packets.Response.SetBKTournamentLink set_bk_tournament_link */ 39:
|
|
330
|
+
message.details = {
|
|
331
|
+
oneofKind: "setBkTournamentLink",
|
|
332
|
+
setBkTournamentLink: Response_SetBKTournamentLink.internalBinaryRead(reader, reader.uint32(), options, message.details.setBkTournamentLink)
|
|
333
|
+
};
|
|
334
|
+
break;
|
|
306
335
|
default:
|
|
307
336
|
let u = options.readUnknownField;
|
|
308
337
|
if (u === "throw")
|
|
@@ -420,6 +449,18 @@ class Response$Type extends MessageType {
|
|
|
420
449
|
/* proto.packets.Response.DeleteWebhook delete_webhook = 35; */
|
|
421
450
|
if (message.details.oneofKind === "deleteWebhook")
|
|
422
451
|
Response_DeleteWebhook.internalBinaryWrite(message.details.deleteWebhook, writer.tag(35, WireType.LengthDelimited).fork(), options).join();
|
|
452
|
+
/* proto.packets.Response.GetGlobalConfiguration get_global_configuration = 36; */
|
|
453
|
+
if (message.details.oneofKind === "getGlobalConfiguration")
|
|
454
|
+
Response_GetGlobalConfiguration.internalBinaryWrite(message.details.getGlobalConfiguration, writer.tag(36, WireType.LengthDelimited).fork(), options).join();
|
|
455
|
+
/* proto.packets.Response.UpdateGlobalConfiguration update_global_configuration = 37; */
|
|
456
|
+
if (message.details.oneofKind === "updateGlobalConfiguration")
|
|
457
|
+
Response_UpdateGlobalConfiguration.internalBinaryWrite(message.details.updateGlobalConfiguration, writer.tag(37, WireType.LengthDelimited).fork(), options).join();
|
|
458
|
+
/* proto.packets.Response.CreateBKTournament create_bk_tournament = 38; */
|
|
459
|
+
if (message.details.oneofKind === "createBkTournament")
|
|
460
|
+
Response_CreateBKTournament.internalBinaryWrite(message.details.createBkTournament, writer.tag(38, WireType.LengthDelimited).fork(), options).join();
|
|
461
|
+
/* proto.packets.Response.SetBKTournamentLink set_bk_tournament_link = 39; */
|
|
462
|
+
if (message.details.oneofKind === "setBkTournamentLink")
|
|
463
|
+
Response_SetBKTournamentLink.internalBinaryWrite(message.details.setBkTournamentLink, writer.tag(39, WireType.LengthDelimited).fork(), options).join();
|
|
423
464
|
let u = options.writeUnknownFields;
|
|
424
465
|
if (u !== false)
|
|
425
466
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -2372,3 +2413,211 @@ class Response_DeleteWebhook$Type extends MessageType {
|
|
|
2372
2413
|
* @generated MessageType for protobuf message proto.packets.Response.DeleteWebhook
|
|
2373
2414
|
*/
|
|
2374
2415
|
export const Response_DeleteWebhook = new Response_DeleteWebhook$Type();
|
|
2416
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
2417
|
+
class Response_GetGlobalConfiguration$Type extends MessageType {
|
|
2418
|
+
constructor() {
|
|
2419
|
+
super("proto.packets.Response.GetGlobalConfiguration", [
|
|
2420
|
+
{ no: 1, name: "configuration", kind: "message", T: () => GlobalConfiguration }
|
|
2421
|
+
]);
|
|
2422
|
+
}
|
|
2423
|
+
create(value) {
|
|
2424
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
2425
|
+
if (value !== undefined)
|
|
2426
|
+
reflectionMergePartial(this, message, value);
|
|
2427
|
+
return message;
|
|
2428
|
+
}
|
|
2429
|
+
internalBinaryRead(reader, length, options, target) {
|
|
2430
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
2431
|
+
while (reader.pos < end) {
|
|
2432
|
+
let [fieldNo, wireType] = reader.tag();
|
|
2433
|
+
switch (fieldNo) {
|
|
2434
|
+
case /* proto.models.GlobalConfiguration configuration */ 1:
|
|
2435
|
+
message.configuration = GlobalConfiguration.internalBinaryRead(reader, reader.uint32(), options, message.configuration);
|
|
2436
|
+
break;
|
|
2437
|
+
default:
|
|
2438
|
+
let u = options.readUnknownField;
|
|
2439
|
+
if (u === "throw")
|
|
2440
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
2441
|
+
let d = reader.skip(wireType);
|
|
2442
|
+
if (u !== false)
|
|
2443
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
return message;
|
|
2447
|
+
}
|
|
2448
|
+
internalBinaryWrite(message, writer, options) {
|
|
2449
|
+
/* proto.models.GlobalConfiguration configuration = 1; */
|
|
2450
|
+
if (message.configuration)
|
|
2451
|
+
GlobalConfiguration.internalBinaryWrite(message.configuration, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
2452
|
+
let u = options.writeUnknownFields;
|
|
2453
|
+
if (u !== false)
|
|
2454
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
2455
|
+
return writer;
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
/**
|
|
2459
|
+
* @generated MessageType for protobuf message proto.packets.Response.GetGlobalConfiguration
|
|
2460
|
+
*/
|
|
2461
|
+
export const Response_GetGlobalConfiguration = new Response_GetGlobalConfiguration$Type();
|
|
2462
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
2463
|
+
class Response_UpdateGlobalConfiguration$Type extends MessageType {
|
|
2464
|
+
constructor() {
|
|
2465
|
+
super("proto.packets.Response.UpdateGlobalConfiguration", [
|
|
2466
|
+
{ no: 1, name: "configuration", kind: "message", T: () => GlobalConfiguration },
|
|
2467
|
+
{ no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
2468
|
+
]);
|
|
2469
|
+
}
|
|
2470
|
+
create(value) {
|
|
2471
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
2472
|
+
message.message = "";
|
|
2473
|
+
if (value !== undefined)
|
|
2474
|
+
reflectionMergePartial(this, message, value);
|
|
2475
|
+
return message;
|
|
2476
|
+
}
|
|
2477
|
+
internalBinaryRead(reader, length, options, target) {
|
|
2478
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
2479
|
+
while (reader.pos < end) {
|
|
2480
|
+
let [fieldNo, wireType] = reader.tag();
|
|
2481
|
+
switch (fieldNo) {
|
|
2482
|
+
case /* proto.models.GlobalConfiguration configuration */ 1:
|
|
2483
|
+
message.configuration = GlobalConfiguration.internalBinaryRead(reader, reader.uint32(), options, message.configuration);
|
|
2484
|
+
break;
|
|
2485
|
+
case /* string message */ 2:
|
|
2486
|
+
message.message = reader.string();
|
|
2487
|
+
break;
|
|
2488
|
+
default:
|
|
2489
|
+
let u = options.readUnknownField;
|
|
2490
|
+
if (u === "throw")
|
|
2491
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
2492
|
+
let d = reader.skip(wireType);
|
|
2493
|
+
if (u !== false)
|
|
2494
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
return message;
|
|
2498
|
+
}
|
|
2499
|
+
internalBinaryWrite(message, writer, options) {
|
|
2500
|
+
/* proto.models.GlobalConfiguration configuration = 1; */
|
|
2501
|
+
if (message.configuration)
|
|
2502
|
+
GlobalConfiguration.internalBinaryWrite(message.configuration, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
2503
|
+
/* string message = 2; */
|
|
2504
|
+
if (message.message !== "")
|
|
2505
|
+
writer.tag(2, WireType.LengthDelimited).string(message.message);
|
|
2506
|
+
let u = options.writeUnknownFields;
|
|
2507
|
+
if (u !== false)
|
|
2508
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
2509
|
+
return writer;
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
/**
|
|
2513
|
+
* @generated MessageType for protobuf message proto.packets.Response.UpdateGlobalConfiguration
|
|
2514
|
+
*/
|
|
2515
|
+
export const Response_UpdateGlobalConfiguration = new Response_UpdateGlobalConfiguration$Type();
|
|
2516
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
2517
|
+
class Response_SetBKTournamentLink$Type extends MessageType {
|
|
2518
|
+
constructor() {
|
|
2519
|
+
super("proto.packets.Response.SetBKTournamentLink", [
|
|
2520
|
+
{ no: 1, name: "tournament", kind: "message", T: () => Tournament },
|
|
2521
|
+
{ no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
2522
|
+
]);
|
|
2523
|
+
}
|
|
2524
|
+
create(value) {
|
|
2525
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
2526
|
+
message.message = "";
|
|
2527
|
+
if (value !== undefined)
|
|
2528
|
+
reflectionMergePartial(this, message, value);
|
|
2529
|
+
return message;
|
|
2530
|
+
}
|
|
2531
|
+
internalBinaryRead(reader, length, options, target) {
|
|
2532
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
2533
|
+
while (reader.pos < end) {
|
|
2534
|
+
let [fieldNo, wireType] = reader.tag();
|
|
2535
|
+
switch (fieldNo) {
|
|
2536
|
+
case /* proto.models.Tournament tournament */ 1:
|
|
2537
|
+
message.tournament = Tournament.internalBinaryRead(reader, reader.uint32(), options, message.tournament);
|
|
2538
|
+
break;
|
|
2539
|
+
case /* string message */ 2:
|
|
2540
|
+
message.message = reader.string();
|
|
2541
|
+
break;
|
|
2542
|
+
default:
|
|
2543
|
+
let u = options.readUnknownField;
|
|
2544
|
+
if (u === "throw")
|
|
2545
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
2546
|
+
let d = reader.skip(wireType);
|
|
2547
|
+
if (u !== false)
|
|
2548
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
return message;
|
|
2552
|
+
}
|
|
2553
|
+
internalBinaryWrite(message, writer, options) {
|
|
2554
|
+
/* proto.models.Tournament tournament = 1; */
|
|
2555
|
+
if (message.tournament)
|
|
2556
|
+
Tournament.internalBinaryWrite(message.tournament, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
2557
|
+
/* string message = 2; */
|
|
2558
|
+
if (message.message !== "")
|
|
2559
|
+
writer.tag(2, WireType.LengthDelimited).string(message.message);
|
|
2560
|
+
let u = options.writeUnknownFields;
|
|
2561
|
+
if (u !== false)
|
|
2562
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
2563
|
+
return writer;
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
/**
|
|
2567
|
+
* @generated MessageType for protobuf message proto.packets.Response.SetBKTournamentLink
|
|
2568
|
+
*/
|
|
2569
|
+
export const Response_SetBKTournamentLink = new Response_SetBKTournamentLink$Type();
|
|
2570
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
2571
|
+
class Response_CreateBKTournament$Type extends MessageType {
|
|
2572
|
+
constructor() {
|
|
2573
|
+
super("proto.packets.Response.CreateBKTournament", [
|
|
2574
|
+
{ no: 1, name: "beat_khana_tournament_guid", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
2575
|
+
{ no: 2, name: "tournament", kind: "message", T: () => Tournament }
|
|
2576
|
+
]);
|
|
2577
|
+
}
|
|
2578
|
+
create(value) {
|
|
2579
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
2580
|
+
message.beatKhanaTournamentGuid = "";
|
|
2581
|
+
if (value !== undefined)
|
|
2582
|
+
reflectionMergePartial(this, message, value);
|
|
2583
|
+
return message;
|
|
2584
|
+
}
|
|
2585
|
+
internalBinaryRead(reader, length, options, target) {
|
|
2586
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
2587
|
+
while (reader.pos < end) {
|
|
2588
|
+
let [fieldNo, wireType] = reader.tag();
|
|
2589
|
+
switch (fieldNo) {
|
|
2590
|
+
case /* string beat_khana_tournament_guid */ 1:
|
|
2591
|
+
message.beatKhanaTournamentGuid = reader.string();
|
|
2592
|
+
break;
|
|
2593
|
+
case /* proto.models.Tournament tournament */ 2:
|
|
2594
|
+
message.tournament = Tournament.internalBinaryRead(reader, reader.uint32(), options, message.tournament);
|
|
2595
|
+
break;
|
|
2596
|
+
default:
|
|
2597
|
+
let u = options.readUnknownField;
|
|
2598
|
+
if (u === "throw")
|
|
2599
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
2600
|
+
let d = reader.skip(wireType);
|
|
2601
|
+
if (u !== false)
|
|
2602
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
return message;
|
|
2606
|
+
}
|
|
2607
|
+
internalBinaryWrite(message, writer, options) {
|
|
2608
|
+
/* string beat_khana_tournament_guid = 1; */
|
|
2609
|
+
if (message.beatKhanaTournamentGuid !== "")
|
|
2610
|
+
writer.tag(1, WireType.LengthDelimited).string(message.beatKhanaTournamentGuid);
|
|
2611
|
+
/* proto.models.Tournament tournament = 2; */
|
|
2612
|
+
if (message.tournament)
|
|
2613
|
+
Tournament.internalBinaryWrite(message.tournament, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
2614
|
+
let u = options.writeUnknownFields;
|
|
2615
|
+
if (u !== false)
|
|
2616
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
2617
|
+
return writer;
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
/**
|
|
2621
|
+
* @generated MessageType for protobuf message proto.packets.Response.CreateBKTournament
|
|
2622
|
+
*/
|
|
2623
|
+
export const Response_CreateBKTournament = new Response_CreateBKTournament$Type();
|
package/dist/scraper.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CustomEventEmitter } from "./custom-event-emitter.js";
|
|
2
2
|
import { TAClient } from "./tournament-assistant-client.js";
|
|
3
|
-
|
|
4
|
-
const MASTER_PORT = "8676";
|
|
3
|
+
import { masterAddress, masterPort } from "./constants.js";
|
|
5
4
|
export function getTournaments(token, onProgress, onComplete) {
|
|
6
5
|
const scraper = new Scraper(token);
|
|
7
6
|
scraper.on("onProgress", (progress) => {
|
|
@@ -42,7 +41,7 @@ class Scraper extends CustomEventEmitter {
|
|
|
42
41
|
//This is probably a sin. If anyone knows the proper way to do this, hit me up on discord
|
|
43
42
|
this.servers
|
|
44
43
|
.filter((x) => `${x.address}:${x.websocketPort}` !==
|
|
45
|
-
`${
|
|
44
|
+
`${masterAddress}:${masterPort}`)
|
|
46
45
|
.map((x) => this.getTournamentsFromServer(x.address, `${x.websocketPort}`));
|
|
47
46
|
});
|
|
48
47
|
masterClient.on("failedToConnectToServer", () => {
|
|
@@ -55,7 +54,7 @@ class Scraper extends CustomEventEmitter {
|
|
|
55
54
|
tournaments: this.tournaments,
|
|
56
55
|
});
|
|
57
56
|
});
|
|
58
|
-
masterClient.connect(
|
|
57
|
+
masterClient.connect(masterAddress, masterPort);
|
|
59
58
|
}
|
|
60
59
|
async getTournamentsFromServer(address, port) {
|
|
61
60
|
const client = new TAClient();
|
|
@@ -1,5 +1,5 @@
|
|
|
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 } from "./models/models.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";
|
|
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";
|
|
@@ -144,4 +144,7 @@ export declare class TAClient extends CustomEventEmitter<TAClientEvents> {
|
|
|
144
144
|
removeTournamentPool: (tournamentId: string, poolId: string) => Promise<Response>;
|
|
145
145
|
deleteTournament: (tournamentId: string) => Promise<Response>;
|
|
146
146
|
addServer: (server: CoreServer, authToken?: string) => Promise<Response>;
|
|
147
|
+
getGlobalConfiguration: () => Promise<Response>;
|
|
148
|
+
updateGlobalConfiguration: (configuration: GlobalConfiguration) => Promise<Response>;
|
|
149
|
+
setBKTournamentLink: (tournamentId: string, isBKTournament: boolean, beatKhanaTournamentGuid: string) => Promise<Response>;
|
|
147
150
|
}
|
|
@@ -1125,6 +1125,8 @@ export class TAClient extends CustomEventEmitter {
|
|
|
1125
1125
|
enablePools,
|
|
1126
1126
|
enableReplayStreaming,
|
|
1127
1127
|
allowMockClients,
|
|
1128
|
+
isBkTournament: false,
|
|
1129
|
+
beatKhanaTournamentGuid: "",
|
|
1128
1130
|
showTournamentButton,
|
|
1129
1131
|
showQualifierButton,
|
|
1130
1132
|
roles,
|
|
@@ -1586,4 +1588,44 @@ export class TAClient extends CustomEventEmitter {
|
|
|
1586
1588
|
}
|
|
1587
1589
|
return response[0].response;
|
|
1588
1590
|
};
|
|
1591
|
+
getGlobalConfiguration = async () => {
|
|
1592
|
+
const response = await this.sendRequest({
|
|
1593
|
+
type: {
|
|
1594
|
+
oneofKind: "getGlobalConfiguration",
|
|
1595
|
+
getGlobalConfiguration: {},
|
|
1596
|
+
},
|
|
1597
|
+
});
|
|
1598
|
+
if (response.length <= 0) {
|
|
1599
|
+
throw new Error("Server timed out");
|
|
1600
|
+
}
|
|
1601
|
+
return response[0].response;
|
|
1602
|
+
};
|
|
1603
|
+
updateGlobalConfiguration = async (configuration) => {
|
|
1604
|
+
const response = await this.sendRequest({
|
|
1605
|
+
type: {
|
|
1606
|
+
oneofKind: "updateGlobalConfiguration",
|
|
1607
|
+
updateGlobalConfiguration: { configuration },
|
|
1608
|
+
},
|
|
1609
|
+
});
|
|
1610
|
+
if (response.length <= 0) {
|
|
1611
|
+
throw new Error("Server timed out");
|
|
1612
|
+
}
|
|
1613
|
+
return response[0].response;
|
|
1614
|
+
};
|
|
1615
|
+
setBKTournamentLink = async (tournamentId, isBKTournament, beatKhanaTournamentGuid) => {
|
|
1616
|
+
const response = await this.sendRequest({
|
|
1617
|
+
type: {
|
|
1618
|
+
oneofKind: "setBkTournamentLink",
|
|
1619
|
+
setBkTournamentLink: {
|
|
1620
|
+
tournamentId,
|
|
1621
|
+
isBkTournament: isBKTournament,
|
|
1622
|
+
beatKhanaTournamentGuid,
|
|
1623
|
+
},
|
|
1624
|
+
},
|
|
1625
|
+
});
|
|
1626
|
+
if (response.length <= 0) {
|
|
1627
|
+
throw new Error("Server timed out");
|
|
1628
|
+
}
|
|
1629
|
+
return response[0].response;
|
|
1630
|
+
};
|
|
1589
1631
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moons-ta-client",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.esm.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -28,25 +28,19 @@
|
|
|
28
28
|
"@types/uuid": "^8.3.4",
|
|
29
29
|
"@types/ws": "^8.5.10",
|
|
30
30
|
"esbuild": "^0.19.12",
|
|
31
|
-
"esbuild-plugin-polyfill-node": "^0.3.0",
|
|
32
31
|
"esbuild-plugin-globals": "^0.2.0",
|
|
32
|
+
"esbuild-plugin-polyfill-node": "^0.3.0",
|
|
33
33
|
"rollup": "^4.17.2",
|
|
34
34
|
"rollup-plugin-dts": "^6.1.1",
|
|
35
|
-
"tslib": "^2.3.1",
|
|
36
35
|
"typescript": "^4.5.4"
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
38
|
"@protobuf-ts/plugin": "^2.6.0",
|
|
40
39
|
"events": "^3.3.0",
|
|
41
|
-
"install": "^0.13.0",
|
|
42
|
-
"npm": "^10.8.0",
|
|
43
40
|
"uuid": "^9.0.0",
|
|
44
41
|
"ws": "^8.17.0"
|
|
45
42
|
},
|
|
46
43
|
"files": [
|
|
47
|
-
"
|
|
48
|
-
"README.md",
|
|
49
|
-
"dist",
|
|
50
|
-
"package.json"
|
|
44
|
+
"dist"
|
|
51
45
|
]
|
|
52
|
-
}
|
|
46
|
+
}
|