trucoshi 8.8.4 → 8.9.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/types.d.ts CHANGED
@@ -7,6 +7,7 @@ import { CARDS, ITable } from "./lib";
7
7
  import { AxiosResponse } from "axios";
8
8
  import { ITrucoshi } from "./server";
9
9
  import { BotProfile } from "./truco/Bot";
10
+ import { MatchBet } from "@prisma/client";
10
11
  export declare enum EMatchState {
11
12
  UNREADY = "UNREADY",
12
13
  READY = "READY",
@@ -20,8 +21,11 @@ export interface IMatchDetails extends Match {
20
21
  }
21
22
  export interface IAccountDetails {
22
23
  stats: UserStats | null;
24
+ matches: Array<Match & {
25
+ players: Pick<MatchPlayer, "accountId" | "idx" | "teamIdx" | "bot" | "name">[];
26
+ bet: Pick<MatchBet, "id" | "satsPerPlayer"> | null;
27
+ }>;
23
28
  account: User | null;
24
- matches: Array<Match>;
25
29
  }
26
30
  export interface IUserData {
27
31
  key: string;
@@ -137,7 +141,8 @@ export declare enum EChatSystem {
137
141
  SYSTEM = "SYSTEM"
138
142
  }
139
143
  export declare enum ESayCommand {
140
- MAZO = "MAZO"
144
+ MAZO = "MAZO",
145
+ PASO = "PASO"
141
146
  }
142
147
  export declare enum EFlorCommand {
143
148
  FLOR = "FLOR",
@@ -262,7 +267,7 @@ export interface IRandom {
262
267
  bitcoinHeight: number;
263
268
  };
264
269
  }
265
- export type IPublicPlayer = Pick<IPlayer, "idx" | "key" | "name" | "bot" | "abandonedTime" | "accountId" | "avatarUrl" | "disabled" | "abandoned" | "ready" | "hand" | "usedHand" | "prevHand" | "teamIdx" | "isTurn" | "turnExpiresAt" | "turnExtensionExpiresAt" | "isEnvidoTurn" | "isOwner" | "hasSaidFlor" | "hasSaidEnvidoPoints" | "hasSaidTruco"> & ({
270
+ export type IPublicPlayer = Pick<IPlayer, "idx" | "key" | "name" | "bot" | "abandonedTime" | "accountId" | "avatarUrl" | "disabled" | "abandoned" | "ready" | "hand" | "usedHand" | "prevHand" | "teamIdx" | "isTurn" | "turnExpiresAt" | "turnExtensionExpiresAt" | "isEnvidoTurn" | "isOwner" | "hasSaidFlor" | "hasSaidEnvidoPoints" | "hasSaidTruco" | "hasPassed"> & ({
266
271
  isMe?: true;
267
272
  commands: IPlayer["commands"];
268
273
  hasFlor: IPlayer["hasFlor"];
@@ -317,6 +322,7 @@ export interface IPlayer {
317
322
  hasSaidFlor: boolean;
318
323
  hasSaidEnvidoPoints: boolean;
319
324
  hasSaidTruco: boolean;
325
+ hasPassed: boolean;
320
326
  isEnvidoTurn: boolean;
321
327
  isOwner: boolean;
322
328
  disabled: boolean;
@@ -330,6 +336,8 @@ export interface IPlayer {
330
336
  saidEnvidoPoints(): void;
331
337
  saidFlor(): void;
332
338
  saidTruco(): void;
339
+ passed(): void;
340
+ resetPassed(): void;
333
341
  resetCommands(): void;
334
342
  calculateEnvido(): Array<{
335
343
  value: number;
@@ -370,6 +378,7 @@ export interface ITeam {
370
378
  disable(player: IPlayer): boolean;
371
379
  abandon(player: IPlayer): boolean;
372
380
  enable(player?: IPlayer): boolean;
381
+ resetPassed(): void;
373
382
  addPoints(matchPoint: number, points: number, simulate?: boolean): ITeamPoints;
374
383
  }
375
384
  export interface ITeamPoints {
package/dist/types.js CHANGED
@@ -16,6 +16,7 @@ export var EChatSystem;
16
16
  export var ESayCommand;
17
17
  (function (ESayCommand) {
18
18
  ESayCommand["MAZO"] = "MAZO";
19
+ ESayCommand["PASO"] = "PASO";
19
20
  })(ESayCommand || (ESayCommand = {}));
20
21
  export var EFlorCommand;
21
22
  (function (EFlorCommand) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trucoshi",
3
- "version": "8.8.4",
3
+ "version": "8.9.0",
4
4
  "description": "Lightning Truco Server",
5
5
  "main": "dist/types.js",
6
6
  "license": "GPL-3.0",
@@ -52,7 +52,7 @@
52
52
  "mocha": "^10.2.0",
53
53
  "nodemon": "^2.0.20",
54
54
  "prisma": "^4.14.1",
55
- "socket.io-client": "^4.5.4",
55
+ "socket.io-client": "4.8.1",
56
56
  "ts-mocha": "^10.0.0"
57
57
  },
58
58
  "files": [
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "dependencies": {
71
71
  "@prisma/client": "^4.14.1",
72
- "@socket.io/redis-adapter": "^8.2.1",
72
+ "@socket.io/redis-adapter": "8.3.0",
73
73
  "@types/jsonwebtoken": "^9.0.5",
74
74
  "@types/node-forge": "^1.3.11",
75
75
  "@types/pino": "^7.0.5",
@@ -91,7 +91,7 @@
91
91
  "pino-pretty": "^11.2.2",
92
92
  "rimraf": "^4.1.1",
93
93
  "safe-rng": "^1.0.4",
94
- "socket.io": "^4.5.4",
94
+ "socket.io": "4.8.1",
95
95
  "ts-node": "^10.9.1",
96
96
  "tsc": "^2.0.4",
97
97
  "typescript": "^5.3.3"