@hellacardgames/speed 0.3.0 → 0.5.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 +3 -2
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +1 -1
- package/dist/client/index.d.cts.map +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +3 -2
- package/dist/client/index.mjs.map +1 -1
- package/dist/manager/index.cjs.map +1 -1
- package/dist/manager/index.d.cts +2 -2
- package/dist/manager/index.d.mts +2 -2
- package/dist/manager/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/client/index.cjs
CHANGED
|
@@ -65,14 +65,15 @@ var Client = class {
|
|
|
65
65
|
})
|
|
66
66
|
})).json();
|
|
67
67
|
}
|
|
68
|
-
async playCard(gameId, playerId, cardId) {
|
|
68
|
+
async playCard(gameId, playerId, cardId, isForOtherPlayerPile) {
|
|
69
69
|
return await (await fetch(`${this.baseUrl}/playCard`, {
|
|
70
70
|
method: "POST",
|
|
71
71
|
headers: { "Content-Type": "application/json" },
|
|
72
72
|
body: JSON.stringify({
|
|
73
73
|
gameId,
|
|
74
74
|
playerId,
|
|
75
|
-
cardId
|
|
75
|
+
cardId,
|
|
76
|
+
isForOtherPlayerPile
|
|
76
77
|
})
|
|
77
78
|
})).json();
|
|
78
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type { CreateGameResult } from \"../server/actions/createGame.js\";\nimport type { DrawCardResult } from \"../server/actions/drawCard.js\";\nimport type { GetClientStateAndClearEventsResult } from \"../server/actions/getClientStateAndClearEvents.js\";\nimport type { GetEventsAndClearAcknowledgedResult } from \"../server/actions/getEventsAndClearAcknowledged.js\";\nimport type { GetJoinableGamesResult } from \"../server/actions/getJoinableGames.js\";\nimport type { JoinGameResult } from \"../server/actions/joinGame.js\";\nimport type { LeaveGameResult } from \"../server/actions/leaveGame.js\";\nimport type { PlayCardResult } from \"../server/actions/playCard.js\";\nimport type { ReportNoPlayableCardsResult } from \"../server/actions/reportNoPlayableCards.js\";\nimport type { SendChatResult } from \"../server/actions/sendChat.js\";\nimport type { StartGameResult } from \"../server/actions/startGame.js\";\nimport type { Card } from \"../manager/types/Card.js\";\nimport type { ChatMessage } from \"../manager/types/ChatMessage.js\";\nimport type { ClientState } from \"../manager/types/ClientState.js\";\nimport type { GameEvent } from \"../manager/types/GameEvent.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 Card,\n ChatMessage,\n ClientState,\n GameEvent,\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 ): 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 }),\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":";;AAkCA,IAAa,SAAb,MAAoB;CAClB;CAEA,YAAY,SAAiB;EAC3B,KAAK,UAAU;CACjB;CAEA,MAAM,WAAW,aAAgD;EAQ/D,OAAO,OADc,MANE,MAAM,GAAG,KAAK,QAAQ,cAAc;GACzD,QAAQ;GACR,SAAS,EACP,eAAe,UAAU,cAC3B;EACF,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SAAS,QAAgB,UAA2C;EASxE,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,YAAY;GACvD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,6BACJ,QACA,UAC6C;EAY7C,OAAO,OADc,MAVE,MACrB,GAAG,KAAK,QAAQ,gCAChB;GACE,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CACF,EAAA,CAC8B,KAAK;CAErC;CAEA,MAAM,8BACJ,QACA,UACA,YAC8C;EAY9C,OAAO,OADc,MAVE,MACrB,GAAG,KAAK,QAAQ,iCAChB;GACE,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;IAAU;GAAW,CAAC;EACvD,CACF,EAAA,CAC8B,KAAK;CAErC;CAEA,MAAM,mBAAoD;EAKxD,OAAO,OADc,MAHE,MAAM,GAAG,KAAK,QAAQ,oBAAoB,EAC/D,QAAQ,OACV,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SAAS,QAAgB,aAA8C;EAU3E,OAAO,OADc,MARE,MAAM,GAAG,KAAK,QAAQ,YAAY;GACvD,QAAQ;GACR,SAAS;IACP,eAAe,UAAU;IACzB,gBAAgB;GAClB;GACA,MAAM,KAAK,UAAU,EAAE,OAAO,CAAC;EACjC,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,UAAU,QAAgB,UAA4C;EAS1E,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,aAAa;GACxD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SACJ,QACA,UACA,
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type { CreateGameResult } from \"../server/actions/createGame.js\";\nimport type { DrawCardResult } from \"../server/actions/drawCard.js\";\nimport type { GetClientStateAndClearEventsResult } from \"../server/actions/getClientStateAndClearEvents.js\";\nimport type { GetEventsAndClearAcknowledgedResult } from \"../server/actions/getEventsAndClearAcknowledged.js\";\nimport type { GetJoinableGamesResult } from \"../server/actions/getJoinableGames.js\";\nimport type { JoinGameResult } from \"../server/actions/joinGame.js\";\nimport type { LeaveGameResult } from \"../server/actions/leaveGame.js\";\nimport type { PlayCardResult } from \"../server/actions/playCard.js\";\nimport type { ReportNoPlayableCardsResult } from \"../server/actions/reportNoPlayableCards.js\";\nimport type { SendChatResult } from \"../server/actions/sendChat.js\";\nimport type { StartGameResult } from \"../server/actions/startGame.js\";\nimport type { Card } from \"../manager/types/Card.js\";\nimport type { ChatMessage } from \"../manager/types/ChatMessage.js\";\nimport type { ClientState } from \"../manager/types/ClientState.js\";\nimport type { GameEvent } from \"../manager/types/GameEvent.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 Card,\n ChatMessage,\n ClientState,\n GameEvent,\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":";;AAkCA,IAAa,SAAb,MAAoB;CAClB;CAEA,YAAY,SAAiB;EAC3B,KAAK,UAAU;CACjB;CAEA,MAAM,WAAW,aAAgD;EAQ/D,OAAO,OADc,MANE,MAAM,GAAG,KAAK,QAAQ,cAAc;GACzD,QAAQ;GACR,SA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U;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SACJ,QACA,UACA,QACA,sBACyB;EASzB,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,YAAY;GACvD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;IAAU;IAAQ;GAAqB,CAAC;EACzE,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,sBACJ,QACA,UACsC;EAStC,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,yBAAyB;GACpE,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SACJ,QACA,UACA,MACyB;EASzB,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,YAAY;GACvD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;IAAU;GAAK,CAAC;EACjD,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,UAAU,QAAgB,UAA4C;EAS1E,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,aAAa;GACxD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;AACF"}
|
package/dist/client/index.d.cts
CHANGED
|
@@ -12,7 +12,7 @@ declare class Client {
|
|
|
12
12
|
getJoinableGames(): Promise<GetJoinableGamesResult>;
|
|
13
13
|
joinGame(gameId: string, accessToken: string): Promise<JoinGameResult>;
|
|
14
14
|
leaveGame(gameId: string, playerId: string): Promise<LeaveGameResult>;
|
|
15
|
-
playCard(gameId: string, playerId: string, cardId: string): Promise<PlayCardResult>;
|
|
15
|
+
playCard(gameId: string, playerId: string, cardId: string, isForOtherPlayerPile: boolean): Promise<PlayCardResult>;
|
|
16
16
|
reportNoPlayableCards(gameId: string, playerId: string): Promise<ReportNoPlayableCardsResult>;
|
|
17
17
|
sendChat(gameId: string, playerId: string, text: string): Promise<SendChatResult>;
|
|
18
18
|
startGame(gameId: string, playerId: string): Promise<StartGameResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/client/Client.ts"],"mappings":";;;;cAkCa,MAAA;EAAA,iBACM,OAAA;cAEL,OAAA;EAIN,UAAA,CAAW,WAAA,WAAsB,OAAA,CAAQ,gBAAA;EAWzC,QAAA,CAAS,MAAA,UAAgB,QAAA,WAAmB,OAAA,CAAQ,cAAA;EAYpD,4BAAA,CACJ,MAAA,UACA,QAAA,WACC,OAAA,CAAQ,kCAAA;EAeL,6BAAA,CACJ,MAAA,UACA,QAAA,UACA,UAAA,kBACC,OAAA,CAAQ,mCAAA;EAeL,gBAAA,IAAoB,OAAA,CAAQ,sBAAA;EAQ5B,QAAA,CAAS,MAAA,UAAgB,WAAA,WAAsB,OAAA,CAAQ,cAAA;EAavD,SAAA,CAAU,MAAA,UAAgB,QAAA,WAAmB,OAAA,CAAQ,eAAA;EAYrD,QAAA,CACJ,MAAA,UACA,QAAA,UACA,MAAA,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/client/Client.ts"],"mappings":";;;;cAkCa,MAAA;EAAA,iBACM,OAAA;cAEL,OAAA;EAIN,UAAA,CAAW,WAAA,WAAsB,OAAA,CAAQ,gBAAA;EAWzC,QAAA,CAAS,MAAA,UAAgB,QAAA,WAAmB,OAAA,CAAQ,cAAA;EAYpD,4BAAA,CACJ,MAAA,UACA,QAAA,WACC,OAAA,CAAQ,kCAAA;EAeL,6BAAA,CACJ,MAAA,UACA,QAAA,UACA,UAAA,kBACC,OAAA,CAAQ,mCAAA;EAeL,gBAAA,IAAoB,OAAA,CAAQ,sBAAA;EAQ5B,QAAA,CAAS,MAAA,UAAgB,WAAA,WAAsB,OAAA,CAAQ,cAAA;EAavD,SAAA,CAAU,MAAA,UAAgB,QAAA,WAAmB,OAAA,CAAQ,eAAA;EAYrD,QAAA,CACJ,MAAA,UACA,QAAA,UACA,MAAA,UACA,oBAAA,YACC,OAAA,CAAQ,cAAA;EAYL,qBAAA,CACJ,MAAA,UACA,QAAA,WACC,OAAA,CAAQ,2BAAA;EAYL,QAAA,CACJ,MAAA,UACA,QAAA,UACA,IAAA,WACC,OAAA,CAAQ,cAAA;EAYL,SAAA,CAAU,MAAA,UAAgB,QAAA,WAAmB,OAAA,CAAQ,eAAA;AAAA"}
|
package/dist/client/index.d.mts
CHANGED
|
@@ -12,7 +12,7 @@ declare class Client {
|
|
|
12
12
|
getJoinableGames(): Promise<GetJoinableGamesResult>;
|
|
13
13
|
joinGame(gameId: string, accessToken: string): Promise<JoinGameResult>;
|
|
14
14
|
leaveGame(gameId: string, playerId: string): Promise<LeaveGameResult>;
|
|
15
|
-
playCard(gameId: string, playerId: string, cardId: string): Promise<PlayCardResult>;
|
|
15
|
+
playCard(gameId: string, playerId: string, cardId: string, isForOtherPlayerPile: boolean): Promise<PlayCardResult>;
|
|
16
16
|
reportNoPlayableCards(gameId: string, playerId: string): Promise<ReportNoPlayableCardsResult>;
|
|
17
17
|
sendChat(gameId: string, playerId: string, text: string): Promise<SendChatResult>;
|
|
18
18
|
startGame(gameId: string, playerId: string): Promise<StartGameResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/client/Client.ts"],"mappings":";;;;cAkCa,MAAA;EAAA,iBACM,OAAA;cAEL,OAAA;EAIN,UAAA,CAAW,WAAA,WAAsB,OAAA,CAAQ,gBAAA;EAWzC,QAAA,CAAS,MAAA,UAAgB,QAAA,WAAmB,OAAA,CAAQ,cAAA;EAYpD,4BAAA,CACJ,MAAA,UACA,QAAA,WACC,OAAA,CAAQ,kCAAA;EAeL,6BAAA,CACJ,MAAA,UACA,QAAA,UACA,UAAA,kBACC,OAAA,CAAQ,mCAAA;EAeL,gBAAA,IAAoB,OAAA,CAAQ,sBAAA;EAQ5B,QAAA,CAAS,MAAA,UAAgB,WAAA,WAAsB,OAAA,CAAQ,cAAA;EAavD,SAAA,CAAU,MAAA,UAAgB,QAAA,WAAmB,OAAA,CAAQ,eAAA;EAYrD,QAAA,CACJ,MAAA,UACA,QAAA,UACA,MAAA,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/client/Client.ts"],"mappings":";;;;cAkCa,MAAA;EAAA,iBACM,OAAA;cAEL,OAAA;EAIN,UAAA,CAAW,WAAA,WAAsB,OAAA,CAAQ,gBAAA;EAWzC,QAAA,CAAS,MAAA,UAAgB,QAAA,WAAmB,OAAA,CAAQ,cAAA;EAYpD,4BAAA,CACJ,MAAA,UACA,QAAA,WACC,OAAA,CAAQ,kCAAA;EAeL,6BAAA,CACJ,MAAA,UACA,QAAA,UACA,UAAA,kBACC,OAAA,CAAQ,mCAAA;EAeL,gBAAA,IAAoB,OAAA,CAAQ,sBAAA;EAQ5B,QAAA,CAAS,MAAA,UAAgB,WAAA,WAAsB,OAAA,CAAQ,cAAA;EAavD,SAAA,CAAU,MAAA,UAAgB,QAAA,WAAmB,OAAA,CAAQ,eAAA;EAYrD,QAAA,CACJ,MAAA,UACA,QAAA,UACA,MAAA,UACA,oBAAA,YACC,OAAA,CAAQ,cAAA;EAYL,qBAAA,CACJ,MAAA,UACA,QAAA,WACC,OAAA,CAAQ,2BAAA;EAYL,QAAA,CACJ,MAAA,UACA,QAAA,UACA,IAAA,WACC,OAAA,CAAQ,cAAA;EAYL,SAAA,CAAU,MAAA,UAAgB,QAAA,WAAmB,OAAA,CAAQ,eAAA;AAAA"}
|
package/dist/client/index.mjs
CHANGED
|
@@ -64,14 +64,15 @@ var Client = class {
|
|
|
64
64
|
})
|
|
65
65
|
})).json();
|
|
66
66
|
}
|
|
67
|
-
async playCard(gameId, playerId, cardId) {
|
|
67
|
+
async playCard(gameId, playerId, cardId, isForOtherPlayerPile) {
|
|
68
68
|
return await (await fetch(`${this.baseUrl}/playCard`, {
|
|
69
69
|
method: "POST",
|
|
70
70
|
headers: { "Content-Type": "application/json" },
|
|
71
71
|
body: JSON.stringify({
|
|
72
72
|
gameId,
|
|
73
73
|
playerId,
|
|
74
|
-
cardId
|
|
74
|
+
cardId,
|
|
75
|
+
isForOtherPlayerPile
|
|
75
76
|
})
|
|
76
77
|
})).json();
|
|
77
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type { CreateGameResult } from \"../server/actions/createGame.js\";\nimport type { DrawCardResult } from \"../server/actions/drawCard.js\";\nimport type { GetClientStateAndClearEventsResult } from \"../server/actions/getClientStateAndClearEvents.js\";\nimport type { GetEventsAndClearAcknowledgedResult } from \"../server/actions/getEventsAndClearAcknowledged.js\";\nimport type { GetJoinableGamesResult } from \"../server/actions/getJoinableGames.js\";\nimport type { JoinGameResult } from \"../server/actions/joinGame.js\";\nimport type { LeaveGameResult } from \"../server/actions/leaveGame.js\";\nimport type { PlayCardResult } from \"../server/actions/playCard.js\";\nimport type { ReportNoPlayableCardsResult } from \"../server/actions/reportNoPlayableCards.js\";\nimport type { SendChatResult } from \"../server/actions/sendChat.js\";\nimport type { StartGameResult } from \"../server/actions/startGame.js\";\nimport type { Card } from \"../manager/types/Card.js\";\nimport type { ChatMessage } from \"../manager/types/ChatMessage.js\";\nimport type { ClientState } from \"../manager/types/ClientState.js\";\nimport type { GameEvent } from \"../manager/types/GameEvent.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 Card,\n ChatMessage,\n ClientState,\n GameEvent,\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 ): 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 }),\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":";AAkCA,IAAa,SAAb,MAAoB;CAClB;CAEA,YAAY,SAAiB;EAC3B,KAAK,UAAU;CACjB;CAEA,MAAM,WAAW,aAAgD;EAQ/D,OAAO,OADc,MANE,MAAM,GAAG,KAAK,QAAQ,cAAc;GACzD,QAAQ;GACR,SAAS,EACP,eAAe,UAAU,cAC3B;EACF,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SAAS,QAAgB,UAA2C;EASxE,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,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../../src/client/Client.ts"],"sourcesContent":["import type { CreateGameResult } from \"../server/actions/createGame.js\";\nimport type { DrawCardResult } from \"../server/actions/drawCard.js\";\nimport type { GetClientStateAndClearEventsResult } from \"../server/actions/getClientStateAndClearEvents.js\";\nimport type { GetEventsAndClearAcknowledgedResult } from \"../server/actions/getEventsAndClearAcknowledged.js\";\nimport type { GetJoinableGamesResult } from \"../server/actions/getJoinableGames.js\";\nimport type { JoinGameResult } from \"../server/actions/joinGame.js\";\nimport type { LeaveGameResult } from \"../server/actions/leaveGame.js\";\nimport type { PlayCardResult } from \"../server/actions/playCard.js\";\nimport type { ReportNoPlayableCardsResult } from \"../server/actions/reportNoPlayableCards.js\";\nimport type { SendChatResult } from \"../server/actions/sendChat.js\";\nimport type { StartGameResult } from \"../server/actions/startGame.js\";\nimport type { Card } from \"../manager/types/Card.js\";\nimport type { ChatMessage } from \"../manager/types/ChatMessage.js\";\nimport type { ClientState } from \"../manager/types/ClientState.js\";\nimport type { GameEvent } from \"../manager/types/GameEvent.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 Card,\n ChatMessage,\n ClientState,\n GameEvent,\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":";AAkCA,IAAa,SAAb,MAAoB;CAClB;CAEA,YAAY,SAAiB;EAC3B,KAAK,UAAU;CACjB;CAEA,MAAM,WAAW,aAAgD;EAQ/D,OAAO,OADc,MANE,MAAM,GAAG,KAAK,QAAQ,cAAc;GACzD,QAAQ;GACR,SAAS,EACP,eAAe,UAAU,cAC3B;EACF,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SAAS,QAAgB,UAA2C;EASxE,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,YAAY;GACvD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,6BACJ,QACA,UAC6C;EAY7C,OAAO,OADc,MAVE,MACrB,GAAG,KAAK,QAAQ,gCAChB;GACE,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CACF,EAAA,CAC8B,KAAK;CAErC;CAEA,MAAM,8BACJ,QACA,UAC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EA,MAAM,SACJ,QACA,UACA,MACyB;EASzB,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,YAAY;GACvD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;IAAU;GAAK,CAAC;EACjD,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,UAAU,QAAgB,UAA4C;EAS1E,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,aAAa;GACxD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["GAME_KEY","WATCHDOG_INTERVAL_MS","games"],"sources":["../../src/manager/watchdog.ts","../../src/manager/index.ts"],"sourcesContent":["import { GAME_KEY, WATCHDOG_INTERVAL_MS } from \"./constants.js\";\nimport { games } from \"./games.js\";\n\nclass Watchdog {\n start() {\n console.log(`watchdog start at ${Date.now()} (${GAME_KEY})`);\n setInterval(() => this.wakeUp(), WATCHDOG_INTERVAL_MS);\n }\n\n wakeUp() {\n const now = Date.now();\n // console.log(`watchdog wakeUp at ${now} (${GAME_KEY})`);\n for (const game of games.values()) {\n if (game.expiresAt <= now) {\n games.delete(game.id);\n console.log(`watchdog purged ${game.id} (${GAME_KEY})`);\n }\n }\n }\n}\n\nexport const watchdog = new Watchdog();\n","import { watchdog } from \"./watchdog.js\";\n\nexport { createGame } from \"./actions/createGame.js\";\nexport { drawCard } from \"./actions/drawCard.js\";\nexport { getClientStateAndClearEvents } from \"./actions/getClientStateAndClearEvents.js\";\nexport { getEventsAndClearAcknowledged } from \"./actions/getEventsAndClearAcknowledged.js\";\nexport { getJoinableGames } from \"./actions/getJoinableGames.js\";\nexport { joinGame } from \"./actions/joinGame.js\";\nexport { leaveGame } from \"./actions/leaveGame.js\";\nexport { playCard } from \"./actions/playCard.js\";\nexport { reportNoPlayableCards } from \"./actions/reportNoPlayableCards.js\";\nexport { sendChat } from \"./actions/sendChat.js\";\nexport { startGame } from \"./actions/startGame.js\";\n\
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["GAME_KEY","WATCHDOG_INTERVAL_MS","games"],"sources":["../../src/manager/watchdog.ts","../../src/manager/index.ts"],"sourcesContent":["import { GAME_KEY, WATCHDOG_INTERVAL_MS } from \"./constants.js\";\nimport { games } from \"./games.js\";\n\nclass Watchdog {\n start() {\n console.log(`watchdog start at ${Date.now()} (${GAME_KEY})`);\n setInterval(() => this.wakeUp(), WATCHDOG_INTERVAL_MS);\n }\n\n wakeUp() {\n const now = Date.now();\n // console.log(`watchdog wakeUp at ${now} (${GAME_KEY})`);\n for (const game of games.values()) {\n if (game.expiresAt <= now) {\n games.delete(game.id);\n console.log(`watchdog purged ${game.id} (${GAME_KEY})`);\n }\n }\n }\n}\n\nexport const watchdog = new Watchdog();\n","import { watchdog } from \"./watchdog.js\";\n\nexport { createGame } from \"./actions/createGame.js\";\nexport { drawCard } from \"./actions/drawCard.js\";\nexport { getClientStateAndClearEvents } from \"./actions/getClientStateAndClearEvents.js\";\nexport { getEventsAndClearAcknowledged } from \"./actions/getEventsAndClearAcknowledged.js\";\nexport { getJoinableGames } from \"./actions/getJoinableGames.js\";\nexport { joinGame } from \"./actions/joinGame.js\";\nexport { leaveGame } from \"./actions/leaveGame.js\";\nexport { playCard } from \"./actions/playCard.js\";\nexport { reportNoPlayableCards } from \"./actions/reportNoPlayableCards.js\";\nexport { sendChat } from \"./actions/sendChat.js\";\nexport { startGame } from \"./actions/startGame.js\";\n\nwatchdog.start();\n"],"mappings":";;;AAGA,IAAM,WAAN,MAAe;CACb,QAAQ;EACN,QAAQ,IAAI,qBAAqB,KAAK,IAAI,EAAE,IAAIA,kBAAAA,SAAS,EAAE;EAC3D,kBAAkB,KAAK,OAAO,GAAGC,kBAAAA,oBAAoB;CACvD;CAEA,SAAS;EACP,MAAM,MAAM,KAAK,IAAI;EAErB,KAAK,MAAM,QAAQC,kBAAAA,MAAM,OAAO,GAC9B,IAAI,KAAK,aAAa,KAAK;GACzB,kBAAA,MAAM,OAAO,KAAK,EAAE;GACpB,QAAQ,IAAI,mBAAmB,KAAK,GAAG,IAAIF,kBAAAA,SAAS,EAAE;EACxD;CAEJ;AACF;;;ACLA,IDO4B,SCP5B,CAAA,CAAS,MAAM"}
|
package/dist/manager/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ClientState, t as GameEvent } from "../GameEvent-DDQ4jXxt.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/manager/actions/createGame.d.ts
|
|
4
4
|
type CreateGameResult = {
|
|
@@ -105,5 +105,5 @@ type StartGameResult = {
|
|
|
105
105
|
};
|
|
106
106
|
declare function startGame(gameId: string, playerId: string): StartGameResult;
|
|
107
107
|
//#endregion
|
|
108
|
-
export {
|
|
108
|
+
export { createGame, drawCard, getClientStateAndClearEvents, getEventsAndClearAcknowledged, getJoinableGames, joinGame, leaveGame, playCard, reportNoPlayableCards, sendChat, startGame };
|
|
109
109
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/manager/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ClientState, t as GameEvent } from "../GameEvent-DDQ4jXxt.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/manager/actions/createGame.d.ts
|
|
4
4
|
type CreateGameResult = {
|
|
@@ -105,5 +105,5 @@ type StartGameResult = {
|
|
|
105
105
|
};
|
|
106
106
|
declare function startGame(gameId: string, playerId: string): StartGameResult;
|
|
107
107
|
//#endregion
|
|
108
|
-
export {
|
|
108
|
+
export { createGame, drawCard, getClientStateAndClearEvents, getEventsAndClearAcknowledged, getJoinableGames, joinGame, leaveGame, playCard, reportNoPlayableCards, sendChat, startGame };
|
|
109
109
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/manager/watchdog.ts","../../src/manager/index.ts"],"sourcesContent":["import { GAME_KEY, WATCHDOG_INTERVAL_MS } from \"./constants.js\";\nimport { games } from \"./games.js\";\n\nclass Watchdog {\n start() {\n console.log(`watchdog start at ${Date.now()} (${GAME_KEY})`);\n setInterval(() => this.wakeUp(), WATCHDOG_INTERVAL_MS);\n }\n\n wakeUp() {\n const now = Date.now();\n // console.log(`watchdog wakeUp at ${now} (${GAME_KEY})`);\n for (const game of games.values()) {\n if (game.expiresAt <= now) {\n games.delete(game.id);\n console.log(`watchdog purged ${game.id} (${GAME_KEY})`);\n }\n }\n }\n}\n\nexport const watchdog = new Watchdog();\n","import { watchdog } from \"./watchdog.js\";\n\nexport { createGame } from \"./actions/createGame.js\";\nexport { drawCard } from \"./actions/drawCard.js\";\nexport { getClientStateAndClearEvents } from \"./actions/getClientStateAndClearEvents.js\";\nexport { getEventsAndClearAcknowledged } from \"./actions/getEventsAndClearAcknowledged.js\";\nexport { getJoinableGames } from \"./actions/getJoinableGames.js\";\nexport { joinGame } from \"./actions/joinGame.js\";\nexport { leaveGame } from \"./actions/leaveGame.js\";\nexport { playCard } from \"./actions/playCard.js\";\nexport { reportNoPlayableCards } from \"./actions/reportNoPlayableCards.js\";\nexport { sendChat } from \"./actions/sendChat.js\";\nexport { startGame } from \"./actions/startGame.js\";\n\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/manager/watchdog.ts","../../src/manager/index.ts"],"sourcesContent":["import { GAME_KEY, WATCHDOG_INTERVAL_MS } from \"./constants.js\";\nimport { games } from \"./games.js\";\n\nclass Watchdog {\n start() {\n console.log(`watchdog start at ${Date.now()} (${GAME_KEY})`);\n setInterval(() => this.wakeUp(), WATCHDOG_INTERVAL_MS);\n }\n\n wakeUp() {\n const now = Date.now();\n // console.log(`watchdog wakeUp at ${now} (${GAME_KEY})`);\n for (const game of games.values()) {\n if (game.expiresAt <= now) {\n games.delete(game.id);\n console.log(`watchdog purged ${game.id} (${GAME_KEY})`);\n }\n }\n }\n}\n\nexport const watchdog = new Watchdog();\n","import { watchdog } from \"./watchdog.js\";\n\nexport { createGame } from \"./actions/createGame.js\";\nexport { drawCard } from \"./actions/drawCard.js\";\nexport { getClientStateAndClearEvents } from \"./actions/getClientStateAndClearEvents.js\";\nexport { getEventsAndClearAcknowledged } from \"./actions/getEventsAndClearAcknowledged.js\";\nexport { getJoinableGames } from \"./actions/getJoinableGames.js\";\nexport { joinGame } from \"./actions/joinGame.js\";\nexport { leaveGame } from \"./actions/leaveGame.js\";\nexport { playCard } from \"./actions/playCard.js\";\nexport { reportNoPlayableCards } from \"./actions/reportNoPlayableCards.js\";\nexport { sendChat } from \"./actions/sendChat.js\";\nexport { startGame } from \"./actions/startGame.js\";\n\nwatchdog.start();\n"],"mappings":";;AAGA,IAAM,WAAN,MAAe;CACb,QAAQ;EACN,QAAQ,IAAI,qBAAqB,KAAK,IAAI,EAAE,IAAI,SAAS,EAAE;EAC3D,kBAAkB,KAAK,OAAO,GAAG,oBAAoB;CACvD;CAEA,SAAS;EACP,MAAM,MAAM,KAAK,IAAI;EAErB,KAAK,MAAM,QAAQ,MAAM,OAAO,GAC9B,IAAI,KAAK,aAAa,KAAK;GACzB,MAAM,OAAO,KAAK,EAAE;GACpB,QAAQ,IAAI,mBAAmB,KAAK,GAAG,IAAI,SAAS,EAAE;EACxD;CAEJ;AACF;;;ACLA,IDO4B,SCP5B,CAAA,CAAS,MAAM"}
|