cleanstrategytypes 1.1.10 → 1.1.12

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.
@@ -2,11 +2,10 @@ var SpaceEventTypes;
2
2
  (function (SpaceEventTypes) {
3
3
  SpaceEventTypes["CONNECT"] = "CONNECT";
4
4
  SpaceEventTypes["DISCONNECT"] = "DISCONNECT";
5
- SpaceEventTypes["START_PERIOD"] = "START_PERIOD";
6
- SpaceEventTypes["END_PERIOD"] = "END_PERIOD";
7
5
  SpaceEventTypes["VOTE"] = "VOTE";
8
6
  SpaceEventTypes["DELETE_VOTE"] = "DELETE_VOTE";
9
7
  SpaceEventTypes["RESET_VOTES"] = "RESET_VOTES";
8
+ SpaceEventTypes["START_ROUND"] = "START_ROUND";
10
9
  })(SpaceEventTypes || (SpaceEventTypes = {}));
11
10
 
12
11
  export { SpaceEventTypes };
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"sourcesContent":["export interface IVote {\r\n id: string;\r\n periodId: string;\r\n userId: string;\r\n taskId: string;\r\n count?: number;\r\n}\r\n\r\nexport type ITask = {\r\n id: string;\r\n title: string;\r\n value: number;\r\n};\r\n\r\nexport type ISpace = {\r\n id: string;\r\n name: string;\r\n roles: string[];\r\n};\r\n\r\nexport interface ICurrentUser {\r\n id: string;\r\n displayName: string;\r\n email: string;\r\n tenants: ISpace[];\r\n}\r\n\r\nexport interface IUser {\r\n id: string;\r\n displayName: string;\r\n color: string;\r\n}\r\n\r\nexport interface IPeriod {\r\n id: string;\r\n order: number;\r\n spaceId: string;\r\n startDate: string;\r\n endDate: string;\r\n}\r\n\r\nexport enum SpaceEventTypes {\r\n CONNECT = \"CONNECT\",\r\n DISCONNECT = \"DISCONNECT\",\r\n START_PERIOD = \"START_PERIOD\",\r\n END_PERIOD = \"END_PERIOD\",\r\n VOTE = \"VOTE\",\r\n DELETE_VOTE = \"DELETE_VOTE\",\r\n RESET_VOTES = \"RESET_VOTES\",\r\n}\r\n\r\n// RequestMessage\r\n\r\nexport type VoteMessageBody = {\r\n type: \"minus\" | \"plus\";\r\n taskId: string;\r\n currentUserId: string;\r\n};\r\n\r\nexport type VoteDeleteMessageBody = {\r\n voteId: string;\r\n};\r\n\r\n// ResponseMessage\r\n\r\nexport type VoteMessageResponse = {\r\n vote: IVote;\r\n};\r\nexport type VoteDeleteMessageResponse = {\r\n voteId: string;\r\n};\r\nexport type ConnectMessageResponse = {\r\n votes: IVote[];\r\n tasks: ITask[];\r\n users: IUser[];\r\n currentPeriod: IPeriod;\r\n};\r\n\r\nexport type ResetVotesMessageResponse = {\r\n votes: IVote[];\r\n};\r\n\r\nexport interface GameServerToClientEvents {\r\n [SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;\r\n [SpaceEventTypes.DISCONNECT]: (message: any) => void;\r\n [SpaceEventTypes.END_PERIOD]: (message: any) => void;\r\n [SpaceEventTypes.START_PERIOD]: (message: any) => void;\r\n [SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;\r\n [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;\r\n [SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;\r\n}\r\n\r\nexport interface GameClientToServerEvents {\r\n [SpaceEventTypes.CONNECT]: (message: any) => void;\r\n [SpaceEventTypes.START_PERIOD]: (message: any) => void;\r\n [SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;\r\n [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;\r\n [SpaceEventTypes.END_PERIOD]: (message: any) => void;\r\n [SpaceEventTypes.START_PERIOD]: (message: any) => void;\r\n [SpaceEventTypes.RESET_VOTES]: (message: any) => void;\r\n}\r\n"],"names":[],"mappings":"IAyCY,gBAQX;AARD,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,cAAA,CAAA,GAAA,cAA6B,CAAA;AAC7B,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;AAC7B,CAAC,EARW,eAAe,KAAf,eAAe,GAQ1B,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"sourcesContent":["export interface IVote {\r\n id: string;\r\n periodId: string;\r\n userId: string;\r\n taskId: string;\r\n count?: number;\r\n}\r\n\r\nexport type ITask = {\r\n id: string;\r\n title: string;\r\n value: number;\r\n};\r\n\r\nexport type ISpace = {\r\n id: string;\r\n name: string;\r\n roles: string[];\r\n};\r\n\r\nexport interface ICurrentUser {\r\n id: string;\r\n displayName: string;\r\n email: string;\r\n tenants: ISpace[];\r\n}\r\n\r\nexport interface IUser {\r\n id: string;\r\n displayName: string;\r\n color: string;\r\n}\r\n\r\nexport interface IRound {\r\n id: string;\r\n order: number;\r\n spaceId: string;\r\n endDate: string;\r\n}\r\n\r\nexport enum SpaceEventTypes {\r\n CONNECT = \"CONNECT\",\r\n DISCONNECT = \"DISCONNECT\",\r\n VOTE = \"VOTE\",\r\n DELETE_VOTE = \"DELETE_VOTE\",\r\n RESET_VOTES = \"RESET_VOTES\",\r\n START_ROUND = \"START_ROUND\",\r\n}\r\n\r\n// RequestMessage\r\n\r\nexport type VoteMessageBody = {\r\n type: \"minus\" | \"plus\";\r\n taskId: string;\r\n currentUserId: string;\r\n};\r\n\r\nexport type VoteDeleteMessageBody = {\r\n voteId: string;\r\n};\r\n\r\n// ResponseMessage\r\ntype ResponseMessageBase = {\r\n errorMessages?: { type: string; message: string }[];\r\n};\r\n\r\nexport type VoteMessageResponse = ResponseMessageBase & {\r\n vote: IVote;\r\n};\r\nexport type VoteDeleteMessageResponse = ResponseMessageBase & {\r\n voteId: string;\r\n};\r\n\r\nexport type StartRoundResponseMessage = ResponseMessageBase & {\r\n round: IRound;\r\n};\r\n\r\nexport type ConnectMessageResponse = ResponseMessageBase & {\r\n votes: IVote[];\r\n tasks: ITask[];\r\n users: IUser[];\r\n currentPeriod: IRound;\r\n};\r\n\r\nexport type ResetVotesMessageResponse = ResponseMessageBase & {\r\n votes: IVote[];\r\n};\r\n\r\nexport type StartRoundMessageResponse = ResponseMessageBase & {\r\n round?: IRound;\r\n};\r\n\r\nexport interface GameServerToClientEvents {\r\n [SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;\r\n [SpaceEventTypes.DISCONNECT]: (message: any) => void;\r\n [SpaceEventTypes.START_ROUND]: (message: StartRoundMessageResponse) => void;\r\n [SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;\r\n [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;\r\n [SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;\r\n}\r\n\r\nexport interface GameClientToServerEvents {\r\n [SpaceEventTypes.CONNECT]: (message: any) => void;\r\n [SpaceEventTypes.START_ROUND]: (message: any) => void;\r\n [SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;\r\n [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;\r\n [SpaceEventTypes.RESET_VOTES]: (message: any) => void;\r\n}\r\n"],"names":[],"mappings":"IAwCY,gBAOX;AAPD,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;AAC7B,CAAC,EAPW,eAAe,KAAf,eAAe,GAO1B,EAAA,CAAA,CAAA;;;;"}
@@ -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.START_PERIOD="START_PERIOD",T.END_PERIOD="END_PERIOD",T.VOTE="VOTE",T.DELETE_VOTE="DELETE_VOTE",T.RESET_VOTES="RESET_VOTES",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",Object.defineProperty(E,"__esModule",{value:!0}),E}({});
package/dist/index.d.ts CHANGED
@@ -26,21 +26,19 @@ export interface IUser {
26
26
  displayName: string;
27
27
  color: string;
28
28
  }
29
- export interface IPeriod {
29
+ export interface IRound {
30
30
  id: string;
31
31
  order: number;
32
32
  spaceId: string;
33
- startDate: string;
34
33
  endDate: string;
35
34
  }
36
35
  export declare enum SpaceEventTypes {
37
36
  CONNECT = "CONNECT",
38
37
  DISCONNECT = "DISCONNECT",
39
- START_PERIOD = "START_PERIOD",
40
- END_PERIOD = "END_PERIOD",
41
38
  VOTE = "VOTE",
42
39
  DELETE_VOTE = "DELETE_VOTE",
43
- RESET_VOTES = "RESET_VOTES"
40
+ RESET_VOTES = "RESET_VOTES",
41
+ START_ROUND = "START_ROUND"
44
42
  }
45
43
  export type VoteMessageBody = {
46
44
  type: "minus" | "plus";
@@ -50,36 +48,46 @@ export type VoteMessageBody = {
50
48
  export type VoteDeleteMessageBody = {
51
49
  voteId: string;
52
50
  };
53
- export type VoteMessageResponse = {
51
+ type ResponseMessageBase = {
52
+ errorMessages?: {
53
+ type: string;
54
+ message: string;
55
+ }[];
56
+ };
57
+ export type VoteMessageResponse = ResponseMessageBase & {
54
58
  vote: IVote;
55
59
  };
56
- export type VoteDeleteMessageResponse = {
60
+ export type VoteDeleteMessageResponse = ResponseMessageBase & {
57
61
  voteId: string;
58
62
  };
59
- export type ConnectMessageResponse = {
63
+ export type StartRoundResponseMessage = ResponseMessageBase & {
64
+ round: IRound;
65
+ };
66
+ export type ConnectMessageResponse = ResponseMessageBase & {
60
67
  votes: IVote[];
61
68
  tasks: ITask[];
62
69
  users: IUser[];
63
- currentPeriod: IPeriod;
70
+ currentPeriod: IRound;
64
71
  };
65
- export type ResetVotesMessageResponse = {
72
+ export type ResetVotesMessageResponse = ResponseMessageBase & {
66
73
  votes: IVote[];
67
74
  };
75
+ export type StartRoundMessageResponse = ResponseMessageBase & {
76
+ round?: IRound;
77
+ };
68
78
  export interface GameServerToClientEvents {
69
79
  [SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;
70
80
  [SpaceEventTypes.DISCONNECT]: (message: any) => void;
71
- [SpaceEventTypes.END_PERIOD]: (message: any) => void;
72
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
81
+ [SpaceEventTypes.START_ROUND]: (message: StartRoundMessageResponse) => void;
73
82
  [SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;
74
83
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;
75
84
  [SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;
76
85
  }
77
86
  export interface GameClientToServerEvents {
78
87
  [SpaceEventTypes.CONNECT]: (message: any) => void;
79
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
88
+ [SpaceEventTypes.START_ROUND]: (message: any) => void;
80
89
  [SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;
81
90
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
82
- [SpaceEventTypes.END_PERIOD]: (message: any) => void;
83
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
84
91
  [SpaceEventTypes.RESET_VOTES]: (message: any) => void;
85
92
  }
93
+ export {};
package/dist/index.js CHANGED
@@ -6,9 +6,8 @@ exports.SpaceEventTypes = void 0;
6
6
  (function (SpaceEventTypes) {
7
7
  SpaceEventTypes["CONNECT"] = "CONNECT";
8
8
  SpaceEventTypes["DISCONNECT"] = "DISCONNECT";
9
- SpaceEventTypes["START_PERIOD"] = "START_PERIOD";
10
- SpaceEventTypes["END_PERIOD"] = "END_PERIOD";
11
9
  SpaceEventTypes["VOTE"] = "VOTE";
12
10
  SpaceEventTypes["DELETE_VOTE"] = "DELETE_VOTE";
13
11
  SpaceEventTypes["RESET_VOTES"] = "RESET_VOTES";
12
+ SpaceEventTypes["START_ROUND"] = "START_ROUND";
14
13
  })(exports.SpaceEventTypes || (exports.SpaceEventTypes = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cleanstrategytypes",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -31,22 +31,20 @@ export interface IUser {
31
31
  color: string;
32
32
  }
33
33
 
34
- export interface IPeriod {
34
+ export interface IRound {
35
35
  id: string;
36
36
  order: number;
37
37
  spaceId: string;
38
- startDate: string;
39
38
  endDate: string;
40
39
  }
41
40
 
42
41
  export enum SpaceEventTypes {
43
42
  CONNECT = "CONNECT",
44
43
  DISCONNECT = "DISCONNECT",
45
- START_PERIOD = "START_PERIOD",
46
- END_PERIOD = "END_PERIOD",
47
44
  VOTE = "VOTE",
48
45
  DELETE_VOTE = "DELETE_VOTE",
49
46
  RESET_VOTES = "RESET_VOTES",
47
+ START_ROUND = "START_ROUND",
50
48
  }
51
49
 
52
50
  // RequestMessage
@@ -62,29 +60,40 @@ export type VoteDeleteMessageBody = {
62
60
  };
63
61
 
64
62
  // ResponseMessage
63
+ type ResponseMessageBase = {
64
+ errorMessages?: { type: string; message: string }[];
65
+ };
65
66
 
66
- export type VoteMessageResponse = {
67
+ export type VoteMessageResponse = ResponseMessageBase & {
67
68
  vote: IVote;
68
69
  };
69
- export type VoteDeleteMessageResponse = {
70
+ export type VoteDeleteMessageResponse = ResponseMessageBase & {
70
71
  voteId: string;
71
72
  };
72
- export type ConnectMessageResponse = {
73
+
74
+ export type StartRoundResponseMessage = ResponseMessageBase & {
75
+ round: IRound;
76
+ };
77
+
78
+ export type ConnectMessageResponse = ResponseMessageBase & {
73
79
  votes: IVote[];
74
80
  tasks: ITask[];
75
81
  users: IUser[];
76
- currentPeriod: IPeriod;
82
+ currentPeriod: IRound;
77
83
  };
78
84
 
79
- export type ResetVotesMessageResponse = {
85
+ export type ResetVotesMessageResponse = ResponseMessageBase & {
80
86
  votes: IVote[];
81
87
  };
82
88
 
89
+ export type StartRoundMessageResponse = ResponseMessageBase & {
90
+ round?: IRound;
91
+ };
92
+
83
93
  export interface GameServerToClientEvents {
84
94
  [SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;
85
95
  [SpaceEventTypes.DISCONNECT]: (message: any) => void;
86
- [SpaceEventTypes.END_PERIOD]: (message: any) => void;
87
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
96
+ [SpaceEventTypes.START_ROUND]: (message: StartRoundMessageResponse) => void;
88
97
  [SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;
89
98
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;
90
99
  [SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;
@@ -92,10 +101,8 @@ export interface GameServerToClientEvents {
92
101
 
93
102
  export interface GameClientToServerEvents {
94
103
  [SpaceEventTypes.CONNECT]: (message: any) => void;
95
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
104
+ [SpaceEventTypes.START_ROUND]: (message: any) => void;
96
105
  [SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;
97
106
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
98
- [SpaceEventTypes.END_PERIOD]: (message: any) => void;
99
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
100
107
  [SpaceEventTypes.RESET_VOTES]: (message: any) => void;
101
108
  }