@hedhog/admin 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. package/dist/index.js +12 -16
  2. package/package.json +3 -2
  3. package/dist/admin.module.d.ts +0 -3
  4. package/dist/admin.module.d.ts.map +0 -1
  5. package/dist/admin.module.js +0 -30
  6. package/dist/admin.module.js.map +0 -1
  7. package/dist/auth/src/auth.controller.d.ts +0 -21
  8. package/dist/auth/src/auth.controller.d.ts.map +0 -1
  9. package/dist/auth/src/auth.controller.js +0 -77
  10. package/dist/auth/src/auth.controller.js.map +0 -1
  11. package/dist/auth/src/auth.module.d.ts +0 -3
  12. package/dist/auth/src/auth.module.d.ts.map +0 -1
  13. package/dist/auth/src/auth.module.js +0 -50
  14. package/dist/auth/src/auth.module.js.map +0 -1
  15. package/dist/auth/src/auth.service.d.ts +0 -36
  16. package/dist/auth/src/auth.service.d.ts.map +0 -1
  17. package/dist/auth/src/auth.service.js +0 -162
  18. package/dist/auth/src/auth.service.js.map +0 -1
  19. package/dist/auth/src/auth.service.spec.d.ts +0 -2
  20. package/dist/auth/src/auth.service.spec.d.ts.map +0 -1
  21. package/dist/auth/src/auth.service.spec.js +0 -17
  22. package/dist/auth/src/auth.service.spec.js.map +0 -1
  23. package/dist/auth/src/decorators/public.decorator.d.ts +0 -3
  24. package/dist/auth/src/decorators/public.decorator.d.ts.map +0 -1
  25. package/dist/auth/src/decorators/public.decorator.js +0 -8
  26. package/dist/auth/src/decorators/public.decorator.js.map +0 -1
  27. package/dist/auth/src/decorators/user.decorator.d.ts +0 -2
  28. package/dist/auth/src/decorators/user.decorator.d.ts.map +0 -1
  29. package/dist/auth/src/decorators/user.decorator.js +0 -12
  30. package/dist/auth/src/decorators/user.decorator.js.map +0 -1
  31. package/dist/auth/src/dto/forget.dto.d.ts +0 -4
  32. package/dist/auth/src/dto/forget.dto.d.ts.map +0 -1
  33. package/dist/auth/src/dto/forget.dto.js +0 -21
  34. package/dist/auth/src/dto/forget.dto.js.map +0 -1
  35. package/dist/auth/src/dto/login.dto.d.ts +0 -5
  36. package/dist/auth/src/dto/login.dto.d.ts.map +0 -1
  37. package/dist/auth/src/dto/login.dto.js +0 -31
  38. package/dist/auth/src/dto/login.dto.js.map +0 -1
  39. package/dist/auth/src/dto/otp.dto.d.ts +0 -5
  40. package/dist/auth/src/dto/otp.dto.d.ts.map +0 -1
  41. package/dist/auth/src/dto/otp.dto.js +0 -27
  42. package/dist/auth/src/dto/otp.dto.js.map +0 -1
  43. package/dist/auth/src/enums/multifactor-type.enum.d.ts +0 -5
  44. package/dist/auth/src/enums/multifactor-type.enum.d.ts.map +0 -1
  45. package/dist/auth/src/enums/multifactor-type.enum.js +0 -9
  46. package/dist/auth/src/enums/multifactor-type.enum.js.map +0 -1
  47. package/dist/auth/src/guards/auth.guard.d.ts +0 -11
  48. package/dist/auth/src/guards/auth.guard.d.ts.map +0 -1
  49. package/dist/auth/src/guards/auth.guard.js +0 -56
  50. package/dist/auth/src/guards/auth.guard.js.map +0 -1
  51. package/dist/auth/src/migrations/index.d.ts +0 -6
  52. package/dist/auth/src/migrations/index.d.ts.map +0 -1
  53. package/dist/auth/src/migrations/index.js +0 -121
  54. package/dist/auth/src/migrations/index.js.map +0 -1
  55. package/dist/auth/src/types/user.type.d.ts +0 -9
  56. package/dist/auth/src/types/user.type.d.ts.map +0 -1
  57. package/dist/auth/src/types/user.type.js +0 -3
  58. package/dist/auth/src/types/user.type.js.map +0 -1
  59. package/dist/index.d.ts +0 -18
  60. package/dist/index.d.ts.map +0 -1
  61. package/dist/index.js.map +0 -1
  62. package/dist/menu/src/dto/create.dto.d.ts +0 -8
  63. package/dist/menu/src/dto/create.dto.d.ts.map +0 -1
  64. package/dist/menu/src/dto/create.dto.js +0 -44
  65. package/dist/menu/src/dto/create.dto.js.map +0 -1
  66. package/dist/menu/src/dto/delete.dto.d.ts +0 -4
  67. package/dist/menu/src/dto/delete.dto.d.ts.map +0 -1
  68. package/dist/menu/src/dto/delete.dto.js +0 -24
  69. package/dist/menu/src/dto/delete.dto.js.map +0 -1
  70. package/dist/menu/src/dto/order.dto.d.ts +0 -4
  71. package/dist/menu/src/dto/order.dto.d.ts.map +0 -1
  72. package/dist/menu/src/dto/order.dto.js +0 -23
  73. package/dist/menu/src/dto/order.dto.js.map +0 -1
  74. package/dist/menu/src/dto/update.dto.d.ts +0 -7
  75. package/dist/menu/src/dto/update.dto.d.ts.map +0 -1
  76. package/dist/menu/src/dto/update.dto.js +0 -37
  77. package/dist/menu/src/dto/update.dto.js.map +0 -1
  78. package/dist/menu/src/menu.controller.d.ts +0 -19
  79. package/dist/menu/src/menu.controller.d.ts.map +0 -1
  80. package/dist/menu/src/menu.controller.js +0 -117
  81. package/dist/menu/src/menu.controller.js.map +0 -1
  82. package/dist/menu/src/menu.module.d.ts +0 -3
  83. package/dist/menu/src/menu.module.d.ts.map +0 -1
  84. package/dist/menu/src/menu.module.js +0 -31
  85. package/dist/menu/src/menu.module.js.map +0 -1
  86. package/dist/menu/src/menu.service.d.ts +0 -23
  87. package/dist/menu/src/menu.service.d.ts.map +0 -1
  88. package/dist/menu/src/menu.service.js +0 -117
  89. package/dist/menu/src/menu.service.js.map +0 -1
  90. package/dist/menu/src/migrations/index.d.ts +0 -7
  91. package/dist/menu/src/migrations/index.d.ts.map +0 -1
  92. package/dist/menu/src/migrations/index.js +0 -101
  93. package/dist/menu/src/migrations/index.js.map +0 -1
  94. package/dist/migrations/migrate-01.d.ts +0 -6
  95. package/dist/migrations/migrate-01.d.ts.map +0 -1
  96. package/dist/migrations/migrate-01.js +0 -121
  97. package/dist/migrations/migrate-01.js.map +0 -1
  98. package/dist/migrations/migrate-02.d.ts +0 -6
  99. package/dist/migrations/migrate-02.d.ts.map +0 -1
  100. package/dist/migrations/migrate-02.js +0 -40
  101. package/dist/migrations/migrate-02.js.map +0 -1
  102. package/dist/migrations/migrate-03.d.ts +0 -7
  103. package/dist/migrations/migrate-03.d.ts.map +0 -1
  104. package/dist/migrations/migrate-03.js +0 -101
  105. package/dist/migrations/migrate-03.js.map +0 -1
  106. package/dist/migrations/migrate-04.d.ts +0 -6
  107. package/dist/migrations/migrate-04.d.ts.map +0 -1
  108. package/dist/migrations/migrate-04.js +0 -525
  109. package/dist/migrations/migrate-04.js.map +0 -1
  110. package/dist/permission/src/decorators/permission.decorator.d.ts +0 -3
  111. package/dist/permission/src/decorators/permission.decorator.d.ts.map +0 -1
  112. package/dist/permission/src/decorators/permission.decorator.js +0 -8
  113. package/dist/permission/src/decorators/permission.decorator.js.map +0 -1
  114. package/dist/permission/src/dto/create.dto.d.ts +0 -5
  115. package/dist/permission/src/dto/create.dto.d.ts.map +0 -1
  116. package/dist/permission/src/dto/create.dto.js +0 -27
  117. package/dist/permission/src/dto/create.dto.js.map +0 -1
  118. package/dist/permission/src/dto/delete.dto.d.ts +0 -4
  119. package/dist/permission/src/dto/delete.dto.d.ts.map +0 -1
  120. package/dist/permission/src/dto/delete.dto.js +0 -23
  121. package/dist/permission/src/dto/delete.dto.js.map +0 -1
  122. package/dist/permission/src/dto/update.dto.d.ts +0 -5
  123. package/dist/permission/src/dto/update.dto.d.ts.map +0 -1
  124. package/dist/permission/src/dto/update.dto.js +0 -27
  125. package/dist/permission/src/dto/update.dto.js.map +0 -1
  126. package/dist/permission/src/guards/permission.guard.d.ts +0 -11
  127. package/dist/permission/src/guards/permission.guard.d.ts.map +0 -1
  128. package/dist/permission/src/guards/permission.guard.js +0 -99
  129. package/dist/permission/src/guards/permission.guard.js.map +0 -1
  130. package/dist/permission/src/migrations/index.d.ts +0 -6
  131. package/dist/permission/src/migrations/index.d.ts.map +0 -1
  132. package/dist/permission/src/migrations/index.js +0 -520
  133. package/dist/permission/src/migrations/index.js.map +0 -1
  134. package/dist/permission/src/permission.controller.d.ts +0 -14
  135. package/dist/permission/src/permission.controller.d.ts.map +0 -1
  136. package/dist/permission/src/permission.controller.js +0 -95
  137. package/dist/permission/src/permission.controller.js.map +0 -1
  138. package/dist/permission/src/permission.module.d.ts +0 -3
  139. package/dist/permission/src/permission.module.d.ts.map +0 -1
  140. package/dist/permission/src/permission.module.js +0 -39
  141. package/dist/permission/src/permission.module.js.map +0 -1
  142. package/dist/permission/src/permission.service.d.ts +0 -19
  143. package/dist/permission/src/permission.service.d.ts.map +0 -1
  144. package/dist/permission/src/permission.service.js +0 -73
  145. package/dist/permission/src/permission.service.js.map +0 -1
  146. package/dist/permission/src/types/permission.types.d.ts +0 -33
  147. package/dist/permission/src/types/permission.types.d.ts.map +0 -1
  148. package/dist/permission/src/types/permission.types.js +0 -3
  149. package/dist/permission/src/types/permission.types.js.map +0 -1
  150. package/dist/screen/src/dto/create.dto.d.ts +0 -7
  151. package/dist/screen/src/dto/create.dto.d.ts.map +0 -1
  152. package/dist/screen/src/dto/create.dto.js +0 -37
  153. package/dist/screen/src/dto/create.dto.js.map +0 -1
  154. package/dist/screen/src/dto/delete.dto.d.ts +0 -4
  155. package/dist/screen/src/dto/delete.dto.d.ts.map +0 -1
  156. package/dist/screen/src/dto/delete.dto.js +0 -23
  157. package/dist/screen/src/dto/delete.dto.js.map +0 -1
  158. package/dist/screen/src/dto/update.dto.d.ts +0 -7
  159. package/dist/screen/src/dto/update.dto.d.ts.map +0 -1
  160. package/dist/screen/src/dto/update.dto.js +0 -37
  161. package/dist/screen/src/dto/update.dto.js.map +0 -1
  162. package/dist/screen/src/migrations/index.d.ts +0 -6
  163. package/dist/screen/src/migrations/index.d.ts.map +0 -1
  164. package/dist/screen/src/migrations/index.js +0 -40
  165. package/dist/screen/src/migrations/index.js.map +0 -1
  166. package/dist/screen/src/screen.controller.d.ts +0 -14
  167. package/dist/screen/src/screen.controller.d.ts.map +0 -1
  168. package/dist/screen/src/screen.controller.js +0 -94
  169. package/dist/screen/src/screen.controller.js.map +0 -1
  170. package/dist/screen/src/screen.module.d.ts +0 -3
  171. package/dist/screen/src/screen.module.d.ts.map +0 -1
  172. package/dist/screen/src/screen.module.js +0 -31
  173. package/dist/screen/src/screen.module.js.map +0 -1
  174. package/dist/screen/src/screen.service.d.ts +0 -19
  175. package/dist/screen/src/screen.service.d.ts.map +0 -1
  176. package/dist/screen/src/screen.service.js +0 -73
  177. package/dist/screen/src/screen.service.js.map +0 -1
  178. package/dist/user/src/constants/user.constants.d.ts +0 -2
  179. package/dist/user/src/constants/user.constants.d.ts.map +0 -1
  180. package/dist/user/src/constants/user.constants.js +0 -5
  181. package/dist/user/src/constants/user.constants.js.map +0 -1
  182. package/dist/user/src/dto/create.dto.d.ts +0 -6
  183. package/dist/user/src/dto/create.dto.d.ts.map +0 -1
  184. package/dist/user/src/dto/create.dto.js +0 -37
  185. package/dist/user/src/dto/create.dto.js.map +0 -1
  186. package/dist/user/src/dto/delete.dto.d.ts +0 -4
  187. package/dist/user/src/dto/delete.dto.d.ts.map +0 -1
  188. package/dist/user/src/dto/delete.dto.js +0 -23
  189. package/dist/user/src/dto/delete.dto.js.map +0 -1
  190. package/dist/user/src/dto/update.dto.d.ts +0 -8
  191. package/dist/user/src/dto/update.dto.d.ts.map +0 -1
  192. package/dist/user/src/dto/update.dto.js +0 -50
  193. package/dist/user/src/dto/update.dto.js.map +0 -1
  194. package/dist/user/src/user.controller.d.ts +0 -14
  195. package/dist/user/src/user.controller.d.ts.map +0 -1
  196. package/dist/user/src/user.controller.js +0 -94
  197. package/dist/user/src/user.controller.js.map +0 -1
  198. package/dist/user/src/user.module.d.ts +0 -3
  199. package/dist/user/src/user.module.d.ts.map +0 -1
  200. package/dist/user/src/user.module.js +0 -31
  201. package/dist/user/src/user.module.js.map +0 -1
  202. package/dist/user/src/user.service.d.ts +0 -20
  203. package/dist/user/src/user.service.d.ts.map +0 -1
  204. package/dist/user/src/user.service.js +0 -84
  205. package/dist/user/src/user.service.js.map +0 -1
  206. package/dist/user/src/user.service.spec.d.ts +0 -2
  207. package/dist/user/src/user.service.spec.d.ts.map +0 -1
  208. package/dist/user/src/user.service.spec.js +0 -17
  209. package/dist/user/src/user.service.spec.js.map +0 -1
@@ -1,73 +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.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
@@ -1 +0,0 @@
1
- {"version":3,"file":"screen.service.js","sourceRoot":"","sources":["../../../src/screen/src/screen.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAMjB,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,UAAU,CAAC,gBAA+B;QAC9C,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;QACvD,MAAM,EAAE,GAAU,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAC1D,MAAM,EACN,gBAAgB,CACjB,CAAC;QAEF,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CACpC,IAAI,CAAC,aAAa,CAAC,OAAO,EAC1B,gBAAgB,EAChB;YACE,KAAK,EAAE;gBACL,EAAE;aACH;SACF,CACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,QAAgB;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAa;QACvD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;YACvC,IAAI,EAAE;gBACJ,IAAI;gBACJ,IAAI;gBACJ,WAAW;gBACX,IAAI;aACL;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAmC;QACxD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;YACvC,KAAK,EAAE,EAAE,EAAE,EAAE;YACb,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,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"}
@@ -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 @@
1
- {"version":3,"file":"user.controller.js","sourceRoot":"","sources":["../../../src/user/src/user.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8BAA+C;AAC/C,mDAAgD;AAChD,2CAYwB;AACxB,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAItC,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAIE,AAAN,KAAK,CAAC,QAAQ,CAAe,gBAAgB;QAC3C,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACrD,CAAC;IAIK,AAAN,KAAK,CAAC,IAAI,CAAgC,MAAc;QACtD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAID,MAAM,CAAS,IAAe;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CACqB,MAAc,EACrC,IAAe;QAEvB,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;YAC7B,EAAE,EAAE,MAAM;YACV,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CAAS,IAAe;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACF,CAAA;AAzCY,wCAAc;AAQnB;IAFL,IAAA,kBAAS,EAAC,aAAS,CAAC;IACpB,IAAA,YAAG,GAAE;IACU,WAAA,IAAA,uBAAU,GAAE,CAAA;;;;8CAE3B;AAIK;IAFL,IAAA,kBAAS,EAAC,aAAS,CAAC;IACpB,IAAA,YAAG,EAAC,SAAS,CAAC;IACH,WAAA,IAAA,cAAK,EAAC,QAAQ,EAAE,qBAAY,CAAC,CAAA;;;;0CAExC;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,iBAAiB,CAAC,QAAQ,CACpC,IAAI,CAAC,aAAa,CAAC,KAAK,EACxB,gBAAgB,EAChB;YACE,KAAK,EAAE;gBACL,EAAE;aACH;SACF,CACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,MAAc;QACtB,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAAgB;QACjC,MAAM,IAAI,GAAG,MAAM,IAAA,gBAAO,EAAC,4BAAW,CAAC,CAAC;QACxC,OAAO,IAAA,aAAI,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAa;QAC/C,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAEzD,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;YACrC,IAAI,EAAE;gBACJ,KAAK;gBACL,IAAI;gBACJ,QAAQ,EAAE,cAAc;aACzB;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAmC;QACxD,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;YACrC,KAAK,EAAE,EAAE,EAAE,EAAE;YACb,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAa;QAC7B,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACpC,MAAM,IAAI,4BAAmB,CAC3B,8CAA8C,CAC/C,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC;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"}