@hed-hog/core 0.0.137 → 0.0.140
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 +1 -1
- package/dist/dashboard/dashboard/dashboard.service.d.ts +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts +1 -1
- package/dist/dashboard/dashboard-user/dashboard-user.controller.d.ts +1 -1
- package/dist/dashboard/dashboard-user/dashboard-user.service.d.ts +1 -1
- package/dist/file/file.controller.d.ts +1 -1
- package/dist/file/file.service.d.ts +1 -1
- package/dist/mail/mail.controller.d.ts +1 -1
- package/dist/mail/mail.service.d.ts +1 -1
- package/dist/mail-sent/mail-sent.controller.d.ts +1 -1
- package/dist/mail-sent/mail-sent.service.d.ts +1 -1
- package/dist/menu/dto/update.dto.d.ts +1 -0
- package/dist/menu/dto/update.dto.d.ts.map +1 -1
- package/dist/menu/dto/update.dto.js +4 -0
- package/dist/menu/dto/update.dto.js.map +1 -1
- package/dist/menu/menu.controller.d.ts +8 -20
- package/dist/menu/menu.controller.d.ts.map +1 -1
- package/dist/menu/menu.controller.js +37 -54
- package/dist/menu/menu.controller.js.map +1 -1
- package/dist/menu/menu.service.d.ts +10 -10
- package/dist/menu/menu.service.d.ts.map +1 -1
- package/dist/menu/menu.service.js +120 -10
- package/dist/menu/menu.service.js.map +1 -1
- package/dist/role/role.controller.d.ts +6 -6
- package/dist/role/role.controller.d.ts.map +1 -1
- package/dist/role/role.controller.js +8 -6
- package/dist/role/role.controller.js.map +1 -1
- package/dist/role/role.service.d.ts +6 -6
- package/dist/role/role.service.d.ts.map +1 -1
- package/dist/role/role.service.js +22 -4
- package/dist/role/role.service.js.map +1 -1
- package/dist/route/route.controller.d.ts +7 -7
- package/dist/route/route.controller.d.ts.map +1 -1
- package/dist/route/route.controller.js +20 -16
- package/dist/route/route.controller.js.map +1 -1
- package/dist/route/route.service.d.ts +7 -7
- package/dist/route/route.service.d.ts.map +1 -1
- package/dist/route/route.service.js +37 -5
- package/dist/route/route.service.js.map +1 -1
- package/dist/screen/screen.controller.d.ts +3 -3
- package/dist/screen/screen.service.d.ts +3 -3
- package/dist/setting/setting.controller.d.ts +3 -3
- package/dist/setting/setting.service.d.ts +3 -3
- package/hedhog/data/route.yaml +8 -0
- package/hedhog/data/setting_group.yaml +10 -1
- package/package.json +4 -4
- package/src/menu/dto/update.dto.ts +3 -0
- package/src/menu/menu.controller.ts +17 -32
- package/src/menu/menu.service.ts +157 -14
- package/src/role/role.controller.ts +4 -3
- package/src/role/role.service.ts +28 -4
- package/src/route/route.controller.ts +12 -11
- package/src/route/route.service.ts +49 -6
|
@@ -13,12 +13,12 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.RouteController = void 0;
|
|
16
|
+
const api_1 = require("@hed-hog/api");
|
|
17
|
+
const api_locale_1 = require("@hed-hog/api-locale");
|
|
16
18
|
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
17
19
|
const common_1 = require("@nestjs/common");
|
|
18
20
|
const delete_dto_1 = require("../dto/delete.dto");
|
|
19
21
|
const update_ids_dto_1 = require("../dto/update-ids.dto");
|
|
20
|
-
const api_locale_1 = require("@hed-hog/api-locale");
|
|
21
|
-
const api_1 = require("@hed-hog/api");
|
|
22
22
|
const create_dto_1 = require("./dto/create.dto");
|
|
23
23
|
const update_dto_1 = require("./dto/update.dto");
|
|
24
24
|
const route_service_1 = require("./route.service");
|
|
@@ -29,17 +29,17 @@ let RouteController = class RouteController {
|
|
|
29
29
|
async list(paginationParams) {
|
|
30
30
|
return this.routeService.list(paginationParams);
|
|
31
31
|
}
|
|
32
|
-
async get(routeId) {
|
|
33
|
-
return this.routeService.get(routeId);
|
|
32
|
+
async get(routeId, locale) {
|
|
33
|
+
return this.routeService.get(routeId, locale);
|
|
34
34
|
}
|
|
35
|
-
async create({ url, method }) {
|
|
36
|
-
return this.routeService.create({ url, method });
|
|
35
|
+
async create({ url, method }, locale) {
|
|
36
|
+
return this.routeService.create({ url, method }, locale);
|
|
37
37
|
}
|
|
38
|
-
async update(routeId, data) {
|
|
39
|
-
return this.routeService.update({ id: routeId, data });
|
|
38
|
+
async update(routeId, data, locale) {
|
|
39
|
+
return this.routeService.update({ id: routeId, data }, locale);
|
|
40
40
|
}
|
|
41
|
-
async delete(data) {
|
|
42
|
-
return this.routeService.delete(data);
|
|
41
|
+
async delete(data, locale) {
|
|
42
|
+
return this.routeService.delete(data, locale);
|
|
43
43
|
}
|
|
44
44
|
async listRoles(routeId, paginationParams, locale) {
|
|
45
45
|
return this.routeService.listRoles(locale, routeId, paginationParams);
|
|
@@ -65,30 +65,34 @@ __decorate([
|
|
|
65
65
|
__decorate([
|
|
66
66
|
(0, common_1.Get)(':routeId'),
|
|
67
67
|
__param(0, (0, common_1.Param)('routeId', common_1.ParseIntPipe)),
|
|
68
|
+
__param(1, (0, api_locale_1.Locale)()),
|
|
68
69
|
__metadata("design:type", Function),
|
|
69
|
-
__metadata("design:paramtypes", [Number]),
|
|
70
|
+
__metadata("design:paramtypes", [Number, Object]),
|
|
70
71
|
__metadata("design:returntype", Promise)
|
|
71
72
|
], RouteController.prototype, "get", null);
|
|
72
73
|
__decorate([
|
|
73
74
|
(0, common_1.Post)(),
|
|
74
75
|
__param(0, (0, common_1.Body)()),
|
|
76
|
+
__param(1, (0, api_locale_1.Locale)()),
|
|
75
77
|
__metadata("design:type", Function),
|
|
76
|
-
__metadata("design:paramtypes", [create_dto_1.CreateDTO]),
|
|
78
|
+
__metadata("design:paramtypes", [create_dto_1.CreateDTO, Object]),
|
|
77
79
|
__metadata("design:returntype", Promise)
|
|
78
80
|
], RouteController.prototype, "create", null);
|
|
79
81
|
__decorate([
|
|
80
82
|
(0, common_1.Patch)(':routeId'),
|
|
81
83
|
__param(0, (0, common_1.Param)('routeId', common_1.ParseIntPipe)),
|
|
82
84
|
__param(1, (0, common_1.Body)()),
|
|
85
|
+
__param(2, (0, api_locale_1.Locale)()),
|
|
83
86
|
__metadata("design:type", Function),
|
|
84
|
-
__metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
|
|
87
|
+
__metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO, Object]),
|
|
85
88
|
__metadata("design:returntype", Promise)
|
|
86
89
|
], RouteController.prototype, "update", null);
|
|
87
90
|
__decorate([
|
|
88
91
|
(0, common_1.Delete)(),
|
|
89
92
|
__param(0, (0, common_1.Body)()),
|
|
93
|
+
__param(1, (0, api_locale_1.Locale)()),
|
|
90
94
|
__metadata("design:type", Function),
|
|
91
|
-
__metadata("design:paramtypes", [delete_dto_1.DeleteDTO]),
|
|
95
|
+
__metadata("design:paramtypes", [delete_dto_1.DeleteDTO, Object]),
|
|
92
96
|
__metadata("design:returntype", Promise)
|
|
93
97
|
], RouteController.prototype, "delete", null);
|
|
94
98
|
__decorate([
|
|
@@ -109,7 +113,7 @@ __decorate([
|
|
|
109
113
|
__metadata("design:returntype", Promise)
|
|
110
114
|
], RouteController.prototype, "updateRoles", null);
|
|
111
115
|
__decorate([
|
|
112
|
-
(0, common_1.Get)(':routeId/
|
|
116
|
+
(0, common_1.Get)(':routeId/screen'),
|
|
113
117
|
__param(0, (0, common_1.Param)('routeId', common_1.ParseIntPipe)),
|
|
114
118
|
__param(1, (0, api_pagination_1.Pagination)()),
|
|
115
119
|
__param(2, (0, api_locale_1.Locale)()),
|
|
@@ -118,7 +122,7 @@ __decorate([
|
|
|
118
122
|
__metadata("design:returntype", Promise)
|
|
119
123
|
], RouteController.prototype, "listScreens", null);
|
|
120
124
|
__decorate([
|
|
121
|
-
(0, common_1.Patch)(':routeId/
|
|
125
|
+
(0, common_1.Patch)(':routeId/screen'),
|
|
122
126
|
__param(0, (0, common_1.Param)('routeId', common_1.ParseIntPipe)),
|
|
123
127
|
__param(1, (0, common_1.Body)()),
|
|
124
128
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.controller.js","sourceRoot":"","sources":["../../src/route/route.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4DAAoE;AACpE,2CAWwB;AACxB,kDAA8C;AAC9C,0DAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"route.controller.js","sourceRoot":"","sources":["../../src/route/route.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAoC;AACpC,oDAA6C;AAC7C,4DAAoE;AACpE,2CAWwB;AACxB,kDAA8C;AAC9C,0DAAqD;AACrD,iDAA6C;AAC7C,iDAA6C;AAC7C,mDAA+C;AAIxC,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAEmB,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAC1C,CAAC;IAGE,AAAN,KAAK,CAAC,IAAI,CAAe,gBAAgB;QACvC,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAClD,CAAC;IAGK,AAAN,KAAK,CAAC,GAAG,CAAiC,OAAe,EAAY,MAAM;QACzE,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,EAAE,GAAG,EAAE,MAAM,EAAa,EAAY,MAAM;QAC/D,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CACsB,OAAe,EACvC,IAAe,EACb,MAAM;QAEhB,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC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BAAY,CAAC,CAAC,CAAA;qCACR,4BAAY;GAHlC,eAAe,CAoE3B"}
|
|
@@ -15,15 +15,15 @@ export declare class RouteService {
|
|
|
15
15
|
pageSize: number;
|
|
16
16
|
prev: number;
|
|
17
17
|
next: number;
|
|
18
|
-
data: any;
|
|
18
|
+
data: any[];
|
|
19
19
|
}>;
|
|
20
|
-
get(routeId: number): Promise<any>;
|
|
21
|
-
create({ url, method }: CreateDTO): Promise<any>;
|
|
20
|
+
get(routeId: number, locale: string): Promise<any>;
|
|
21
|
+
create({ url, method }: CreateDTO, locale: string): Promise<any>;
|
|
22
22
|
update({ id, data }: {
|
|
23
23
|
id: number;
|
|
24
24
|
data: UpdateDTO;
|
|
25
|
-
}): Promise<any>;
|
|
26
|
-
delete({ ids }: DeleteDTO): Promise<{
|
|
25
|
+
}, locale: string): Promise<any>;
|
|
26
|
+
delete({ ids }: DeleteDTO, locale: string): Promise<{
|
|
27
27
|
count: number;
|
|
28
28
|
}>;
|
|
29
29
|
listRoles(locale: string, routeId: number, paginationParams: PaginationDTO): Promise<{
|
|
@@ -33,7 +33,7 @@ export declare class RouteService {
|
|
|
33
33
|
pageSize: number;
|
|
34
34
|
prev: number;
|
|
35
35
|
next: number;
|
|
36
|
-
data: any;
|
|
36
|
+
data: any[];
|
|
37
37
|
}>;
|
|
38
38
|
updateRoles(routeId: number, data: UpdateIdsDTO): Promise<{
|
|
39
39
|
count: number;
|
|
@@ -45,7 +45,7 @@ export declare class RouteService {
|
|
|
45
45
|
pageSize: number;
|
|
46
46
|
prev: number;
|
|
47
47
|
next: number;
|
|
48
|
-
data: any;
|
|
48
|
+
data: any[];
|
|
49
49
|
}>;
|
|
50
50
|
updateScreens(routeId: number, data: UpdateIdsDTO): Promise<{
|
|
51
51
|
count: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.service.d.ts","sourceRoot":"","sources":["../../src/route/route.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"route.service.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AAE,IAAI,EAAE,YAAY,GAAE,OAAO,CAAC;QAAC,KAAK,EAAC,MAAM,CAAA;KAAC,CAAC;IAgBxE,WAAW,CACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,aAAa;;;;;;;;;IAgC3B,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAE,OAAO,CAAC;QAAC,KAAK,EAAC,MAAM,CAAA;KAAC,CAAC;CAejF"}
|
|
@@ -13,6 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.RouteService = void 0;
|
|
16
|
+
const api_locale_1 = require("@hed-hog/api-locale");
|
|
16
17
|
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
17
18
|
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
18
19
|
const common_1 = require("@nestjs/common");
|
|
@@ -30,19 +31,50 @@ let RouteService = class RouteService {
|
|
|
30
31
|
},
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
async get(routeId) {
|
|
34
|
-
|
|
34
|
+
async get(routeId, locale) {
|
|
35
|
+
const route = await this.prismaService.route.findUnique({ where: { id: routeId } });
|
|
36
|
+
if (!route) {
|
|
37
|
+
throw new common_1.NotFoundException((0, api_locale_1.getLocaleText)('itemNotFound', locale, `Route with ID ${routeId} not found`).replace('{{item}}', 'Route'));
|
|
38
|
+
}
|
|
39
|
+
return route;
|
|
35
40
|
}
|
|
36
|
-
async create({ url, method }) {
|
|
41
|
+
async create({ url, method }, locale) {
|
|
42
|
+
const existingRoute = await this.prismaService.route.findFirst({
|
|
43
|
+
where: {
|
|
44
|
+
url,
|
|
45
|
+
method,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
if (existingRoute) {
|
|
49
|
+
throw new common_1.BadRequestException((0, api_locale_1.getLocaleText)('itemAlreadyExists', locale, `Route with URL ${url} and method ${method} already exists`).replace('{{item}}', 'Route'));
|
|
50
|
+
}
|
|
37
51
|
return this.prismaService.route.create({ data: { url, method } });
|
|
38
52
|
}
|
|
39
|
-
async update({ id, data }) {
|
|
53
|
+
async update({ id, data }, locale) {
|
|
54
|
+
const routeExists = await this.prismaService.route.findUnique({
|
|
55
|
+
where: { id },
|
|
56
|
+
});
|
|
57
|
+
if (!routeExists) {
|
|
58
|
+
throw new common_1.NotFoundException((0, api_locale_1.getLocaleText)('itemNotFound', locale, `Route with ID ${id} not found`).replace('{{item}}', 'Route'));
|
|
59
|
+
}
|
|
40
60
|
return this.prismaService.route.update({
|
|
41
61
|
where: { id },
|
|
42
62
|
data,
|
|
43
63
|
});
|
|
44
64
|
}
|
|
45
|
-
async delete({ ids }) {
|
|
65
|
+
async delete({ ids }, locale) {
|
|
66
|
+
const existingRoutes = await this.prismaService.route.findMany({
|
|
67
|
+
where: {
|
|
68
|
+
id: {
|
|
69
|
+
in: ids,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
if (existingRoutes.length !== ids.length) {
|
|
74
|
+
const existingIds = existingRoutes.map((route) => route.id);
|
|
75
|
+
const missingIds = ids.filter((id) => !existingIds.includes(id));
|
|
76
|
+
throw new common_1.NotFoundException((0, api_locale_1.getLocaleText)('itemsNotFound', locale, `Routes with IDs ${missingIds.join(', ')} not found`).replace('{{items}}', 'Routes'));
|
|
77
|
+
}
|
|
46
78
|
return this.prismaService.route.deleteMany({
|
|
47
79
|
where: {
|
|
48
80
|
id: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.service.js","sourceRoot":"","sources":["../../src/route/route.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4DAA2E;AAC3E,oDAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"route.service.js","sourceRoot":"","sources":["../../src/route/route.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAoD;AAC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CAAC,CAAC;IACL,CAAC;CACF,CAAA;AApMY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAGR,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;GAL5C,YAAY,CAoMxB"}
|
|
@@ -13,7 +13,7 @@ export declare class ScreenController {
|
|
|
13
13
|
pageSize: number;
|
|
14
14
|
prev: number;
|
|
15
15
|
next: number;
|
|
16
|
-
data: any;
|
|
16
|
+
data: any[];
|
|
17
17
|
}>;
|
|
18
18
|
listRoles(screenId: number, paginationParams: any, locale: any): Promise<{
|
|
19
19
|
total: any;
|
|
@@ -22,7 +22,7 @@ export declare class ScreenController {
|
|
|
22
22
|
pageSize: number;
|
|
23
23
|
prev: number;
|
|
24
24
|
next: number;
|
|
25
|
-
data: any;
|
|
25
|
+
data: any[];
|
|
26
26
|
}>;
|
|
27
27
|
listRoutes(screenId: number, paginationParams: any): Promise<{
|
|
28
28
|
total: any;
|
|
@@ -31,7 +31,7 @@ export declare class ScreenController {
|
|
|
31
31
|
pageSize: number;
|
|
32
32
|
prev: number;
|
|
33
33
|
next: number;
|
|
34
|
-
data: any;
|
|
34
|
+
data: any[];
|
|
35
35
|
}>;
|
|
36
36
|
updateRoles(screenId: number, data: UpdateIdsDTO): Promise<{
|
|
37
37
|
count: number;
|
|
@@ -21,7 +21,7 @@ export declare class ScreenService {
|
|
|
21
21
|
pageSize: number;
|
|
22
22
|
prev: number;
|
|
23
23
|
next: number;
|
|
24
|
-
data: any;
|
|
24
|
+
data: any[];
|
|
25
25
|
}>;
|
|
26
26
|
listRoles(locale: string, screenId: number, paginationParams: PaginationDTO): Promise<{
|
|
27
27
|
total: any;
|
|
@@ -30,7 +30,7 @@ export declare class ScreenService {
|
|
|
30
30
|
pageSize: number;
|
|
31
31
|
prev: number;
|
|
32
32
|
next: number;
|
|
33
|
-
data: any;
|
|
33
|
+
data: any[];
|
|
34
34
|
}>;
|
|
35
35
|
list(locale: string, paginationParams: PaginationDTO): Promise<{
|
|
36
36
|
total: any;
|
|
@@ -39,7 +39,7 @@ export declare class ScreenService {
|
|
|
39
39
|
pageSize: number;
|
|
40
40
|
prev: number;
|
|
41
41
|
next: number;
|
|
42
|
-
data: any;
|
|
42
|
+
data: any[];
|
|
43
43
|
}>;
|
|
44
44
|
get(screenId: number): Promise<{
|
|
45
45
|
id: number;
|
|
@@ -21,7 +21,7 @@ export declare class SettingsController {
|
|
|
21
21
|
pageSize: number;
|
|
22
22
|
prev: number;
|
|
23
23
|
next: number;
|
|
24
|
-
data: any;
|
|
24
|
+
data: any[];
|
|
25
25
|
}>;
|
|
26
26
|
listSettingGroups(paginationParams: any, locale: any): Promise<{
|
|
27
27
|
total: any;
|
|
@@ -30,7 +30,7 @@ export declare class SettingsController {
|
|
|
30
30
|
pageSize: number;
|
|
31
31
|
prev: number;
|
|
32
32
|
next: number;
|
|
33
|
-
data: any;
|
|
33
|
+
data: any[];
|
|
34
34
|
}>;
|
|
35
35
|
getUserSettings({ id }: {
|
|
36
36
|
id: any;
|
|
@@ -53,7 +53,7 @@ export declare class SettingsController {
|
|
|
53
53
|
pageSize: number;
|
|
54
54
|
prev: number;
|
|
55
55
|
next: number;
|
|
56
|
-
data: any;
|
|
56
|
+
data: any[];
|
|
57
57
|
}>;
|
|
58
58
|
get(settingId: number): Promise<{
|
|
59
59
|
value: string | null;
|
|
@@ -38,7 +38,7 @@ export declare class SettingService {
|
|
|
38
38
|
pageSize: number;
|
|
39
39
|
prev: number;
|
|
40
40
|
next: number;
|
|
41
|
-
data: any;
|
|
41
|
+
data: any[];
|
|
42
42
|
}>;
|
|
43
43
|
listSettingGroups(locale: string, paginationParams: PaginationDTO): Promise<{
|
|
44
44
|
total: any;
|
|
@@ -47,7 +47,7 @@ export declare class SettingService {
|
|
|
47
47
|
pageSize: number;
|
|
48
48
|
prev: number;
|
|
49
49
|
next: number;
|
|
50
|
-
data: any;
|
|
50
|
+
data: any[];
|
|
51
51
|
}>;
|
|
52
52
|
listSettings(locale: string, paginationParams: PaginationDTO): Promise<{
|
|
53
53
|
total: any;
|
|
@@ -56,7 +56,7 @@ export declare class SettingService {
|
|
|
56
56
|
pageSize: number;
|
|
57
57
|
prev: number;
|
|
58
58
|
next: number;
|
|
59
|
-
data: any;
|
|
59
|
+
data: any[];
|
|
60
60
|
}>;
|
|
61
61
|
get(settingId: number): Promise<{
|
|
62
62
|
value: string | null;
|
package/hedhog/data/route.yaml
CHANGED
|
@@ -36,6 +36,14 @@
|
|
|
36
36
|
slug: admin
|
|
37
37
|
- where:
|
|
38
38
|
slug: admin-access
|
|
39
|
+
- url: /sessions/revoke-all-other
|
|
40
|
+
method: DELETE
|
|
41
|
+
relations:
|
|
42
|
+
role:
|
|
43
|
+
- where:
|
|
44
|
+
slug: admin
|
|
45
|
+
- where:
|
|
46
|
+
slug: admin-access
|
|
39
47
|
- url: /sessions/:sessionId/revoke
|
|
40
48
|
method: DELETE
|
|
41
49
|
relations:
|
|
@@ -1070,7 +1070,7 @@
|
|
|
1070
1070
|
order: 1
|
|
1071
1071
|
- value: abs
|
|
1072
1072
|
order: 2
|
|
1073
|
-
- value:
|
|
1073
|
+
- value: gcs
|
|
1074
1074
|
order: 3
|
|
1075
1075
|
- slug: storage-accept-mimetype
|
|
1076
1076
|
type: array
|
|
@@ -1225,6 +1225,15 @@
|
|
|
1225
1225
|
en: The mail provider to use
|
|
1226
1226
|
pt: O provedor de email a utilizar
|
|
1227
1227
|
value: SES
|
|
1228
|
+
component: combobox
|
|
1229
|
+
relations:
|
|
1230
|
+
setting_list:
|
|
1231
|
+
- value: SMTP
|
|
1232
|
+
order: 0
|
|
1233
|
+
- value: GMAIL
|
|
1234
|
+
order: 1
|
|
1235
|
+
- value: SES
|
|
1236
|
+
order: 2
|
|
1228
1237
|
- slug: mail-from
|
|
1229
1238
|
type: string
|
|
1230
1239
|
name:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hed-hog/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.140",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"sharp": "^0.34.2",
|
|
30
30
|
"speakeasy": "^2.0.0",
|
|
31
31
|
"uuid": "^11.1.0",
|
|
32
|
-
"@hed-hog/api-
|
|
33
|
-
"@hed-hog/api-locale": "0.0.10",
|
|
32
|
+
"@hed-hog/api-locale": "0.0.11",
|
|
34
33
|
"@hed-hog/api-prisma": "0.0.4",
|
|
34
|
+
"@hed-hog/api-mail": "0.0.7",
|
|
35
35
|
"@hed-hog/types": "0.0.1",
|
|
36
|
-
"@hed-hog/api-pagination": "0.0.
|
|
36
|
+
"@hed-hog/api-pagination": "0.0.5",
|
|
37
37
|
"@hed-hog/api": "0.0.3"
|
|
38
38
|
},
|
|
39
39
|
"exports": {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Role, User } from '@hed-hog/api';
|
|
2
|
+
import { Locale } from '@hed-hog/api-locale';
|
|
1
3
|
import { Pagination } from '@hed-hog/api-pagination';
|
|
2
4
|
import {
|
|
3
5
|
Body,
|
|
@@ -13,8 +15,6 @@ import {
|
|
|
13
15
|
} from '@nestjs/common';
|
|
14
16
|
import { DeleteDTO } from '../dto/delete.dto';
|
|
15
17
|
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
|
16
|
-
import { Locale } from '@hed-hog/api-locale';
|
|
17
|
-
import { Role, User } from '@hed-hog/api';
|
|
18
18
|
import { CreateDTO } from './dto/create.dto';
|
|
19
19
|
import { OrderDTO } from './dto/order.dto';
|
|
20
20
|
import { UpdateDTO } from './dto/update.dto';
|
|
@@ -47,59 +47,44 @@ export class MenuController {
|
|
|
47
47
|
return this.menuService.listRoles(locale, menuId, paginationParams);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
@Get(':menuId/screen')
|
|
51
|
-
async listScreens(
|
|
52
|
-
@Param('menuId', ParseIntPipe) menuId: number,
|
|
53
|
-
@Pagination() paginationParams,
|
|
54
|
-
@Locale() locale,
|
|
55
|
-
) {
|
|
56
|
-
return this.menuService.listScreens(locale, menuId, paginationParams);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
50
|
@Patch(':menuId/role')
|
|
60
51
|
async updateRoles(
|
|
61
52
|
@Param('menuId', ParseIntPipe) menuId: number,
|
|
62
53
|
@Body() data: UpdateIdsDTO,
|
|
54
|
+
@Locale() locale,
|
|
63
55
|
) {
|
|
64
|
-
return this.menuService.updateRoles(menuId, data);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@Patch(':menuId/screen')
|
|
68
|
-
async updateScreens(
|
|
69
|
-
@Param('menuId', ParseIntPipe) menuId: number,
|
|
70
|
-
@Body() data: UpdateIdsDTO,
|
|
71
|
-
) {
|
|
72
|
-
return this.menuService.updateScreens(menuId, data);
|
|
56
|
+
return this.menuService.updateRoles(locale, menuId, data);
|
|
73
57
|
}
|
|
74
58
|
|
|
75
59
|
@Get(':menuId')
|
|
76
|
-
async show(@Param('menuId', ParseIntPipe) menuId: number) {
|
|
77
|
-
return this.menuService.get(menuId);
|
|
60
|
+
async show(@Locale() locale,@Param('menuId', ParseIntPipe) menuId: number) {
|
|
61
|
+
return this.menuService.get(locale, menuId);
|
|
78
62
|
}
|
|
79
63
|
|
|
80
64
|
@Post()
|
|
81
|
-
async create(@Body() data: CreateDTO) {
|
|
82
|
-
return this.menuService.create(data);
|
|
65
|
+
async create(@Locale() locale, @Body() data: CreateDTO) {
|
|
66
|
+
return this.menuService.create(locale,data);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@Patch('order')
|
|
70
|
+
async updateOrder(@Locale() locale, @Body() data: OrderDTO): Promise<void> {
|
|
71
|
+
return this.menuService.updateOrder(locale, data);
|
|
83
72
|
}
|
|
84
73
|
|
|
85
74
|
@Patch(':menuId')
|
|
86
75
|
async update(
|
|
76
|
+
@Locale() locale,
|
|
87
77
|
@Param('menuId', ParseIntPipe) menuId: number,
|
|
88
78
|
@Body() data: UpdateDTO,
|
|
89
79
|
) {
|
|
90
|
-
return this.menuService.update({
|
|
80
|
+
return this.menuService.update(locale,{
|
|
91
81
|
id: menuId,
|
|
92
82
|
data,
|
|
93
83
|
});
|
|
94
84
|
}
|
|
95
85
|
|
|
96
86
|
@Delete()
|
|
97
|
-
async delete(@Body() data: DeleteDTO) {
|
|
98
|
-
return this.menuService.delete(data);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@Patch('order')
|
|
102
|
-
async updateOrder(@Body() data: OrderDTO): Promise<void> {
|
|
103
|
-
return this.menuService.updateOrder(data);
|
|
87
|
+
async delete(@Locale() locale, @Body() data: DeleteDTO) {
|
|
88
|
+
return this.menuService.delete(locale, data);
|
|
104
89
|
}
|
|
105
90
|
}
|