@hedhog/admin 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (290) hide show
  1. package/dist/admin.module.d.ts +3 -0
  2. package/dist/admin.module.d.ts.map +1 -0
  3. package/dist/admin.module.js +33 -0
  4. package/dist/admin.module.js.map +1 -0
  5. package/dist/auth/src/auth.controller.d.ts +21 -0
  6. package/dist/auth/src/auth.controller.d.ts.map +1 -0
  7. package/dist/auth/src/auth.controller.js +77 -0
  8. package/dist/auth/src/auth.controller.js.map +1 -0
  9. package/dist/auth/src/auth.module.d.ts +3 -0
  10. package/dist/auth/src/auth.module.d.ts.map +1 -0
  11. package/dist/auth/src/auth.module.js +50 -0
  12. package/dist/auth/src/auth.module.js.map +1 -0
  13. package/dist/auth/src/auth.service.d.ts +36 -0
  14. package/dist/auth/src/auth.service.d.ts.map +1 -0
  15. package/dist/auth/src/auth.service.js +162 -0
  16. package/dist/auth/src/auth.service.js.map +1 -0
  17. package/dist/auth/src/auth.service.spec.d.ts +2 -0
  18. package/dist/auth/src/auth.service.spec.d.ts.map +1 -0
  19. package/dist/auth/src/auth.service.spec.js +17 -0
  20. package/dist/auth/src/auth.service.spec.js.map +1 -0
  21. package/dist/auth/src/decorators/public.decorator.d.ts +3 -0
  22. package/dist/auth/src/decorators/public.decorator.d.ts.map +1 -0
  23. package/dist/auth/src/decorators/public.decorator.js +8 -0
  24. package/dist/auth/src/decorators/public.decorator.js.map +1 -0
  25. package/dist/auth/src/decorators/user.decorator.d.ts +2 -0
  26. package/dist/auth/src/decorators/user.decorator.d.ts.map +1 -0
  27. package/dist/auth/src/decorators/user.decorator.js +12 -0
  28. package/dist/auth/src/decorators/user.decorator.js.map +1 -0
  29. package/dist/auth/src/dto/forget.dto.d.ts +4 -0
  30. package/dist/auth/src/dto/forget.dto.d.ts.map +1 -0
  31. package/dist/auth/src/dto/forget.dto.js +21 -0
  32. package/dist/auth/src/dto/forget.dto.js.map +1 -0
  33. package/dist/auth/src/dto/login.dto.d.ts +5 -0
  34. package/dist/auth/src/dto/login.dto.d.ts.map +1 -0
  35. package/dist/auth/src/dto/login.dto.js +31 -0
  36. package/dist/auth/src/dto/login.dto.js.map +1 -0
  37. package/dist/auth/src/dto/otp.dto.d.ts +5 -0
  38. package/dist/auth/src/dto/otp.dto.d.ts.map +1 -0
  39. package/dist/auth/src/dto/otp.dto.js +27 -0
  40. package/dist/auth/src/dto/otp.dto.js.map +1 -0
  41. package/dist/auth/src/enums/multifactor-type.enum.d.ts +5 -0
  42. package/dist/auth/src/enums/multifactor-type.enum.d.ts.map +1 -0
  43. package/dist/auth/src/enums/multifactor-type.enum.js +9 -0
  44. package/dist/auth/src/enums/multifactor-type.enum.js.map +1 -0
  45. package/dist/auth/src/guards/auth.guard.d.ts +11 -0
  46. package/dist/auth/src/guards/auth.guard.d.ts.map +1 -0
  47. package/dist/auth/src/guards/auth.guard.js +56 -0
  48. package/dist/auth/src/guards/auth.guard.js.map +1 -0
  49. package/dist/auth/src/migrations/index.d.ts +6 -0
  50. package/dist/auth/src/migrations/index.d.ts.map +1 -0
  51. package/dist/auth/src/migrations/index.js +121 -0
  52. package/dist/auth/src/migrations/index.js.map +1 -0
  53. package/dist/auth/src/types/user.type.d.ts +9 -0
  54. package/dist/auth/src/types/user.type.d.ts.map +1 -0
  55. package/dist/auth/src/types/user.type.js +3 -0
  56. package/dist/auth/src/types/user.type.js.map +1 -0
  57. package/dist/file/src/dto/delete.dto.d.ts +4 -0
  58. package/dist/file/src/dto/delete.dto.d.ts.map +1 -0
  59. package/dist/file/src/dto/delete.dto.js +23 -0
  60. package/dist/file/src/dto/delete.dto.js.map +1 -0
  61. package/dist/file/src/file.module.d.ts +3 -0
  62. package/dist/file/src/file.module.d.ts.map +1 -0
  63. package/dist/file/src/file.module.js +29 -0
  64. package/dist/file/src/file.module.js.map +1 -0
  65. package/dist/file/src/file.service.d.ts +12 -0
  66. package/dist/file/src/file.service.d.ts.map +1 -0
  67. package/dist/file/src/file.service.js +59 -0
  68. package/dist/file/src/file.service.js.map +1 -0
  69. package/dist/file/src/migrations/index.d.ts +6 -0
  70. package/dist/file/src/migrations/index.d.ts.map +1 -0
  71. package/dist/file/src/migrations/index.js +137 -0
  72. package/dist/file/src/migrations/index.js.map +1 -0
  73. package/dist/index.d.ts +26 -0
  74. package/dist/index.d.ts.map +1 -0
  75. package/dist/index.js +51 -0
  76. package/dist/index.js.map +1 -0
  77. package/dist/mail/src/enums/mail-configuration-type.enum.d.ts +6 -0
  78. package/dist/mail/src/enums/mail-configuration-type.enum.d.ts.map +1 -0
  79. package/dist/mail/src/enums/mail-configuration-type.enum.js +10 -0
  80. package/dist/mail/src/enums/mail-configuration-type.enum.js.map +1 -0
  81. package/dist/mail/src/interfaces/index.d.ts +3 -0
  82. package/dist/mail/src/interfaces/index.d.ts.map +1 -0
  83. package/dist/mail/src/interfaces/index.js +19 -0
  84. package/dist/mail/src/interfaces/index.js.map +1 -0
  85. package/dist/mail/src/interfaces/mail-module-options.interface.d.ts +32 -0
  86. package/dist/mail/src/interfaces/mail-module-options.interface.d.ts.map +1 -0
  87. package/dist/mail/src/interfaces/mail-module-options.interface.js +3 -0
  88. package/dist/mail/src/interfaces/mail-module-options.interface.js.map +1 -0
  89. package/dist/mail/src/interfaces/mail-type.d.ts +13 -0
  90. package/dist/mail/src/interfaces/mail-type.d.ts.map +1 -0
  91. package/dist/mail/src/interfaces/mail-type.js +3 -0
  92. package/dist/mail/src/interfaces/mail-type.js.map +1 -0
  93. package/dist/mail/src/mail.consts.d.ts +17 -0
  94. package/dist/mail/src/mail.consts.d.ts.map +1 -0
  95. package/dist/mail/src/mail.consts.js +5 -0
  96. package/dist/mail/src/mail.consts.js.map +1 -0
  97. package/dist/mail/src/mail.module.d.ts +8 -0
  98. package/dist/mail/src/mail.module.d.ts.map +1 -0
  99. package/dist/mail/src/mail.module.js +51 -0
  100. package/dist/mail/src/mail.module.js.map +1 -0
  101. package/dist/mail/src/mail.service.d.ts +14 -0
  102. package/dist/mail/src/mail.service.d.ts.map +1 -0
  103. package/dist/mail/src/mail.service.js +281 -0
  104. package/dist/mail/src/mail.service.js.map +1 -0
  105. package/dist/mail/src/mail.service.spec.d.ts +2 -0
  106. package/dist/mail/src/mail.service.spec.d.ts.map +1 -0
  107. package/dist/mail/src/mail.service.spec.js +17 -0
  108. package/dist/mail/src/mail.service.spec.js.map +1 -0
  109. package/dist/menu/src/dto/create.dto.d.ts +8 -0
  110. package/dist/menu/src/dto/create.dto.d.ts.map +1 -0
  111. package/dist/menu/src/dto/create.dto.js +44 -0
  112. package/dist/menu/src/dto/create.dto.js.map +1 -0
  113. package/dist/menu/src/dto/delete.dto.d.ts +4 -0
  114. package/dist/menu/src/dto/delete.dto.d.ts.map +1 -0
  115. package/dist/menu/src/dto/delete.dto.js +24 -0
  116. package/dist/menu/src/dto/delete.dto.js.map +1 -0
  117. package/dist/menu/src/dto/order.dto.d.ts +4 -0
  118. package/dist/menu/src/dto/order.dto.d.ts.map +1 -0
  119. package/dist/menu/src/dto/order.dto.js +23 -0
  120. package/dist/menu/src/dto/order.dto.js.map +1 -0
  121. package/dist/menu/src/dto/update.dto.d.ts +7 -0
  122. package/dist/menu/src/dto/update.dto.d.ts.map +1 -0
  123. package/dist/menu/src/dto/update.dto.js +37 -0
  124. package/dist/menu/src/dto/update.dto.js.map +1 -0
  125. package/dist/menu/src/menu.controller.d.ts +19 -0
  126. package/dist/menu/src/menu.controller.d.ts.map +1 -0
  127. package/dist/menu/src/menu.controller.js +117 -0
  128. package/dist/menu/src/menu.controller.js.map +1 -0
  129. package/dist/menu/src/menu.module.d.ts +3 -0
  130. package/dist/menu/src/menu.module.d.ts.map +1 -0
  131. package/dist/menu/src/menu.module.js +31 -0
  132. package/dist/menu/src/menu.module.js.map +1 -0
  133. package/dist/menu/src/menu.service.d.ts +23 -0
  134. package/dist/menu/src/menu.service.d.ts.map +1 -0
  135. package/dist/menu/src/menu.service.js +117 -0
  136. package/dist/menu/src/menu.service.js.map +1 -0
  137. package/dist/menu/src/migrations/index.d.ts +7 -0
  138. package/dist/menu/src/migrations/index.d.ts.map +1 -0
  139. package/dist/menu/src/migrations/index.js +101 -0
  140. package/dist/menu/src/migrations/index.js.map +1 -0
  141. package/dist/migrations/1726795702341-migrate.d.ts +6 -0
  142. package/dist/migrations/1726795702341-migrate.d.ts.map +1 -0
  143. package/dist/migrations/1726795702341-migrate.js +121 -0
  144. package/dist/migrations/1726795702341-migrate.js.map +1 -0
  145. package/dist/migrations/1726795734665-migrate.d.ts +6 -0
  146. package/dist/migrations/1726795734665-migrate.d.ts.map +1 -0
  147. package/dist/migrations/1726795734665-migrate.js +40 -0
  148. package/dist/migrations/1726795734665-migrate.js.map +1 -0
  149. package/dist/migrations/1726795818403-migrate.d.ts +7 -0
  150. package/dist/migrations/1726795818403-migrate.d.ts.map +1 -0
  151. package/dist/migrations/1726795818403-migrate.js +101 -0
  152. package/dist/migrations/1726795818403-migrate.js.map +1 -0
  153. package/dist/migrations/1726795828359-migrate.d.ts +6 -0
  154. package/dist/migrations/1726795828359-migrate.d.ts.map +1 -0
  155. package/dist/migrations/1726795828359-migrate.js +525 -0
  156. package/dist/migrations/1726795828359-migrate.js.map +1 -0
  157. package/dist/permission/src/decorators/permission.decorator.d.ts +3 -0
  158. package/dist/permission/src/decorators/permission.decorator.d.ts.map +1 -0
  159. package/dist/permission/src/decorators/permission.decorator.js +8 -0
  160. package/dist/permission/src/decorators/permission.decorator.js.map +1 -0
  161. package/dist/permission/src/dto/create.dto.d.ts +5 -0
  162. package/dist/permission/src/dto/create.dto.d.ts.map +1 -0
  163. package/dist/permission/src/dto/create.dto.js +27 -0
  164. package/dist/permission/src/dto/create.dto.js.map +1 -0
  165. package/dist/permission/src/dto/delete.dto.d.ts +4 -0
  166. package/dist/permission/src/dto/delete.dto.d.ts.map +1 -0
  167. package/dist/permission/src/dto/delete.dto.js +23 -0
  168. package/dist/permission/src/dto/delete.dto.js.map +1 -0
  169. package/dist/permission/src/dto/update.dto.d.ts +5 -0
  170. package/dist/permission/src/dto/update.dto.d.ts.map +1 -0
  171. package/dist/permission/src/dto/update.dto.js +27 -0
  172. package/dist/permission/src/dto/update.dto.js.map +1 -0
  173. package/dist/permission/src/guards/permission.guard.d.ts +11 -0
  174. package/dist/permission/src/guards/permission.guard.d.ts.map +1 -0
  175. package/dist/permission/src/guards/permission.guard.js +99 -0
  176. package/dist/permission/src/guards/permission.guard.js.map +1 -0
  177. package/dist/permission/src/migrations/index.d.ts +6 -0
  178. package/dist/permission/src/migrations/index.d.ts.map +1 -0
  179. package/dist/permission/src/migrations/index.js +520 -0
  180. package/dist/permission/src/migrations/index.js.map +1 -0
  181. package/dist/permission/src/permission.controller.d.ts +14 -0
  182. package/dist/permission/src/permission.controller.d.ts.map +1 -0
  183. package/dist/permission/src/permission.controller.js +95 -0
  184. package/dist/permission/src/permission.controller.js.map +1 -0
  185. package/dist/permission/src/permission.module.d.ts +3 -0
  186. package/dist/permission/src/permission.module.d.ts.map +1 -0
  187. package/dist/permission/src/permission.module.js +39 -0
  188. package/dist/permission/src/permission.module.js.map +1 -0
  189. package/dist/permission/src/permission.service.d.ts +19 -0
  190. package/dist/permission/src/permission.service.d.ts.map +1 -0
  191. package/dist/permission/src/permission.service.js +73 -0
  192. package/dist/permission/src/permission.service.js.map +1 -0
  193. package/dist/permission/src/types/permission.types.d.ts +33 -0
  194. package/dist/permission/src/types/permission.types.d.ts.map +1 -0
  195. package/dist/permission/src/types/permission.types.js +3 -0
  196. package/dist/permission/src/types/permission.types.js.map +1 -0
  197. package/dist/screen/src/dto/create.dto.d.ts +7 -0
  198. package/dist/screen/src/dto/create.dto.d.ts.map +1 -0
  199. package/dist/screen/src/dto/create.dto.js +37 -0
  200. package/dist/screen/src/dto/create.dto.js.map +1 -0
  201. package/dist/screen/src/dto/delete.dto.d.ts +4 -0
  202. package/dist/screen/src/dto/delete.dto.d.ts.map +1 -0
  203. package/dist/screen/src/dto/delete.dto.js +23 -0
  204. package/dist/screen/src/dto/delete.dto.js.map +1 -0
  205. package/dist/screen/src/dto/update.dto.d.ts +7 -0
  206. package/dist/screen/src/dto/update.dto.d.ts.map +1 -0
  207. package/dist/screen/src/dto/update.dto.js +37 -0
  208. package/dist/screen/src/dto/update.dto.js.map +1 -0
  209. package/dist/screen/src/migrations/index.d.ts +6 -0
  210. package/dist/screen/src/migrations/index.d.ts.map +1 -0
  211. package/dist/screen/src/migrations/index.js +40 -0
  212. package/dist/screen/src/migrations/index.js.map +1 -0
  213. package/dist/screen/src/screen.controller.d.ts +14 -0
  214. package/dist/screen/src/screen.controller.d.ts.map +1 -0
  215. package/dist/screen/src/screen.controller.js +94 -0
  216. package/dist/screen/src/screen.controller.js.map +1 -0
  217. package/dist/screen/src/screen.module.d.ts +3 -0
  218. package/dist/screen/src/screen.module.d.ts.map +1 -0
  219. package/dist/screen/src/screen.module.js +31 -0
  220. package/dist/screen/src/screen.module.js.map +1 -0
  221. package/dist/screen/src/screen.service.d.ts +19 -0
  222. package/dist/screen/src/screen.service.d.ts.map +1 -0
  223. package/dist/screen/src/screen.service.js +73 -0
  224. package/dist/screen/src/screen.service.js.map +1 -0
  225. package/dist/setting/src/dto/create.dto.d.ts +4 -0
  226. package/dist/setting/src/dto/create.dto.d.ts.map +1 -0
  227. package/dist/setting/src/dto/create.dto.js +22 -0
  228. package/dist/setting/src/dto/create.dto.js.map +1 -0
  229. package/dist/setting/src/dto/delete.dto.d.ts +4 -0
  230. package/dist/setting/src/dto/delete.dto.d.ts.map +1 -0
  231. package/dist/setting/src/dto/delete.dto.js +23 -0
  232. package/dist/setting/src/dto/delete.dto.js.map +1 -0
  233. package/dist/setting/src/dto/update.dto.d.ts +4 -0
  234. package/dist/setting/src/dto/update.dto.d.ts.map +1 -0
  235. package/dist/setting/src/dto/update.dto.js +8 -0
  236. package/dist/setting/src/dto/update.dto.js.map +1 -0
  237. package/dist/setting/src/migrations/index.d.ts +6 -0
  238. package/dist/setting/src/migrations/index.d.ts.map +1 -0
  239. package/dist/setting/src/migrations/index.js +67 -0
  240. package/dist/setting/src/migrations/index.js.map +1 -0
  241. package/dist/setting/src/settings.controller.d.ts +14 -0
  242. package/dist/setting/src/settings.controller.d.ts.map +1 -0
  243. package/dist/setting/src/settings.controller.js +94 -0
  244. package/dist/setting/src/settings.controller.js.map +1 -0
  245. package/dist/setting/src/settings.module.d.ts +3 -0
  246. package/dist/setting/src/settings.module.d.ts.map +1 -0
  247. package/dist/setting/src/settings.module.js +31 -0
  248. package/dist/setting/src/settings.module.js.map +1 -0
  249. package/dist/setting/src/settings.service.d.ts +19 -0
  250. package/dist/setting/src/settings.service.d.ts.map +1 -0
  251. package/dist/setting/src/settings.service.js +70 -0
  252. package/dist/setting/src/settings.service.js.map +1 -0
  253. package/dist/user/src/constants/user.constants.d.ts +2 -0
  254. package/dist/user/src/constants/user.constants.d.ts.map +1 -0
  255. package/dist/user/src/constants/user.constants.js +5 -0
  256. package/dist/user/src/constants/user.constants.js.map +1 -0
  257. package/dist/user/src/dto/create.dto.d.ts +6 -0
  258. package/dist/user/src/dto/create.dto.d.ts.map +1 -0
  259. package/dist/user/src/dto/create.dto.js +37 -0
  260. package/dist/user/src/dto/create.dto.js.map +1 -0
  261. package/dist/user/src/dto/delete.dto.d.ts +4 -0
  262. package/dist/user/src/dto/delete.dto.d.ts.map +1 -0
  263. package/dist/user/src/dto/delete.dto.js +23 -0
  264. package/dist/user/src/dto/delete.dto.js.map +1 -0
  265. package/dist/user/src/dto/update.dto.d.ts +8 -0
  266. package/dist/user/src/dto/update.dto.d.ts.map +1 -0
  267. package/dist/user/src/dto/update.dto.js +50 -0
  268. package/dist/user/src/dto/update.dto.js.map +1 -0
  269. package/dist/user/src/user.controller.d.ts +14 -0
  270. package/dist/user/src/user.controller.d.ts.map +1 -0
  271. package/dist/user/src/user.controller.js +94 -0
  272. package/dist/user/src/user.controller.js.map +1 -0
  273. package/dist/user/src/user.module.d.ts +3 -0
  274. package/dist/user/src/user.module.d.ts.map +1 -0
  275. package/dist/user/src/user.module.js +31 -0
  276. package/dist/user/src/user.module.js.map +1 -0
  277. package/dist/user/src/user.service.d.ts +20 -0
  278. package/dist/user/src/user.service.d.ts.map +1 -0
  279. package/dist/user/src/user.service.js +84 -0
  280. package/dist/user/src/user.service.js.map +1 -0
  281. package/dist/user/src/user.service.spec.d.ts +2 -0
  282. package/dist/user/src/user.service.spec.d.ts.map +1 -0
  283. package/dist/user/src/user.service.spec.js +17 -0
  284. package/dist/user/src/user.service.spec.js.map +1 -0
  285. package/package.json +29 -0
  286. package/src/mail/src/mail.template.ejs +1 -0
  287. package/src/migrations/1726795702341-migrate.ts +107 -0
  288. package/src/migrations/1726795734665-migrate.ts +40 -0
  289. package/src/migrations/1726795818403-migrate.ts +161 -0
  290. package/src/migrations/1726795828359-migrate.ts +573 -0
@@ -0,0 +1,94 @@
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.ScreenController = void 0;
16
+ const __1 = require("../../");
17
+ const pagination_1 = require("@hedhog/pagination");
18
+ const common_1 = require("@nestjs/common");
19
+ const create_dto_1 = require("./dto/create.dto");
20
+ const delete_dto_1 = require("./dto/delete.dto");
21
+ const update_dto_1 = require("./dto/update.dto");
22
+ const screen_service_1 = require("./screen.service");
23
+ let ScreenController = class ScreenController {
24
+ constructor(screenService) {
25
+ this.screenService = screenService;
26
+ }
27
+ async getScreens(paginationParams) {
28
+ return this.screenService.getScreens(paginationParams);
29
+ }
30
+ async show(screenId) {
31
+ return this.screenService.get(screenId);
32
+ }
33
+ create(data) {
34
+ return this.screenService.create(data);
35
+ }
36
+ async update(screenId, data) {
37
+ return this.screenService.update({
38
+ id: screenId,
39
+ data,
40
+ });
41
+ }
42
+ async delete(data) {
43
+ return this.screenService.delete(data);
44
+ }
45
+ };
46
+ exports.ScreenController = ScreenController;
47
+ __decorate([
48
+ (0, common_1.UseGuards)(__1.AuthGuard),
49
+ (0, common_1.Get)(),
50
+ __param(0, (0, pagination_1.Pagination)()),
51
+ __metadata("design:type", Function),
52
+ __metadata("design:paramtypes", [Object]),
53
+ __metadata("design:returntype", Promise)
54
+ ], ScreenController.prototype, "getScreens", null);
55
+ __decorate([
56
+ (0, common_1.UseGuards)(__1.AuthGuard),
57
+ (0, common_1.Get)(':screenId'),
58
+ __param(0, (0, common_1.Param)('screenId', common_1.ParseIntPipe)),
59
+ __metadata("design:type", Function),
60
+ __metadata("design:paramtypes", [Number]),
61
+ __metadata("design:returntype", Promise)
62
+ ], ScreenController.prototype, "show", null);
63
+ __decorate([
64
+ (0, common_1.UseGuards)(__1.AuthGuard),
65
+ (0, common_1.Post)(),
66
+ __param(0, (0, common_1.Body)()),
67
+ __metadata("design:type", Function),
68
+ __metadata("design:paramtypes", [create_dto_1.CreateDTO]),
69
+ __metadata("design:returntype", void 0)
70
+ ], ScreenController.prototype, "create", null);
71
+ __decorate([
72
+ (0, common_1.UseGuards)(__1.AuthGuard),
73
+ (0, common_1.Patch)(':screenId'),
74
+ __param(0, (0, common_1.Param)('screenId', common_1.ParseIntPipe)),
75
+ __param(1, (0, common_1.Body)()),
76
+ __metadata("design:type", Function),
77
+ __metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
78
+ __metadata("design:returntype", Promise)
79
+ ], ScreenController.prototype, "update", null);
80
+ __decorate([
81
+ (0, common_1.UseGuards)(__1.AuthGuard),
82
+ (0, common_1.Delete)(),
83
+ __param(0, (0, common_1.Body)()),
84
+ __metadata("design:type", Function),
85
+ __metadata("design:paramtypes", [delete_dto_1.DeleteDTO]),
86
+ __metadata("design:returntype", Promise)
87
+ ], ScreenController.prototype, "delete", null);
88
+ exports.ScreenController = ScreenController = __decorate([
89
+ (0, __1.Permission)(),
90
+ (0, common_1.Controller)('screens'),
91
+ __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => screen_service_1.ScreenService))),
92
+ __metadata("design:paramtypes", [screen_service_1.ScreenService])
93
+ ], ScreenController);
94
+ //# sourceMappingURL=screen.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screen.controller.js","sourceRoot":"","sources":["../../../src/screen/src/screen.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8BAA+C;AAC/C,mDAAgD;AAChD,2CAYwB;AACxB,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,qDAAiD;AAI1C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAEmB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAIE,AAAN,KAAK,CAAC,UAAU,CAAe,gBAAgB;QAC7C,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACzD,CAAC;IAIK,AAAN,KAAK,CAAC,IAAI,CAAkC,QAAgB;QAC1D,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAID,MAAM,CAAS,IAAe;QAC5B,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CACuB,QAAgB,EACzC,IAAe;QAEvB,OAAO,IAAI,CAAC,aAAa,CAAC,MAA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.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screen.module.d.ts","sourceRoot":"","sources":["../../../src/screen/src/screen.module.ts"],"names":[],"mappings":"AAOA,qBAUa,YAAY;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.ScreenModule = void 0;
10
+ const __1 = require("../../");
11
+ const pagination_1 = require("@hedhog/pagination");
12
+ const prisma_1 = require("@hedhog/prisma");
13
+ const common_1 = require("@nestjs/common");
14
+ const screen_controller_1 = require("./screen.controller");
15
+ const screen_service_1 = require("./screen.service");
16
+ let ScreenModule = class ScreenModule {
17
+ };
18
+ exports.ScreenModule = ScreenModule;
19
+ exports.ScreenModule = ScreenModule = __decorate([
20
+ (0, common_1.Module)({
21
+ providers: [screen_service_1.ScreenService],
22
+ exports: [screen_service_1.ScreenService],
23
+ controllers: [screen_controller_1.ScreenController],
24
+ imports: [
25
+ (0, common_1.forwardRef)(() => __1.AuthModule),
26
+ (0, common_1.forwardRef)(() => prisma_1.PrismaModule),
27
+ (0, common_1.forwardRef)(() => pagination_1.PaginationModule),
28
+ ],
29
+ })
30
+ ], ScreenModule);
31
+ //# sourceMappingURL=screen.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screen.module.js","sourceRoot":"","sources":["../../../src/screen/src/screen.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8BAAoC;AACpC,mDAAsD;AACtD,2CAA8C;AAC9C,2CAAoD;AACpD,2DAAuD;AACvD,qDAAiD;AAY1C,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAVxB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,8BAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,8BAAa,CAAC;QACxB,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,cAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,6BAAgB,CAAC;SACnC;KACF,CAAC;GACW,YAAY,CAAG"}
@@ -0,0 +1,19 @@
1
+ import { PaginationDTO, PaginationService } from '@hedhog/pagination';
2
+ import { PrismaService } from '@hedhog/prisma';
3
+ import { CreateDTO } from './dto/create.dto';
4
+ import { DeleteDTO } from './dto/delete.dto';
5
+ import { UpdateDTO } from './dto/update.dto';
6
+ export declare class ScreenService {
7
+ private readonly prismaService;
8
+ private readonly paginationService;
9
+ constructor(prismaService: PrismaService, paginationService: PaginationService);
10
+ getScreens(paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
11
+ get(screenId: number): Promise<any>;
12
+ create({ name, slug, description, icon }: CreateDTO): Promise<any>;
13
+ update({ id, data }: {
14
+ id: number;
15
+ data: UpdateDTO;
16
+ }): Promise<any>;
17
+ delete({ ids }: DeleteDTO): Promise<any>;
18
+ }
19
+ //# sourceMappingURL=screen.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screen.service.d.ts","sourceRoot":"","sources":["../../../src/screen/src/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,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,aAAa;IAGtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,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"}
@@ -0,0 +1,73 @@
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.ScreenService = 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 ScreenService = class ScreenService {
20
+ constructor(prismaService, paginationService) {
21
+ this.prismaService = prismaService;
22
+ this.paginationService = paginationService;
23
+ }
24
+ async getScreens(paginationParams) {
25
+ const fields = ['name', 'slug', 'description', 'icon'];
26
+ const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
27
+ return this.paginationService.paginate(this.prismaService.screens, paginationParams, {
28
+ where: {
29
+ OR,
30
+ },
31
+ });
32
+ }
33
+ async get(screenId) {
34
+ return this.prismaService.screens.findUnique({ where: { id: screenId } });
35
+ }
36
+ async create({ name, slug, description, icon }) {
37
+ return this.prismaService.screens.create({
38
+ data: {
39
+ name,
40
+ slug,
41
+ description,
42
+ icon,
43
+ },
44
+ });
45
+ }
46
+ async update({ id, data }) {
47
+ return this.prismaService.screens.update({
48
+ where: { id },
49
+ data,
50
+ });
51
+ }
52
+ async delete({ ids }) {
53
+ if (ids == undefined || ids == null) {
54
+ throw new common_1.BadRequestException(`You must select at least one screen to delete.`);
55
+ }
56
+ return this.prismaService.screens.deleteMany({
57
+ where: {
58
+ id: {
59
+ in: ids,
60
+ },
61
+ },
62
+ });
63
+ }
64
+ };
65
+ exports.ScreenService = ScreenService;
66
+ exports.ScreenService = ScreenService = __decorate([
67
+ (0, common_1.Injectable)(),
68
+ __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => prisma_1.PrismaService))),
69
+ __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => pagination_1.PaginationService))),
70
+ __metadata("design:paramtypes", [prisma_1.PrismaService,
71
+ pagination_1.PaginationService])
72
+ ], ScreenService);
73
+ //# sourceMappingURL=screen.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screen.service.js","sourceRoot":"","sources":["../../../src/screen/src/screen.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDA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AG,EAAa;QAC7B,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACpC,MAAM,IAAI,4BAAmB,CAC3B,gDAAgD,CACjD,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC;YAC3C,KAAK,EAAE;gBACL,EAAE,EAAE;oBACF,EAAE,EAAE,GAAG;iBACR;aACF;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA/DY,sCAAa;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,CA+DzB"}
@@ -0,0 +1,4 @@
1
+ export declare class CreateDTO {
2
+ name: string;
3
+ }
4
+ //# sourceMappingURL=create.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../../src/setting/src/dto/create.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAGpB,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateDTO = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class CreateDTO {
15
+ }
16
+ exports.CreateDTO = CreateDTO;
17
+ __decorate([
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/src/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,4 @@
1
+ export declare class DeleteDTO {
2
+ ids: number[];
3
+ }
4
+ //# sourceMappingURL=delete.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.dto.d.ts","sourceRoot":"","sources":["../../../../src/setting/src/dto/delete.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAIpB,GAAG,EAAE,MAAM,EAAE,CAAC;CACf"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DeleteDTO = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class DeleteDTO {
15
+ }
16
+ exports.DeleteDTO = DeleteDTO;
17
+ __decorate([
18
+ (0, class_validator_1.IsArray)(),
19
+ (0, class_validator_1.ArrayMinSize)(1),
20
+ (0, class_validator_1.IsInt)({ each: true }),
21
+ __metadata("design:type", Array)
22
+ ], DeleteDTO.prototype, "ids", void 0);
23
+ //# sourceMappingURL=delete.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.dto.js","sourceRoot":"","sources":["../../../../src/setting/src/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,4 @@
1
+ import { CreateDTO } from './create.dto';
2
+ export declare class UpdateDTO extends CreateDTO {
3
+ }
4
+ //# sourceMappingURL=update.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../../src/setting/src/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/src/dto/update.dto.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,MAAa,SAAU,SAAQ,sBAAS;CAAG;AAA3C,8BAA2C"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class Migrate implements MigrationInterface {
3
+ up(queryRunner: QueryRunner): Promise<void>;
4
+ down(queryRunner: QueryRunner): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/setting/src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,WAAW,EAGZ,MAAM,SAAS,CAAC;AAGjB,qBAAa,OAAQ,YAAW,kBAAkB;IACnC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAgE3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3D"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migrate = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ const utils_1 = require("@hedhog/utils");
6
+ class Migrate {
7
+ async up(queryRunner) {
8
+ await queryRunner.createTable(new typeorm_1.Table({
9
+ name: 'settings',
10
+ columns: [
11
+ (0, utils_1.idColumn)(),
12
+ {
13
+ name: 'name',
14
+ type: 'varchar',
15
+ },
16
+ (0, utils_1.timestampColumn)(),
17
+ (0, utils_1.timestampColumn)('updated_at'),
18
+ ],
19
+ }));
20
+ await queryRunner.createTable(new typeorm_1.Table({
21
+ name: 'setting_values',
22
+ columns: [
23
+ (0, utils_1.idColumn)(),
24
+ {
25
+ name: 'value',
26
+ type: 'varchar',
27
+ length: '1023',
28
+ },
29
+ {
30
+ name: 'name',
31
+ type: 'varchar',
32
+ isUnique: true,
33
+ },
34
+ {
35
+ name: 'description',
36
+ type: 'varchar',
37
+ isNullable: true,
38
+ },
39
+ {
40
+ name: 'label',
41
+ type: 'varchar',
42
+ isNullable: true,
43
+ },
44
+ {
45
+ name: 'setting_id',
46
+ type: 'int',
47
+ unsigned: true,
48
+ },
49
+ (0, utils_1.timestampColumn)(),
50
+ (0, utils_1.timestampColumn)('updated_at'),
51
+ ],
52
+ }));
53
+ // Criação das foreign keys
54
+ await queryRunner.createForeignKey('setting_values', new typeorm_1.TableForeignKey({
55
+ columnNames: ['setting_id'],
56
+ referencedColumnNames: ['id'],
57
+ referencedTableName: 'settings',
58
+ onDelete: 'CASCADE',
59
+ }));
60
+ }
61
+ async down(queryRunner) {
62
+ await queryRunner.dropTable('setting_values');
63
+ await queryRunner.dropTable('settings');
64
+ }
65
+ }
66
+ exports.Migrate = Migrate;
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/setting/src/migrations/index.ts"],"names":[],"mappings":";;;AAAA,qCAKiB;AACjB,yCAA0D;AAE1D,MAAa,OAAO;IACX,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;iBAChB;gBACD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;SACF,CAAC,CACH,CAAC;QAEF,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV;oBACE,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,SAAS;oBACf,MAAM,EAAE,MAAM;iBACf;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,QAAQ,EAAE,IAAI;iBACf;gBACD;oBACE,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,IAAI;iBACjB;gBACD;oBACE,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,IAAI;iBACjB;gBACD;oBACE,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,KAAK;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;SACF,CAAC,CACH,CAAC;QAEF,2BAA2B;QAC3B,MAAM,WAAW,CAAC,gBAAgB,CAChC,gBAAgB,EAChB,IAAI,yBAAe,CAAC;YAClB,WAAW,EAAE,CAAC,YAAY,CAAC;YAC3B,qBAAqB,EAAE,CAAC,IAAI,CAAC;YAC7B,mBAAmB,EAAE,UAAU;YAC/B,QAAQ,EAAE,SAAS;SACpB,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,WAAW,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QAC9C,MAAM,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;CACF;AArED,0BAqEC"}
@@ -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/src/settings.controller.ts"],"names":[],"mappings":"AAeA,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,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,94 @@
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 __1 = require("../../");
17
+ const pagination_1 = require("@hedhog/pagination");
18
+ const common_1 = require("@nestjs/common");
19
+ const create_dto_1 = require("./dto/create.dto");
20
+ const delete_dto_1 = require("./dto/delete.dto");
21
+ const update_dto_1 = require("./dto/update.dto");
22
+ const settings_service_1 = require("./settings.service");
23
+ let SettingsController = class SettingsController {
24
+ constructor(settingsService) {
25
+ this.settingsService = settingsService;
26
+ }
27
+ async getSettings(paginationParams) {
28
+ return this.settingsService.getSettings(paginationParams);
29
+ }
30
+ async show(settingId) {
31
+ return this.settingsService.get(settingId);
32
+ }
33
+ create(data) {
34
+ return this.settingsService.create(data);
35
+ }
36
+ async update(settingId, data) {
37
+ return this.settingsService.update({
38
+ id: settingId,
39
+ data,
40
+ });
41
+ }
42
+ async delete(data) {
43
+ return this.settingsService.delete(data);
44
+ }
45
+ };
46
+ exports.SettingsController = SettingsController;
47
+ __decorate([
48
+ (0, common_1.UseGuards)(__1.AuthGuard),
49
+ (0, common_1.Get)(),
50
+ __param(0, (0, pagination_1.Pagination)()),
51
+ __metadata("design:type", Function),
52
+ __metadata("design:paramtypes", [Object]),
53
+ __metadata("design:returntype", Promise)
54
+ ], SettingsController.prototype, "getSettings", null);
55
+ __decorate([
56
+ (0, common_1.UseGuards)(__1.AuthGuard),
57
+ (0, common_1.Get)(':settingId'),
58
+ __param(0, (0, common_1.Param)('settingId', common_1.ParseIntPipe)),
59
+ __metadata("design:type", Function),
60
+ __metadata("design:paramtypes", [Number]),
61
+ __metadata("design:returntype", Promise)
62
+ ], SettingsController.prototype, "show", null);
63
+ __decorate([
64
+ (0, common_1.UseGuards)(__1.AuthGuard),
65
+ (0, common_1.Post)(),
66
+ __param(0, (0, common_1.Body)()),
67
+ __metadata("design:type", Function),
68
+ __metadata("design:paramtypes", [create_dto_1.CreateDTO]),
69
+ __metadata("design:returntype", void 0)
70
+ ], SettingsController.prototype, "create", null);
71
+ __decorate([
72
+ (0, common_1.UseGuards)(__1.AuthGuard),
73
+ (0, common_1.Patch)(':settingId'),
74
+ __param(0, (0, common_1.Param)('settingId', common_1.ParseIntPipe)),
75
+ __param(1, (0, common_1.Body)()),
76
+ __metadata("design:type", Function),
77
+ __metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
78
+ __metadata("design:returntype", Promise)
79
+ ], SettingsController.prototype, "update", null);
80
+ __decorate([
81
+ (0, common_1.UseGuards)(__1.AuthGuard),
82
+ (0, common_1.Delete)(),
83
+ __param(0, (0, common_1.Body)()),
84
+ __metadata("design:type", Function),
85
+ __metadata("design:paramtypes", [delete_dto_1.DeleteDTO]),
86
+ __metadata("design:returntype", Promise)
87
+ ], SettingsController.prototype, "delete", null);
88
+ exports.SettingsController = SettingsController = __decorate([
89
+ (0, __1.Permission)(),
90
+ (0, common_1.Controller)('settings'),
91
+ __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => settings_service_1.SettingsService))),
92
+ __metadata("design:paramtypes", [settings_service_1.SettingsService])
93
+ ], SettingsController);
94
+ //# sourceMappingURL=settings.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.controller.js","sourceRoot":"","sources":["../../../src/setting/src/settings.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8BAA+C;AAC/C,mDAAgD;AAChD,2CAYwB;AACxB,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,yDAAqD;AAI9C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAEmB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAChD,CAAC;IAIE,AAAN,KAAK,CAAC,WAAW,CAAe,gBAAgB;QAC9C,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC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AA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;gDAEnC;6BAxCU,kBAAkB;IAF9B,IAAA,cAAU,GAAE;IACZ,IAAA,mBAAU,EAAC,UAAU,CAAC;IAGlB,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kCAAe,CAAC,CAAC,CAAA;qCACR,kCAAe;GAHxC,kBAAkB,CAyC9B"}
@@ -0,0 +1,3 @@
1
+ export declare class SettingModule {
2
+ }
3
+ //# sourceMappingURL=settings.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.module.d.ts","sourceRoot":"","sources":["../../../src/setting/src/settings.module.ts"],"names":[],"mappings":"AAOA,qBAUa,aAAa;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.SettingModule = void 0;
10
+ const __1 = require("../../");
11
+ const pagination_1 = require("@hedhog/pagination");
12
+ const prisma_1 = require("@hedhog/prisma");
13
+ const common_1 = require("@nestjs/common");
14
+ const settings_controller_1 = require("./settings.controller");
15
+ const settings_service_1 = require("./settings.service");
16
+ let SettingModule = class SettingModule {
17
+ };
18
+ exports.SettingModule = SettingModule;
19
+ exports.SettingModule = SettingModule = __decorate([
20
+ (0, common_1.Module)({
21
+ providers: [settings_service_1.SettingsService],
22
+ exports: [settings_service_1.SettingsService],
23
+ controllers: [settings_controller_1.SettingsController],
24
+ imports: [
25
+ (0, common_1.forwardRef)(() => __1.AuthModule),
26
+ (0, common_1.forwardRef)(() => prisma_1.PrismaModule),
27
+ (0, common_1.forwardRef)(() => pagination_1.PaginationModule),
28
+ ],
29
+ })
30
+ ], SettingModule);
31
+ //# sourceMappingURL=settings.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.module.js","sourceRoot":"","sources":["../../../src/setting/src/settings.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8BAAoC;AACpC,mDAAsD;AACtD,2CAA8C;AAC9C,2CAAoD;AACpD,+DAA2D;AAC3D,yDAAqD;AAY9C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAVzB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,kCAAe,CAAC;QAC5B,OAAO,EAAE,CAAC,kCAAe,CAAC;QAC1B,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,cAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,6BAAgB,CAAC;SACnC;KACF,CAAC;GACW,aAAa,CAAG"}
@@ -0,0 +1,19 @@
1
+ import { PaginationDTO, PaginationService } from '@hedhog/pagination';
2
+ import { PrismaService } from '@hedhog/prisma';
3
+ import { CreateDTO } from './dto/create.dto';
4
+ import { DeleteDTO } from './dto/delete.dto';
5
+ import { UpdateDTO } from './dto/update.dto';
6
+ export declare class SettingsService {
7
+ private readonly prismaService;
8
+ private readonly paginationService;
9
+ constructor(prismaService: PrismaService, paginationService: PaginationService);
10
+ getSettings(paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
11
+ get(settingId: number): Promise<any>;
12
+ create({ name }: CreateDTO): Promise<any>;
13
+ update({ id, data }: {
14
+ id: number;
15
+ data: UpdateDTO;
16
+ }): Promise<any>;
17
+ delete({ ids }: DeleteDTO): Promise<any>;
18
+ }
19
+ //# sourceMappingURL=settings.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.service.d.ts","sourceRoot":"","sources":["../../../src/setting/src/settings.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,eAAe;IAGxB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,WAAW,CAAC,gBAAgB,EAAE,aAAa;IAmB3C,GAAG,CAAC,SAAS,EAAE,MAAM;IAMrB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;IAM1B,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"}