@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
package/dist/index.js CHANGED
@@ -17,24 +17,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  // Admin Module
18
18
  __exportStar(require("./admin.module"), exports);
19
19
  // Auth Module
20
- __exportStar(require("./auth/src/auth.module"), exports);
21
- __exportStar(require("./auth/src/auth.service"), exports);
22
- __exportStar(require("./auth/src/decorators/public.decorator"), exports);
23
- __exportStar(require("./auth/src/decorators/user.decorator"), exports);
24
- __exportStar(require("./auth/src/guards/auth.guard"), exports);
20
+ __exportStar(require("./auth/auth.service"), exports);
21
+ __exportStar(require("./auth/decorators/public.decorator"), exports);
22
+ __exportStar(require("./auth/decorators/user.decorator"), exports);
23
+ __exportStar(require("./auth/guards/auth.guard"), exports);
25
24
  // Menu Module
26
- __exportStar(require("./menu/src/menu.module"), exports);
27
- __exportStar(require("./menu/src/menu.service"), exports);
25
+ __exportStar(require("./menu/menu.service"), exports);
28
26
  // Permission Module
29
- __exportStar(require("./permission/src/permission.module"), exports);
30
- __exportStar(require("./permission/src/permission.service"), exports);
31
- __exportStar(require("./permission/src/types/permission.types"), exports);
32
- __exportStar(require("./permission/src/decorators/permission.decorator"), exports);
27
+ __exportStar(require("./permission/permission.service"), exports);
28
+ __exportStar(require("./permission/types/permission.types"), exports);
29
+ __exportStar(require("./permission/decorators/permission.decorator"), exports);
30
+ __exportStar(require("./permission/guards/permission.guard"), exports);
33
31
  // Screen Module
34
- __exportStar(require("./screen/src/screen.module"), exports);
35
- __exportStar(require("./screen/src/screen.service"), exports);
32
+ __exportStar(require("./screen/screen.service"), exports);
36
33
  // User Module
37
- __exportStar(require("./user/src/constants/user.constants"), exports);
38
- __exportStar(require("./user/src/user.module"), exports);
39
- __exportStar(require("./user/src/user.service"), exports);
34
+ __exportStar(require("./user/constants/user.constants"), exports);
35
+ __exportStar(require("./user/user.service"), exports);
40
36
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@hedhog/admin",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
+ "clean": "rimraf ./dist",
8
+ "prebuild": "npm run clean",
7
9
  "build": "tsc --project tsconfig.production.json && npm version patch",
8
10
  "prod": "npm run build && npm publish --access public"
9
11
  },
10
12
  "files": [
11
- "dist/**/*",
12
13
  "src/migrations/**/*.ts",
13
14
  "src/**/*.ejs"
14
15
  ],
@@ -1,3 +0,0 @@
1
- export declare class AdminModule {
2
- }
3
- //# sourceMappingURL=admin.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"admin.module.d.ts","sourceRoot":"","sources":["../src/admin.module.ts"],"names":[],"mappings":"AAWA,qBAWa,WAAW;CAAG"}
@@ -1,30 +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.AdminModule = void 0;
10
- const prisma_1 = require("@hedhog/prisma");
11
- const pagination_1 = require("@hedhog/pagination");
12
- const _1 = require("./");
13
- const common_1 = require("@nestjs/common");
14
- let AdminModule = class AdminModule {
15
- };
16
- exports.AdminModule = AdminModule;
17
- exports.AdminModule = AdminModule = __decorate([
18
- (0, common_1.Module)({
19
- imports: [
20
- (0, common_1.forwardRef)(() => _1.AuthModule),
21
- (0, common_1.forwardRef)(() => _1.MenuModule),
22
- (0, common_1.forwardRef)(() => pagination_1.PaginationModule),
23
- (0, common_1.forwardRef)(() => _1.PermissionModule),
24
- (0, common_1.forwardRef)(() => prisma_1.PrismaModule),
25
- (0, common_1.forwardRef)(() => _1.ScreenModule),
26
- (0, common_1.forwardRef)(() => _1.UserModule),
27
- ],
28
- })
29
- ], AdminModule);
30
- //# sourceMappingURL=admin.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"admin.module.js","sourceRoot":"","sources":["../src/admin.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8C;AAC9C,mDAAsD;AACtD,yBAMY;AACZ,2CAAoD;AAa7C,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IAXvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,aAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,aAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,6BAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,mBAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,eAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,aAAU,CAAC;SAC7B;KACF,CAAC;GACW,WAAW,CAAG"}
@@ -1,21 +0,0 @@
1
- import { AuthService } from './auth.service';
2
- import { ForgetDTO } from './dto/forget.dto';
3
- import { LoginDTO } from './dto/login.dto';
4
- import { OtpDTO } from './dto/otp.dto';
5
- import { User as UserType } from './types/user.type';
6
- export declare class AuthController {
7
- private readonly service;
8
- constructor(service: AuthService);
9
- verify({ id }: UserType): Promise<any>;
10
- login({ email, password }: LoginDTO): Promise<{
11
- token: string;
12
- } | {
13
- token: string;
14
- mfa: boolean;
15
- }>;
16
- otp({ token, code }: OtpDTO): Promise<{
17
- token: string;
18
- }>;
19
- forget({ email }: ForgetDTO): Promise<boolean>;
20
- }
21
- //# sourceMappingURL=auth.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../../../src/auth/src/auth.controller.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAErD,qBACa,cAAc;IAGvB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,WAAW;IAIjC,MAAM,CAAS,EAAE,EAAE,EAAE,EAAE,QAAQ;IAM/B,KAAK,CAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,QAAQ;;;;;;IAM3C,GAAG,CAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,MAAM;;;IAMnC,MAAM,CAAS,EAAE,KAAK,EAAE,EAAE,SAAS;CAG1C"}
@@ -1,77 +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.AuthController = void 0;
16
- const common_1 = require("@nestjs/common");
17
- const auth_service_1 = require("./auth.service");
18
- const public_decorator_1 = require("./decorators/public.decorator");
19
- const user_decorator_1 = require("./decorators/user.decorator");
20
- const forget_dto_1 = require("./dto/forget.dto");
21
- const login_dto_1 = require("./dto/login.dto");
22
- const otp_dto_1 = require("./dto/otp.dto");
23
- let AuthController = class AuthController {
24
- constructor(service) {
25
- this.service = service;
26
- }
27
- async verify({ id }) {
28
- return this.service.verify(id);
29
- }
30
- async login({ email, password }) {
31
- return this.service.login({ email, password });
32
- }
33
- async otp({ token, code }) {
34
- return this.service.otp({ token, code });
35
- }
36
- async forget({ email }) {
37
- return this.service.forget({ email });
38
- }
39
- };
40
- exports.AuthController = AuthController;
41
- __decorate([
42
- (0, common_1.Get)('verify'),
43
- __param(0, (0, user_decorator_1.User)()),
44
- __metadata("design:type", Function),
45
- __metadata("design:paramtypes", [Object]),
46
- __metadata("design:returntype", Promise)
47
- ], AuthController.prototype, "verify", null);
48
- __decorate([
49
- (0, public_decorator_1.Public)(),
50
- (0, common_1.Post)('login'),
51
- __param(0, (0, common_1.Body)()),
52
- __metadata("design:type", Function),
53
- __metadata("design:paramtypes", [login_dto_1.LoginDTO]),
54
- __metadata("design:returntype", Promise)
55
- ], AuthController.prototype, "login", null);
56
- __decorate([
57
- (0, public_decorator_1.Public)(),
58
- (0, common_1.Post)('otp'),
59
- __param(0, (0, common_1.Body)()),
60
- __metadata("design:type", Function),
61
- __metadata("design:paramtypes", [otp_dto_1.OtpDTO]),
62
- __metadata("design:returntype", Promise)
63
- ], AuthController.prototype, "otp", null);
64
- __decorate([
65
- (0, public_decorator_1.Public)(),
66
- (0, common_1.Post)('forget'),
67
- __param(0, (0, common_1.Body)()),
68
- __metadata("design:type", Function),
69
- __metadata("design:paramtypes", [forget_dto_1.ForgetDTO]),
70
- __metadata("design:returntype", Promise)
71
- ], AuthController.prototype, "forget", null);
72
- exports.AuthController = AuthController = __decorate([
73
- (0, common_1.Controller)('auth'),
74
- __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => auth_service_1.AuthService))),
75
- __metadata("design:paramtypes", [auth_service_1.AuthService])
76
- ], AuthController);
77
- //# sourceMappingURL=auth.controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../../src/auth/src/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,iDAA6C;AAC7C,oEAAuD;AACvD,gEAAmD;AACnD,iDAA6C;AAC7C,+CAA2C;AAC3C,2CAAuC;AAIhC,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,OAAoB;QAApB,YAAO,GAAP,OAAO,CAAa;IACpC,CAAC;IAGE,AAAN,KAAK,CAAC,MAAM,CAAS,EAAE,EAAE,EAAY;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAIK,AAAN,KAAK,CAAC,KAAK,CAAS,EAAE,KAAK,EAAE,QAAQ,EAAY;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAIK,AAAN,KAAK,CAAC,GAAG,CAAS,EAAE,KAAK,EAAE,IAAI,EAAU;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CAAS,EAAE,KAAK,EAAa;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACxC,CAAC;CACF,CAAA;AA5BY,wCAAc;AAOnB;IADL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACA,WAAA,IAAA,qBAAI,GAAE,CAAA;;;;4CAEnB;AAIK;IAFL,IAAA,yBAAM,GAAE;IACR,IAAA,aAAI,EAAC,OAAO,CAAC;IACD,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAsB,oBAAQ;;2CAEhD;AAIK;IAFL,IAAA,yBAAM,GAAE;IACR,IAAA,aAAI,EAAC,KAAK,CAAC;IACD,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAkB,gBAAM;;yCAExC;AAIK;IAFL,IAAA,yBAAM,GAAE;IACR,IAAA,aAAI,EAAC,QAAQ,CAAC;IACD,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAY,sBAAS;;4CAExC;yBA3BU,cAAc;IAD1B,IAAA,mBAAU,EAAC,MAAM,CAAC;IAGd,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAW,CAAC,CAAC,CAAA;qCACZ,0BAAW;GAH5B,cAAc,CA4B1B"}
@@ -1,3 +0,0 @@
1
- export declare class AuthModule {
2
- }
3
- //# sourceMappingURL=auth.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../../src/auth/src/auth.module.ts"],"names":[],"mappings":"AASA,qBA6Ba,UAAU;CAAG"}
@@ -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
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.AuthModule = void 0;
10
- const common_1 = require("@nestjs/common");
11
- const auth_service_1 = require("./auth.service");
12
- const auth_controller_1 = require("./auth.controller");
13
- const prisma_1 = require("@hedhog/prisma");
14
- const jwt_1 = require("@nestjs/jwt");
15
- const core_1 = require("@nestjs/core");
16
- const auth_guard_1 = require("./guards/auth.guard");
17
- const mail_1 = require("@hedhog/mail");
18
- let AuthModule = class AuthModule {
19
- };
20
- exports.AuthModule = AuthModule;
21
- exports.AuthModule = AuthModule = __decorate([
22
- (0, common_1.Module)({
23
- imports: [
24
- (0, common_1.forwardRef)(() => jwt_1.JwtModule.registerAsync({
25
- global: true,
26
- useFactory: () => {
27
- return {
28
- secret: String(process.env.JWT_SECRET),
29
- global: true,
30
- signOptions: {
31
- expiresIn: process.env.JWT_EXPIRES_IN || '30d',
32
- },
33
- };
34
- },
35
- })),
36
- (0, common_1.forwardRef)(() => prisma_1.PrismaModule),
37
- (0, common_1.forwardRef)(() => mail_1.MailModule),
38
- ],
39
- controllers: [auth_controller_1.AuthController],
40
- providers: [
41
- auth_service_1.AuthService,
42
- {
43
- provide: core_1.APP_GUARD,
44
- useClass: auth_guard_1.AuthGuard,
45
- },
46
- ],
47
- exports: [auth_service_1.AuthService],
48
- })
49
- ], AuthModule);
50
- //# sourceMappingURL=auth.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../src/auth/src/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,iDAA6C;AAC7C,uDAAmD;AACnD,2CAA8C;AAC9C,qCAAwC;AACxC,uCAAyC;AACzC,oDAAgD;AAChD,uCAA0C;AA+BnC,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IA7BtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CACd,eAAS,CAAC,aAAa,CAAC;gBACtB,MAAM,EAAE,IAAI;gBACZ,UAAU,EAAE,GAAG,EAAE;oBACf,OAAO;wBACL,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;wBACtC,MAAM,EAAE,IAAI;wBACZ,WAAW,EAAE;4BACX,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,KAAK;yBAC/C;qBACF,CAAC;gBACJ,CAAC;aACF,CAAC,CACH;YACD,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iBAAU,CAAC;SAC7B;QACD,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,SAAS,EAAE;YACT,0BAAW;YACX;gBACE,OAAO,EAAE,gBAAS;gBAClB,QAAQ,EAAE,sBAAS;aACpB;SACF;QACD,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG"}
@@ -1,36 +0,0 @@
1
- import { PrismaService } from '@hedhog/prisma';
2
- import { JwtService } from '@nestjs/jwt';
3
- import { ForgetDTO } from './dto/forget.dto';
4
- import { LoginDTO } from './dto/login.dto';
5
- import { OtpDTO } from './dto/otp.dto';
6
- import { MailService } from '@hedhog/mail';
7
- export declare class AuthService {
8
- private readonly prisma;
9
- private readonly jwt;
10
- private readonly mail;
11
- constructor(prisma: PrismaService, jwt: JwtService, mail: MailService);
12
- verifyToken(token: string): Promise<any>;
13
- generateRandomString(length: number): string;
14
- generateRandomNumber(): number;
15
- loginWithEmailAndPassword(email: string, password: string): Promise<{
16
- token: string;
17
- } | {
18
- token: string;
19
- mfa: boolean;
20
- }>;
21
- getToken(user: any): Promise<{
22
- token: string;
23
- }>;
24
- forget({ email }: ForgetDTO): Promise<boolean>;
25
- otp({ token, code }: OtpDTO): Promise<{
26
- token: string;
27
- }>;
28
- login({ email, password }: LoginDTO): Promise<{
29
- token: string;
30
- } | {
31
- token: string;
32
- mfa: boolean;
33
- }>;
34
- verify(id: number): any;
35
- }
36
- //# sourceMappingURL=auth.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../../src/auth/src/auth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,qBACa,WAAW;IAGpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAEpB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAJJ,MAAM,EAAE,aAAa,EAErB,GAAG,EAAE,UAAU,EAEf,IAAI,EAAE,WAAW;IAG9B,WAAW,CAAC,KAAK,EAAE,MAAM;IAM/B,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAW5C,oBAAoB,IAAI,MAAM;IAMxB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;IAgDzD,QAAQ,CAAC,IAAI,KAAA;;;IAUb,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS;IAkC3B,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,MAAM;;;IA0BjC,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,QAAQ;;;;;;IAInC,MAAM,CAAC,EAAE,EAAE,MAAM;CAGlB"}
@@ -1,162 +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.AuthService = void 0;
16
- const prisma_1 = require("@hedhog/prisma");
17
- const common_1 = require("@nestjs/common");
18
- const jwt_1 = require("@nestjs/jwt");
19
- const bcrypt_1 = require("bcrypt");
20
- const multifactor_type_enum_1 = require("./enums/multifactor-type.enum");
21
- const mail_1 = require("@hedhog/mail");
22
- let AuthService = class AuthService {
23
- constructor(prisma, jwt, mail) {
24
- this.prisma = prisma;
25
- this.jwt = jwt;
26
- this.mail = mail;
27
- }
28
- async verifyToken(token) {
29
- return this.jwt.verifyAsync(token, {
30
- secret: String(process.env.JWT_SECRET),
31
- });
32
- }
33
- generateRandomString(length) {
34
- const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
35
- let result = '';
36
- for (let i = 0; i < length; i++) {
37
- const randomIndex = Math.floor(Math.random() * characters.length);
38
- result += characters.charAt(randomIndex);
39
- }
40
- return result;
41
- }
42
- generateRandomNumber() {
43
- const min = 100000;
44
- const max = 999999;
45
- return Math.floor(Math.random() * (max - min + 1)) + min;
46
- }
47
- async loginWithEmailAndPassword(email, password) {
48
- const user = await this.prisma.users.findFirst({
49
- where: {
50
- email,
51
- },
52
- });
53
- if (!user) {
54
- throw new common_1.NotFoundException('User not found');
55
- }
56
- const isPasswordValid = await (0, bcrypt_1.compare)(password, user.password);
57
- if (!isPasswordValid) {
58
- throw new common_1.NotFoundException('Invalid password');
59
- }
60
- if (!user.multifactor_id) {
61
- return this.getToken(user);
62
- }
63
- else {
64
- if (user.multifactor_id === multifactor_type_enum_1.MultifactorType.EMAIL) {
65
- const code = this.generateRandomNumber();
66
- await this.prisma.users.update({
67
- where: {
68
- id: user.id,
69
- },
70
- data: {
71
- code: String(code),
72
- },
73
- });
74
- await this.mail.send({
75
- to: user.email,
76
- subject: 'Login code',
77
- body: `Your login code is ${code}`,
78
- });
79
- }
80
- return {
81
- token: this.jwt.sign({
82
- id: user.id,
83
- mfa: user.multifactor_id,
84
- }),
85
- mfa: true,
86
- };
87
- }
88
- }
89
- async getToken(user) {
90
- delete user.password;
91
- const payload = { user };
92
- return {
93
- token: this.jwt.sign(payload),
94
- };
95
- }
96
- async forget({ email }) {
97
- const user = await this.prisma.users.findFirst({
98
- where: {
99
- email,
100
- },
101
- select: {
102
- id: true,
103
- },
104
- });
105
- if (!user) {
106
- throw new common_1.NotFoundException('User not found');
107
- }
108
- const code = this.generateRandomString(32);
109
- await this.prisma.users.update({
110
- where: {
111
- id: user.id,
112
- },
113
- data: {
114
- code,
115
- },
116
- });
117
- await this.mail.send({
118
- to: email,
119
- subject: 'Reset password',
120
- body: `Reset your password by clicking <a href="${process.env.FRONTEND_URL}/reset-password/${code}">here</a>`,
121
- });
122
- return true;
123
- }
124
- async otp({ token, code }) {
125
- const data = this.jwt.decode(token);
126
- const user = await this.prisma.users.findFirst({
127
- where: {
128
- id: data['id'],
129
- code: String(code),
130
- },
131
- });
132
- if (!user) {
133
- throw new common_1.NotFoundException('Invalid code');
134
- }
135
- await this.prisma.users.update({
136
- where: {
137
- id: user.id,
138
- },
139
- data: {
140
- code: null,
141
- },
142
- });
143
- return this.getToken(user);
144
- }
145
- login({ email, password }) {
146
- return this.loginWithEmailAndPassword(email, password);
147
- }
148
- verify(id) {
149
- return this.prisma.users.findUnique({ where: { id } });
150
- }
151
- };
152
- exports.AuthService = AuthService;
153
- exports.AuthService = AuthService = __decorate([
154
- (0, common_1.Injectable)(),
155
- __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => prisma_1.PrismaService))),
156
- __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => jwt_1.JwtService))),
157
- __param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => mail_1.MailService))),
158
- __metadata("design:paramtypes", [prisma_1.PrismaService,
159
- jwt_1.JwtService,
160
- mail_1.MailService])
161
- ], AuthService);
162
- //# sourceMappingURL=auth.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../../src/auth/src/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+C;AAC/C,2CAKwB;AACxB,qCAAyC;AACzC,mCAAiC;AAIjC,yEAAgE;AAChE,uCAA2C;AAGpC,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAEmB,MAAqB,EAErB,GAAe,EAEf,IAAiB;QAJjB,WAAM,GAAN,MAAM,CAAe;QAErB,QAAG,GAAH,GAAG,CAAY;QAEf,SAAI,GAAJ,IAAI,CAAa;IACjC,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,KAAa;QAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,EAAE;YACjC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;SACvC,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB,CAAC,MAAc;QACjC,MAAM,UAAU,GACd,gEAAgE,CAAC;QACnE,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;YAClE,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC3C,CAAC;QACD,O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,GAAG,EAAE,CAAC,sBAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,gBAAU,CAAC,CAAC,CAAA;IAEpC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kBAAW,CAAC,CAAC,CAAA;qCAHb,sBAAa;QAEhB,gBAAU;QAET,kBAAW;GAPzB,WAAW,CA8JvB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=auth.service.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.service.spec.d.ts","sourceRoot":"","sources":["../../../src/auth/src/auth.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 auth_service_1 = require("./auth.service");
5
- describe('AuthService', () => {
6
- let service;
7
- beforeEach(async () => {
8
- const module = await testing_1.Test.createTestingModule({
9
- providers: [auth_service_1.AuthService],
10
- }).compile();
11
- service = module.get(auth_service_1.AuthService);
12
- });
13
- it('should be defined', () => {
14
- expect(service).toBeDefined();
15
- });
16
- });
17
- //# sourceMappingURL=auth.service.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.service.spec.js","sourceRoot":"","sources":["../../../src/auth/src/auth.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"}
@@ -1,3 +0,0 @@
1
- export declare const IS_PUBLIC_KEY = "isPublic";
2
- export declare const Public: () => import("@nestjs/common").CustomDecorator<string>;
3
- //# sourceMappingURL=public.decorator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public.decorator.d.ts","sourceRoot":"","sources":["../../../../src/auth/src/decorators/public.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,MAAM,wDAAyC,CAAC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Public = exports.IS_PUBLIC_KEY = void 0;
4
- const common_1 = require("@nestjs/common");
5
- exports.IS_PUBLIC_KEY = 'isPublic';
6
- const Public = () => (0, common_1.SetMetadata)(exports.IS_PUBLIC_KEY, true);
7
- exports.Public = Public;
8
- //# sourceMappingURL=public.decorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public.decorator.js","sourceRoot":"","sources":["../../../../src/auth/src/decorators/public.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAEhC,QAAA,aAAa,GAAG,UAAU,CAAC;AACjC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,IAAA,oBAAW,EAAC,qBAAa,EAAE,IAAI,CAAC,CAAC;AAAhD,QAAA,MAAM,UAA0C"}
@@ -1,2 +0,0 @@
1
- export declare const User: (...dataOrPipes: (string | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
2
- //# sourceMappingURL=user.decorator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.decorator.d.ts","sourceRoot":"","sources":["../../../../src/auth/src/decorators/user.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,yLAUhB,CAAC"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.User = void 0;
4
- const common_1 = require("@nestjs/common");
5
- exports.User = (0, common_1.createParamDecorator)((field = null, ctx) => {
6
- const request = ctx.switchToHttp().getRequest();
7
- if (!request.auth || !request.auth.user) {
8
- throw new common_1.UnauthorizedException(`User is not authenticated`);
9
- }
10
- return field ? request.auth.user[field] : request.auth.user;
11
- });
12
- //# sourceMappingURL=user.decorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.decorator.js","sourceRoot":"","sources":["../../../../src/auth/src/decorators/user.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA+F;AAElF,QAAA,IAAI,GAAG,IAAA,6BAAoB,EACtC,CAAC,QAAuB,IAAI,EAAE,GAAqB,EAAE,EAAE;IACrD,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAEhD,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,IAAI,8BAAqB,CAAC,2BAA2B,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9D,CAAC,CACF,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare class ForgetDTO {
2
- email: string;
3
- }
4
- //# sourceMappingURL=forget.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forget.dto.d.ts","sourceRoot":"","sources":["../../../../src/auth/src/dto/forget.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAGpB,KAAK,EAAE,MAAM,CAAC;CAEf"}
@@ -1,21 +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.ForgetDTO = void 0;
13
- const class_validator_1 = require("class-validator");
14
- class ForgetDTO {
15
- }
16
- exports.ForgetDTO = ForgetDTO;
17
- __decorate([
18
- (0, class_validator_1.IsEmail)(),
19
- __metadata("design:type", String)
20
- ], ForgetDTO.prototype, "email", void 0);
21
- //# sourceMappingURL=forget.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forget.dto.js","sourceRoot":"","sources":["../../../../src/auth/src/dto/forget.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0C;AAE1C,MAAa,SAAS;CAKrB;AALD,8BAKC;AAFC;IADC,IAAA,yBAAO,GAAE;;wCACI"}
@@ -1,5 +0,0 @@
1
- export declare class LoginDTO {
2
- email: string;
3
- password: string;
4
- }
5
- //# sourceMappingURL=login.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"login.dto.d.ts","sourceRoot":"","sources":["../../../../src/auth/src/dto/login.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAQ;IAEnB,KAAK,EAAE,MAAM,CAAC;IASd,QAAQ,EAAE,MAAM,CAAC;CAClB"}