sea-platform-helpers 1.0.0 → 1.2.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.
Files changed (51) hide show
  1. package/dist/constants/account/index.d.ts.map +1 -1
  2. package/dist/constants/account/index.js +0 -4
  3. package/dist/constants/application/index.d.ts +1 -0
  4. package/dist/constants/application/index.d.ts.map +1 -1
  5. package/dist/constants/application/index.js +7 -0
  6. package/dist/constants/index.d.ts +4 -0
  7. package/dist/constants/index.d.ts.map +1 -1
  8. package/dist/constants/index.js +5 -1
  9. package/dist/constants/kpi/index.d.ts +14 -0
  10. package/dist/constants/kpi/index.d.ts.map +1 -0
  11. package/dist/constants/kpi/index.js +19 -0
  12. package/dist/constants/permission/index.d.ts +27 -1
  13. package/dist/constants/permission/index.d.ts.map +1 -1
  14. package/dist/constants/permission/index.js +197 -2
  15. package/dist/constants/project/index.d.ts +5 -0
  16. package/dist/constants/project/index.d.ts.map +1 -0
  17. package/dist/constants/project/index.js +8 -0
  18. package/dist/constants/strategy-socket/index.d.ts +23 -0
  19. package/dist/constants/strategy-socket/index.d.ts.map +1 -0
  20. package/dist/constants/strategy-socket/index.js +25 -0
  21. package/dist/constants/task/index.d.ts +6 -0
  22. package/dist/constants/task/index.d.ts.map +1 -0
  23. package/dist/constants/task/index.js +9 -0
  24. package/dist/dto/calendar/index.d.ts +12 -0
  25. package/dist/dto/calendar/index.d.ts.map +1 -0
  26. package/dist/dto/calendar/index.js +2 -0
  27. package/dist/dto/category/index.d.ts +1 -0
  28. package/dist/dto/category/index.d.ts.map +1 -0
  29. package/dist/dto/category/index.js +1 -0
  30. package/dist/dto/event/index.d.ts +53 -0
  31. package/dist/dto/event/index.d.ts.map +1 -0
  32. package/dist/dto/event/index.js +10 -0
  33. package/dist/dto/event-category/index.d.ts +7 -0
  34. package/dist/dto/event-category/index.d.ts.map +1 -0
  35. package/dist/dto/event-category/index.js +2 -0
  36. package/dist/dto/index.d.ts +3 -0
  37. package/dist/dto/index.d.ts.map +1 -1
  38. package/dist/dto/index.js +4 -1
  39. package/dist/utils/array/index.d.ts +1 -0
  40. package/dist/utils/array/index.d.ts.map +1 -1
  41. package/dist/utils/array/index.js +12 -1
  42. package/dist/utils/moment/index.d.ts +6 -0
  43. package/dist/utils/moment/index.d.ts.map +1 -1
  44. package/dist/utils/moment/index.js +49 -2
  45. package/dist/utils/numbers/index.d.ts +2 -2
  46. package/dist/utils/numbers/index.d.ts.map +1 -1
  47. package/dist/utils/numbers/index.js +8 -2
  48. package/dist/utils/string/index.d.ts +2 -0
  49. package/dist/utils/string/index.d.ts.map +1 -1
  50. package/dist/utils/string/index.js +6 -1
  51. package/package.json +36 -36
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/account/index.ts"],"names":[],"mappings":"AAKA,oBAAY,GAAG;CAAG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/account/index.ts"],"names":[],"mappings":"AAAA,oBAAY,GAAG;CAAG"}
@@ -1,8 +1,4 @@
1
1
  "use strict";
2
- // export enum AccountTypes {
3
- // User = "User",
4
- // Admin = "Admin",
5
- // }
6
2
  Object.defineProperty(exports, "__esModule", { value: true });
7
3
  exports.One = void 0;
8
4
  var One;
@@ -5,6 +5,7 @@ export declare enum ApplicationStatuses {
5
5
  }
6
6
  export declare enum ApplicationKeys {
7
7
  PlatformAdministrationApplication = "Platform-Administration-Application",
8
+ PublicCalendarApplication = "Public-Calendar-Application",
8
9
  StrategyApplication = "Strategy-Application"
9
10
  }
10
11
  export declare const Applications: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/application/index.ts"],"names":[],"mappings":"AAAA,oBAAY,mBAAmB;IAC7B,WAAW,gBAAgB;IAC3B,WAAW,iBAAiB;IAC5B,SAAS,cAAc;CACxB;AAED,oBAAY,eAAe;IACzB,iCAAiC,wCAAwC;IACzE,mBAAmB,yBAAyB;CAC7C;AAED,eAAO,MAAM,YAAY;;;;;GAexB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/application/index.ts"],"names":[],"mappings":"AAAA,oBAAY,mBAAmB;IAC7B,WAAW,gBAAgB;IAC3B,WAAW,iBAAiB;IAC5B,SAAS,cAAc;CACxB;AAED,oBAAY,eAAe;IACzB,iCAAiC,wCAAwC;IACzE,yBAAyB,gCAAgC;IACzD,mBAAmB,yBAAyB;CAC7C;AAED,eAAO,MAAM,YAAY;;;;;GAsBxB,CAAC"}
@@ -10,6 +10,7 @@ var ApplicationStatuses;
10
10
  var ApplicationKeys;
11
11
  (function (ApplicationKeys) {
12
12
  ApplicationKeys["PlatformAdministrationApplication"] = "Platform-Administration-Application";
13
+ ApplicationKeys["PublicCalendarApplication"] = "Public-Calendar-Application";
13
14
  ApplicationKeys["StrategyApplication"] = "Strategy-Application";
14
15
  })(ApplicationKeys || (exports.ApplicationKeys = ApplicationKeys = {}));
15
16
  exports.Applications = [
@@ -19,6 +20,12 @@ exports.Applications = [
19
20
  status: ApplicationStatuses.Available,
20
21
  description: "The main application for managing the platform, including user accounts, roles, and permissions.",
21
22
  },
23
+ {
24
+ name: "Public Calendar Application",
25
+ key: ApplicationKeys.PublicCalendarApplication,
26
+ status: ApplicationStatuses.Unavailable,
27
+ description: "An application for managing the public calendar within the platform.",
28
+ },
22
29
  {
23
30
  name: "Strategy Application",
24
31
  key: ApplicationKeys.StrategyApplication,
@@ -3,4 +3,8 @@ export * as Server from "./server";
3
3
  export * as Account from "./account";
4
4
  export * as Application from "./application";
5
5
  export * as OTP from "./otp";
6
+ export * as KPI from "./kpi";
7
+ export * as Project from "./project";
8
+ export * as Task from "./task";
9
+ export * as StrategySocket from "./strategy-socket";
6
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC"}
@@ -33,9 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.OTP = exports.Application = exports.Account = exports.Server = exports.Permission = void 0;
36
+ exports.StrategySocket = exports.Task = exports.Project = exports.KPI = exports.OTP = exports.Application = exports.Account = exports.Server = exports.Permission = void 0;
37
37
  exports.Permission = __importStar(require("./permission"));
38
38
  exports.Server = __importStar(require("./server"));
39
39
  exports.Account = __importStar(require("./account"));
40
40
  exports.Application = __importStar(require("./application"));
41
41
  exports.OTP = __importStar(require("./otp"));
42
+ exports.KPI = __importStar(require("./kpi"));
43
+ exports.Project = __importStar(require("./project"));
44
+ exports.Task = __importStar(require("./task"));
45
+ exports.StrategySocket = __importStar(require("./strategy-socket"));
@@ -0,0 +1,14 @@
1
+ export declare enum KPITrackingMethods {
2
+ Manual = "Manual",
3
+ Project = "Project",
4
+ Task = "Task"
5
+ }
6
+ export declare enum KPIReportingFrequencies {
7
+ Yearly = "Yearly",
8
+ Quarterly = "Quarterly"
9
+ }
10
+ export declare enum KPIReportingTypes {
11
+ Boolean = "Boolean",
12
+ Number = "Number"
13
+ }
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/kpi/index.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB;IAC5B,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,oBAAY,uBAAuB;IACjC,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KPIReportingTypes = exports.KPIReportingFrequencies = exports.KPITrackingMethods = void 0;
4
+ var KPITrackingMethods;
5
+ (function (KPITrackingMethods) {
6
+ KPITrackingMethods["Manual"] = "Manual";
7
+ KPITrackingMethods["Project"] = "Project";
8
+ KPITrackingMethods["Task"] = "Task";
9
+ })(KPITrackingMethods || (exports.KPITrackingMethods = KPITrackingMethods = {}));
10
+ var KPIReportingFrequencies;
11
+ (function (KPIReportingFrequencies) {
12
+ KPIReportingFrequencies["Yearly"] = "Yearly";
13
+ KPIReportingFrequencies["Quarterly"] = "Quarterly";
14
+ })(KPIReportingFrequencies || (exports.KPIReportingFrequencies = KPIReportingFrequencies = {}));
15
+ var KPIReportingTypes;
16
+ (function (KPIReportingTypes) {
17
+ KPIReportingTypes["Boolean"] = "Boolean";
18
+ KPIReportingTypes["Number"] = "Number";
19
+ })(KPIReportingTypes || (exports.KPIReportingTypes = KPIReportingTypes = {}));
@@ -39,7 +39,33 @@ export declare enum PermissionKeys {
39
39
  ManageInitiativesCreate = "manage-initiatives-create",
40
40
  ManageInitiativesRead = "manage-initiatives-read",
41
41
  ManageInitiativesUpdateDetails = "manage-initiatives-update-details",
42
- ManageInitiativesDelete = "manage-initiatives-delete"
42
+ ManageInitiativesDelete = "manage-initiatives-delete",
43
+ ManageKPIs = "manage-kpis",
44
+ ManageKPIsCreate = "manage-kpis-create",
45
+ ManageKPIsRead = "manage-kpis-read",
46
+ ManageKPIsUpdateDetails = "manage-kpis-update-details",
47
+ ManageKPIsDelete = "manage-kpis-delete",
48
+ ManageKPIsAddUpdateEvidence = "manage-kpis-add-update-evidence",
49
+ ManageKPIsAddUpdateProgress = "manage-kpis-add-update-progress",
50
+ ManageProjects = "manage-projects",
51
+ ManageProjectsCreate = "manage-projects-create",
52
+ ManageProjectsRead = "manage-projects-read",
53
+ ManageProjectsUpdateDetails = "manage-projects-update-details",
54
+ ManageProjectsDelete = "manage-projects-delete",
55
+ ManageProjectMembers = "manage-project-members",
56
+ ManageProjectMilestones = "manage-project-milestones",
57
+ ManageProjectSections = "manage-project-sections",
58
+ PublicCalendarApp = "public-calendar-app",
59
+ PublicCalendarManagement = "public-calendar-management",
60
+ ManageCalendar = "manage-calendar",
61
+ ManageCalendarCreate = "manage-calendar-create",
62
+ ManageCalendarRead = "manage-calendar-read",
63
+ ManageCalendarUpdateDetails = "manage-calendar-update-details",
64
+ ManageCalendarDelete = "manage-calendar-delete",
65
+ ManageEvent = "manage-event",
66
+ ManageEventRead = "manage-event-read",
67
+ ManageEventUpdateDetails = "manage-event-update-details",
68
+ ViewPublicCalendar = "view-public-calendar"
43
69
  }
44
70
  export declare const PERMISSIONS: IPermission[];
45
71
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/permission/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAExD,oBAAY,cAAc;IAExB,sBAAsB,4BAA4B;IAClD,cAAc,oBAAoB;IAClC,kBAAkB,yBAAyB;IAC3C,oBAAoB,2BAA2B;IAC/C,4BAA4B,oCAAoC;IAChE,2BAA2B,mCAAmC;IAC9D,oBAAoB,2BAA2B;IAC/C,wBAAwB,gCAAgC;IACxD,yBAAyB,iCAAiC;IAC1D,qBAAqB,4BAA4B;IACjD,WAAW,iBAAiB;IAC5B,eAAe,sBAAsB;IACrC,iBAAiB,wBAAwB;IACzC,wBAAwB,gCAAgC;IACxD,iBAAiB,wBAAwB;IACzC,iBAAiB,wBAAwB;IACzC,qBAAqB,6BAA6B;IAClD,8BAA8B,uCAAuC;IACrE,kBAAkB,wBAAwB;IAC1C,wBAAwB,+BAA+B;IACvD,sBAAsB,6BAA6B;IACnD,+BAA+B,uCAAuC;IACtE,wBAAwB,+BAA+B;IACvD,gBAAgB,sBAAsB;IACtC,sBAAsB,6BAA6B;IACnD,oBAAoB,2BAA2B;IAC/C,6BAA6B,qCAAqC;IAClE,sBAAsB,6BAA6B;IAGnD,WAAW,iBAAiB;IAC5B,WAAW,iBAAiB;IAC5B,iBAAiB,wBAAwB;IACzC,eAAe,sBAAsB;IACrC,wBAAwB,gCAAgC;IACxD,iBAAiB,wBAAwB;IACzC,iBAAiB,uBAAuB;IACxC,uBAAuB,8BAA8B;IACrD,qBAAqB,4BAA4B;IACjD,8BAA8B,sCAAsC;IACpE,uBAAuB,8BAA8B;CACtD;AAED,eAAO,MAAM,WAAW,EAAE,WAAW,EAoQpC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/permission/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAExD,oBAAY,cAAc;IAExB,sBAAsB,4BAA4B;IAClD,cAAc,oBAAoB;IAClC,kBAAkB,yBAAyB;IAC3C,oBAAoB,2BAA2B;IAC/C,4BAA4B,oCAAoC;IAChE,2BAA2B,mCAAmC;IAC9D,oBAAoB,2BAA2B;IAC/C,wBAAwB,gCAAgC;IACxD,yBAAyB,iCAAiC;IAC1D,qBAAqB,4BAA4B;IACjD,WAAW,iBAAiB;IAC5B,eAAe,sBAAsB;IACrC,iBAAiB,wBAAwB;IACzC,wBAAwB,gCAAgC;IACxD,iBAAiB,wBAAwB;IACzC,iBAAiB,wBAAwB;IACzC,qBAAqB,6BAA6B;IAClD,8BAA8B,uCAAuC;IACrE,kBAAkB,wBAAwB;IAC1C,wBAAwB,+BAA+B;IACvD,sBAAsB,6BAA6B;IACnD,+BAA+B,uCAAuC;IACtE,wBAAwB,+BAA+B;IACvD,gBAAgB,sBAAsB;IACtC,sBAAsB,6BAA6B;IACnD,oBAAoB,2BAA2B;IAC/C,6BAA6B,qCAAqC;IAClE,sBAAsB,6BAA6B;IAGnD,WAAW,iBAAiB;IAC5B,WAAW,iBAAiB;IAC5B,iBAAiB,wBAAwB;IACzC,eAAe,sBAAsB;IACrC,wBAAwB,gCAAgC;IACxD,iBAAiB,wBAAwB;IACzC,iBAAiB,uBAAuB;IACxC,uBAAuB,8BAA8B;IACrD,qBAAqB,4BAA4B;IACjD,8BAA8B,sCAAsC;IACpE,uBAAuB,8BAA8B;IACrD,UAAU,gBAAgB;IAC1B,gBAAgB,uBAAuB;IACvC,cAAc,qBAAqB;IACnC,uBAAuB,+BAA+B;IACtD,gBAAgB,uBAAuB;IACvC,2BAA2B,oCAAoC;IAC/D,2BAA2B,oCAAoC;IAC/D,cAAc,oBAAoB;IAClC,oBAAoB,2BAA2B;IAC/C,kBAAkB,yBAAyB;IAC3C,2BAA2B,mCAAmC;IAC9D,oBAAoB,2BAA2B;IAC/C,oBAAoB,2BAA2B;IAC/C,uBAAuB,8BAA8B;IACrD,qBAAqB,4BAA4B;IAGjD,iBAAiB,wBAAwB;IACzC,wBAAwB,+BAA+B;IACvD,cAAc,oBAAoB;IAClC,oBAAoB,2BAA2B;IAC/C,kBAAkB,yBAAyB;IAC3C,2BAA2B,mCAAmC;IAC9D,oBAAoB,2BAA2B;IAC/C,WAAW,iBAAiB;IAC5B,eAAe,sBAAsB;IACrC,wBAAwB,gCAAgC;IACxD,kBAAkB,yBAAyB;CAC5C;AAED,eAAO,MAAM,WAAW,EAAE,WAAW,EA+apC,CAAC"}
@@ -4,7 +4,7 @@ exports.PERMISSIONS = exports.PermissionKeys = void 0;
4
4
  const application_1 = require("../application");
5
5
  var PermissionKeys;
6
6
  (function (PermissionKeys) {
7
- // Admin
7
+ // Administration Application
8
8
  PermissionKeys["PlatformAdministration"] = "platform-administration";
9
9
  PermissionKeys["ManageAccounts"] = "manage-accounts";
10
10
  PermissionKeys["ManageAccountsRead"] = "manage-accounts-read";
@@ -33,7 +33,7 @@ var PermissionKeys;
33
33
  PermissionKeys["ManageDepartmentRead"] = "manage-department-read";
34
34
  PermissionKeys["ManageDepartmentUpdateDetails"] = "manage-department-update-details";
35
35
  PermissionKeys["ManageDepartmentDelete"] = "manage-department-delete";
36
- // User
36
+ // Strategy Application
37
37
  PermissionKeys["StrategyApp"] = "strategy-app";
38
38
  PermissionKeys["ManageGoals"] = "manage-goals";
39
39
  PermissionKeys["ManageGoalsCreate"] = "manage-goals-create";
@@ -45,6 +45,33 @@ var PermissionKeys;
45
45
  PermissionKeys["ManageInitiativesRead"] = "manage-initiatives-read";
46
46
  PermissionKeys["ManageInitiativesUpdateDetails"] = "manage-initiatives-update-details";
47
47
  PermissionKeys["ManageInitiativesDelete"] = "manage-initiatives-delete";
48
+ PermissionKeys["ManageKPIs"] = "manage-kpis";
49
+ PermissionKeys["ManageKPIsCreate"] = "manage-kpis-create";
50
+ PermissionKeys["ManageKPIsRead"] = "manage-kpis-read";
51
+ PermissionKeys["ManageKPIsUpdateDetails"] = "manage-kpis-update-details";
52
+ PermissionKeys["ManageKPIsDelete"] = "manage-kpis-delete";
53
+ PermissionKeys["ManageKPIsAddUpdateEvidence"] = "manage-kpis-add-update-evidence";
54
+ PermissionKeys["ManageKPIsAddUpdateProgress"] = "manage-kpis-add-update-progress";
55
+ PermissionKeys["ManageProjects"] = "manage-projects";
56
+ PermissionKeys["ManageProjectsCreate"] = "manage-projects-create";
57
+ PermissionKeys["ManageProjectsRead"] = "manage-projects-read";
58
+ PermissionKeys["ManageProjectsUpdateDetails"] = "manage-projects-update-details";
59
+ PermissionKeys["ManageProjectsDelete"] = "manage-projects-delete";
60
+ PermissionKeys["ManageProjectMembers"] = "manage-project-members";
61
+ PermissionKeys["ManageProjectMilestones"] = "manage-project-milestones";
62
+ PermissionKeys["ManageProjectSections"] = "manage-project-sections";
63
+ // Public Calendar
64
+ PermissionKeys["PublicCalendarApp"] = "public-calendar-app";
65
+ PermissionKeys["PublicCalendarManagement"] = "public-calendar-management";
66
+ PermissionKeys["ManageCalendar"] = "manage-calendar";
67
+ PermissionKeys["ManageCalendarCreate"] = "manage-calendar-create";
68
+ PermissionKeys["ManageCalendarRead"] = "manage-calendar-read";
69
+ PermissionKeys["ManageCalendarUpdateDetails"] = "manage-calendar-update-details";
70
+ PermissionKeys["ManageCalendarDelete"] = "manage-calendar-delete";
71
+ PermissionKeys["ManageEvent"] = "manage-event";
72
+ PermissionKeys["ManageEventRead"] = "manage-event-read";
73
+ PermissionKeys["ManageEventUpdateDetails"] = "manage-event-update-details";
74
+ PermissionKeys["ViewPublicCalendar"] = "view-public-calendar";
48
75
  })(PermissionKeys || (exports.PermissionKeys = PermissionKeys = {}));
49
76
  exports.PERMISSIONS = [
50
77
  // Administration Application
@@ -301,6 +328,174 @@ exports.PERMISSIONS = [
301
328
  },
302
329
  ],
303
330
  },
331
+ {
332
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
333
+ key: PermissionKeys.ManageKPIs,
334
+ name: "Manage KPIs",
335
+ isLeaf: false,
336
+ children: [
337
+ {
338
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
339
+ key: PermissionKeys.ManageKPIsCreate,
340
+ name: "Create KPI",
341
+ isLeaf: true,
342
+ },
343
+ {
344
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
345
+ key: PermissionKeys.ManageKPIsRead,
346
+ name: "Read KPIs",
347
+ isLeaf: true,
348
+ },
349
+ {
350
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
351
+ key: PermissionKeys.ManageKPIsUpdateDetails,
352
+ name: "Update KPI Details",
353
+ isLeaf: true,
354
+ },
355
+ {
356
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
357
+ key: PermissionKeys.ManageKPIsDelete,
358
+ name: "Delete KPI",
359
+ isLeaf: true,
360
+ },
361
+ {
362
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
363
+ key: PermissionKeys.ManageKPIsAddUpdateEvidence,
364
+ name: "Add/Update KPI Evidence",
365
+ isLeaf: true,
366
+ },
367
+ {
368
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
369
+ key: PermissionKeys.ManageKPIsAddUpdateProgress,
370
+ name: "Add/Update KPI Progress",
371
+ isLeaf: true,
372
+ },
373
+ ],
374
+ },
375
+ {
376
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
377
+ key: PermissionKeys.ManageProjects,
378
+ name: "Manage Projects",
379
+ isLeaf: false,
380
+ children: [
381
+ {
382
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
383
+ key: PermissionKeys.ManageProjectsCreate,
384
+ name: "Create Project",
385
+ isLeaf: true,
386
+ },
387
+ {
388
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
389
+ key: PermissionKeys.ManageProjectsRead,
390
+ name: "Read Projects",
391
+ isLeaf: true,
392
+ },
393
+ {
394
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
395
+ key: PermissionKeys.ManageProjectsUpdateDetails,
396
+ name: "Update Project Details",
397
+ isLeaf: true,
398
+ },
399
+ {
400
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
401
+ key: PermissionKeys.ManageProjectsDelete,
402
+ name: "Delete Project",
403
+ isLeaf: true,
404
+ },
405
+ {
406
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
407
+ key: PermissionKeys.ManageProjectMembers,
408
+ name: "Manage Project Members",
409
+ isLeaf: true,
410
+ },
411
+ {
412
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
413
+ key: PermissionKeys.ManageProjectMilestones,
414
+ name: "Manage Project Milestones",
415
+ isLeaf: true,
416
+ },
417
+ {
418
+ applicationKey: application_1.ApplicationKeys.StrategyApplication,
419
+ key: PermissionKeys.ManageProjectSections,
420
+ name: "Manage Project Sections",
421
+ isLeaf: true,
422
+ },
423
+ ],
424
+ },
425
+ ],
426
+ },
427
+ {
428
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
429
+ key: PermissionKeys.PublicCalendarApp,
430
+ name: "Public Calendar",
431
+ isLeaf: false,
432
+ children: [
433
+ {
434
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
435
+ key: PermissionKeys.PublicCalendarManagement,
436
+ name: "Management",
437
+ isLeaf: false,
438
+ children: [
439
+ {
440
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
441
+ isLeaf: false,
442
+ key: PermissionKeys.ManageCalendar,
443
+ name: "Manage Calendar",
444
+ children: [
445
+ {
446
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
447
+ isLeaf: true,
448
+ key: PermissionKeys.ManageCalendarCreate,
449
+ name: "Create Calendar",
450
+ },
451
+ {
452
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
453
+ isLeaf: true,
454
+ key: PermissionKeys.ManageCalendarRead,
455
+ name: "Read Calendars",
456
+ },
457
+ {
458
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
459
+ isLeaf: true,
460
+ key: PermissionKeys.ManageCalendarUpdateDetails,
461
+ name: "Update Calendar",
462
+ },
463
+ {
464
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
465
+ isLeaf: true,
466
+ key: PermissionKeys.ManageCalendarDelete,
467
+ name: "Delete Calendar",
468
+ },
469
+ ],
470
+ },
471
+ {
472
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
473
+ isLeaf: false,
474
+ key: PermissionKeys.ManageEvent,
475
+ name: "Manage Event",
476
+ children: [
477
+ {
478
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
479
+ isLeaf: true,
480
+ key: PermissionKeys.ManageEventRead,
481
+ name: "Read Events",
482
+ },
483
+ {
484
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
485
+ isLeaf: true,
486
+ key: PermissionKeys.ManageEventUpdateDetails,
487
+ name: "Update Event",
488
+ },
489
+ ],
490
+ },
491
+ ],
492
+ },
493
+ {
494
+ applicationKey: application_1.ApplicationKeys.PublicCalendarApplication,
495
+ key: PermissionKeys.ViewPublicCalendar,
496
+ name: "View Public Calendar",
497
+ isLeaf: true,
498
+ },
304
499
  ],
305
500
  },
306
501
  ];
@@ -0,0 +1,5 @@
1
+ export declare enum ProjectMemberTypes {
2
+ Stakeholder = "Stakeholder",
3
+ Member = "Member"
4
+ }
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/project/index.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB;IAC5B,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectMemberTypes = void 0;
4
+ var ProjectMemberTypes;
5
+ (function (ProjectMemberTypes) {
6
+ ProjectMemberTypes["Stakeholder"] = "Stakeholder";
7
+ ProjectMemberTypes["Member"] = "Member";
8
+ })(ProjectMemberTypes || (exports.ProjectMemberTypes = ProjectMemberTypes = {}));
@@ -0,0 +1,23 @@
1
+ export declare const Events: {
2
+ Send: {
3
+ UserConnected: string;
4
+ UserDisconnected: string;
5
+ ProjectCreated: string;
6
+ ProjectUpdated: string;
7
+ ProjectDeleted: string;
8
+ MilestoneCreated: string;
9
+ MilestoneUpdated: string;
10
+ MilestoneDeleted: string;
11
+ SectionCreated: string;
12
+ SectionUpdated: string;
13
+ SectionDeleted: string;
14
+ TaskCreated: string;
15
+ TaskUpdated: string;
16
+ TaskDeleted: string;
17
+ ProjectMemberAdded: string;
18
+ ProjectMemberUpdated: string;
19
+ ProjectMemberRemoved: string;
20
+ };
21
+ Receive: {};
22
+ };
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/strategy-socket/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;CAqBlB,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Events = void 0;
4
+ exports.Events = {
5
+ Send: {
6
+ UserConnected: "user-connected",
7
+ UserDisconnected: "user-disconnected",
8
+ ProjectCreated: "project-created",
9
+ ProjectUpdated: "project-updated",
10
+ ProjectDeleted: "project-deleted",
11
+ MilestoneCreated: "milestone-created",
12
+ MilestoneUpdated: "milestone-updated",
13
+ MilestoneDeleted: "milestone-deleted",
14
+ SectionCreated: "section-created",
15
+ SectionUpdated: "section-updated",
16
+ SectionDeleted: "section-deleted",
17
+ TaskCreated: "task-created",
18
+ TaskUpdated: "task-updated",
19
+ TaskDeleted: "task-deleted",
20
+ ProjectMemberAdded: "project-member-added",
21
+ ProjectMemberUpdated: "project-member-updated",
22
+ ProjectMemberRemoved: "project-member-removed",
23
+ },
24
+ Receive: {},
25
+ };
@@ -0,0 +1,6 @@
1
+ export declare enum TaskPriorities {
2
+ Low = "Low",
3
+ Medium = "Medium",
4
+ High = "High"
5
+ }
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/task/index.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;CACd"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaskPriorities = void 0;
4
+ var TaskPriorities;
5
+ (function (TaskPriorities) {
6
+ TaskPriorities["Low"] = "Low";
7
+ TaskPriorities["Medium"] = "Medium";
8
+ TaskPriorities["High"] = "High";
9
+ })(TaskPriorities || (exports.TaskPriorities = TaskPriorities = {}));
@@ -0,0 +1,12 @@
1
+ import { IArrayDataResponse } from "../global";
2
+ export interface ICalendar {
3
+ id: string;
4
+ name: string;
5
+ calendarEmail: string;
6
+ color: string;
7
+ enabled: boolean;
8
+ }
9
+ export interface ICalendarArrayDataResponse extends IArrayDataResponse<ICalendar> {
10
+ data: ICalendar[];
11
+ }
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dto/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,0BACf,SAAQ,kBAAkB,CAAC,SAAS,CAAC;IACrC,IAAI,EAAE,SAAS,EAAE,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dto/category/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,53 @@
1
+ import { IEventCategory } from "../event-category";
2
+ import { IFile } from "../file";
3
+ import { IArrayDataResponse } from "../global";
4
+ export declare enum ShownStatuses {
5
+ All = "All",
6
+ Pending = "Pending",
7
+ Shown = "Shown",
8
+ Hidden = "Hidden"
9
+ }
10
+ export interface IEventBody {
11
+ contentType: string;
12
+ content: string;
13
+ bodyPreview: string;
14
+ }
15
+ export interface IEventLocation {
16
+ displayName: string;
17
+ locationType: string;
18
+ }
19
+ export interface IEventAttendee {
20
+ name: string;
21
+ email: string;
22
+ responseStatus: string;
23
+ responseAt: string;
24
+ }
25
+ export interface IEventOrganizer {
26
+ name: string;
27
+ email: string;
28
+ }
29
+ export interface IEvent {
30
+ azureEventId: string;
31
+ subject: string;
32
+ body?: IEventBody;
33
+ location: IEventLocation;
34
+ start: string;
35
+ end: string;
36
+ webLink: string;
37
+ joinLink: string;
38
+ importance: string;
39
+ isCancelled: boolean;
40
+ isOnlineMeeting: boolean;
41
+ isAllDay: boolean;
42
+ attendees: IEventAttendee[];
43
+ organizer: IEventOrganizer;
44
+ category?: IEventCategory;
45
+ isShown?: boolean;
46
+ color: string;
47
+ description?: string;
48
+ attachmentFiles: IFile[];
49
+ }
50
+ export interface IEventArrayDataResponse extends IArrayDataResponse<IEvent> {
51
+ data: IEvent[];
52
+ }
53
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dto/event/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,MAAM;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,SAAS,EAAE,eAAe,CAAC;IAC3B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,KAAK,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB,CAAC,MAAM,CAAC;IACzE,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShownStatuses = void 0;
4
+ var ShownStatuses;
5
+ (function (ShownStatuses) {
6
+ ShownStatuses["All"] = "All";
7
+ ShownStatuses["Pending"] = "Pending";
8
+ ShownStatuses["Shown"] = "Shown";
9
+ ShownStatuses["Hidden"] = "Hidden";
10
+ })(ShownStatuses || (exports.ShownStatuses = ShownStatuses = {}));
@@ -0,0 +1,7 @@
1
+ export interface IEventCategory {
2
+ id: string;
3
+ title: string;
4
+ icon: string;
5
+ color: string;
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dto/event-category/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,4 +6,7 @@ export * as Request from "./request";
6
6
  export * as Role from "./role";
7
7
  export * as Organization from "./organization";
8
8
  export * as Department from "./department";
9
+ export * as Calendar from "./calendar";
10
+ export * as EventCategory from "./event-category";
11
+ export * as Event from "./event";
9
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
package/dist/dto/index.js CHANGED
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Department = exports.Organization = exports.Role = exports.Request = exports.Permission = exports.File = exports.Application = exports.Account = void 0;
36
+ exports.Event = exports.EventCategory = exports.Calendar = exports.Department = exports.Organization = exports.Role = exports.Request = exports.Permission = exports.File = exports.Application = exports.Account = void 0;
37
37
  exports.Account = __importStar(require("./account"));
38
38
  exports.Application = __importStar(require("./application"));
39
39
  exports.File = __importStar(require("./file"));
@@ -42,3 +42,6 @@ exports.Request = __importStar(require("./request"));
42
42
  exports.Role = __importStar(require("./role"));
43
43
  exports.Organization = __importStar(require("./organization"));
44
44
  exports.Department = __importStar(require("./department"));
45
+ exports.Calendar = __importStar(require("./calendar"));
46
+ exports.EventCategory = __importStar(require("./event-category"));
47
+ exports.Event = __importStar(require("./event"));
@@ -1,4 +1,5 @@
1
1
  export declare const removeDuplicates: <T>(array: T[]) => T[];
2
2
  export declare const pushIfNotFound: <T>(array: T[], item: T, comparer?: (a: T, b: T) => boolean) => void;
3
3
  export declare const concatWithoutDuplicates: <T>(array1: T[], array2: T[], comparer: (a: T, b: T) => boolean) => T[];
4
+ export declare const groupBy: <T, K extends string | number | symbol>(array: T[], keyGetter: (item: T) => K) => Record<K, T[]>;
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/array/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,CAAC,EAAE,KAAG,CAAC,EAEjD,CAAC;AAGF,eAAO,MAAM,cAAc,GAAI,CAAC,SACvB,CAAC,EAAE,QACJ,CAAC,aACI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,KACjC,IAQF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,CAAC,UAC/B,CAAC,EAAE,UACH,CAAC,EAAE,YACD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,KAChC,CAAC,EAUH,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/array/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,CAAC,EAAE,KAAG,CAAC,EAEjD,CAAC;AAGF,eAAO,MAAM,cAAc,GAAI,CAAC,SACvB,CAAC,EAAE,QACJ,CAAC,aACI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,KACjC,IAQF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,CAAC,UAC/B,CAAC,EAAE,UACH,CAAC,EAAE,YACD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,KAChC,CAAC,EAUH,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,SACpD,CAAC,EAAE,aACC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KACxB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CASf,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.concatWithoutDuplicates = exports.pushIfNotFound = exports.removeDuplicates = void 0;
3
+ exports.groupBy = exports.concatWithoutDuplicates = exports.pushIfNotFound = exports.removeDuplicates = void 0;
4
4
  // Remove duplicate items from an array
5
5
  const removeDuplicates = (array) => {
6
6
  return Array.from(new Set(array));
@@ -26,3 +26,14 @@ const concatWithoutDuplicates = (array1, array2, comparer) => {
26
26
  return result;
27
27
  };
28
28
  exports.concatWithoutDuplicates = concatWithoutDuplicates;
29
+ const groupBy = (array, keyGetter) => {
30
+ return array.reduce((result, item) => {
31
+ const key = keyGetter(item);
32
+ if (!result[key]) {
33
+ result[key] = [];
34
+ }
35
+ result[key].push(item);
36
+ return result;
37
+ }, {});
38
+ };
39
+ exports.groupBy = groupBy;
@@ -1,9 +1,15 @@
1
1
  import moment from "moment";
2
+ import * as momentTZ from "moment-timezone";
3
+ export { momentTZ };
2
4
  export declare const formatDate: (data: Date | string, format?: string) => string;
3
5
  export declare const formatDateAsLabel: (date: string | Date) => string;
4
6
  export declare const getCurrentYear: () => string;
5
7
  export declare const getDaysCountBetweenTwoDays: (date1: string, date2: string) => number;
6
8
  export declare const getDaysCountTillNow: (pastDate: string) => number;
7
9
  export declare const getAge: (birthdate: string) => number;
10
+ export declare const getStartOfDay: (date?: Date | string) => Date;
11
+ export declare const getEndOfDay: (date?: Date | string) => Date;
12
+ export declare const getNextPeriod: (date: string | Date, period: "day" | "week" | "month") => Date;
13
+ export declare const getPreviousPeriod: (date: string | Date, period: "day" | "week" | "month") => Date;
8
14
  export default moment;
9
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/moment/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,UAAU,SAAU,IAAI,GAAG,MAAM,4BAE7C,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAU,MAAM,GAAG,IAAI,WAgBpD,CAAC;AAEF,eAAO,MAAM,cAAc,cAA2C,CAAC;AAEvE,eAAO,MAAM,0BAA0B,UAAW,MAAM,SAAS,MAAM,WAC5B,CAAC;AAE5C,eAAO,MAAM,mBAAmB,aAAc,MAAM,WACqB,CAAC;AAE1E,eAAO,MAAM,MAAM,cAAe,MAAM,WACG,CAAC;AAE5C,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/moment/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,eAAO,MAAM,UAAU,SAAU,IAAI,GAAG,MAAM,4BAE7C,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAU,MAAM,GAAG,IAAI,WAgBpD,CAAC;AAEF,eAAO,MAAM,cAAc,cAA2C,CAAC;AAEvE,eAAO,MAAM,0BAA0B,UAAW,MAAM,SAAS,MAAM,WAC5B,CAAC;AAE5C,eAAO,MAAM,mBAAmB,aAAc,MAAM,WACqB,CAAC;AAE1E,eAAO,MAAM,MAAM,cAAe,MAAM,WACG,CAAC;AAE5C,eAAO,MAAM,aAAa,UAAW,IAAI,GAAG,MAAM,KAAG,IAEpD,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,IAAI,GAAG,MAAM,KAAG,IAElD,CAAC;AAEF,eAAO,MAAM,aAAa,SAClB,MAAM,GAAG,IAAI,UACX,KAAK,GAAG,MAAM,GAAG,OAAO,SACO,CAAC;AAE1C,eAAO,MAAM,iBAAiB,SACtB,MAAM,GAAG,IAAI,UACX,KAAK,GAAG,MAAM,GAAG,OAAO,SACY,CAAC;AAE/C,eAAe,MAAM,CAAC"}
@@ -1,12 +1,47 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getAge = exports.getDaysCountTillNow = exports.getDaysCountBetweenTwoDays = exports.getCurrentYear = exports.formatDateAsLabel = exports.formatDate = void 0;
39
+ exports.getPreviousPeriod = exports.getNextPeriod = exports.getEndOfDay = exports.getStartOfDay = exports.getAge = exports.getDaysCountTillNow = exports.getDaysCountBetweenTwoDays = exports.getCurrentYear = exports.formatDateAsLabel = exports.formatDate = exports.momentTZ = void 0;
7
40
  const moment_1 = __importDefault(require("moment"));
41
+ const momentTZ = __importStar(require("moment-timezone"));
42
+ exports.momentTZ = momentTZ;
8
43
  const formatDate = (data, format = "YYYY-MM-DD") => {
9
- return moment_1.default.utc(data).format(format).toString();
44
+ return (0, moment_1.default)(data).format(format).toString();
10
45
  };
11
46
  exports.formatDate = formatDate;
12
47
  const formatDateAsLabel = (date) => {
@@ -36,4 +71,16 @@ const getDaysCountTillNow = (pastDate) => (0, exports.getDaysCountBetweenTwoDays
36
71
  exports.getDaysCountTillNow = getDaysCountTillNow;
37
72
  const getAge = (birthdate) => (0, moment_1.default)().diff((0, moment_1.default)(birthdate), "years");
38
73
  exports.getAge = getAge;
74
+ const getStartOfDay = (date) => {
75
+ return (0, moment_1.default)(date).startOf("day").toDate();
76
+ };
77
+ exports.getStartOfDay = getStartOfDay;
78
+ const getEndOfDay = (date) => {
79
+ return (0, moment_1.default)(date).endOf("day").toDate();
80
+ };
81
+ exports.getEndOfDay = getEndOfDay;
82
+ const getNextPeriod = (date, period) => (0, moment_1.default)(date).add(1, period).toDate();
83
+ exports.getNextPeriod = getNextPeriod;
84
+ const getPreviousPeriod = (date, period) => (0, moment_1.default)(date).subtract(1, period).toDate();
85
+ exports.getPreviousPeriod = getPreviousPeriod;
39
86
  exports.default = moment_1.default;
@@ -1,3 +1,3 @@
1
- declare const utils: typeof import("numeral");
2
- export default utils;
1
+ export declare const numeralUtils: typeof import("numeral");
2
+ export declare const getRandomInt: (min: number, max: number) => number;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/numbers/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,KAAK,0BAAkB,CAAC;AAE9B,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/numbers/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,0BAAkB,CAAC;AAE5C,eAAO,MAAM,YAAY,QAAS,MAAM,OAAO,MAAM,KAAG,MAIvD,CAAC"}
@@ -33,6 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getRandomInt = exports.numeralUtils = void 0;
36
37
  const numeral = __importStar(require("numeral"));
37
- const utils = numeral.default;
38
- exports.default = utils;
38
+ exports.numeralUtils = numeral.default;
39
+ const getRandomInt = (min, max) => {
40
+ const lower = Math.ceil(min);
41
+ const upper = Math.floor(max);
42
+ return Math.floor(Math.random() * (upper - lower + 1)) + lower;
43
+ };
44
+ exports.getRandomInt = getRandomInt;
@@ -2,6 +2,8 @@ export declare const normalizeString: (str: string | undefined | null) => string
2
2
  export declare const generateRandomString: (length?: number) => string;
3
3
  export declare const phoneRegExp: RegExp;
4
4
  export declare const emailRegex: RegExp;
5
+ export declare const colorRegex: RegExp;
5
6
  export declare const isPhoneNumber: (str: string) => boolean;
6
7
  export declare const isEmail: (str: string) => boolean;
8
+ export declare const isColor: (str: string) => boolean;
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/string/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,QAAS,MAAM,GAAG,SAAS,GAAG,IAAI,kBAG7D,CAAC;AAEF,eAAO,MAAM,oBAAoB,YAAY,MAAM,WASlD,CAAC;AAEF,eAAO,MAAM,WAAW,QAA8B,CAAC;AAEvD,eAAO,MAAM,UAAU,QAAoD,CAAC;AAE5E,eAAO,MAAM,aAAa,QAAS,MAAM,YAExC,CAAC;AACF,eAAO,MAAM,OAAO,QAAS,MAAM,YAElC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/string/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,QAAS,MAAM,GAAG,SAAS,GAAG,IAAI,kBAG7D,CAAC;AAEF,eAAO,MAAM,oBAAoB,YAAY,MAAM,WASlD,CAAC;AAEF,eAAO,MAAM,WAAW,QAA8B,CAAC;AAEvD,eAAO,MAAM,UAAU,QAAoD,CAAC;AAE5E,eAAO,MAAM,UAAU,QAA+B,CAAC;AAEvD,eAAO,MAAM,aAAa,QAAS,MAAM,YAExC,CAAC;AACF,eAAO,MAAM,OAAO,QAAS,MAAM,YAElC,CAAC;AAEF,eAAO,MAAM,OAAO,QAAS,MAAM,YAElC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isEmail = exports.isPhoneNumber = exports.emailRegex = exports.phoneRegExp = exports.generateRandomString = exports.normalizeString = void 0;
3
+ exports.isColor = exports.isEmail = exports.isPhoneNumber = exports.colorRegex = exports.emailRegex = exports.phoneRegExp = exports.generateRandomString = exports.normalizeString = void 0;
4
4
  const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
5
5
  const normalizeString = (str) => {
6
6
  if (str)
@@ -19,6 +19,7 @@ const generateRandomString = (length = 6) => {
19
19
  exports.generateRandomString = generateRandomString;
20
20
  exports.phoneRegExp = /^\+?[1-9]\d{1,3}\d{6,14}$/;
21
21
  exports.emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
22
+ exports.colorRegex = /^#(?:[0-9a-fA-F]{3}){1,2}$/;
22
23
  const isPhoneNumber = (str) => {
23
24
  return exports.phoneRegExp.test(str);
24
25
  };
@@ -27,3 +28,7 @@ const isEmail = (str) => {
27
28
  return exports.emailRegex.test(str);
28
29
  };
29
30
  exports.isEmail = isEmail;
31
+ const isColor = (str) => {
32
+ return exports.colorRegex.test(str);
33
+ };
34
+ exports.isColor = isColor;
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
- {
2
- "name": "sea-platform-helpers",
3
- "description": "SEA platform helpers library",
4
- "version": "1.0.0",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "build": "tsc --build",
8
- "watch": "tsc --watch"
9
- },
10
- "files": [
11
- "dist/**/*"
12
- ],
13
- "exports": {
14
- ".": {
15
- "types": "./dist/index.d.ts",
16
- "default": "./dist/index.js"
17
- }
18
- },
19
- "keywords": [],
20
- "author": "",
21
- "license": "ISC",
22
- "dependencies": {
23
- "@nestjs/swagger": "^8.0.7",
24
- "bcrypt": "^5.1.1",
25
- "class-transformer": "^0.5.1",
26
- "class-validator": "^0.14.1",
27
- "moment": "^2.30.1",
28
- "moment-timezone": "^0.5.46",
29
- "numeral": "^2.0.6",
30
- "sea-platform-helpers": "file:"
31
- },
32
- "devDependencies": {
33
- "@types/bcrypt": "^5.0.2",
34
- "@types/numeral": "^2.0.5"
35
- }
36
- }
1
+ {
2
+ "name": "sea-platform-helpers",
3
+ "description": "SEA platform helpers library",
4
+ "version": "1.2.0",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "build": "tsc --build",
8
+ "watch": "tsc --watch"
9
+ },
10
+ "files": [
11
+ "dist/**/*"
12
+ ],
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ }
18
+ },
19
+ "keywords": [],
20
+ "author": "",
21
+ "license": "ISC",
22
+ "dependencies": {
23
+ "@nestjs/swagger": "^8.0.7",
24
+ "bcrypt": "^5.1.1",
25
+ "class-transformer": "^0.5.1",
26
+ "class-validator": "^0.14.1",
27
+ "moment": "^2.30.1",
28
+ "moment-timezone": "^0.5.46",
29
+ "numeral": "^2.0.6",
30
+ "sea-platform-helpers": "file:"
31
+ },
32
+ "devDependencies": {
33
+ "@types/bcrypt": "^5.0.2",
34
+ "@types/numeral": "^2.0.5"
35
+ }
36
+ }