cleanstrategytypes 1.1.9 → 1.1.11

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.
@@ -6,6 +6,7 @@ var SpaceEventTypes;
6
6
  SpaceEventTypes["END_PERIOD"] = "END_PERIOD";
7
7
  SpaceEventTypes["VOTE"] = "VOTE";
8
8
  SpaceEventTypes["DELETE_VOTE"] = "DELETE_VOTE";
9
+ SpaceEventTypes["RESET_VOTES"] = "RESET_VOTES";
9
10
  })(SpaceEventTypes || (SpaceEventTypes = {}));
10
11
 
11
12
  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 interface ICurrentUser {\r\n id: string;\r\n displayName: string;\r\n email: string;\r\n tenants: string[];\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}\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 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}\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}\r\n"],"names":[],"mappings":"IAmCY,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,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;AAC7B,CAAC,EAPW,eAAe,KAAf,eAAe,GAO1B,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 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 +1 @@
1
- var MyLibrary=function(E){"use strict";var e;return E.SpaceEventTypes=void 0,(e=E.SpaceEventTypes||(E.SpaceEventTypes={})).CONNECT="CONNECT",e.DISCONNECT="DISCONNECT",e.START_PERIOD="START_PERIOD",e.END_PERIOD="END_PERIOD",e.VOTE="VOTE",e.DELETE_VOTE="DELETE_VOTE",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.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}({});
package/dist/index.d.ts CHANGED
@@ -10,11 +10,16 @@ export type ITask = {
10
10
  title: string;
11
11
  value: number;
12
12
  };
13
+ export type ISpace = {
14
+ id: string;
15
+ name: string;
16
+ roles: string[];
17
+ };
13
18
  export interface ICurrentUser {
14
19
  id: string;
15
20
  displayName: string;
16
21
  email: string;
17
- tenants: string[];
22
+ tenants: ISpace[];
18
23
  }
19
24
  export interface IUser {
20
25
  id: string;
@@ -34,7 +39,8 @@ export declare enum SpaceEventTypes {
34
39
  START_PERIOD = "START_PERIOD",
35
40
  END_PERIOD = "END_PERIOD",
36
41
  VOTE = "VOTE",
37
- DELETE_VOTE = "DELETE_VOTE"
42
+ DELETE_VOTE = "DELETE_VOTE",
43
+ RESET_VOTES = "RESET_VOTES"
38
44
  }
39
45
  export type VoteMessageBody = {
40
46
  type: "minus" | "plus";
@@ -44,18 +50,30 @@ export type VoteMessageBody = {
44
50
  export type VoteDeleteMessageBody = {
45
51
  voteId: string;
46
52
  };
47
- export type VoteMessageResponse = {
53
+ type ResponseMessageBase = {
54
+ errorMessages?: {
55
+ type: string;
56
+ message: string;
57
+ }[];
58
+ };
59
+ export type VoteMessageResponse = ResponseMessageBase & {
48
60
  vote: IVote;
49
61
  };
50
- export type VoteDeleteMessageResponse = {
62
+ export type VoteDeleteMessageResponse = ResponseMessageBase & {
51
63
  voteId: string;
52
64
  };
53
- export type ConnectMessageResponse = {
65
+ export type StartRoundResponseMessage = ResponseMessageBase & {
66
+ round: IPeriod;
67
+ };
68
+ export type ConnectMessageResponse = ResponseMessageBase & {
54
69
  votes: IVote[];
55
70
  tasks: ITask[];
56
71
  users: IUser[];
57
72
  currentPeriod: IPeriod;
58
73
  };
74
+ export type ResetVotesMessageResponse = ResponseMessageBase & {
75
+ votes: IVote[];
76
+ };
59
77
  export interface GameServerToClientEvents {
60
78
  [SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;
61
79
  [SpaceEventTypes.DISCONNECT]: (message: any) => void;
@@ -63,6 +81,7 @@ export interface GameServerToClientEvents {
63
81
  [SpaceEventTypes.START_PERIOD]: (message: any) => void;
64
82
  [SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;
65
83
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;
84
+ [SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;
66
85
  }
67
86
  export interface GameClientToServerEvents {
68
87
  [SpaceEventTypes.CONNECT]: (message: any) => void;
@@ -71,4 +90,6 @@ export interface GameClientToServerEvents {
71
90
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
72
91
  [SpaceEventTypes.END_PERIOD]: (message: any) => void;
73
92
  [SpaceEventTypes.START_PERIOD]: (message: any) => void;
93
+ [SpaceEventTypes.RESET_VOTES]: (message: any) => void;
74
94
  }
95
+ export {};
package/dist/index.js CHANGED
@@ -10,4 +10,5 @@ exports.SpaceEventTypes = void 0;
10
10
  SpaceEventTypes["END_PERIOD"] = "END_PERIOD";
11
11
  SpaceEventTypes["VOTE"] = "VOTE";
12
12
  SpaceEventTypes["DELETE_VOTE"] = "DELETE_VOTE";
13
+ SpaceEventTypes["RESET_VOTES"] = "RESET_VOTES";
13
14
  })(exports.SpaceEventTypes || (exports.SpaceEventTypes = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cleanstrategytypes",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -12,11 +12,17 @@ export type ITask = {
12
12
  value: number;
13
13
  };
14
14
 
15
+ export type ISpace = {
16
+ id: string;
17
+ name: string;
18
+ roles: string[];
19
+ };
20
+
15
21
  export interface ICurrentUser {
16
22
  id: string;
17
23
  displayName: string;
18
24
  email: string;
19
- tenants: string[];
25
+ tenants: ISpace[];
20
26
  }
21
27
 
22
28
  export interface IUser {
@@ -40,6 +46,7 @@ export enum SpaceEventTypes {
40
46
  END_PERIOD = "END_PERIOD",
41
47
  VOTE = "VOTE",
42
48
  DELETE_VOTE = "DELETE_VOTE",
49
+ RESET_VOTES = "RESET_VOTES",
43
50
  }
44
51
 
45
52
  // RequestMessage
@@ -55,20 +62,32 @@ export type VoteDeleteMessageBody = {
55
62
  };
56
63
 
57
64
  // ResponseMessage
65
+ type ResponseMessageBase = {
66
+ errorMessages?: { type: string; message: string }[];
67
+ };
58
68
 
59
- export type VoteMessageResponse = {
69
+ export type VoteMessageResponse = ResponseMessageBase & {
60
70
  vote: IVote;
61
71
  };
62
- export type VoteDeleteMessageResponse = {
72
+ export type VoteDeleteMessageResponse = ResponseMessageBase & {
63
73
  voteId: string;
64
74
  };
65
- export type ConnectMessageResponse = {
75
+
76
+ export type StartRoundResponseMessage = ResponseMessageBase & {
77
+ round: IPeriod;
78
+ };
79
+
80
+ export type ConnectMessageResponse = ResponseMessageBase & {
66
81
  votes: IVote[];
67
82
  tasks: ITask[];
68
83
  users: IUser[];
69
84
  currentPeriod: IPeriod;
70
85
  };
71
86
 
87
+ export type ResetVotesMessageResponse = ResponseMessageBase & {
88
+ votes: IVote[];
89
+ };
90
+
72
91
  export interface GameServerToClientEvents {
73
92
  [SpaceEventTypes.CONNECT]: (message: ConnectMessageResponse) => void;
74
93
  [SpaceEventTypes.DISCONNECT]: (message: any) => void;
@@ -76,6 +95,7 @@ export interface GameServerToClientEvents {
76
95
  [SpaceEventTypes.START_PERIOD]: (message: any) => void;
77
96
  [SpaceEventTypes.VOTE]: (message: VoteMessageResponse) => void;
78
97
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageResponse) => void;
98
+ [SpaceEventTypes.RESET_VOTES]: (message: ResetVotesMessageResponse) => void;
79
99
  }
80
100
 
81
101
  export interface GameClientToServerEvents {
@@ -85,4 +105,5 @@ export interface GameClientToServerEvents {
85
105
  [SpaceEventTypes.DELETE_VOTE]: (message: VoteDeleteMessageBody) => void;
86
106
  [SpaceEventTypes.END_PERIOD]: (message: any) => void;
87
107
  [SpaceEventTypes.START_PERIOD]: (message: any) => void;
108
+ [SpaceEventTypes.RESET_VOTES]: (message: any) => void;
88
109
  }