@hellacardgames/speed 0.5.2 → 0.6.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/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +2 -3
- package/dist/client/index.d.cts.map +1 -1
- package/dist/client/index.d.mts +2 -3
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs.map +1 -1
- package/dist/{startGame-5InkAgEp.d.cts → index-FveApXzq.d.cts} +52 -36
- package/dist/index-FveApXzq.d.cts.map +1 -0
- package/dist/{startGame-ayp8a-Cl.d.mts → index-J8s2QklC.d.mts} +52 -36
- package/dist/index-J8s2QklC.d.mts.map +1 -0
- package/dist/index-YAYbNr-s.d.cts +200 -0
- package/dist/index-YAYbNr-s.d.cts.map +1 -0
- package/dist/index-YAYbNr-s.d.mts +200 -0
- package/dist/index-YAYbNr-s.d.mts.map +1 -0
- package/dist/manager/index.cjs +2 -32
- package/dist/manager/index.d.cts +2 -109
- package/dist/manager/index.d.mts +2 -109
- package/dist/manager/index.mjs +2 -22
- package/dist/manager-BOymBQ4E.mjs +817 -0
- package/dist/manager-BOymBQ4E.mjs.map +1 -0
- package/dist/manager-BpKvQbcp.cjs +822 -0
- package/dist/manager-BpKvQbcp.cjs.map +1 -0
- package/dist/server/index.cjs +138 -157
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +3 -40
- package/dist/server/index.d.mts +3 -40
- package/dist/server/index.mjs +138 -157
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/GameEvent-DDQ4jXxt.d.cts +0 -111
- package/dist/GameEvent-DDQ4jXxt.d.cts.map +0 -1
- package/dist/GameEvent-DDQ4jXxt.d.mts +0 -111
- package/dist/GameEvent-DDQ4jXxt.d.mts.map +0 -1
- package/dist/manager/index.cjs.map +0 -1
- package/dist/manager/index.d.cts.map +0 -1
- package/dist/manager/index.d.mts.map +0 -1
- package/dist/manager/index.mjs.map +0 -1
- package/dist/server/index.d.cts.map +0 -1
- package/dist/server/index.d.mts.map +0 -1
- package/dist/startGame-5InkAgEp.d.cts.map +0 -1
- package/dist/startGame-BC9XfFzG.mjs +0 -815
- package/dist/startGame-BC9XfFzG.mjs.map +0 -1
- package/dist/startGame-Bhk__XWk.cjs +0 -898
- package/dist/startGame-Bhk__XWk.cjs.map +0 -1
- package/dist/startGame-ayp8a-Cl.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type {\n CreateGameResult,\n DrawCardResult,\n GetClientStateAndClearEventsResult,\n GetEventsAndClearAcknowledgedResult,\n GetJoinableGamesResult,\n JoinGameResult,\n LeaveGameResult,\n PlayCardResult,\n ReportNoPlayableCardsResult,\n SendChatResult,\n StartGameResult,\n} from \"../server/index.js\";\n\nexport type {\n CreateGameResult,\n DrawCardResult,\n GetClientStateAndClearEventsResult,\n GetEventsAndClearAcknowledgedResult,\n GetJoinableGamesResult,\n JoinGameResult,\n LeaveGameResult,\n PlayCardResult,\n ReportNoPlayableCardsResult,\n SendChatResult,\n StartGameResult,\n};\n\nexport class Client {\n private readonly baseUrl: string;\n\n constructor(baseUrl: string) {\n this.baseUrl = baseUrl;\n }\n\n async createGame(accessToken: string): Promise<CreateGameResult> {\n const response = await fetch(`${this.baseUrl}/createGame`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n });\n const result = await response.json();\n return result;\n }\n\n async drawCard(gameId: string, playerId: string): Promise<DrawCardResult> {\n const response = await fetch(`${this.baseUrl}/drawCard`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async getClientStateAndClearEvents(\n gameId: string,\n playerId: string,\n ): Promise<GetClientStateAndClearEventsResult> {\n const response = await fetch(\n `${this.baseUrl}/getClientStateAndClearEvents`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n },\n );\n const result = await response.json();\n return result;\n }\n\n async getEventsAndClearAcknowledged(\n gameId: string,\n playerId: string,\n lastReadId: string | null,\n ): Promise<GetEventsAndClearAcknowledgedResult> {\n const response = await fetch(\n `${this.baseUrl}/getEventsAndClearAcknowledged`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, lastReadId }),\n },\n );\n const result = await response.json();\n return result;\n }\n\n async getJoinableGames(): Promise<GetJoinableGamesResult> {\n const response = await fetch(`${this.baseUrl}/getJoinableGames`, {\n method: \"POST\",\n });\n const result = await response.json();\n return result;\n }\n\n async joinGame(gameId: string, accessToken: string): Promise<JoinGameResult> {\n const response = await fetch(`${this.baseUrl}/joinGame`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId }),\n });\n const result = await response.json();\n return result;\n }\n\n async leaveGame(gameId: string, playerId: string): Promise<LeaveGameResult> {\n const response = await fetch(`${this.baseUrl}/leaveGame`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async playCard(\n gameId: string,\n playerId: string,\n cardId: string,\n isForOtherPlayerPile: boolean,\n ): Promise<PlayCardResult> {\n const response = await fetch(`${this.baseUrl}/playCard`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, cardId, isForOtherPlayerPile }),\n });\n const result = await response.json();\n return result;\n }\n\n async reportNoPlayableCards(\n gameId: string,\n playerId: string,\n ): Promise<ReportNoPlayableCardsResult> {\n const response = await fetch(`${this.baseUrl}/reportNoPlayableCards`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async sendChat(\n gameId: string,\n playerId: string,\n text: string,\n ): Promise<SendChatResult> {\n const response = await fetch(`${this.baseUrl}/sendChat`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, text }),\n });\n const result = await response.json();\n return result;\n }\n\n async startGame(gameId: string, playerId: string): Promise<StartGameResult> {\n const response = await fetch(`${this.baseUrl}/startGame`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n}\n"],"mappings":"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"}
|
package/dist/client/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
|
|
1
|
+
import { g as Card, h as ChatMessage, m as ClientState, p as GameEvent } from "../index-YAYbNr-s.cjs";
|
|
2
|
+
import { a as GetJoinableGamesResult, c as PlayCardResult, f as StartGameResult, i as GetEventsAndClearAcknowledgedResult, l as ReportNoPlayableCardsResult, n as DrawCardResult, o as JoinGameResult, r as GetClientStateAndClearEventsResult, s as LeaveGameResult, t as CreateGameResult, u as SendChatResult } from "../index-FveApXzq.cjs";
|
|
4
3
|
//#region src/client/Client.d.ts
|
|
5
4
|
declare class Client {
|
|
6
5
|
private readonly baseUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/client/Client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/client/Client.ts"],"mappings":";;;cA4Ba;mBACM;EAEL,YAAA;EAIN,WAAW,sBAAsB,QAAQ;EAWzC,SAAS,gBAAgB,mBAAmB,QAAQ;EAYpD,6BACJ,gBACA,mBACC,QAAQ;EAeL,8BACJ,gBACA,kBACA,4BACC,QAAQ;EAeL,oBAAoB,QAAQ;EAQ5B,SAAS,gBAAgB,sBAAsB,QAAQ;EAavD,UAAU,gBAAgB,mBAAmB,QAAQ;EAYrD,SACJ,gBACA,kBACA,gBACA,gCACC,QAAQ;EAYL,sBACJ,gBACA,mBACC,QAAQ;EAYL,SACJ,gBACA,kBACA,eACC,QAAQ;EAYL,UAAU,gBAAgB,mBAAmB,QAAQ"}
|
package/dist/client/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
|
|
1
|
+
import { g as Card, h as ChatMessage, m as ClientState, p as GameEvent } from "../index-YAYbNr-s.mjs";
|
|
2
|
+
import { a as GetJoinableGamesResult, c as PlayCardResult, f as StartGameResult, i as GetEventsAndClearAcknowledgedResult, l as ReportNoPlayableCardsResult, n as DrawCardResult, o as JoinGameResult, r as GetClientStateAndClearEventsResult, s as LeaveGameResult, t as CreateGameResult, u as SendChatResult } from "../index-J8s2QklC.mjs";
|
|
4
3
|
//#region src/client/Client.d.ts
|
|
5
4
|
declare class Client {
|
|
6
5
|
private readonly baseUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/client/Client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/client/Client.ts"],"mappings":";;;cA4Ba;mBACM;EAEL,YAAA;EAIN,WAAW,sBAAsB,QAAQ;EAWzC,SAAS,gBAAgB,mBAAmB,QAAQ;EAYpD,6BACJ,gBACA,mBACC,QAAQ;EAeL,8BACJ,gBACA,kBACA,4BACC,QAAQ;EAeL,oBAAoB,QAAQ;EAQ5B,SAAS,gBAAgB,sBAAsB,QAAQ;EAavD,UAAU,gBAAgB,mBAAmB,QAAQ;EAYrD,SACJ,gBACA,kBACA,gBACA,gCACC,QAAQ;EAYL,sBACJ,gBACA,mBACC,QAAQ;EAYL,SACJ,gBACA,kBACA,eACC,QAAQ;EAYL,UAAU,gBAAgB,mBAAmB,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type {\n CreateGameResult,\n DrawCardResult,\n GetClientStateAndClearEventsResult,\n GetEventsAndClearAcknowledgedResult,\n GetJoinableGamesResult,\n JoinGameResult,\n LeaveGameResult,\n PlayCardResult,\n ReportNoPlayableCardsResult,\n SendChatResult,\n StartGameResult,\n} from \"../server/index.js\";\n\nexport type {\n CreateGameResult,\n DrawCardResult,\n GetClientStateAndClearEventsResult,\n GetEventsAndClearAcknowledgedResult,\n GetJoinableGamesResult,\n JoinGameResult,\n LeaveGameResult,\n PlayCardResult,\n ReportNoPlayableCardsResult,\n SendChatResult,\n StartGameResult,\n};\n\nexport class Client {\n private readonly baseUrl: string;\n\n constructor(baseUrl: string) {\n this.baseUrl = baseUrl;\n }\n\n async createGame(accessToken: string): Promise<CreateGameResult> {\n const response = await fetch(`${this.baseUrl}/createGame`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n });\n const result = await response.json();\n return result;\n }\n\n async drawCard(gameId: string, playerId: string): Promise<DrawCardResult> {\n const response = await fetch(`${this.baseUrl}/drawCard`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async getClientStateAndClearEvents(\n gameId: string,\n playerId: string,\n ): Promise<GetClientStateAndClearEventsResult> {\n const response = await fetch(\n `${this.baseUrl}/getClientStateAndClearEvents`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n },\n );\n const result = await response.json();\n return result;\n }\n\n async getEventsAndClearAcknowledged(\n gameId: string,\n playerId: string,\n lastReadId: string | null,\n ): Promise<GetEventsAndClearAcknowledgedResult> {\n const response = await fetch(\n `${this.baseUrl}/getEventsAndClearAcknowledged`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, lastReadId }),\n },\n );\n const result = await response.json();\n return result;\n }\n\n async getJoinableGames(): Promise<GetJoinableGamesResult> {\n const response = await fetch(`${this.baseUrl}/getJoinableGames`, {\n method: \"POST\",\n });\n const result = await response.json();\n return result;\n }\n\n async joinGame(gameId: string, accessToken: string): Promise<JoinGameResult> {\n const response = await fetch(`${this.baseUrl}/joinGame`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId }),\n });\n const result = await response.json();\n return result;\n }\n\n async leaveGame(gameId: string, playerId: string): Promise<LeaveGameResult> {\n const response = await fetch(`${this.baseUrl}/leaveGame`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async playCard(\n gameId: string,\n playerId: string,\n cardId: string,\n isForOtherPlayerPile: boolean,\n ): Promise<PlayCardResult> {\n const response = await fetch(`${this.baseUrl}/playCard`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, cardId, isForOtherPlayerPile }),\n });\n const result = await response.json();\n return result;\n }\n\n async reportNoPlayableCards(\n gameId: string,\n playerId: string,\n ): Promise<ReportNoPlayableCardsResult> {\n const response = await fetch(`${this.baseUrl}/reportNoPlayableCards`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async sendChat(\n gameId: string,\n playerId: string,\n text: string,\n ): Promise<SendChatResult> {\n const response = await fetch(`${this.baseUrl}/sendChat`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, text }),\n });\n const result = await response.json();\n return result;\n }\n\n async startGame(gameId: string, playerId: string): Promise<StartGameResult> {\n const response = await fetch(`${this.baseUrl}/startGame`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/server/actions/createGame.d.ts
|
|
1
|
+
import { m as ClientState, p as GameEvent } from "./index-YAYbNr-s.cjs";
|
|
2
|
+
//#region src/server/Server.d.ts
|
|
4
3
|
type CreateGameResult = {
|
|
5
4
|
readonly success: true;
|
|
6
5
|
readonly gameId: string;
|
|
@@ -9,18 +8,12 @@ type CreateGameResult = {
|
|
|
9
8
|
readonly success: false;
|
|
10
9
|
readonly error: "maxGamesReached";
|
|
11
10
|
};
|
|
12
|
-
declare function createGame(userId: string, username: string): CreateGameResult;
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/server/actions/drawCard.d.ts
|
|
15
11
|
type DrawCardResult = {
|
|
16
12
|
readonly success: true;
|
|
17
13
|
} | {
|
|
18
14
|
readonly success: false;
|
|
19
15
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "handFull" | "drawPileEmpty";
|
|
20
16
|
};
|
|
21
|
-
declare function drawCard(input: unknown): DrawCardResult;
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/server/actions/getClientStateAndClearEvents.d.ts
|
|
24
17
|
type GetClientStateAndClearEventsResult = {
|
|
25
18
|
readonly success: true;
|
|
26
19
|
readonly state: ClientState;
|
|
@@ -28,9 +21,6 @@ type GetClientStateAndClearEventsResult = {
|
|
|
28
21
|
readonly success: false;
|
|
29
22
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound";
|
|
30
23
|
};
|
|
31
|
-
declare function getClientStateAndClearEvents(input: unknown): GetClientStateAndClearEventsResult;
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/server/actions/getEventsAndClearAcknowledged.d.ts
|
|
34
24
|
type GetEventsAndClearAcknowledgedResult = {
|
|
35
25
|
readonly success: true;
|
|
36
26
|
readonly events: readonly GameEvent[];
|
|
@@ -38,18 +28,12 @@ type GetEventsAndClearAcknowledgedResult = {
|
|
|
38
28
|
readonly success: false;
|
|
39
29
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound";
|
|
40
30
|
};
|
|
41
|
-
declare function getEventsAndClearAcknowledged(input: unknown): GetEventsAndClearAcknowledgedResult;
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/server/actions/getJoinableGames.d.ts
|
|
44
31
|
type GetJoinableGamesResult = {
|
|
45
32
|
readonly games: readonly {
|
|
46
33
|
readonly id: string;
|
|
47
34
|
readonly numPlayers: number;
|
|
48
35
|
}[];
|
|
49
36
|
};
|
|
50
|
-
declare function getJoinableGames(): GetJoinableGamesResult;
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/server/actions/joinGame.d.ts
|
|
53
37
|
type JoinGameResult = {
|
|
54
38
|
readonly success: true;
|
|
55
39
|
readonly playerId: string;
|
|
@@ -57,52 +41,84 @@ type JoinGameResult = {
|
|
|
57
41
|
readonly success: false;
|
|
58
42
|
readonly error: "invalidInput" | "gameNotFound" | "invalidStatus" | "maxPlayersReached" | "alreadyInGame";
|
|
59
43
|
};
|
|
60
|
-
declare function joinGame(input: unknown, userId: string, username: string): JoinGameResult;
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/server/actions/leaveGame.d.ts
|
|
63
44
|
type LeaveGameResult = {
|
|
64
45
|
readonly success: true;
|
|
65
46
|
} | {
|
|
66
47
|
readonly success: false;
|
|
67
48
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound";
|
|
68
49
|
};
|
|
69
|
-
declare function leaveGame(input: unknown): LeaveGameResult;
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/server/actions/playCard.d.ts
|
|
72
50
|
type PlayCardResult = {
|
|
73
51
|
readonly success: true;
|
|
74
52
|
} | {
|
|
75
53
|
readonly success: false;
|
|
76
54
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "cardNotFound" | "cardNotPlayable";
|
|
77
55
|
};
|
|
78
|
-
declare function playCard(input: unknown): PlayCardResult;
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/server/actions/reportNoPlayableCards.d.ts
|
|
81
56
|
type ReportNoPlayableCardsResult = {
|
|
82
57
|
readonly success: true;
|
|
83
58
|
} | {
|
|
84
59
|
readonly success: false;
|
|
85
60
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "alreadyReported" | "hasPlayableCard" | "canDraw";
|
|
86
61
|
};
|
|
87
|
-
declare function reportNoPlayableCards(input: unknown): ReportNoPlayableCardsResult;
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/server/actions/sendChat.d.ts
|
|
90
62
|
type SendChatResult = {
|
|
91
63
|
readonly success: true;
|
|
92
64
|
} | {
|
|
93
65
|
readonly success: false;
|
|
94
66
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound";
|
|
95
67
|
};
|
|
96
|
-
declare function sendChat(input: unknown): SendChatResult;
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/server/actions/startGame.d.ts
|
|
99
68
|
type StartGameResult = {
|
|
100
69
|
readonly success: true;
|
|
101
70
|
} | {
|
|
102
71
|
readonly success: false;
|
|
103
72
|
readonly error: "invalidInput" | "gameNotFound" | "invalidStatus" | "playerNotFound" | "playerNotAdmin" | "minPlayersNotReached";
|
|
104
73
|
};
|
|
105
|
-
declare
|
|
74
|
+
declare class Server {
|
|
75
|
+
private readonly manager;
|
|
76
|
+
readonly actions: readonly [{
|
|
77
|
+
readonly path: "/createGame";
|
|
78
|
+
readonly action: (userId: string, username: string) => CreateGameResult;
|
|
79
|
+
}, {
|
|
80
|
+
readonly path: "/drawCard";
|
|
81
|
+
readonly action: (input: unknown) => DrawCardResult;
|
|
82
|
+
}, {
|
|
83
|
+
readonly path: "/getClientStateAndClearEvents";
|
|
84
|
+
readonly action: (input: unknown) => GetClientStateAndClearEventsResult;
|
|
85
|
+
}, {
|
|
86
|
+
readonly path: "/getEventsAndClearAcknowledged";
|
|
87
|
+
readonly action: (input: unknown) => GetEventsAndClearAcknowledgedResult;
|
|
88
|
+
}, {
|
|
89
|
+
readonly path: "/getJoinableGames";
|
|
90
|
+
readonly action: () => GetJoinableGamesResult;
|
|
91
|
+
}, {
|
|
92
|
+
readonly path: "/joinGame";
|
|
93
|
+
readonly action: (input: unknown, userId: string, username: string) => JoinGameResult;
|
|
94
|
+
}, {
|
|
95
|
+
readonly path: "/leaveGame";
|
|
96
|
+
readonly action: (input: unknown) => LeaveGameResult;
|
|
97
|
+
}, {
|
|
98
|
+
readonly path: "/playCard";
|
|
99
|
+
readonly action: (input: unknown) => PlayCardResult;
|
|
100
|
+
}, {
|
|
101
|
+
readonly path: "/reportNoPlayableCards";
|
|
102
|
+
readonly action: (input: unknown) => ReportNoPlayableCardsResult;
|
|
103
|
+
}, {
|
|
104
|
+
readonly path: "/sendChat";
|
|
105
|
+
readonly action: (input: unknown) => SendChatResult;
|
|
106
|
+
}, {
|
|
107
|
+
readonly path: "/startGame";
|
|
108
|
+
readonly action: (input: unknown) => StartGameResult;
|
|
109
|
+
}];
|
|
110
|
+
private createGame;
|
|
111
|
+
private drawCard;
|
|
112
|
+
private getClientStateAndClearEvents;
|
|
113
|
+
private getEventsAndClearAcknowledged;
|
|
114
|
+
private getJoinableGames;
|
|
115
|
+
private joinGame;
|
|
116
|
+
private leaveGame;
|
|
117
|
+
private playCard;
|
|
118
|
+
private reportNoPlayableCards;
|
|
119
|
+
private sendChat;
|
|
120
|
+
private startGame;
|
|
121
|
+
}
|
|
106
122
|
//#endregion
|
|
107
|
-
export {
|
|
108
|
-
//# sourceMappingURL=
|
|
123
|
+
export { GetJoinableGamesResult as a, PlayCardResult as c, Server as d, StartGameResult as f, GetEventsAndClearAcknowledgedResult as i, ReportNoPlayableCardsResult as l, DrawCardResult as n, JoinGameResult as o, GetClientStateAndClearEventsResult as r, LeaveGameResult as s, CreateGameResult as t, SendChatResult as u };
|
|
124
|
+
//# sourceMappingURL=index-FveApXzq.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-FveApXzq.d.cts","names":[],"sources":["../src/server/Server.ts"],"mappings":";;KAIY;WAEG;WACA;WACA;;WAGA;WACA;;KAGH;WAEG;;WAGA;WACA;;KAUH;WAEG;WACA,OAAO;;WAGP;WACA;;KAGH;WAEG;WACA,iBAAiB;;WAGjB;WACA;;KAGH;WACD;aACE;aACA;;;KAID;WAEG;WACA;;WAGA;WACA;;KAQH;WAEG;;WAGA;WACA;;KAGH;WAEG;;WAGA;WACA;;KAUH;WAEG;;WAGA;WACA;;KAWH;WAEG;;WAGA;WACA;;KAGH;WAEG;;WAGA;WACA;;cAiFF;mBACM;WAER;;aAuBkB,SAAA,gBAAM,qBAAqB;;;aAI9B,SAAA,mBAAU;;;aASzB,SAAA,mBACN;;;aAUM,SAAA,mBACN;;;aASyB,cAAA;;;aAKnB,SAAA,gBAAO,gBACA,qBAEb;;;aAQsB,SAAA,mBAAU;;;aAQX,SAAA,mBAAU;;;aAQG,SAAA,mBAAU;;;aAQvB,SAAA,mBAAU;;;aAQT,SAAA,mBAAU;;UAlF3B;UAIA;UAQA;UAWA;UAWA;UAIA;UAYA;UAQA;UAQA;UAQA;UAQA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/server/actions/createGame.d.ts
|
|
1
|
+
import { m as ClientState, p as GameEvent } from "./index-YAYbNr-s.mjs";
|
|
2
|
+
//#region src/server/Server.d.ts
|
|
4
3
|
type CreateGameResult = {
|
|
5
4
|
readonly success: true;
|
|
6
5
|
readonly gameId: string;
|
|
@@ -9,18 +8,12 @@ type CreateGameResult = {
|
|
|
9
8
|
readonly success: false;
|
|
10
9
|
readonly error: "maxGamesReached";
|
|
11
10
|
};
|
|
12
|
-
declare function createGame(userId: string, username: string): CreateGameResult;
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/server/actions/drawCard.d.ts
|
|
15
11
|
type DrawCardResult = {
|
|
16
12
|
readonly success: true;
|
|
17
13
|
} | {
|
|
18
14
|
readonly success: false;
|
|
19
15
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "handFull" | "drawPileEmpty";
|
|
20
16
|
};
|
|
21
|
-
declare function drawCard(input: unknown): DrawCardResult;
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/server/actions/getClientStateAndClearEvents.d.ts
|
|
24
17
|
type GetClientStateAndClearEventsResult = {
|
|
25
18
|
readonly success: true;
|
|
26
19
|
readonly state: ClientState;
|
|
@@ -28,9 +21,6 @@ type GetClientStateAndClearEventsResult = {
|
|
|
28
21
|
readonly success: false;
|
|
29
22
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound";
|
|
30
23
|
};
|
|
31
|
-
declare function getClientStateAndClearEvents(input: unknown): GetClientStateAndClearEventsResult;
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/server/actions/getEventsAndClearAcknowledged.d.ts
|
|
34
24
|
type GetEventsAndClearAcknowledgedResult = {
|
|
35
25
|
readonly success: true;
|
|
36
26
|
readonly events: readonly GameEvent[];
|
|
@@ -38,18 +28,12 @@ type GetEventsAndClearAcknowledgedResult = {
|
|
|
38
28
|
readonly success: false;
|
|
39
29
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound";
|
|
40
30
|
};
|
|
41
|
-
declare function getEventsAndClearAcknowledged(input: unknown): GetEventsAndClearAcknowledgedResult;
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/server/actions/getJoinableGames.d.ts
|
|
44
31
|
type GetJoinableGamesResult = {
|
|
45
32
|
readonly games: readonly {
|
|
46
33
|
readonly id: string;
|
|
47
34
|
readonly numPlayers: number;
|
|
48
35
|
}[];
|
|
49
36
|
};
|
|
50
|
-
declare function getJoinableGames(): GetJoinableGamesResult;
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/server/actions/joinGame.d.ts
|
|
53
37
|
type JoinGameResult = {
|
|
54
38
|
readonly success: true;
|
|
55
39
|
readonly playerId: string;
|
|
@@ -57,52 +41,84 @@ type JoinGameResult = {
|
|
|
57
41
|
readonly success: false;
|
|
58
42
|
readonly error: "invalidInput" | "gameNotFound" | "invalidStatus" | "maxPlayersReached" | "alreadyInGame";
|
|
59
43
|
};
|
|
60
|
-
declare function joinGame(input: unknown, userId: string, username: string): JoinGameResult;
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/server/actions/leaveGame.d.ts
|
|
63
44
|
type LeaveGameResult = {
|
|
64
45
|
readonly success: true;
|
|
65
46
|
} | {
|
|
66
47
|
readonly success: false;
|
|
67
48
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound";
|
|
68
49
|
};
|
|
69
|
-
declare function leaveGame(input: unknown): LeaveGameResult;
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/server/actions/playCard.d.ts
|
|
72
50
|
type PlayCardResult = {
|
|
73
51
|
readonly success: true;
|
|
74
52
|
} | {
|
|
75
53
|
readonly success: false;
|
|
76
54
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "cardNotFound" | "cardNotPlayable";
|
|
77
55
|
};
|
|
78
|
-
declare function playCard(input: unknown): PlayCardResult;
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/server/actions/reportNoPlayableCards.d.ts
|
|
81
56
|
type ReportNoPlayableCardsResult = {
|
|
82
57
|
readonly success: true;
|
|
83
58
|
} | {
|
|
84
59
|
readonly success: false;
|
|
85
60
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "alreadyReported" | "hasPlayableCard" | "canDraw";
|
|
86
61
|
};
|
|
87
|
-
declare function reportNoPlayableCards(input: unknown): ReportNoPlayableCardsResult;
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/server/actions/sendChat.d.ts
|
|
90
62
|
type SendChatResult = {
|
|
91
63
|
readonly success: true;
|
|
92
64
|
} | {
|
|
93
65
|
readonly success: false;
|
|
94
66
|
readonly error: "invalidInput" | "gameNotFound" | "playerNotFound";
|
|
95
67
|
};
|
|
96
|
-
declare function sendChat(input: unknown): SendChatResult;
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/server/actions/startGame.d.ts
|
|
99
68
|
type StartGameResult = {
|
|
100
69
|
readonly success: true;
|
|
101
70
|
} | {
|
|
102
71
|
readonly success: false;
|
|
103
72
|
readonly error: "invalidInput" | "gameNotFound" | "invalidStatus" | "playerNotFound" | "playerNotAdmin" | "minPlayersNotReached";
|
|
104
73
|
};
|
|
105
|
-
declare
|
|
74
|
+
declare class Server {
|
|
75
|
+
private readonly manager;
|
|
76
|
+
readonly actions: readonly [{
|
|
77
|
+
readonly path: "/createGame";
|
|
78
|
+
readonly action: (userId: string, username: string) => CreateGameResult;
|
|
79
|
+
}, {
|
|
80
|
+
readonly path: "/drawCard";
|
|
81
|
+
readonly action: (input: unknown) => DrawCardResult;
|
|
82
|
+
}, {
|
|
83
|
+
readonly path: "/getClientStateAndClearEvents";
|
|
84
|
+
readonly action: (input: unknown) => GetClientStateAndClearEventsResult;
|
|
85
|
+
}, {
|
|
86
|
+
readonly path: "/getEventsAndClearAcknowledged";
|
|
87
|
+
readonly action: (input: unknown) => GetEventsAndClearAcknowledgedResult;
|
|
88
|
+
}, {
|
|
89
|
+
readonly path: "/getJoinableGames";
|
|
90
|
+
readonly action: () => GetJoinableGamesResult;
|
|
91
|
+
}, {
|
|
92
|
+
readonly path: "/joinGame";
|
|
93
|
+
readonly action: (input: unknown, userId: string, username: string) => JoinGameResult;
|
|
94
|
+
}, {
|
|
95
|
+
readonly path: "/leaveGame";
|
|
96
|
+
readonly action: (input: unknown) => LeaveGameResult;
|
|
97
|
+
}, {
|
|
98
|
+
readonly path: "/playCard";
|
|
99
|
+
readonly action: (input: unknown) => PlayCardResult;
|
|
100
|
+
}, {
|
|
101
|
+
readonly path: "/reportNoPlayableCards";
|
|
102
|
+
readonly action: (input: unknown) => ReportNoPlayableCardsResult;
|
|
103
|
+
}, {
|
|
104
|
+
readonly path: "/sendChat";
|
|
105
|
+
readonly action: (input: unknown) => SendChatResult;
|
|
106
|
+
}, {
|
|
107
|
+
readonly path: "/startGame";
|
|
108
|
+
readonly action: (input: unknown) => StartGameResult;
|
|
109
|
+
}];
|
|
110
|
+
private createGame;
|
|
111
|
+
private drawCard;
|
|
112
|
+
private getClientStateAndClearEvents;
|
|
113
|
+
private getEventsAndClearAcknowledged;
|
|
114
|
+
private getJoinableGames;
|
|
115
|
+
private joinGame;
|
|
116
|
+
private leaveGame;
|
|
117
|
+
private playCard;
|
|
118
|
+
private reportNoPlayableCards;
|
|
119
|
+
private sendChat;
|
|
120
|
+
private startGame;
|
|
121
|
+
}
|
|
106
122
|
//#endregion
|
|
107
|
-
export {
|
|
108
|
-
//# sourceMappingURL=
|
|
123
|
+
export { GetJoinableGamesResult as a, PlayCardResult as c, Server as d, StartGameResult as f, GetEventsAndClearAcknowledgedResult as i, ReportNoPlayableCardsResult as l, DrawCardResult as n, JoinGameResult as o, GetClientStateAndClearEventsResult as r, LeaveGameResult as s, CreateGameResult as t, SendChatResult as u };
|
|
124
|
+
//# sourceMappingURL=index-J8s2QklC.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-J8s2QklC.d.mts","names":[],"sources":["../src/server/Server.ts"],"mappings":";;KAIY;WAEG;WACA;WACA;;WAGA;WACA;;KAGH;WAEG;;WAGA;WACA;;KAUH;WAEG;WACA,OAAO;;WAGP;WACA;;KAGH;WAEG;WACA,iBAAiB;;WAGjB;WACA;;KAGH;WACD;aACE;aACA;;;KAID;WAEG;WACA;;WAGA;WACA;;KAQH;WAEG;;WAGA;WACA;;KAGH;WAEG;;WAGA;WACA;;KAUH;WAEG;;WAGA;WACA;;KAWH;WAEG;;WAGA;WACA;;KAGH;WAEG;;WAGA;WACA;;cAiFF;mBACM;WAER;;aAuBkB,SAAA,gBAAM,qBAAqB;;;aAI9B,SAAA,mBAAU;;;aASzB,SAAA,mBACN;;;aAUM,SAAA,mBACN;;;aASyB,cAAA;;;aAKnB,SAAA,gBAAO,gBACA,qBAEb;;;aAQsB,SAAA,mBAAU;;;aAQX,SAAA,mBAAU;;;aAQG,SAAA,mBAAU;;;aAQvB,SAAA,mBAAU;;;aAQT,SAAA,mBAAU;;UAlF3B;UAIA;UAQA;UAWA;UAWA;UAIA;UAYA;UAQA;UAQA;UAQA;UAQA"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
//#region src/manager/types/Card.d.ts
|
|
2
|
+
type Card = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly rank: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14;
|
|
5
|
+
readonly suite: "clubs" | "diamonds" | "hearts" | "spades";
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/manager/types/ChatMessage.d.ts
|
|
9
|
+
type ChatMessage = {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly username: string;
|
|
12
|
+
readonly text: string;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/manager/types/ClientState.d.ts
|
|
16
|
+
type ClientState = {
|
|
17
|
+
readonly status: "open" | "started" | "completed" | "forfeited";
|
|
18
|
+
readonly gameId: string;
|
|
19
|
+
readonly playerId: string;
|
|
20
|
+
readonly username: string;
|
|
21
|
+
readonly players: readonly Player[];
|
|
22
|
+
readonly expiresAt: number;
|
|
23
|
+
readonly chatMessages: readonly ChatMessage[];
|
|
24
|
+
readonly hand: readonly Card[];
|
|
25
|
+
readonly canPlayAt: number | null;
|
|
26
|
+
};
|
|
27
|
+
type Player = {
|
|
28
|
+
readonly username: string;
|
|
29
|
+
readonly handSize: number;
|
|
30
|
+
readonly drawPileSize: number;
|
|
31
|
+
readonly sidePileSize: number;
|
|
32
|
+
readonly centerPileTopCard: Card | null;
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/manager/types/GameEvent.d.ts
|
|
36
|
+
type GameEvent = {
|
|
37
|
+
readonly type: "canPlayAtUpdated";
|
|
38
|
+
readonly id: string;
|
|
39
|
+
readonly canPlayAt: number;
|
|
40
|
+
} | {
|
|
41
|
+
readonly type: "cardDrawnFromSidePileToCenterPile";
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly username: string;
|
|
44
|
+
readonly card: Card;
|
|
45
|
+
} | {
|
|
46
|
+
readonly type: "cardPlayed";
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly username: string;
|
|
49
|
+
readonly card: Card;
|
|
50
|
+
readonly isForOtherPlayerPile: boolean;
|
|
51
|
+
} | {
|
|
52
|
+
readonly type: "chat";
|
|
53
|
+
readonly id: string;
|
|
54
|
+
readonly message: ChatMessage;
|
|
55
|
+
} | {
|
|
56
|
+
readonly type: "drewCard";
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly card: Card;
|
|
59
|
+
} | {
|
|
60
|
+
readonly type: "expirationUpdated";
|
|
61
|
+
readonly id: string;
|
|
62
|
+
readonly expiresAt: number;
|
|
63
|
+
} | {
|
|
64
|
+
readonly type: "gameCompleted";
|
|
65
|
+
readonly id: string;
|
|
66
|
+
} | {
|
|
67
|
+
readonly type: "gameForfeited";
|
|
68
|
+
readonly id: string;
|
|
69
|
+
} | {
|
|
70
|
+
readonly type: "gameStarted";
|
|
71
|
+
readonly id: string;
|
|
72
|
+
} | {
|
|
73
|
+
readonly type: "handInitialized";
|
|
74
|
+
readonly id: string;
|
|
75
|
+
readonly cards: readonly Card[];
|
|
76
|
+
} | {
|
|
77
|
+
readonly type: "playerCenterPileInitialized";
|
|
78
|
+
readonly id: string;
|
|
79
|
+
readonly username: string;
|
|
80
|
+
readonly card: Card;
|
|
81
|
+
} | {
|
|
82
|
+
readonly type: "playerDrawPileInitialized";
|
|
83
|
+
readonly id: string;
|
|
84
|
+
readonly username: string;
|
|
85
|
+
readonly numCards: number;
|
|
86
|
+
} | {
|
|
87
|
+
readonly type: "playerDrewCard";
|
|
88
|
+
readonly id: string;
|
|
89
|
+
readonly username: string;
|
|
90
|
+
} | {
|
|
91
|
+
readonly type: "playerHandInitialized";
|
|
92
|
+
readonly id: string;
|
|
93
|
+
readonly username: string;
|
|
94
|
+
readonly numCards: number;
|
|
95
|
+
} | {
|
|
96
|
+
readonly type: "playerJoined";
|
|
97
|
+
readonly id: string;
|
|
98
|
+
readonly username: string;
|
|
99
|
+
} | {
|
|
100
|
+
readonly type: "playerLeft";
|
|
101
|
+
readonly id: string;
|
|
102
|
+
readonly username: string;
|
|
103
|
+
} | {
|
|
104
|
+
readonly type: "playerSidePileInitialized";
|
|
105
|
+
readonly id: string;
|
|
106
|
+
readonly username: string;
|
|
107
|
+
readonly numCards: number;
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/manager/Manager.d.ts
|
|
111
|
+
type CreateGameResult = {
|
|
112
|
+
readonly success: true;
|
|
113
|
+
readonly gameId: string;
|
|
114
|
+
readonly playerId: string;
|
|
115
|
+
} | {
|
|
116
|
+
readonly success: false;
|
|
117
|
+
readonly error: "maxGamesReached";
|
|
118
|
+
};
|
|
119
|
+
type DrawCardResult = {
|
|
120
|
+
readonly success: true;
|
|
121
|
+
} | {
|
|
122
|
+
readonly success: false;
|
|
123
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "handFull" | "drawPileEmpty";
|
|
124
|
+
};
|
|
125
|
+
type GetClientStateAndClearEventsResult = {
|
|
126
|
+
readonly success: true;
|
|
127
|
+
readonly state: ClientState;
|
|
128
|
+
} | {
|
|
129
|
+
readonly success: false;
|
|
130
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
131
|
+
};
|
|
132
|
+
type GetEventsAndClearAcknowledgedResult = {
|
|
133
|
+
readonly success: true;
|
|
134
|
+
readonly events: readonly GameEvent[];
|
|
135
|
+
} | {
|
|
136
|
+
readonly success: false;
|
|
137
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
138
|
+
};
|
|
139
|
+
type GetJoinableGamesResult = {
|
|
140
|
+
readonly games: readonly {
|
|
141
|
+
readonly id: string;
|
|
142
|
+
readonly numPlayers: number;
|
|
143
|
+
}[];
|
|
144
|
+
};
|
|
145
|
+
type JoinGameResult = {
|
|
146
|
+
readonly success: true;
|
|
147
|
+
readonly playerId: string;
|
|
148
|
+
} | {
|
|
149
|
+
readonly success: false;
|
|
150
|
+
readonly error: "gameNotFound" | "invalidStatus" | "maxPlayersReached" | "alreadyInGame";
|
|
151
|
+
};
|
|
152
|
+
type LeaveGameResult = {
|
|
153
|
+
readonly success: true;
|
|
154
|
+
} | {
|
|
155
|
+
readonly success: false;
|
|
156
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
157
|
+
};
|
|
158
|
+
type PlayCardResult = {
|
|
159
|
+
readonly success: true;
|
|
160
|
+
} | {
|
|
161
|
+
readonly success: false;
|
|
162
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "cardNotFound" | "cardNotPlayable";
|
|
163
|
+
};
|
|
164
|
+
type ReportNoPlayableCardsResult = {
|
|
165
|
+
readonly success: true;
|
|
166
|
+
} | {
|
|
167
|
+
readonly success: false;
|
|
168
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "alreadyReported" | "hasPlayableCard" | "canDraw";
|
|
169
|
+
};
|
|
170
|
+
type SendChatResult = {
|
|
171
|
+
readonly success: true;
|
|
172
|
+
} | {
|
|
173
|
+
readonly success: false;
|
|
174
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
175
|
+
};
|
|
176
|
+
type StartGameResult = {
|
|
177
|
+
readonly success: true;
|
|
178
|
+
} | {
|
|
179
|
+
readonly success: false;
|
|
180
|
+
readonly error: "gameNotFound" | "invalidStatus" | "playerNotFound" | "playerNotAdmin" | "minPlayersNotReached";
|
|
181
|
+
};
|
|
182
|
+
declare class Manager {
|
|
183
|
+
private readonly games;
|
|
184
|
+
private readonly watchdog;
|
|
185
|
+
constructor();
|
|
186
|
+
createGame(userId: string, username: string): CreateGameResult;
|
|
187
|
+
drawCard(gameId: string, playerId: string): DrawCardResult;
|
|
188
|
+
getClientStateAndClearEvents(gameId: string, playerId: string): GetClientStateAndClearEventsResult;
|
|
189
|
+
getEventsAndClearAcknowledged(gameId: string, playerId: string, lastReadId: string | null): GetEventsAndClearAcknowledgedResult;
|
|
190
|
+
getJoinableGames(): GetJoinableGamesResult;
|
|
191
|
+
joinGame(gameId: string, userId: string, username: string): JoinGameResult;
|
|
192
|
+
leaveGame(gameId: string, playerId: string): LeaveGameResult;
|
|
193
|
+
playCard(gameId: string, playerId: string, cardId: string, isForOtherPlayerPile: boolean): PlayCardResult;
|
|
194
|
+
reportNoPlayableCards(gameId: string, playerId: string): ReportNoPlayableCardsResult;
|
|
195
|
+
sendChat(gameId: string, playerId: string, text: string): SendChatResult;
|
|
196
|
+
startGame(gameId: string, playerId: string): StartGameResult;
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
199
|
+
export { GetJoinableGamesResult as a, Manager as c, SendChatResult as d, StartGameResult as f, Card as g, ChatMessage as h, GetEventsAndClearAcknowledgedResult as i, PlayCardResult as l, ClientState as m, DrawCardResult as n, JoinGameResult as o, GameEvent as p, GetClientStateAndClearEventsResult as r, LeaveGameResult as s, CreateGameResult as t, ReportNoPlayableCardsResult as u };
|
|
200
|
+
//# sourceMappingURL=index-YAYbNr-s.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-YAYbNr-s.d.cts","names":[],"sources":["../src/manager/types/Card.ts","../src/manager/types/ChatMessage.ts","../src/manager/types/ClientState.ts","../src/manager/types/GameEvent.ts","../src/manager/Manager.ts"],"mappings":";KAAY;WACD;WACA;WACA;;;;KCHC;WACD;WACA;WACA;;;;KCAC;WACD;WACA;WACA;WACA;WACA,kBAAkB;WAClB;WACA,uBAAuB;WACvB,eAAe;WACf;;KAGN;WACM;WACA;WACA;WACA;WACA,mBAAmB;;;;KCjBlB;WAEG;WACA;WACA;;WAGA;WACA;WACA;WACA,MAAM;;WAGN;WACA;WACA;WACA,MAAM;WACN;;WAGA;WACA;WACA,SAAS;;WAGT;WACA;WACA,MAAM;;WAGN;WACA;WACA;;WAGA;WACA;;WAGA;WACA;;WAGA;WACA;;WAGA;WACA;WACA,gBAAgB;;WAGhB;WACA;WACA;WACA,MAAM;;WAGN;WACA;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;WACA;;;;KCtEH;WAEG;WACA;WACA;;WAGA;WACA;;KAGH;WAEG;;WAGA;WACA;;KASH;WAEG;WACA,OAAO;;WAGP;WACA;;KAGH;WAEG;WACA,iBAAiB;;WAGjB;WACA;;KAGH;WACD;aACE;aACA;;;KAID;WAEG;WACA;;WAGA;WACA;;KAOH;WAEG;;WAGA;WACA;;KAGH;WAEG;;WAGA;WACA;;KASH;WAEG;;WAGA;WACA;;KAUH;WAEG;;WAGA;WACA;;KAGH;WAEG;;WAGA;WACA;;cAQF;mBACM;mBACA;;EAQjB,WAAW,gBAAgB,mBAAmB;EA4B9C,SAAS,gBAAgB,mBAAmB;EA8B5C,6BACE,gBACA,mBACC;EAgCH,8BACE,gBACA,kBACA,4BACC;EAgBH,oBAAoB;EAWpB,SAAS,gBAAgB,gBAAgB,mBAAmB;EA8B5D,UAAU,gBAAgB,mBAAmB;EAkC7C,SACE,gBACA,kBACA,gBACA,gCACC;EAwDH,sBACE,gBACA,mBACC;EAuFH,SAAS,gBAAgB,kBAAkB,eAAe;EAmB1D,UAAU,gBAAgB,mBAAmB"}
|