@hed-hog/core 0.0.151 → 0.0.153
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.
- package/dist/dashboard/dashboard/dashboard.controller.d.ts +214 -9
- package/dist/dashboard/dashboard/dashboard.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dashboard.controller.js +35 -35
- package/dist/dashboard/dashboard/dashboard.controller.js.map +1 -1
- package/dist/dashboard/dashboard/dashboard.module.d.ts +1 -1
- package/dist/dashboard/dashboard/dashboard.module.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dashboard.module.js +11 -6
- package/dist/dashboard/dashboard/dashboard.module.js.map +1 -1
- package/dist/dashboard/dashboard/dashboard.service.d.ts +217 -16
- package/dist/dashboard/dashboard/dashboard.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dashboard.service.js +115 -28
- package/dist/dashboard/dashboard/dashboard.service.js.map +1 -1
- package/dist/dashboard/dashboard/dto/create.dto.d.ts +4 -2
- package/dist/dashboard/dashboard/dto/create.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dto/create.dto.js +10 -1
- package/dist/dashboard/dashboard/dto/create.dto.js.map +1 -1
- package/dist/dashboard/dashboard/dto/index.d.ts +5 -0
- package/dist/dashboard/dashboard/dto/index.d.ts.map +1 -0
- package/dist/dashboard/dashboard/dto/index.js +25 -0
- package/dist/dashboard/dashboard/dto/index.js.map +1 -0
- package/dist/dashboard/dashboard/dto/update.dto.d.ts +5 -4
- package/dist/dashboard/dashboard/dto/update.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dto/update.dto.js +27 -3
- package/dist/dashboard/dashboard/dto/update.dto.js.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts +114 -9
- package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.controller.js +35 -36
- package/dist/dashboard/dashboard-component/dashboard-component.controller.js.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.module.js +4 -3
- package/dist/dashboard/dashboard-component/dashboard-component.module.js.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts +116 -15
- package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.service.js +109 -22
- package/dist/dashboard/dashboard-component/dashboard-component.service.js.map +1 -1
- package/dist/dashboard/dashboard-component/dto/create.dto.d.ts +4 -2
- package/dist/dashboard/dashboard-component/dto/create.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dto/create.dto.js +10 -1
- package/dist/dashboard/dashboard-component/dto/create.dto.js.map +1 -1
- package/dist/dashboard/dashboard-component/dto/index.d.ts +5 -0
- package/dist/dashboard/dashboard-component/dto/index.d.ts.map +1 -0
- package/dist/dashboard/dashboard-component/dto/index.js +25 -0
- package/dist/dashboard/dashboard-component/dto/index.js.map +1 -0
- package/dist/dashboard/dashboard-component/dto/update.dto.d.ts +13 -4
- package/dist/dashboard/dashboard-component/dto/update.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dto/update.dto.js +67 -3
- package/dist/dashboard/dashboard-component/dto/update.dto.js.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts +56 -0
- package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.controller.js +65 -0
- package/dist/dashboard/dashboard-core/dashboard-core.controller.js.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts +52 -0
- package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.service.js +221 -0
- package/dist/dashboard/dashboard-core/dashboard-core.service.js.map +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts +26 -29
- package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.controller.js +24 -43
- package/dist/dashboard/dashboard-item/dashboard-item.controller.js.map +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts +30 -34
- package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.service.js +51 -35
- package/dist/dashboard/dashboard-item/dashboard-item.service.js.map +1 -1
- package/dist/dashboard/dashboard-item/dto/index.d.ts +5 -0
- package/dist/dashboard/dashboard-item/dto/index.d.ts.map +1 -0
- package/dist/dashboard/dashboard-item/dto/index.js +25 -0
- package/dist/dashboard/dashboard-item/dto/index.js.map +1 -0
- package/dist/dashboard/dashboard-item/dto/update.dto.d.ts +7 -4
- package/dist/dashboard/dashboard-item/dto/update.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard-item/dto/update.dto.js +42 -3
- package/dist/dashboard/dashboard-item/dto/update.dto.js.map +1 -1
- package/dist/dashboard/dashboard.module.js +1 -1
- package/dist/dashboard/dashboard.module.js.map +1 -1
- package/dist/oauth/oauth.controller.d.ts.map +1 -1
- package/dist/oauth/oauth.controller.js.map +1 -1
- package/dist/oauth/providers/microsoft-entra-id.provider.d.ts.map +1 -1
- package/dist/oauth/providers/microsoft-entra-id.provider.js +7 -4
- package/dist/oauth/providers/microsoft-entra-id.provider.js.map +1 -1
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +1 -0
- package/dist/setting/setting.service.js.map +1 -1
- package/hedhog/data/route.yaml +44 -14
- package/hedhog/data/setting_group.yaml +10 -0
- package/hedhog/query/dashboard-seed.sql +131 -0
- package/package.json +1 -1
- package/src/dashboard/dashboard/dashboard.controller.ts +26 -23
- package/src/dashboard/dashboard/dashboard.module.ts +7 -2
- package/src/dashboard/dashboard/dashboard.service.ts +125 -44
- package/src/dashboard/dashboard/dto/create.dto.ts +12 -3
- package/src/dashboard/dashboard/dto/index.ts +7 -0
- package/src/dashboard/dashboard/dto/update.dto.ts +17 -3
- package/src/dashboard/dashboard-component/dashboard-component.controller.ts +22 -19
- package/src/dashboard/dashboard-component/dashboard-component.module.ts +3 -3
- package/src/dashboard/dashboard-component/dashboard-component.service.ts +128 -39
- package/src/dashboard/dashboard-component/dto/create.dto.ts +12 -3
- package/src/dashboard/dashboard-component/dto/index.ts +7 -0
- package/src/dashboard/dashboard-component/dto/update.dto.ts +49 -3
- package/src/dashboard/dashboard-core/dashboard-core.controller.ts +53 -2
- package/src/dashboard/dashboard-core/dashboard-core.service.ts +271 -0
- package/src/dashboard/dashboard-item/dashboard-item.controller.ts +17 -26
- package/src/dashboard/dashboard-item/dashboard-item.service.ts +55 -47
- package/src/dashboard/dashboard-item/dto/index.ts +7 -0
- package/src/dashboard/dashboard-item/dto/update.dto.ts +27 -3
- package/src/dashboard/dashboard.module.ts +2 -2
- package/src/language/en.json +4 -1
- package/src/language/pt.json +4 -1
- package/src/oauth/oauth.controller.ts +1 -2
- package/src/oauth/providers/microsoft-entra-id.provider.ts +9 -4
- package/src/setting/setting.service.ts +1 -0
|
@@ -7,17 +7,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.DashboardComponentModule = void 0;
|
|
10
|
-
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
11
10
|
const api_locale_1 = require("@hed-hog/api-locale");
|
|
11
|
+
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
12
|
+
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
12
13
|
const common_1 = require("@nestjs/common");
|
|
13
|
-
const dashboard_component_service_1 = require("./dashboard-component.service");
|
|
14
14
|
const dashboard_component_controller_1 = require("./dashboard-component.controller");
|
|
15
|
+
const dashboard_component_service_1 = require("./dashboard-component.service");
|
|
15
16
|
let DashboardComponentModule = class DashboardComponentModule {
|
|
16
17
|
};
|
|
17
18
|
exports.DashboardComponentModule = DashboardComponentModule;
|
|
18
19
|
exports.DashboardComponentModule = DashboardComponentModule = __decorate([
|
|
19
20
|
(0, common_1.Module)({
|
|
20
|
-
imports: [(0, common_1.forwardRef)(() => api_locale_1.LocaleModule), (0, common_1.forwardRef)(() => api_prisma_1.PrismaModule)],
|
|
21
|
+
imports: [(0, common_1.forwardRef)(() => api_locale_1.LocaleModule), (0, common_1.forwardRef)(() => api_pagination_1.PaginationModule), (0, common_1.forwardRef)(() => api_prisma_1.PrismaModule)],
|
|
21
22
|
controllers: [dashboard_component_controller_1.DashboardComponentController],
|
|
22
23
|
providers: [dashboard_component_service_1.DashboardComponentService],
|
|
23
24
|
exports: [dashboard_component_service_1.DashboardComponentService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-component.module.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.module.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dashboard-component.module.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAmD;AACnD,4DAA2D;AAC3D,oDAAmD;AACnD,2CAAoD;AACpD,qFAAgF;AAChF,+EAA0E;AAQnE,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CAAG,CAAA;AAA3B,4DAAwB;mCAAxB,wBAAwB;IANpC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAgB,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC,CAAC;QAC7G,WAAW,EAAE,CAAC,6DAA4B,CAAC;QAC3C,SAAS,EAAE,CAAC,uDAAyB,CAAC;QACtC,OAAO,EAAE,CAAC,uDAAyB,CAAC;KACrC,CAAC;GACW,wBAAwB,CAAG"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PaginationService } from '@hed-hog/api-pagination';
|
|
2
2
|
import { PrismaService } from '@hed-hog/api-prisma';
|
|
3
|
-
import {
|
|
4
|
-
import { DeleteDTO } from '@hed-hog/api';
|
|
5
|
-
import { UpdateDTO } from './dto/update.dto';
|
|
6
|
-
import { LocaleService } from '@hed-hog/api-locale';
|
|
3
|
+
import { CreateDashboardComponentDTO, UpdateDashboardComponentDTO } from './dto';
|
|
7
4
|
export declare class DashboardComponentService {
|
|
8
5
|
private readonly prismaService;
|
|
9
|
-
private readonly
|
|
6
|
+
private readonly paginationService;
|
|
10
7
|
private readonly modelName;
|
|
11
8
|
private readonly foreignKey;
|
|
12
|
-
constructor(prismaService: PrismaService,
|
|
13
|
-
|
|
9
|
+
constructor(prismaService: PrismaService, paginationService: PaginationService);
|
|
10
|
+
getAllComponents(paginationParams: any): Promise<{
|
|
14
11
|
total: any;
|
|
15
12
|
lastPage: number;
|
|
16
13
|
page: number;
|
|
@@ -19,14 +16,118 @@ export declare class DashboardComponentService {
|
|
|
19
16
|
next: number;
|
|
20
17
|
data: any[];
|
|
21
18
|
}>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
getComponent(id: number, locale: string): Promise<{
|
|
20
|
+
dashboard_component_locale: ({
|
|
21
|
+
locale: {
|
|
22
|
+
code: string;
|
|
23
|
+
name: string;
|
|
24
|
+
region: string;
|
|
25
|
+
id: number;
|
|
26
|
+
created_at: Date;
|
|
27
|
+
updated_at: Date;
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
};
|
|
30
|
+
} & {
|
|
31
|
+
name: string;
|
|
32
|
+
id: number;
|
|
33
|
+
created_at: Date;
|
|
34
|
+
updated_at: Date;
|
|
35
|
+
locale_id: number;
|
|
36
|
+
dashboard_component_id: number;
|
|
37
|
+
})[];
|
|
38
|
+
} & {
|
|
39
|
+
path: string;
|
|
40
|
+
width: number;
|
|
25
41
|
id: number;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
created_at: Date;
|
|
43
|
+
updated_at: Date;
|
|
44
|
+
slug: string;
|
|
45
|
+
min_width: number;
|
|
46
|
+
max_width: number | null;
|
|
47
|
+
min_height: number;
|
|
48
|
+
max_height: number | null;
|
|
49
|
+
height: number;
|
|
50
|
+
is_resizable: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
createComponent(data: CreateDashboardComponentDTO, locale: string): Promise<{
|
|
53
|
+
dashboard_component_locale: ({
|
|
54
|
+
locale: {
|
|
55
|
+
code: string;
|
|
56
|
+
name: string;
|
|
57
|
+
region: string;
|
|
58
|
+
id: number;
|
|
59
|
+
created_at: Date;
|
|
60
|
+
updated_at: Date;
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
};
|
|
63
|
+
} & {
|
|
64
|
+
name: string;
|
|
65
|
+
id: number;
|
|
66
|
+
created_at: Date;
|
|
67
|
+
updated_at: Date;
|
|
68
|
+
locale_id: number;
|
|
69
|
+
dashboard_component_id: number;
|
|
70
|
+
})[];
|
|
71
|
+
} & {
|
|
72
|
+
path: string;
|
|
73
|
+
width: number;
|
|
74
|
+
id: number;
|
|
75
|
+
created_at: Date;
|
|
76
|
+
updated_at: Date;
|
|
77
|
+
slug: string;
|
|
78
|
+
min_width: number;
|
|
79
|
+
max_width: number | null;
|
|
80
|
+
min_height: number;
|
|
81
|
+
max_height: number | null;
|
|
82
|
+
height: number;
|
|
83
|
+
is_resizable: boolean;
|
|
84
|
+
}>;
|
|
85
|
+
updateComponent(id: number, data: UpdateDashboardComponentDTO, locale: string): Promise<{
|
|
86
|
+
dashboard_component_locale: ({
|
|
87
|
+
locale: {
|
|
88
|
+
code: string;
|
|
89
|
+
name: string;
|
|
90
|
+
region: string;
|
|
91
|
+
id: number;
|
|
92
|
+
created_at: Date;
|
|
93
|
+
updated_at: Date;
|
|
94
|
+
enabled: boolean;
|
|
95
|
+
};
|
|
96
|
+
} & {
|
|
97
|
+
name: string;
|
|
98
|
+
id: number;
|
|
99
|
+
created_at: Date;
|
|
100
|
+
updated_at: Date;
|
|
101
|
+
locale_id: number;
|
|
102
|
+
dashboard_component_id: number;
|
|
103
|
+
})[];
|
|
104
|
+
} & {
|
|
105
|
+
path: string;
|
|
106
|
+
width: number;
|
|
107
|
+
id: number;
|
|
108
|
+
created_at: Date;
|
|
109
|
+
updated_at: Date;
|
|
110
|
+
slug: string;
|
|
111
|
+
min_width: number;
|
|
112
|
+
max_width: number | null;
|
|
113
|
+
min_height: number;
|
|
114
|
+
max_height: number | null;
|
|
115
|
+
height: number;
|
|
116
|
+
is_resizable: boolean;
|
|
117
|
+
}>;
|
|
118
|
+
deleteComponent(id: number, locale: string): Promise<{
|
|
119
|
+
path: string;
|
|
120
|
+
width: number;
|
|
121
|
+
id: number;
|
|
122
|
+
created_at: Date;
|
|
123
|
+
updated_at: Date;
|
|
124
|
+
slug: string;
|
|
125
|
+
min_width: number;
|
|
126
|
+
max_width: number | null;
|
|
127
|
+
min_height: number;
|
|
128
|
+
max_height: number | null;
|
|
129
|
+
height: number;
|
|
130
|
+
is_resizable: boolean;
|
|
30
131
|
}>;
|
|
31
132
|
}
|
|
32
133
|
//# sourceMappingURL=dashboard-component.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-component.service.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard-component.service.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOpD,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,OAAO,CAAC;AACf,qBACa,yBAAyB;IAMlC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAPpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;gBAI1B,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,gBAAgB,CAAC,gBAAgB,KAAA;;;;;;;;;IAoBjC,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqBvC,eAAe,CAAC,IAAI,EAAE,2BAA2B,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCjE,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyC7E,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;CAejD"}
|
|
@@ -13,38 +13,125 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.DashboardComponentService = void 0;
|
|
16
|
+
const api_locale_1 = require("@hed-hog/api-locale");
|
|
17
|
+
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
16
18
|
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
17
19
|
const common_1 = require("@nestjs/common");
|
|
18
|
-
const api_locale_1 = require("@hed-hog/api-locale");
|
|
19
20
|
let DashboardComponentService = class DashboardComponentService {
|
|
20
|
-
constructor(prismaService,
|
|
21
|
+
constructor(prismaService, paginationService) {
|
|
21
22
|
this.prismaService = prismaService;
|
|
22
|
-
this.
|
|
23
|
+
this.paginationService = paginationService;
|
|
23
24
|
this.modelName = 'dashboard_component';
|
|
24
25
|
this.foreignKey = 'component_id';
|
|
25
26
|
}
|
|
26
|
-
async
|
|
27
|
-
return this.
|
|
27
|
+
async getAllComponents(paginationParams) {
|
|
28
|
+
return this.paginationService.paginate(this.prismaService.dashboard_component, paginationParams, {
|
|
29
|
+
include: {
|
|
30
|
+
dashboard_component_locale: {
|
|
31
|
+
include: {
|
|
32
|
+
locale: true,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
orderBy: {
|
|
37
|
+
created_at: 'desc',
|
|
38
|
+
},
|
|
39
|
+
}, 'dashboardComponent');
|
|
28
40
|
}
|
|
29
|
-
async
|
|
30
|
-
|
|
41
|
+
async getComponent(id, locale) {
|
|
42
|
+
const component = await this.prismaService.dashboard_component.findUnique({
|
|
43
|
+
where: { id },
|
|
44
|
+
include: {
|
|
45
|
+
dashboard_component_locale: {
|
|
46
|
+
include: {
|
|
47
|
+
locale: true,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
if (!component) {
|
|
53
|
+
throw new common_1.NotFoundException((0, api_locale_1.getLocaleText)('dashboardComponentNotFound', locale, 'Dashboard component not found'));
|
|
54
|
+
}
|
|
55
|
+
return component;
|
|
31
56
|
}
|
|
32
|
-
async
|
|
33
|
-
|
|
57
|
+
async createComponent(data, locale) {
|
|
58
|
+
var _a;
|
|
59
|
+
const component = await this.prismaService.dashboard_component.create({
|
|
60
|
+
data: {
|
|
61
|
+
slug: data.slug,
|
|
62
|
+
path: data.path,
|
|
63
|
+
min_width: data.min_width,
|
|
64
|
+
max_width: data.max_width,
|
|
65
|
+
min_height: data.min_height,
|
|
66
|
+
max_height: data.max_height,
|
|
67
|
+
width: data.width,
|
|
68
|
+
height: data.height,
|
|
69
|
+
is_resizable: (_a = data.is_resizable) !== null && _a !== void 0 ? _a : true,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
if (data.locale) {
|
|
73
|
+
for (const [localeCode, localeData] of Object.entries(data.locale)) {
|
|
74
|
+
const localeRecord = await this.prismaService.locale.findFirst({
|
|
75
|
+
where: { code: localeCode },
|
|
76
|
+
});
|
|
77
|
+
if (localeRecord) {
|
|
78
|
+
await this.prismaService.dashboard_component_locale.create({
|
|
79
|
+
data: {
|
|
80
|
+
dashboard_component_id: component.id,
|
|
81
|
+
locale_id: localeRecord.id,
|
|
82
|
+
name: localeData.name,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return this.getComponent(component.id, locale);
|
|
34
89
|
}
|
|
35
|
-
async
|
|
36
|
-
|
|
90
|
+
async updateComponent(id, data, locale) {
|
|
91
|
+
await this.prismaService.dashboard_component.update({
|
|
92
|
+
where: { id },
|
|
93
|
+
data: {
|
|
94
|
+
slug: data.slug,
|
|
95
|
+
path: data.path,
|
|
96
|
+
min_width: data.min_width,
|
|
97
|
+
max_width: data.max_width,
|
|
98
|
+
min_height: data.min_height,
|
|
99
|
+
max_height: data.max_height,
|
|
100
|
+
width: data.width,
|
|
101
|
+
height: data.height,
|
|
102
|
+
is_resizable: data.is_resizable,
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
if (data.locale) {
|
|
106
|
+
await this.prismaService.dashboard_component_locale.deleteMany({
|
|
107
|
+
where: { dashboard_component_id: id },
|
|
108
|
+
});
|
|
109
|
+
for (const [localeCode, localeData] of Object.entries(data.locale)) {
|
|
110
|
+
const localeRecord = await this.prismaService.locale.findFirst({
|
|
111
|
+
where: { code: localeCode },
|
|
112
|
+
});
|
|
113
|
+
if (localeRecord) {
|
|
114
|
+
await this.prismaService.dashboard_component_locale.create({
|
|
115
|
+
data: {
|
|
116
|
+
dashboard_component_id: id,
|
|
117
|
+
locale_id: localeRecord.id,
|
|
118
|
+
name: localeData.name,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return this.getComponent(id, locale);
|
|
37
125
|
}
|
|
38
|
-
async
|
|
39
|
-
|
|
40
|
-
|
|
126
|
+
async deleteComponent(id, locale) {
|
|
127
|
+
const component = await this.prismaService.dashboard_component.findUnique({
|
|
128
|
+
where: { id },
|
|
129
|
+
});
|
|
130
|
+
if (!component) {
|
|
131
|
+
throw new common_1.NotFoundException((0, api_locale_1.getLocaleText)('dashboardComponentNotFound', locale, 'Dashboard component not found'));
|
|
41
132
|
}
|
|
42
|
-
return this.prismaService.dashboard_component.
|
|
43
|
-
where: {
|
|
44
|
-
id: {
|
|
45
|
-
in: ids,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
133
|
+
return this.prismaService.dashboard_component.delete({
|
|
134
|
+
where: { id },
|
|
48
135
|
});
|
|
49
136
|
}
|
|
50
137
|
};
|
|
@@ -52,8 +139,8 @@ exports.DashboardComponentService = DashboardComponentService;
|
|
|
52
139
|
exports.DashboardComponentService = DashboardComponentService = __decorate([
|
|
53
140
|
(0, common_1.Injectable)(),
|
|
54
141
|
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
|
|
55
|
-
__param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() =>
|
|
142
|
+
__param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_pagination_1.PaginationService))),
|
|
56
143
|
__metadata("design:paramtypes", [api_prisma_1.PrismaService,
|
|
57
|
-
|
|
144
|
+
api_pagination_1.PaginationService])
|
|
58
145
|
], DashboardComponentService);
|
|
59
146
|
//# sourceMappingURL=dashboard-component.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-component.service.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dashboard-component.service.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,4DAA4D;AAC5D,oDAAoD;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AC,UAAU,CAAC;YACxE,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,0BAAiB,CACzB,IAAA,0BAAa,EAAC,4BAA4B,EAAE,MAAM,EAAE,+BAA+B,CAAC,CACrF,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC;YACnD,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAhJY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kCAAiB,CAAC,CAAC,CAAA;qCADZ,0BAAa;QAET,kCAAiB;GAR5C,yBAAyB,CAgJrC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class CreateDTO extends WithLocaleDTO {
|
|
1
|
+
export declare class CreateDTO {
|
|
3
2
|
slug: string;
|
|
4
3
|
path: string;
|
|
5
4
|
min_width?: number;
|
|
@@ -9,5 +8,8 @@ export declare class CreateDTO extends WithLocaleDTO {
|
|
|
9
8
|
width: number;
|
|
10
9
|
height: number;
|
|
11
10
|
is_resizable?: boolean;
|
|
11
|
+
locale: Record<string, {
|
|
12
|
+
name: string;
|
|
13
|
+
}>;
|
|
12
14
|
}
|
|
13
15
|
//# sourceMappingURL=create.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/create.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/create.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,SAAS;IAEpB,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IAIb,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,KAAK,EAAE,MAAM,CAAC;IAGd,MAAM,EAAE,MAAM,CAAC;IAIf,YAAY,CAAC,EAAE,OAAO,CAAC;IASvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1C"}
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.CreateDTO = void 0;
|
|
13
13
|
const api_locale_1 = require("@hed-hog/api-locale");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
-
class CreateDTO
|
|
15
|
+
class CreateDTO {
|
|
16
16
|
}
|
|
17
17
|
exports.CreateDTO = CreateDTO;
|
|
18
18
|
__decorate([
|
|
@@ -56,4 +56,13 @@ __decorate([
|
|
|
56
56
|
(0, class_validator_1.IsBoolean)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.booleanRequired', args.value) }),
|
|
57
57
|
__metadata("design:type", Boolean)
|
|
58
58
|
], CreateDTO.prototype, "is_resizable", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, class_validator_1.IsObject)({
|
|
61
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.localeMustBeObject', args.value),
|
|
62
|
+
}),
|
|
63
|
+
(0, class_validator_1.IsNotEmpty)({
|
|
64
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.localeRequired', args.value),
|
|
65
|
+
}),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], CreateDTO.prototype, "locale", void 0);
|
|
59
68
|
//# sourceMappingURL=create.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,qDAAkG;AAElG,MAAa,SAAS;CAyCrB;AAzCD,8BAyCC;AAvCC;IADC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;uCAC3E;AAGb;IADC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;uCAC3E;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;4CACzE;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;4CACzE;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KA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AAO,EAAE,SAAS,IAAI,2BAA2B,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,SAAS,IAAI,2BAA2B,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
exports.UpdateDashboardComponentDTO = exports.CreateDashboardComponentDTO = void 0;
|
|
18
|
+
__exportStar(require("./create.dto"), exports);
|
|
19
|
+
__exportStar(require("./update.dto"), exports);
|
|
20
|
+
// Aliases para compatibilidade
|
|
21
|
+
var create_dto_1 = require("./create.dto");
|
|
22
|
+
Object.defineProperty(exports, "CreateDashboardComponentDTO", { enumerable: true, get: function () { return create_dto_1.CreateDTO; } });
|
|
23
|
+
var update_dto_1 = require("./update.dto");
|
|
24
|
+
Object.defineProperty(exports, "UpdateDashboardComponentDTO", { enumerable: true, get: function () { return update_dto_1.UpdateDTO; } });
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAE7B,+BAA+B;AAC/B,2CAAwE;AAA/D,yHAAA,SAAS,OAA+B;AACjD,2CAAwE;AAA/D,yHAAA,SAAS,OAA+B"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare class UpdateDTO {
|
|
2
|
+
slug?: string;
|
|
3
|
+
path?: string;
|
|
4
|
+
min_width?: number;
|
|
5
|
+
max_width?: number;
|
|
6
|
+
min_height?: number;
|
|
7
|
+
max_height?: number;
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
is_resizable?: boolean;
|
|
11
|
+
locale?: Record<string, {
|
|
12
|
+
name: string;
|
|
13
|
+
}>;
|
|
4
14
|
}
|
|
5
|
-
export {};
|
|
6
15
|
//# sourceMappingURL=update.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/update.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/update.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,SAAS;IAGpB,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAIf,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,YAAY,CAAC,EAAE,OAAO,CAAC;IAUvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3C"}
|
|
@@ -1,9 +1,73 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.UpdateDTO = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
class UpdateDTO
|
|
13
|
+
const api_locale_1 = require("@hed-hog/api-locale");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class UpdateDTO {
|
|
7
16
|
}
|
|
8
17
|
exports.UpdateDTO = UpdateDTO;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsOptional)(),
|
|
20
|
+
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], UpdateDTO.prototype, "slug", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], UpdateDTO.prototype, "path", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
(0, class_validator_1.IsNumber)({}, { message: (args) => (0, api_locale_1.getLocaleText)('validation.numberRequired', args.value) }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], UpdateDTO.prototype, "min_width", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
(0, class_validator_1.IsNumber)({}, { message: (args) => (0, api_locale_1.getLocaleText)('validation.numberRequired', args.value) }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], UpdateDTO.prototype, "max_width", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsOptional)(),
|
|
40
|
+
(0, class_validator_1.IsNumber)({}, { message: (args) => (0, api_locale_1.getLocaleText)('validation.numberRequired', args.value) }),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], UpdateDTO.prototype, "min_height", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_validator_1.IsOptional)(),
|
|
45
|
+
(0, class_validator_1.IsNumber)({}, { message: (args) => (0, api_locale_1.getLocaleText)('validation.numberRequired', args.value) }),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], UpdateDTO.prototype, "max_height", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
(0, class_validator_1.IsNumber)({}, { message: (args) => (0, api_locale_1.getLocaleText)('validation.numberRequired', args.value) }),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], UpdateDTO.prototype, "width", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_validator_1.IsOptional)(),
|
|
55
|
+
(0, class_validator_1.IsNumber)({}, { message: (args) => (0, api_locale_1.getLocaleText)('validation.numberRequired', args.value) }),
|
|
56
|
+
__metadata("design:type", Number)
|
|
57
|
+
], UpdateDTO.prototype, "height", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsOptional)(),
|
|
60
|
+
(0, class_validator_1.IsBoolean)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.booleanRequired', args.value) }),
|
|
61
|
+
__metadata("design:type", Boolean)
|
|
62
|
+
], UpdateDTO.prototype, "is_resizable", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsOptional)(),
|
|
65
|
+
(0, class_validator_1.IsObject)({
|
|
66
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.localeMustBeObject', args.value),
|
|
67
|
+
}),
|
|
68
|
+
(0, class_validator_1.IsNotEmpty)({
|
|
69
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.localeRequired', args.value),
|
|
70
|
+
}),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], UpdateDTO.prototype, "locale", void 0);
|
|
9
73
|
//# sourceMappingURL=update.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/update.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard-component/dto/update.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,qDAAkG;AAElG,MAAa,SAAS;CA8CrB;AA9CD,8BA8CC;AA3CC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;uCAC1E;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,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AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,4BAA4B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;+CACnE;AAUvB;IARC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC;QACR,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAChB,IAAA,0BAAa,EAAC,+BAA+B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC7D,CAAC;IACD,IAAA,4BAAU,EAAC;QACV,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC1E,CAAC;;yCACwC"}
|
|
@@ -48,5 +48,61 @@ export declare class DashboardCoreController {
|
|
|
48
48
|
x_axis: number;
|
|
49
49
|
y_axis: number;
|
|
50
50
|
})[]>;
|
|
51
|
+
getStatistics(): Promise<{
|
|
52
|
+
totalUsers: number;
|
|
53
|
+
recentUsers: number;
|
|
54
|
+
activeUsers: number;
|
|
55
|
+
totalRoles: number;
|
|
56
|
+
totalMenus: number;
|
|
57
|
+
totalRoutes: number;
|
|
58
|
+
}>;
|
|
59
|
+
getUserGrowth(): Promise<{
|
|
60
|
+
date: Date;
|
|
61
|
+
count: number;
|
|
62
|
+
}[]>;
|
|
63
|
+
getUserLayout(user: any, slug: string): Promise<{
|
|
64
|
+
i: string;
|
|
65
|
+
component_id: number;
|
|
66
|
+
slug: string;
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
w: number;
|
|
70
|
+
h: number;
|
|
71
|
+
minW: number;
|
|
72
|
+
maxW: number;
|
|
73
|
+
minH: number;
|
|
74
|
+
maxH: number;
|
|
75
|
+
isResizable: boolean;
|
|
76
|
+
}[]>;
|
|
77
|
+
saveUserLayout(user: any, slug: string, body: {
|
|
78
|
+
layout: Array<{
|
|
79
|
+
i: string;
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
w: number;
|
|
83
|
+
h: number;
|
|
84
|
+
}>;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
success: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
addWidget(user: any, slug: string, body: {
|
|
89
|
+
componentSlug: string;
|
|
90
|
+
}): Promise<{
|
|
91
|
+
i: string;
|
|
92
|
+
component_id: number;
|
|
93
|
+
slug: string;
|
|
94
|
+
x: number;
|
|
95
|
+
y: number;
|
|
96
|
+
w: number;
|
|
97
|
+
h: number;
|
|
98
|
+
minW: number;
|
|
99
|
+
maxW: number;
|
|
100
|
+
minH: number;
|
|
101
|
+
maxH: number;
|
|
102
|
+
isResizable: boolean;
|
|
103
|
+
}>;
|
|
104
|
+
removeWidget(user: any, slug: string, widgetId: string): Promise<{
|
|
105
|
+
success: boolean;
|
|
106
|
+
}>;
|
|
51
107
|
}
|
|
52
108
|
//# sourceMappingURL=dashboard-core.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-core.controller.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-core.controller.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-core/dashboard-core.controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,qBAEa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAApB,oBAAoB,EAAE,oBAAoB;IAGvE,QAAQ,CAAgB,IAAI,EAAE,MAAM,EAAY,MAAM,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKtD,aAAa;;;;;;;;IAKb,aAAa;;;;IAKb,aAAa,CAAS,IAAI,KAAA,EAAiB,IAAI,EAAE,MAAM;;;;;;;;;;;;;;IAKvD,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;;;;;;;;;;;;;;IAUzC,YAAY,CACF,IAAI,KAAA,EACG,IAAI,EAAE,MAAM,EACR,QAAQ,EAAE,MAAM;;;CAQtC"}
|