@levrbet/shared 0.3.1 → 0.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/core/config/urls.js +4 -4
- package/dist/core/config/urls.js.map +1 -1
- package/dist/core/utils/game.utils.d.ts +0 -2
- package/dist/core/utils/game.utils.js +1 -69
- package/dist/core/utils/game.utils.js.map +1 -1
- package/dist/server/oracle/config/game-periods/providers/lsports.periods.js +3 -3
- package/dist/server/oracle/config/game-periods/providers/lsports.periods.js.map +1 -1
- package/dist/server/oracle/config/game-periods/providers/optic-odds.periods.d.ts +27 -4
- package/dist/server/oracle/config/game-periods/providers/optic-odds.periods.js +27 -4
- package/dist/server/oracle/config/game-periods/providers/optic-odds.periods.js.map +1 -1
- package/dist/server/oracle/config/game-periods/sports.config.js +73 -8
- package/dist/server/oracle/config/game-periods/sports.config.js.map +1 -1
- package/dist/server/oracle/config/game-periods/types.d.ts +6 -2
- package/dist/server/oracle/config/game-periods/types.js +1 -0
- package/dist/server/oracle/config/game-periods/types.js.map +1 -1
- package/dist/server/oracle/redis-cache-manager/game.progress.d.ts +4 -0
- package/dist/server/oracle/redis-cache-manager/game.progress.js +27 -0
- package/dist/server/oracle/redis-cache-manager/game.progress.js.map +1 -0
- package/dist/server/oracle/redis-cache-manager/index.d.ts +1 -0
- package/dist/server/oracle/redis-cache-manager/index.js +1 -0
- package/dist/server/oracle/redis-cache-manager/index.js.map +1 -1
- package/dist/server/oracle/types/providers/game-clock/index.d.ts +1 -1
- package/dist/server/oracle/types/providers/game-clock/index.js +1 -1
- package/dist/server/oracle/types/providers/game-clock/index.js.map +1 -1
- package/dist/server/utils/game_progress/caclulate.game.progress.d.ts +6 -0
- package/dist/server/utils/game_progress/caclulate.game.progress.js +96 -0
- package/dist/server/utils/game_progress/caclulate.game.progress.js.map +1 -0
- package/dist/server/utils/game_progress/game.utils.d.ts +2 -0
- package/dist/server/utils/game_progress/game.utils.js +64 -0
- package/dist/server/utils/game_progress/game.utils.js.map +1 -0
- package/dist/server/utils/game_progress/index.d.ts +3 -0
- package/dist/server/utils/game_progress/index.js +20 -0
- package/dist/server/utils/game_progress/index.js.map +1 -0
- package/dist/server/{oracle/types/providers/game-clock → utils/game_progress}/parser.d.ts +1 -7
- package/dist/server/{oracle/types/providers/game-clock → utils/game_progress}/parser.js +2 -13
- package/dist/server/utils/game_progress/parser.js.map +1 -0
- package/dist/server/utils/index.d.ts +1 -0
- package/dist/server/utils/index.js +1 -0
- package/dist/server/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/server/oracle/types/providers/game-clock/parser.js.map +0 -1
package/dist/core/config/urls.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.allUrls = {
|
|
|
9
9
|
auth: "https://auth-api.dev.levr.bet",
|
|
10
10
|
oracleCore: "https://oracle-core.dev.levr.bet",
|
|
11
11
|
oraclePeriphery: "https://oracle-periphery.dev.levr.bet",
|
|
12
|
-
oracleProcessors: "https://oracle-
|
|
12
|
+
oracleProcessors: "https://oracle-processor.dev.levr.bet",
|
|
13
13
|
relayer: "https://relayers.dev.levr.bet",
|
|
14
14
|
referrals: "https://referrals.dev.levr.bet",
|
|
15
15
|
liquidationEngine: "https://liquidation-engine.dev.levr.bet",
|
|
@@ -24,7 +24,7 @@ exports.allUrls = {
|
|
|
24
24
|
auth: "https://auth-api.dev.levr.bet",
|
|
25
25
|
oracleCore: "https://oracle-core.dev.levr.bet",
|
|
26
26
|
oraclePeriphery: "https://oracle-periphery.dev.levr.bet",
|
|
27
|
-
oracleProcessors: "https://oracle-
|
|
27
|
+
oracleProcessors: "https://oracle-processor.dev.levr.bet",
|
|
28
28
|
relayer: "https://relayers.dev.levr.bet", //http://levr-v1-openzeppeline-1018367603.ap-south-1.elb.amazonaws.com",
|
|
29
29
|
referrals: "https://referrals.dev.levr.bet",
|
|
30
30
|
liquidationEngine: "https://liquidation-engine.dev.levr.bet",
|
|
@@ -39,7 +39,7 @@ exports.allUrls = {
|
|
|
39
39
|
auth: "https://auth-api.staging.levr.bet/",
|
|
40
40
|
oracleCore: "https://oracle-core.staging.levr.bet",
|
|
41
41
|
oraclePeriphery: "https://oracle-periphery.staging.levr.bet",
|
|
42
|
-
oracleProcessors: "https://oracle-
|
|
42
|
+
oracleProcessors: "https://oracle-processor.staging.levr.bet",
|
|
43
43
|
relayer: "https://relayers.staging.levr.bet",
|
|
44
44
|
referrals: "https://referrals.staging.levr.bet",
|
|
45
45
|
liquidationEngine: "https://liquidation-engine.dev.levr.bet",
|
|
@@ -54,7 +54,7 @@ exports.allUrls = {
|
|
|
54
54
|
auth: "https://auth-api.levr.bet",
|
|
55
55
|
oracleCore: "https://oracle-core.levr.app",
|
|
56
56
|
oraclePeriphery: "https://oracle-periphery.levr.app",
|
|
57
|
-
oracleProcessors: "https://oracle-
|
|
57
|
+
oracleProcessors: "https://oracle-processor.levr.app",
|
|
58
58
|
relayer: "https://relayers.levr.app",
|
|
59
59
|
referrals: "https://referrals.levr.app",
|
|
60
60
|
liquidationEngine: "https://liquidation-engine.dev.levr.bet",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../../../src/core/config/urls.ts"],"names":[],"mappings":";;;AAAA,oCAA6C;AAC7C,4DAAqD;AAErD,sBAAsB;AAET,QAAA,OAAO,GAAG;IACnB,CAAC,eAAO,CAAC,KAAK,CAAC,EAAE;QACb,IAAI,EAAE,+BAA+B;QACrC,UAAU,EAAE,kCAAkC;QAC9C,eAAe,EAAE,uCAAuC;QACxD,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../../../src/core/config/urls.ts"],"names":[],"mappings":";;;AAAA,oCAA6C;AAC7C,4DAAqD;AAErD,sBAAsB;AAET,QAAA,OAAO,GAAG;IACnB,CAAC,eAAO,CAAC,KAAK,CAAC,EAAE;QACb,IAAI,EAAE,+BAA+B;QACrC,UAAU,EAAE,kCAAkC;QAC9C,eAAe,EAA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AI,EAAE,4BAAW,CAAC,QAAQ,EAAE,GAAG,EAAE,kCAAkC,EAAE;aAC1E;SACJ;KACJ;IACD,CAAC,eAAO,CAAC,IAAI,CAAC,EAAE;QACZ,IAAI,EAAE,2BAA2B;QACjC,UAAU,EAAE,8BAA8B;QAC1C,eAAe,EAAE,mCAAmC;QACpD,gBAAgB,EAAE,mCAAmC;QACrD,OAAO,EAAE,2BAA2B;QACpC,SAAS,EAAE,4BAA4B;QACvC,iBAAiB,EAAE,yCAAyC;QAC5D,QAAQ,EAAE;YACN,CAAC,iBAAS,CAAC,aAAa,CAAC,EAAE;gBACvB,EAAE,IAAI,EAAE,4BAAW,CAAC,KAAK,EAAE,GAAG,EAAE,0BAA0B,EAAE;gBAC5D,EAAE,IAAI,EAAE,4BAAW,CAAC,QAAQ,EAAE,GAAG,EAAE,0BAA0B,EAAE;aAClE;SACJ;KACJ;CACJ,CAAA"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { SportGroup } from "@prisma/client";
|
|
2
1
|
export declare const calculatePrice: (americanOdds: number, normalizationFactor: number) => number;
|
|
3
2
|
export declare const calculateAmericanOdds: (price: number, normalizationFactor?: number) => string;
|
|
4
|
-
export declare const getGameProgressBPS: (gameClock: string, totalPeriodDurationInSeconds: number, period: number, totalPeriods: number, sportGroup: SportGroup) => number | null;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const client_1 = require("@prisma/client");
|
|
3
|
+
exports.calculateAmericanOdds = exports.calculatePrice = void 0;
|
|
5
4
|
const calculatePrice = (americanOdds, normalizationFactor) => {
|
|
6
5
|
const decimalOdds = americanOdds > 0 ? americanOdds / 100 + 1 : 100 / Math.abs(americanOdds) + 1;
|
|
7
6
|
return Number((normalizationFactor / decimalOdds).toFixed(4));
|
|
@@ -22,71 +21,4 @@ const calculateAmericanOdds = (price, normalizationFactor = 1) => {
|
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
23
|
exports.calculateAmericanOdds = calculateAmericanOdds;
|
|
25
|
-
// Game progress calculation utilities
|
|
26
|
-
const parseGameClockToSeconds = (gameClock) => {
|
|
27
|
-
const [rawMinutes, rawSeconds] = gameClock.split(":");
|
|
28
|
-
const minutes = Number(rawMinutes);
|
|
29
|
-
const seconds = Number(rawSeconds);
|
|
30
|
-
if (isNaN(minutes) || isNaN(seconds))
|
|
31
|
-
return null;
|
|
32
|
-
return minutes * 60 + seconds;
|
|
33
|
-
};
|
|
34
|
-
const calculateGameProgressBPSWithPeriodsOnly = (period, totalPeriods) => {
|
|
35
|
-
if (period > totalPeriods)
|
|
36
|
-
return 1e4;
|
|
37
|
-
const progress = period / totalPeriods;
|
|
38
|
-
return Math.round(progress * 1e4);
|
|
39
|
-
};
|
|
40
|
-
//{ totalPeriods: 2, totalPeriodDurationInSeconds: 45 * 60 },
|
|
41
|
-
// gameClock: '57:20',
|
|
42
|
-
//levr-v1-dev-oracle-core | gamePeriod: 20,
|
|
43
|
-
const calculateGameProgressBPS = (elapsedSeconds, totalPeriodDurationInSeconds, totalPeriods, period) => {
|
|
44
|
-
if (totalPeriodDurationInSeconds === 0)
|
|
45
|
-
return 0;
|
|
46
|
-
if (elapsedSeconds > totalPeriodDurationInSeconds)
|
|
47
|
-
elapsedSeconds = totalPeriodDurationInSeconds;
|
|
48
|
-
const progress = elapsedSeconds / totalPeriodDurationInSeconds;
|
|
49
|
-
const periodsPassed = period - 1;
|
|
50
|
-
const pastProgress = calculateGameProgressBPSWithPeriodsOnly(periodsPassed, totalPeriods);
|
|
51
|
-
const currentPeriodProgress = (progress * 1e4) / totalPeriods;
|
|
52
|
-
const value = Math.round(pastProgress + currentPeriodProgress);
|
|
53
|
-
//TODO: revise time tracking
|
|
54
|
-
if (value > 1e4 || value < 0)
|
|
55
|
-
return 5e3;
|
|
56
|
-
return value;
|
|
57
|
-
};
|
|
58
|
-
// Example: { totalPeriods: 2, totalPeriodDurationInSeconds: 45 * 60 }, gameClock: '57:20', period: 2
|
|
59
|
-
// gameClock is cumulative (57:20 = 57 mins into game, which is 12:20 into period 2)
|
|
60
|
-
// Expected: elapsedInPeriod = 3440 - 2700 = 740 seconds → ~63.7% game progress
|
|
61
|
-
const calculateGameProgressBPSWithGameClockCountUp = (gameClock, totalPeriodDurationInSeconds, totalPeriods, period) => {
|
|
62
|
-
const cumulativeElapsedSeconds = parseGameClockToSeconds(gameClock);
|
|
63
|
-
if (cumulativeElapsedSeconds === null)
|
|
64
|
-
return null;
|
|
65
|
-
// Subtract time from previous periods since gameClock is cumulative
|
|
66
|
-
const previousPeriodsSeconds = (period - 1) * totalPeriodDurationInSeconds;
|
|
67
|
-
const elapsedSecondsInCurrentPeriod = cumulativeElapsedSeconds - previousPeriodsSeconds;
|
|
68
|
-
return calculateGameProgressBPS(elapsedSecondsInCurrentPeriod, totalPeriodDurationInSeconds, totalPeriods, period);
|
|
69
|
-
};
|
|
70
|
-
const calculateGameProgressBPSWithGameClockCountDown = (gameClock, totalPeriodDurationInSeconds, totalPeriods, period) => {
|
|
71
|
-
const remainingSeconds = parseGameClockToSeconds(gameClock);
|
|
72
|
-
if (remainingSeconds === null)
|
|
73
|
-
return null;
|
|
74
|
-
const elapsedSeconds = totalPeriodDurationInSeconds - remainingSeconds;
|
|
75
|
-
return calculateGameProgressBPS(elapsedSeconds, totalPeriodDurationInSeconds, totalPeriods, period);
|
|
76
|
-
};
|
|
77
|
-
const getGameProgressBPS = (gameClock, totalPeriodDurationInSeconds, period, totalPeriods, sportGroup) => {
|
|
78
|
-
switch (sportGroup) {
|
|
79
|
-
case client_1.SportGroup.Soccer:
|
|
80
|
-
return calculateGameProgressBPSWithGameClockCountUp(gameClock, totalPeriodDurationInSeconds, totalPeriods, period);
|
|
81
|
-
case client_1.SportGroup.Basketball:
|
|
82
|
-
return calculateGameProgressBPSWithGameClockCountDown(gameClock, totalPeriodDurationInSeconds, totalPeriods, period);
|
|
83
|
-
case client_1.SportGroup.Football:
|
|
84
|
-
return calculateGameProgressBPSWithGameClockCountDown(gameClock, totalPeriodDurationInSeconds, totalPeriods, period);
|
|
85
|
-
case client_1.SportGroup.Baseball:
|
|
86
|
-
return calculateGameProgressBPSWithPeriodsOnly(period, totalPeriods);
|
|
87
|
-
default:
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
exports.getGameProgressBPS = getGameProgressBPS;
|
|
92
24
|
//# sourceMappingURL=game.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game.utils.js","sourceRoot":"","sources":["../../../src/core/utils/game.utils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"game.utils.js","sourceRoot":"","sources":["../../../src/core/utils/game.utils.ts"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,CAAC,YAAoB,EAAE,mBAA2B,EAAU,EAAE;IACxF,MAAM,WAAW,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAChG,OAAO,MAAM,CAAC,CAAC,mBAAmB,GAAG,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AACjE,CAAC,CAAA;AAHY,QAAA,cAAc,kBAG1B;AAEM,MAAM,qBAAqB,GAAG,CAAC,KAAa,EAAE,mBAAmB,GAAG,CAAC,EAAU,EAAE;IACpF,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAC5B,IAAI,CAAC;QACD,MAAM,WAAW,GAAG,mBAAmB,GAAG,KAAK,CAAA;QAC/C,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,GAAG,KAAK,CAAA;QAEhE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAA;QAE5G,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAA;IAC7D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAA;QACrD,OAAO,IAAI,CAAA;IACf,CAAC;AACL,CAAC,CAAA;AAbY,QAAA,qBAAqB,yBAajC"}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.LSPORTS_NCAA_PERIODS = exports.LSPORTS_AMERICAN_FOOTBALL_PERIODS = exports.LSPORTS_BASEBALL_PERIODS = exports.LSPORTS_BASKETBALL_PERIODS = exports.LSPORTS_SOCCER_PERIODS = void 0;
|
|
7
7
|
exports.LSPORTS_SOCCER_PERIODS = {
|
|
8
|
-
FIRST_HALF: 10, // regular
|
|
9
|
-
SECOND_HALF: 20, // regular
|
|
10
|
-
THIRD_HALF: 25, // extra time // how is this treated?
|
|
8
|
+
FIRST_HALF: 10, // regular 1, = 44 minutes // maximum
|
|
9
|
+
SECOND_HALF: 20, // regular 2, = 45 minutes
|
|
10
|
+
THIRD_HALF: 25, // extra time // how is this treated? // 15 minutes?
|
|
11
11
|
OVERTIME_FIRST_HALF: 30, // extra time is it a full cycle period?
|
|
12
12
|
OVERTIME_SECOND_HALF: 35, // extra time is it a full cycle period?
|
|
13
13
|
PENALTIES: 50, // full cycle, considered 100% or almost 100% game progress
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsports.periods.js","sourceRoot":"","sources":["../../../../../../src/server/oracle/config/game-periods/providers/lsports.periods.ts"],"names":[],"mappings":";AAAA;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"lsports.periods.js","sourceRoot":"","sources":["../../../../../../src/server/oracle/config/game-periods/providers/lsports.periods.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGU,QAAA,sBAAsB,GAAG;IAClC,UAAU,EAAE,EAAE,EAAE,wCAAwC;IACxD,WAAW,EAAE,EAAE,EAAE,2BAA2B;IAE5C,UAAU,EAAE,EAAE,EAAE,oDAAoD;IACpE,mBAAmB,EAAE,EAAE,EAAE,wCAAwC;IACjE,oBAAoB,EAAE,EAAE,EAAE,wCAAwC;IAClE,SAAS,EAAE,EAAE,EAAE,2DAA2D;IAC1E,IAAI,EAAE,EAAE,EAAE,wBAAwB;IAClC,SAAS,EAAE,GAAG,EAAE,2CAA2C;IAC3D,wBAAwB,EAAE,GAAG,EAAE,2CAA2C;IAC1E,yBAAyB,EAAE,GAAG,EAAE,2CAA2C;CACrE,CAAA;AAGG,QAAA,0BAA0B,GAAG;IACtC,aAAa,EAAE,CAAC,EAAE,UAAU;IAC5B,cAAc,EAAE,CAAC,EAAE,UAAU;IAC7B,aAAa,EAAE,CAAC,EAAE,UAAU;IAC5B,cAAc,EAAE,CAAC,EAAE,UAAU;IAC7B,QAAQ,EAAE,EAAE,EAAE,2DAA2D;IACzE,SAAS,EAAE,GAAG,EAAE,2CAA2C;IAC3D,wBAAwB,EAAE,GAAG,EAAE,2CAA2C;CACpE,CAAA;AAEG,QAAA,wBAAwB,GAAG;IACpC,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,SAAS,EAAE,GAAG,EAAE,2CAA2C;IAC3D,0BAA0B,EAAE,GAAG,EAAE,2CAA2C;CACtE,CAAA;AAEG,QAAA,iCAAiC,GAAG;IAC7C,aAAa,EAAE,CAAC;IAChB,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,cAAc,EAAE,CAAC;IACjB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,GAAG;IACd,wBAAwB,EAAE,GAAG;CACvB,CAAA;AAEV,sDAAsD;AACzC,QAAA,oBAAoB,GAAG;IAChC,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,SAAS,EAAE,GAAG;IACd,wBAAwB,EAAE,GAAG;IAC7B,QAAQ,EAAE,EAAE;CACN,CAAA"}
|
|
@@ -2,7 +2,30 @@
|
|
|
2
2
|
* OpticOdds provider period constants by sport
|
|
3
3
|
* TODO: Add period mappings when OpticOdds integration is complete
|
|
4
4
|
*/
|
|
5
|
-
export declare const OPTIC_ODDS_SOCCER_PERIODS: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export declare const OPTIC_ODDS_SOCCER_PERIODS: {
|
|
6
|
+
readonly FIRST_HALF: 1;
|
|
7
|
+
readonly SECOND_HALF: 2;
|
|
8
|
+
};
|
|
9
|
+
export declare const OPTIC_ODDS_BASKETBALL_PERIODS: {
|
|
10
|
+
readonly FIRST_QUARTER: 1;
|
|
11
|
+
readonly SECOND_QUARTER: 2;
|
|
12
|
+
readonly THIRD_QUARTER: 3;
|
|
13
|
+
readonly FOURTH_QUARTER: 4;
|
|
14
|
+
};
|
|
15
|
+
export declare const OPTIC_ODDS_BASEBALL_PERIODS: {
|
|
16
|
+
readonly FIRST_INNING: 1;
|
|
17
|
+
readonly SECOND_INNING: 2;
|
|
18
|
+
readonly THIRD_INNING: 3;
|
|
19
|
+
readonly FOURTH_INNING: 4;
|
|
20
|
+
readonly FIFTH_INNING: 5;
|
|
21
|
+
readonly SIXTH_INNING: 6;
|
|
22
|
+
readonly SEVENTH_INNING: 7;
|
|
23
|
+
readonly EIGHTH_INNING: 8;
|
|
24
|
+
readonly NINTH_INNING: 9;
|
|
25
|
+
};
|
|
26
|
+
export declare const OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS: {
|
|
27
|
+
readonly FIRST_QUARTER: 1;
|
|
28
|
+
readonly SECOND_QUARTER: 2;
|
|
29
|
+
readonly THIRD_QUARTER: 3;
|
|
30
|
+
readonly FOURTH_QUARTER: 4;
|
|
31
|
+
};
|
|
@@ -5,8 +5,31 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS = exports.OPTIC_ODDS_BASEBALL_PERIODS = exports.OPTIC_ODDS_BASKETBALL_PERIODS = exports.OPTIC_ODDS_SOCCER_PERIODS = void 0;
|
|
8
|
-
exports.OPTIC_ODDS_SOCCER_PERIODS = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
exports.OPTIC_ODDS_SOCCER_PERIODS = {
|
|
9
|
+
FIRST_HALF: 1,
|
|
10
|
+
SECOND_HALF: 2,
|
|
11
|
+
};
|
|
12
|
+
exports.OPTIC_ODDS_BASKETBALL_PERIODS = {
|
|
13
|
+
FIRST_QUARTER: 1,
|
|
14
|
+
SECOND_QUARTER: 2,
|
|
15
|
+
THIRD_QUARTER: 3,
|
|
16
|
+
FOURTH_QUARTER: 4,
|
|
17
|
+
};
|
|
18
|
+
exports.OPTIC_ODDS_BASEBALL_PERIODS = {
|
|
19
|
+
FIRST_INNING: 1,
|
|
20
|
+
SECOND_INNING: 2,
|
|
21
|
+
THIRD_INNING: 3,
|
|
22
|
+
FOURTH_INNING: 4,
|
|
23
|
+
FIFTH_INNING: 5,
|
|
24
|
+
SIXTH_INNING: 6,
|
|
25
|
+
SEVENTH_INNING: 7,
|
|
26
|
+
EIGHTH_INNING: 8,
|
|
27
|
+
NINTH_INNING: 9,
|
|
28
|
+
};
|
|
29
|
+
exports.OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS = {
|
|
30
|
+
FIRST_QUARTER: 1,
|
|
31
|
+
SECOND_QUARTER: 2,
|
|
32
|
+
THIRD_QUARTER: 3,
|
|
33
|
+
FOURTH_QUARTER: 4,
|
|
34
|
+
};
|
|
12
35
|
//# sourceMappingURL=optic-odds.periods.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optic-odds.periods.js","sourceRoot":"","sources":["../../../../../../src/server/oracle/config/game-periods/providers/optic-odds.periods.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,yBAAyB,GAAG,
|
|
1
|
+
{"version":3,"file":"optic-odds.periods.js","sourceRoot":"","sources":["../../../../../../src/server/oracle/config/game-periods/providers/optic-odds.periods.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,yBAAyB,GAAG;IACrC,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;CACR,CAAA;AAEG,QAAA,6BAA6B,GAAG;IACzC,aAAa,EAAE,CAAC;IAChB,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,cAAc,EAAE,CAAC;CACX,CAAA;AAEG,QAAA,2BAA2B,GAAG;IACvC,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;CACT,CAAA;AAEG,QAAA,oCAAoC,GAAG;IAChD,aAAa,EAAE,CAAC;IAChB,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,cAAc,EAAE,CAAC;CACX,CAAA"}
|
|
@@ -3,12 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SportsGamePeriodClockConfig = void 0;
|
|
4
4
|
const client_1 = require("@prisma/client");
|
|
5
5
|
const providers_1 = require("./providers");
|
|
6
|
+
const core_1 = require("../../../../core");
|
|
6
7
|
/**
|
|
7
8
|
* Main configuration for game periods and clock behavior by sport and provider
|
|
8
9
|
*/
|
|
9
10
|
exports.SportsGamePeriodClockConfig = {
|
|
10
11
|
[client_1.SportGroup.Basketball]: {
|
|
11
|
-
|
|
12
|
+
totalPeriodDurationInSeconds: 720, // 12 minutes per quarter
|
|
13
|
+
totalPeriods: 4,
|
|
14
|
+
[core_1.OddsServices.LSPORTS]: {
|
|
12
15
|
sportPeriods: {
|
|
13
16
|
regular: [
|
|
14
17
|
providers_1.LSPORTS_BASKETBALL_PERIODS.FIRST_QUARTER,
|
|
@@ -22,13 +25,29 @@ exports.SportsGamePeriodClockConfig = {
|
|
|
22
25
|
providers_1.LSPORTS_BASKETBALL_PERIODS.FULL_TIME_AFTER_OVERTIME,
|
|
23
26
|
],
|
|
24
27
|
extraTime: [providers_1.LSPORTS_BASKETBALL_PERIODS.OVERTIME],
|
|
28
|
+
countUpClock: false,
|
|
29
|
+
},
|
|
30
|
+
leaguePeriods: null,
|
|
31
|
+
},
|
|
32
|
+
[core_1.OddsServices.OPTIC_ODDS]: {
|
|
33
|
+
sportPeriods: {
|
|
34
|
+
regular: [
|
|
35
|
+
providers_1.OPTIC_ODDS_BASKETBALL_PERIODS.FIRST_QUARTER,
|
|
36
|
+
providers_1.OPTIC_ODDS_BASKETBALL_PERIODS.SECOND_QUARTER,
|
|
37
|
+
providers_1.OPTIC_ODDS_BASKETBALL_PERIODS.THIRD_QUARTER,
|
|
38
|
+
providers_1.OPTIC_ODDS_BASKETBALL_PERIODS.FOURTH_QUARTER,
|
|
39
|
+
],
|
|
40
|
+
fullCycle: [],
|
|
41
|
+
extraTime: [],
|
|
42
|
+
countUpClock: true,
|
|
25
43
|
},
|
|
26
44
|
leaguePeriods: null,
|
|
27
45
|
},
|
|
28
|
-
opticOdds: {},
|
|
29
46
|
},
|
|
30
47
|
[client_1.SportGroup.Soccer]: {
|
|
31
|
-
|
|
48
|
+
totalPeriodDurationInSeconds: 2700, // 45 minutes per half
|
|
49
|
+
totalPeriods: 2,
|
|
50
|
+
[core_1.OddsServices.LSPORTS]: {
|
|
32
51
|
sportPeriods: {
|
|
33
52
|
regular: [providers_1.LSPORTS_SOCCER_PERIODS.FIRST_HALF, providers_1.LSPORTS_SOCCER_PERIODS.SECOND_HALF],
|
|
34
53
|
fullCycle: [
|
|
@@ -42,13 +61,24 @@ exports.SportsGamePeriodClockConfig = {
|
|
|
42
61
|
providers_1.LSPORTS_SOCCER_PERIODS.OVERTIME_FIRST_HALF,
|
|
43
62
|
providers_1.LSPORTS_SOCCER_PERIODS.OVERTIME_SECOND_HALF,
|
|
44
63
|
],
|
|
64
|
+
countUpClock: true,
|
|
65
|
+
},
|
|
66
|
+
leaguePeriods: null,
|
|
67
|
+
},
|
|
68
|
+
[core_1.OddsServices.OPTIC_ODDS]: {
|
|
69
|
+
sportPeriods: {
|
|
70
|
+
regular: [providers_1.OPTIC_ODDS_SOCCER_PERIODS.FIRST_HALF, providers_1.OPTIC_ODDS_SOCCER_PERIODS.SECOND_HALF],
|
|
71
|
+
fullCycle: [],
|
|
72
|
+
extraTime: [],
|
|
73
|
+
countUpClock: true,
|
|
45
74
|
},
|
|
46
75
|
leaguePeriods: null,
|
|
47
76
|
},
|
|
48
|
-
opticOdds: {},
|
|
49
77
|
},
|
|
50
78
|
[client_1.SportGroup.Baseball]: {
|
|
51
|
-
|
|
79
|
+
totalPeriodDurationInSeconds: 1200, // Approximate 20 minutes per inning
|
|
80
|
+
totalPeriods: 9,
|
|
81
|
+
[core_1.OddsServices.LSPORTS]: {
|
|
52
82
|
sportPeriods: {
|
|
53
83
|
regular: [
|
|
54
84
|
providers_1.LSPORTS_BASEBALL_PERIODS.FIRST_INNING,
|
|
@@ -63,13 +93,34 @@ exports.SportsGamePeriodClockConfig = {
|
|
|
63
93
|
],
|
|
64
94
|
fullCycle: [providers_1.LSPORTS_BASEBALL_PERIODS.FULL_TIME, providers_1.LSPORTS_BASEBALL_PERIODS.FULL_TIME_AFTER_EXTRA_TIME],
|
|
65
95
|
extraTime: [providers_1.LSPORTS_BASEBALL_PERIODS.EXTRA_INNINGS],
|
|
96
|
+
countUpClock: true,
|
|
97
|
+
},
|
|
98
|
+
leaguePeriods: null,
|
|
99
|
+
},
|
|
100
|
+
[core_1.OddsServices.OPTIC_ODDS]: {
|
|
101
|
+
sportPeriods: {
|
|
102
|
+
regular: [
|
|
103
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.FIRST_INNING,
|
|
104
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.SECOND_INNING,
|
|
105
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.THIRD_INNING,
|
|
106
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.FOURTH_INNING,
|
|
107
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.FIFTH_INNING,
|
|
108
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.SIXTH_INNING,
|
|
109
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.SEVENTH_INNING,
|
|
110
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.EIGHTH_INNING,
|
|
111
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.NINTH_INNING,
|
|
112
|
+
],
|
|
113
|
+
fullCycle: [],
|
|
114
|
+
extraTime: [],
|
|
115
|
+
countUpClock: true,
|
|
66
116
|
},
|
|
67
117
|
leaguePeriods: null,
|
|
68
118
|
},
|
|
69
|
-
opticOdds: {},
|
|
70
119
|
},
|
|
71
120
|
[client_1.SportGroup.Football]: {
|
|
72
|
-
|
|
121
|
+
totalPeriodDurationInSeconds: 900, // 15 minutes per quarter
|
|
122
|
+
totalPeriods: 4,
|
|
123
|
+
[core_1.OddsServices.LSPORTS]: {
|
|
73
124
|
sportPeriods: {
|
|
74
125
|
regular: [
|
|
75
126
|
providers_1.LSPORTS_AMERICAN_FOOTBALL_PERIODS.FIRST_QUARTER,
|
|
@@ -82,10 +133,24 @@ exports.SportsGamePeriodClockConfig = {
|
|
|
82
133
|
providers_1.LSPORTS_AMERICAN_FOOTBALL_PERIODS.FULL_TIME_AFTER_OVERTIME,
|
|
83
134
|
],
|
|
84
135
|
extraTime: [providers_1.LSPORTS_AMERICAN_FOOTBALL_PERIODS.OVERTIME],
|
|
136
|
+
countUpClock: false,
|
|
137
|
+
},
|
|
138
|
+
leaguePeriods: null,
|
|
139
|
+
},
|
|
140
|
+
[core_1.OddsServices.OPTIC_ODDS]: {
|
|
141
|
+
sportPeriods: {
|
|
142
|
+
regular: [
|
|
143
|
+
providers_1.OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS.FIRST_QUARTER,
|
|
144
|
+
providers_1.OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS.SECOND_QUARTER,
|
|
145
|
+
providers_1.OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS.THIRD_QUARTER,
|
|
146
|
+
providers_1.OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS.FOURTH_QUARTER,
|
|
147
|
+
],
|
|
148
|
+
fullCycle: [],
|
|
149
|
+
extraTime: [],
|
|
150
|
+
countUpClock: true,
|
|
85
151
|
},
|
|
86
152
|
leaguePeriods: null,
|
|
87
153
|
},
|
|
88
|
-
opticOdds: {},
|
|
89
154
|
},
|
|
90
155
|
};
|
|
91
156
|
//# sourceMappingURL=sports.config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sports.config.js","sourceRoot":"","sources":["../../../../../src/server/oracle/config/game-periods/sports.config.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE3C,
|
|
1
|
+
{"version":3,"file":"sports.config.js","sourceRoot":"","sources":["../../../../../src/server/oracle/config/game-periods/sports.config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
1
1
|
import { SportGroup } from "@prisma/client";
|
|
2
|
+
import { OddsServices } from "../../../../core";
|
|
2
3
|
/**
|
|
3
4
|
* Period configuration for a specific sport or league
|
|
4
5
|
*/
|
|
@@ -9,6 +10,7 @@ export interface PeriodConfig {
|
|
|
9
10
|
fullCycle: number[];
|
|
10
11
|
/** Extra time / overtime periods */
|
|
11
12
|
extraTime: number[];
|
|
13
|
+
countUpClock: boolean;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Provider-specific period configuration
|
|
@@ -25,8 +27,10 @@ export interface ProviderPeriodConfig {
|
|
|
25
27
|
* Complete period configuration for all providers
|
|
26
28
|
*/
|
|
27
29
|
export interface SportPeriodClockConfig {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
totalPeriods: number;
|
|
31
|
+
totalPeriodDurationInSeconds: number;
|
|
32
|
+
[OddsServices.LSPORTS]: ProviderPeriodConfig;
|
|
33
|
+
[OddsServices.OPTIC_ODDS]: ProviderPeriodConfig;
|
|
30
34
|
}
|
|
31
35
|
/**
|
|
32
36
|
* Main configuration type mapping sport groups to their period configs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/server/oracle/config/game-periods/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/server/oracle/config/game-periods/types.ts"],"names":[],"mappings":";;AACA,2CAA+C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import Redis from "ioredis";
|
|
2
|
+
export declare const saveGameProgressToCache: (gameObjectId: string, progressBPS: number, redisClient: Redis) => Promise<void>;
|
|
3
|
+
export declare const getAllGameProgressFromCache: (gameObjectId: string, redisClient: Redis) => Promise<number[]>;
|
|
4
|
+
export declare const getLatestGameProgressFromCache: (gameObjectId: string, redisClient: Redis) => Promise<number | null>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLatestGameProgressFromCache = exports.getAllGameProgressFromCache = exports.saveGameProgressToCache = void 0;
|
|
4
|
+
const cacheKey = `game-progress:test:`;
|
|
5
|
+
const getCacheKey = (gameObjectId) => {
|
|
6
|
+
return `${cacheKey}${gameObjectId}`;
|
|
7
|
+
};
|
|
8
|
+
const saveGameProgressToCache = async (gameObjectId, progressBPS, redisClient) => {
|
|
9
|
+
const cacheKey = getCacheKey(gameObjectId);
|
|
10
|
+
await redisClient.lpush(cacheKey, progressBPS.toString());
|
|
11
|
+
};
|
|
12
|
+
exports.saveGameProgressToCache = saveGameProgressToCache;
|
|
13
|
+
const getAllGameProgressFromCache = async (gameObjectId, redisClient) => {
|
|
14
|
+
const cacheKey = getCacheKey(gameObjectId);
|
|
15
|
+
const results = await redisClient.lrange(cacheKey, 0, -1);
|
|
16
|
+
return results.map((val) => parseInt(val, 10));
|
|
17
|
+
};
|
|
18
|
+
exports.getAllGameProgressFromCache = getAllGameProgressFromCache;
|
|
19
|
+
const getLatestGameProgressFromCache = async (gameObjectId, redisClient) => {
|
|
20
|
+
const cacheKey = getCacheKey(gameObjectId);
|
|
21
|
+
const result = await redisClient.lindex(cacheKey, 0);
|
|
22
|
+
if (result === null)
|
|
23
|
+
return null;
|
|
24
|
+
return parseInt(result, 10);
|
|
25
|
+
};
|
|
26
|
+
exports.getLatestGameProgressFromCache = getLatestGameProgressFromCache;
|
|
27
|
+
//# sourceMappingURL=game.progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game.progress.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/game.progress.ts"],"names":[],"mappings":";;;AAIA,MAAM,QAAQ,GAAG,qBAAqB,CAAA;AAEtC,MAAM,WAAW,GAAG,CAAC,YAAoB,EAAU,EAAE;IACjD,OAAO,GAAG,QAAQ,GAAG,YAAY,EAAE,CAAA;AACvC,CAAC,CAAA;AAEM,MAAM,uBAAuB,GAAG,KAAK,EAAE,YAAoB,EAAE,WAAmB,EAAE,WAAkB,EAAE,EAAE;IAC3G,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;IAC1C,MAAM,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAA;AAC7D,CAAC,CAAA;AAHY,QAAA,uBAAuB,2BAGnC;AAEM,MAAM,2BAA2B,GAAG,KAAK,EAAE,YAAoB,EAAE,WAAkB,EAAqB,EAAE;IAC7G,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;IAC1C,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACzD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAA;AAClD,CAAC,CAAA;AAJY,QAAA,2BAA2B,+BAIvC;AAEM,MAAM,8BAA8B,GAAG,KAAK,EAAE,YAAoB,EAAE,WAAkB,EAA0B,EAAE;IACrH,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;IAC1C,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IACpD,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAChC,OAAO,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAC/B,CAAC,CAAA;AALY,QAAA,8BAA8B,kCAK1C"}
|
|
@@ -18,5 +18,6 @@ __exportStar(require("./cache.keys.utils"), exports);
|
|
|
18
18
|
__exportStar(require("./channels"), exports);
|
|
19
19
|
__exportStar(require("./game.query.engine"), exports);
|
|
20
20
|
__exportStar(require("./leagues.cache.service"), exports);
|
|
21
|
+
__exportStar(require("./game.progress"), exports);
|
|
21
22
|
__exportStar(require("./market.query.engine"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,6CAA0B;AAC1B,sDAAmC;AACnC,0DAAuC;AACvC,wDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,6CAA0B;AAC1B,sDAAmC;AACnC,0DAAuC;AACvC,kDAA+B;AAC/B,wDAAqC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
|
-
export * from "
|
|
2
|
+
export * from "../../../../utils/game_progress/parser";
|
|
@@ -15,5 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./types"), exports);
|
|
18
|
-
__exportStar(require("
|
|
18
|
+
__exportStar(require("../../../../utils/game_progress/parser"), exports);
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/server/oracle/types/providers/game-clock/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/server/oracle/types/providers/game-clock/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,yEAAsD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SportGroup } from "@prisma/client";
|
|
2
|
+
import { OddsServices } from "../../../core";
|
|
3
|
+
export declare const calculateSoccerProgress: (currentPeriod: number, gameClock: string, sportGroup: SportGroup, provider: OddsServices) => number | null;
|
|
4
|
+
export declare const calculateBasketballProgress: (currentPeriod: number, gameClock: string, sportGroup: SportGroup, provider: OddsServices) => number | null;
|
|
5
|
+
export declare const calculateFootballProgress: (currentPeriod: number, gameClock: string, sportGroup: SportGroup, provider: OddsServices) => number | null;
|
|
6
|
+
export declare const calculateBaseballProgress: (currentPeriod: number, gameClock: string, sportGroup: SportGroup, provider: OddsServices) => number | null;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateBaseballProgress = exports.calculateFootballProgress = exports.calculateBasketballProgress = exports.calculateSoccerProgress = void 0;
|
|
4
|
+
const client_1 = require("@prisma/client");
|
|
5
|
+
const game_utils_1 = require("../game_progress/game.utils");
|
|
6
|
+
const parser_1 = require("./parser");
|
|
7
|
+
const oracle_1 = require("../../oracle");
|
|
8
|
+
const core_1 = require("../../../core");
|
|
9
|
+
const PERIOD_MAPPERS = {
|
|
10
|
+
[core_1.OddsServices.LSPORTS]: {
|
|
11
|
+
[client_1.SportGroup.Soccer]: (currentPeriod) => {
|
|
12
|
+
if (currentPeriod === 10)
|
|
13
|
+
return 1;
|
|
14
|
+
if (currentPeriod === 20)
|
|
15
|
+
return 2;
|
|
16
|
+
return null;
|
|
17
|
+
},
|
|
18
|
+
[client_1.SportGroup.Basketball]: (currentPeriod, totalPeriods) => {
|
|
19
|
+
if (currentPeriod >= 1 && currentPeriod <= totalPeriods)
|
|
20
|
+
return currentPeriod;
|
|
21
|
+
return null;
|
|
22
|
+
},
|
|
23
|
+
[client_1.SportGroup.Football]: (currentPeriod, totalPeriods) => {
|
|
24
|
+
if (currentPeriod >= 1 && currentPeriod <= totalPeriods)
|
|
25
|
+
return currentPeriod;
|
|
26
|
+
return null;
|
|
27
|
+
},
|
|
28
|
+
[client_1.SportGroup.Baseball]: (currentPeriod, totalPeriods) => {
|
|
29
|
+
if (currentPeriod >= 1 && currentPeriod <= totalPeriods)
|
|
30
|
+
return currentPeriod;
|
|
31
|
+
return null;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
[core_1.OddsServices.OPTIC_ODDS]: {
|
|
35
|
+
[client_1.SportGroup.Soccer]: (currentPeriod, totalPeriods) => {
|
|
36
|
+
if (currentPeriod >= 1 && currentPeriod <= totalPeriods)
|
|
37
|
+
return currentPeriod;
|
|
38
|
+
return null;
|
|
39
|
+
},
|
|
40
|
+
[client_1.SportGroup.Basketball]: (currentPeriod, totalPeriods) => {
|
|
41
|
+
if (currentPeriod >= 1 && currentPeriod <= totalPeriods)
|
|
42
|
+
return currentPeriod;
|
|
43
|
+
return null;
|
|
44
|
+
},
|
|
45
|
+
[client_1.SportGroup.Football]: (currentPeriod, totalPeriods) => {
|
|
46
|
+
if (currentPeriod >= 1 && currentPeriod <= totalPeriods)
|
|
47
|
+
return currentPeriod;
|
|
48
|
+
return null;
|
|
49
|
+
},
|
|
50
|
+
[client_1.SportGroup.Baseball]: (currentPeriod, totalPeriods) => {
|
|
51
|
+
if (currentPeriod >= 1 && currentPeriod <= totalPeriods)
|
|
52
|
+
return currentPeriod;
|
|
53
|
+
return null;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
const calculateGameProgress = (currentPeriod, gameClock, sportGroup, provider) => {
|
|
58
|
+
const config = oracle_1.SportsGamePeriodClockConfig[sportGroup];
|
|
59
|
+
if (!config?.[provider].sportPeriods.regular.includes(currentPeriod))
|
|
60
|
+
return null;
|
|
61
|
+
const periodMapper = PERIOD_MAPPERS[provider]?.[sportGroup];
|
|
62
|
+
if (!periodMapper)
|
|
63
|
+
return null;
|
|
64
|
+
const period = periodMapper(currentPeriod, config.totalPeriods);
|
|
65
|
+
if (period === null)
|
|
66
|
+
return null;
|
|
67
|
+
const gameClockInSeconds = (0, parser_1.parseGameClockToSeconds)(gameClock);
|
|
68
|
+
if (gameClockInSeconds === null)
|
|
69
|
+
return null;
|
|
70
|
+
return (0, game_utils_1.getGameProgressBPS)(gameClockInSeconds, config.totalPeriodDurationInSeconds, config.totalPeriods, period, sportGroup, config[provider].sportPeriods.countUpClock);
|
|
71
|
+
};
|
|
72
|
+
const calculateSoccerProgress = (currentPeriod, gameClock, sportGroup, provider) => {
|
|
73
|
+
if (sportGroup !== client_1.SportGroup.Soccer)
|
|
74
|
+
throw new Error("Sport group is not soccer");
|
|
75
|
+
return calculateGameProgress(currentPeriod, gameClock, sportGroup, provider);
|
|
76
|
+
};
|
|
77
|
+
exports.calculateSoccerProgress = calculateSoccerProgress;
|
|
78
|
+
const calculateBasketballProgress = (currentPeriod, gameClock, sportGroup, provider) => {
|
|
79
|
+
if (sportGroup !== client_1.SportGroup.Basketball)
|
|
80
|
+
throw new Error("Sport group is not basketball");
|
|
81
|
+
return calculateGameProgress(currentPeriod, gameClock, sportGroup, provider);
|
|
82
|
+
};
|
|
83
|
+
exports.calculateBasketballProgress = calculateBasketballProgress;
|
|
84
|
+
const calculateFootballProgress = (currentPeriod, gameClock, sportGroup, provider) => {
|
|
85
|
+
if (sportGroup !== client_1.SportGroup.Football)
|
|
86
|
+
throw new Error("Sport group is not football");
|
|
87
|
+
return calculateGameProgress(currentPeriod, gameClock, sportGroup, provider);
|
|
88
|
+
};
|
|
89
|
+
exports.calculateFootballProgress = calculateFootballProgress;
|
|
90
|
+
const calculateBaseballProgress = (currentPeriod, gameClock, sportGroup, provider) => {
|
|
91
|
+
if (sportGroup !== client_1.SportGroup.Baseball)
|
|
92
|
+
throw new Error("Sport group is not baseball");
|
|
93
|
+
return calculateGameProgress(currentPeriod, gameClock, sportGroup, provider);
|
|
94
|
+
};
|
|
95
|
+
exports.calculateBaseballProgress = calculateBaseballProgress;
|
|
96
|
+
//# sourceMappingURL=caclulate.game.progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caclulate.game.progress.js","sourceRoot":"","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,EACjB,UAAsB,EACtB,QAAsB,EACxB,EAAE;IACA,IAAI,UAAU,KAAK,mBAAU,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;IACtF,OAAO,qBAAqB,CAAC,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAA;AAChF,CAAC,CAAA;AARY,QAAA,yBAAyB,6BAQrC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGameProgressBPS = void 0;
|
|
4
|
+
const client_1 = require("@prisma/client");
|
|
5
|
+
const calculateGameProgressBPSWithPeriodsOnly = (period, totalPeriods) => {
|
|
6
|
+
if (period > totalPeriods)
|
|
7
|
+
return 1e4;
|
|
8
|
+
const progress = period / totalPeriods;
|
|
9
|
+
return Math.round(progress * 1e4);
|
|
10
|
+
};
|
|
11
|
+
//{ totalPeriods: 2, totalPeriodDurationInSeconds: 45 * 60 },
|
|
12
|
+
// gameClock: '57:20',
|
|
13
|
+
//levr-v1-dev-oracle-core | gamePeriod: 20,
|
|
14
|
+
const calculateGameProgressBPS = (elapsedSeconds, totalPeriodDurationInSeconds, totalPeriods, period) => {
|
|
15
|
+
if (totalPeriodDurationInSeconds === 0)
|
|
16
|
+
return 0;
|
|
17
|
+
if (elapsedSeconds > totalPeriodDurationInSeconds)
|
|
18
|
+
elapsedSeconds = totalPeriodDurationInSeconds;
|
|
19
|
+
const progress = elapsedSeconds / totalPeriodDurationInSeconds;
|
|
20
|
+
const periodsPassed = period - 1;
|
|
21
|
+
const pastProgress = calculateGameProgressBPSWithPeriodsOnly(periodsPassed, totalPeriods);
|
|
22
|
+
const currentPeriodProgress = (progress * 1e4) / totalPeriods;
|
|
23
|
+
const value = Math.round(pastProgress + currentPeriodProgress);
|
|
24
|
+
//TODO: revise time tracking
|
|
25
|
+
if (value > 1e4)
|
|
26
|
+
return 1e4;
|
|
27
|
+
if (value < 0)
|
|
28
|
+
return 0;
|
|
29
|
+
return value;
|
|
30
|
+
};
|
|
31
|
+
// Example: { totalPeriods: 2, totalPeriodDurationInSeconds: 45 * 60 }, gameClock: '57:20', period: 2
|
|
32
|
+
// gameClock is cumulative (57:20 = 57 mins into game, which is 12:20 into period 2)
|
|
33
|
+
// Expected: elapsedInPeriod = 3440 - 2700 = 740 seconds → ~63.7% game progress
|
|
34
|
+
const calculateGameProgressBPSWithGameClockCountUp = (gameClockInSeconds, totalPeriodDurationInSeconds, totalPeriods, period) => {
|
|
35
|
+
const cumulativeElapsedSeconds = gameClockInSeconds;
|
|
36
|
+
if (cumulativeElapsedSeconds === null)
|
|
37
|
+
return null;
|
|
38
|
+
// Subtract time from previous periods since gameClock is cumulative
|
|
39
|
+
const previousPeriodsSeconds = (period - 1) * totalPeriodDurationInSeconds;
|
|
40
|
+
const elapsedSecondsInCurrentPeriod = cumulativeElapsedSeconds - previousPeriodsSeconds;
|
|
41
|
+
return calculateGameProgressBPS(elapsedSecondsInCurrentPeriod, totalPeriodDurationInSeconds, totalPeriods, period);
|
|
42
|
+
};
|
|
43
|
+
const calculateGameProgressBPSWithGameClockCountDown = (gameClockInSeconds, totalPeriodDurationInSeconds, totalPeriods, period) => {
|
|
44
|
+
const remainingSeconds = gameClockInSeconds;
|
|
45
|
+
if (remainingSeconds === null)
|
|
46
|
+
return null;
|
|
47
|
+
const elapsedSeconds = totalPeriodDurationInSeconds - remainingSeconds;
|
|
48
|
+
return calculateGameProgressBPS(elapsedSeconds, totalPeriodDurationInSeconds, totalPeriods, period);
|
|
49
|
+
};
|
|
50
|
+
const getGameProgressBPS = (gameClockInSeconds, totalPeriodDurationInSeconds, period, totalPeriods, sportGroup, clockCountUp) => {
|
|
51
|
+
switch (sportGroup) {
|
|
52
|
+
case client_1.SportGroup.Baseball:
|
|
53
|
+
return calculateGameProgressBPSWithPeriodsOnly(period, totalPeriods);
|
|
54
|
+
default:
|
|
55
|
+
if (clockCountUp) {
|
|
56
|
+
return calculateGameProgressBPSWithGameClockCountUp(gameClockInSeconds, totalPeriodDurationInSeconds, totalPeriods, period);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return calculateGameProgressBPSWithGameClockCountDown(gameClockInSeconds, totalPeriodDurationInSeconds, totalPeriods, period);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.getGameProgressBPS = getGameProgressBPS;
|
|
64
|
+
//# sourceMappingURL=game.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game.utils.js","sourceRoot":"","sources":["../../../../src/server/utils/game_progress/game.utils.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE3C,MAAM,uCAAuC,GAAG,CAAC,MAAc,EAAE,YAAoB,EAAU,EAAE;IAC7F,IAAI,MAAM,GAAG,YAAY;QAAE,OAAO,GAAG,CAAA;IACrC,MAAM,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAA;IACtC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAA;AACrC,CAAC,CAAA;AAED,6DAA6D;AAC7D,uBAAuB;AACvB,gDAAgD;AAEhD,MAAM,wBAAwB,GAAG,CAC7B,cAAsB,EACtB,4BAAoC,EACpC,YAAoB,EACpB,MAAc,EACD,EAAE;IACf,IAAI,4BAA4B,KAAK,CAAC;QAAE,OAAO,CAAC,CAAA;IAChD,IAAI,cAAc,GAAG,4BAA4B;QAAE,cAAc,GAAG,4BAA4B,CAAA;IAChG,MAAM,QAAQ,GAAG,cAAc,GAAG,4BAA4B,CAAA;IAC9D,MAAM,aAAa,GAAG,MAAM,GAAG,CAAC,CAAA;IAChC,MAAM,YAAY,GAAG,uCAAuC,CAAC,aAAa,EAAE,YAAY,CAAC,CAAA;IACzF,MAAM,qBAAqB,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,YAAY,CAAA;IAC7D,MAAM,KAAK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C,QAAQ;YACpB,OAAO,uCAAuC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;QACxE;YACI,IAAI,YAAY,EAAE,CAAC;gBACf,OAAO,4CAA4C,CAC/C,kBAAkB,EAClB,4BAA4B,EAC5B,YAAY,EACZ,MAAM,CACT,CAAA;YACL,CAAC;iBAAM,CAAC;gBACJ,OAAO,8CAA8C,CACjD,kBAAkB,EAClB,4BAA4B,EAC5B,YAAY,EACZ,MAAM,CACT,CAAA;YACL,CAAC;IACT,CAAC;AACL,CAAC,CAAA;AA5BY,QAAA,kBAAkB,sBA4B9B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./caclulate.game.progress"), exports);
|
|
18
|
+
__exportStar(require("./game.utils"), exports);
|
|
19
|
+
__exportStar(require("./parser"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/utils/game_progress/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAyC;AACzC,+CAA4B;AAC5B,2CAAwB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GameClockPattern } from "
|
|
1
|
+
import { GameClockPattern } from "../../oracle/types/providers/game-clock/types";
|
|
2
2
|
/**
|
|
3
3
|
* Detect the pattern of a game clock string
|
|
4
4
|
* @param gameClock - The game clock string to analyze
|
|
@@ -12,9 +12,3 @@ export declare const detectGameClockPattern: (gameClock: string) => GameClockPat
|
|
|
12
12
|
* @returns Number of seconds, or null if invalid format
|
|
13
13
|
*/
|
|
14
14
|
export declare const parseGameClockToSeconds: (gameClock: string) => number | null;
|
|
15
|
-
/**
|
|
16
|
-
* Format seconds to a clock string (MM:SS)
|
|
17
|
-
* @param totalSeconds - Total seconds to format
|
|
18
|
-
* @returns Formatted clock string
|
|
19
|
-
*/
|
|
20
|
-
export declare const formatSecondsToGameClock: (totalSeconds: number) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const types_1 = require("
|
|
3
|
+
exports.parseGameClockToSeconds = exports.detectGameClockPattern = void 0;
|
|
4
|
+
const types_1 = require("../../oracle/types/providers/game-clock/types");
|
|
5
5
|
/**
|
|
6
6
|
* Regex patterns for different game clock formats
|
|
7
7
|
*/
|
|
@@ -90,15 +90,4 @@ const parseGameClockToSeconds = (gameClock) => {
|
|
|
90
90
|
return null;
|
|
91
91
|
};
|
|
92
92
|
exports.parseGameClockToSeconds = parseGameClockToSeconds;
|
|
93
|
-
/**
|
|
94
|
-
* Format seconds to a clock string (MM:SS)
|
|
95
|
-
* @param totalSeconds - Total seconds to format
|
|
96
|
-
* @returns Formatted clock string
|
|
97
|
-
*/
|
|
98
|
-
const formatSecondsToGameClock = (totalSeconds) => {
|
|
99
|
-
const minutes = Math.floor(totalSeconds / 60);
|
|
100
|
-
const seconds = totalSeconds % 60;
|
|
101
|
-
return `${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
|
|
102
|
-
};
|
|
103
|
-
exports.formatSecondsToGameClock = formatSecondsToGameClock;
|
|
104
93
|
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/server/utils/game_progress/parser.ts"],"names":[],"mappings":";;;AAAA,yEAAgF;AAEhF;;GAEG;AACH,MAAM,cAAc,GAAG;IACnB,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,OAAO;IACnB,aAAa,EAAE,qBAAqB;IACpC,WAAW,EAAE,4BAA4B;IACzC,gBAAgB,EAAE,2BAA2B;CACvC,CAAA;AAEV;;;;GAIG;AACI,MAAM,sBAAsB,GAAG,CAAC,SAAiB,EAAoB,EAAE;IAC1E,IAAI,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACzC,OAAO,wBAAgB,CAAC,cAAc,CAAA;IAC1C,CAAC;IACD,IAAI,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5C,OAAO,wBAAgB,CAAC,UAAU,CAAA;IACtC,CAAC;IACD,IAAI,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/C,OAAO,wBAAgB,CAAC,mBAAmB,CAAA;IAC/C,CAAC;IACD,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7C,OAAO,wBAAgB,CAAC,qBAAqB,CAAA;IACjD,CAAC;IACD,IAAI,cAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAClD,OAAO,wBAAgB,CAAC,0BAA0B,CAAA;IACtD,CAAC;IACD,OAAO,wBAAgB,CAAC,OAAO,CAAA;AACnC,CAAC,CAAA;AAjBY,QAAA,s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,CAAC,CAAA;YACzD,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3B,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;gBACtC,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;gBACtC,OAAO,OAAO,GAAG,EAAE,GAAG,OAAO,CAAA;YACjC,CAAC;YACD,MAAK;QACT,CAAC;QACD,KAAK,wBAAgB,CAAC,0BAA0B,CAAC,CAAC,CAAC;YAC/C,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAA;YAC9D,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3B,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;gBACtC,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;gBACtC,OAAO,OAAO,GAAG,EAAE,GAAG,OAAO,CAAA;YACjC,CAAC;YACD,MAAK;QACT,CAAC;QACD,KAAK,wBAAgB,CAAC,OAAO,CAAC;QAC9B;YACI,OAAO,IAAI,CAAA;IACnB,CAAC;IACD,OAAO,IAAI,CAAA;AACf,CAAC,CAAA;AA/CY,QAAA,uBAAuB,2BA+CnC"}
|
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./express.utils"), exports);
|
|
18
18
|
__exportStar(require("./tracing"), exports);
|
|
19
|
+
__exportStar(require("./game_progress"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,4CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,4CAAyB;AACzB,kDAA+B"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../../../src/server/oracle/types/providers/game-clock/parser.ts"],"names":[],"mappings":";;;AAAA,mCAA0C;AAE1C;;GAEG;AACH,MAAM,cAAc,GAAG;IACnB,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,OAAO;IACnB,aAAa,EAAE,qBAAqB;IACpC,WAAW,EAAE,4BAA4B;IACzC,gBAAgB,EAAE,2BAA2B;CACvC,CAAA;AAEV;;;;GAIG;AACI,MAAM,sBAAsB,GAAG,CAAC,SAAiB,EAAoB,EAAE;IAC1E,IAAI,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACzC,OAAO,wBAAgB,CAAC,cAAc,CAAA;IAC1C,CAAC;IACD,IAAI,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5C,OAAO,wBAAgB,CAAC,UAAU,CAAA;IACtC,CAAC;IACD,IAAI,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/C,OAAO,wBAAgB,CAAC,mBAAmB,CAAA;IAC/C,CAAC;IACD,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7C,OAAO,wBAAgB,CAAC,qBAAqB,CAAA;IACjD,CAAC;IACD,IAAI,cAAc,CAAC,gBAAgB,CAAC,IAAI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