cleanstrategytypes 1.1.37 → 1.1.38
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/.github/workflows/publish.yml +11 -8
- package/dist/bundle.esm.js +18 -0
- package/dist/bundle.esm.js.map +1 -1
- package/dist/bundle.min.js +1 -1
- package/dist/index.d.ts +167 -2
- package/dist/index.js +18 -0
- package/package.json +2 -3
- package/src/index.ts +199 -3
|
@@ -2,27 +2,30 @@ name: Publish Package
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches: [
|
|
5
|
+
branches: [main]
|
|
6
6
|
|
|
7
7
|
jobs:
|
|
8
8
|
publish:
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
steps:
|
|
11
11
|
- uses: actions/checkout@v4
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
- name: Setup Node.js
|
|
14
14
|
uses: actions/setup-node@v4
|
|
15
15
|
with:
|
|
16
|
-
node-version:
|
|
17
|
-
registry-url:
|
|
18
|
-
|
|
16
|
+
node-version: "20"
|
|
17
|
+
registry-url: "https://registry.npmjs.org"
|
|
18
|
+
|
|
19
19
|
- name: Install dependencies
|
|
20
20
|
run: npm ci
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
- name: Bump patch version (no git tag)
|
|
23
|
+
run: npm version patch --no-git-tag-version
|
|
24
|
+
|
|
22
25
|
- name: Build package
|
|
23
26
|
run: npm run build
|
|
24
|
-
|
|
27
|
+
|
|
25
28
|
- name: Publish to npm
|
|
26
29
|
run: npm publish --access public
|
|
27
30
|
env:
|
|
28
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
31
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -6,6 +6,24 @@ var SpaceEventTypes;
|
|
|
6
6
|
SpaceEventTypes["DELETE_VOTE"] = "DELETE_VOTE";
|
|
7
7
|
SpaceEventTypes["RESET_VOTES"] = "RESET_VOTES";
|
|
8
8
|
SpaceEventTypes["START_ROUND"] = "START_ROUND";
|
|
9
|
+
SpaceEventTypes["PLAYER_ADDED"] = "PLAYER_ADDED";
|
|
10
|
+
SpaceEventTypes["PLAYER_REMOVED"] = "PLAYER_REMOVED";
|
|
11
|
+
SpaceEventTypes["TASK_CREATED"] = "TASK_CREATED";
|
|
12
|
+
SpaceEventTypes["TASK_UPDATED"] = "TASK_UPDATED";
|
|
13
|
+
SpaceEventTypes["TASK_DELETED"] = "TASK_DELETED";
|
|
14
|
+
SpaceEventTypes["TASK_CREATION_ERROR"] = "TASK_CREATION_ERROR";
|
|
15
|
+
SpaceEventTypes["TASK_UPDATE_ERROR"] = "TASK_UPDATE_ERROR";
|
|
16
|
+
SpaceEventTypes["TASK_DELETE_ERROR"] = "TASK_DELETE_ERROR";
|
|
17
|
+
SpaceEventTypes["CATEGORY_CREATED"] = "CATEGORY_CREATED";
|
|
18
|
+
SpaceEventTypes["CATEGORY_DELETED"] = "CATEGORY_DELETED";
|
|
19
|
+
SpaceEventTypes["ASSING_TASK_TO_CATEGORY"] = "ASSING_TASK_TO_CATEGORY";
|
|
20
|
+
SpaceEventTypes["REMOVE_TASK_FROM_CATEGORY"] = "REMOVE_TASK_FROM_CATEGORY";
|
|
21
|
+
SpaceEventTypes["SPACE_ERROR"] = "SPACE_ERROR";
|
|
22
|
+
SpaceEventTypes["CREATE_TASK"] = "CREATE_TASK";
|
|
23
|
+
SpaceEventTypes["UPDATE_TASK"] = "UPDATE_TASK";
|
|
24
|
+
SpaceEventTypes["DELETE_TASK"] = "DELETE_TASK";
|
|
25
|
+
SpaceEventTypes["CREATE_CATEGORY"] = "CREATE_CATEGORY";
|
|
26
|
+
SpaceEventTypes["DELETE_CATEGORY"] = "DELETE_CATEGORY";
|
|
9
27
|
})(SpaceEventTypes || (SpaceEventTypes = {}));
|
|
10
28
|
|
|
11
29
|
export { SpaceEventTypes };
|
package/dist/bundle.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"sourcesContent":["export interface IVote {\n id: string;\n roundId: string;\n userId: string;\n taskId: string;\n count?: number;\n spaceId: string;\n createdAt: Date;\n}\n\nexport type ITask = {\n id: string;\n title: string;\n value: number;\n};\n\nexport type ISpace = {\n id: string;\n name: string;\n roles: string[];\n};\n\nexport interface ICurrentUser {\n id: string;\n displayName: string;\n email: string;\n deviceId: string;\n tenants: ISpace[];\n}\n\nexport interface IUser {\n id: string;\n displayName: string;\n}\n\nexport interface IRound {\n id: string;\n order: number;\n spaceId: string;\n endDate: Date;\n status?: \"finished\" | \"active\";\n}\n\nexport interface IStats extends Record<string, Record<string, number>> { }\n\nexport enum SpaceEventTypes {\n CONNECT = \"CONNECT\",\n DISCONNECT = \"DISCONNECT\",\n VOTE = \"VOTE\",\n DELETE_VOTE = \"DELETE_VOTE\",\n RESET_VOTES = \"RESET_VOTES\",\n START_ROUND = \"START_ROUND\",\n}\n\n// RequestMessage\n\nexport type VoteMessageBody = {\n type: \"minus\" | \"plus\";\n taskId: string;\n currentUserId: string;\n};\n\nexport type VoteDeleteMessageBody = {\n voteId: string;\n};\n\n// ResponseMessage\ntype ResponseMessageBase = {\n errorMessages?: { type: string; message: string }[];\n};\n\nexport type VoteMessageResponse = ResponseMessageBase & {\n vote: IVote;\n};\n\nexport type VoteDeleteMessageResponse = ResponseMessageBase & {\n voteId: string;\n};\n\nexport type StartRoundResponseMessage = ResponseMessageBase & {\n round: IRound;\n};\n\nexport type ConnectMessageResponse = ResponseMessageBase & {\n votes: IVote[];\n tasks: ITask[];\n users: IUser[]
|
|
1
|
+
{"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"sourcesContent":["export interface IVote {\n id: string;\n roundId: string;\n userId: string;\n taskId: string;\n count?: number;\n spaceId: string;\n createdAt: Date;\n}\n\nexport type ITask = {\n id: string;\n title: string;\n value: number;\n categoryId?: string;\n};\n\nexport type ISpace = {\n id: string;\n name: string;\n roles: string[];\n};\n\nexport interface ICurrentUser {\n id: string;\n displayName: string;\n email: string;\n deviceId: string;\n tenants: ISpace[];\n}\n\nexport interface IUser {\n id: string;\n displayName: string;\n}\n\nexport interface IRound {\n id: string;\n order: number;\n spaceId: string;\n endDate: Date;\n status?: \"finished\" | \"active\";\n}\n\nexport interface IStats extends Record<string, Record<string, number>> {}\n\nexport interface ICategory {\n id: string;\n name: string;\n spaceId?: string;\n createdAt?: Date;\n updatedAt?: Date;\n}\n\nexport enum SpaceEventTypes {\n CONNECT = \"CONNECT\",\n DISCONNECT = \"DISCONNECT\",\n VOTE = \"VOTE\",\n DELETE_VOTE = \"DELETE_VOTE\",\n RESET_VOTES = \"RESET_VOTES\",\n START_ROUND = \"START_ROUND\",\n PLAYER_ADDED = \"PLAYER_ADDED\",\n PLAYER_REMOVED = \"PLAYER_REMOVED\",\n TASK_CREATED = \"TASK_CREATED\",\n TASK_UPDATED = \"TASK_UPDATED\",\n TASK_DELETED = \"TASK_DELETED\",\n TASK_CREATION_ERROR = \"TASK_CREATION_ERROR\",\n TASK_UPDATE_ERROR = \"TASK_UPDATE_ERROR\",\n TASK_DELETE_ERROR = \"TASK_DELETE_ERROR\",\n CATEGORY_CREATED = \"CATEGORY_CREATED\",\n CATEGORY_DELETED = \"CATEGORY_DELETED\",\n ASSING_TASK_TO_CATEGORY = \"ASSING_TASK_TO_CATEGORY\",\n REMOVE_TASK_FROM_CATEGORY = \"REMOVE_TASK_FROM_CATEGORY\",\n SPACE_ERROR = \"SPACE_ERROR\",\n CREATE_TASK = \"CREATE_TASK\",\n UPDATE_TASK = \"UPDATE_TASK\",\n DELETE_TASK = \"DELETE_TASK\",\n CREATE_CATEGORY = \"CREATE_CATEGORY\",\n DELETE_CATEGORY = \"DELETE_CATEGORY\",\n}\n//\n\n// RequestMessage\n\nexport type VoteMessageBody = {\n type: \"minus\" | \"plus\";\n taskId: string;\n currentUserId: string;\n};\n\nexport type VoteDeleteMessageBody = {\n voteId: string;\n};\n\nexport type CreateTaskMessageBody = {\n title: string;\n description: string;\n value: number;\n categoryId?: string;\n};\n\nexport type UpdateTaskMessageBody = {\n taskId: string;\n title: string;\n description: string;\n value: number;\n};\n\nexport type DeleteTaskMessageBody = {\n taskId: string;\n};\n\nexport type CreateCategoryMessageBody = {\n category: { name: string };\n taskIDs?: string[];\n};\n\nexport type AssignTaskToCategoryMessageBody = {\n taskId: string;\n categoryId: string;\n};\n\nexport type RemoveTaskFromCategoryMessageBody = {\n taskId: string;\n categoryId: string;\n};\n\nexport type DeleteCategoryMessageBody = {\n categoryId: string;\n};\n\n// HTTP DTOs (shared)\nexport type CreateSpaceDto = {\n spaceName: string;\n taskTemplateId?: string;\n taskTemplate?: string;\n};\n\nexport type InviteSpaceDto = {\n email: string;\n};\n\nexport type CreatePlayerDto = {\n displayName: string;\n};\n\nexport type UpdatePlayerDto = {\n displayName?: string;\n};\n\nexport type SaveNotificationTokenDto = {\n token: string;\n};\n\nexport type UpdateDisplayNameDto = {\n displayName: string;\n};\n\nexport type SendPushNotificationDto = {\n pushToken: string;\n title: string;\n body: string;\n data?: Record<string, any>;\n};\n\nexport type SendMultiplePushNotificationDto = {\n pushTokens: string[];\n title: string;\n body: string;\n data?: Record<string, any>;\n};\n\nexport type GetReceiptsDto = {\n receiptIds: string[];\n};\n\nexport type SpaceStatisticsQueryDto = {\n startDate: string; // ISO8601\n endDate: string; // ISO8601\n};\n\n// ResponseMessage\ntype ResponseMessageBase = {\n errorMessages?: { type: string; message: string }[];\n};\n\nexport type VoteMessageResponse = ResponseMessageBase & {\n vote: IVote;\n};\n\nexport type VoteDeleteMessageResponse = ResponseMessageBase & {\n voteId: string;\n};\n\nexport type StartRoundResponseMessage = ResponseMessageBase & {\n round: IRound;\n};\n\nexport type ConnectMessageResponse = ResponseMessageBase & {\n votes: IVote[];\n tasks: ITask[];\n users: IUser[];\n currentPeriod: IRound;\n stats: IStats;\n categories?: ICategory[];\n};\n\nexport type ResetVotesMessageResponse = ResponseMessageBase & {\n votes: IVote[];\n};\n\nexport type StartRoundMessageResponse = ResponseMessageBase & {\n round?: IRound;\n};\n\nexport type PlayerAddedMessageResponse = ResponseMessageBase & {\n player: {\n id: string;\n displayName: string;\n userId?: string;\n email?: string;\n };\n};\n\nexport type PlayerRemovedMessageResponse = ResponseMessageBase & {\n playerId: string;\n};\n\nexport type TaskCreatedMessageResponse = ResponseMessageBase & {\n task: ITask;\n};\n\nexport type TaskUpdatedMessageResponse = ResponseMessageBase & {\n task: ITask;\n};\n\nexport type TaskDeletedMessageResponse = ResponseMessageBase & {\n taskId: string;\n};\n\nexport type TaskCreationErrorMessageResponse = ResponseMessageBase & {\n message: string;\n};\n\nexport type TaskUpdateErrorMessageResponse = ResponseMessageBase & {\n message: string;\n};\n\nexport type TaskDeleteErrorMessageResponse = ResponseMessageBase & {\n message: string;\n};\n\nexport type CategoryCreatedMessageResponse = ResponseMessageBase & {\n category: ICategory;\n updatedTaskIDs?: string[];\n};\n\nexport type CategoryDeletedMessageResponse = ResponseMessageBase & {\n categoryId: string;\n tasks: ITask[];\n};\n\nexport type AssignTaskToCategoryMessageResponse = ResponseMessageBase & {\n taskId: string;\n categoryId: string;\n};\n\nexport type RemoveTaskFromCategoryMessageResponse = ResponseMessageBase & {\n taskId: string;\n categoryId: string;\n};\n\nexport type SpaceErrorMessageResponse = ResponseMessageBase & {\n message: string;\n};\n\nexport interface GameServerToClientEvents {\n [SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;\n [SpaceEventTypes.DISCONNECT]: (message: any) => void;\n [SpaceEventTypes.START_ROUND]: (message: StartRoundMessageResponse) => void;\n [SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;\n [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;\n [SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;\n [SpaceEventTypes.PLAYER_ADDED]: (message: PlayerAddedMessageResponse) => void;\n [SpaceEventTypes.PLAYER_REMOVED]: (message: PlayerRemovedMessageResponse) => void;\n [SpaceEventTypes.TASK_CREATED]: (message: TaskCreatedMessageResponse) => void;\n [SpaceEventTypes.TASK_UPDATED]: (message: TaskUpdatedMessageResponse) => void;\n [SpaceEventTypes.TASK_DELETED]: (message: TaskDeletedMessageResponse) => void;\n [SpaceEventTypes.TASK_CREATION_ERROR]: (message: TaskCreationErrorMessageResponse) => void;\n [SpaceEventTypes.TASK_UPDATE_ERROR]: (message: TaskUpdateErrorMessageResponse) => void;\n [SpaceEventTypes.TASK_DELETE_ERROR]: (message: TaskDeleteErrorMessageResponse) => void;\n [SpaceEventTypes.CATEGORY_CREATED]: (message: CategoryCreatedMessageResponse) => void;\n [SpaceEventTypes.CATEGORY_DELETED]: (message: CategoryDeletedMessageResponse) => void;\n [SpaceEventTypes.ASSING_TASK_TO_CATEGORY]: (message: AssignTaskToCategoryMessageResponse) => void;\n [SpaceEventTypes.REMOVE_TASK_FROM_CATEGORY]: (message: RemoveTaskFromCategoryMessageResponse) => void;\n [SpaceEventTypes.SPACE_ERROR]: (message: SpaceErrorMessageResponse) => void;\n}\n\nexport interface GameClientToServerEvents {\n [SpaceEventTypes.CONNECT]: (message: any) => void;\n [SpaceEventTypes.START_ROUND]: (message: any) => void;\n [SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;\n [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;\n [SpaceEventTypes.RESET_VOTES]: (message: any) => void;\n [SpaceEventTypes.CREATE_TASK]: (message: CreateTaskMessageBody) => void;\n [SpaceEventTypes.UPDATE_TASK]: (message: UpdateTaskMessageBody) => void;\n [SpaceEventTypes.DELETE_TASK]: (message: DeleteTaskMessageBody) => void;\n [SpaceEventTypes.CREATE_CATEGORY]: (message: CreateCategoryMessageBody) => void;\n [SpaceEventTypes.ASSING_TASK_TO_CATEGORY]: (message: AssignTaskToCategoryMessageBody) => void;\n [SpaceEventTypes.REMOVE_TASK_FROM_CATEGORY]: (message: RemoveTaskFromCategoryMessageBody) => void;\n [SpaceEventTypes.DELETE_CATEGORY]: (message: DeleteCategoryMessageBody) => void;\n}\n"],"names":[],"mappings":"IAsDY,gBAyBX;AAzBD,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,eAAA,CAAA,YAAA,CAAA,GAAA,YAAyB,CAAA;AACzB,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,eAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC3B,IAAA,eAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC3B,IAAA,eAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC3B,IAAA,eAAA,CAAA,cAAA,CAAA,GAAA,cAA6B,CAAA;AAC7B,IAAA,eAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC,CAAA;AACjC,IAAA,eAAA,CAAA,cAAA,CAAA,GAAA,cAA6B,CAAA;AAC7B,IAAA,eAAA,CAAA,cAAA,CAAA,GAAA,cAA6B,CAAA;AAC7B,IAAA,eAAA,CAAA,cAAA,CAAA,GAAA,cAA6B,CAAA;AAC7B,IAAA,eAAA,CAAA,qBAAA,CAAA,GAAA,qBAA2C,CAAA;AAC3C,IAAA,eAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC,CAAA;AACvC,IAAA,eAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC,CAAA;AACvC,IAAA,eAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACrC,IAAA,eAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACrC,IAAA,eAAA,CAAA,yBAAA,CAAA,GAAA,yBAAmD,CAAA;AACnD,IAAA,eAAA,CAAA,2BAAA,CAAA,GAAA,2BAAuD,CAAA;AACvD,IAAA,eAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC3B,IAAA,eAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC3B,IAAA,eAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC3B,IAAA,eAAA,CAAA,aAAA,CAAA,GAAA,aAA2B,CAAA;AAC3B,IAAA,eAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC,CAAA;AACnC,IAAA,eAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC,CAAA;AACrC,CAAC,EAzBW,eAAe,KAAf,eAAe,GAyB1B,EAAA,CAAA,CAAA;;;;"}
|
package/dist/bundle.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var MyLibrary=function(E){"use strict";var T;return E.SpaceEventTypes=void 0,(T=E.SpaceEventTypes||(E.SpaceEventTypes={})).CONNECT="CONNECT",T.DISCONNECT="DISCONNECT",T.VOTE="VOTE",T.DELETE_VOTE="DELETE_VOTE",T.RESET_VOTES="RESET_VOTES",T.START_ROUND="START_ROUND",Object.defineProperty(E,"__esModule",{value:!0}),E}({});
|
|
1
|
+
var MyLibrary=function(E){"use strict";var T;return E.SpaceEventTypes=void 0,(T=E.SpaceEventTypes||(E.SpaceEventTypes={})).CONNECT="CONNECT",T.DISCONNECT="DISCONNECT",T.VOTE="VOTE",T.DELETE_VOTE="DELETE_VOTE",T.RESET_VOTES="RESET_VOTES",T.START_ROUND="START_ROUND",T.PLAYER_ADDED="PLAYER_ADDED",T.PLAYER_REMOVED="PLAYER_REMOVED",T.TASK_CREATED="TASK_CREATED",T.TASK_UPDATED="TASK_UPDATED",T.TASK_DELETED="TASK_DELETED",T.TASK_CREATION_ERROR="TASK_CREATION_ERROR",T.TASK_UPDATE_ERROR="TASK_UPDATE_ERROR",T.TASK_DELETE_ERROR="TASK_DELETE_ERROR",T.CATEGORY_CREATED="CATEGORY_CREATED",T.CATEGORY_DELETED="CATEGORY_DELETED",T.ASSING_TASK_TO_CATEGORY="ASSING_TASK_TO_CATEGORY",T.REMOVE_TASK_FROM_CATEGORY="REMOVE_TASK_FROM_CATEGORY",T.SPACE_ERROR="SPACE_ERROR",T.CREATE_TASK="CREATE_TASK",T.UPDATE_TASK="UPDATE_TASK",T.DELETE_TASK="DELETE_TASK",T.CREATE_CATEGORY="CREATE_CATEGORY",T.DELETE_CATEGORY="DELETE_CATEGORY",Object.defineProperty(E,"__esModule",{value:!0}),E}({});
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export type ITask = {
|
|
|
11
11
|
id: string;
|
|
12
12
|
title: string;
|
|
13
13
|
value: number;
|
|
14
|
+
categoryId?: string;
|
|
14
15
|
};
|
|
15
16
|
export type ISpace = {
|
|
16
17
|
id: string;
|
|
@@ -37,13 +38,38 @@ export interface IRound {
|
|
|
37
38
|
}
|
|
38
39
|
export interface IStats extends Record<string, Record<string, number>> {
|
|
39
40
|
}
|
|
41
|
+
export interface ICategory {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
spaceId?: string;
|
|
45
|
+
createdAt?: Date;
|
|
46
|
+
updatedAt?: Date;
|
|
47
|
+
}
|
|
40
48
|
export declare enum SpaceEventTypes {
|
|
41
49
|
CONNECT = "CONNECT",
|
|
42
50
|
DISCONNECT = "DISCONNECT",
|
|
43
51
|
VOTE = "VOTE",
|
|
44
52
|
DELETE_VOTE = "DELETE_VOTE",
|
|
45
53
|
RESET_VOTES = "RESET_VOTES",
|
|
46
|
-
START_ROUND = "START_ROUND"
|
|
54
|
+
START_ROUND = "START_ROUND",
|
|
55
|
+
PLAYER_ADDED = "PLAYER_ADDED",
|
|
56
|
+
PLAYER_REMOVED = "PLAYER_REMOVED",
|
|
57
|
+
TASK_CREATED = "TASK_CREATED",
|
|
58
|
+
TASK_UPDATED = "TASK_UPDATED",
|
|
59
|
+
TASK_DELETED = "TASK_DELETED",
|
|
60
|
+
TASK_CREATION_ERROR = "TASK_CREATION_ERROR",
|
|
61
|
+
TASK_UPDATE_ERROR = "TASK_UPDATE_ERROR",
|
|
62
|
+
TASK_DELETE_ERROR = "TASK_DELETE_ERROR",
|
|
63
|
+
CATEGORY_CREATED = "CATEGORY_CREATED",
|
|
64
|
+
CATEGORY_DELETED = "CATEGORY_DELETED",
|
|
65
|
+
ASSING_TASK_TO_CATEGORY = "ASSING_TASK_TO_CATEGORY",
|
|
66
|
+
REMOVE_TASK_FROM_CATEGORY = "REMOVE_TASK_FROM_CATEGORY",
|
|
67
|
+
SPACE_ERROR = "SPACE_ERROR",
|
|
68
|
+
CREATE_TASK = "CREATE_TASK",
|
|
69
|
+
UPDATE_TASK = "UPDATE_TASK",
|
|
70
|
+
DELETE_TASK = "DELETE_TASK",
|
|
71
|
+
CREATE_CATEGORY = "CREATE_CATEGORY",
|
|
72
|
+
DELETE_CATEGORY = "DELETE_CATEGORY"
|
|
47
73
|
}
|
|
48
74
|
export type VoteMessageBody = {
|
|
49
75
|
type: "minus" | "plus";
|
|
@@ -53,6 +79,77 @@ export type VoteMessageBody = {
|
|
|
53
79
|
export type VoteDeleteMessageBody = {
|
|
54
80
|
voteId: string;
|
|
55
81
|
};
|
|
82
|
+
export type CreateTaskMessageBody = {
|
|
83
|
+
title: string;
|
|
84
|
+
description: string;
|
|
85
|
+
value: number;
|
|
86
|
+
categoryId?: string;
|
|
87
|
+
};
|
|
88
|
+
export type UpdateTaskMessageBody = {
|
|
89
|
+
taskId: string;
|
|
90
|
+
title: string;
|
|
91
|
+
description: string;
|
|
92
|
+
value: number;
|
|
93
|
+
};
|
|
94
|
+
export type DeleteTaskMessageBody = {
|
|
95
|
+
taskId: string;
|
|
96
|
+
};
|
|
97
|
+
export type CreateCategoryMessageBody = {
|
|
98
|
+
category: {
|
|
99
|
+
name: string;
|
|
100
|
+
};
|
|
101
|
+
taskIDs?: string[];
|
|
102
|
+
};
|
|
103
|
+
export type AssignTaskToCategoryMessageBody = {
|
|
104
|
+
taskId: string;
|
|
105
|
+
categoryId: string;
|
|
106
|
+
};
|
|
107
|
+
export type RemoveTaskFromCategoryMessageBody = {
|
|
108
|
+
taskId: string;
|
|
109
|
+
categoryId: string;
|
|
110
|
+
};
|
|
111
|
+
export type DeleteCategoryMessageBody = {
|
|
112
|
+
categoryId: string;
|
|
113
|
+
};
|
|
114
|
+
export type CreateSpaceDto = {
|
|
115
|
+
spaceName: string;
|
|
116
|
+
taskTemplateId?: string;
|
|
117
|
+
taskTemplate?: string;
|
|
118
|
+
};
|
|
119
|
+
export type InviteSpaceDto = {
|
|
120
|
+
email: string;
|
|
121
|
+
};
|
|
122
|
+
export type CreatePlayerDto = {
|
|
123
|
+
displayName: string;
|
|
124
|
+
};
|
|
125
|
+
export type UpdatePlayerDto = {
|
|
126
|
+
displayName?: string;
|
|
127
|
+
};
|
|
128
|
+
export type SaveNotificationTokenDto = {
|
|
129
|
+
token: string;
|
|
130
|
+
};
|
|
131
|
+
export type UpdateDisplayNameDto = {
|
|
132
|
+
displayName: string;
|
|
133
|
+
};
|
|
134
|
+
export type SendPushNotificationDto = {
|
|
135
|
+
pushToken: string;
|
|
136
|
+
title: string;
|
|
137
|
+
body: string;
|
|
138
|
+
data?: Record<string, any>;
|
|
139
|
+
};
|
|
140
|
+
export type SendMultiplePushNotificationDto = {
|
|
141
|
+
pushTokens: string[];
|
|
142
|
+
title: string;
|
|
143
|
+
body: string;
|
|
144
|
+
data?: Record<string, any>;
|
|
145
|
+
};
|
|
146
|
+
export type GetReceiptsDto = {
|
|
147
|
+
receiptIds: string[];
|
|
148
|
+
};
|
|
149
|
+
export type SpaceStatisticsQueryDto = {
|
|
150
|
+
startDate: string;
|
|
151
|
+
endDate: string;
|
|
152
|
+
};
|
|
56
153
|
type ResponseMessageBase = {
|
|
57
154
|
errorMessages?: {
|
|
58
155
|
type: string;
|
|
@@ -74,7 +171,7 @@ export type ConnectMessageResponse = ResponseMessageBase & {
|
|
|
74
171
|
users: IUser[];
|
|
75
172
|
currentPeriod: IRound;
|
|
76
173
|
stats: IStats;
|
|
77
|
-
categories?:
|
|
174
|
+
categories?: ICategory[];
|
|
78
175
|
};
|
|
79
176
|
export type ResetVotesMessageResponse = ResponseMessageBase & {
|
|
80
177
|
votes: IVote[];
|
|
@@ -82,6 +179,54 @@ export type ResetVotesMessageResponse = ResponseMessageBase & {
|
|
|
82
179
|
export type StartRoundMessageResponse = ResponseMessageBase & {
|
|
83
180
|
round?: IRound;
|
|
84
181
|
};
|
|
182
|
+
export type PlayerAddedMessageResponse = ResponseMessageBase & {
|
|
183
|
+
player: {
|
|
184
|
+
id: string;
|
|
185
|
+
displayName: string;
|
|
186
|
+
userId?: string;
|
|
187
|
+
email?: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
export type PlayerRemovedMessageResponse = ResponseMessageBase & {
|
|
191
|
+
playerId: string;
|
|
192
|
+
};
|
|
193
|
+
export type TaskCreatedMessageResponse = ResponseMessageBase & {
|
|
194
|
+
task: ITask;
|
|
195
|
+
};
|
|
196
|
+
export type TaskUpdatedMessageResponse = ResponseMessageBase & {
|
|
197
|
+
task: ITask;
|
|
198
|
+
};
|
|
199
|
+
export type TaskDeletedMessageResponse = ResponseMessageBase & {
|
|
200
|
+
taskId: string;
|
|
201
|
+
};
|
|
202
|
+
export type TaskCreationErrorMessageResponse = ResponseMessageBase & {
|
|
203
|
+
message: string;
|
|
204
|
+
};
|
|
205
|
+
export type TaskUpdateErrorMessageResponse = ResponseMessageBase & {
|
|
206
|
+
message: string;
|
|
207
|
+
};
|
|
208
|
+
export type TaskDeleteErrorMessageResponse = ResponseMessageBase & {
|
|
209
|
+
message: string;
|
|
210
|
+
};
|
|
211
|
+
export type CategoryCreatedMessageResponse = ResponseMessageBase & {
|
|
212
|
+
category: ICategory;
|
|
213
|
+
updatedTaskIDs?: string[];
|
|
214
|
+
};
|
|
215
|
+
export type CategoryDeletedMessageResponse = ResponseMessageBase & {
|
|
216
|
+
categoryId: string;
|
|
217
|
+
tasks: ITask[];
|
|
218
|
+
};
|
|
219
|
+
export type AssignTaskToCategoryMessageResponse = ResponseMessageBase & {
|
|
220
|
+
taskId: string;
|
|
221
|
+
categoryId: string;
|
|
222
|
+
};
|
|
223
|
+
export type RemoveTaskFromCategoryMessageResponse = ResponseMessageBase & {
|
|
224
|
+
taskId: string;
|
|
225
|
+
categoryId: string;
|
|
226
|
+
};
|
|
227
|
+
export type SpaceErrorMessageResponse = ResponseMessageBase & {
|
|
228
|
+
message: string;
|
|
229
|
+
};
|
|
85
230
|
export interface GameServerToClientEvents {
|
|
86
231
|
[SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;
|
|
87
232
|
[SpaceEventTypes.DISCONNECT]: (message: any) => void;
|
|
@@ -89,6 +234,19 @@ export interface GameServerToClientEvents {
|
|
|
89
234
|
[SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;
|
|
90
235
|
[SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;
|
|
91
236
|
[SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;
|
|
237
|
+
[SpaceEventTypes.PLAYER_ADDED]: (message: PlayerAddedMessageResponse) => void;
|
|
238
|
+
[SpaceEventTypes.PLAYER_REMOVED]: (message: PlayerRemovedMessageResponse) => void;
|
|
239
|
+
[SpaceEventTypes.TASK_CREATED]: (message: TaskCreatedMessageResponse) => void;
|
|
240
|
+
[SpaceEventTypes.TASK_UPDATED]: (message: TaskUpdatedMessageResponse) => void;
|
|
241
|
+
[SpaceEventTypes.TASK_DELETED]: (message: TaskDeletedMessageResponse) => void;
|
|
242
|
+
[SpaceEventTypes.TASK_CREATION_ERROR]: (message: TaskCreationErrorMessageResponse) => void;
|
|
243
|
+
[SpaceEventTypes.TASK_UPDATE_ERROR]: (message: TaskUpdateErrorMessageResponse) => void;
|
|
244
|
+
[SpaceEventTypes.TASK_DELETE_ERROR]: (message: TaskDeleteErrorMessageResponse) => void;
|
|
245
|
+
[SpaceEventTypes.CATEGORY_CREATED]: (message: CategoryCreatedMessageResponse) => void;
|
|
246
|
+
[SpaceEventTypes.CATEGORY_DELETED]: (message: CategoryDeletedMessageResponse) => void;
|
|
247
|
+
[SpaceEventTypes.ASSING_TASK_TO_CATEGORY]: (message: AssignTaskToCategoryMessageResponse) => void;
|
|
248
|
+
[SpaceEventTypes.REMOVE_TASK_FROM_CATEGORY]: (message: RemoveTaskFromCategoryMessageResponse) => void;
|
|
249
|
+
[SpaceEventTypes.SPACE_ERROR]: (message: SpaceErrorMessageResponse) => void;
|
|
92
250
|
}
|
|
93
251
|
export interface GameClientToServerEvents {
|
|
94
252
|
[SpaceEventTypes.CONNECT]: (message: any) => void;
|
|
@@ -96,5 +254,12 @@ export interface GameClientToServerEvents {
|
|
|
96
254
|
[SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;
|
|
97
255
|
[SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
|
|
98
256
|
[SpaceEventTypes.RESET_VOTES]: (message: any) => void;
|
|
257
|
+
[SpaceEventTypes.CREATE_TASK]: (message: CreateTaskMessageBody) => void;
|
|
258
|
+
[SpaceEventTypes.UPDATE_TASK]: (message: UpdateTaskMessageBody) => void;
|
|
259
|
+
[SpaceEventTypes.DELETE_TASK]: (message: DeleteTaskMessageBody) => void;
|
|
260
|
+
[SpaceEventTypes.CREATE_CATEGORY]: (message: CreateCategoryMessageBody) => void;
|
|
261
|
+
[SpaceEventTypes.ASSING_TASK_TO_CATEGORY]: (message: AssignTaskToCategoryMessageBody) => void;
|
|
262
|
+
[SpaceEventTypes.REMOVE_TASK_FROM_CATEGORY]: (message: RemoveTaskFromCategoryMessageBody) => void;
|
|
263
|
+
[SpaceEventTypes.DELETE_CATEGORY]: (message: DeleteCategoryMessageBody) => void;
|
|
99
264
|
}
|
|
100
265
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -10,4 +10,22 @@ exports.SpaceEventTypes = void 0;
|
|
|
10
10
|
SpaceEventTypes["DELETE_VOTE"] = "DELETE_VOTE";
|
|
11
11
|
SpaceEventTypes["RESET_VOTES"] = "RESET_VOTES";
|
|
12
12
|
SpaceEventTypes["START_ROUND"] = "START_ROUND";
|
|
13
|
+
SpaceEventTypes["PLAYER_ADDED"] = "PLAYER_ADDED";
|
|
14
|
+
SpaceEventTypes["PLAYER_REMOVED"] = "PLAYER_REMOVED";
|
|
15
|
+
SpaceEventTypes["TASK_CREATED"] = "TASK_CREATED";
|
|
16
|
+
SpaceEventTypes["TASK_UPDATED"] = "TASK_UPDATED";
|
|
17
|
+
SpaceEventTypes["TASK_DELETED"] = "TASK_DELETED";
|
|
18
|
+
SpaceEventTypes["TASK_CREATION_ERROR"] = "TASK_CREATION_ERROR";
|
|
19
|
+
SpaceEventTypes["TASK_UPDATE_ERROR"] = "TASK_UPDATE_ERROR";
|
|
20
|
+
SpaceEventTypes["TASK_DELETE_ERROR"] = "TASK_DELETE_ERROR";
|
|
21
|
+
SpaceEventTypes["CATEGORY_CREATED"] = "CATEGORY_CREATED";
|
|
22
|
+
SpaceEventTypes["CATEGORY_DELETED"] = "CATEGORY_DELETED";
|
|
23
|
+
SpaceEventTypes["ASSING_TASK_TO_CATEGORY"] = "ASSING_TASK_TO_CATEGORY";
|
|
24
|
+
SpaceEventTypes["REMOVE_TASK_FROM_CATEGORY"] = "REMOVE_TASK_FROM_CATEGORY";
|
|
25
|
+
SpaceEventTypes["SPACE_ERROR"] = "SPACE_ERROR";
|
|
26
|
+
SpaceEventTypes["CREATE_TASK"] = "CREATE_TASK";
|
|
27
|
+
SpaceEventTypes["UPDATE_TASK"] = "UPDATE_TASK";
|
|
28
|
+
SpaceEventTypes["DELETE_TASK"] = "DELETE_TASK";
|
|
29
|
+
SpaceEventTypes["CREATE_CATEGORY"] = "CREATE_CATEGORY";
|
|
30
|
+
SpaceEventTypes["DELETE_CATEGORY"] = "DELETE_CATEGORY";
|
|
13
31
|
})(exports.SpaceEventTypes || (exports.SpaceEventTypes = {}));
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cleanstrategytypes",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.38",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "rollup -c",
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
-
"version": "npm run build && git add -A dist"
|
|
10
|
-
"postversion": "git push && git push --tags"
|
|
9
|
+
"version": "npm run build && git add -A dist"
|
|
11
10
|
},
|
|
12
11
|
"author": "",
|
|
13
12
|
"license": "ISC",
|
package/src/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ export type ITask = {
|
|
|
12
12
|
id: string;
|
|
13
13
|
title: string;
|
|
14
14
|
value: number;
|
|
15
|
+
categoryId?: string;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export type ISpace = {
|
|
@@ -41,7 +42,15 @@ export interface IRound {
|
|
|
41
42
|
status?: "finished" | "active";
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
export interface IStats extends Record<string, Record<string, number>> {
|
|
45
|
+
export interface IStats extends Record<string, Record<string, number>> {}
|
|
46
|
+
|
|
47
|
+
export interface ICategory {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
spaceId?: string;
|
|
51
|
+
createdAt?: Date;
|
|
52
|
+
updatedAt?: Date;
|
|
53
|
+
}
|
|
45
54
|
|
|
46
55
|
export enum SpaceEventTypes {
|
|
47
56
|
CONNECT = "CONNECT",
|
|
@@ -50,7 +59,26 @@ export enum SpaceEventTypes {
|
|
|
50
59
|
DELETE_VOTE = "DELETE_VOTE",
|
|
51
60
|
RESET_VOTES = "RESET_VOTES",
|
|
52
61
|
START_ROUND = "START_ROUND",
|
|
62
|
+
PLAYER_ADDED = "PLAYER_ADDED",
|
|
63
|
+
PLAYER_REMOVED = "PLAYER_REMOVED",
|
|
64
|
+
TASK_CREATED = "TASK_CREATED",
|
|
65
|
+
TASK_UPDATED = "TASK_UPDATED",
|
|
66
|
+
TASK_DELETED = "TASK_DELETED",
|
|
67
|
+
TASK_CREATION_ERROR = "TASK_CREATION_ERROR",
|
|
68
|
+
TASK_UPDATE_ERROR = "TASK_UPDATE_ERROR",
|
|
69
|
+
TASK_DELETE_ERROR = "TASK_DELETE_ERROR",
|
|
70
|
+
CATEGORY_CREATED = "CATEGORY_CREATED",
|
|
71
|
+
CATEGORY_DELETED = "CATEGORY_DELETED",
|
|
72
|
+
ASSING_TASK_TO_CATEGORY = "ASSING_TASK_TO_CATEGORY",
|
|
73
|
+
REMOVE_TASK_FROM_CATEGORY = "REMOVE_TASK_FROM_CATEGORY",
|
|
74
|
+
SPACE_ERROR = "SPACE_ERROR",
|
|
75
|
+
CREATE_TASK = "CREATE_TASK",
|
|
76
|
+
UPDATE_TASK = "UPDATE_TASK",
|
|
77
|
+
DELETE_TASK = "DELETE_TASK",
|
|
78
|
+
CREATE_CATEGORY = "CREATE_CATEGORY",
|
|
79
|
+
DELETE_CATEGORY = "DELETE_CATEGORY",
|
|
53
80
|
}
|
|
81
|
+
//
|
|
54
82
|
|
|
55
83
|
// RequestMessage
|
|
56
84
|
|
|
@@ -64,6 +92,93 @@ export type VoteDeleteMessageBody = {
|
|
|
64
92
|
voteId: string;
|
|
65
93
|
};
|
|
66
94
|
|
|
95
|
+
export type CreateTaskMessageBody = {
|
|
96
|
+
title: string;
|
|
97
|
+
description: string;
|
|
98
|
+
value: number;
|
|
99
|
+
categoryId?: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type UpdateTaskMessageBody = {
|
|
103
|
+
taskId: string;
|
|
104
|
+
title: string;
|
|
105
|
+
description: string;
|
|
106
|
+
value: number;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export type DeleteTaskMessageBody = {
|
|
110
|
+
taskId: string;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export type CreateCategoryMessageBody = {
|
|
114
|
+
category: { name: string };
|
|
115
|
+
taskIDs?: string[];
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export type AssignTaskToCategoryMessageBody = {
|
|
119
|
+
taskId: string;
|
|
120
|
+
categoryId: string;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export type RemoveTaskFromCategoryMessageBody = {
|
|
124
|
+
taskId: string;
|
|
125
|
+
categoryId: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export type DeleteCategoryMessageBody = {
|
|
129
|
+
categoryId: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// HTTP DTOs (shared)
|
|
133
|
+
export type CreateSpaceDto = {
|
|
134
|
+
spaceName: string;
|
|
135
|
+
taskTemplateId?: string;
|
|
136
|
+
taskTemplate?: string;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export type InviteSpaceDto = {
|
|
140
|
+
email: string;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export type CreatePlayerDto = {
|
|
144
|
+
displayName: string;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export type UpdatePlayerDto = {
|
|
148
|
+
displayName?: string;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export type SaveNotificationTokenDto = {
|
|
152
|
+
token: string;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export type UpdateDisplayNameDto = {
|
|
156
|
+
displayName: string;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export type SendPushNotificationDto = {
|
|
160
|
+
pushToken: string;
|
|
161
|
+
title: string;
|
|
162
|
+
body: string;
|
|
163
|
+
data?: Record<string, any>;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export type SendMultiplePushNotificationDto = {
|
|
167
|
+
pushTokens: string[];
|
|
168
|
+
title: string;
|
|
169
|
+
body: string;
|
|
170
|
+
data?: Record<string, any>;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export type GetReceiptsDto = {
|
|
174
|
+
receiptIds: string[];
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export type SpaceStatisticsQueryDto = {
|
|
178
|
+
startDate: string; // ISO8601
|
|
179
|
+
endDate: string; // ISO8601
|
|
180
|
+
};
|
|
181
|
+
|
|
67
182
|
// ResponseMessage
|
|
68
183
|
type ResponseMessageBase = {
|
|
69
184
|
errorMessages?: { type: string; message: string }[];
|
|
@@ -84,10 +199,10 @@ export type StartRoundResponseMessage = ResponseMessageBase & {
|
|
|
84
199
|
export type ConnectMessageResponse = ResponseMessageBase & {
|
|
85
200
|
votes: IVote[];
|
|
86
201
|
tasks: ITask[];
|
|
87
|
-
users: IUser[];
|
|
202
|
+
users: IUser[];
|
|
88
203
|
currentPeriod: IRound;
|
|
89
204
|
stats: IStats;
|
|
90
|
-
categories?:
|
|
205
|
+
categories?: ICategory[];
|
|
91
206
|
};
|
|
92
207
|
|
|
93
208
|
export type ResetVotesMessageResponse = ResponseMessageBase & {
|
|
@@ -98,6 +213,67 @@ export type StartRoundMessageResponse = ResponseMessageBase & {
|
|
|
98
213
|
round?: IRound;
|
|
99
214
|
};
|
|
100
215
|
|
|
216
|
+
export type PlayerAddedMessageResponse = ResponseMessageBase & {
|
|
217
|
+
player: {
|
|
218
|
+
id: string;
|
|
219
|
+
displayName: string;
|
|
220
|
+
userId?: string;
|
|
221
|
+
email?: string;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export type PlayerRemovedMessageResponse = ResponseMessageBase & {
|
|
226
|
+
playerId: string;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export type TaskCreatedMessageResponse = ResponseMessageBase & {
|
|
230
|
+
task: ITask;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
export type TaskUpdatedMessageResponse = ResponseMessageBase & {
|
|
234
|
+
task: ITask;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export type TaskDeletedMessageResponse = ResponseMessageBase & {
|
|
238
|
+
taskId: string;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export type TaskCreationErrorMessageResponse = ResponseMessageBase & {
|
|
242
|
+
message: string;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export type TaskUpdateErrorMessageResponse = ResponseMessageBase & {
|
|
246
|
+
message: string;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export type TaskDeleteErrorMessageResponse = ResponseMessageBase & {
|
|
250
|
+
message: string;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
export type CategoryCreatedMessageResponse = ResponseMessageBase & {
|
|
254
|
+
category: ICategory;
|
|
255
|
+
updatedTaskIDs?: string[];
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export type CategoryDeletedMessageResponse = ResponseMessageBase & {
|
|
259
|
+
categoryId: string;
|
|
260
|
+
tasks: ITask[];
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export type AssignTaskToCategoryMessageResponse = ResponseMessageBase & {
|
|
264
|
+
taskId: string;
|
|
265
|
+
categoryId: string;
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export type RemoveTaskFromCategoryMessageResponse = ResponseMessageBase & {
|
|
269
|
+
taskId: string;
|
|
270
|
+
categoryId: string;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export type SpaceErrorMessageResponse = ResponseMessageBase & {
|
|
274
|
+
message: string;
|
|
275
|
+
};
|
|
276
|
+
|
|
101
277
|
export interface GameServerToClientEvents {
|
|
102
278
|
[SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;
|
|
103
279
|
[SpaceEventTypes.DISCONNECT]: (message: any) => void;
|
|
@@ -105,6 +281,19 @@ export interface GameServerToClientEvents {
|
|
|
105
281
|
[SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;
|
|
106
282
|
[SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;
|
|
107
283
|
[SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;
|
|
284
|
+
[SpaceEventTypes.PLAYER_ADDED]: (message: PlayerAddedMessageResponse) => void;
|
|
285
|
+
[SpaceEventTypes.PLAYER_REMOVED]: (message: PlayerRemovedMessageResponse) => void;
|
|
286
|
+
[SpaceEventTypes.TASK_CREATED]: (message: TaskCreatedMessageResponse) => void;
|
|
287
|
+
[SpaceEventTypes.TASK_UPDATED]: (message: TaskUpdatedMessageResponse) => void;
|
|
288
|
+
[SpaceEventTypes.TASK_DELETED]: (message: TaskDeletedMessageResponse) => void;
|
|
289
|
+
[SpaceEventTypes.TASK_CREATION_ERROR]: (message: TaskCreationErrorMessageResponse) => void;
|
|
290
|
+
[SpaceEventTypes.TASK_UPDATE_ERROR]: (message: TaskUpdateErrorMessageResponse) => void;
|
|
291
|
+
[SpaceEventTypes.TASK_DELETE_ERROR]: (message: TaskDeleteErrorMessageResponse) => void;
|
|
292
|
+
[SpaceEventTypes.CATEGORY_CREATED]: (message: CategoryCreatedMessageResponse) => void;
|
|
293
|
+
[SpaceEventTypes.CATEGORY_DELETED]: (message: CategoryDeletedMessageResponse) => void;
|
|
294
|
+
[SpaceEventTypes.ASSING_TASK_TO_CATEGORY]: (message: AssignTaskToCategoryMessageResponse) => void;
|
|
295
|
+
[SpaceEventTypes.REMOVE_TASK_FROM_CATEGORY]: (message: RemoveTaskFromCategoryMessageResponse) => void;
|
|
296
|
+
[SpaceEventTypes.SPACE_ERROR]: (message: SpaceErrorMessageResponse) => void;
|
|
108
297
|
}
|
|
109
298
|
|
|
110
299
|
export interface GameClientToServerEvents {
|
|
@@ -113,4 +302,11 @@ export interface GameClientToServerEvents {
|
|
|
113
302
|
[SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;
|
|
114
303
|
[SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
|
|
115
304
|
[SpaceEventTypes.RESET_VOTES]: (message: any) => void;
|
|
305
|
+
[SpaceEventTypes.CREATE_TASK]: (message: CreateTaskMessageBody) => void;
|
|
306
|
+
[SpaceEventTypes.UPDATE_TASK]: (message: UpdateTaskMessageBody) => void;
|
|
307
|
+
[SpaceEventTypes.DELETE_TASK]: (message: DeleteTaskMessageBody) => void;
|
|
308
|
+
[SpaceEventTypes.CREATE_CATEGORY]: (message: CreateCategoryMessageBody) => void;
|
|
309
|
+
[SpaceEventTypes.ASSING_TASK_TO_CATEGORY]: (message: AssignTaskToCategoryMessageBody) => void;
|
|
310
|
+
[SpaceEventTypes.REMOVE_TASK_FROM_CATEGORY]: (message: RemoveTaskFromCategoryMessageBody) => void;
|
|
311
|
+
[SpaceEventTypes.DELETE_CATEGORY]: (message: DeleteCategoryMessageBody) => void;
|
|
116
312
|
}
|