@levrbet/shared 0.2.48 → 0.2.50

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/README.md CHANGED
@@ -5,31 +5,10 @@ Shared utilities, components, and types for the LEVR platform.
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @levrbet/shared @prisma/client prisma
8
+ npm install @levrbet/shared @prisma/client
9
9
  ```
10
10
 
11
- ## Prisma Setup
12
-
13
- This package includes a Prisma schema. After installation, run the setup script to generate the Prisma client:
14
-
15
- ```bash
16
- npx levrbet-prisma-setup
17
- ```
18
-
19
- Or add it to your `postinstall` script in `package.json`:
20
-
21
- ```json
22
- {
23
- "scripts": {
24
- "postinstall": "levrbet-prisma-setup"
25
- }
26
- }
27
- ```
28
-
29
- This will:
30
-
31
- 1. Copy the Prisma schema to your project's `prisma/` folder
32
- 2. Generate the `@prisma/client` in your `node_modules`
11
+ The Prisma client is automatically generated during installation - no additional setup required.
33
12
 
34
13
  ## Usage
35
14
 
@@ -37,7 +16,7 @@ This will:
37
16
  // Core utilities (universal - works in both browser and Node.js)
38
17
  import { e18, LevrBaseMarket } from "@levrbet/shared/core"
39
18
 
40
- // Prisma types and client (requires running prisma setup first)
19
+ // Prisma types and client
41
20
  import { PrismaClient, GamePhase, MarketStatus } from "@levrbet/shared/core"
42
21
  // Or directly from @prisma/client
43
22
  import { PrismaClient, GamePhase } from "@prisma/client"
@@ -62,11 +41,20 @@ This package requires the following peer dependencies:
62
41
  | Package | Required For |
63
42
  | ----------------------- | ---------------------------- |
64
43
  | `@prisma/client` | Database types and client |
65
- | `prisma` | Generating the Prisma client |
66
44
  | `react` | React hooks (optional) |
67
45
  | `@tanstack/react-query` | React query hooks (optional) |
68
46
  | `@privy-io/react-auth` | Privy auth hooks (optional) |
69
47
 
48
+ ## Prisma
49
+
50
+ The Prisma schema is bundled in this package and the client is auto-generated on install. If you need to manually regenerate:
51
+
52
+ ```bash
53
+ npx levrbet-prisma-setup
54
+ # Or directly:
55
+ npx prisma generate --schema=node_modules/@levrbet/shared/prisma/schema.prisma
56
+ ```
57
+
70
58
  ## Development
71
59
 
72
60
  ```bash
@@ -83,7 +71,6 @@ npm run dev # Creates a .tgz file
83
71
 
84
72
  # In consumer project
85
73
  npm install /path/to/levr-shared/*.tgz
86
- npx levrbet-prisma-setup
87
74
  ```
88
75
 
89
76
  ## License
@@ -17,7 +17,6 @@ export interface LevrGameWithRelationsPeriphery extends LevrGame {
17
17
  }
18
18
  export type LevrGameWithMarketsScoresAndLeague = Prisma.LevrGameGetPayload<{
19
19
  include: {
20
- fixture: {};
21
20
  markets: {
22
21
  include: {
23
22
  odds: true;
@@ -1 +1 @@
1
- {"version":3,"file":"game.types.js","sourceRoot":"","sources":["../../../../../src/core/types/oracle/game/game.types.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AACxE,0CAA2C;AAI3C,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,+CAAyB,CAAA;IACzB,mDAA6B,CAAA;AACjC,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAEM,MAAM,mBAAmB,GAAG,CAAC,MAAkB,EAAE,EAAE;IACtD,OAAO;QACH,CAAC,mBAAU,CAAC,cAAc,CAAC,EAAE,kBAAkB;QAC/C,CAAC,mBAAU,CAAC,SAAS,CAAC,EAAE,YAAY;KACvC,CAAC,MAAM,CAAC,CAAA;AACb,CAAC,CAAA;AALY,QAAA,mBAAmB,uBAK/B;AAyBD,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,kDAA0B,CAAA;IAC1B,oDAA4B,CAAA;IAC5B,0DAAkC,CAAA;IAClC,8CAAsB,CAAA;IACtB,sDAA8B,CAAA;AAClC,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAEY,QAAA,cAAc,GAAG,IAAA,kBAAU,EAAC,oBAAoB,EAAE,EAAE,CAAC,CAAA;AAErD,QAAA,cAAc,GAAG,IAAA,kBAAU,EAAC,oBAAoB,EAAE;IAC3D,SAAS,EAAE,kBAAkB;CAChC,CAAC,CAAA;AACW,QAAA,cAAc,GAAG,IAAA,kBAAU,EAAC,oBAAoB,EAAE,EAAE,CAAC,CAAA;AACrD,QAAA,cAAc,GAAG,IAAA,kBAAU,EAAC,oBAAoB,EAAE;IAC3D,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,qBAAqB;CACrC,CAAC,CAAA;AAEF,IAAY,iBAUX;AAVD,WAAY,iBAAiB;IACzB,uEAAe,CAAA;IACf,iEAAY,CAAA;IACZ,uEAAe,CAAA;IACf,iEAAY,CAAA;IACZ,mEAAa,CAAA;IACb,uEAAe,CAAA;IACf,mEAAa,CAAA;IACb,2EAAiB,CAAA;IACjB,6EAAkB,CAAA;AACtB,CAAC,EAVW,iBAAiB,iCAAjB,iBAAiB,QAU5B;AAyBD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,iEAAa,CAAA;IACb,6DAAW,CAAA;AACf,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAQD,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;AACzB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,wCAAwB,CAAA;AAC5B,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB"}
1
+ {"version":3,"file":"game.types.js","sourceRoot":"","sources":["../../../../../src/core/types/oracle/game/game.types.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AACxE,0CAA2C;AAI3C,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,+CAAyB,CAAA;IACzB,mDAA6B,CAAA;AACjC,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAEM,MAAM,mBAAmB,GAAG,CAAC,MAAkB,EAAE,EAAE;IACtD,OAAO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AHW,aAAa,6BAAb,aAAa,QAGxB;AAED,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,wCAAwB,CAAA;AAC5B,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levrbet/shared",
3
- "version": "0.2.48",
3
+ "version": "0.2.50",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -197,9 +197,9 @@ model Scores {
197
197
  }
198
198
 
199
199
  model LevrGame {
200
- objectId String @id @default(auto()) @map("_id") @db.ObjectId
201
- gameId Int @unique
202
- txHash String @unique
200
+ objectId String @id @default(auto()) @map("_id") @db.ObjectId
201
+ gameId Int @unique
202
+ txHash String @unique
203
203
  chainId Int
204
204
  seasonType String
205
205
  venue String
@@ -207,19 +207,21 @@ model LevrGame {
207
207
  location String
208
208
  venueLocation String
209
209
  gameClock String
210
- gameProgressBps Int @default(0)
211
- paused Boolean @default(false)
210
+ gameProgressBps Int @default(0)
211
+ paused Boolean @default(false)
212
212
  fixtureDate DateTime
213
213
  wentLiveAt DateTime?
214
214
  homeTeam Json // as defined in sample-data/lever/levr-game.json
215
215
  awayTeam Json // as defined in sample-data/lever/levr-game.json
216
- currentPeriod Int @default(0)
217
- actualDuration Float @default(0) // in milliseconds
218
- gamePhase GamePhase @default(PreGame)
216
+ currentPeriod Int @default(0)
217
+ actualDuration Float @default(0) // in milliseconds
218
+ gamePhase GamePhase @default(PreGame)
219
219
  levrFixtureId String
220
220
  opticOddsFixtureId String?
221
221
  lsportsFixtureId String?
222
- sportGroup SportGroup
222
+ liveScoreMatchId String?
223
+
224
+ sportGroup SportGroup
223
225
 
224
226
  tournamentObjectId String @db.ObjectId
225
227
  fixtureObjectId String @db.ObjectId