@hellacardgames/speed 0.8.1 → 0.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/ClientState-Dx8UvhMt.d.cts +111 -0
- package/dist/ClientState-Dx8UvhMt.d.cts.map +1 -0
- package/dist/ClientState-Dx8UvhMt.d.mts +111 -0
- package/dist/ClientState-Dx8UvhMt.d.mts.map +1 -0
- package/dist/client/index.cjs +60 -10
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +89 -14
- package/dist/client/index.d.cts.map +1 -1
- package/dist/client/index.d.mts +89 -14
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +60 -10
- package/dist/client/index.mjs.map +1 -1
- package/dist/manager/index.cjs +2 -2
- package/dist/manager/index.d.cts +140 -2
- package/dist/manager/index.d.cts.map +1 -0
- package/dist/manager/index.d.mts +140 -2
- package/dist/manager/index.d.mts.map +1 -0
- package/dist/manager/index.mjs +2 -2
- package/dist/{manager-0r8lvLRR.cjs → manager-B7gHPSPL.cjs} +70 -154
- package/dist/manager-B7gHPSPL.cjs.map +1 -0
- package/dist/{manager-B32oi0dB.mjs → manager-C6kRM9IW.mjs} +70 -154
- package/dist/manager-C6kRM9IW.mjs.map +1 -0
- package/dist/server/index.cjs +45 -165
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +149 -3
- package/dist/server/index.d.cts.map +1 -0
- package/dist/server/index.d.mts +149 -3
- package/dist/server/index.d.mts.map +1 -0
- package/dist/server/index.mjs +45 -165
- package/dist/server/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/index-CVbiOmI3.d.mts +0 -125
- package/dist/index-CVbiOmI3.d.mts.map +0 -1
- package/dist/index-DOimW07r.d.cts +0 -125
- package/dist/index-DOimW07r.d.cts.map +0 -1
- package/dist/index-DlRknHKq.d.cts +0 -247
- package/dist/index-DlRknHKq.d.cts.map +0 -1
- package/dist/index-DlRknHKq.d.mts +0 -247
- package/dist/index-DlRknHKq.d.mts.map +0 -1
- package/dist/manager-0r8lvLRR.cjs.map +0 -1
- package/dist/manager-B32oi0dB.mjs.map +0 -1
package/dist/client/index.d.mts
CHANGED
|
@@ -1,21 +1,96 @@
|
|
|
1
|
-
import {
|
|
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-CVbiOmI3.mjs";
|
|
1
|
+
import { i as Card, n as GameEvent, r as ChatMessage, t as ClientState } from "../ClientState-Dx8UvhMt.mjs";
|
|
3
2
|
//#region src/client/Client.d.ts
|
|
4
3
|
declare class Client {
|
|
5
4
|
private readonly baseUrl;
|
|
6
5
|
constructor(baseUrl: string);
|
|
7
|
-
createGame(accessToken: string): Promise<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
createGame(accessToken: string): Promise<{
|
|
7
|
+
readonly success: true;
|
|
8
|
+
readonly gameId: string;
|
|
9
|
+
readonly playerId: string;
|
|
10
|
+
} | {
|
|
11
|
+
readonly success: false;
|
|
12
|
+
readonly error: "maxGamesReached";
|
|
13
|
+
}>;
|
|
14
|
+
drawCard(gameId: string, playerId: string): Promise<{
|
|
15
|
+
readonly success: true;
|
|
16
|
+
readonly error?: never;
|
|
17
|
+
} | {
|
|
18
|
+
readonly success: false;
|
|
19
|
+
readonly error: "playerNotFound" | "gameNotFound" | "invalidStatus" | "canPlayAtNotReached" | "handFull" | "drawPileEmpty" | "invalidInput";
|
|
20
|
+
}>;
|
|
21
|
+
getClientStateAndClearEvents(gameId: string, playerId: string): Promise<{
|
|
22
|
+
readonly success: true;
|
|
23
|
+
readonly state: ClientState;
|
|
24
|
+
} | {
|
|
25
|
+
readonly success: false;
|
|
26
|
+
readonly error: "playerNotFound" | "gameNotFound" | "invalidInput";
|
|
27
|
+
}>;
|
|
28
|
+
getEventsAndClearAcknowledged(gameId: string, playerId: string, lastReadId: string | null): Promise<{
|
|
29
|
+
readonly success: true;
|
|
30
|
+
readonly events: readonly GameEvent[];
|
|
31
|
+
} | {
|
|
32
|
+
readonly success: false;
|
|
33
|
+
readonly error: "playerNotFound" | "gameNotFound" | "invalidInput";
|
|
34
|
+
}>;
|
|
35
|
+
getJoinableGames(): Promise<{
|
|
36
|
+
readonly games: readonly {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly numPlayers: number;
|
|
39
|
+
}[];
|
|
40
|
+
}>;
|
|
41
|
+
joinGame(gameId: string, accessToken: string): Promise<{
|
|
42
|
+
readonly success: true;
|
|
43
|
+
readonly playerId: string;
|
|
44
|
+
} | {
|
|
45
|
+
readonly success: false;
|
|
46
|
+
readonly error: "maxPlayersReached" | "alreadyInGame" | "gameNotFound" | "invalidStatus" | "invalidInput";
|
|
47
|
+
}>;
|
|
48
|
+
leaveGame(gameId: string, playerId: string): Promise<{
|
|
49
|
+
readonly success: true;
|
|
50
|
+
} | {
|
|
51
|
+
readonly success: false;
|
|
52
|
+
readonly error: "playerNotFound" | "gameNotFound" | "invalidInput";
|
|
53
|
+
}>;
|
|
54
|
+
playCard(gameId: string, playerId: string, cardId: string, isForOtherPlayerPile: boolean): Promise<{
|
|
55
|
+
readonly success: true;
|
|
56
|
+
readonly error?: never;
|
|
57
|
+
} | {
|
|
58
|
+
readonly success: false;
|
|
59
|
+
readonly error: "playerNotFound" | "gameNotFound" | "invalidStatus" | "canPlayAtNotReached" | "cardNotFound" | "cardNotPlayable" | "invalidInput";
|
|
60
|
+
}>;
|
|
61
|
+
reportNoPlayableCards(gameId: string, playerId: string): Promise<{
|
|
62
|
+
readonly success: true;
|
|
63
|
+
readonly error?: never;
|
|
64
|
+
} | {
|
|
65
|
+
readonly success: false;
|
|
66
|
+
readonly error: "playerNotFound" | "gameNotFound" | "invalidStatus" | "canPlayAtNotReached" | "alreadyReported" | "hasPlayableCard" | "canDraw" | "invalidInput";
|
|
67
|
+
}>;
|
|
68
|
+
sendChat(gameId: string, playerId: string, text: string): Promise<{
|
|
69
|
+
readonly success: true;
|
|
70
|
+
} | {
|
|
71
|
+
readonly success: false;
|
|
72
|
+
readonly error: "playerNotFound" | "gameNotFound" | "invalidInput";
|
|
73
|
+
}>;
|
|
74
|
+
startGame(gameId: string, playerId: string): Promise<{
|
|
75
|
+
readonly success: true;
|
|
76
|
+
} | {
|
|
77
|
+
readonly success: false;
|
|
78
|
+
readonly error: "playerNotFound" | "playerNotAdmin" | "minPlayersNotReached" | "gameNotFound" | "invalidStatus" | "invalidInput";
|
|
79
|
+
}>;
|
|
18
80
|
}
|
|
19
81
|
//#endregion
|
|
20
|
-
|
|
82
|
+
//#region src/client/index.d.ts
|
|
83
|
+
type CreateGameResult = Awaited<ReturnType<Client["createGame"]>>;
|
|
84
|
+
type DrawCardResult = Awaited<ReturnType<Client["drawCard"]>>;
|
|
85
|
+
type GetClientStateAndClearEventsResult = Awaited<ReturnType<Client["getClientStateAndClearEvents"]>>;
|
|
86
|
+
type GetEventsAndClearAcknowledgedResult = Awaited<ReturnType<Client["getEventsAndClearAcknowledged"]>>;
|
|
87
|
+
type GetJoinableGamesResult = Awaited<ReturnType<Client["getJoinableGames"]>>;
|
|
88
|
+
type JoinGameResult = Awaited<ReturnType<Client["joinGame"]>>;
|
|
89
|
+
type LeaveGameResult = Awaited<ReturnType<Client["leaveGame"]>>;
|
|
90
|
+
type PlayCardResult = Awaited<ReturnType<Client["playCard"]>>;
|
|
91
|
+
type ReportNoPlayableCards = Awaited<ReturnType<Client["reportNoPlayableCards"]>>;
|
|
92
|
+
type SendChatResult = Awaited<ReturnType<Client["sendChat"]>>;
|
|
93
|
+
type StartGameResult = Awaited<ReturnType<Client["startGame"]>>;
|
|
94
|
+
//#endregion
|
|
95
|
+
export { type Card, type ChatMessage, Client, type ClientState, CreateGameResult, DrawCardResult, type GameEvent, GetClientStateAndClearEventsResult, GetEventsAndClearAcknowledgedResult, GetJoinableGamesResult, JoinGameResult, LeaveGameResult, PlayCardResult, ReportNoPlayableCards, SendChatResult, StartGameResult };
|
|
21
96
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -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","../../src/client/index.ts"],"mappings":";;cAYa;mBACM;EAEL,YAAA;EAIN,WAAW,sBAAmB;;;;;;;;EAc9B,SAAS,gBAAgB,mBAAgB;;;;;;;EAezC,6BAA6B,gBAAgB,mBAAgB;;oBAfpB;;;;;EAkCzC,8BACJ,gBACA,kBACA,4BAAyB;;8BAtBwC;;;;;EA0C7D,oBAAgB;;;;;;EAShB,SAAS,gBAAgB,sBAAmB;;;;;;;EAgB5C,UAAU,gBAAgB,mBAAgB;;;;;;EAe1C,SACJ,gBACA,kBACA,gBACA,gCAA6B;;;;;;;EAgBzB,sBAAsB,gBAAgB,mBAAgB;;;;;;;EAgBtD,SAAS,gBAAgB,kBAAkB,eAAY;;;;;;EAevD,UAAU,gBAAgB,mBAAgB;;;;;;;;;KClLtC,mBAAmB,QAAQ,WAAW;KACtC,iBAAiB,QAAQ,WAAW;KACpC,qCAAqC,QAC/C,WAAW;KAED,sCAAsC,QAChD,WAAW;KAED,yBAAyB,QACnC,WAAW;KAED,iBAAiB,QAAQ,WAAW;KACpC,kBAAkB,QAAQ,WAAW;KACrC,iBAAiB,QAAQ,WAAW;KACpC,wBAAwB,QAClC,WAAW;KAED,iBAAiB,QAAQ,WAAW;KACpC,kBAAkB,QAAQ,WAAW"}
|
package/dist/client/index.mjs
CHANGED
|
@@ -5,13 +5,18 @@ var Client = class {
|
|
|
5
5
|
this.baseUrl = baseUrl;
|
|
6
6
|
}
|
|
7
7
|
async createGame(accessToken) {
|
|
8
|
-
|
|
8
|
+
const result = await (await fetch(`${this.baseUrl}/createGame`, {
|
|
9
9
|
method: "POST",
|
|
10
10
|
headers: { Authorization: `Bearer ${accessToken}` }
|
|
11
11
|
})).json();
|
|
12
|
+
if (!result.success) return {
|
|
13
|
+
success: false,
|
|
14
|
+
error: result.error
|
|
15
|
+
};
|
|
16
|
+
return result;
|
|
12
17
|
}
|
|
13
18
|
async drawCard(gameId, playerId) {
|
|
14
|
-
|
|
19
|
+
const result = await (await fetch(`${this.baseUrl}/drawCard`, {
|
|
15
20
|
method: "POST",
|
|
16
21
|
headers: { "Content-Type": "application/json" },
|
|
17
22
|
body: JSON.stringify({
|
|
@@ -19,9 +24,14 @@ var Client = class {
|
|
|
19
24
|
playerId
|
|
20
25
|
})
|
|
21
26
|
})).json();
|
|
27
|
+
if (!result.success) return {
|
|
28
|
+
success: false,
|
|
29
|
+
error: result.error
|
|
30
|
+
};
|
|
31
|
+
return result;
|
|
22
32
|
}
|
|
23
33
|
async getClientStateAndClearEvents(gameId, playerId) {
|
|
24
|
-
|
|
34
|
+
const result = await (await fetch(`${this.baseUrl}/getClientStateAndClearEvents`, {
|
|
25
35
|
method: "POST",
|
|
26
36
|
headers: { "Content-Type": "application/json" },
|
|
27
37
|
body: JSON.stringify({
|
|
@@ -29,9 +39,14 @@ var Client = class {
|
|
|
29
39
|
playerId
|
|
30
40
|
})
|
|
31
41
|
})).json();
|
|
42
|
+
if (!result.success) return {
|
|
43
|
+
success: false,
|
|
44
|
+
error: result.error
|
|
45
|
+
};
|
|
46
|
+
return result;
|
|
32
47
|
}
|
|
33
48
|
async getEventsAndClearAcknowledged(gameId, playerId, lastReadId) {
|
|
34
|
-
|
|
49
|
+
const result = await (await fetch(`${this.baseUrl}/getEventsAndClearAcknowledged`, {
|
|
35
50
|
method: "POST",
|
|
36
51
|
headers: { "Content-Type": "application/json" },
|
|
37
52
|
body: JSON.stringify({
|
|
@@ -40,12 +55,17 @@ var Client = class {
|
|
|
40
55
|
lastReadId
|
|
41
56
|
})
|
|
42
57
|
})).json();
|
|
58
|
+
if (!result.success) return {
|
|
59
|
+
success: false,
|
|
60
|
+
error: result.error
|
|
61
|
+
};
|
|
62
|
+
return result;
|
|
43
63
|
}
|
|
44
64
|
async getJoinableGames() {
|
|
45
65
|
return await (await fetch(`${this.baseUrl}/getJoinableGames`, { method: "POST" })).json();
|
|
46
66
|
}
|
|
47
67
|
async joinGame(gameId, accessToken) {
|
|
48
|
-
|
|
68
|
+
const result = await (await fetch(`${this.baseUrl}/joinGame`, {
|
|
49
69
|
method: "POST",
|
|
50
70
|
headers: {
|
|
51
71
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -53,9 +73,14 @@ var Client = class {
|
|
|
53
73
|
},
|
|
54
74
|
body: JSON.stringify({ gameId })
|
|
55
75
|
})).json();
|
|
76
|
+
if (!result.success) return {
|
|
77
|
+
success: false,
|
|
78
|
+
error: result.error
|
|
79
|
+
};
|
|
80
|
+
return result;
|
|
56
81
|
}
|
|
57
82
|
async leaveGame(gameId, playerId) {
|
|
58
|
-
|
|
83
|
+
const result = await (await fetch(`${this.baseUrl}/leaveGame`, {
|
|
59
84
|
method: "POST",
|
|
60
85
|
headers: { "Content-Type": "application/json" },
|
|
61
86
|
body: JSON.stringify({
|
|
@@ -63,9 +88,14 @@ var Client = class {
|
|
|
63
88
|
playerId
|
|
64
89
|
})
|
|
65
90
|
})).json();
|
|
91
|
+
if (!result.success) return {
|
|
92
|
+
success: false,
|
|
93
|
+
error: result.error
|
|
94
|
+
};
|
|
95
|
+
return result;
|
|
66
96
|
}
|
|
67
97
|
async playCard(gameId, playerId, cardId, isForOtherPlayerPile) {
|
|
68
|
-
|
|
98
|
+
const result = await (await fetch(`${this.baseUrl}/playCard`, {
|
|
69
99
|
method: "POST",
|
|
70
100
|
headers: { "Content-Type": "application/json" },
|
|
71
101
|
body: JSON.stringify({
|
|
@@ -75,9 +105,14 @@ var Client = class {
|
|
|
75
105
|
isForOtherPlayerPile
|
|
76
106
|
})
|
|
77
107
|
})).json();
|
|
108
|
+
if (!result.success) return {
|
|
109
|
+
success: false,
|
|
110
|
+
error: result.error
|
|
111
|
+
};
|
|
112
|
+
return result;
|
|
78
113
|
}
|
|
79
114
|
async reportNoPlayableCards(gameId, playerId) {
|
|
80
|
-
|
|
115
|
+
const result = await (await fetch(`${this.baseUrl}/reportNoPlayableCards`, {
|
|
81
116
|
method: "POST",
|
|
82
117
|
headers: { "Content-Type": "application/json" },
|
|
83
118
|
body: JSON.stringify({
|
|
@@ -85,9 +120,14 @@ var Client = class {
|
|
|
85
120
|
playerId
|
|
86
121
|
})
|
|
87
122
|
})).json();
|
|
123
|
+
if (!result.success) return {
|
|
124
|
+
success: false,
|
|
125
|
+
error: result.error
|
|
126
|
+
};
|
|
127
|
+
return result;
|
|
88
128
|
}
|
|
89
129
|
async sendChat(gameId, playerId, text) {
|
|
90
|
-
|
|
130
|
+
const result = await (await fetch(`${this.baseUrl}/sendChat`, {
|
|
91
131
|
method: "POST",
|
|
92
132
|
headers: { "Content-Type": "application/json" },
|
|
93
133
|
body: JSON.stringify({
|
|
@@ -96,9 +136,14 @@ var Client = class {
|
|
|
96
136
|
text
|
|
97
137
|
})
|
|
98
138
|
})).json();
|
|
139
|
+
if (!result.success) return {
|
|
140
|
+
success: false,
|
|
141
|
+
error: result.error
|
|
142
|
+
};
|
|
143
|
+
return result;
|
|
99
144
|
}
|
|
100
145
|
async startGame(gameId, playerId) {
|
|
101
|
-
|
|
146
|
+
const result = await (await fetch(`${this.baseUrl}/startGame`, {
|
|
102
147
|
method: "POST",
|
|
103
148
|
headers: { "Content-Type": "application/json" },
|
|
104
149
|
body: JSON.stringify({
|
|
@@ -106,6 +151,11 @@ var Client = class {
|
|
|
106
151
|
playerId
|
|
107
152
|
})
|
|
108
153
|
})).json();
|
|
154
|
+
if (!result.success) return {
|
|
155
|
+
success: false,
|
|
156
|
+
error: result.error
|
|
157
|
+
};
|
|
158
|
+
return result;
|
|
109
159
|
}
|
|
110
160
|
};
|
|
111
161
|
//#endregion
|
|
@@ -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 { createServer } from \"../server/index.js\";\n\ntype Server = ReturnType<typeof createServer>;\n\ntype ServerResult<\n TServer extends {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n actions: readonly { path: string; action: (...args: any[]) => any }[];\n },\n TPath extends TServer[\"actions\"][number][\"path\"],\n> = ReturnType<Extract<TServer[\"actions\"][number], { path: TPath }>[\"action\"]>;\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) {\n const response = await fetch(`${this.baseUrl}/createGame`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n });\n const result: ServerResult<Server, \"/createGame\"> = await response.json();\n if (!result.success) {\n return { success: false, error: result.error } as const;\n }\n return result;\n }\n\n async drawCard(gameId: string, playerId: string) {\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: ServerResult<Server, \"/drawCard\"> = await response.json();\n if (!result.success) {\n return { success: false, error: result.error } as const;\n }\n return result;\n }\n\n async getClientStateAndClearEvents(gameId: string, playerId: string) {\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: ServerResult<Server, \"/getClientStateAndClearEvents\"> =\n await response.json();\n if (!result.success) {\n return { success: false, error: result.error } as const;\n }\n return result;\n }\n\n async getEventsAndClearAcknowledged(\n gameId: string,\n playerId: string,\n lastReadId: string | null,\n ) {\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: ServerResult<Server, \"/getEventsAndClearAcknowledged\"> =\n await response.json();\n if (!result.success) {\n return { success: false, error: result.error } as const;\n }\n return result;\n }\n\n async getJoinableGames() {\n const response = await fetch(`${this.baseUrl}/getJoinableGames`, {\n method: \"POST\",\n });\n const result: ServerResult<Server, \"/getJoinableGames\"> =\n await response.json();\n return result;\n }\n\n async joinGame(gameId: string, accessToken: string) {\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: ServerResult<Server, \"/joinGame\"> = await response.json();\n if (!result.success) {\n return { success: false, error: result.error } as const;\n }\n return result;\n }\n\n async leaveGame(gameId: string, playerId: string) {\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: ServerResult<Server, \"/leaveGame\"> = await response.json();\n if (!result.success) {\n return { success: false, error: result.error } as const;\n }\n return result;\n }\n\n async playCard(\n gameId: string,\n playerId: string,\n cardId: string,\n isForOtherPlayerPile: boolean,\n ) {\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: ServerResult<Server, \"/playCard\"> = await response.json();\n if (!result.success) {\n return { success: false, error: result.error } as const;\n }\n return result;\n }\n\n async reportNoPlayableCards(gameId: string, playerId: string) {\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: ServerResult<Server, \"/reportNoPlayableCards\"> =\n await response.json();\n if (!result.success) {\n return { success: false, error: result.error } as const;\n }\n return result;\n }\n\n async sendChat(gameId: string, playerId: string, text: string) {\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: ServerResult<Server, \"/sendChat\"> = await response.json();\n if (!result.success) {\n return { success: false, error: result.error } as const;\n }\n return result;\n }\n\n async startGame(gameId: string, playerId: string) {\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: ServerResult<Server, \"/startGame\"> = await response.json();\n if (!result.success) {\n return { success: false, error: result.error } as const;\n }\n return result;\n }\n}\n"],"mappings":"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"}
|
package/dist/manager/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_manager = require("../manager-
|
|
3
|
-
exports.
|
|
2
|
+
const require_manager = require("../manager-B7gHPSPL.cjs");
|
|
3
|
+
exports.createManager = require_manager.createManager;
|
package/dist/manager/index.d.cts
CHANGED
|
@@ -1,2 +1,140 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { n as GameEvent, t as ClientState } from "../ClientState-Dx8UvhMt.cjs";
|
|
2
|
+
//#region src/manager/createManager.d.ts
|
|
3
|
+
declare const createManager: (logKey: string, maxGames: number, watchdogIntervalMs: number) => {
|
|
4
|
+
readonly createGame: (userId: string, username: string) => {
|
|
5
|
+
readonly success: false;
|
|
6
|
+
readonly error: "maxGamesReached";
|
|
7
|
+
readonly gameId?: never;
|
|
8
|
+
readonly playerId?: never;
|
|
9
|
+
} | {
|
|
10
|
+
readonly success: true;
|
|
11
|
+
readonly gameId: string;
|
|
12
|
+
readonly playerId: string;
|
|
13
|
+
readonly error?: never;
|
|
14
|
+
};
|
|
15
|
+
readonly getClientStateAndClearEvents: (gameId: string, playerId: string) => {
|
|
16
|
+
readonly success: false;
|
|
17
|
+
readonly error: "gameNotFound";
|
|
18
|
+
readonly state?: never;
|
|
19
|
+
} | {
|
|
20
|
+
readonly success: false;
|
|
21
|
+
readonly error: "playerNotFound";
|
|
22
|
+
readonly state?: never;
|
|
23
|
+
} | {
|
|
24
|
+
readonly success: true;
|
|
25
|
+
readonly state: ClientState;
|
|
26
|
+
readonly error?: never;
|
|
27
|
+
};
|
|
28
|
+
readonly getEventsAndClearAcknowledged: (gameId: string, playerId: string, lastReadId: string | null) => {
|
|
29
|
+
readonly success: false;
|
|
30
|
+
readonly error: "gameNotFound";
|
|
31
|
+
readonly events?: never;
|
|
32
|
+
} | {
|
|
33
|
+
readonly success: false;
|
|
34
|
+
readonly error: "playerNotFound";
|
|
35
|
+
readonly events?: never;
|
|
36
|
+
} | {
|
|
37
|
+
readonly success: true;
|
|
38
|
+
readonly events: readonly GameEvent[];
|
|
39
|
+
readonly error?: never;
|
|
40
|
+
};
|
|
41
|
+
readonly getJoinableGames: () => {
|
|
42
|
+
readonly games: readonly {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly numPlayers: number;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
readonly joinGame: (gameId: string, userId: string, username: string) => {
|
|
48
|
+
readonly success: false;
|
|
49
|
+
readonly error: "gameNotFound";
|
|
50
|
+
readonly playerId?: never;
|
|
51
|
+
} | {
|
|
52
|
+
readonly success: false;
|
|
53
|
+
readonly error: "invalidStatus";
|
|
54
|
+
readonly playerId?: never;
|
|
55
|
+
} | {
|
|
56
|
+
readonly success: true;
|
|
57
|
+
readonly playerId: string;
|
|
58
|
+
readonly error?: never;
|
|
59
|
+
} | {
|
|
60
|
+
readonly success: false;
|
|
61
|
+
readonly error: "maxPlayersReached" | "alreadyInGame";
|
|
62
|
+
readonly playerId?: never;
|
|
63
|
+
};
|
|
64
|
+
readonly leaveGame: (gameId: string, playerId: string) => {
|
|
65
|
+
readonly success: false;
|
|
66
|
+
readonly error: "gameNotFound";
|
|
67
|
+
} | {
|
|
68
|
+
readonly success: true;
|
|
69
|
+
readonly error?: never;
|
|
70
|
+
} | {
|
|
71
|
+
readonly success: false;
|
|
72
|
+
readonly error: "playerNotFound";
|
|
73
|
+
};
|
|
74
|
+
readonly sendChat: (gameId: string, playerId: string, text: string) => {
|
|
75
|
+
readonly success: false;
|
|
76
|
+
readonly error: "gameNotFound";
|
|
77
|
+
} | {
|
|
78
|
+
readonly success: true;
|
|
79
|
+
readonly error?: never;
|
|
80
|
+
} | {
|
|
81
|
+
readonly success: false;
|
|
82
|
+
readonly error: "playerNotFound";
|
|
83
|
+
};
|
|
84
|
+
readonly startGame: (gameId: string, playerId: string) => {
|
|
85
|
+
readonly success: false;
|
|
86
|
+
readonly error: "gameNotFound";
|
|
87
|
+
} | {
|
|
88
|
+
readonly success: false;
|
|
89
|
+
readonly error: "invalidStatus";
|
|
90
|
+
} | {
|
|
91
|
+
readonly success: true;
|
|
92
|
+
readonly error?: never;
|
|
93
|
+
} | {
|
|
94
|
+
readonly success: false;
|
|
95
|
+
readonly error: "playerNotFound" | "playerNotAdmin" | "minPlayersNotReached";
|
|
96
|
+
};
|
|
97
|
+
} & Readonly<{
|
|
98
|
+
drawCard: (gameId: string, playerId: string) => {
|
|
99
|
+
readonly success: false;
|
|
100
|
+
readonly error: "gameNotFound";
|
|
101
|
+
} | {
|
|
102
|
+
readonly success: false;
|
|
103
|
+
readonly error: "invalidStatus";
|
|
104
|
+
} | {
|
|
105
|
+
readonly success: false;
|
|
106
|
+
readonly error: "playerNotFound" | "canPlayAtNotReached" | "handFull" | "drawPileEmpty";
|
|
107
|
+
} | {
|
|
108
|
+
readonly success: true;
|
|
109
|
+
readonly error?: never;
|
|
110
|
+
};
|
|
111
|
+
playCard: (gameId: string, playerId: string, cardId: string, isForOtherPlayerPile: boolean) => {
|
|
112
|
+
readonly success: false;
|
|
113
|
+
readonly error: "gameNotFound";
|
|
114
|
+
} | {
|
|
115
|
+
readonly success: false;
|
|
116
|
+
readonly error: "invalidStatus";
|
|
117
|
+
} | {
|
|
118
|
+
readonly success: false;
|
|
119
|
+
readonly error: "playerNotFound" | "canPlayAtNotReached" | "cardNotFound" | "cardNotPlayable";
|
|
120
|
+
} | {
|
|
121
|
+
readonly success: true;
|
|
122
|
+
readonly error?: never;
|
|
123
|
+
};
|
|
124
|
+
reportNoPlayableCards: (gameId: string, playerId: string) => {
|
|
125
|
+
readonly success: false;
|
|
126
|
+
readonly error: "gameNotFound";
|
|
127
|
+
} | {
|
|
128
|
+
readonly success: false;
|
|
129
|
+
readonly error: "invalidStatus";
|
|
130
|
+
} | {
|
|
131
|
+
readonly success: false;
|
|
132
|
+
readonly error: "playerNotFound" | "canPlayAtNotReached" | "alreadyReported" | "hasPlayableCard" | "canDraw";
|
|
133
|
+
} | {
|
|
134
|
+
readonly success: true;
|
|
135
|
+
readonly error?: never;
|
|
136
|
+
};
|
|
137
|
+
}>;
|
|
138
|
+
//#endregion
|
|
139
|
+
export { createManager };
|
|
140
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/manager/createManager.ts"],"mappings":";;cAea,gBAAa,gBAAA,kBAAA;;;;aA8DgmD;aAA+B;;;;;aAA4H;;;;;;;;;;;;oBA9DxwD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUU,WAAA,gBAAM;;;;;;;;;;;;;EAgBf,WAAA,gBAAM,kBACE,gBACF;;;;;;;;;;;;;EAiBgB,wBAAA,gBAAM"}
|
package/dist/manager/index.d.mts
CHANGED
|
@@ -1,2 +1,140 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { n as GameEvent, t as ClientState } from "../ClientState-Dx8UvhMt.mjs";
|
|
2
|
+
//#region src/manager/createManager.d.ts
|
|
3
|
+
declare const createManager: (logKey: string, maxGames: number, watchdogIntervalMs: number) => {
|
|
4
|
+
readonly createGame: (userId: string, username: string) => {
|
|
5
|
+
readonly success: false;
|
|
6
|
+
readonly error: "maxGamesReached";
|
|
7
|
+
readonly gameId?: never;
|
|
8
|
+
readonly playerId?: never;
|
|
9
|
+
} | {
|
|
10
|
+
readonly success: true;
|
|
11
|
+
readonly gameId: string;
|
|
12
|
+
readonly playerId: string;
|
|
13
|
+
readonly error?: never;
|
|
14
|
+
};
|
|
15
|
+
readonly getClientStateAndClearEvents: (gameId: string, playerId: string) => {
|
|
16
|
+
readonly success: false;
|
|
17
|
+
readonly error: "gameNotFound";
|
|
18
|
+
readonly state?: never;
|
|
19
|
+
} | {
|
|
20
|
+
readonly success: false;
|
|
21
|
+
readonly error: "playerNotFound";
|
|
22
|
+
readonly state?: never;
|
|
23
|
+
} | {
|
|
24
|
+
readonly success: true;
|
|
25
|
+
readonly state: ClientState;
|
|
26
|
+
readonly error?: never;
|
|
27
|
+
};
|
|
28
|
+
readonly getEventsAndClearAcknowledged: (gameId: string, playerId: string, lastReadId: string | null) => {
|
|
29
|
+
readonly success: false;
|
|
30
|
+
readonly error: "gameNotFound";
|
|
31
|
+
readonly events?: never;
|
|
32
|
+
} | {
|
|
33
|
+
readonly success: false;
|
|
34
|
+
readonly error: "playerNotFound";
|
|
35
|
+
readonly events?: never;
|
|
36
|
+
} | {
|
|
37
|
+
readonly success: true;
|
|
38
|
+
readonly events: readonly GameEvent[];
|
|
39
|
+
readonly error?: never;
|
|
40
|
+
};
|
|
41
|
+
readonly getJoinableGames: () => {
|
|
42
|
+
readonly games: readonly {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly numPlayers: number;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
readonly joinGame: (gameId: string, userId: string, username: string) => {
|
|
48
|
+
readonly success: false;
|
|
49
|
+
readonly error: "gameNotFound";
|
|
50
|
+
readonly playerId?: never;
|
|
51
|
+
} | {
|
|
52
|
+
readonly success: false;
|
|
53
|
+
readonly error: "invalidStatus";
|
|
54
|
+
readonly playerId?: never;
|
|
55
|
+
} | {
|
|
56
|
+
readonly success: true;
|
|
57
|
+
readonly playerId: string;
|
|
58
|
+
readonly error?: never;
|
|
59
|
+
} | {
|
|
60
|
+
readonly success: false;
|
|
61
|
+
readonly error: "maxPlayersReached" | "alreadyInGame";
|
|
62
|
+
readonly playerId?: never;
|
|
63
|
+
};
|
|
64
|
+
readonly leaveGame: (gameId: string, playerId: string) => {
|
|
65
|
+
readonly success: false;
|
|
66
|
+
readonly error: "gameNotFound";
|
|
67
|
+
} | {
|
|
68
|
+
readonly success: true;
|
|
69
|
+
readonly error?: never;
|
|
70
|
+
} | {
|
|
71
|
+
readonly success: false;
|
|
72
|
+
readonly error: "playerNotFound";
|
|
73
|
+
};
|
|
74
|
+
readonly sendChat: (gameId: string, playerId: string, text: string) => {
|
|
75
|
+
readonly success: false;
|
|
76
|
+
readonly error: "gameNotFound";
|
|
77
|
+
} | {
|
|
78
|
+
readonly success: true;
|
|
79
|
+
readonly error?: never;
|
|
80
|
+
} | {
|
|
81
|
+
readonly success: false;
|
|
82
|
+
readonly error: "playerNotFound";
|
|
83
|
+
};
|
|
84
|
+
readonly startGame: (gameId: string, playerId: string) => {
|
|
85
|
+
readonly success: false;
|
|
86
|
+
readonly error: "gameNotFound";
|
|
87
|
+
} | {
|
|
88
|
+
readonly success: false;
|
|
89
|
+
readonly error: "invalidStatus";
|
|
90
|
+
} | {
|
|
91
|
+
readonly success: true;
|
|
92
|
+
readonly error?: never;
|
|
93
|
+
} | {
|
|
94
|
+
readonly success: false;
|
|
95
|
+
readonly error: "playerNotFound" | "playerNotAdmin" | "minPlayersNotReached";
|
|
96
|
+
};
|
|
97
|
+
} & Readonly<{
|
|
98
|
+
drawCard: (gameId: string, playerId: string) => {
|
|
99
|
+
readonly success: false;
|
|
100
|
+
readonly error: "gameNotFound";
|
|
101
|
+
} | {
|
|
102
|
+
readonly success: false;
|
|
103
|
+
readonly error: "invalidStatus";
|
|
104
|
+
} | {
|
|
105
|
+
readonly success: false;
|
|
106
|
+
readonly error: "playerNotFound" | "canPlayAtNotReached" | "handFull" | "drawPileEmpty";
|
|
107
|
+
} | {
|
|
108
|
+
readonly success: true;
|
|
109
|
+
readonly error?: never;
|
|
110
|
+
};
|
|
111
|
+
playCard: (gameId: string, playerId: string, cardId: string, isForOtherPlayerPile: boolean) => {
|
|
112
|
+
readonly success: false;
|
|
113
|
+
readonly error: "gameNotFound";
|
|
114
|
+
} | {
|
|
115
|
+
readonly success: false;
|
|
116
|
+
readonly error: "invalidStatus";
|
|
117
|
+
} | {
|
|
118
|
+
readonly success: false;
|
|
119
|
+
readonly error: "playerNotFound" | "canPlayAtNotReached" | "cardNotFound" | "cardNotPlayable";
|
|
120
|
+
} | {
|
|
121
|
+
readonly success: true;
|
|
122
|
+
readonly error?: never;
|
|
123
|
+
};
|
|
124
|
+
reportNoPlayableCards: (gameId: string, playerId: string) => {
|
|
125
|
+
readonly success: false;
|
|
126
|
+
readonly error: "gameNotFound";
|
|
127
|
+
} | {
|
|
128
|
+
readonly success: false;
|
|
129
|
+
readonly error: "invalidStatus";
|
|
130
|
+
} | {
|
|
131
|
+
readonly success: false;
|
|
132
|
+
readonly error: "playerNotFound" | "canPlayAtNotReached" | "alreadyReported" | "hasPlayableCard" | "canDraw";
|
|
133
|
+
} | {
|
|
134
|
+
readonly success: true;
|
|
135
|
+
readonly error?: never;
|
|
136
|
+
};
|
|
137
|
+
}>;
|
|
138
|
+
//#endregion
|
|
139
|
+
export { createManager };
|
|
140
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/manager/createManager.ts"],"mappings":";;cAea,gBAAa,gBAAA,kBAAA;;;;aA8DgmD;aAA+B;;;;;aAA4H;;;;;;;;;;;;oBA9DxwD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUU,WAAA,gBAAM;;;;;;;;;;;;;EAgBf,WAAA,gBAAM,kBACE,gBACF;;;;;;;;;;;;;EAiBgB,wBAAA,gBAAM"}
|
package/dist/manager/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
export {
|
|
1
|
+
import { t as createManager } from "../manager-C6kRM9IW.mjs";
|
|
2
|
+
export { createManager };
|