@hed-hog/core 0.0.169 → 0.0.171

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 (74) hide show
  1. package/dist/dashboard/dashboard/dashboard.controller.d.ts +3 -15
  2. package/dist/dashboard/dashboard/dashboard.controller.d.ts.map +1 -1
  3. package/dist/dashboard/dashboard/dashboard.service.d.ts +3 -15
  4. package/dist/dashboard/dashboard/dashboard.service.d.ts.map +1 -1
  5. package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts +17 -20
  6. package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts.map +1 -1
  7. package/dist/dashboard/dashboard-component/dashboard-component.controller.js +15 -3
  8. package/dist/dashboard/dashboard-component/dashboard-component.controller.js.map +1 -1
  9. package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts +15 -22
  10. package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts.map +1 -1
  11. package/dist/dashboard/dashboard-component/dashboard-component.service.js +83 -12
  12. package/dist/dashboard/dashboard-component/dashboard-component.service.js.map +1 -1
  13. package/dist/dashboard/dashboard-component/dto/create.dto.d.ts +0 -4
  14. package/dist/dashboard/dashboard-component/dto/create.dto.d.ts.map +1 -1
  15. package/dist/dashboard/dashboard-component/dto/create.dto.js +0 -19
  16. package/dist/dashboard/dashboard-component/dto/create.dto.js.map +1 -1
  17. package/dist/dashboard/dashboard-component/dto/update.dto.d.ts +0 -4
  18. package/dist/dashboard/dashboard-component/dto/update.dto.d.ts.map +1 -1
  19. package/dist/dashboard/dashboard-component/dto/update.dto.js +0 -20
  20. package/dist/dashboard/dashboard-component/dto/update.dto.js.map +1 -1
  21. package/dist/dashboard/dashboard-component-role/dashboard-component-role.controller.d.ts +122 -0
  22. package/dist/dashboard/dashboard-component-role/dashboard-component-role.controller.d.ts.map +1 -0
  23. package/dist/dashboard/dashboard-component-role/dashboard-component-role.controller.js +83 -0
  24. package/dist/dashboard/dashboard-component-role/dashboard-component-role.controller.js.map +1 -0
  25. package/dist/dashboard/dashboard-component-role/dashboard-component-role.module.d.ts +3 -0
  26. package/dist/dashboard/dashboard-component-role/dashboard-component-role.module.d.ts.map +1 -0
  27. package/dist/dashboard/dashboard-component-role/dashboard-component-role.module.js +26 -0
  28. package/dist/dashboard/dashboard-component-role/dashboard-component-role.module.js.map +1 -0
  29. package/dist/dashboard/dashboard-component-role/dashboard-component-role.service.d.ts +125 -0
  30. package/dist/dashboard/dashboard-component-role/dashboard-component-role.service.d.ts.map +1 -0
  31. package/dist/dashboard/dashboard-component-role/dashboard-component-role.service.js +143 -0
  32. package/dist/dashboard/dashboard-component-role/dashboard-component-role.service.js.map +1 -0
  33. package/dist/dashboard/dashboard-component-role/dto/create.dto.d.ts +5 -0
  34. package/dist/dashboard/dashboard-component-role/dto/create.dto.d.ts.map +1 -0
  35. package/dist/dashboard/dashboard-component-role/dto/create.dto.js +25 -0
  36. package/dist/dashboard/dashboard-component-role/dto/create.dto.js.map +1 -0
  37. package/dist/dashboard/dashboard-component-role/dto/index.d.ts +2 -0
  38. package/dist/dashboard/dashboard-component-role/dto/index.d.ts.map +1 -0
  39. package/dist/dashboard/dashboard-component-role/dto/index.js +18 -0
  40. package/dist/dashboard/dashboard-component-role/dto/index.js.map +1 -0
  41. package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts +36 -22
  42. package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts.map +1 -1
  43. package/dist/dashboard/dashboard-core/dashboard-core.controller.js +0 -9
  44. package/dist/dashboard/dashboard-core/dashboard-core.controller.js.map +1 -1
  45. package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts +36 -22
  46. package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts.map +1 -1
  47. package/dist/dashboard/dashboard-core/dashboard-core.service.js +123 -51
  48. package/dist/dashboard/dashboard-core/dashboard-core.service.js.map +1 -1
  49. package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts +0 -4
  50. package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts.map +1 -1
  51. package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts +0 -4
  52. package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts.map +1 -1
  53. package/dist/dashboard/dashboard.module.d.ts.map +1 -1
  54. package/dist/dashboard/dashboard.module.js +2 -0
  55. package/dist/dashboard/dashboard.module.js.map +1 -1
  56. package/hedhog/data/dashboard_component.yaml +16 -16
  57. package/hedhog/data/dashboard_component_role.yaml +48 -0
  58. package/hedhog/data/dashboard_item.yaml +28 -28
  59. package/hedhog/data/menu.yaml +3 -3
  60. package/hedhog/data/route.yaml +30 -0
  61. package/hedhog/table/dashboard_component_role.yaml +16 -0
  62. package/package.json +2 -2
  63. package/src/dashboard/dashboard-component/dashboard-component.controller.ts +12 -3
  64. package/src/dashboard/dashboard-component/dashboard-component.service.ts +104 -14
  65. package/src/dashboard/dashboard-component/dto/create.dto.ts +0 -15
  66. package/src/dashboard/dashboard-component/dto/update.dto.ts +0 -16
  67. package/src/dashboard/dashboard-component-role/dashboard-component-role.controller.ts +57 -0
  68. package/src/dashboard/dashboard-component-role/dashboard-component-role.module.ts +13 -0
  69. package/src/dashboard/dashboard-component-role/dashboard-component-role.service.ts +170 -0
  70. package/src/dashboard/dashboard-component-role/dto/create.dto.ts +9 -0
  71. package/src/dashboard/dashboard-component-role/dto/index.ts +1 -0
  72. package/src/dashboard/dashboard-core/dashboard-core.controller.ts +0 -5
  73. package/src/dashboard/dashboard-core/dashboard-core.service.ts +152 -54
  74. package/src/dashboard/dashboard.module.ts +2 -0
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DashboardComponentRoleService = void 0;
16
+ const api_locale_1 = require("@hed-hog/api-locale");
17
+ const api_pagination_1 = require("@hed-hog/api-pagination");
18
+ const api_prisma_1 = require("@hed-hog/api-prisma");
19
+ const common_1 = require("@nestjs/common");
20
+ let DashboardComponentRoleService = class DashboardComponentRoleService {
21
+ constructor(prismaService, paginationService) {
22
+ this.prismaService = prismaService;
23
+ this.paginationService = paginationService;
24
+ }
25
+ async getAll(paginationParams, locale) {
26
+ return this.paginationService.paginate(this.prismaService.dashboard_component_role, paginationParams, {
27
+ include: {
28
+ dashboard_component: {
29
+ include: {
30
+ dashboard_component_locale: {
31
+ include: {
32
+ locale: true,
33
+ },
34
+ },
35
+ },
36
+ },
37
+ role: {
38
+ include: {
39
+ role_locale: {
40
+ include: {
41
+ locale: true,
42
+ },
43
+ },
44
+ },
45
+ },
46
+ },
47
+ orderBy: {
48
+ id: 'desc',
49
+ },
50
+ }, 'dashboardComponentRole');
51
+ }
52
+ async getAllByComponent(componentId, locale) {
53
+ const relations = await this.prismaService.dashboard_component_role.findMany({
54
+ where: { component_id: componentId },
55
+ include: {
56
+ role: {
57
+ include: {
58
+ role_locale: {
59
+ include: {
60
+ locale: true,
61
+ },
62
+ },
63
+ },
64
+ },
65
+ },
66
+ });
67
+ return relations;
68
+ }
69
+ async create(data, locale) {
70
+ // Verificar se a relação já existe
71
+ const existing = await this.prismaService.dashboard_component_role.findFirst({
72
+ where: {
73
+ component_id: data.component_id,
74
+ role_id: data.role_id,
75
+ },
76
+ });
77
+ if (existing) {
78
+ throw new Error((0, api_locale_1.getLocaleText)('dashboardComponentRoleAlreadyExists', locale, 'Dashboard component role already exists'));
79
+ }
80
+ return this.prismaService.dashboard_component_role.create({
81
+ data: {
82
+ component_id: data.component_id,
83
+ role_id: data.role_id,
84
+ },
85
+ include: {
86
+ dashboard_component: {
87
+ include: {
88
+ dashboard_component_locale: {
89
+ include: {
90
+ locale: true,
91
+ },
92
+ },
93
+ },
94
+ },
95
+ role: {
96
+ include: {
97
+ role_locale: {
98
+ include: {
99
+ locale: true,
100
+ },
101
+ },
102
+ },
103
+ },
104
+ },
105
+ });
106
+ }
107
+ async delete(id, locale) {
108
+ const relation = await this.prismaService.dashboard_component_role.findUnique({
109
+ where: { id },
110
+ });
111
+ if (!relation) {
112
+ throw new common_1.NotFoundException((0, api_locale_1.getLocaleText)('dashboardComponentRoleNotFound', locale, 'Dashboard component role not found'));
113
+ }
114
+ await this.prismaService.dashboard_component_role.delete({
115
+ where: { id },
116
+ });
117
+ return { success: true };
118
+ }
119
+ async deleteByComponentAndRole(componentId, roleId, locale) {
120
+ const relation = await this.prismaService.dashboard_component_role.findFirst({
121
+ where: {
122
+ component_id: componentId,
123
+ role_id: roleId,
124
+ },
125
+ });
126
+ if (!relation) {
127
+ throw new common_1.NotFoundException((0, api_locale_1.getLocaleText)('dashboardComponentRoleNotFound', locale, 'Dashboard component role not found'));
128
+ }
129
+ await this.prismaService.dashboard_component_role.delete({
130
+ where: { id: relation.id },
131
+ });
132
+ return { success: true };
133
+ }
134
+ };
135
+ exports.DashboardComponentRoleService = DashboardComponentRoleService;
136
+ exports.DashboardComponentRoleService = DashboardComponentRoleService = __decorate([
137
+ (0, common_1.Injectable)(),
138
+ __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
139
+ __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_pagination_1.PaginationService))),
140
+ __metadata("design:paramtypes", [api_prisma_1.PrismaService,
141
+ api_pagination_1.PaginationService])
142
+ ], DashboardComponentRoleService);
143
+ //# sourceMappingURL=dashboard-component-role.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-component-role.service.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component-role/dashboard-component-role.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,4DAA4D;AAC5D,oDAAoD;AACpD,2CAKwB;AAIjB,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACxC,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAc;QAC3C,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CACpC,IAAI,CAAC,aAAa,CAAC,wBAAwB,EAC3C,gBAAgB,EAChB;YACE,OAAO,EAAE;gBACP,mBAAmB,EAAE;oBACnB,OAAO,EAAE;wBACP,0BAA0B,EAAE;4BAC1B,OAAO,EAAE;gCACP,MAAM,EAAE,IAAI;6BACb;yBACF;qBACF;iBACF;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE;wBACP,WAAW,EAAE;4BACX,OAAO,EAAE;gCACP,MAAM,EAAE,IAAI;6BACb;yBACF;qBACF;iBACF;aACF;YACD,OAAO,EAAE;gBACP,EAAE,EAAE,MAAM;aACX;SACF,EACD,wBAAwB,CACzB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,WAAmB,EAAE,MAAc;QACzD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,wBAAwB,CAAC,QAAQ,CAAC;YAC3E,KAAK,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE;YACpC,OAAO,EAAE;gBACP,IAAI,EAAE;oBACJ,OAAO,EAAE;wBACP,WAAW,EAAE;4BACX,OAAO,EAA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+ //# sourceMappingURL=create.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component-role/dto/create.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,+BAA+B;IAE1C,YAAY,EAAE,MAAM,CAAC;IAGrB,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateDashboardComponentRoleDTO = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class CreateDashboardComponentRoleDTO {
15
+ }
16
+ exports.CreateDashboardComponentRoleDTO = CreateDashboardComponentRoleDTO;
17
+ __decorate([
18
+ (0, class_validator_1.IsInt)(),
19
+ __metadata("design:type", Number)
20
+ ], CreateDashboardComponentRoleDTO.prototype, "component_id", void 0);
21
+ __decorate([
22
+ (0, class_validator_1.IsInt)(),
23
+ __metadata("design:type", Number)
24
+ ], CreateDashboardComponentRoleDTO.prototype, "role_id", void 0);
25
+ //# sourceMappingURL=create.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component-role/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwC;AAExC,MAAa,+BAA+B;CAM3C;AAND,0EAMC;AAJC;IADC,IAAA,uBAAK,GAAE;;qEACa;AAGrB;IADC,IAAA,uBAAK,GAAE;;gEACQ"}
@@ -0,0 +1,2 @@
1
+ export * from './create.dto';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component-role/dto/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./create.dto"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component-role/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
@@ -7,28 +7,24 @@ export declare class DashboardCoreController {
7
7
  dashboard_component_locale: {
8
8
  name: string;
9
9
  id: number;
10
- description: string | null;
10
+ description: string;
11
11
  created_at: Date;
12
12
  updated_at: Date;
13
13
  locale_id: number;
14
14
  dashboard_component_id: number;
15
15
  }[];
16
16
  } & {
17
- path: string;
18
17
  width: number;
19
18
  id: number;
20
19
  created_at: Date;
21
20
  updated_at: Date;
22
21
  slug: string;
23
- icon: string | null;
24
- color: string | null;
25
22
  min_width: number;
26
23
  max_width: number | null;
27
24
  min_height: number;
28
25
  max_height: number | null;
29
26
  height: number;
30
27
  is_resizable: boolean;
31
- stat_key: string | null;
32
28
  };
33
29
  dashboard_user: {
34
30
  width: number;
@@ -53,20 +49,42 @@ export declare class DashboardCoreController {
53
49
  y_axis: number;
54
50
  })[]>;
55
51
  getStatistics(): Promise<{
56
- totalUsers: number;
57
- recentUsers: number;
58
- activeUsers: number;
59
- totalRoles: number;
60
- totalMenus: number;
61
- totalRoutes: number;
62
- totalModules: number;
63
- totalSettings: number;
64
- totalContacts: number;
52
+ cards: {
53
+ sessionsToday: {
54
+ value: number;
55
+ change: number;
56
+ };
57
+ activeUsers: {
58
+ value: number;
59
+ change: number;
60
+ };
61
+ emailsSent: {
62
+ value: number;
63
+ change: number;
64
+ };
65
+ roles: {
66
+ value: number;
67
+ change: number;
68
+ };
69
+ };
70
+ charts: {
71
+ emailsPerWeek: {
72
+ day: string;
73
+ sent: number;
74
+ }[];
75
+ permissionDistribution: {
76
+ name: string;
77
+ value: number;
78
+ color: string;
79
+ }[];
80
+ sessionActivity: any[];
81
+ userGrowth: {
82
+ month: string;
83
+ users: number;
84
+ sessions: number;
85
+ }[];
86
+ };
65
87
  }>;
66
- getUserGrowth(): Promise<{
67
- date: Date;
68
- count: number;
69
- }[]>;
70
88
  getUserLayout(user: any, slug: string, locale: string): Promise<{
71
89
  i: string;
72
90
  component_id: number;
@@ -106,10 +124,6 @@ export declare class DashboardCoreController {
106
124
  slug: string;
107
125
  name: any;
108
126
  description: any;
109
- path: string;
110
- icon: any;
111
- stat_key: any;
112
- color: any;
113
127
  x: number;
114
128
  y: number;
115
129
  w: number;
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-core.controller.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.controller.ts"],"names":[],"mappings":"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKtD,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKb,aAAa,CAAS,IAAI,KAAA,EAAiB,IAAI,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;IAKjF,cAAc,CACJ,IAAI,KAAA,EACG,IAAI,EAAE,MAAM,EACnB,IAAI,EAAE;QAAE,MAAM,EAAE,KAAK,CAAC;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;;;IAM5F,SAAS,CACC,IAAI,KAAA,EACG,IAAI,EAAE,MAAM,EACnB,IAAI,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,EAC7B,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;IAW1B,YAAY,CACF,IAAI,KAAA,EACG,IAAI,EAAE,MAAM,EACR,QAAQ,EAAE,MAAM;;;CAQtC"}
@@ -27,9 +27,6 @@ let DashboardCoreController = class DashboardCoreController {
27
27
  getStatistics() {
28
28
  return this.dashboardCoreService.getStatistics();
29
29
  }
30
- getUserGrowth() {
31
- return this.dashboardCoreService.getUserGrowth();
32
- }
33
30
  getUserLayout(user, slug, locale) {
34
31
  return this.dashboardCoreService.getUserLayout(user.id, slug, locale);
35
32
  }
@@ -58,12 +55,6 @@ __decorate([
58
55
  __metadata("design:paramtypes", []),
59
56
  __metadata("design:returntype", void 0)
60
57
  ], DashboardCoreController.prototype, "getStatistics", null);
61
- __decorate([
62
- (0, common_1.Get)('stats/user-growth'),
63
- __metadata("design:type", Function),
64
- __metadata("design:paramtypes", []),
65
- __metadata("design:returntype", void 0)
66
- ], DashboardCoreController.prototype, "getUserGrowth", null);
67
58
  __decorate([
68
59
  (0, common_1.Get)('layout/:slug'),
69
60
  __param(0, (0, api_1.User)()),
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-core.controller.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA0C;AAC1C,oDAA6C;AAC7C,2CAA4E;AAC5E,qEAAgE;AAIzD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IAG3E,QAAQ,CAAgB,IAAY,EAAY,MAAM;QACpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;IAGD,aAAa;QACX,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE,CAAC;IACnD,CAAC;IAGD,aAAa;QACX,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE,CAAC;IACnD,CAAC;IAGD,aAAa,CAAS,IAAI,EAAiB,IAAY,EAAY,MAAc;QAC/E,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;IAGD,cAAc,CACJ,IAAI,EACG,IAAY,EACnB,IAAkF;QAE1F,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9E,CAAC;IAGD,SAAS,CACC,IAAI,EACG,IAAY,EACnB,IAA+B,EAC7B,MAAc;QAExB,OAAO,IAAI,CAAC,oBAAoB,CAAC,wBAAwB,CACvD,IAAI,CAAC,EAAE,EACP,IAAI,EACJ,IAAI,CAAC,aAAa,EAClB,MAAM,CACP,CAAC;IACJ,CAAC;IAGD,YAAY,CACF,IAAI,EACG,IAAY,EACR,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CAAoB;GAD5D,uBAAuB,CA2DnC"}
1
+ {"version":3,"file":"dashboard-core.controller.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA0C;AAC1C,oDAA6C;AAC7C,2CAA4E;AAC5E,qEAAgE;AAIzD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IAG3E,QAAQ,CAAgB,IAAY,EAAY,MAAM;QACpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;IAGD,aAAa;QACX,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE,CAAC;IACnD,CAAC;IAGD,aAAa,CAAS,IAAI,EAAiB,IAAY,EAAY,MAAc;QAC/E,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;IAGD,cAAc,CACJ,IAAI,EACG,IAAY,EACnB,IAAkF;QAE1F,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9E,CAAC;IAGD,SAAS,CACC,IAAI,EACG,IAAY,EACnB,IAA+B,EAC7B,MAAc;QAExB,OAAO,IAAI,CAAC,oBAAoB,CAAC,wBAAwB,CACvD,IAAI,CAAC,EAAE,EACP,IAAI,EACJ,IAAI,CAAC,aAAa,EAClB,MAAM,CACP,CAAC;IACJ,CAAC;IAGD,YAAY,CACF,IAAI,EACG,IAAY,EACR,QAAgB;QAEnC,OAAO,IAAI,CAAC,oBAAoB,CAAC,6BAA6B,CAC5D,IAAI,CAAC,EAAE,EACP,IAAI,EACJ,QAAQ,CACT,CAAC;IACJ,CAAC;CACF,CAAA;AAtDY,0DAAuB;AAIlC;IADC,IAAA,YAAG,EAAC,OAAO,CAAC;IACH,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IAAgB,WAAA,IAAA,mBAAM,GAAE,CAAA;;;;uDAE9C;AAGD;IADC,IAAA,YAAG,EAAC,gBAAgB,CAAC;;;;4DAGrB;AAGD;IADC,IAAA,YAAG,EAAC,cAAc,CAAC;IACL,WAAA,IAAA,UAAI,GAAE,CAAA;IAAQ,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IAAgB,WAAA,IAAA,mBAAM,GAAE,CAAA;;;;4DAEjE;AAGD;IADC,IAAA,aAAI,EAAC,cAAc,CAAC;IAElB,WAAA,IAAA,UAAI,GAAE,CAAA;IACN,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,aAAI,GAAE,CAAA;;;;6DAGR;AAGD;IADC,IAAA,aAAI,EAAC,cAAc,CAAC;IAElB,WAAA,IAAA,UAAI,GAAE,CAAA;IACN,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,mBAAM,GAAE,CAAA;;;;wDAQV;AAGD;IADC,IAAA,eAAM,EAAC,wBAAwB,CAAC;IAE9B,WAAA,IAAA,UAAI,GAAE,CAAA;IACN,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;;;;2DAOnB;kCArDU,uBAAuB;IAFnC,IAAA,UAAI,GAAE;IACN,IAAA,mBAAU,EAAC,gBAAgB,CAAC;qCAEwB,6CAAoB;GAD5D,uBAAuB,CAsDnC"}
@@ -7,28 +7,24 @@ export declare class DashboardCoreService {
7
7
  dashboard_component_locale: {
8
8
  name: string;
9
9
  id: number;
10
- description: string | null;
10
+ description: string;
11
11
  created_at: Date;
12
12
  updated_at: Date;
13
13
  locale_id: number;
14
14
  dashboard_component_id: number;
15
15
  }[];
16
16
  } & {
17
- path: string;
18
17
  width: number;
19
18
  id: number;
20
19
  created_at: Date;
21
20
  updated_at: Date;
22
21
  slug: string;
23
- icon: string | null;
24
- color: string | null;
25
22
  min_width: number;
26
23
  max_width: number | null;
27
24
  min_height: number;
28
25
  max_height: number | null;
29
26
  height: number;
30
27
  is_resizable: boolean;
31
- stat_key: string | null;
32
28
  };
33
29
  dashboard_user: {
34
30
  width: number;
@@ -53,20 +49,42 @@ export declare class DashboardCoreService {
53
49
  y_axis: number;
54
50
  })[]>;
55
51
  getStatistics(): Promise<{
56
- totalUsers: number;
57
- recentUsers: number;
58
- activeUsers: number;
59
- totalRoles: number;
60
- totalMenus: number;
61
- totalRoutes: number;
62
- totalModules: number;
63
- totalSettings: number;
64
- totalContacts: number;
52
+ cards: {
53
+ sessionsToday: {
54
+ value: number;
55
+ change: number;
56
+ };
57
+ activeUsers: {
58
+ value: number;
59
+ change: number;
60
+ };
61
+ emailsSent: {
62
+ value: number;
63
+ change: number;
64
+ };
65
+ roles: {
66
+ value: number;
67
+ change: number;
68
+ };
69
+ };
70
+ charts: {
71
+ emailsPerWeek: {
72
+ day: string;
73
+ sent: number;
74
+ }[];
75
+ permissionDistribution: {
76
+ name: string;
77
+ value: number;
78
+ color: string;
79
+ }[];
80
+ sessionActivity: any[];
81
+ userGrowth: {
82
+ month: string;
83
+ users: number;
84
+ sessions: number;
85
+ }[];
86
+ };
65
87
  }>;
66
- getUserGrowth(): Promise<{
67
- date: Date;
68
- count: number;
69
- }[]>;
70
88
  getUserLayout(userId: number, slug: string, localeCode: string): Promise<{
71
89
  i: string;
72
90
  component_id: number;
@@ -102,10 +120,6 @@ export declare class DashboardCoreService {
102
120
  slug: string;
103
121
  name: any;
104
122
  description: any;
105
- path: string;
106
- icon: any;
107
- stat_key: any;
108
- color: any;
109
123
  x: number;
110
124
  y: number;
111
125
  w: number;
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-core.service.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,qBACa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAEnD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoBnC,aAAa;;;;;;;;;;;IAyCb,aAAa;;;;IAmBb,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;IA+D9D,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,KAAK,CAAC;QACZ,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;;;IA4DE,wBAAwB,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;IAiHd,6BAA6B,CACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM;;;CAYnB"}
1
+ {"version":3,"file":"dashboard-core.service.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,qBACa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAEnD,QAAQ,CA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