tods-competition-factory 1.6.29 → 1.7.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/forge/generate.mjs +28 -8
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.mjs +22 -1
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +22 -1
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/forge/utilities.mjs.map +1 -1
- package/dist/index.mjs +146 -148
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +224 -235
- package/dist/tods-competition-factory.development.cjs.js.map +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -329,7 +329,7 @@ const matchUpFormatCode = {
|
|
|
329
329
|
};
|
|
330
330
|
|
|
331
331
|
function factoryVersion() {
|
|
332
|
-
return "1.
|
|
332
|
+
return "1.7.0";
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
function getObjectTieFormat(obj) {
|
|
@@ -1425,7 +1425,8 @@ var syncGlobalState$1 = {
|
|
|
1425
1425
|
setSubscriptions: setSubscriptions$1,
|
|
1426
1426
|
setTournamentId: setTournamentId$1,
|
|
1427
1427
|
setTournamentRecord: setTournamentRecord$2,
|
|
1428
|
-
setTournamentRecords: setTournamentRecords$1
|
|
1428
|
+
setTournamentRecords: setTournamentRecords$1,
|
|
1429
|
+
handleCaughtError: handleCaughtError$1
|
|
1429
1430
|
};
|
|
1430
1431
|
function disableNotifications$1() {
|
|
1431
1432
|
syncGlobalState.disableNotifications = true;
|
|
@@ -1531,6 +1532,26 @@ function callListener$1({ topic, notices }) {
|
|
|
1531
1532
|
method(notices);
|
|
1532
1533
|
}
|
|
1533
1534
|
}
|
|
1535
|
+
function handleCaughtError$1({
|
|
1536
|
+
engineName,
|
|
1537
|
+
methodName,
|
|
1538
|
+
params,
|
|
1539
|
+
err
|
|
1540
|
+
}) {
|
|
1541
|
+
let error;
|
|
1542
|
+
if (typeof err === "string") {
|
|
1543
|
+
error = err.toUpperCase();
|
|
1544
|
+
} else if (err instanceof Error) {
|
|
1545
|
+
error = err.message;
|
|
1546
|
+
}
|
|
1547
|
+
console.log("ERROR", {
|
|
1548
|
+
tournamentId: getTournamentId$1(),
|
|
1549
|
+
params: JSON.stringify(params),
|
|
1550
|
+
engine: engineName,
|
|
1551
|
+
methodName,
|
|
1552
|
+
error
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1534
1555
|
|
|
1535
1556
|
const globalState = {
|
|
1536
1557
|
tournamentFactoryVersion: "0.0.0",
|
|
@@ -1550,6 +1571,8 @@ const requiredStateProviderMethods = [
|
|
|
1550
1571
|
"cycleMutationStatus",
|
|
1551
1572
|
"deleteNotice",
|
|
1552
1573
|
"deleteNotices",
|
|
1574
|
+
"disableNotifications",
|
|
1575
|
+
"enableNotifications",
|
|
1553
1576
|
"getNotices",
|
|
1554
1577
|
"getTopics",
|
|
1555
1578
|
"getTournamentId",
|
|
@@ -1649,8 +1672,8 @@ function cycleMutationStatus() {
|
|
|
1649
1672
|
function addNotice(notice) {
|
|
1650
1673
|
return _globalStateProvider.addNotice(notice);
|
|
1651
1674
|
}
|
|
1652
|
-
function getNotices(
|
|
1653
|
-
return _globalStateProvider.getNotices(
|
|
1675
|
+
function getNotices(params) {
|
|
1676
|
+
return _globalStateProvider.getNotices(params);
|
|
1654
1677
|
}
|
|
1655
1678
|
function deleteNotice({ key, topic }) {
|
|
1656
1679
|
return _globalStateProvider.deleteNotice({ key, topic });
|
|
@@ -1685,6 +1708,20 @@ function setTournamentId(tournamentId) {
|
|
|
1685
1708
|
function removeTournamentRecord(tournamentId) {
|
|
1686
1709
|
return _globalStateProvider.removeTournamentRecord(tournamentId);
|
|
1687
1710
|
}
|
|
1711
|
+
function handleCaughtError({
|
|
1712
|
+
engineName,
|
|
1713
|
+
methodName,
|
|
1714
|
+
params,
|
|
1715
|
+
err
|
|
1716
|
+
}) {
|
|
1717
|
+
const caughtErrorHandler = typeof _globalStateProvider.handleCaughtError === "function" && _globalStateProvider.handleCaughtError || syncGlobalState$1.handleCaughtError;
|
|
1718
|
+
return caughtErrorHandler({
|
|
1719
|
+
engineName,
|
|
1720
|
+
methodName,
|
|
1721
|
+
params,
|
|
1722
|
+
err
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1688
1725
|
|
|
1689
1726
|
function isObject(obj) {
|
|
1690
1727
|
return typeof obj === "object";
|
|
@@ -38377,18 +38414,11 @@ const competitionEngine = function() {
|
|
|
38377
38414
|
try {
|
|
38378
38415
|
return engineInvoke(governor[methodName], params, methodName);
|
|
38379
38416
|
} catch (err) {
|
|
38380
|
-
|
|
38381
|
-
|
|
38382
|
-
if (typeof err === "string") {
|
|
38383
|
-
error = err.toUpperCase();
|
|
38384
|
-
} else if (err instanceof Error) {
|
|
38385
|
-
error = err.message;
|
|
38386
|
-
}
|
|
38387
|
-
console.log("ERROR", {
|
|
38388
|
-
params: JSON.stringify(params),
|
|
38389
|
-
activeTournamentId,
|
|
38417
|
+
handleCaughtError({
|
|
38418
|
+
engineName: "competitionEngine",
|
|
38390
38419
|
methodName,
|
|
38391
|
-
|
|
38420
|
+
params,
|
|
38421
|
+
err
|
|
38392
38422
|
});
|
|
38393
38423
|
}
|
|
38394
38424
|
}
|
|
@@ -38545,26 +38575,19 @@ function competitionEngineAsync(test) {
|
|
|
38545
38575
|
async function importGovernors(governors) {
|
|
38546
38576
|
for (const governor of governors) {
|
|
38547
38577
|
const govKeys = Object.keys(governor);
|
|
38548
|
-
for (const
|
|
38549
|
-
engine[
|
|
38578
|
+
for (const methodName of govKeys) {
|
|
38579
|
+
engine[methodName] = async function(params) {
|
|
38550
38580
|
if (getDevContext()) {
|
|
38551
|
-
return await engineInvoke(governor[
|
|
38581
|
+
return await engineInvoke(governor[methodName], params);
|
|
38552
38582
|
} else {
|
|
38553
38583
|
try {
|
|
38554
|
-
return await engineInvoke(governor[
|
|
38584
|
+
return await engineInvoke(governor[methodName], params);
|
|
38555
38585
|
} catch (err) {
|
|
38556
|
-
|
|
38557
|
-
|
|
38558
|
-
|
|
38559
|
-
|
|
38560
|
-
|
|
38561
|
-
error = err.message;
|
|
38562
|
-
}
|
|
38563
|
-
console.log("ERROR", {
|
|
38564
|
-
params: JSON.stringify(params),
|
|
38565
|
-
activeTournamentId,
|
|
38566
|
-
method,
|
|
38567
|
-
error
|
|
38586
|
+
handleCaughtError({
|
|
38587
|
+
engineName: "competitionEngine",
|
|
38588
|
+
methodName,
|
|
38589
|
+
params,
|
|
38590
|
+
err
|
|
38568
38591
|
});
|
|
38569
38592
|
}
|
|
38570
38593
|
}
|
|
@@ -40570,8 +40593,6 @@ function getGenerators(params) {
|
|
|
40570
40593
|
function generateDrawStructuresAndLinks$1(params) {
|
|
40571
40594
|
const {
|
|
40572
40595
|
enforceMinimumDrawSize = true,
|
|
40573
|
-
drawTypeCoercion = true,
|
|
40574
|
-
// coerce to SINGLE_ELIMINATION for drawSize: 2
|
|
40575
40596
|
overwriteExisting,
|
|
40576
40597
|
appliedPolicies,
|
|
40577
40598
|
staggeredEntry,
|
|
@@ -40582,6 +40603,7 @@ function generateDrawStructuresAndLinks$1(params) {
|
|
|
40582
40603
|
isMock,
|
|
40583
40604
|
uuids
|
|
40584
40605
|
} = params || {};
|
|
40606
|
+
const drawTypeCoercion = params.drawTypeCoercion ?? appliedPolicies?.[POLICY_TYPE_DRAWS]?.drawTypeCoercion ?? true;
|
|
40585
40607
|
const stack = "generateDrawStructuresAndLinks";
|
|
40586
40608
|
let drawType = drawTypeCoercion && params.drawSize === 2 && DrawTypeEnum.SingleElimination || params.drawType || DrawTypeEnum.SingleElimination;
|
|
40587
40609
|
const structures = [], links = [];
|
|
@@ -48690,25 +48712,19 @@ const drawEngine = function() {
|
|
|
48690
48712
|
return engine;
|
|
48691
48713
|
function importGovernors(governors) {
|
|
48692
48714
|
governors.forEach((governor) => {
|
|
48693
|
-
Object.keys(governor).forEach((
|
|
48694
|
-
engine[
|
|
48715
|
+
Object.keys(governor).forEach((methodName) => {
|
|
48716
|
+
engine[methodName] = (params) => {
|
|
48695
48717
|
if (getDevContext()) {
|
|
48696
|
-
return invoke({ params, governor,
|
|
48718
|
+
return invoke({ params, governor, methodName });
|
|
48697
48719
|
} else {
|
|
48698
48720
|
try {
|
|
48699
|
-
return invoke({ params, governor,
|
|
48721
|
+
return invoke({ params, governor, methodName });
|
|
48700
48722
|
} catch (err) {
|
|
48701
|
-
|
|
48702
|
-
|
|
48703
|
-
|
|
48704
|
-
|
|
48705
|
-
|
|
48706
|
-
}
|
|
48707
|
-
console.log("ERROR", {
|
|
48708
|
-
params: JSON.stringify(params),
|
|
48709
|
-
drawId: drawDefinition$1?.drawId,
|
|
48710
|
-
method: governorMethod,
|
|
48711
|
-
error
|
|
48723
|
+
handleCaughtError({
|
|
48724
|
+
engineName: "drawEngine",
|
|
48725
|
+
methodName,
|
|
48726
|
+
params,
|
|
48727
|
+
err
|
|
48712
48728
|
});
|
|
48713
48729
|
}
|
|
48714
48730
|
}
|
|
@@ -48716,7 +48732,7 @@ const drawEngine = function() {
|
|
|
48716
48732
|
});
|
|
48717
48733
|
});
|
|
48718
48734
|
}
|
|
48719
|
-
function invoke({ params, governor,
|
|
48735
|
+
function invoke({ params, governor, methodName }) {
|
|
48720
48736
|
delete engine.success;
|
|
48721
48737
|
delete engine.error;
|
|
48722
48738
|
const snapshot = params?.rollbackOnError && makeDeepCopy(drawDefinition$1, false, true);
|
|
@@ -48727,7 +48743,7 @@ const drawEngine = function() {
|
|
|
48727
48743
|
tournamentParticipants: tournamentParticipants$1,
|
|
48728
48744
|
drawDefinition: drawDefinition$1
|
|
48729
48745
|
};
|
|
48730
|
-
const result = governor[
|
|
48746
|
+
const result = governor[methodName](params);
|
|
48731
48747
|
if (result?.error) {
|
|
48732
48748
|
if (snapshot)
|
|
48733
48749
|
setState$3(snapshot);
|
|
@@ -48820,25 +48836,19 @@ function drawEngineAsync(test) {
|
|
|
48820
48836
|
async function importGovernors(governors) {
|
|
48821
48837
|
for (const governor of governors) {
|
|
48822
48838
|
const governorMethods = Object.keys(governor);
|
|
48823
|
-
for (const
|
|
48824
|
-
engine[
|
|
48839
|
+
for (const methodName of governorMethods) {
|
|
48840
|
+
engine[methodName] = async (params) => {
|
|
48825
48841
|
if (getDevContext()) {
|
|
48826
|
-
return await invoke({ params, governor,
|
|
48842
|
+
return await invoke({ params, governor, methodName });
|
|
48827
48843
|
} else {
|
|
48828
48844
|
try {
|
|
48829
|
-
return await invoke({ params, governor,
|
|
48845
|
+
return await invoke({ params, governor, methodName });
|
|
48830
48846
|
} catch (err) {
|
|
48831
|
-
|
|
48832
|
-
|
|
48833
|
-
|
|
48834
|
-
|
|
48835
|
-
|
|
48836
|
-
}
|
|
48837
|
-
console.log("ERROR", {
|
|
48838
|
-
params: JSON.stringify(params),
|
|
48839
|
-
drawId: drawDefinition?.drawId,
|
|
48840
|
-
method: governorMethod,
|
|
48841
|
-
error
|
|
48847
|
+
handleCaughtError({
|
|
48848
|
+
engineName: "drawEngine",
|
|
48849
|
+
methodName,
|
|
48850
|
+
params,
|
|
48851
|
+
err
|
|
48842
48852
|
});
|
|
48843
48853
|
}
|
|
48844
48854
|
}
|
|
@@ -48846,7 +48856,7 @@ function drawEngineAsync(test) {
|
|
|
48846
48856
|
}
|
|
48847
48857
|
}
|
|
48848
48858
|
}
|
|
48849
|
-
async function invoke({ params, governor,
|
|
48859
|
+
async function invoke({ params, governor, methodName }) {
|
|
48850
48860
|
delete engine.success;
|
|
48851
48861
|
delete engine.error;
|
|
48852
48862
|
const snapshot = params?.rollbackOnError && makeDeepCopy(drawDefinition, false, true);
|
|
@@ -48857,7 +48867,7 @@ function drawEngineAsync(test) {
|
|
|
48857
48867
|
tournamentParticipants,
|
|
48858
48868
|
drawDefinition
|
|
48859
48869
|
};
|
|
48860
|
-
const result2 = governor[
|
|
48870
|
+
const result2 = governor[methodName](params);
|
|
48861
48871
|
if (result2?.error) {
|
|
48862
48872
|
if (snapshot)
|
|
48863
48873
|
setState$3(snapshot);
|
|
@@ -49355,24 +49365,19 @@ const matchUpEngine = (() => {
|
|
|
49355
49365
|
return engine;
|
|
49356
49366
|
function importGovernors(governors) {
|
|
49357
49367
|
governors.forEach((governor) => {
|
|
49358
|
-
Object.keys(governor).forEach((
|
|
49359
|
-
engine[
|
|
49368
|
+
Object.keys(governor).forEach((methodName) => {
|
|
49369
|
+
engine[methodName] = (params) => {
|
|
49360
49370
|
if (getDevContext()) {
|
|
49361
|
-
return invoke({ params, governor,
|
|
49371
|
+
return invoke({ params, governor, methodName });
|
|
49362
49372
|
} else {
|
|
49363
49373
|
try {
|
|
49364
|
-
return invoke({ params, governor,
|
|
49374
|
+
return invoke({ params, governor, methodName });
|
|
49365
49375
|
} catch (err) {
|
|
49366
|
-
|
|
49367
|
-
|
|
49368
|
-
|
|
49369
|
-
|
|
49370
|
-
|
|
49371
|
-
}
|
|
49372
|
-
console.log("ERROR", {
|
|
49373
|
-
params: JSON.stringify(params),
|
|
49374
|
-
method: governorMethod,
|
|
49375
|
-
error
|
|
49376
|
+
handleCaughtError({
|
|
49377
|
+
engineName: "matchUpEngine",
|
|
49378
|
+
methodName,
|
|
49379
|
+
params,
|
|
49380
|
+
err
|
|
49376
49381
|
});
|
|
49377
49382
|
}
|
|
49378
49383
|
}
|
|
@@ -49380,7 +49385,7 @@ const matchUpEngine = (() => {
|
|
|
49380
49385
|
});
|
|
49381
49386
|
});
|
|
49382
49387
|
}
|
|
49383
|
-
function invoke({ params, governor,
|
|
49388
|
+
function invoke({ params, governor, methodName }) {
|
|
49384
49389
|
engine.error = void 0;
|
|
49385
49390
|
engine.success = false;
|
|
49386
49391
|
const matchUp = params?.matchUp || getMatchUp();
|
|
@@ -49392,7 +49397,7 @@ const matchUpEngine = (() => {
|
|
|
49392
49397
|
matchUps,
|
|
49393
49398
|
matchUp
|
|
49394
49399
|
};
|
|
49395
|
-
const result = governor[
|
|
49400
|
+
const result = governor[methodName](params);
|
|
49396
49401
|
if (result?.error) {
|
|
49397
49402
|
if (snapshot)
|
|
49398
49403
|
setState$2(snapshot);
|
|
@@ -49452,24 +49457,19 @@ function matchUpEngineAsync(test) {
|
|
|
49452
49457
|
async function importGovernors(governors) {
|
|
49453
49458
|
for (const governor of governors) {
|
|
49454
49459
|
const governorMethods = Object.keys(governor);
|
|
49455
|
-
for (const
|
|
49456
|
-
engine[
|
|
49460
|
+
for (const methodName of governorMethods) {
|
|
49461
|
+
engine[methodName] = async (params) => {
|
|
49457
49462
|
if (getDevContext()) {
|
|
49458
|
-
return await invoke({ params, governor,
|
|
49463
|
+
return await invoke({ params, governor, methodName });
|
|
49459
49464
|
} else {
|
|
49460
49465
|
try {
|
|
49461
|
-
return await invoke({ params, governor,
|
|
49466
|
+
return await invoke({ params, governor, methodName });
|
|
49462
49467
|
} catch (err) {
|
|
49463
|
-
|
|
49464
|
-
|
|
49465
|
-
|
|
49466
|
-
|
|
49467
|
-
|
|
49468
|
-
}
|
|
49469
|
-
console.log("ERROR", {
|
|
49470
|
-
params: JSON.stringify(params),
|
|
49471
|
-
method: governorMethod,
|
|
49472
|
-
error
|
|
49468
|
+
handleCaughtError({
|
|
49469
|
+
engineName: "matchUpEngine",
|
|
49470
|
+
methodName,
|
|
49471
|
+
params,
|
|
49472
|
+
err
|
|
49473
49473
|
});
|
|
49474
49474
|
}
|
|
49475
49475
|
}
|
|
@@ -49477,7 +49477,7 @@ function matchUpEngineAsync(test) {
|
|
|
49477
49477
|
}
|
|
49478
49478
|
}
|
|
49479
49479
|
}
|
|
49480
|
-
async function invoke({ params, governor,
|
|
49480
|
+
async function invoke({ params, governor, methodName }) {
|
|
49481
49481
|
engine.success = false;
|
|
49482
49482
|
engine.error = void 0;
|
|
49483
49483
|
const matchUp = params?.matchUp || getMatchUp();
|
|
@@ -49489,7 +49489,7 @@ function matchUpEngineAsync(test) {
|
|
|
49489
49489
|
matchUps,
|
|
49490
49490
|
matchUp
|
|
49491
49491
|
};
|
|
49492
|
-
const result2 = governor[
|
|
49492
|
+
const result2 = governor[methodName](params);
|
|
49493
49493
|
if (result2?.error) {
|
|
49494
49494
|
if (snapshot)
|
|
49495
49495
|
setState$2(snapshot);
|
|
@@ -54724,7 +54724,10 @@ function addEventEntryPairs({
|
|
|
54724
54724
|
event
|
|
54725
54725
|
});
|
|
54726
54726
|
if (newParticipants.length) {
|
|
54727
|
-
addNotice({
|
|
54727
|
+
addNotice({
|
|
54728
|
+
payload: { participants: newParticipants },
|
|
54729
|
+
topic: ADD_PARTICIPANTS
|
|
54730
|
+
});
|
|
54728
54731
|
}
|
|
54729
54732
|
const newParticipantIds = newParticipants.map(getParticipantId);
|
|
54730
54733
|
return { ...result, info, newParticipantIds };
|
|
@@ -57343,7 +57346,6 @@ function generateDrawDefinition(params) {
|
|
|
57343
57346
|
const {
|
|
57344
57347
|
considerEventEntries = true,
|
|
57345
57348
|
// in the absence of drawSize and drawEntries, look to event.entries
|
|
57346
|
-
drawTypeCoercion = true,
|
|
57347
57349
|
ignoreAllowedDrawTypes,
|
|
57348
57350
|
voluntaryConsolation,
|
|
57349
57351
|
hydrateCollections,
|
|
@@ -57357,15 +57359,16 @@ function generateDrawDefinition(params) {
|
|
|
57357
57359
|
placeByes,
|
|
57358
57360
|
event
|
|
57359
57361
|
} = params;
|
|
57362
|
+
const appliedPolicies = getAppliedPolicies({
|
|
57363
|
+
tournamentRecord,
|
|
57364
|
+
event
|
|
57365
|
+
}).appliedPolicies ?? {};
|
|
57366
|
+
const drawTypeCoercion = params.drawTypeCoercion ?? appliedPolicies?.[POLICY_TYPE_DRAWS]?.drawTypeCoercion ?? true;
|
|
57360
57367
|
const drawType = drawTypeCoercion && params.drawSize === 2 && DrawTypeEnum.SingleElimination || params.drawType || DrawTypeEnum.SingleElimination;
|
|
57361
57368
|
const { tournamentParticipants: participants } = getTournamentParticipants({
|
|
57362
57369
|
tournamentRecord,
|
|
57363
57370
|
inContext: true
|
|
57364
57371
|
});
|
|
57365
|
-
const appliedPolicies = getAppliedPolicies({
|
|
57366
|
-
tournamentRecord,
|
|
57367
|
-
event
|
|
57368
|
-
}).appliedPolicies ?? {};
|
|
57369
57372
|
const enforceGender = params.enforceGender ?? policyDefinitions?.[POLICY_TYPE_MATCHUP_ACTIONS]?.participants?.enforceGender ?? appliedPolicies?.[POLICY_TYPE_MATCHUP_ACTIONS]?.participants?.enforceGender;
|
|
57370
57373
|
const allowedDrawTypes = !ignoreAllowedDrawTypes && tournamentRecord && getAllowedDrawTypes({
|
|
57371
57374
|
tournamentRecord,
|
|
@@ -58744,17 +58747,11 @@ const tournamentEngine = (() => {
|
|
|
58744
58747
|
try {
|
|
58745
58748
|
return engineInvoke(governor[methodName], params, methodName);
|
|
58746
58749
|
} catch (err) {
|
|
58747
|
-
|
|
58748
|
-
|
|
58749
|
-
error = err.toUpperCase();
|
|
58750
|
-
} else if (err instanceof Error) {
|
|
58751
|
-
error = err.message;
|
|
58752
|
-
}
|
|
58753
|
-
console.log("ERROR", {
|
|
58754
|
-
tournamentId: getTournamentId(),
|
|
58755
|
-
params: JSON.stringify(params),
|
|
58750
|
+
handleCaughtError({
|
|
58751
|
+
engineName: "tournamentEngine",
|
|
58756
58752
|
methodName,
|
|
58757
|
-
|
|
58753
|
+
params,
|
|
58754
|
+
err
|
|
58758
58755
|
});
|
|
58759
58756
|
}
|
|
58760
58757
|
}
|
|
@@ -58915,26 +58912,19 @@ function tournamentEngineAsync(test) {
|
|
|
58915
58912
|
function importGovernors(governors) {
|
|
58916
58913
|
for (const governor of governors) {
|
|
58917
58914
|
const governorMethods = Object.keys(governor);
|
|
58918
|
-
for (const
|
|
58919
|
-
engine[
|
|
58915
|
+
for (const methodName of governorMethods) {
|
|
58916
|
+
engine[methodName] = async (params) => {
|
|
58920
58917
|
if (getDevContext()) {
|
|
58921
|
-
return await engineInvoke(governor[
|
|
58918
|
+
return await engineInvoke(governor[methodName], params);
|
|
58922
58919
|
} else {
|
|
58923
58920
|
try {
|
|
58924
|
-
return await engineInvoke(governor[
|
|
58921
|
+
return await engineInvoke(governor[methodName], params);
|
|
58925
58922
|
} catch (err) {
|
|
58926
|
-
|
|
58927
|
-
|
|
58928
|
-
|
|
58929
|
-
|
|
58930
|
-
|
|
58931
|
-
error = err.message;
|
|
58932
|
-
}
|
|
58933
|
-
console.log("ERROR", {
|
|
58934
|
-
params: JSON.stringify(params),
|
|
58935
|
-
tournamentId,
|
|
58936
|
-
method,
|
|
58937
|
-
error
|
|
58923
|
+
handleCaughtError({
|
|
58924
|
+
engineName: "tournamentEngine",
|
|
58925
|
+
methodName,
|
|
58926
|
+
params,
|
|
58927
|
+
err
|
|
58938
58928
|
});
|
|
58939
58929
|
}
|
|
58940
58930
|
}
|
|
@@ -59633,24 +59623,19 @@ const scaleEngine = (() => {
|
|
|
59633
59623
|
}
|
|
59634
59624
|
function importGovernors(governors) {
|
|
59635
59625
|
governors.forEach((governor) => {
|
|
59636
|
-
Object.keys(governor).forEach((
|
|
59637
|
-
engine[
|
|
59626
|
+
Object.keys(governor).forEach((methodName) => {
|
|
59627
|
+
engine[methodName] = (params) => {
|
|
59638
59628
|
if (getDevContext()) {
|
|
59639
|
-
return engineInvoke(governor[
|
|
59629
|
+
return engineInvoke(governor[methodName], params);
|
|
59640
59630
|
} else {
|
|
59641
59631
|
try {
|
|
59642
|
-
return engineInvoke(governor[
|
|
59632
|
+
return engineInvoke(governor[methodName], params);
|
|
59643
59633
|
} catch (err) {
|
|
59644
|
-
|
|
59645
|
-
|
|
59646
|
-
|
|
59647
|
-
|
|
59648
|
-
|
|
59649
|
-
}
|
|
59650
|
-
console.log("ERROR", {
|
|
59651
|
-
error,
|
|
59652
|
-
method,
|
|
59653
|
-
params: JSON.stringify(params)
|
|
59634
|
+
handleCaughtError({
|
|
59635
|
+
engineName: "scaleEngine",
|
|
59636
|
+
methodName,
|
|
59637
|
+
params,
|
|
59638
|
+
err
|
|
59654
59639
|
});
|
|
59655
59640
|
}
|
|
59656
59641
|
}
|
|
@@ -59722,9 +59707,22 @@ function scaleEngineAsync(test) {
|
|
|
59722
59707
|
function importGovernors(governors) {
|
|
59723
59708
|
for (const governor of governors) {
|
|
59724
59709
|
const governorMethods = Object.keys(governor);
|
|
59725
|
-
for (const
|
|
59726
|
-
engine[
|
|
59727
|
-
|
|
59710
|
+
for (const methodName of governorMethods) {
|
|
59711
|
+
engine[methodName] = async (params) => {
|
|
59712
|
+
if (getDevContext()) {
|
|
59713
|
+
return await engineInvoke(governor[methodName], params);
|
|
59714
|
+
} else {
|
|
59715
|
+
try {
|
|
59716
|
+
return await engineInvoke(governor[methodName], params);
|
|
59717
|
+
} catch (err) {
|
|
59718
|
+
handleCaughtError({
|
|
59719
|
+
engineName: "scaleEngine",
|
|
59720
|
+
methodName,
|
|
59721
|
+
params,
|
|
59722
|
+
err
|
|
59723
|
+
});
|
|
59724
|
+
}
|
|
59725
|
+
}
|
|
59728
59726
|
};
|
|
59729
59727
|
}
|
|
59730
59728
|
}
|