cleanstrategytypes 1.1.11 → 1.1.13

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\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: IPeriod;\r\n};\r\n\r\nexport type ConnectMessageResponse = ResponseMessageBase & {\r\n votes: IVote[];\r\n tasks: ITask[];\r\n users: IUser[];\r\n currentPeriod: IPeriod;\r\n};\r\n\r\nexport type ResetVotesMessageResponse = ResponseMessageBase & {\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 status?: \"finished\" | \"active\";\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":"IAyCY,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,20 @@ 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;
34
+ status?: "finished" | "active";
35
35
  }
36
36
  export declare enum SpaceEventTypes {
37
37
  CONNECT = "CONNECT",
38
38
  DISCONNECT = "DISCONNECT",
39
- START_PERIOD = "START_PERIOD",
40
- END_PERIOD = "END_PERIOD",
41
39
  VOTE = "VOTE",
42
40
  DELETE_VOTE = "DELETE_VOTE",
43
- RESET_VOTES = "RESET_VOTES"
41
+ RESET_VOTES = "RESET_VOTES",
42
+ START_ROUND = "START_ROUND"
44
43
  }
45
44
  export type VoteMessageBody = {
46
45
  type: "minus" | "plus";
@@ -63,33 +62,33 @@ export type VoteDeleteMessageResponse = ResponseMessageBase & {
63
62
  voteId: string;
64
63
  };
65
64
  export type StartRoundResponseMessage = ResponseMessageBase & {
66
- round: IPeriod;
65
+ round: IRound;
67
66
  };
68
67
  export type ConnectMessageResponse = ResponseMessageBase & {
69
68
  votes: IVote[];
70
69
  tasks: ITask[];
71
70
  users: IUser[];
72
- currentPeriod: IPeriod;
71
+ currentPeriod: IRound;
73
72
  };
74
73
  export type ResetVotesMessageResponse = ResponseMessageBase & {
75
74
  votes: IVote[];
76
75
  };
76
+ export type StartRoundMessageResponse = ResponseMessageBase & {
77
+ round?: IRound;
78
+ };
77
79
  export interface GameServerToClientEvents {
78
80
  [SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;
79
81
  [SpaceEventTypes.DISCONNECT]: (message: any) => void;
80
- [SpaceEventTypes.END_PERIOD]: (message: any) => void;
81
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
82
+ [SpaceEventTypes.START_ROUND]: (message: StartRoundMessageResponse) => void;
82
83
  [SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;
83
84
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;
84
85
  [SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;
85
86
  }
86
87
  export interface GameClientToServerEvents {
87
88
  [SpaceEventTypes.CONNECT]: (message: any) => void;
88
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
89
+ [SpaceEventTypes.START_ROUND]: (message: any) => void;
89
90
  [SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;
90
91
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
91
- [SpaceEventTypes.END_PERIOD]: (message: any) => void;
92
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
93
92
  [SpaceEventTypes.RESET_VOTES]: (message: any) => void;
94
93
  }
95
94
  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.11",
3
+ "version": "1.1.13",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -31,22 +31,21 @@ 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;
39
+ status?: "finished" | "active";
40
40
  }
41
41
 
42
42
  export enum SpaceEventTypes {
43
43
  CONNECT = "CONNECT",
44
44
  DISCONNECT = "DISCONNECT",
45
- START_PERIOD = "START_PERIOD",
46
- END_PERIOD = "END_PERIOD",
47
45
  VOTE = "VOTE",
48
46
  DELETE_VOTE = "DELETE_VOTE",
49
47
  RESET_VOTES = "RESET_VOTES",
48
+ START_ROUND = "START_ROUND",
50
49
  }
51
50
 
52
51
  // RequestMessage
@@ -74,25 +73,28 @@ export type VoteDeleteMessageResponse = ResponseMessageBase & {
74
73
  };
75
74
 
76
75
  export type StartRoundResponseMessage = ResponseMessageBase & {
77
- round: IPeriod;
76
+ round: IRound;
78
77
  };
79
78
 
80
79
  export type ConnectMessageResponse = ResponseMessageBase & {
81
80
  votes: IVote[];
82
81
  tasks: ITask[];
83
82
  users: IUser[];
84
- currentPeriod: IPeriod;
83
+ currentPeriod: IRound;
85
84
  };
86
85
 
87
86
  export type ResetVotesMessageResponse = ResponseMessageBase & {
88
87
  votes: IVote[];
89
88
  };
90
89
 
90
+ export type StartRoundMessageResponse = ResponseMessageBase & {
91
+ round?: IRound;
92
+ };
93
+
91
94
  export interface GameServerToClientEvents {
92
95
  [SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;
93
96
  [SpaceEventTypes.DISCONNECT]: (message: any) => void;
94
- [SpaceEventTypes.END_PERIOD]: (message: any) => void;
95
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
97
+ [SpaceEventTypes.START_ROUND]: (message: StartRoundMessageResponse) => void;
96
98
  [SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;
97
99
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;
98
100
  [SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;
@@ -100,10 +102,8 @@ export interface GameServerToClientEvents {
100
102
 
101
103
  export interface GameClientToServerEvents {
102
104
  [SpaceEventTypes.CONNECT]: (message: any) => void;
103
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
105
+ [SpaceEventTypes.START_ROUND]: (message: any) => void;
104
106
  [SpaceEventTypes.VOTE]: (message: VoteMessageBody) => void;
105
107
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
106
- [SpaceEventTypes.END_PERIOD]: (message: any) => void;
107
- [SpaceEventTypes.START_PERIOD]: (message: any) => void;
108
108
  [SpaceEventTypes.RESET_VOTES]: (message: any) => void;
109
109
  }