@hedhog/admin 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. package/README.md +3 -0
  2. package/dist/index.js +12 -16
  3. package/package.json +32 -29
  4. package/src/migrations/migrate-01.ts +107 -0
  5. package/src/migrations/migrate-02.ts +40 -0
  6. package/src/migrations/{1726795818403-migrate.ts → migrate-03.ts} +49 -49
  7. package/src/migrations/{1726795828359-migrate.ts → migrate-04.ts} +1 -1
  8. package/dist/admin.module.d.ts +0 -3
  9. package/dist/admin.module.d.ts.map +0 -1
  10. package/dist/admin.module.js +0 -30
  11. package/dist/admin.module.js.map +0 -1
  12. package/dist/auth/src/auth.controller.d.ts +0 -21
  13. package/dist/auth/src/auth.controller.d.ts.map +0 -1
  14. package/dist/auth/src/auth.controller.js +0 -77
  15. package/dist/auth/src/auth.controller.js.map +0 -1
  16. package/dist/auth/src/auth.module.d.ts +0 -3
  17. package/dist/auth/src/auth.module.d.ts.map +0 -1
  18. package/dist/auth/src/auth.module.js +0 -50
  19. package/dist/auth/src/auth.module.js.map +0 -1
  20. package/dist/auth/src/auth.service.d.ts +0 -36
  21. package/dist/auth/src/auth.service.d.ts.map +0 -1
  22. package/dist/auth/src/auth.service.js +0 -162
  23. package/dist/auth/src/auth.service.js.map +0 -1
  24. package/dist/auth/src/auth.service.spec.d.ts +0 -2
  25. package/dist/auth/src/auth.service.spec.d.ts.map +0 -1
  26. package/dist/auth/src/auth.service.spec.js +0 -17
  27. package/dist/auth/src/auth.service.spec.js.map +0 -1
  28. package/dist/auth/src/decorators/public.decorator.d.ts +0 -3
  29. package/dist/auth/src/decorators/public.decorator.d.ts.map +0 -1
  30. package/dist/auth/src/decorators/public.decorator.js +0 -8
  31. package/dist/auth/src/decorators/public.decorator.js.map +0 -1
  32. package/dist/auth/src/decorators/user.decorator.d.ts +0 -2
  33. package/dist/auth/src/decorators/user.decorator.d.ts.map +0 -1
  34. package/dist/auth/src/decorators/user.decorator.js +0 -12
  35. package/dist/auth/src/decorators/user.decorator.js.map +0 -1
  36. package/dist/auth/src/dto/forget.dto.d.ts +0 -4
  37. package/dist/auth/src/dto/forget.dto.d.ts.map +0 -1
  38. package/dist/auth/src/dto/forget.dto.js +0 -21
  39. package/dist/auth/src/dto/forget.dto.js.map +0 -1
  40. package/dist/auth/src/dto/login.dto.d.ts +0 -5
  41. package/dist/auth/src/dto/login.dto.d.ts.map +0 -1
  42. package/dist/auth/src/dto/login.dto.js +0 -31
  43. package/dist/auth/src/dto/login.dto.js.map +0 -1
  44. package/dist/auth/src/dto/otp.dto.d.ts +0 -5
  45. package/dist/auth/src/dto/otp.dto.d.ts.map +0 -1
  46. package/dist/auth/src/dto/otp.dto.js +0 -27
  47. package/dist/auth/src/dto/otp.dto.js.map +0 -1
  48. package/dist/auth/src/enums/multifactor-type.enum.d.ts +0 -5
  49. package/dist/auth/src/enums/multifactor-type.enum.d.ts.map +0 -1
  50. package/dist/auth/src/enums/multifactor-type.enum.js +0 -9
  51. package/dist/auth/src/enums/multifactor-type.enum.js.map +0 -1
  52. package/dist/auth/src/guards/auth.guard.d.ts +0 -11
  53. package/dist/auth/src/guards/auth.guard.d.ts.map +0 -1
  54. package/dist/auth/src/guards/auth.guard.js +0 -56
  55. package/dist/auth/src/guards/auth.guard.js.map +0 -1
  56. package/dist/auth/src/migrations/index.d.ts +0 -6
  57. package/dist/auth/src/migrations/index.d.ts.map +0 -1
  58. package/dist/auth/src/migrations/index.js +0 -121
  59. package/dist/auth/src/migrations/index.js.map +0 -1
  60. package/dist/auth/src/types/user.type.d.ts +0 -9
  61. package/dist/auth/src/types/user.type.d.ts.map +0 -1
  62. package/dist/auth/src/types/user.type.js +0 -3
  63. package/dist/auth/src/types/user.type.js.map +0 -1
  64. package/dist/file/src/dto/delete.dto.d.ts +0 -4
  65. package/dist/file/src/dto/delete.dto.d.ts.map +0 -1
  66. package/dist/file/src/dto/delete.dto.js +0 -23
  67. package/dist/file/src/dto/delete.dto.js.map +0 -1
  68. package/dist/file/src/file.module.d.ts +0 -3
  69. package/dist/file/src/file.module.d.ts.map +0 -1
  70. package/dist/file/src/file.module.js +0 -29
  71. package/dist/file/src/file.module.js.map +0 -1
  72. package/dist/file/src/file.service.d.ts +0 -12
  73. package/dist/file/src/file.service.d.ts.map +0 -1
  74. package/dist/file/src/file.service.js +0 -59
  75. package/dist/file/src/file.service.js.map +0 -1
  76. package/dist/file/src/migrations/index.d.ts +0 -6
  77. package/dist/file/src/migrations/index.d.ts.map +0 -1
  78. package/dist/file/src/migrations/index.js +0 -137
  79. package/dist/file/src/migrations/index.js.map +0 -1
  80. package/dist/index.d.ts +0 -18
  81. package/dist/index.d.ts.map +0 -1
  82. package/dist/index.js.map +0 -1
  83. package/dist/mail/src/enums/mail-configuration-type.enum.d.ts +0 -6
  84. package/dist/mail/src/enums/mail-configuration-type.enum.d.ts.map +0 -1
  85. package/dist/mail/src/enums/mail-configuration-type.enum.js +0 -10
  86. package/dist/mail/src/enums/mail-configuration-type.enum.js.map +0 -1
  87. package/dist/mail/src/interfaces/index.d.ts +0 -3
  88. package/dist/mail/src/interfaces/index.d.ts.map +0 -1
  89. package/dist/mail/src/interfaces/index.js +0 -19
  90. package/dist/mail/src/interfaces/index.js.map +0 -1
  91. package/dist/mail/src/interfaces/mail-module-options.interface.d.ts +0 -32
  92. package/dist/mail/src/interfaces/mail-module-options.interface.d.ts.map +0 -1
  93. package/dist/mail/src/interfaces/mail-module-options.interface.js +0 -3
  94. package/dist/mail/src/interfaces/mail-module-options.interface.js.map +0 -1
  95. package/dist/mail/src/interfaces/mail-type.d.ts +0 -13
  96. package/dist/mail/src/interfaces/mail-type.d.ts.map +0 -1
  97. package/dist/mail/src/interfaces/mail-type.js +0 -3
  98. package/dist/mail/src/interfaces/mail-type.js.map +0 -1
  99. package/dist/mail/src/mail.consts.d.ts +0 -17
  100. package/dist/mail/src/mail.consts.d.ts.map +0 -1
  101. package/dist/mail/src/mail.consts.js +0 -5
  102. package/dist/mail/src/mail.consts.js.map +0 -1
  103. package/dist/mail/src/mail.module.d.ts +0 -8
  104. package/dist/mail/src/mail.module.d.ts.map +0 -1
  105. package/dist/mail/src/mail.module.js +0 -51
  106. package/dist/mail/src/mail.module.js.map +0 -1
  107. package/dist/mail/src/mail.service.d.ts +0 -14
  108. package/dist/mail/src/mail.service.d.ts.map +0 -1
  109. package/dist/mail/src/mail.service.js +0 -281
  110. package/dist/mail/src/mail.service.js.map +0 -1
  111. package/dist/mail/src/mail.service.spec.d.ts +0 -2
  112. package/dist/mail/src/mail.service.spec.d.ts.map +0 -1
  113. package/dist/mail/src/mail.service.spec.js +0 -17
  114. package/dist/mail/src/mail.service.spec.js.map +0 -1
  115. package/dist/menu/src/dto/create.dto.d.ts +0 -8
  116. package/dist/menu/src/dto/create.dto.d.ts.map +0 -1
  117. package/dist/menu/src/dto/create.dto.js +0 -44
  118. package/dist/menu/src/dto/create.dto.js.map +0 -1
  119. package/dist/menu/src/dto/delete.dto.d.ts +0 -4
  120. package/dist/menu/src/dto/delete.dto.d.ts.map +0 -1
  121. package/dist/menu/src/dto/delete.dto.js +0 -24
  122. package/dist/menu/src/dto/delete.dto.js.map +0 -1
  123. package/dist/menu/src/dto/order.dto.d.ts +0 -4
  124. package/dist/menu/src/dto/order.dto.d.ts.map +0 -1
  125. package/dist/menu/src/dto/order.dto.js +0 -23
  126. package/dist/menu/src/dto/order.dto.js.map +0 -1
  127. package/dist/menu/src/dto/update.dto.d.ts +0 -7
  128. package/dist/menu/src/dto/update.dto.d.ts.map +0 -1
  129. package/dist/menu/src/dto/update.dto.js +0 -37
  130. package/dist/menu/src/dto/update.dto.js.map +0 -1
  131. package/dist/menu/src/menu.controller.d.ts +0 -19
  132. package/dist/menu/src/menu.controller.d.ts.map +0 -1
  133. package/dist/menu/src/menu.controller.js +0 -117
  134. package/dist/menu/src/menu.controller.js.map +0 -1
  135. package/dist/menu/src/menu.module.d.ts +0 -3
  136. package/dist/menu/src/menu.module.d.ts.map +0 -1
  137. package/dist/menu/src/menu.module.js +0 -31
  138. package/dist/menu/src/menu.module.js.map +0 -1
  139. package/dist/menu/src/menu.service.d.ts +0 -23
  140. package/dist/menu/src/menu.service.d.ts.map +0 -1
  141. package/dist/menu/src/menu.service.js +0 -117
  142. package/dist/menu/src/menu.service.js.map +0 -1
  143. package/dist/menu/src/migrations/index.d.ts +0 -7
  144. package/dist/menu/src/migrations/index.d.ts.map +0 -1
  145. package/dist/menu/src/migrations/index.js +0 -101
  146. package/dist/menu/src/migrations/index.js.map +0 -1
  147. package/dist/migrations/1726795702341-migrate.d.ts +0 -6
  148. package/dist/migrations/1726795702341-migrate.d.ts.map +0 -1
  149. package/dist/migrations/1726795702341-migrate.js +0 -121
  150. package/dist/migrations/1726795702341-migrate.js.map +0 -1
  151. package/dist/migrations/1726795734665-migrate.d.ts +0 -6
  152. package/dist/migrations/1726795734665-migrate.d.ts.map +0 -1
  153. package/dist/migrations/1726795734665-migrate.js +0 -40
  154. package/dist/migrations/1726795734665-migrate.js.map +0 -1
  155. package/dist/migrations/1726795818403-migrate.d.ts +0 -7
  156. package/dist/migrations/1726795818403-migrate.d.ts.map +0 -1
  157. package/dist/migrations/1726795818403-migrate.js +0 -101
  158. package/dist/migrations/1726795818403-migrate.js.map +0 -1
  159. package/dist/migrations/1726795828359-migrate.d.ts +0 -6
  160. package/dist/migrations/1726795828359-migrate.d.ts.map +0 -1
  161. package/dist/migrations/1726795828359-migrate.js +0 -525
  162. package/dist/migrations/1726795828359-migrate.js.map +0 -1
  163. package/dist/permission/src/decorators/permission.decorator.d.ts +0 -3
  164. package/dist/permission/src/decorators/permission.decorator.d.ts.map +0 -1
  165. package/dist/permission/src/decorators/permission.decorator.js +0 -8
  166. package/dist/permission/src/decorators/permission.decorator.js.map +0 -1
  167. package/dist/permission/src/dto/create.dto.d.ts +0 -5
  168. package/dist/permission/src/dto/create.dto.d.ts.map +0 -1
  169. package/dist/permission/src/dto/create.dto.js +0 -27
  170. package/dist/permission/src/dto/create.dto.js.map +0 -1
  171. package/dist/permission/src/dto/delete.dto.d.ts +0 -4
  172. package/dist/permission/src/dto/delete.dto.d.ts.map +0 -1
  173. package/dist/permission/src/dto/delete.dto.js +0 -23
  174. package/dist/permission/src/dto/delete.dto.js.map +0 -1
  175. package/dist/permission/src/dto/update.dto.d.ts +0 -5
  176. package/dist/permission/src/dto/update.dto.d.ts.map +0 -1
  177. package/dist/permission/src/dto/update.dto.js +0 -27
  178. package/dist/permission/src/dto/update.dto.js.map +0 -1
  179. package/dist/permission/src/guards/permission.guard.d.ts +0 -11
  180. package/dist/permission/src/guards/permission.guard.d.ts.map +0 -1
  181. package/dist/permission/src/guards/permission.guard.js +0 -99
  182. package/dist/permission/src/guards/permission.guard.js.map +0 -1
  183. package/dist/permission/src/migrations/index.d.ts +0 -6
  184. package/dist/permission/src/migrations/index.d.ts.map +0 -1
  185. package/dist/permission/src/migrations/index.js +0 -520
  186. package/dist/permission/src/migrations/index.js.map +0 -1
  187. package/dist/permission/src/permission.controller.d.ts +0 -14
  188. package/dist/permission/src/permission.controller.d.ts.map +0 -1
  189. package/dist/permission/src/permission.controller.js +0 -95
  190. package/dist/permission/src/permission.controller.js.map +0 -1
  191. package/dist/permission/src/permission.module.d.ts +0 -3
  192. package/dist/permission/src/permission.module.d.ts.map +0 -1
  193. package/dist/permission/src/permission.module.js +0 -39
  194. package/dist/permission/src/permission.module.js.map +0 -1
  195. package/dist/permission/src/permission.service.d.ts +0 -19
  196. package/dist/permission/src/permission.service.d.ts.map +0 -1
  197. package/dist/permission/src/permission.service.js +0 -73
  198. package/dist/permission/src/permission.service.js.map +0 -1
  199. package/dist/permission/src/types/permission.types.d.ts +0 -33
  200. package/dist/permission/src/types/permission.types.d.ts.map +0 -1
  201. package/dist/permission/src/types/permission.types.js +0 -3
  202. package/dist/permission/src/types/permission.types.js.map +0 -1
  203. package/dist/screen/src/dto/create.dto.d.ts +0 -7
  204. package/dist/screen/src/dto/create.dto.d.ts.map +0 -1
  205. package/dist/screen/src/dto/create.dto.js +0 -37
  206. package/dist/screen/src/dto/create.dto.js.map +0 -1
  207. package/dist/screen/src/dto/delete.dto.d.ts +0 -4
  208. package/dist/screen/src/dto/delete.dto.d.ts.map +0 -1
  209. package/dist/screen/src/dto/delete.dto.js +0 -23
  210. package/dist/screen/src/dto/delete.dto.js.map +0 -1
  211. package/dist/screen/src/dto/update.dto.d.ts +0 -7
  212. package/dist/screen/src/dto/update.dto.d.ts.map +0 -1
  213. package/dist/screen/src/dto/update.dto.js +0 -37
  214. package/dist/screen/src/dto/update.dto.js.map +0 -1
  215. package/dist/screen/src/migrations/index.d.ts +0 -6
  216. package/dist/screen/src/migrations/index.d.ts.map +0 -1
  217. package/dist/screen/src/migrations/index.js +0 -40
  218. package/dist/screen/src/migrations/index.js.map +0 -1
  219. package/dist/screen/src/screen.controller.d.ts +0 -14
  220. package/dist/screen/src/screen.controller.d.ts.map +0 -1
  221. package/dist/screen/src/screen.controller.js +0 -94
  222. package/dist/screen/src/screen.controller.js.map +0 -1
  223. package/dist/screen/src/screen.module.d.ts +0 -3
  224. package/dist/screen/src/screen.module.d.ts.map +0 -1
  225. package/dist/screen/src/screen.module.js +0 -31
  226. package/dist/screen/src/screen.module.js.map +0 -1
  227. package/dist/screen/src/screen.service.d.ts +0 -19
  228. package/dist/screen/src/screen.service.d.ts.map +0 -1
  229. package/dist/screen/src/screen.service.js +0 -73
  230. package/dist/screen/src/screen.service.js.map +0 -1
  231. package/dist/setting/src/dto/create.dto.d.ts +0 -4
  232. package/dist/setting/src/dto/create.dto.d.ts.map +0 -1
  233. package/dist/setting/src/dto/create.dto.js +0 -22
  234. package/dist/setting/src/dto/create.dto.js.map +0 -1
  235. package/dist/setting/src/dto/delete.dto.d.ts +0 -4
  236. package/dist/setting/src/dto/delete.dto.d.ts.map +0 -1
  237. package/dist/setting/src/dto/delete.dto.js +0 -23
  238. package/dist/setting/src/dto/delete.dto.js.map +0 -1
  239. package/dist/setting/src/dto/update.dto.d.ts +0 -4
  240. package/dist/setting/src/dto/update.dto.d.ts.map +0 -1
  241. package/dist/setting/src/dto/update.dto.js +0 -8
  242. package/dist/setting/src/dto/update.dto.js.map +0 -1
  243. package/dist/setting/src/migrations/index.d.ts +0 -6
  244. package/dist/setting/src/migrations/index.d.ts.map +0 -1
  245. package/dist/setting/src/migrations/index.js +0 -67
  246. package/dist/setting/src/migrations/index.js.map +0 -1
  247. package/dist/setting/src/settings.controller.d.ts +0 -14
  248. package/dist/setting/src/settings.controller.d.ts.map +0 -1
  249. package/dist/setting/src/settings.controller.js +0 -94
  250. package/dist/setting/src/settings.controller.js.map +0 -1
  251. package/dist/setting/src/settings.module.d.ts +0 -3
  252. package/dist/setting/src/settings.module.d.ts.map +0 -1
  253. package/dist/setting/src/settings.module.js +0 -31
  254. package/dist/setting/src/settings.module.js.map +0 -1
  255. package/dist/setting/src/settings.service.d.ts +0 -19
  256. package/dist/setting/src/settings.service.d.ts.map +0 -1
  257. package/dist/setting/src/settings.service.js +0 -70
  258. package/dist/setting/src/settings.service.js.map +0 -1
  259. package/dist/user/src/constants/user.constants.d.ts +0 -2
  260. package/dist/user/src/constants/user.constants.d.ts.map +0 -1
  261. package/dist/user/src/constants/user.constants.js +0 -5
  262. package/dist/user/src/constants/user.constants.js.map +0 -1
  263. package/dist/user/src/dto/create.dto.d.ts +0 -6
  264. package/dist/user/src/dto/create.dto.d.ts.map +0 -1
  265. package/dist/user/src/dto/create.dto.js +0 -37
  266. package/dist/user/src/dto/create.dto.js.map +0 -1
  267. package/dist/user/src/dto/delete.dto.d.ts +0 -4
  268. package/dist/user/src/dto/delete.dto.d.ts.map +0 -1
  269. package/dist/user/src/dto/delete.dto.js +0 -23
  270. package/dist/user/src/dto/delete.dto.js.map +0 -1
  271. package/dist/user/src/dto/update.dto.d.ts +0 -8
  272. package/dist/user/src/dto/update.dto.d.ts.map +0 -1
  273. package/dist/user/src/dto/update.dto.js +0 -50
  274. package/dist/user/src/dto/update.dto.js.map +0 -1
  275. package/dist/user/src/user.controller.d.ts +0 -14
  276. package/dist/user/src/user.controller.d.ts.map +0 -1
  277. package/dist/user/src/user.controller.js +0 -94
  278. package/dist/user/src/user.controller.js.map +0 -1
  279. package/dist/user/src/user.module.d.ts +0 -3
  280. package/dist/user/src/user.module.d.ts.map +0 -1
  281. package/dist/user/src/user.module.js +0 -31
  282. package/dist/user/src/user.module.js.map +0 -1
  283. package/dist/user/src/user.service.d.ts +0 -20
  284. package/dist/user/src/user.service.d.ts.map +0 -1
  285. package/dist/user/src/user.service.js +0 -84
  286. package/dist/user/src/user.service.js.map +0 -1
  287. package/dist/user/src/user.service.spec.d.ts +0 -2
  288. package/dist/user/src/user.service.spec.d.ts.map +0 -1
  289. package/dist/user/src/user.service.spec.js +0 -17
  290. package/dist/user/src/user.service.spec.js.map +0 -1
  291. package/src/migrations/1726795702341-migrate.ts +0 -107
  292. package/src/migrations/1726795734665-migrate.ts +0 -40
@@ -1,70 +0,0 @@
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.SettingsService = 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 SettingsService = class SettingsService {
20
- constructor(prismaService, paginationService) {
21
- this.prismaService = prismaService;
22
- this.paginationService = paginationService;
23
- }
24
- async getSettings(paginationParams) {
25
- const fields = ['name'];
26
- const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
27
- return this.paginationService.paginate(this.prismaService.settings, paginationParams, {
28
- where: {
29
- OR,
30
- },
31
- });
32
- }
33
- async get(settingId) {
34
- return this.prismaService.settings.findUnique({
35
- where: { id: settingId },
36
- });
37
- }
38
- async create({ name }) {
39
- return this.prismaService.settings.create({
40
- data: { name },
41
- });
42
- }
43
- async update({ id, data }) {
44
- return this.prismaService.settings.update({
45
- where: { id },
46
- data,
47
- });
48
- }
49
- async delete({ ids }) {
50
- if (ids == undefined || ids == null) {
51
- throw new common_1.BadRequestException(`You must select at least one setting to delete.`);
52
- }
53
- return this.prismaService.settings.deleteMany({
54
- where: {
55
- id: {
56
- in: ids,
57
- },
58
- },
59
- });
60
- }
61
- };
62
- exports.SettingsService = SettingsService;
63
- exports.SettingsService = SettingsService = __decorate([
64
- (0, common_1.Injectable)(),
65
- __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => prisma_1.PrismaService))),
66
- __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => pagination_1.PaginationService))),
67
- __metadata("design:paramtypes", [prisma_1.PrismaService,
68
- pagination_1.PaginationService])
69
- ], SettingsService);
70
- //# sourceMappingURL=settings.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"settings.service.js","sourceRoot":"","sources":["../../../src/setting/src/settings.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAMjB,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,gBAA+B;QAC/C,MAAM,MAAM,GAAG,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AE;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,eAAe,CA6D3B"}
@@ -1,2 +0,0 @@
1
- export declare const SALT_ROUNDS = 10;
2
- //# sourceMappingURL=user.constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.constants.d.ts","sourceRoot":"","sources":["../../../../src/user/src/constants/user.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,KAAK,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SALT_ROUNDS = void 0;
4
- exports.SALT_ROUNDS = 10;
5
- //# sourceMappingURL=user.constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.constants.js","sourceRoot":"","sources":["../../../../src/user/src/constants/user.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,EAAE,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare class CreateDTO {
2
- name: string;
3
- email: string;
4
- password: string;
5
- }
6
- //# sourceMappingURL=create.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../../src/user/src/dto/create.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAEpB,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAed,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -1,37 +0,0 @@
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
- __metadata("design:type", String)
20
- ], CreateDTO.prototype, "name", void 0);
21
- __decorate([
22
- (0, class_validator_1.IsEmail)({}, { message: 'O email deve ser um email válido' }),
23
- __metadata("design:type", String)
24
- ], CreateDTO.prototype, "email", void 0);
25
- __decorate([
26
- (0, class_validator_1.IsStrongPassword)({
27
- minLength: 6,
28
- minLowercase: 1,
29
- minUppercase: 0,
30
- minNumbers: 0,
31
- minSymbols: 0,
32
- }, {
33
- message: 'A senha deve ter pelo menos 6 caracteres, contendo pelo menos uma letra minúscula',
34
- }),
35
- __metadata("design:type", String)
36
- ], CreateDTO.prototype, "password", void 0);
37
- //# sourceMappingURL=create.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../../src/user/src/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsE;AAEtE,MAAa,SAAS;CAqBrB;AArBD,8BAqBC;AAnBC;IADC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;;uCACvC;AAGb;IADC,IAAA,yBAAO,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;;wCAChD;AAed;IAbC,IAAA,kCAAgB,EACf;QACE,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,CAAC;KACd,EACD;QACE,OAAO,EACL,mFAAmF;KACtF,CACF;;2CACgB"}
@@ -1,4 +0,0 @@
1
- export declare class DeleteDTO {
2
- ids: number[];
3
- }
4
- //# sourceMappingURL=delete.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete.dto.d.ts","sourceRoot":"","sources":["../../../../src/user/src/dto/delete.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAIpB,GAAG,EAAE,MAAM,EAAE,CAAC;CACf"}
@@ -1,23 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete.dto.js","sourceRoot":"","sources":["../../../../src/user/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"}
@@ -1,8 +0,0 @@
1
- export declare class UpdateDTO {
2
- name?: string;
3
- email?: string;
4
- password?: string;
5
- multifactor_id?: number;
6
- code?: string;
7
- }
8
- //# sourceMappingURL=update.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../../src/user/src/dto/update.dto.ts"],"names":[],"mappings":"AAQA,qBAAa,SAAS;IAGpB,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,KAAK,CAAC,EAAE,MAAM,CAAC;IAgBf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAIlB,cAAc,CAAC,EAAE,MAAM,CAAC;IAIxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -1,50 +0,0 @@
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.UpdateDTO = void 0;
13
- const class_validator_1 = require("class-validator");
14
- class UpdateDTO {
15
- }
16
- exports.UpdateDTO = UpdateDTO;
17
- __decorate([
18
- (0, class_validator_1.IsString)({ message: 'The name must be a string' }),
19
- (0, class_validator_1.IsOptional)(),
20
- __metadata("design:type", String)
21
- ], UpdateDTO.prototype, "name", void 0);
22
- __decorate([
23
- (0, class_validator_1.IsEmail)({}, { message: 'The email must be a valid email' }),
24
- (0, class_validator_1.IsOptional)(),
25
- __metadata("design:type", String)
26
- ], UpdateDTO.prototype, "email", void 0);
27
- __decorate([
28
- (0, class_validator_1.IsOptional)(),
29
- (0, class_validator_1.IsStrongPassword)({
30
- minLength: 6,
31
- minLowercase: 1,
32
- minUppercase: 0,
33
- minNumbers: 0,
34
- minSymbols: 0,
35
- }, {
36
- message: 'The password must be at least 6 characters long and contain at least one lowercase',
37
- }),
38
- __metadata("design:type", String)
39
- ], UpdateDTO.prototype, "password", void 0);
40
- __decorate([
41
- (0, class_validator_1.IsOptional)(),
42
- (0, class_validator_1.IsInt)({ message: 'The multifactor_id must be an integer' }),
43
- __metadata("design:type", Number)
44
- ], UpdateDTO.prototype, "multifactor_id", void 0);
45
- __decorate([
46
- (0, class_validator_1.IsOptional)(),
47
- (0, class_validator_1.IsString)({ message: 'The code must be a string' }),
48
- __metadata("design:type", String)
49
- ], UpdateDTO.prototype, "code", void 0);
50
- //# sourceMappingURL=update.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../../src/user/src/dto/update.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMyB;AAEzB,MAAa,SAAS;CAgCrB;AAhCD,8BAgCC;AA7BC;IAFC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC;IAClD,IAAA,4BAAU,GAAE;;uCACC;AAId;IAFC,IAAA,yBAAO,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;IAC3D,IAAA,4BAAU,GAAE;;wCACE;AAgBf;IAdC,IAAA,4BAAU,GAAE;IACZ,IAAA,kCAAgB,EACf;QACE,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,CAAC;KACd,EACD;QACE,OAAO,EACL,oFAAoF;KACvF,CACF;;2CACiB;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,EAAC,EAAE,OAAO,EAAE,uCAAuC,EAAE,CAAC;;iDACpC;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC;;uCACrC"}
@@ -1,14 +0,0 @@
1
- import { CreateDTO } from './dto/create.dto';
2
- import { DeleteDTO } from './dto/delete.dto';
3
- import { UpdateDTO } from './dto/update.dto';
4
- import { UserService } from './user.service';
5
- export declare class UserController {
6
- private readonly userService;
7
- constructor(userService: UserService);
8
- getUsers(paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
9
- show(userId: number): Promise<any>;
10
- create(data: CreateDTO): Promise<any>;
11
- update(userId: number, data: UpdateDTO): Promise<any>;
12
- delete(data: DeleteDTO): Promise<any>;
13
- }
14
- //# sourceMappingURL=user.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.controller.d.ts","sourceRoot":"","sources":["../../../src/user/src/user.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,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,qBAEa,cAAc;IAGvB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAKrC,QAAQ,CAAe,gBAAgB,KAAA;IAMvC,IAAI,CAAgC,MAAM,EAAE,MAAM;IAMxD,MAAM,CAAS,IAAI,EAAE,SAAS;IAMxB,MAAM,CACqB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,SAAS;IAUnB,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
@@ -1,94 +0,0 @@
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.UserController = 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 user_service_1 = require("./user.service");
23
- let UserController = class UserController {
24
- constructor(userService) {
25
- this.userService = userService;
26
- }
27
- async getUsers(paginationParams) {
28
- return this.userService.getUsers(paginationParams);
29
- }
30
- async show(userId) {
31
- return this.userService.get(userId);
32
- }
33
- create(data) {
34
- return this.userService.create(data);
35
- }
36
- async update(userId, data) {
37
- return this.userService.update({
38
- id: userId,
39
- data,
40
- });
41
- }
42
- async delete(data) {
43
- return this.userService.delete(data);
44
- }
45
- };
46
- exports.UserController = UserController;
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
- ], UserController.prototype, "getUsers", null);
55
- __decorate([
56
- (0, common_1.UseGuards)(__1.AuthGuard),
57
- (0, common_1.Get)(':userId'),
58
- __param(0, (0, common_1.Param)('userId', common_1.ParseIntPipe)),
59
- __metadata("design:type", Function),
60
- __metadata("design:paramtypes", [Number]),
61
- __metadata("design:returntype", Promise)
62
- ], UserController.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
- ], UserController.prototype, "create", null);
71
- __decorate([
72
- (0, common_1.UseGuards)(__1.AuthGuard),
73
- (0, common_1.Patch)(':userId'),
74
- __param(0, (0, common_1.Param)('userId', 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
- ], UserController.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
- ], UserController.prototype, "delete", null);
88
- exports.UserController = UserController = __decorate([
89
- (0, __1.Permission)(),
90
- (0, common_1.Controller)('users'),
91
- __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => user_service_1.UserService))),
92
- __metadata("design:paramtypes", [user_service_1.UserService])
93
- ], UserController);
94
- //# sourceMappingURL=user.controller.js.map
@@ -1 +0,0 @@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;AAID;IAFC,IAAA,kBAAS,EAAC,aAAS,CAAC;IACpB,IAAA,aAAI,GAAE;IACC,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;4CAE7B;AAIK;IAFL,IAAA,kBAAS,EAAC,aAAS,CAAC;IACpB,IAAA,cAAK,EAAC,SAAS,CAAC;IAEd,WAAA,IAAA,cAAK,EAAC,QAAQ,EAAE,qBAAY,CAAC,CAAA;IAC7B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,sBAAS;;4CAMxB;AAIK;IAFL,IAAA,kBAAS,EAAC,aAAS,CAAC;IACpB,IAAA,eAAM,GAAE;IACK,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;4CAEnC;yBAxCU,cAAc;IAF1B,IAAA,cAAU,GAAE;IACZ,IAAA,mBAAU,EAAC,OAAO,CAAC;IAGf,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAW,CAAC,CAAC,CAAA;qCACR,0BAAW;GAHhC,cAAc,CAyC1B"}
@@ -1,3 +0,0 @@
1
- export declare class UserModule {
2
- }
3
- //# sourceMappingURL=user.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.module.d.ts","sourceRoot":"","sources":["../../../src/user/src/user.module.ts"],"names":[],"mappings":"AAOA,qBAUa,UAAU;CAAG"}
@@ -1,31 +0,0 @@
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.UserModule = 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 user_controller_1 = require("./user.controller");
15
- const user_service_1 = require("./user.service");
16
- let UserModule = class UserModule {
17
- };
18
- exports.UserModule = UserModule;
19
- exports.UserModule = UserModule = __decorate([
20
- (0, common_1.Module)({
21
- providers: [user_service_1.UserService],
22
- exports: [user_service_1.UserService],
23
- controllers: [user_controller_1.UserController],
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
- ], UserModule);
31
- //# sourceMappingURL=user.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.module.js","sourceRoot":"","sources":["../../../src/user/src/user.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8BAAoC;AACpC,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,cAAU,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"}
@@ -1,20 +0,0 @@
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 UserService {
7
- private readonly prismaService;
8
- private readonly paginationService;
9
- constructor(prismaService: PrismaService, paginationService: PaginationService);
10
- getUsers(paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
11
- get(userId: number): Promise<any>;
12
- hashPassword(password: string): Promise<string>;
13
- create({ email, name, password }: CreateDTO): Promise<any>;
14
- update({ id, data }: {
15
- id: number;
16
- data: UpdateDTO;
17
- }): Promise<any>;
18
- delete({ ids }: DeleteDTO): Promise<any>;
19
- }
20
- //# sourceMappingURL=user.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.service.d.ts","sourceRoot":"","sources":["../../../src/user/src/user.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAS/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;IAkBxC,GAAG,CAAC,MAAM,EAAE,MAAM;IAIlB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK/C,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,SAAS;IAY3C,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;CAoBhC"}
@@ -1,84 +0,0 @@
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.UserService = void 0;
16
- const pagination_1 = require("@hedhog/pagination");
17
- const prisma_1 = require("@hedhog/prisma");
18
- const common_1 = require("@nestjs/common");
19
- const bcrypt_1 = require("bcrypt");
20
- const user_constants_1 = require("./constants/user.constants");
21
- let UserService = class UserService {
22
- constructor(prismaService, paginationService) {
23
- this.prismaService = prismaService;
24
- this.paginationService = paginationService;
25
- }
26
- async getUsers(paginationParams) {
27
- const fields = ['name', 'email'];
28
- const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
29
- return this.paginationService.paginate(this.prismaService.users, paginationParams, {
30
- where: {
31
- OR,
32
- },
33
- });
34
- }
35
- async get(userId) {
36
- return this.prismaService.users.findUnique({ where: { id: userId } });
37
- }
38
- async hashPassword(password) {
39
- const salt = await (0, bcrypt_1.genSalt)(user_constants_1.SALT_ROUNDS);
40
- return (0, bcrypt_1.hash)(password, salt);
41
- }
42
- async create({ email, name, password }) {
43
- const hashedPassword = await this.hashPassword(password);
44
- return this.prismaService.users.create({
45
- data: {
46
- email,
47
- name,
48
- password: hashedPassword,
49
- },
50
- });
51
- }
52
- async update({ id, data }) {
53
- return this.prismaService.users.update({
54
- where: { id },
55
- data,
56
- });
57
- }
58
- async delete({ ids }) {
59
- if (ids == undefined || ids == null) {
60
- throw new common_1.BadRequestException(`You must select at least one user to delete.`);
61
- }
62
- return this.prismaService.users.deleteMany({
63
- where: {
64
- id: {
65
- in: ids,
66
- },
67
- email: {
68
- not: {
69
- startsWith: 'root@',
70
- },
71
- },
72
- },
73
- });
74
- }
75
- };
76
- exports.UserService = UserService;
77
- exports.UserService = UserService = __decorate([
78
- (0, common_1.Injectable)(),
79
- __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => prisma_1.PrismaService))),
80
- __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => pagination_1.PaginationService))),
81
- __metadata("design:paramtypes", [prisma_1.PrismaService,
82
- pagination_1.PaginationService])
83
- ], UserService);
84
- //# sourceMappingURL=user.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../../src/user/src/user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AACxB,mCAAuC;AACvC,+DAAyD;AAMlD,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,QAAQ,CAAC,gBAA+B;QAC5C,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,uBAAuB,CACnD,MAAM,EACN,gBAAgB,CACjB,CAAC;QAEF,OAAO,IAAI,CAAC,iBAA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C;YACzC,KAAK,EAAE;gBACL,EAAE,EAAE;oBACF,EAAE,EAAE,GAAG;iBACR;gBACD,KAAK,EAAE;oBACL,GAAG,EAAE;wBACH,UAAU,EAAE,OAAO;qBACpB;iBACF;aACF;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA1EY,kCAAW;sBAAX,WAAW;IADvB,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,WAAW,CA0EvB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=user.service.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.service.spec.d.ts","sourceRoot":"","sources":["../../../src/user/src/user.service.spec.ts"],"names":[],"mappings":""}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const testing_1 = require("@nestjs/testing");
4
- const user_service_1 = require("./user.service");
5
- describe('UserService', () => {
6
- let service;
7
- beforeEach(async () => {
8
- const module = await testing_1.Test.createTestingModule({
9
- providers: [user_service_1.UserService],
10
- }).compile();
11
- service = module.get(user_service_1.UserService);
12
- });
13
- it('should be defined', () => {
14
- expect(service).toBeDefined();
15
- });
16
- });
17
- //# sourceMappingURL=user.service.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.service.spec.js","sourceRoot":"","sources":["../../../src/user/src/user.service.spec.ts"],"names":[],"mappings":";;AAAA,6CAAsD;AACtD,iDAA6C;AAE7C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,OAAoB,CAAC;IAEzB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,MAAM,GAAkB,MAAM,cAAI,CAAC,mBAAmB,CAAC;YAC3D,SAAS,EAAE,CAAC,0BAAW,CAAC;SACzB,CAAC,CAAC,OAAO,EAAE,CAAC;QAEb,OAAO,GAAG,MAAM,CAAC,GAAG,CAAc,0BAAW,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC3B,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}