@hedhog/admin 0.0.12 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. package/dist/admin.module.d.ts.map +1 -1
  2. package/dist/admin.module.js +3 -3
  3. package/dist/admin.module.js.map +1 -1
  4. package/dist/index.d.ts +3 -4
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +3 -4
  7. package/dist/index.js.map +1 -1
  8. package/dist/menu/menu.controller.d.ts.map +1 -1
  9. package/dist/menu/menu.controller.js +3 -9
  10. package/dist/menu/menu.controller.js.map +1 -1
  11. package/dist/menu/menu.module.d.ts.map +1 -1
  12. package/dist/menu/menu.module.js +0 -2
  13. package/dist/menu/menu.module.js.map +1 -1
  14. package/dist/role/decorators/role.decorator.d.ts +3 -0
  15. package/dist/role/decorators/role.decorator.d.ts.map +1 -0
  16. package/dist/role/decorators/role.decorator.js +8 -0
  17. package/dist/role/decorators/role.decorator.js.map +1 -0
  18. package/dist/role/dto/create.dto.d.ts.map +1 -0
  19. package/dist/role/dto/create.dto.js.map +1 -0
  20. package/dist/role/dto/delete.dto.d.ts.map +1 -0
  21. package/dist/role/dto/delete.dto.js.map +1 -0
  22. package/dist/role/dto/update.dto.d.ts.map +1 -0
  23. package/dist/role/dto/update.dto.js.map +1 -0
  24. package/dist/{permission/guards/permission.guard.d.ts → role/guards/role.guard.d.ts} +2 -2
  25. package/dist/role/guards/role.guard.d.ts.map +1 -0
  26. package/dist/{permission/guards/permission.guard.js → role/guards/role.guard.js} +12 -9
  27. package/dist/role/guards/role.guard.js.map +1 -0
  28. package/dist/role/role.controller.d.ts +14 -0
  29. package/dist/role/role.controller.d.ts.map +1 -0
  30. package/dist/{permission/permission.controller.js → role/role.controller.js} +33 -37
  31. package/dist/role/role.controller.js.map +1 -0
  32. package/dist/role/role.module.d.ts +3 -0
  33. package/dist/role/role.module.d.ts.map +1 -0
  34. package/dist/{permission/permission.module.js → role/role.module.js} +13 -13
  35. package/dist/role/role.module.js.map +1 -0
  36. package/dist/{permission/permission.service.d.ts → role/role.service.d.ts} +4 -4
  37. package/dist/role/role.service.d.ts.map +1 -0
  38. package/dist/{permission/permission.service.js → role/role.service.js} +9 -9
  39. package/dist/role/role.service.js.map +1 -0
  40. package/dist/screen/screen.controller.d.ts.map +1 -1
  41. package/dist/screen/screen.controller.js +3 -7
  42. package/dist/screen/screen.controller.js.map +1 -1
  43. package/dist/user/dto/update-roles.dto.d.ts +4 -0
  44. package/dist/user/dto/update-roles.dto.d.ts.map +1 -0
  45. package/dist/user/dto/update-roles.dto.js +24 -0
  46. package/dist/user/dto/update-roles.dto.js.map +1 -0
  47. package/dist/user/user.controller.d.ts +3 -0
  48. package/dist/user/user.controller.d.ts.map +1 -1
  49. package/dist/user/user.controller.js +26 -7
  50. package/dist/user/user.controller.js.map +1 -1
  51. package/dist/user/user.service.d.ts +3 -0
  52. package/dist/user/user.service.d.ts.map +1 -1
  53. package/dist/user/user.service.js +31 -0
  54. package/dist/user/user.service.js.map +1 -1
  55. package/package.json +1 -1
  56. package/src/migrations/migrate-04.ts +8 -0
  57. package/dist/permission/decorators/permission.decorator.d.ts +0 -3
  58. package/dist/permission/decorators/permission.decorator.d.ts.map +0 -1
  59. package/dist/permission/decorators/permission.decorator.js +0 -8
  60. package/dist/permission/decorators/permission.decorator.js.map +0 -1
  61. package/dist/permission/dto/create.dto.d.ts.map +0 -1
  62. package/dist/permission/dto/create.dto.js.map +0 -1
  63. package/dist/permission/dto/delete.dto.d.ts.map +0 -1
  64. package/dist/permission/dto/delete.dto.js.map +0 -1
  65. package/dist/permission/dto/update.dto.d.ts.map +0 -1
  66. package/dist/permission/dto/update.dto.js.map +0 -1
  67. package/dist/permission/guards/permission.guard.d.ts.map +0 -1
  68. package/dist/permission/guards/permission.guard.js.map +0 -1
  69. package/dist/permission/permission.controller.d.ts +0 -14
  70. package/dist/permission/permission.controller.d.ts.map +0 -1
  71. package/dist/permission/permission.controller.js.map +0 -1
  72. package/dist/permission/permission.module.d.ts +0 -3
  73. package/dist/permission/permission.module.d.ts.map +0 -1
  74. package/dist/permission/permission.module.js.map +0 -1
  75. package/dist/permission/permission.service.d.ts.map +0 -1
  76. package/dist/permission/permission.service.js.map +0 -1
  77. package/dist/permission/types/permission.types.d.ts +0 -33
  78. package/dist/permission/types/permission.types.d.ts.map +0 -1
  79. package/dist/permission/types/permission.types.js +0 -3
  80. package/dist/permission/types/permission.types.js.map +0 -1
  81. /package/dist/{permission → role}/dto/create.dto.d.ts +0 -0
  82. /package/dist/{permission → role}/dto/create.dto.js +0 -0
  83. /package/dist/{permission → role}/dto/delete.dto.d.ts +0 -0
  84. /package/dist/{permission → role}/dto/delete.dto.js +0 -0
  85. /package/dist/{permission → role}/dto/update.dto.d.ts +0 -0
  86. /package/dist/{permission → role}/dto/update.dto.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"admin.module.d.ts","sourceRoot":"","sources":["../src/admin.module.ts"],"names":[],"mappings":"AASA,qBAYa,WAAW;CAAG"}
1
+ {"version":3,"file":"admin.module.d.ts","sourceRoot":"","sources":["../src/admin.module.ts"],"names":[],"mappings":"AAUA,qBAYa,WAAW;CAAG"}
@@ -12,9 +12,9 @@ const pagination_1 = require("@hedhog/pagination");
12
12
  const common_1 = require("@nestjs/common");
13
13
  const auth_module_1 = require("./auth/auth.module");
14
14
  const menu_module_1 = require("./menu/menu.module");
15
- const permission_module_1 = require("./permission/permission.module");
16
15
  const screen_module_1 = require("./screen/screen.module");
17
16
  const user_module_1 = require("./user/user.module");
17
+ const role_module_1 = require("./role/role.module");
18
18
  let AdminModule = class AdminModule {
19
19
  };
20
20
  exports.AdminModule = AdminModule;
@@ -24,12 +24,12 @@ exports.AdminModule = AdminModule = __decorate([
24
24
  (0, common_1.forwardRef)(() => auth_module_1.AuthModule),
25
25
  (0, common_1.forwardRef)(() => menu_module_1.MenuModule),
26
26
  (0, common_1.forwardRef)(() => pagination_1.PaginationModule),
27
- (0, common_1.forwardRef)(() => permission_module_1.PermissionModule),
27
+ (0, common_1.forwardRef)(() => role_module_1.RoleModule),
28
28
  (0, common_1.forwardRef)(() => prisma_1.PrismaModule),
29
29
  (0, common_1.forwardRef)(() => screen_module_1.ScreenModule),
30
30
  (0, common_1.forwardRef)(() => user_module_1.UserModule),
31
31
  ],
32
- exports: [user_module_1.UserModule, auth_module_1.AuthModule, permission_module_1.PermissionModule, menu_module_1.MenuModule, screen_module_1.ScreenModule],
32
+ exports: [user_module_1.UserModule, auth_module_1.AuthModule, role_module_1.RoleModule, menu_module_1.MenuModule, screen_module_1.ScreenModule],
33
33
  })
34
34
  ], AdminModule);
35
35
  //# sourceMappingURL=admin.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin.module.js","sourceRoot":"","sources":["../src/admin.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8C;AAC9C,mDAAsD;AACtD,2CAAoD;AACpD,oDAAgD;AAChD,oDAAgD;AAChD,sEAAkE;AAClE,0DAAsD;AACtD,oDAAgD;AAczC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IAZvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,6BAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,oCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4BAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;SAC7B;QACD,OAAO,EAAE,CAAC,wBAAU,EAAE,wBAAU,EAAE,oCAAgB,EAAE,wBAAU,EAAE,4BAAY,CAAC;KAC9E,CAAC;GACW,WAAW,CAAG"}
1
+ {"version":3,"file":"admin.module.js","sourceRoot":"","sources":["../src/admin.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8C;AAC9C,mDAAsD;AACtD,2CAAoD;AACpD,oDAAgD;AAChD,oDAAgD;AAEhD,0DAAsD;AACtD,oDAAgD;AAChD,oDAAgD;AAczC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IAZvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,6BAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4BAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;SAC7B;QACD,OAAO,EAAE,CAAC,wBAAU,EAAE,wBAAU,EAAE,wBAAU,EAAE,wBAAU,EAAE,4BAAY,CAAC;KACxE,CAAC;GACW,WAAW,CAAG"}
package/dist/index.d.ts CHANGED
@@ -4,10 +4,9 @@ export * from './auth/decorators/public.decorator';
4
4
  export * from './auth/decorators/user.decorator';
5
5
  export * from './auth/guards/auth.guard';
6
6
  export * from './menu/menu.service';
7
- export * from './permission/permission.service';
8
- export * from './permission/types/permission.types';
9
- export * from './permission/decorators/permission.decorator';
10
- export * from './permission/guards/permission.guard';
7
+ export * from './role/role.service';
8
+ export * from './role/decorators/role.decorator';
9
+ export * from './role/guards/role.guard';
11
10
  export * from './screen/screen.service';
12
11
  export * from './user/constants/user.constants';
13
12
  export * from './user/user.service';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAG/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AAGzC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sCAAsC,CAAC;AAGrD,cAAc,yBAAyB,CAAC;AAGxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAG/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AAGzC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AAGzC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -24,10 +24,9 @@ __exportStar(require("./auth/guards/auth.guard"), exports);
24
24
  // Menu Module
25
25
  __exportStar(require("./menu/menu.service"), exports);
26
26
  // Permission Module
27
- __exportStar(require("./permission/permission.service"), exports);
28
- __exportStar(require("./permission/types/permission.types"), exports);
29
- __exportStar(require("./permission/decorators/permission.decorator"), exports);
30
- __exportStar(require("./permission/guards/permission.guard"), exports);
27
+ __exportStar(require("./role/role.service"), exports);
28
+ __exportStar(require("./role/decorators/role.decorator"), exports);
29
+ __exportStar(require("./role/guards/role.guard"), exports);
31
30
  // Screen Module
32
31
  __exportStar(require("./screen/screen.service"), exports);
33
32
  // User Module
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,eAAe;AACf,iDAA+B;AAE/B,cAAc;AACd,sDAAoC;AACpC,qEAAmD;AACnD,mEAAiD;AACjD,2DAAyC;AAEzC,cAAc;AACd,sDAAoC;AAEpC,oBAAoB;AACpB,kEAAgD;AAChD,sEAAoD;AACpD,+EAA6D;AAC7D,uEAAqD;AAErD,gBAAgB;AAChB,0DAAwC;AAExC,cAAc;AACd,kEAAgD;AAChD,sDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,eAAe;AACf,iDAA+B;AAE/B,cAAc;AACd,sDAAoC;AACpC,qEAAmD;AACnD,mEAAiD;AACjD,2DAAyC;AAEzC,cAAc;AACd,sDAAoC;AAEpC,oBAAoB;AACpB,sDAAoC;AACpC,mEAAiD;AACjD,2DAAyC;AAEzC,gBAAgB;AAChB,0DAAwC;AAExC,cAAc;AACd,kEAAgD;AAChD,sDAAoC"}
@@ -1 +1 @@
1
- {"version":3,"file":"menu.controller.d.ts","sourceRoot":"","sources":["../../src/menu/menu.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAK3C,qBAEa,cAAc;IAGvB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAKrC,aAAa,CAAS,EAAE,EAAE,EAAE;;KAAA;IAM5B,OAAO,CAAe,gBAAgB,KAAA;IAMtC,IAAI,CAAgC,MAAM,EAAE,MAAM;IAMlD,MAAM,CAAS,IAAI,EAAE,SAAS;IAM9B,MAAM,CACqB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,SAAS;IAUnB,MAAM,CAAS,IAAI,EAAE,SAAS;IAM9B,WAAW,CAAS,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzD"}
1
+ {"version":3,"file":"menu.controller.d.ts","sourceRoot":"","sources":["../../src/menu/menu.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAK3C,qBAGa,cAAc;IAGvB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAIrC,aAAa,CAAS,EAAE,EAAE,EAAE;;KAAA;IAK5B,OAAO,CAAe,gBAAgB,KAAA;IAKtC,IAAI,CAAgC,MAAM,EAAE,MAAM;IAKlD,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,MAAM,CACqB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,SAAS;IASnB,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,WAAW,CAAS,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzD"}
@@ -20,9 +20,9 @@ const delete_dto_1 = require("./dto/delete.dto");
20
20
  const update_dto_1 = require("./dto/update.dto");
21
21
  const menu_service_1 = require("./menu.service");
22
22
  const order_dto_1 = require("./dto/order.dto");
23
- const permission_decorator_1 = require("../permission/decorators/permission.decorator");
24
23
  const auth_guard_1 = require("../auth/guards/auth.guard");
25
24
  const user_decorator_1 = require("../auth/decorators/user.decorator");
25
+ const role_decorator_1 = require("../role/decorators/role.decorator");
26
26
  let MenuController = class MenuController {
27
27
  constructor(menuService) {
28
28
  this.menuService = menuService;
@@ -54,7 +54,6 @@ let MenuController = class MenuController {
54
54
  };
55
55
  exports.MenuController = MenuController;
56
56
  __decorate([
57
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
58
57
  (0, common_1.Get)('system'),
59
58
  __param(0, (0, user_decorator_1.User)()),
60
59
  __metadata("design:type", Function),
@@ -62,7 +61,6 @@ __decorate([
62
61
  __metadata("design:returntype", Promise)
63
62
  ], MenuController.prototype, "getSystemMenu", null);
64
63
  __decorate([
65
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
66
64
  (0, common_1.Get)(),
67
65
  __param(0, (0, pagination_1.Pagination)()),
68
66
  __metadata("design:type", Function),
@@ -70,7 +68,6 @@ __decorate([
70
68
  __metadata("design:returntype", Promise)
71
69
  ], MenuController.prototype, "getMenu", null);
72
70
  __decorate([
73
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
74
71
  (0, common_1.Get)(':menuId'),
75
72
  __param(0, (0, common_1.Param)('menuId', common_1.ParseIntPipe)),
76
73
  __metadata("design:type", Function),
@@ -78,7 +75,6 @@ __decorate([
78
75
  __metadata("design:returntype", Promise)
79
76
  ], MenuController.prototype, "show", null);
80
77
  __decorate([
81
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
82
78
  (0, common_1.Post)(),
83
79
  __param(0, (0, common_1.Body)()),
84
80
  __metadata("design:type", Function),
@@ -86,7 +82,6 @@ __decorate([
86
82
  __metadata("design:returntype", Promise)
87
83
  ], MenuController.prototype, "create", null);
88
84
  __decorate([
89
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
90
85
  (0, common_1.Patch)(':menuId'),
91
86
  __param(0, (0, common_1.Param)('menuId', common_1.ParseIntPipe)),
92
87
  __param(1, (0, common_1.Body)()),
@@ -95,7 +90,6 @@ __decorate([
95
90
  __metadata("design:returntype", Promise)
96
91
  ], MenuController.prototype, "update", null);
97
92
  __decorate([
98
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
99
93
  (0, common_1.Delete)(),
100
94
  __param(0, (0, common_1.Body)()),
101
95
  __metadata("design:type", Function),
@@ -103,7 +97,6 @@ __decorate([
103
97
  __metadata("design:returntype", Promise)
104
98
  ], MenuController.prototype, "delete", null);
105
99
  __decorate([
106
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
107
100
  (0, common_1.Patch)('order'),
108
101
  __param(0, (0, common_1.Body)()),
109
102
  __metadata("design:type", Function),
@@ -111,7 +104,8 @@ __decorate([
111
104
  __metadata("design:returntype", Promise)
112
105
  ], MenuController.prototype, "updateOrder", null);
113
106
  exports.MenuController = MenuController = __decorate([
114
- (0, permission_decorator_1.Permission)(),
107
+ (0, role_decorator_1.Role)(),
108
+ (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
115
109
  (0, common_1.Controller)('menus'),
116
110
  __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => menu_service_1.MenuService))),
117
111
  __metadata("design:paramtypes", [menu_service_1.MenuService])
@@ -1 +1 @@
1
- {"version":3,"file":"menu.controller.js","sourceRoot":"","sources":["../../src/menu/menu.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAYwB;AACxB,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,+CAA2C;AAC3C,wFAA2E;AAC3E,0DAAsD;AACtD,sEAAyD;AAIlD,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAIE,AAAN,KAAK,CAAC,aAAa,CAAS,EAAE,EAAE,EAAE;QAChC,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;IAIK,AAAN,KAAK,CAAC,OAAO,CAAe,gBAAgB;Q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,EAAE,qBAAY,CAAC,CAAA;IAC7B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,sBAAS;;4CAMxB;AAGK;IADL,IAAA,eAAM,GAAE;IACK,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;4CAEnC;AAGK;IADL,IAAA,cAAK,EAAC,OAAO,CAAC;IACI,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,oBAAQ;;iDAEvC;yBA7CU,cAAc;IAH1B,IAAA,qBAAI,GAAE;IACN,IAAA,kBAAS,EAAC,sBAAS,CAAC;IACpB,IAAA,mBAAU,EAAC,OAAO,CAAC;IAGf,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAW,CAAC,CAAC,CAAA;qCACR,0BAAW;GAHhC,cAAc,CA8C1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"menu.module.d.ts","sourceRoot":"","sources":["../../src/menu/menu.module.ts"],"names":[],"mappings":"AAQA,qBAWa,UAAU;CAAG"}
1
+ {"version":3,"file":"menu.module.d.ts","sourceRoot":"","sources":["../../src/menu/menu.module.ts"],"names":[],"mappings":"AAOA,qBAUa,UAAU;CAAG"}
@@ -13,7 +13,6 @@ const prisma_1 = require("@hedhog/prisma");
13
13
  const common_1 = require("@nestjs/common");
14
14
  const menu_controller_1 = require("./menu.controller");
15
15
  const menu_service_1 = require("./menu.service");
16
- const permission_module_1 = require("../permission/permission.module");
17
16
  let MenuModule = class MenuModule {
18
17
  };
19
18
  exports.MenuModule = MenuModule;
@@ -26,7 +25,6 @@ exports.MenuModule = MenuModule = __decorate([
26
25
  (0, common_1.forwardRef)(() => auth_module_1.AuthModule),
27
26
  (0, common_1.forwardRef)(() => prisma_1.PrismaModule),
28
27
  (0, common_1.forwardRef)(() => pagination_1.PaginationModule),
29
- (0, common_1.forwardRef)(() => permission_module_1.PermissionModule),
30
28
  ],
31
29
  })
32
30
  ], MenuModule);
@@ -1 +1 @@
1
- {"version":3,"file":"menu.module.js","sourceRoot":"","sources":["../../src/menu/menu.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qDAAiD;AACjD,mDAAsD;AACtD,2CAA8C;AAC9C,2CAAoD;AACpD,uDAAmD;AACnD,iDAA6C;AAC7C,uEAAmE;AAa5D,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAXtB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;QACtB,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,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;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,oCAAgB,CAAC;SACnC;KACF,CAAC;GACW,UAAU,CAAG"}
1
+ {"version":3,"file":"menu.module.js","sourceRoot":"","sources":["../../src/menu/menu.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qDAAiD;AACjD,mDAAsD;AACtD,2CAA8C;AAC9C,2CAAoD;AACpD,uDAAmD;AACnD,iDAA6C;AAYtC,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAVtB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;QACtB,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,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,UAAU,CAAG"}
@@ -0,0 +1,3 @@
1
+ export declare const WITH_ROLE = "withRole";
2
+ export declare const Role: () => import("@nestjs/common").CustomDecorator<string>;
3
+ //# sourceMappingURL=role.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.decorator.d.ts","sourceRoot":"","sources":["../../../src/role/decorators/role.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,aAAa,CAAC;AACpC,eAAO,MAAM,IAAI,wDAAqC,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Role = exports.WITH_ROLE = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ exports.WITH_ROLE = 'withRole';
6
+ const Role = () => (0, common_1.SetMetadata)(exports.WITH_ROLE, true);
7
+ exports.Role = Role;
8
+ //# sourceMappingURL=role.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.decorator.js","sourceRoot":"","sources":["../../../src/role/decorators/role.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAEhC,QAAA,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,IAAA,oBAAW,EAAC,iBAAS,EAAE,IAAI,CAAC,CAAC;AAA1C,QAAA,IAAI,QAAsC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../src/role/dto/create.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAGpB,IAAI,EAAE,MAAM,CAAC;IAIb,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../src/role/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAEvD,MAAa,SAAS;CAQrB;AARD,8BAQC;AALC;IAFC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;IACnD,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;;uCACpC;AAIb;IAFC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;IACxD,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;;8CAClC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.dto.d.ts","sourceRoot":"","sources":["../../../src/role/dto/delete.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAIpB,GAAG,EAAE,MAAM,EAAE,CAAC;CACf"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.dto.js","sourceRoot":"","sources":["../../../src/role/dto/delete.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAE/D,MAAa,SAAS;CAKrB;AALD,8BAKC;AADC;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,8BAAY,EAAC,CAAC,CAAC;IACf,IAAA,uBAAK,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;sCACR"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../src/role/dto/update.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAGpB,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../src/role/dto/update.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAEvD,MAAa,SAAS;CAQrB;AARD,8BAQC;AALC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;;uCACtC;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;;8CACpC"}
@@ -1,11 +1,11 @@
1
1
  import { CanActivate, ExecutionContext } from '@nestjs/common';
2
2
  import { Reflector } from '@nestjs/core';
3
3
  import { PrismaService } from '@hedhog/prisma';
4
- export declare class PermissionGuard implements CanActivate {
4
+ export declare class RoleGuard implements CanActivate {
5
5
  private reflector;
6
6
  private readonly prisma;
7
7
  constructor(reflector: Reflector, prisma: PrismaService);
8
8
  canActivate(context: ExecutionContext): Promise<boolean>;
9
9
  private extractTokenFromHeader;
10
10
  }
11
- //# sourceMappingURL=permission.guard.d.ts.map
11
+ //# sourceMappingURL=role.guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.guard.d.ts","sourceRoot":"","sources":["../../../src/role/guards/role.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAMjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qBACa,SAAU,YAAW,WAAW;IAEzC,OAAO,CAAC,SAAS;IAEjB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFf,SAAS,EAAE,SAAS,EAEX,MAAM,EAAE,aAAa;IAGlC,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAoF9D,OAAO,CAAC,sBAAsB;CAI/B"}
@@ -12,21 +12,24 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.PermissionGuard = void 0;
15
+ exports.RoleGuard = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const core_1 = require("@nestjs/core");
18
18
  const constants_1 = require("@nestjs/common/constants");
19
- const permission_decorator_1 = require("../decorators/permission.decorator");
19
+ const role_decorator_1 = require("../decorators/role.decorator");
20
20
  const prisma_1 = require("@hedhog/prisma");
21
- let PermissionGuard = class PermissionGuard {
21
+ let RoleGuard = class RoleGuard {
22
22
  constructor(reflector, prisma) {
23
23
  this.reflector = reflector;
24
24
  this.prisma = prisma;
25
25
  }
26
26
  async canActivate(context) {
27
27
  var _a, _b;
28
- const withPermission = this.reflector.getAllAndOverride(permission_decorator_1.WITH_PERMISSION, [context.getHandler(), context.getClass()]);
29
- if (!withPermission) {
28
+ const withRole = this.reflector.getAllAndOverride(role_decorator_1.WITH_ROLE, [
29
+ context.getHandler(),
30
+ context.getClass(),
31
+ ]);
32
+ if (!withRole) {
30
33
  return true;
31
34
  }
32
35
  const request = context.switchToHttp().getRequest();
@@ -96,11 +99,11 @@ let PermissionGuard = class PermissionGuard {
96
99
  return type === 'Bearer' ? token : undefined;
97
100
  }
98
101
  };
99
- exports.PermissionGuard = PermissionGuard;
100
- exports.PermissionGuard = PermissionGuard = __decorate([
102
+ exports.RoleGuard = RoleGuard;
103
+ exports.RoleGuard = RoleGuard = __decorate([
101
104
  (0, common_1.Injectable)(),
102
105
  __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => prisma_1.PrismaService))),
103
106
  __metadata("design:paramtypes", [core_1.Reflector,
104
107
  prisma_1.PrismaService])
105
- ], PermissionGuard);
106
- //# sourceMappingURL=permission.guard.js.map
108
+ ], RoleGuard);
109
+ //# sourceMappingURL=role.guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.guard.js","sourceRoot":"","sources":["../../../src/role/guards/role.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AAExB,uCAAyC;AACzC,wDAA2D;AAC3D,iEAAyD;AACzD,2CAA+C;AAGxC,IAAM,SAAS,GAAf,MAAM,SAAS;IACpB,YACU,SAAoB,EAEX,MAAqB;QAF9B,cAAS,GAAT,SAAS,CAAW;QAEX,WAAM,GAAN,MAA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E,KAAK,CAAC,GAAG,CAAC,mCAAI,EAAE,CAAC;QACtE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/C,CAAC;CACF,CAAA;AA/FY,8BAAS;oBAAT,SAAS;IADrB,IAAA,mBAAU,GAAE;IAIR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sBAAa,CAAC,CAAC,CAAA;qCADrB,gBAAS;QAEH,sBAAa;GAJ7B,SAAS,CA+FrB"}
@@ -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 { RoleService } from './role.service';
5
+ export declare class RoleController {
6
+ private readonly roleService;
7
+ constructor(roleService: RoleService);
8
+ getRoles(paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
9
+ show(roleId: number): Promise<any>;
10
+ create(data: CreateDTO): Promise<any>;
11
+ update(roleId: number, data: UpdateDTO): Promise<any>;
12
+ delete(data: DeleteDTO): Promise<any>;
13
+ }
14
+ //# sourceMappingURL=role.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.controller.d.ts","sourceRoot":"","sources":["../../src/role/role.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C,qBAGa,cAAc;IAGvB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAIrC,QAAQ,CAAe,gBAAgB,KAAA;IAKvC,IAAI,CAAgC,MAAM,EAAE,MAAM;IAKxD,MAAM,CAAS,IAAI,EAAE,SAAS;IAKxB,MAAM,CACqB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,SAAS;IASnB,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
@@ -12,84 +12,80 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.PermissionController = void 0;
15
+ exports.RoleController = 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
19
  const delete_dto_1 = require("./dto/delete.dto");
20
20
  const update_dto_1 = require("./dto/update.dto");
21
- const permission_service_1 = require("./permission.service");
22
- const permission_decorator_1 = require("./decorators/permission.decorator");
21
+ const role_service_1 = require("./role.service");
22
+ const role_decorator_1 = require("./decorators/role.decorator");
23
23
  const auth_guard_1 = require("../auth/guards/auth.guard");
24
- let PermissionController = class PermissionController {
25
- constructor(permissionService) {
26
- this.permissionService = permissionService;
24
+ let RoleController = class RoleController {
25
+ constructor(roleService) {
26
+ this.roleService = roleService;
27
27
  }
28
- async getPermissions(paginationParams) {
29
- return this.permissionService.getPermissions(paginationParams);
28
+ async getRoles(paginationParams) {
29
+ return this.roleService.getRoles(paginationParams);
30
30
  }
31
- async show(permissionId) {
32
- return this.permissionService.get(permissionId);
31
+ async show(roleId) {
32
+ return this.roleService.get(roleId);
33
33
  }
34
34
  create(data) {
35
- return this.permissionService.create(data);
35
+ return this.roleService.create(data);
36
36
  }
37
- async update(permissionId, data) {
38
- return this.permissionService.update({
39
- id: permissionId,
37
+ async update(roleId, data) {
38
+ return this.roleService.update({
39
+ id: roleId,
40
40
  data,
41
41
  });
42
42
  }
43
43
  async delete(data) {
44
- return this.permissionService.delete(data);
44
+ return this.roleService.delete(data);
45
45
  }
46
46
  };
47
- exports.PermissionController = PermissionController;
47
+ exports.RoleController = RoleController;
48
48
  __decorate([
49
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
50
49
  (0, common_1.Get)(),
51
50
  __param(0, (0, pagination_1.Pagination)()),
52
51
  __metadata("design:type", Function),
53
52
  __metadata("design:paramtypes", [Object]),
54
53
  __metadata("design:returntype", Promise)
55
- ], PermissionController.prototype, "getPermissions", null);
54
+ ], RoleController.prototype, "getRoles", null);
56
55
  __decorate([
57
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
58
- (0, common_1.Get)(':permissionId'),
59
- __param(0, (0, common_1.Param)('PermissionId', common_1.ParseIntPipe)),
56
+ (0, common_1.Get)(':roleId'),
57
+ __param(0, (0, common_1.Param)('roleId', common_1.ParseIntPipe)),
60
58
  __metadata("design:type", Function),
61
59
  __metadata("design:paramtypes", [Number]),
62
60
  __metadata("design:returntype", Promise)
63
- ], PermissionController.prototype, "show", null);
61
+ ], RoleController.prototype, "show", null);
64
62
  __decorate([
65
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
66
63
  (0, common_1.Post)(),
67
64
  __param(0, (0, common_1.Body)()),
68
65
  __metadata("design:type", Function),
69
66
  __metadata("design:paramtypes", [create_dto_1.CreateDTO]),
70
67
  __metadata("design:returntype", void 0)
71
- ], PermissionController.prototype, "create", null);
68
+ ], RoleController.prototype, "create", null);
72
69
  __decorate([
73
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
74
- (0, common_1.Patch)(':permissionId'),
75
- __param(0, (0, common_1.Param)('PermissionId', common_1.ParseIntPipe)),
70
+ (0, common_1.Patch)(':roleId'),
71
+ __param(0, (0, common_1.Param)('roleId', common_1.ParseIntPipe)),
76
72
  __param(1, (0, common_1.Body)()),
77
73
  __metadata("design:type", Function),
78
74
  __metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
79
75
  __metadata("design:returntype", Promise)
80
- ], PermissionController.prototype, "update", null);
76
+ ], RoleController.prototype, "update", null);
81
77
  __decorate([
82
- (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
83
78
  (0, common_1.Delete)(),
84
79
  __param(0, (0, common_1.Body)()),
85
80
  __metadata("design:type", Function),
86
81
  __metadata("design:paramtypes", [delete_dto_1.DeleteDTO]),
87
82
  __metadata("design:returntype", Promise)
88
- ], PermissionController.prototype, "delete", null);
89
- exports.PermissionController = PermissionController = __decorate([
90
- (0, permission_decorator_1.Permission)(),
91
- (0, common_1.Controller)('permissions'),
92
- __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => permission_service_1.PermissionService))),
93
- __metadata("design:paramtypes", [permission_service_1.PermissionService])
94
- ], PermissionController);
95
- //# sourceMappingURL=permission.controller.js.map
83
+ ], RoleController.prototype, "delete", null);
84
+ exports.RoleController = RoleController = __decorate([
85
+ (0, role_decorator_1.Role)(),
86
+ (0, common_1.UseGuards)(auth_guard_1.AuthGuard),
87
+ (0, common_1.Controller)('roles'),
88
+ __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => role_service_1.RoleService))),
89
+ __metadata("design:paramtypes", [role_service_1.RoleService])
90
+ ], RoleController);
91
+ //# sourceMappingURL=role.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.controller.js","sourceRoot":"","sources":["../../src/role/role.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAYwB;AACxB,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,gEAAmD;AACnD,0DAAsD;AAK/C,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAGE,AAAN,KAAK,CAAC,QAAQ,CAAe,gBAAgB;QAC3C,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACrD,CAAC;IAGK,AAAN,KAAK,CAAC,IAAI,CAAgC,MAAc;QACtD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC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 export declare class RoleModule {
2
+ }
3
+ //# sourceMappingURL=role.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.module.d.ts","sourceRoot":"","sources":["../../src/role/role.module.ts"],"names":[],"mappings":"AASA,qBAgBa,UAAU;CAAG"}
@@ -6,34 +6,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.PermissionModule = void 0;
9
+ exports.RoleModule = void 0;
10
10
  const auth_module_1 = require("../auth/auth.module");
11
11
  const pagination_1 = require("@hedhog/pagination");
12
12
  const prisma_1 = require("@hedhog/prisma");
13
13
  const common_1 = require("@nestjs/common");
14
- const permission_service_1 = require("./permission.service");
15
- const permission_controller_1 = require("./permission.controller");
16
- const permission_guard_1 = require("./guards/permission.guard");
17
14
  const core_1 = require("@nestjs/core");
18
- let PermissionModule = class PermissionModule {
15
+ const role_controller_1 = require("./role.controller");
16
+ const role_service_1 = require("./role.service");
17
+ const role_guard_1 = require("./guards/role.guard");
18
+ let RoleModule = class RoleModule {
19
19
  };
20
- exports.PermissionModule = PermissionModule;
21
- exports.PermissionModule = PermissionModule = __decorate([
20
+ exports.RoleModule = RoleModule;
21
+ exports.RoleModule = RoleModule = __decorate([
22
22
  (0, common_1.Module)({
23
23
  imports: [
24
24
  (0, common_1.forwardRef)(() => auth_module_1.AuthModule),
25
25
  (0, common_1.forwardRef)(() => prisma_1.PrismaModule),
26
26
  (0, common_1.forwardRef)(() => pagination_1.PaginationModule),
27
27
  ],
28
- controllers: [permission_controller_1.PermissionController],
28
+ controllers: [role_controller_1.RoleController],
29
29
  providers: [
30
- permission_service_1.PermissionService,
30
+ role_service_1.RoleService,
31
31
  {
32
32
  provide: core_1.APP_GUARD,
33
- useClass: permission_guard_1.PermissionGuard,
33
+ useClass: role_guard_1.RoleGuard,
34
34
  },
35
35
  ],
36
- exports: [permission_service_1.PermissionService],
36
+ exports: [role_service_1.RoleService],
37
37
  })
38
- ], PermissionModule);
39
- //# sourceMappingURL=permission.module.js.map
38
+ ], RoleModule);
39
+ //# sourceMappingURL=role.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.module.js","sourceRoot":"","sources":["../../src/role/role.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qDAAiD;AACjD,mDAAsD;AACtD,2CAA8C;AAC9C,2CAAoD;AACpD,uCAAyC;AACzC,uDAAmD;AACnD,iDAA6C;AAC7C,oDAAgD;AAkBzC,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAhBtB,IAAA,eAAM,EAAC;QACN,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;QACD,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,SAAS,EAAE;YACT,0BAAW;YACX;gBACE,OAAO,EAAE,gBAAS;gBAClB,QAAQ,EAAE,sBAAS;aACpB;SACF;QACD,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG"}
@@ -3,12 +3,12 @@ import { PrismaService } from '@hedhog/prisma';
3
3
  import { CreateDTO } from './dto/create.dto';
4
4
  import { DeleteDTO } from './dto/delete.dto';
5
5
  import { UpdateDTO } from './dto/update.dto';
6
- export declare class PermissionService {
6
+ export declare class RoleService {
7
7
  private readonly prismaService;
8
8
  private readonly paginationService;
9
9
  constructor(prismaService: PrismaService, paginationService: PaginationService);
10
- getPermissions(paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
11
- get(permissionId: number): Promise<any>;
10
+ getRoles(paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
11
+ get(roleId: number): Promise<any>;
12
12
  create({ name, description }: CreateDTO): Promise<any>;
13
13
  update({ id, data }: {
14
14
  id: number;
@@ -16,4 +16,4 @@ export declare class PermissionService {
16
16
  }): Promise<any>;
17
17
  delete({ ids }: DeleteDTO): Promise<any>;
18
18
  }
19
- //# sourceMappingURL=permission.service.d.ts.map
19
+ //# sourceMappingURL=role.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.service.d.ts","sourceRoot":"","sources":["../../src/role/role.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,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,WAAW;IAGpB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,QAAQ,CAAC,gBAAgB,EAAE,aAAa;IAmBxC,GAAG,CAAC,MAAM,EAAE,MAAM;IAMlB,MAAM,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,SAAS;IASvC,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"}
@@ -12,16 +12,16 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.PermissionService = void 0;
15
+ exports.RoleService = void 0;
16
16
  const pagination_1 = require("@hedhog/pagination");
17
17
  const prisma_1 = require("@hedhog/prisma");
18
18
  const common_1 = require("@nestjs/common");
19
- let PermissionService = class PermissionService {
19
+ let RoleService = class RoleService {
20
20
  constructor(prismaService, paginationService) {
21
21
  this.prismaService = prismaService;
22
22
  this.paginationService = paginationService;
23
23
  }
24
- async getPermissions(paginationParams) {
24
+ async getRoles(paginationParams) {
25
25
  const fields = ['name', 'description'];
26
26
  const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
27
27
  return this.paginationService.paginate(this.prismaService.roles, paginationParams, {
@@ -30,9 +30,9 @@ let PermissionService = class PermissionService {
30
30
  },
31
31
  });
32
32
  }
33
- async get(permissionId) {
33
+ async get(roleId) {
34
34
  return this.prismaService.roles.findUnique({
35
- where: { id: permissionId },
35
+ where: { id: roleId },
36
36
  });
37
37
  }
38
38
  async create({ name, description }) {
@@ -62,12 +62,12 @@ let PermissionService = class PermissionService {
62
62
  });
63
63
  }
64
64
  };
65
- exports.PermissionService = PermissionService;
66
- exports.PermissionService = PermissionService = __decorate([
65
+ exports.RoleService = RoleService;
66
+ exports.RoleService = RoleService = __decorate([
67
67
  (0, common_1.Injectable)(),
68
68
  __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => prisma_1.PrismaService))),
69
69
  __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => pagination_1.PaginationService))),
70
70
  __metadata("design:paramtypes", [prisma_1.PrismaService,
71
71
  pagination_1.PaginationService])
72
- ], PermissionService);
73
- //# sourceMappingURL=permission.service.js.map
72
+ ], RoleService);
73
+ //# sourceMappingURL=role.service.js.map