@levrbet/shared 0.1.151 → 0.1.153

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.
@@ -0,0 +1,20 @@
1
+ import { GamePhase, Odds, Scores } from "../prisma";
2
+ import { LevrFixtureId } from "../types";
3
+ export declare enum RoomEvent {
4
+ JoinRoom = "joinRoom",
5
+ LeaveRoom = "leaveRoom"
6
+ }
7
+ export declare enum GameEvent {
8
+ ScoreUpdate = "gameScoreUpdate",
9
+ PhaseUpdate = "gamePhaseUpdate"
10
+ }
11
+ export type GameScoreUpdate = Scores;
12
+ export type GamePhaseUpdate = {
13
+ chainId: number;
14
+ levrFixtureId: LevrFixtureId;
15
+ phase: GamePhase;
16
+ };
17
+ export declare enum MarketEvent {
18
+ OddsUpdate = "marketOddsUpdate"
19
+ }
20
+ export type MarketOddsUpdate = Odds;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MarketEvent = exports.GameEvent = exports.RoomEvent = void 0;
4
+ var RoomEvent;
5
+ (function (RoomEvent) {
6
+ RoomEvent["JoinRoom"] = "joinRoom";
7
+ RoomEvent["LeaveRoom"] = "leaveRoom";
8
+ })(RoomEvent || (exports.RoomEvent = RoomEvent = {}));
9
+ // GAME EVENTS AND TYPES
10
+ var GameEvent;
11
+ (function (GameEvent) {
12
+ GameEvent["ScoreUpdate"] = "gameScoreUpdate";
13
+ GameEvent["PhaseUpdate"] = "gamePhaseUpdate";
14
+ })(GameEvent || (exports.GameEvent = GameEvent = {}));
15
+ // MARKET EVENTS AND TYPES
16
+ var MarketEvent;
17
+ (function (MarketEvent) {
18
+ MarketEvent["OddsUpdate"] = "marketOddsUpdate";
19
+ })(MarketEvent || (exports.MarketEvent = MarketEvent = {}));
20
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/core/socket.io/events.ts"],"names":[],"mappings":";;;AAGA,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,kCAAqB,CAAA;IACrB,oCAAuB,CAAA;AAC3B,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,wBAAwB;AACxB,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,4CAA+B,CAAA;IAC/B,4CAA+B,CAAA;AACnC,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAQD,0BAA0B;AAC1B,IAAY,WAEX;AAFD,WAAY,WAAW;IACnB,8CAA+B,CAAA;AACnC,CAAC,EAFW,WAAW,2BAAX,WAAW,QAEtB"}
@@ -1,3 +1,2 @@
1
- export * from "./events.names";
2
- export * from "./events.types";
1
+ export * from "./events";
3
2
  export * from "./rooms";
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./events.names"), exports);
18
- __exportStar(require("./events.types"), exports);
17
+ __exportStar(require("./events"), exports);
19
18
  __exportStar(require("./rooms"), exports);
20
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/socket.io/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,iDAA8B;AAC9B,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/socket.io/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,0CAAuB"}
@@ -103,6 +103,7 @@ export interface LevrGameTeamDetails {
103
103
  name: string;
104
104
  logoUrl: string;
105
105
  mascot: string;
106
+ abbreviation?: string;
106
107
  providerTeamIds: string[];
107
108
  }
108
109
  export type LeagueWithTeams = Prisma.LeagueGetPayload<{
@@ -19,7 +19,7 @@ export interface MarketPriceBroadcast {
19
19
  gamePhase: GamePhase;
20
20
  gamePeriod: number;
21
21
  gameClock: number;
22
- gameMarketId: LevrGameMarketIdBytes;
22
+ gameMarketId: LevrGameMarketId;
23
23
  nFactor: number;
24
24
  providerObjectId: string;
25
25
  levrGameObjectId: string;
@@ -91,5 +91,5 @@ export declare const SIDE_UNDER: number;
91
91
  */
92
92
  export declare const GROUP_OUTCOME: number;
93
93
  export declare const GROUP_TOTAL: number;
94
- export type LevrMarketIdBytes = Bytes16;
95
- export type LevrGameMarketIdBytes = Bytes32;
94
+ export type LevrGameMarketId = Bytes32;
95
+ export type LevrFixtureId = Bytes16;
@@ -1,6 +1,2 @@
1
1
  import Redis from "ioredis";
2
- import { LevrScores, Odds } from "../../../core";
3
- export declare const LEVR_GAME_UPDATES = "game_updates";
4
- export declare const LEVR_MARKET_UPDATES = "market_updates";
5
- export declare const publishToGameUpdatesChannel: (redis: Redis, data: LevrScores) => Promise<void>;
6
- export declare const publishToMarketUpdatesChannel: (redis: Redis, data: Odds) => Promise<void>;
2
+ export declare const publishToChannel: (redis: Redis, channel: string, data: unknown) => Promise<void>;
@@ -1,20 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.publishToMarketUpdatesChannel = exports.publishToGameUpdatesChannel = exports.LEVR_MARKET_UPDATES = exports.LEVR_GAME_UPDATES = void 0;
3
+ exports.publishToChannel = void 0;
4
4
  const cache_keys_utils_1 = require("./cache.keys.utils");
5
- exports.LEVR_GAME_UPDATES = "game_updates";
6
- exports.LEVR_MARKET_UPDATES = "market_updates";
7
- // add different types as we need
8
- const publishToGameUpdatesChannel = async (redis, data) => {
9
- const success = (await redis.publish(exports.LEVR_GAME_UPDATES, JSON.stringify(data)));
5
+ const publishToChannel = async (redis, channel, data) => {
6
+ const success = (await redis.publish(channel, JSON.stringify(data)));
10
7
  if (success <= cache_keys_utils_1.RedisNumStates.failure)
11
8
  throw Error("Failed to publish to redis channel");
12
9
  };
13
- exports.publishToGameUpdatesChannel = publishToGameUpdatesChannel;
14
- const publishToMarketUpdatesChannel = async (redis, data) => {
15
- const success = (await redis.publish(exports.LEVR_MARKET_UPDATES, JSON.stringify(data)));
16
- if (success <= cache_keys_utils_1.RedisNumStates.failure)
17
- throw Error("Failed to publish to redis channel");
18
- };
19
- exports.publishToMarketUpdatesChannel = publishToMarketUpdatesChannel;
10
+ exports.publishToChannel = publishToChannel;
20
11
  //# sourceMappingURL=channels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/channels.ts"],"names":[],"mappings":";;;AAEA,yDAAmD;AAEtC,QAAA,iBAAiB,GAAG,cAAc,CAAA;AAElC,QAAA,mBAAmB,GAAG,gBAAgB,CAAA;AAEnD,iCAAiC;AAC1B,MAAM,2BAA2B,GAAG,KAAK,EAAE,KAAY,EAAE,IAAgB,EAAiB,EAAE;IAC/F,MAAM,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,yBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAmB,CAAA;IAChG,IAAI,OAAO,IAAI,iCAAc,CAAC,OAAO;QAAE,MAAM,KAAK,CAAC,oCAAoC,CAAC,CAAA;AAC5F,CAAC,CAAA;AAHY,QAAA,2BAA2B,+BAGvC;AAEM,MAAM,6BAA6B,GAAG,KAAK,EAAE,KAAY,EAAE,IAAU,EAAiB,EAAE;IAC3F,MAAM,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,2BAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAmB,CAAA;IAClG,IAAI,OAAO,IAAI,iCAAc,CAAC,OAAO;QAAE,MAAM,KAAK,CAAC,oCAAoC,CAAC,CAAA;AAC5F,CAAC,CAAA;AAHY,QAAA,6BAA6B,iCAGzC"}
1
+ {"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/channels.ts"],"names":[],"mappings":";;;AACA,yDAAmD;AAE5C,MAAM,gBAAgB,GAAG,KAAK,EAAE,KAAY,EAAE,OAAe,EAAE,IAAa,EAAiB,EAAE;IAClG,MAAM,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAmB,CAAA;IACtF,IAAI,OAAO,IAAI,iCAAc,CAAC,OAAO;QAAE,MAAM,KAAK,CAAC,oCAAoC,CAAC,CAAA;AAC5F,CAAC,CAAA;AAHY,QAAA,gBAAgB,oBAG5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levrbet/shared",
3
- "version": "0.1.151",
3
+ "version": "0.1.153",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -1,9 +0,0 @@
1
- export declare enum RoomEventName {
2
- joinRoom = "joinRoom",
3
- leaveRoom = "leaveRoom"
4
- }
5
- export declare enum GameEventName {
6
- gameOddsUpdate = "gameOddsUpdate",
7
- gameScoreUpdate = "gameScoreUpdate",
8
- gameStatusUpdate = "gameStatusUpdate"
9
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GameEventName = exports.RoomEventName = void 0;
4
- var RoomEventName;
5
- (function (RoomEventName) {
6
- RoomEventName["joinRoom"] = "joinRoom";
7
- RoomEventName["leaveRoom"] = "leaveRoom";
8
- })(RoomEventName || (exports.RoomEventName = RoomEventName = {}));
9
- var GameEventName;
10
- (function (GameEventName) {
11
- GameEventName["gameOddsUpdate"] = "gameOddsUpdate";
12
- GameEventName["gameScoreUpdate"] = "gameScoreUpdate";
13
- GameEventName["gameStatusUpdate"] = "gameStatusUpdate";
14
- })(GameEventName || (exports.GameEventName = GameEventName = {}));
15
- //# sourceMappingURL=events.names.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.names.js","sourceRoot":"","sources":["../../../src/core/socket.io/events.names.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;AAC3B,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,kDAAiC,CAAA;IACjC,oDAAmC,CAAA;IACnC,sDAAqC,CAAA;AACzC,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB"}
@@ -1,2 +0,0 @@
1
- import { Odds } from "../prisma";
2
- export type GameOddsUpdate = Odds;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=events.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.types.js","sourceRoot":"","sources":["../../../src/core/socket.io/events.types.ts"],"names":[],"mappings":""}