@hedhog/admin 0.0.21 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +505 -93
- package/dist/admin.module.d.ts.map +1 -1
- package/dist/admin.module.js +13 -1
- package/dist/admin.module.js.map +1 -1
- package/dist/dto/delete.dto.d.ts.map +1 -0
- package/dist/dto/delete.dto.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/menu/menu.controller.d.ts +3 -3
- package/dist/menu/menu.controller.d.ts.map +1 -1
- package/dist/menu/menu.controller.js +9 -7
- package/dist/menu/menu.controller.js.map +1 -1
- package/dist/menu/menu.service.d.ts +3 -3
- package/dist/menu/menu.service.d.ts.map +1 -1
- package/dist/menu/menu.service.js +18 -10
- package/dist/menu/menu.service.js.map +1 -1
- package/dist/role/role.controller.d.ts +1 -1
- package/dist/role/role.controller.d.ts.map +1 -1
- package/dist/role/role.controller.js +5 -5
- package/dist/role/role.controller.js.map +1 -1
- package/dist/role/role.service.d.ts +5 -5
- package/dist/role/role.service.d.ts.map +1 -1
- package/dist/role/role.service.js +40 -12
- package/dist/role/role.service.js.map +1 -1
- package/dist/route/dto/create.dto.d.ts +6 -0
- package/dist/route/dto/create.dto.d.ts.map +1 -0
- package/dist/{menu/dto/delete.dto.js → route/dto/create.dto.js} +14 -10
- package/dist/route/dto/create.dto.js.map +1 -0
- package/dist/route/dto/update.dto.d.ts +6 -0
- package/dist/route/dto/update.dto.d.ts.map +1 -0
- package/dist/{user/dto/delete.dto.js → route/dto/update.dto.js} +16 -9
- package/dist/route/dto/update.dto.js.map +1 -0
- package/dist/route/route.controller.d.ts +20 -0
- package/dist/route/route.controller.d.ts.map +1 -0
- package/dist/route/route.controller.js +133 -0
- package/dist/route/route.controller.js.map +1 -0
- package/dist/route/route.module.d.ts +3 -0
- package/dist/route/route.module.d.ts.map +1 -0
- package/dist/route/route.module.js +31 -0
- package/dist/route/route.module.js.map +1 -0
- package/dist/route/route.service.d.ts +24 -0
- package/dist/route/route.service.d.ts.map +1 -0
- package/dist/route/route.service.js +121 -0
- package/dist/route/route.service.js.map +1 -0
- package/dist/screen/screen.controller.d.ts +1 -1
- package/dist/screen/screen.controller.d.ts.map +1 -1
- package/dist/screen/screen.controller.js +1 -1
- package/dist/screen/screen.controller.js.map +1 -1
- package/dist/screen/screen.service.d.ts +1 -1
- package/dist/screen/screen.service.d.ts.map +1 -1
- package/dist/screen/screen.service.js +12 -4
- package/dist/screen/screen.service.js.map +1 -1
- package/dist/setting/dto/create.dto.d.ts +4 -0
- package/dist/setting/dto/create.dto.d.ts.map +1 -0
- package/dist/{screen/dto/delete.dto.js → setting/dto/create.dto.js} +8 -9
- package/dist/setting/dto/create.dto.js.map +1 -0
- package/dist/setting/dto/update.dto.d.ts +4 -0
- package/dist/setting/dto/update.dto.d.ts.map +1 -0
- package/dist/setting/dto/update.dto.js +8 -0
- package/dist/setting/dto/update.dto.js.map +1 -0
- package/dist/setting/settings.controller.d.ts +14 -0
- package/dist/setting/settings.controller.d.ts.map +1 -0
- package/dist/setting/settings.controller.js +95 -0
- package/dist/setting/settings.controller.js.map +1 -0
- package/dist/setting/settings.module.d.ts +3 -0
- package/dist/setting/settings.module.d.ts.map +1 -0
- package/dist/setting/settings.module.js +31 -0
- package/dist/setting/settings.module.js.map +1 -0
- package/dist/setting/settings.service.d.ts +19 -0
- package/dist/setting/settings.service.d.ts.map +1 -0
- package/dist/setting/settings.service.js +70 -0
- package/dist/setting/settings.service.js.map +1 -0
- package/dist/types/http-method.d.ts +2 -0
- package/dist/types/http-method.d.ts.map +1 -0
- package/dist/types/http-method.js +3 -0
- package/dist/types/http-method.js.map +1 -0
- package/dist/user/user.controller.d.ts +1 -1
- package/dist/user/user.controller.d.ts.map +1 -1
- package/dist/user/user.controller.js +1 -1
- package/dist/user/user.controller.js.map +1 -1
- package/dist/user/user.service.d.ts +1 -1
- package/dist/user/user.service.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/migrations/migrate-02.ts +12 -0
- package/src/migrations/migrate-03.ts +18 -2
- package/src/migrations/migrate-04.ts +52 -0
- package/src/migrations/migrate-12.ts +16 -0
- package/src/migrations/migrate-17.ts +78 -0
- package/dist/auth/auth.service.spec.d.ts +0 -2
- package/dist/auth/auth.service.spec.d.ts.map +0 -1
- package/dist/auth/auth.service.spec.js +0 -17
- package/dist/auth/auth.service.spec.js.map +0 -1
- package/dist/menu/dto/delete.dto.d.ts.map +0 -1
- package/dist/menu/dto/delete.dto.js.map +0 -1
- package/dist/role/dto/delete.dto.d.ts +0 -4
- package/dist/role/dto/delete.dto.d.ts.map +0 -1
- package/dist/role/dto/delete.dto.js.map +0 -1
- package/dist/screen/dto/delete.dto.d.ts +0 -4
- package/dist/screen/dto/delete.dto.d.ts.map +0 -1
- package/dist/screen/dto/delete.dto.js.map +0 -1
- package/dist/user/dto/delete.dto.d.ts +0 -4
- package/dist/user/dto/delete.dto.d.ts.map +0 -1
- package/dist/user/dto/delete.dto.js.map +0 -1
- /package/dist/{menu/dto → dto}/delete.dto.d.ts +0 -0
- /package/dist/{role/dto → dto}/delete.dto.js +0 -0
@@ -0,0 +1,133 @@
|
|
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.RouteController = void 0;
|
16
|
+
const common_1 = require("@nestjs/common");
|
17
|
+
const role_decorator_1 = require("../role/decorators/role.decorator");
|
18
|
+
const auth_guard_1 = require("../auth/guards/auth.guard");
|
19
|
+
const pagination_1 = require("@hedhog/pagination");
|
20
|
+
const route_service_1 = require("./route.service");
|
21
|
+
const create_dto_1 = require("./dto/create.dto");
|
22
|
+
const update_dto_1 = require("./dto/update.dto");
|
23
|
+
const delete_dto_1 = require("../dto/delete.dto");
|
24
|
+
const update_ids_dto_1 = require("../dto/update-ids.dto");
|
25
|
+
let RouteController = class RouteController {
|
26
|
+
constructor(routeService) {
|
27
|
+
this.routeService = routeService;
|
28
|
+
}
|
29
|
+
async getRoutes(paginationParams) {
|
30
|
+
return this.routeService.getRoutes(paginationParams);
|
31
|
+
}
|
32
|
+
async getRouteById(routeId) {
|
33
|
+
return this.routeService.getRouteById(routeId);
|
34
|
+
}
|
35
|
+
async create({ url, method }) {
|
36
|
+
return this.routeService.create({ url, method });
|
37
|
+
}
|
38
|
+
async update(routeId, data) {
|
39
|
+
return this.routeService.update({ id: routeId, data });
|
40
|
+
}
|
41
|
+
async delete(data) {
|
42
|
+
return this.routeService.delete(data);
|
43
|
+
}
|
44
|
+
async listRoles(routeId, paginationParams) {
|
45
|
+
return this.routeService.listRoles(routeId, paginationParams);
|
46
|
+
}
|
47
|
+
async updateRoles(routeId, data) {
|
48
|
+
return this.routeService.updateRoles(routeId, data);
|
49
|
+
}
|
50
|
+
async listScreens(routeId, paginationParams) {
|
51
|
+
return this.routeService.listScreens(routeId, paginationParams);
|
52
|
+
}
|
53
|
+
async updateScreens(routeId, data) {
|
54
|
+
return this.routeService.updateScreens(routeId, data);
|
55
|
+
}
|
56
|
+
};
|
57
|
+
exports.RouteController = RouteController;
|
58
|
+
__decorate([
|
59
|
+
(0, common_1.Get)(),
|
60
|
+
__param(0, (0, pagination_1.Pagination)()),
|
61
|
+
__metadata("design:type", Function),
|
62
|
+
__metadata("design:paramtypes", [Object]),
|
63
|
+
__metadata("design:returntype", Promise)
|
64
|
+
], RouteController.prototype, "getRoutes", null);
|
65
|
+
__decorate([
|
66
|
+
(0, common_1.Get)(':routeId'),
|
67
|
+
__param(0, (0, common_1.Param)('routeId', common_1.ParseIntPipe)),
|
68
|
+
__metadata("design:type", Function),
|
69
|
+
__metadata("design:paramtypes", [Number]),
|
70
|
+
__metadata("design:returntype", Promise)
|
71
|
+
], RouteController.prototype, "getRouteById", null);
|
72
|
+
__decorate([
|
73
|
+
(0, common_1.Post)(),
|
74
|
+
__param(0, (0, common_1.Body)()),
|
75
|
+
__metadata("design:type", Function),
|
76
|
+
__metadata("design:paramtypes", [create_dto_1.CreateDTO]),
|
77
|
+
__metadata("design:returntype", Promise)
|
78
|
+
], RouteController.prototype, "create", null);
|
79
|
+
__decorate([
|
80
|
+
(0, common_1.Patch)(':routeId'),
|
81
|
+
__param(0, (0, common_1.Param)('routeId', common_1.ParseIntPipe)),
|
82
|
+
__param(1, (0, common_1.Body)()),
|
83
|
+
__metadata("design:type", Function),
|
84
|
+
__metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
|
85
|
+
__metadata("design:returntype", Promise)
|
86
|
+
], RouteController.prototype, "update", null);
|
87
|
+
__decorate([
|
88
|
+
(0, common_1.Delete)(),
|
89
|
+
__param(0, (0, common_1.Body)()),
|
90
|
+
__metadata("design:type", Function),
|
91
|
+
__metadata("design:paramtypes", [delete_dto_1.DeleteDTO]),
|
92
|
+
__metadata("design:returntype", Promise)
|
93
|
+
], RouteController.prototype, "delete", null);
|
94
|
+
__decorate([
|
95
|
+
(0, common_1.Get)(':routeId/roles'),
|
96
|
+
__param(0, (0, common_1.Param)('routeId', common_1.ParseIntPipe)),
|
97
|
+
__param(1, (0, pagination_1.Pagination)()),
|
98
|
+
__metadata("design:type", Function),
|
99
|
+
__metadata("design:paramtypes", [Number, pagination_1.PaginationDTO]),
|
100
|
+
__metadata("design:returntype", Promise)
|
101
|
+
], RouteController.prototype, "listRoles", null);
|
102
|
+
__decorate([
|
103
|
+
(0, common_1.Patch)(':routeId/roles'),
|
104
|
+
__param(0, (0, common_1.Param)('routeId', common_1.ParseIntPipe)),
|
105
|
+
__param(1, (0, common_1.Body)()),
|
106
|
+
__metadata("design:type", Function),
|
107
|
+
__metadata("design:paramtypes", [Number, update_ids_dto_1.UpdateIdsDTO]),
|
108
|
+
__metadata("design:returntype", Promise)
|
109
|
+
], RouteController.prototype, "updateRoles", null);
|
110
|
+
__decorate([
|
111
|
+
(0, common_1.Get)(':routeId/screens'),
|
112
|
+
__param(0, (0, common_1.Param)('routeId', common_1.ParseIntPipe)),
|
113
|
+
__param(1, (0, pagination_1.Pagination)()),
|
114
|
+
__metadata("design:type", Function),
|
115
|
+
__metadata("design:paramtypes", [Number, pagination_1.PaginationDTO]),
|
116
|
+
__metadata("design:returntype", Promise)
|
117
|
+
], RouteController.prototype, "listScreens", null);
|
118
|
+
__decorate([
|
119
|
+
(0, common_1.Patch)(':routeId/screens'),
|
120
|
+
__param(0, (0, common_1.Param)('routeId', common_1.ParseIntPipe)),
|
121
|
+
__param(1, (0, common_1.Body)()),
|
122
|
+
__metadata("design:type", Function),
|
123
|
+
__metadata("design:paramtypes", [Number, update_ids_dto_1.UpdateIdsDTO]),
|
124
|
+
__metadata("design:returntype", Promise)
|
125
|
+
], RouteController.prototype, "updateScreens", null);
|
126
|
+
exports.RouteController = RouteController = __decorate([
|
127
|
+
(0, role_decorator_1.Role)(),
|
128
|
+
(0, common_1.UseGuards)(auth_guard_1.AuthGuard),
|
129
|
+
(0, common_1.Controller)('routes'),
|
130
|
+
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => route_service_1.RouteService))),
|
131
|
+
__metadata("design:paramtypes", [route_service_1.RouteService])
|
132
|
+
], RouteController);
|
133
|
+
//# sourceMappingURL=route.controller.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.controller.js","sourceRoot":"","sources":["../../src/route/route.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,sEAAyD;AACzD,0DAAsD;AACtD,mDAA+D;AAC/D,mDAA+C;AAC/C,iDAA6C;AAC7C,iDAA6C;AAC7C,kDAA8C;AAC9C,0DAAqD;AAK9C,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAEmB,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAC1C,CAAC;IAGE,AAAN,KAAK,CAAC,SAAS,CAAe,gBAAgB;QAC5C,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACvD,CAAC;IAGK,AAAN,KAAK,CAAC,YAAY,CAAiC,OAAe;QAChE,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,EAAE,GAAG,EAAE,MAAM,EAAa;QAC7C,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IACnD,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CACsB,OAAe,EACvC,IAAe;QAEvB,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,IAAe;QAClC,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CACmB,OAAe,EACjC,gBAA+B;QAE7C,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;I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B,WAAA,IAAA,cAAK,EAAC,SAAS,EAAE,qBAAY,CAAC,CAAA;IAC9B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,6BAAY;;kDAG3B;AAGK;IADL,IAAA,YAAG,EAAC,kBAAkB,CAAC;IAErB,WAAA,IAAA,cAAK,EAAC,SAAS,EAAE,qBAAY,CAAC,CAAA;IAC9B,WAAA,IAAA,uBAAU,GAAE,CAAA;;6CAAmB,0BAAa;;kDAG9C;AAGK;IADL,IAAA,cAAK,EAAC,kBAAkB,CAAC;IAEvB,WAAA,IAAA,cAAK,EAAC,SAAS,EAAE,qBAAY,CAAC,CAAA;IAC9B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,6BAAY;;oDAG3B;0BAhEU,eAAe;IAH3B,IAAA,qBAAI,GAAE;IACN,IAAA,kBAAS,EAAC,sBAAS,CAAC;IACpB,IAAA,mBAAU,EAAC,QAAQ,CAAC;IAGhB,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4BAAY,CAAC,CAAC,CAAA;qCACR,4BAAY;GAHlC,eAAe,CAiE3B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.module.d.ts","sourceRoot":"","sources":["../../src/route/route.module.ts"],"names":[],"mappings":"AAOA,qBAUa,WAAW;CAAG"}
|
@@ -0,0 +1,31 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
9
|
+
exports.RouteModule = void 0;
|
10
|
+
const pagination_1 = require("@hedhog/pagination");
|
11
|
+
const prisma_1 = require("@hedhog/prisma");
|
12
|
+
const common_1 = require("@nestjs/common");
|
13
|
+
const route_controller_1 = require("./route.controller");
|
14
|
+
const route_service_1 = require("./route.service");
|
15
|
+
const auth_module_1 = require("../auth/auth.module");
|
16
|
+
let RouteModule = class RouteModule {
|
17
|
+
};
|
18
|
+
exports.RouteModule = RouteModule;
|
19
|
+
exports.RouteModule = RouteModule = __decorate([
|
20
|
+
(0, common_1.Module)({
|
21
|
+
providers: [route_service_1.RouteService],
|
22
|
+
exports: [route_service_1.RouteService],
|
23
|
+
controllers: [route_controller_1.RouteController],
|
24
|
+
imports: [
|
25
|
+
(0, common_1.forwardRef)(() => auth_module_1.AuthModule),
|
26
|
+
(0, common_1.forwardRef)(() => prisma_1.PrismaModule),
|
27
|
+
(0, common_1.forwardRef)(() => pagination_1.PaginationModule),
|
28
|
+
],
|
29
|
+
})
|
30
|
+
], RouteModule);
|
31
|
+
//# sourceMappingURL=route.module.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.module.js","sourceRoot":"","sources":["../../src/route/route.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAsD;AACtD,2CAA8C;AAC9C,2CAAoD;AACpD,yDAAqD;AACrD,mDAA+C;AAC/C,qDAAiD;AAY1C,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IAVvB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,4BAAY,CAAC;QACzB,OAAO,EAAE,CAAC,4BAAY,CAAC;QACvB,WAAW,EAAE,CAAC,kCAAe,CAAC;QAC9B,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,6BAAgB,CAAC;SACnC;KACF,CAAC;GACW,WAAW,CAAG"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { PaginationDTO, PaginationService } from '@hedhog/pagination';
|
2
|
+
import { PrismaService } from '@hedhog/prisma';
|
3
|
+
import { UpdateDTO } from './dto/update.dto';
|
4
|
+
import { CreateDTO } from './dto/create.dto';
|
5
|
+
import { DeleteDTO } from '../dto/delete.dto';
|
6
|
+
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
7
|
+
export declare class RouteService {
|
8
|
+
private readonly prismaService;
|
9
|
+
private readonly paginationService;
|
10
|
+
constructor(prismaService: PrismaService, paginationService: PaginationService);
|
11
|
+
getRoutes(paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
12
|
+
getRouteById(routeId: number): Promise<any>;
|
13
|
+
create({ url, method }: CreateDTO): Promise<any>;
|
14
|
+
update({ id, data }: {
|
15
|
+
id: number;
|
16
|
+
data: UpdateDTO;
|
17
|
+
}): Promise<any>;
|
18
|
+
delete({ ids }: DeleteDTO): Promise<any>;
|
19
|
+
listRoles(routeId: number, paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
20
|
+
updateRoles(routeId: number, data: UpdateIdsDTO): Promise<any>;
|
21
|
+
listScreens(routeId: number, paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
22
|
+
updateScreens(routeId: number, data: UpdateIdsDTO): Promise<any>;
|
23
|
+
}
|
24
|
+
//# sourceMappingURL=route.service.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.service.d.ts","sourceRoot":"","sources":["../../src/route/route.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBACa,YAAY;IAGrB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,SAAS,CAAC,gBAAgB,EAAE,aAAa;IAmBzC,YAAY,CAAC,OAAO,EAAE,MAAM;IAI5B,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,SAAS;IAIjC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;IAOpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;IAUzB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IAoB1D,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;IAgB/C,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IAoB5D,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;CAexD"}
|
@@ -0,0 +1,121 @@
|
|
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.RouteService = void 0;
|
16
|
+
const pagination_1 = require("@hedhog/pagination");
|
17
|
+
const prisma_1 = require("@hedhog/prisma");
|
18
|
+
const common_1 = require("@nestjs/common");
|
19
|
+
let RouteService = class RouteService {
|
20
|
+
constructor(prismaService, paginationService) {
|
21
|
+
this.prismaService = prismaService;
|
22
|
+
this.paginationService = paginationService;
|
23
|
+
}
|
24
|
+
async getRoutes(paginationParams) {
|
25
|
+
const fields = ['url', 'method'];
|
26
|
+
const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
|
27
|
+
return this.paginationService.paginate(this.prismaService.routes, paginationParams, {
|
28
|
+
where: {
|
29
|
+
OR,
|
30
|
+
},
|
31
|
+
});
|
32
|
+
}
|
33
|
+
async getRouteById(routeId) {
|
34
|
+
return this.prismaService.routes.findUnique({ where: { id: routeId } });
|
35
|
+
}
|
36
|
+
async create({ url, method }) {
|
37
|
+
return this.prismaService.routes.create({ data: { url, method } });
|
38
|
+
}
|
39
|
+
async update({ id, data }) {
|
40
|
+
return this.prismaService.routes.update({
|
41
|
+
where: { id },
|
42
|
+
data,
|
43
|
+
});
|
44
|
+
}
|
45
|
+
async delete({ ids }) {
|
46
|
+
return this.prismaService.routes.deleteMany({
|
47
|
+
where: {
|
48
|
+
id: {
|
49
|
+
in: ids,
|
50
|
+
},
|
51
|
+
},
|
52
|
+
});
|
53
|
+
}
|
54
|
+
async listRoles(routeId, paginationParams) {
|
55
|
+
return this.paginationService.paginate(this.prismaService.roles, paginationParams, {
|
56
|
+
include: {
|
57
|
+
role_routes: {
|
58
|
+
where: {
|
59
|
+
route_id: routeId,
|
60
|
+
},
|
61
|
+
select: {
|
62
|
+
route_id: true,
|
63
|
+
role_id: true,
|
64
|
+
},
|
65
|
+
},
|
66
|
+
},
|
67
|
+
});
|
68
|
+
}
|
69
|
+
async updateRoles(routeId, data) {
|
70
|
+
await this.prismaService.role_routes.deleteMany({
|
71
|
+
where: {
|
72
|
+
route_id: routeId,
|
73
|
+
},
|
74
|
+
});
|
75
|
+
return this.prismaService.role_routes.createMany({
|
76
|
+
data: data.ids.map((roleId) => ({
|
77
|
+
role_id: roleId,
|
78
|
+
route_id: routeId,
|
79
|
+
})),
|
80
|
+
skipDuplicates: true,
|
81
|
+
});
|
82
|
+
}
|
83
|
+
async listScreens(routeId, paginationParams) {
|
84
|
+
return this.paginationService.paginate(this.prismaService.screens, paginationParams, {
|
85
|
+
include: {
|
86
|
+
route_screens: {
|
87
|
+
where: {
|
88
|
+
route_id: routeId,
|
89
|
+
},
|
90
|
+
select: {
|
91
|
+
route_id: true,
|
92
|
+
screen_id: true,
|
93
|
+
},
|
94
|
+
},
|
95
|
+
},
|
96
|
+
});
|
97
|
+
}
|
98
|
+
async updateScreens(routeId, data) {
|
99
|
+
await this.prismaService.route_screens.deleteMany({
|
100
|
+
where: {
|
101
|
+
route_id: routeId,
|
102
|
+
},
|
103
|
+
});
|
104
|
+
return this.prismaService.route_screens.createMany({
|
105
|
+
data: data.ids.map((screenId) => ({
|
106
|
+
screen_id: screenId,
|
107
|
+
route_id: routeId,
|
108
|
+
})),
|
109
|
+
skipDuplicates: true,
|
110
|
+
});
|
111
|
+
}
|
112
|
+
};
|
113
|
+
exports.RouteService = RouteService;
|
114
|
+
exports.RouteService = RouteService = __decorate([
|
115
|
+
(0, common_1.Injectable)(),
|
116
|
+
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => prisma_1.PrismaService))),
|
117
|
+
__param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => pagination_1.PaginationService))),
|
118
|
+
__metadata("design:paramtypes", [prisma_1.PrismaService,
|
119
|
+
pagination_1.PaginationService])
|
120
|
+
], RouteService);
|
121
|
+
//# sourceMappingURL=route.service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.service.js","sourceRoot":"","sources":["../../src/route/route.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAAgE;AAOzD,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,SAAS,CAAC,gBAA+B;QAC7C,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAEjC,MAAM,EAAE,GAAU,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAC1D,MAAM,EACN,gBAAgB,CACjB,CAAC;QAEF,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CACpC,IAAI,CAAC,aAAa,CAAC,MAAM,EACzB,gBAAgB,EAChB;YACE,KAAK,EAAE;gBACL,EAAE;aACH;SACF,CACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAe;QAChC,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,EAAa;QACrC,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,CA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from './dto/update.dto';
|
4
4
|
import { ScreenService } from './screen.service';
|
5
5
|
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.controller.d.ts","sourceRoot":"","sources":["../../src/screen/screen.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"screen.controller.d.ts","sourceRoot":"","sources":["../../src/screen/screen.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAGa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAIzC,UAAU,CAAe,gBAAgB,KAAA;IAKzC,SAAS,CACoB,QAAQ,EAAE,MAAM,EACnC,gBAAgB,KAAA;IAM1B,UAAU,CACmB,QAAQ,EAAE,MAAM,EACnC,gBAAgB,KAAA;IAM1B,WAAW,CACkB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,YAAY;IAMtB,YAAY,CACiB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,YAAY;IAMtB,IAAI,CAAkC,QAAQ,EAAE,MAAM;IAK5D,MAAM,CAAS,IAAI,EAAE,SAAS;IAKxB,MAAM,CACuB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,SAAS;IASnB,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
|
@@ -16,7 +16,7 @@ exports.ScreenController = void 0;
|
|
16
16
|
const pagination_1 = require("@hedhog/pagination");
|
17
17
|
const common_1 = require("@nestjs/common");
|
18
18
|
const create_dto_1 = require("./dto/create.dto");
|
19
|
-
const delete_dto_1 = require("
|
19
|
+
const delete_dto_1 = require("../dto/delete.dto");
|
20
20
|
const update_dto_1 = require("./dto/update.dto");
|
21
21
|
const screen_service_1 = require("./screen.service");
|
22
22
|
const auth_guard_1 = require("../auth/guards/auth.guard");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.controller.js","sourceRoot":"","sources":["../../src/screen/screen.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAYwB;AACxB,iDAA6C;AAC7C,
|
1
|
+
{"version":3,"file":"screen.controller.js","sourceRoot":"","sources":["../../src/screen/screen.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAYwB;AACxB,iDAA6C;AAC7C,kDAA8C;AAC9C,iDAA6C;AAC7C,qDAAiD;AACjD,0DAAsD;AACtD,sEAAyD;AACzD,0DAAqD;AAK9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAEmB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAGE,AAAN,KAAK,CAAC,UAAU,CAAe,gBAAgB;QAC7C,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACzD,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CACoB,QAAgB,EACnC,gBAAgB;QAE9B,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IAClE,CAAC;IAGK,AAAN,KAAK,CAAC,UAAU,CACmB,QAAgB,EACnC,gBAAgB;QAE9B,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IACnE,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CACkB,QAAgB,E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AEtB,WAAA,IAAA,cAAK,EAAC,UAAU,EAAE,qBAAY,CAAC,CAAA;IAC/B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,6BAAY;;mDAG3B;AAGK;IADL,IAAA,cAAK,EAAC,kBAAkB,CAAC;IAEvB,WAAA,IAAA,cAAK,EAAC,UAAU,EAAE,qBAAY,CAAC,CAAA;IAC/B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,6BAAY;;oDAG3B;AAGK;IADL,IAAA,YAAG,EAAC,WAAW,CAAC;IACL,WAAA,IAAA,cAAK,EAAC,UAAU,EAAE,qBAAY,CAAC,CAAA;;;;4CAE1C;AAGD;IADC,IAAA,aAAI,GAAE;IACC,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;8CAE7B;AAGK;IADL,IAAA,cAAK,EAAC,WAAW,CAAC;IAEhB,WAAA,IAAA,cAAK,EAAC,UAAU,EAAE,qBAAY,CAAC,CAAA;IAC/B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,sBAAS;;8CAMxB;AAGK;IADL,IAAA,eAAM,GAAE;IACK,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;8CAEnC;2BAnEU,gBAAgB;IAH5B,IAAA,qBAAI,GAAE;IACN,IAAA,kBAAS,EAAC,sBAAS,CAAC;IACpB,IAAA,mBAAU,EAAC,SAAS,CAAC;IAGjB,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAa,CAAC,CAAC,CAAA;qCACR,8BAAa;GAHpC,gBAAgB,CAoE5B"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { PaginationDTO, PaginationService } from '@hedhog/pagination';
|
2
2
|
import { PrismaService } from '@hedhog/prisma';
|
3
3
|
import { CreateDTO } from './dto/create.dto';
|
4
|
-
import { DeleteDTO } from '
|
4
|
+
import { DeleteDTO } from '../dto/delete.dto';
|
5
5
|
import { UpdateDTO } from './dto/update.dto';
|
6
6
|
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
7
7
|
export declare class ScreenService {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.service.d.ts","sourceRoot":"","sources":["../../src/screen/screen.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"screen.service.d.ts","sourceRoot":"","sources":["../../src/screen/screen.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBACa,aAAa;IAGtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;IAehD,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,YAAY;IA4BpD,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IAoB5D,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IAoB3D,UAAU,CAAC,gBAAgB,EAAE,aAAa;IAkB1C,GAAG,CAAC,QAAQ,EAAE,MAAM;IAIpB,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,SAAS;IAWnD,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;IAOpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;CAehC"}
|
@@ -61,22 +61,30 @@ let ScreenService = class ScreenService {
|
|
61
61
|
}
|
62
62
|
async listRoutes(screenId, paginationParams) {
|
63
63
|
return this.paginationService.paginate(this.prismaService.routes, paginationParams, {
|
64
|
-
|
64
|
+
include: {
|
65
65
|
route_screens: {
|
66
|
-
|
66
|
+
where: {
|
67
67
|
screen_id: screenId,
|
68
68
|
},
|
69
|
+
select: {
|
70
|
+
route_id: true,
|
71
|
+
screen_id: true,
|
72
|
+
},
|
69
73
|
},
|
70
74
|
},
|
71
75
|
});
|
72
76
|
}
|
73
77
|
async listRoles(screenId, paginationParams) {
|
74
78
|
return this.paginationService.paginate(this.prismaService.roles, paginationParams, {
|
75
|
-
|
79
|
+
include: {
|
76
80
|
role_screens: {
|
77
|
-
|
81
|
+
where: {
|
78
82
|
screen_id: screenId,
|
79
83
|
},
|
84
|
+
select: {
|
85
|
+
role_id: true,
|
86
|
+
screen_id: true,
|
87
|
+
},
|
80
88
|
},
|
81
89
|
},
|
82
90
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.service.js","sourceRoot":"","sources":["../../src/screen/screen.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAOjB,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAi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AAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sBAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAiB,CAAC,CAAC,CAAA;qCADZ,sBAAa;QAET,8BAAiB;GAL5C,aAAa,CAkJzB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../src/setting/dto/create.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAGpB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
@@ -9,15 +9,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.
|
12
|
+
exports.CreateDTO = void 0;
|
13
13
|
const class_validator_1 = require("class-validator");
|
14
|
-
class
|
14
|
+
class CreateDTO {
|
15
15
|
}
|
16
|
-
exports.
|
16
|
+
exports.CreateDTO = CreateDTO;
|
17
17
|
__decorate([
|
18
|
-
(0, class_validator_1.
|
19
|
-
(0, class_validator_1.
|
20
|
-
(
|
21
|
-
|
22
|
-
|
23
|
-
//# sourceMappingURL=delete.dto.js.map
|
18
|
+
(0, class_validator_1.IsString)({ message: 'O nome deve ser uma string' }),
|
19
|
+
(0, class_validator_1.IsNotEmpty)({ message: 'O nome é obrigatório.' }),
|
20
|
+
__metadata("design:type", String)
|
21
|
+
], CreateDTO.prototype, "name", void 0);
|
22
|
+
//# sourceMappingURL=create.dto.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../src/setting/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAEvD,MAAa,SAAS;CAIrB;AAJD,8BAIC;AADC;IAFC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;IACnD,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;;uCACpC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../src/setting/dto/update.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBAAa,SAAU,SAAQ,SAAS;CAAG"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.UpdateDTO = void 0;
|
4
|
+
const create_dto_1 = require("./create.dto");
|
5
|
+
class UpdateDTO extends create_dto_1.CreateDTO {
|
6
|
+
}
|
7
|
+
exports.UpdateDTO = UpdateDTO;
|
8
|
+
//# sourceMappingURL=update.dto.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../src/setting/dto/update.dto.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,MAAa,SAAU,SAAQ,sBAAS;CAAG;AAA3C,8BAA2C"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { CreateDTO } from './dto/create.dto';
|
2
|
+
import { DeleteDTO } from '../dto/delete.dto';
|
3
|
+
import { UpdateDTO } from './dto/update.dto';
|
4
|
+
import { SettingsService } from './settings.service';
|
5
|
+
export declare class SettingsController {
|
6
|
+
private readonly settingsService;
|
7
|
+
constructor(settingsService: SettingsService);
|
8
|
+
getSettings(paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
9
|
+
show(settingId: number): Promise<any>;
|
10
|
+
create(data: CreateDTO): Promise<any>;
|
11
|
+
update(settingId: number, data: UpdateDTO): Promise<any>;
|
12
|
+
delete(data: DeleteDTO): Promise<any>;
|
13
|
+
}
|
14
|
+
//# sourceMappingURL=settings.controller.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"settings.controller.d.ts","sourceRoot":"","sources":["../../src/setting/settings.controller.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAEa,kBAAkB;IAG3B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAK7C,WAAW,CAAe,gBAAgB,KAAA;IAM1C,IAAI,CAAmC,SAAS,EAAE,MAAM;IAM9D,MAAM,CAAS,IAAI,EAAE,SAAS;IAMxB,MAAM,CACwB,SAAS,EAAE,MAAM,EAC3C,IAAI,EAAE,SAAS;IAUnB,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
|
@@ -0,0 +1,95 @@
|
|
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.SettingsController = void 0;
|
16
|
+
const pagination_1 = require("@hedhog/pagination");
|
17
|
+
const common_1 = require("@nestjs/common");
|
18
|
+
const auth_guard_1 = require("../auth/guards/auth.guard");
|
19
|
+
const role_decorator_1 = require("../role/decorators/role.decorator");
|
20
|
+
const create_dto_1 = require("./dto/create.dto");
|
21
|
+
const delete_dto_1 = require("../dto/delete.dto");
|
22
|
+
const update_dto_1 = require("./dto/update.dto");
|
23
|
+
const settings_service_1 = require("./settings.service");
|
24
|
+
let SettingsController = class SettingsController {
|
25
|
+
constructor(settingsService) {
|
26
|
+
this.settingsService = settingsService;
|
27
|
+
}
|
28
|
+
async getSettings(paginationParams) {
|
29
|
+
return this.settingsService.getSettings(paginationParams);
|
30
|
+
}
|
31
|
+
async show(settingId) {
|
32
|
+
return this.settingsService.get(settingId);
|
33
|
+
}
|
34
|
+
create(data) {
|
35
|
+
return this.settingsService.create(data);
|
36
|
+
}
|
37
|
+
async update(settingId, data) {
|
38
|
+
return this.settingsService.update({
|
39
|
+
id: settingId,
|
40
|
+
data,
|
41
|
+
});
|
42
|
+
}
|
43
|
+
async delete(data) {
|
44
|
+
return this.settingsService.delete(data);
|
45
|
+
}
|
46
|
+
};
|
47
|
+
exports.SettingsController = SettingsController;
|
48
|
+
__decorate([
|
49
|
+
(0, common_1.UseGuards)(auth_guard_1.AuthGuard),
|
50
|
+
(0, common_1.Get)(),
|
51
|
+
__param(0, (0, pagination_1.Pagination)()),
|
52
|
+
__metadata("design:type", Function),
|
53
|
+
__metadata("design:paramtypes", [Object]),
|
54
|
+
__metadata("design:returntype", Promise)
|
55
|
+
], SettingsController.prototype, "getSettings", null);
|
56
|
+
__decorate([
|
57
|
+
(0, common_1.UseGuards)(auth_guard_1.AuthGuard),
|
58
|
+
(0, common_1.Get)(':settingId'),
|
59
|
+
__param(0, (0, common_1.Param)('settingId', common_1.ParseIntPipe)),
|
60
|
+
__metadata("design:type", Function),
|
61
|
+
__metadata("design:paramtypes", [Number]),
|
62
|
+
__metadata("design:returntype", Promise)
|
63
|
+
], SettingsController.prototype, "show", null);
|
64
|
+
__decorate([
|
65
|
+
(0, common_1.UseGuards)(auth_guard_1.AuthGuard),
|
66
|
+
(0, common_1.Post)(),
|
67
|
+
__param(0, (0, common_1.Body)()),
|
68
|
+
__metadata("design:type", Function),
|
69
|
+
__metadata("design:paramtypes", [create_dto_1.CreateDTO]),
|
70
|
+
__metadata("design:returntype", void 0)
|
71
|
+
], SettingsController.prototype, "create", null);
|
72
|
+
__decorate([
|
73
|
+
(0, common_1.UseGuards)(auth_guard_1.AuthGuard),
|
74
|
+
(0, common_1.Patch)(':settingId'),
|
75
|
+
__param(0, (0, common_1.Param)('settingId', common_1.ParseIntPipe)),
|
76
|
+
__param(1, (0, common_1.Body)()),
|
77
|
+
__metadata("design:type", Function),
|
78
|
+
__metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
|
79
|
+
__metadata("design:returntype", Promise)
|
80
|
+
], SettingsController.prototype, "update", null);
|
81
|
+
__decorate([
|
82
|
+
(0, common_1.UseGuards)(auth_guard_1.AuthGuard),
|
83
|
+
(0, common_1.Delete)(),
|
84
|
+
__param(0, (0, common_1.Body)()),
|
85
|
+
__metadata("design:type", Function),
|
86
|
+
__metadata("design:paramtypes", [delete_dto_1.DeleteDTO]),
|
87
|
+
__metadata("design:returntype", Promise)
|
88
|
+
], SettingsController.prototype, "delete", null);
|
89
|
+
exports.SettingsController = SettingsController = __decorate([
|
90
|
+
(0, role_decorator_1.Role)(),
|
91
|
+
(0, common_1.Controller)('settings'),
|
92
|
+
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => settings_service_1.SettingsService))),
|
93
|
+
__metadata("design:paramtypes", [settings_service_1.SettingsService])
|
94
|
+
], SettingsController);
|
95
|
+
//# sourceMappingURL=settings.controller.js.map
|