trucoshi 2.1.1 → 2.2.1

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
@@ -1,6 +1,7 @@
1
1
  import { User } from "lightning-accounts";
2
2
  import { CARDS, IHand } from "./lib";
3
3
  import { IUserData } from "./server";
4
+ import { SocketError } from "./server/classes/SocketError";
4
5
  export { CARDS, CARDS_HUMAN_READABLE, BURNT_CARD } from "./lib/constants";
5
6
  export declare enum EMatchState {
6
7
  UNREADY = "UNREADY",
@@ -114,6 +115,7 @@ export type IHandCommands = {
114
115
  };
115
116
  export type IEventCallback<T = {}> = (args: {
116
117
  success: boolean;
118
+ error?: SocketError;
117
119
  } & T) => void;
118
120
  export declare enum EServerEvent {
119
121
  PONG = "PONG",
@@ -208,6 +210,9 @@ export declare class TMap<K, V> extends Map<K, V> {
208
210
  getOrThrow(key?: K): NonNullable<V>;
209
211
  }
210
212
  export declare enum GAME_ERROR {
213
+ UNEXPECTED_ERROR = "UNEXPECTED_ERROR",
214
+ FORBIDDEN = "FORBIDDEN",
215
+ NOT_FOUND = "NOT_FOUND",
211
216
  MATCH_ALREADY_STARTED = "MATCH_ALREADY_STARTED",
212
217
  LOBBY_IS_FULL = "LOBBY_IS_FULL",
213
218
  UNEXPECTED_TEAM_SIZE = "UNEXPECTED_TEAM_SIZE",
package/dist/types.js CHANGED
@@ -105,6 +105,9 @@ export class TMap extends Map {
105
105
  }
106
106
  export var GAME_ERROR;
107
107
  (function (GAME_ERROR) {
108
+ GAME_ERROR["UNEXPECTED_ERROR"] = "UNEXPECTED_ERROR";
109
+ GAME_ERROR["FORBIDDEN"] = "FORBIDDEN";
110
+ GAME_ERROR["NOT_FOUND"] = "NOT_FOUND";
108
111
  GAME_ERROR["MATCH_ALREADY_STARTED"] = "MATCH_ALREADY_STARTED";
109
112
  GAME_ERROR["LOBBY_IS_FULL"] = "LOBBY_IS_FULL";
110
113
  GAME_ERROR["UNEXPECTED_TEAM_SIZE"] = "UNEXPECTED_TEAM_SIZE";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trucoshi",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "Lightning Truco Server",
5
5
  "main": "dist/types.js",
6
6
  "license": "GPL-3.0",
@@ -66,7 +66,7 @@
66
66
  "dotenv-cli": "^7.3.0",
67
67
  "form-data": "^4.0.0",
68
68
  "jsonwebtoken": "^9.0.2",
69
- "lightning-accounts": "2.0.1",
69
+ "lightning-accounts": "2.2.0",
70
70
  "path-scurry": "^1.9.2",
71
71
  "pino": "^8.11.0",
72
72
  "pino-pretty": "^10.0.0",