@hedhog/admin 0.7.4 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.module.d.ts.map +1 -1
- package/dist/admin.module.js +3 -0
- package/dist/admin.module.js.map +1 -1
- package/dist/auth/auth.controller.d.ts +18 -2
- package/dist/auth/auth.controller.d.ts.map +1 -1
- package/dist/auth/auth.controller.js +23 -4
- package/dist/auth/auth.controller.js.map +1 -1
- package/dist/auth/auth.service.d.ts +21 -2
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.service.js +34 -4
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/auth/consts/body.d.ts +2 -0
- package/dist/auth/consts/body.d.ts.map +1 -0
- package/dist/auth/consts/body.js +31 -0
- package/dist/auth/consts/body.js.map +1 -0
- package/dist/auth/consts/subject.d.ts +2 -0
- package/dist/auth/consts/subject.d.ts.map +1 -0
- package/dist/auth/consts/subject.js +5 -0
- package/dist/auth/consts/subject.js.map +1 -0
- package/dist/auth/dto/reset.dto.d.ts +6 -0
- package/dist/auth/dto/reset.dto.d.ts.map +1 -0
- package/dist/auth/dto/reset.dto.js +31 -0
- package/dist/auth/dto/reset.dto.js.map +1 -0
- package/dist/menu/menu.controller.d.ts +33 -6
- package/dist/menu/menu.controller.d.ts.map +1 -1
- package/dist/menu/menu.service.d.ts +33 -6
- package/dist/menu/menu.service.d.ts.map +1 -1
- package/dist/role/role.controller.d.ts +5 -5
- package/dist/role/role.service.d.ts +5 -5
- package/dist/route/route.controller.d.ts +27 -6
- package/dist/route/route.controller.d.ts.map +1 -1
- package/dist/route/route.service.d.ts +27 -6
- package/dist/route/route.service.d.ts.map +1 -1
- package/dist/screen/screen.controller.d.ts +24 -6
- package/dist/screen/screen.controller.d.ts.map +1 -1
- package/dist/screen/screen.service.d.ts +24 -6
- package/dist/screen/screen.service.d.ts.map +1 -1
- package/dist/user/user.controller.d.ts +32 -5
- package/dist/user/user.controller.d.ts.map +1 -1
- package/dist/user/user.service.d.ts +32 -5
- package/dist/user/user.service.d.ts.map +1 -1
- package/package.json +43 -43
- package/src/admin.module.ts +3 -0
- package/src/auth/auth.controller.ts +29 -3
- package/src/auth/auth.service.ts +64 -5
- package/src/auth/consts/body.ts +26 -0
- package/src/auth/consts/subject.ts +1 -0
- package/src/auth/dto/reset.dto.ts +14 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"admin.module.d.ts","sourceRoot":"","sources":["../src/admin.module.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"admin.module.d.ts","sourceRoot":"","sources":["../src/admin.module.ts"],"names":[],"mappings":"AAYA,qBAwBa,WAAW;CAAG"}
|
package/dist/admin.module.js
CHANGED
@@ -17,6 +17,7 @@ const role_module_1 = require("./role/role.module");
|
|
17
17
|
const route_module_1 = require("./route/route.module");
|
18
18
|
const screen_module_1 = require("./screen/screen.module");
|
19
19
|
const user_module_1 = require("./user/user.module");
|
20
|
+
const mail_1 = require("@hedhog/mail");
|
20
21
|
let AdminModule = class AdminModule {
|
21
22
|
};
|
22
23
|
exports.AdminModule = AdminModule;
|
@@ -24,6 +25,7 @@ exports.AdminModule = AdminModule = __decorate([
|
|
24
25
|
(0, common_1.Module)({
|
25
26
|
imports: [
|
26
27
|
(0, common_1.forwardRef)(() => auth_module_1.AuthModule),
|
28
|
+
(0, common_1.forwardRef)(() => mail_1.MailModule),
|
27
29
|
(0, common_1.forwardRef)(() => menu_module_1.MenuModule),
|
28
30
|
(0, common_1.forwardRef)(() => pagination_1.PaginationModule),
|
29
31
|
(0, common_1.forwardRef)(() => role_module_1.RoleModule),
|
@@ -36,6 +38,7 @@ exports.AdminModule = AdminModule = __decorate([
|
|
36
38
|
exports: [
|
37
39
|
user_module_1.UserModule,
|
38
40
|
auth_module_1.AuthModule,
|
41
|
+
mail_1.MailModule,
|
39
42
|
route_module_1.RouteModule,
|
40
43
|
role_module_1.RoleModule,
|
41
44
|
menu_module_1.MenuModule,
|
package/dist/admin.module.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"admin.module.js","sourceRoot":"","sources":["../src/admin.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAsD;AACtD,2CAA8C;AAC9C,2CAAoD;AACpD,oDAAgD;AAChD,2CAA8C;AAC9C,oDAAgD;AAChD,oDAAgD;AAChD,uDAAmD;AACnD,0DAAsD;AACtD,oDAAgD;
|
1
|
+
{"version":3,"file":"admin.module.js","sourceRoot":"","sources":["../src/admin.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAsD;AACtD,2CAA8C;AAC9C,2CAAoD;AACpD,oDAAgD;AAChD,2CAA8C;AAC9C,oDAAgD;AAChD,oDAAgD;AAChD,uDAAmD;AACnD,0DAAsD;AACtD,oDAAgD;AAChD,uCAA0C;AA0BnC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IAxBvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,6BAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAW,CAAC;YAC7B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4BAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;SAC7B;QACD,OAAO,EAAE;YACP,wBAAU;YACV,wBAAU;YACV,iBAAU;YACV,0BAAW;YACX,wBAAU;YACV,wBAAU;YACV,4BAAY;YACZ,qBAAY;SACb;KACF,CAAC;GACW,WAAW,CAAG"}
|
@@ -1,12 +1,22 @@
|
|
1
1
|
import { AuthService } from './auth.service';
|
2
2
|
import { ForgetDTO } from './dto/forget.dto';
|
3
|
+
import { ResetDTO } from './dto/reset.dto';
|
3
4
|
import { LoginDTO } from './dto/login.dto';
|
4
5
|
import { OtpDTO } from './dto/otp.dto';
|
5
6
|
import { User as UserType } from './types/user.type';
|
6
7
|
export declare class AuthController {
|
7
8
|
private readonly service;
|
8
9
|
constructor(service: AuthService);
|
9
|
-
verify({ id }: UserType): Promise<
|
10
|
+
verify({ id }: UserType): Promise<{
|
11
|
+
code: string | null;
|
12
|
+
name: string;
|
13
|
+
id: number;
|
14
|
+
created_at: Date;
|
15
|
+
updated_at: Date;
|
16
|
+
multifactor_id: number | null;
|
17
|
+
email: string;
|
18
|
+
password: string;
|
19
|
+
}>;
|
10
20
|
login({ email, password }: LoginDTO): Promise<{
|
11
21
|
token: string;
|
12
22
|
} | {
|
@@ -16,6 +26,12 @@ export declare class AuthController {
|
|
16
26
|
otp({ token, code }: OtpDTO): Promise<{
|
17
27
|
token: string;
|
18
28
|
}>;
|
19
|
-
forget({ email }: ForgetDTO
|
29
|
+
forget({ email, subject, body, }: ForgetDTO & {
|
30
|
+
subject: string;
|
31
|
+
body: string;
|
32
|
+
}): Promise<boolean>;
|
33
|
+
reset({ newPassword, confirmNewPassword, code, }: ResetDTO): Promise<false | {
|
34
|
+
token: string;
|
35
|
+
}>;
|
20
36
|
}
|
21
37
|
//# sourceMappingURL=auth.controller.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../../src/auth/auth.controller.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,O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Q;;;CAOZ"}
|
@@ -16,7 +16,7 @@ exports.AuthController = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
17
17
|
const core_1 = require("@hedhog/core");
|
18
18
|
const auth_service_1 = require("./auth.service");
|
19
|
-
const
|
19
|
+
const reset_dto_1 = require("./dto/reset.dto");
|
20
20
|
const login_dto_1 = require("./dto/login.dto");
|
21
21
|
const otp_dto_1 = require("./dto/otp.dto");
|
22
22
|
let AuthController = class AuthController {
|
@@ -32,8 +32,19 @@ let AuthController = class AuthController {
|
|
32
32
|
async otp({ token, code }) {
|
33
33
|
return this.service.otp({ token, code });
|
34
34
|
}
|
35
|
-
async forget({ email }) {
|
36
|
-
return this.service.forget({
|
35
|
+
async forget({ email, subject, body, }) {
|
36
|
+
return this.service.forget({
|
37
|
+
email,
|
38
|
+
subject,
|
39
|
+
body,
|
40
|
+
});
|
41
|
+
}
|
42
|
+
async reset({ newPassword, confirmNewPassword, code, }) {
|
43
|
+
return this.service.resetPassword({
|
44
|
+
newPassword,
|
45
|
+
confirmNewPassword,
|
46
|
+
code,
|
47
|
+
});
|
37
48
|
}
|
38
49
|
};
|
39
50
|
exports.AuthController = AuthController;
|
@@ -66,9 +77,17 @@ __decorate([
|
|
66
77
|
(0, common_1.Post)('forget'),
|
67
78
|
__param(0, (0, common_1.Body)()),
|
68
79
|
__metadata("design:type", Function),
|
69
|
-
__metadata("design:paramtypes", [
|
80
|
+
__metadata("design:paramtypes", [Object]),
|
70
81
|
__metadata("design:returntype", Promise)
|
71
82
|
], AuthController.prototype, "forget", null);
|
83
|
+
__decorate([
|
84
|
+
(0, core_1.Public)(),
|
85
|
+
(0, common_1.Post)('reset'),
|
86
|
+
__param(0, (0, common_1.Body)()),
|
87
|
+
__metadata("design:type", Function),
|
88
|
+
__metadata("design:paramtypes", [reset_dto_1.ResetDTO]),
|
89
|
+
__metadata("design:returntype", Promise)
|
90
|
+
], AuthController.prototype, "reset", null);
|
72
91
|
exports.AuthController = AuthController = __decorate([
|
73
92
|
(0, common_1.Controller)('auth'),
|
74
93
|
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => auth_service_1.AuthService))),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../src/auth/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,uCAAkD;AAClD,iDAA6C;
|
1
|
+
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../src/auth/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,uCAAkD;AAClD,iDAA6C;AAE7C,+CAA2C;AAC3C,+CAA2C;AAC3C,2CAAuC;AAIhC,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,OAAoB;QAApB,YAAO,GAAP,OAAO,CAAa;IACnC,CAAC;IAIC,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,EACnB,KAAK,EACL,OAAO,EACP,IAAI,GAIL;QACC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;YACzB,KAAK;YACL,OAAO;YACP,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAIK,AAAN,KAAK,CAAC,KAAK,CAAS,EAClB,WAAW,EACX,kBAAkB,EAClB,IAAI,GACK;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;YAChC,WAAW;YACX,kBAAkB;YAClB,IAAI;SACL,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAtDY,wCAAc;AAQnB;IAFL,IAAA,WAAI,GAAE;IACN,IAAA,YAAG,EAAC,QAAQ,CAAC;IACA,WAAA,IAAA,WAAI,GAAE,CAAA;;;;4CAEnB;AAIK;IAFL,IAAA,aAAM,GAAE;IACR,IAAA,aAAI,EAAC,OAAO,CAAC;IACD,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAsB,oBAAQ;;2CAEhD;AAIK;IAFL,IAAA,aAAM,GAAE;IACR,IAAA,aAAI,EAAC,KAAK,CAAC;IACD,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAkB,gBAAM;;yCAExC;AAIK;IAFL,IAAA,aAAM,GAAE;IACR,IAAA,aAAI,EAAC,QAAQ,CAAC;IACD,WAAA,IAAA,aAAI,GAAE,CAAA;;;;4CAanB;AAIK;IAFL,IAAA,aAAM,GAAE;IACR,IAAA,aAAI,EAAC,OAAO,CAAC;IACD,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAIhB,oBAAQ;;2CAMV;yBArDU,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,CAsD1B"}
|
@@ -21,7 +21,17 @@ export declare class AuthService {
|
|
21
21
|
getToken(user: any): Promise<{
|
22
22
|
token: string;
|
23
23
|
}>;
|
24
|
-
forget({ email }: ForgetDTO
|
24
|
+
forget({ email, subject, body, }: ForgetDTO & {
|
25
|
+
subject?: string;
|
26
|
+
body?: string;
|
27
|
+
}): Promise<boolean>;
|
28
|
+
resetPassword({ code, newPassword, confirmNewPassword, }: {
|
29
|
+
code: string;
|
30
|
+
newPassword: string;
|
31
|
+
confirmNewPassword: string;
|
32
|
+
}): Promise<false | {
|
33
|
+
token: string;
|
34
|
+
}>;
|
25
35
|
otp({ token, code }: OtpDTO): Promise<{
|
26
36
|
token: string;
|
27
37
|
}>;
|
@@ -31,6 +41,15 @@ export declare class AuthService {
|
|
31
41
|
token: string;
|
32
42
|
mfa: boolean;
|
33
43
|
}>;
|
34
|
-
verify(id: number):
|
44
|
+
verify(id: number): import(".prisma/client").Prisma.Prisma__userClient<{
|
45
|
+
code: string | null;
|
46
|
+
name: string;
|
47
|
+
id: number;
|
48
|
+
created_at: Date;
|
49
|
+
updated_at: Date;
|
50
|
+
multifactor_id: number | null;
|
51
|
+
email: string;
|
52
|
+
password: string;
|
53
|
+
}, null, import("@prisma/client/runtime/library").DefaultArgs>;
|
35
54
|
}
|
36
55
|
//# sourceMappingURL=auth.service.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQ/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;AAMvC,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,EACX,KAAK,EACL,OAAO,EACP,IAAI,GACL,EAAE,SAAS,GAAG;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;IAwCK,aAAa,CAAC,EAClB,IAAI,EACJ,WAAW,EACX,kBAAkB,GACnB,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,MAAM,CAAC;KAC5B;;;IAkCK,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"}
|
@@ -19,6 +19,8 @@ const common_1 = require("@nestjs/common");
|
|
19
19
|
const jwt_1 = require("@nestjs/jwt");
|
20
20
|
const bcrypt_1 = require("bcrypt");
|
21
21
|
const multifactor_type_enum_1 = require("./enums/multifactor-type.enum");
|
22
|
+
const subject_1 = require("./consts/subject");
|
23
|
+
const body_1 = require("./consts/body");
|
22
24
|
let AuthService = class AuthService {
|
23
25
|
constructor(prisma, jwt, mail) {
|
24
26
|
this.prisma = prisma;
|
@@ -93,7 +95,7 @@ let AuthService = class AuthService {
|
|
93
95
|
token: this.jwt.sign(payload),
|
94
96
|
};
|
95
97
|
}
|
96
|
-
async forget({ email }) {
|
98
|
+
async forget({ email, subject, body, }) {
|
97
99
|
const user = await this.prisma.user.findFirst({
|
98
100
|
where: {
|
99
101
|
email,
|
@@ -105,7 +107,8 @@ let AuthService = class AuthService {
|
|
105
107
|
if (!user) {
|
106
108
|
throw new common_1.NotFoundException('User not found');
|
107
109
|
}
|
108
|
-
const
|
110
|
+
const payload = Object.assign({}, user);
|
111
|
+
const code = this.jwt.sign(payload);
|
109
112
|
await this.prisma.user.update({
|
110
113
|
where: {
|
111
114
|
id: user.id,
|
@@ -116,11 +119,38 @@ let AuthService = class AuthService {
|
|
116
119
|
});
|
117
120
|
await this.mail.send({
|
118
121
|
to: email,
|
119
|
-
subject:
|
120
|
-
body:
|
122
|
+
subject: subject !== null && subject !== void 0 ? subject : subject_1.SUBJECT_RECOVERY,
|
123
|
+
body: body !== null && body !== void 0 ? body : (0, body_1.getBody)(`${process.env.FRONTEND_URL}/password-recovery/${code}`),
|
121
124
|
});
|
122
125
|
return true;
|
123
126
|
}
|
127
|
+
async resetPassword({ code, newPassword, confirmNewPassword, }) {
|
128
|
+
if (newPassword !== confirmNewPassword) {
|
129
|
+
throw new common_1.BadRequestException("Passwords don't match");
|
130
|
+
}
|
131
|
+
const { id } = this.jwt.decode(code);
|
132
|
+
const user = await this.prisma.user.findFirst({
|
133
|
+
where: {
|
134
|
+
id,
|
135
|
+
code,
|
136
|
+
},
|
137
|
+
});
|
138
|
+
if (user) {
|
139
|
+
const salt = await (0, bcrypt_1.genSalt)();
|
140
|
+
const password = await (0, bcrypt_1.hash)(confirmNewPassword, salt);
|
141
|
+
await this.prisma.user.update({
|
142
|
+
where: {
|
143
|
+
id: user.id,
|
144
|
+
},
|
145
|
+
data: {
|
146
|
+
password,
|
147
|
+
code: null,
|
148
|
+
},
|
149
|
+
});
|
150
|
+
return this.getToken(user);
|
151
|
+
}
|
152
|
+
return false;
|
153
|
+
}
|
124
154
|
async otp({ token, code }) {
|
125
155
|
const data = this.jwt.decode(token);
|
126
156
|
const user = await this.prisma.user.findFirst({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,2CAA+C;AAC/C,
|
1
|
+
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,2CAA+C;AAC/C,2CAMwB;AACxB,qCAAyC;AACzC,mCAAgD;AAIhD,yEAAgE;AAEhE,8CAAoD;AACpD,wCAAwC;AAGjC,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,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,oBAAoB;QAClB,MA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qCAHb,sBAAa;QAEhB,gBAAU;QAET,kBAAW;GAPzB,WAAW,CAqNvB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/auth/consts/body.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,QAAS,MAAM,KAAG,MAyBrC,CAAC"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getBody = void 0;
|
4
|
+
const getBody = (url) => {
|
5
|
+
return `
|
6
|
+
<body style="font-family: Arial, sans-serif; background-color: #eef2f7; color: #333; margin: 0; padding: 0;">
|
7
|
+
<div style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
|
8
|
+
<div style="text-align: center; margin-bottom: 30px;">
|
9
|
+
<h1 style="color: #2c3e50; font-size: 26px; margin: 0;">Recuperação de Senha</h1>
|
10
|
+
</div>
|
11
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
12
|
+
<p>Olá,</p>
|
13
|
+
<p>Recebemos uma solicitação para redefinir sua senha em nossa plataforma. Para garantir que você é o proprietário desta conta, criamos um link exclusivo para redefinir sua senha.</p>
|
14
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
15
|
+
<p>Para redefinir sua senha, clique no botão abaixo:</p>
|
16
|
+
</div>
|
17
|
+
<div style="text-align: center; margin: 30px 0;">
|
18
|
+
<a href="${url}" style="display: inline-block; padding: 15px 30px; background-color: #3498db; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: bold; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);">Redefinir Senha</a>
|
19
|
+
</div>
|
20
|
+
<div style="font-size: 14px; line-height: 1.7; color: #666;">
|
21
|
+
<p>Por razões de segurança, evite compartilhar suas informações de login ou clicar em links suspeitos.</p>
|
22
|
+
<p>Agradecemos por escolher nossa plataforma!</p>
|
23
|
+
</div>
|
24
|
+
<div style="text-align: center; font-size: 13px; color: #95a5a6; margin-top: 40px; border-top: 1px solid #ecf0f1; padding-top: 20px;">
|
25
|
+
<p>Este email foi enviado automaticamente. Por favor, não responda.</p>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</body>`;
|
29
|
+
};
|
30
|
+
exports.getBody = getBody;
|
31
|
+
//# sourceMappingURL=body.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/auth/consts/body.ts"],"names":[],"mappings":";;;AAAO,MAAM,OAAO,GAAG,CAAC,GAAW,EAAU,EAAE;IAC7C,OAAO;;;;;;;;;;;;;2CAakC,GAAG;;;;;;;;;;gBAU9B,CAAC;AACjB,CAAC,CAAC;AAzBW,QAAA,OAAO,WAyBlB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../../../src/auth/consts/subject.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,mCAAyB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"subject.js","sourceRoot":"","sources":["../../../src/auth/consts/subject.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,sBAAsB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"reset.dto.d.ts","sourceRoot":"","sources":["../../../src/auth/dto/reset.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAQ;IAGjB,WAAW,EAAE,MAAM,CAAC;IAIpB,kBAAkB,EAAE,MAAM,CAAC;IAG3B,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
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.ResetDTO = void 0;
|
13
|
+
const class_validator_1 = require("class-validator");
|
14
|
+
class ResetDTO {
|
15
|
+
}
|
16
|
+
exports.ResetDTO = ResetDTO;
|
17
|
+
__decorate([
|
18
|
+
(0, class_validator_1.IsNotEmpty)(),
|
19
|
+
(0, class_validator_1.MinLength)(8),
|
20
|
+
__metadata("design:type", String)
|
21
|
+
], ResetDTO.prototype, "newPassword", void 0);
|
22
|
+
__decorate([
|
23
|
+
(0, class_validator_1.IsNotEmpty)(),
|
24
|
+
(0, class_validator_1.MinLength)(8),
|
25
|
+
__metadata("design:type", String)
|
26
|
+
], ResetDTO.prototype, "confirmNewPassword", void 0);
|
27
|
+
__decorate([
|
28
|
+
(0, class_validator_1.IsNotEmpty)(),
|
29
|
+
__metadata("design:type", String)
|
30
|
+
], ResetDTO.prototype, "code", void 0);
|
31
|
+
//# sourceMappingURL=reset.dto.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"reset.dto.js","sourceRoot":"","sources":["../../../src/auth/dto/reset.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwD;AAExD,MAAa,QAAQ;CAWpB;AAXD,4BAWC;AARG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;;6CACO;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;;oDACc;AAG3B;IADC,IAAA,4BAAU,GAAE;;sCACA"}
|
@@ -37,12 +37,39 @@ export declare class MenuController {
|
|
37
37
|
next: number;
|
38
38
|
data: any;
|
39
39
|
}>;
|
40
|
-
updateRoles(menuId: number, data: UpdateIdsDTO): Promise<
|
41
|
-
updateScreens(menuId: number, data: UpdateIdsDTO): Promise<
|
42
|
-
show(menuId: number): Promise<
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
updateRoles(menuId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
41
|
+
updateScreens(menuId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
42
|
+
show(menuId: number): Promise<{
|
43
|
+
id: number;
|
44
|
+
created_at: Date;
|
45
|
+
updated_at: Date;
|
46
|
+
menu_id: number | null;
|
47
|
+
slug: string;
|
48
|
+
url: string | null;
|
49
|
+
order: number;
|
50
|
+
icon: string | null;
|
51
|
+
}>;
|
52
|
+
create(data: CreateDTO): Promise<{
|
53
|
+
id: number;
|
54
|
+
created_at: Date;
|
55
|
+
updated_at: Date;
|
56
|
+
menu_id: number | null;
|
57
|
+
slug: string;
|
58
|
+
url: string | null;
|
59
|
+
order: number;
|
60
|
+
icon: string | null;
|
61
|
+
}>;
|
62
|
+
update(menuId: number, data: UpdateDTO): Promise<{
|
63
|
+
id: number;
|
64
|
+
created_at: Date;
|
65
|
+
updated_at: Date;
|
66
|
+
menu_id: number | null;
|
67
|
+
slug: string;
|
68
|
+
url: string | null;
|
69
|
+
order: number;
|
70
|
+
icon: string | null;
|
71
|
+
}>;
|
72
|
+
delete(data: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
46
73
|
updateOrder(data: OrderDTO): Promise<void>;
|
47
74
|
}
|
48
75
|
//# sourceMappingURL=menu.controller.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"menu.controller.d.ts","sourceRoot":"","sources":["../../src/menu/menu.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,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;IAIrC,aAAa,CAAS,EAAE,EAAE,EAAE;;KAAA,EAAY,MAAM,KAAA;IAK9C,IAAI,CAAe,gBAAgB,KAAA,EAAY,MAAM,KAAA;;;;;;;;;IAKrD,SAAS,CACkB,MAAM,EAAE,MAAM,EAC/B,gBAAgB,KAAA,EACpB,MAAM,KAAA;;;;;;;;;IAMZ,WAAW,CACgB,MAAM,EAAE,MAAM,EAC/B,gBAAgB,KAAA,EACpB,MAAM,KAAA;;;;;;;;;IAMZ,WAAW,CACgB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,YAAY;IAMtB,aAAa,CACc,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,YAAY;IAMtB,IAAI,CAAgC,MAAM,EAAE,MAAM
|
1
|
+
{"version":3,"file":"menu.controller.d.ts","sourceRoot":"","sources":["../../src/menu/menu.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,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;IAIrC,aAAa,CAAS,EAAE,EAAE,EAAE;;KAAA,EAAY,MAAM,KAAA;IAK9C,IAAI,CAAe,gBAAgB,KAAA,EAAY,MAAM,KAAA;;;;;;;;;IAKrD,SAAS,CACkB,MAAM,EAAE,MAAM,EAC/B,gBAAgB,KAAA,EACpB,MAAM,KAAA;;;;;;;;;IAMZ,WAAW,CACgB,MAAM,EAAE,MAAM,EAC/B,gBAAgB,KAAA,EACpB,MAAM,KAAA;;;;;;;;;IAMZ,WAAW,CACgB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,YAAY;IAMtB,aAAa,CACc,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,YAAY;IAMtB,IAAI,CAAgC,MAAM,EAAE,MAAM;;;;;;;;;;IAKlD,MAAM,CAAS,IAAI,EAAE,SAAS;;;;;;;;;;IAK9B,MAAM,CACqB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,SAAS;;;;;;;;;;IASnB,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,WAAW,CAAS,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzD"}
|
@@ -9,8 +9,8 @@ export declare class MenuService {
|
|
9
9
|
private readonly prismaService;
|
10
10
|
private readonly paginationService;
|
11
11
|
constructor(prismaService: PrismaService, paginationService: PaginationService);
|
12
|
-
updateScreens(menuId: number, data: UpdateIdsDTO): Promise<
|
13
|
-
updateRoles(menuId: number, data: UpdateIdsDTO): Promise<
|
12
|
+
updateScreens(menuId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
13
|
+
updateRoles(menuId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
14
14
|
listScreens(locale: string, menuId: number, paginationParams: PaginationDTO): Promise<{
|
15
15
|
total: any;
|
16
16
|
lastPage: number;
|
@@ -40,13 +40,40 @@ export declare class MenuService {
|
|
40
40
|
next: number;
|
41
41
|
data: any;
|
42
42
|
}>;
|
43
|
-
get(menuId: number): Promise<
|
44
|
-
|
43
|
+
get(menuId: number): Promise<{
|
44
|
+
id: number;
|
45
|
+
created_at: Date;
|
46
|
+
updated_at: Date;
|
47
|
+
menu_id: number | null;
|
48
|
+
slug: string;
|
49
|
+
url: string | null;
|
50
|
+
order: number;
|
51
|
+
icon: string | null;
|
52
|
+
}>;
|
53
|
+
create({ slug, url, icon, order, menuId }: CreateDTO): Promise<{
|
54
|
+
id: number;
|
55
|
+
created_at: Date;
|
56
|
+
updated_at: Date;
|
57
|
+
menu_id: number | null;
|
58
|
+
slug: string;
|
59
|
+
url: string | null;
|
60
|
+
order: number;
|
61
|
+
icon: string | null;
|
62
|
+
}>;
|
45
63
|
update({ id, data }: {
|
46
64
|
id: number;
|
47
65
|
data: UpdateDTO;
|
48
|
-
}): Promise<
|
49
|
-
|
66
|
+
}): Promise<{
|
67
|
+
id: number;
|
68
|
+
created_at: Date;
|
69
|
+
updated_at: Date;
|
70
|
+
menu_id: number | null;
|
71
|
+
slug: string;
|
72
|
+
url: string | null;
|
73
|
+
order: number;
|
74
|
+
icon: string | null;
|
75
|
+
}>;
|
76
|
+
delete({ ids }: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
50
77
|
updateOrder({ ids }: OrderDTO): Promise<void>;
|
51
78
|
}
|
52
79
|
//# sourceMappingURL=menu.service.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"menu.service.d.ts","sourceRoot":"","sources":["../../src/menu/menu.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC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pD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;IAgBzB,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAsBpD"}
|
@@ -51,13 +51,13 @@ export declare class RoleController {
|
|
51
51
|
next: number;
|
52
52
|
data: any;
|
53
53
|
}>;
|
54
|
-
updateUsers(roleId: number, data: UpdateIdsDTO): Promise<
|
55
|
-
updateMenus(roleId: number, data: UpdateIdsDTO): Promise<
|
56
|
-
updateRoutes(roleId: number, data: UpdateIdsDTO): Promise<
|
57
|
-
updateScreens(roleId: number, data: UpdateIdsDTO): Promise<
|
54
|
+
updateUsers(roleId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
55
|
+
updateMenus(roleId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
56
|
+
updateRoutes(roleId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
57
|
+
updateScreens(roleId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
58
58
|
show(roleId: number, locale: any): Promise<any>;
|
59
59
|
create(data: CreateDTO): Promise<any>;
|
60
60
|
update(roleId: number, data: UpdateDTO): Promise<any>;
|
61
|
-
delete(data: DeleteDTO): Promise<
|
61
|
+
delete(data: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
62
62
|
}
|
63
63
|
//# sourceMappingURL=role.controller.d.ts.map
|
@@ -10,10 +10,10 @@ export declare class RoleService {
|
|
10
10
|
private readonly paginationService;
|
11
11
|
private readonly localeService;
|
12
12
|
constructor(prismaService: PrismaService, paginationService: PaginationService, localeService: LocaleService);
|
13
|
-
updateUsers(roleId: number, { ids }: UpdateIdsDTO): Promise<
|
14
|
-
updateScreens(roleId: number, data: UpdateIdsDTO): Promise<
|
15
|
-
updateRoutes(roleId: number, data: UpdateIdsDTO): Promise<
|
16
|
-
updateMenus(roleId: number, data: UpdateIdsDTO): Promise<
|
13
|
+
updateUsers(roleId: number, { ids }: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
14
|
+
updateScreens(roleId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
15
|
+
updateRoutes(roleId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
16
|
+
updateMenus(roleId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
17
17
|
listUsers(roleId: number, paginationParams: PaginationDTO): Promise<{
|
18
18
|
total: any;
|
19
19
|
lastPage: number;
|
@@ -65,6 +65,6 @@ export declare class RoleService {
|
|
65
65
|
id: number;
|
66
66
|
data: UpdateDTO;
|
67
67
|
}): Promise<any>;
|
68
|
-
delete({ ids }: DeleteDTO): Promise<
|
68
|
+
delete({ ids }: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
69
69
|
}
|
70
70
|
//# sourceMappingURL=role.service.d.ts.map
|
@@ -16,10 +16,31 @@ export declare class RouteController {
|
|
16
16
|
next: number;
|
17
17
|
data: any;
|
18
18
|
}>;
|
19
|
-
get(routeId: number): Promise<
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
get(routeId: number): Promise<{
|
20
|
+
method: import(".prisma/client").$Enums.route_method_enum;
|
21
|
+
id: number;
|
22
|
+
description: string | null;
|
23
|
+
created_at: Date;
|
24
|
+
updated_at: Date;
|
25
|
+
url: string;
|
26
|
+
}>;
|
27
|
+
create({ url, method }: CreateDTO): Promise<{
|
28
|
+
method: import(".prisma/client").$Enums.route_method_enum;
|
29
|
+
id: number;
|
30
|
+
description: string | null;
|
31
|
+
created_at: Date;
|
32
|
+
updated_at: Date;
|
33
|
+
url: string;
|
34
|
+
}>;
|
35
|
+
update(routeId: number, data: UpdateDTO): Promise<{
|
36
|
+
method: import(".prisma/client").$Enums.route_method_enum;
|
37
|
+
id: number;
|
38
|
+
description: string | null;
|
39
|
+
created_at: Date;
|
40
|
+
updated_at: Date;
|
41
|
+
url: string;
|
42
|
+
}>;
|
43
|
+
delete(data: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
23
44
|
listRoles(routeId: number, paginationParams: PaginationDTO, locale: any): Promise<{
|
24
45
|
total: any;
|
25
46
|
lastPage: number;
|
@@ -29,7 +50,7 @@ export declare class RouteController {
|
|
29
50
|
next: number;
|
30
51
|
data: any;
|
31
52
|
}>;
|
32
|
-
updateRoles(routeId: number, data: UpdateIdsDTO): Promise<
|
53
|
+
updateRoles(routeId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
33
54
|
listScreens(routeId: number, paginationParams: PaginationDTO, locale: any): Promise<{
|
34
55
|
total: any;
|
35
56
|
lastPage: number;
|
@@ -39,6 +60,6 @@ export declare class RouteController {
|
|
39
60
|
next: number;
|
40
61
|
data: any;
|
41
62
|
}>;
|
42
|
-
updateScreens(routeId: number, data: UpdateIdsDTO): Promise<
|
63
|
+
updateScreens(routeId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
43
64
|
}
|
44
65
|
//# sourceMappingURL=route.controller.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"route.controller.d.ts","sourceRoot":"","sources":["../../src/route/route.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAa/D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAEa,eAAe;IAGxB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAIvC,IAAI,CAAe,gBAAgB,KAAA;;;;;;;;;IAKnC,GAAG,CAAiC,OAAO,EAAE,MAAM
|
1
|
+
{"version":3,"file":"route.controller.d.ts","sourceRoot":"","sources":["../../src/route/route.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAa/D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAEa,eAAe;IAGxB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAIvC,IAAI,CAAe,gBAAgB,KAAA;;;;;;;;;IAKnC,GAAG,CAAiC,OAAO,EAAE,MAAM;;;;;;;;IAKnD,MAAM,CAAS,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,SAAS;;;;;;;;IAKzC,MAAM,CACsB,OAAO,EAAE,MAAM,EACvC,IAAI,EAAE,SAAS;;;;;;;;IAMnB,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,SAAS,CACmB,OAAO,EAAE,MAAM,EACjC,gBAAgB,EAAE,aAAa,EACnC,MAAM,KAAA;;;;;;;;;IAMZ,WAAW,CACiB,OAAO,EAAE,MAAM,EACvC,IAAI,EAAE,YAAY;IAMtB,WAAW,CACiB,OAAO,EAAE,MAAM,EACjC,gBAAgB,EAAE,aAAa,EACnC,MAAM,KAAA;;;;;;;;;IAMZ,aAAa,CACe,OAAO,EAAE,MAAM,EACvC,IAAI,EAAE,YAAY;CAI7B"}
|
@@ -17,13 +17,34 @@ export declare class RouteService {
|
|
17
17
|
next: number;
|
18
18
|
data: any;
|
19
19
|
}>;
|
20
|
-
get(routeId: number): Promise<
|
21
|
-
|
20
|
+
get(routeId: number): Promise<{
|
21
|
+
method: import(".prisma/client").$Enums.route_method_enum;
|
22
|
+
id: number;
|
23
|
+
description: string | null;
|
24
|
+
created_at: Date;
|
25
|
+
updated_at: Date;
|
26
|
+
url: string;
|
27
|
+
}>;
|
28
|
+
create({ url, method }: CreateDTO): Promise<{
|
29
|
+
method: import(".prisma/client").$Enums.route_method_enum;
|
30
|
+
id: number;
|
31
|
+
description: string | null;
|
32
|
+
created_at: Date;
|
33
|
+
updated_at: Date;
|
34
|
+
url: string;
|
35
|
+
}>;
|
22
36
|
update({ id, data }: {
|
23
37
|
id: number;
|
24
38
|
data: UpdateDTO;
|
25
|
-
}): Promise<
|
26
|
-
|
39
|
+
}): Promise<{
|
40
|
+
method: import(".prisma/client").$Enums.route_method_enum;
|
41
|
+
id: number;
|
42
|
+
description: string | null;
|
43
|
+
created_at: Date;
|
44
|
+
updated_at: Date;
|
45
|
+
url: string;
|
46
|
+
}>;
|
47
|
+
delete({ ids }: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
27
48
|
listRoles(locale: string, routeId: number, paginationParams: PaginationDTO): Promise<{
|
28
49
|
total: any;
|
29
50
|
lastPage: number;
|
@@ -33,7 +54,7 @@ export declare class RouteService {
|
|
33
54
|
next: number;
|
34
55
|
data: any;
|
35
56
|
}>;
|
36
|
-
updateRoles(routeId: number, data: UpdateIdsDTO): Promise<
|
57
|
+
updateRoles(routeId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
37
58
|
listScreens(locale: string, routeId: number, paginationParams: PaginationDTO): Promise<{
|
38
59
|
total: any;
|
39
60
|
lastPage: number;
|
@@ -43,6 +64,6 @@ export declare class RouteService {
|
|
43
64
|
next: number;
|
44
65
|
data: any;
|
45
66
|
}>;
|
46
|
-
updateScreens(routeId: number, data: UpdateIdsDTO): Promise<
|
67
|
+
updateScreens(routeId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
47
68
|
}
|
48
69
|
//# sourceMappingURL=route.service.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"route.service.d.ts","sourceRoot":"","sources":["../../src/route/route.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,YAAY;IAGrB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,IAAI,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAmBpC,GAAG,CAAC,OAAO,EAAE,MAAM
|
1
|
+
{"version":3,"file":"route.service.d.ts","sourceRoot":"","sources":["../../src/route/route.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,YAAY;IAGrB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,IAAI,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAmBpC,GAAG,CAAC,OAAO,EAAE,MAAM;;;;;;;;IAInB,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,SAAS;;;;;;;;IAIjC,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;IAUzB,SAAS,CACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,aAAa;;;;;;;;;IAiC3B,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;IAgB/C,WAAW,CACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,aAAa;;;;;;;;;IAgC3B,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;CAexD"}
|
@@ -33,11 +33,29 @@ export declare class ScreenController {
|
|
33
33
|
next: number;
|
34
34
|
data: any;
|
35
35
|
}>;
|
36
|
-
updateRoles(screenId: number, data: UpdateIdsDTO): Promise<
|
37
|
-
updateRoutes(screenId: number, data: UpdateIdsDTO): Promise<
|
38
|
-
show(screenId: number): Promise<
|
39
|
-
|
40
|
-
|
41
|
-
|
36
|
+
updateRoles(screenId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
37
|
+
updateRoutes(screenId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
38
|
+
show(screenId: number): Promise<{
|
39
|
+
id: number;
|
40
|
+
created_at: Date;
|
41
|
+
updated_at: Date;
|
42
|
+
slug: string;
|
43
|
+
icon: string | null;
|
44
|
+
}>;
|
45
|
+
create(data: CreateDTO): Promise<{
|
46
|
+
id: number;
|
47
|
+
created_at: Date;
|
48
|
+
updated_at: Date;
|
49
|
+
slug: string;
|
50
|
+
icon: string | null;
|
51
|
+
}>;
|
52
|
+
update(screenId: number, data: UpdateDTO): Promise<{
|
53
|
+
id: number;
|
54
|
+
created_at: Date;
|
55
|
+
updated_at: Date;
|
56
|
+
slug: string;
|
57
|
+
icon: string | null;
|
58
|
+
}>;
|
59
|
+
delete(data: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
42
60
|
}
|
43
61
|
//# sourceMappingURL=screen.controller.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.controller.d.ts","sourceRoot":"","sources":["../../src/screen/screen.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAEa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAIzC,IAAI,CAAe,gBAAgB,KAAA,EAAY,MAAM,KAAA;;;;;;;;;IAKrD,SAAS,CACoB,QAAQ,EAAE,MAAM,EACnC,gBAAgB,KAAA,EACpB,MAAM,KAAA;;;;;;;;;IAMZ,UAAU,CACmB,QAAQ,EAAE,MAAM,EACnC,gBAAgB,KAAA;;;;;;;;;IAM1B,WAAW,CACkB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,YAAY;IAMtB,YAAY,CACiB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,YAAY;IAMtB,IAAI,CAAkC,QAAQ,EAAE,MAAM
|
1
|
+
{"version":3,"file":"screen.controller.d.ts","sourceRoot":"","sources":["../../src/screen/screen.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAEa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAIzC,IAAI,CAAe,gBAAgB,KAAA,EAAY,MAAM,KAAA;;;;;;;;;IAKrD,SAAS,CACoB,QAAQ,EAAE,MAAM,EACnC,gBAAgB,KAAA,EACpB,MAAM,KAAA;;;;;;;;;IAMZ,UAAU,CACmB,QAAQ,EAAE,MAAM,EACnC,gBAAgB,KAAA;;;;;;;;;IAM1B,WAAW,CACkB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,YAAY;IAMtB,YAAY,CACiB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,YAAY;IAMtB,IAAI,CAAkC,QAAQ,EAAE,MAAM;;;;;;;IAK5D,MAAM,CAAS,IAAI,EAAE,SAAS;;;;;;;IAKxB,MAAM,CACuB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,SAAS;;;;;;;IASnB,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
|
@@ -8,8 +8,8 @@ export declare class ScreenService {
|
|
8
8
|
private readonly prismaService;
|
9
9
|
private readonly paginationService;
|
10
10
|
constructor(prismaService: PrismaService, paginationService: PaginationService);
|
11
|
-
updateRoles(screenId: number, data: UpdateIdsDTO): Promise<
|
12
|
-
updateRoutes(screenId: number, { ids }: UpdateIdsDTO): Promise<
|
11
|
+
updateRoles(screenId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
12
|
+
updateRoutes(screenId: number, { ids }: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
13
13
|
listRoutes(screenId: number, paginationParams: PaginationDTO): Promise<{
|
14
14
|
total: any;
|
15
15
|
lastPage: number;
|
@@ -37,12 +37,30 @@ export declare class ScreenService {
|
|
37
37
|
next: number;
|
38
38
|
data: any;
|
39
39
|
}>;
|
40
|
-
get(screenId: number): Promise<
|
41
|
-
|
40
|
+
get(screenId: number): Promise<{
|
41
|
+
id: number;
|
42
|
+
created_at: Date;
|
43
|
+
updated_at: Date;
|
44
|
+
slug: string;
|
45
|
+
icon: string | null;
|
46
|
+
}>;
|
47
|
+
create({ slug, icon }: CreateDTO): Promise<{
|
48
|
+
id: number;
|
49
|
+
created_at: Date;
|
50
|
+
updated_at: Date;
|
51
|
+
slug: string;
|
52
|
+
icon: string | null;
|
53
|
+
}>;
|
42
54
|
update({ id, data }: {
|
43
55
|
id: number;
|
44
56
|
data: UpdateDTO;
|
45
|
-
}): Promise<
|
46
|
-
|
57
|
+
}): Promise<{
|
58
|
+
id: number;
|
59
|
+
created_at: Date;
|
60
|
+
updated_at: Date;
|
61
|
+
slug: string;
|
62
|
+
icon: string | null;
|
63
|
+
}>;
|
64
|
+
delete({ ids }: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
47
65
|
}
|
48
66
|
//# sourceMappingURL=screen.service.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.service.d.ts","sourceRoot":"","sources":["../../src/screen/screen.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAA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,iBAAiB;IAGjD,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;IAehD,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,YAAY;IA4BpD,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;;;;;;;;;IAoB5D,SAAS,CACb,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,aAAa;;;;;;;;;IAqB3B,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;;;;;;;;;IAkCpD,GAAG,CAAC,QAAQ,EAAE,MAAM;;;;;;;IAIpB,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,SAAS;;;;;;;IAShC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;;;;;;;IAOpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;CAehC"}
|
@@ -24,10 +24,37 @@ export declare class UserController {
|
|
24
24
|
next: number;
|
25
25
|
data: any;
|
26
26
|
}>;
|
27
|
-
updateRoles(userId: number, data: UpdateIdsDTO): Promise<
|
28
|
-
get(userId: number): Promise<
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
updateRoles(userId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
28
|
+
get(userId: number): Promise<{
|
29
|
+
code: string | null;
|
30
|
+
name: string;
|
31
|
+
id: number;
|
32
|
+
created_at: Date;
|
33
|
+
updated_at: Date;
|
34
|
+
multifactor_id: number | null;
|
35
|
+
email: string;
|
36
|
+
password: string;
|
37
|
+
}>;
|
38
|
+
create(data: CreateDTO): Promise<{
|
39
|
+
code: string | null;
|
40
|
+
name: string;
|
41
|
+
id: number;
|
42
|
+
created_at: Date;
|
43
|
+
updated_at: Date;
|
44
|
+
multifactor_id: number | null;
|
45
|
+
email: string;
|
46
|
+
password: string;
|
47
|
+
}>;
|
48
|
+
update(userId: number, data: UpdateDTO): Promise<{
|
49
|
+
code: string | null;
|
50
|
+
name: string;
|
51
|
+
id: number;
|
52
|
+
created_at: Date;
|
53
|
+
updated_at: Date;
|
54
|
+
multifactor_id: number | null;
|
55
|
+
email: string;
|
56
|
+
password: string;
|
57
|
+
}>;
|
58
|
+
delete(data: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
32
59
|
}
|
33
60
|
//# sourceMappingURL=user.controller.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"user.controller.d.ts","sourceRoot":"","sources":["../../src/user/user.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,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;IAIrC,IAAI,CAAe,gBAAgB,KAAA;;;;;;;;;IAKnC,SAAS,CACkB,MAAM,EAAE,MAAM,EAC/B,gBAAgB,KAAA;;;;;;;;;IAM1B,WAAW,CACgB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,YAAY;IAMtB,GAAG,CAAgC,MAAM,EAAE,MAAM
|
1
|
+
{"version":3,"file":"user.controller.d.ts","sourceRoot":"","sources":["../../src/user/user.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,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;IAIrC,IAAI,CAAe,gBAAgB,KAAA;;;;;;;;;IAKnC,SAAS,CACkB,MAAM,EAAE,MAAM,EAC/B,gBAAgB,KAAA;;;;;;;;;IAM1B,WAAW,CACgB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,YAAY;IAMtB,GAAG,CAAgC,MAAM,EAAE,MAAM;;;;;;;;;;IAKvD,MAAM,CAAS,IAAI,EAAE,SAAS;;;;;;;;;;IAKxB,MAAM,CACqB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,SAAS;;;;;;;;;;IASnB,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
|
@@ -17,7 +17,7 @@ export declare class UserService {
|
|
17
17
|
next: number;
|
18
18
|
data: any;
|
19
19
|
}>;
|
20
|
-
updateRoles(userId: number, { ids }: UpdateIdsDTO): Promise<
|
20
|
+
updateRoles(userId: number, { ids }: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
21
21
|
list(paginationParams: PaginationDTO): Promise<{
|
22
22
|
total: any;
|
23
23
|
lastPage: number;
|
@@ -27,13 +27,40 @@ export declare class UserService {
|
|
27
27
|
next: number;
|
28
28
|
data: any;
|
29
29
|
}>;
|
30
|
-
get(userId: number): Promise<
|
30
|
+
get(userId: number): Promise<{
|
31
|
+
code: string | null;
|
32
|
+
name: string;
|
33
|
+
id: number;
|
34
|
+
created_at: Date;
|
35
|
+
updated_at: Date;
|
36
|
+
multifactor_id: number | null;
|
37
|
+
email: string;
|
38
|
+
password: string;
|
39
|
+
}>;
|
31
40
|
hashPassword(password: string): Promise<string>;
|
32
|
-
create({ email, name, password }: CreateDTO): Promise<
|
41
|
+
create({ email, name, password }: CreateDTO): Promise<{
|
42
|
+
code: string | null;
|
43
|
+
name: string;
|
44
|
+
id: number;
|
45
|
+
created_at: Date;
|
46
|
+
updated_at: Date;
|
47
|
+
multifactor_id: number | null;
|
48
|
+
email: string;
|
49
|
+
password: string;
|
50
|
+
}>;
|
33
51
|
update({ id, data }: {
|
34
52
|
id: number;
|
35
53
|
data: UpdateDTO;
|
36
|
-
}): Promise<
|
37
|
-
|
54
|
+
}): Promise<{
|
55
|
+
code: string | null;
|
56
|
+
name: string;
|
57
|
+
id: number;
|
58
|
+
created_at: Date;
|
59
|
+
updated_at: Date;
|
60
|
+
multifactor_id: number | null;
|
61
|
+
email: string;
|
62
|
+
password: string;
|
63
|
+
}>;
|
64
|
+
delete({ ids }: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
38
65
|
}
|
39
66
|
//# sourceMappingURL=user.service.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"user.service.d.ts","sourceRoot":"","sources":["../../src/user/user.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQ/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,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,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;;;;;;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S,CAAA;KAAE;;;;;;;;;;IAOpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;CAoBhC"}
|
package/package.json
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
{
|
2
|
-
"name": "@hedhog/admin",
|
3
|
-
"version": "0.7.
|
4
|
-
"private": false,
|
5
|
-
"main": "dist/index.js",
|
6
|
-
"scripts": {
|
7
|
-
"clean": "rimraf ./dist",
|
8
|
-
"prebuild": "npm run clean",
|
9
|
-
"build": "tsc --project tsconfig.production.json && npm version patch",
|
10
|
-
"prod": "npm run build && npm publish --access public"
|
11
|
-
},
|
12
|
-
"file": [
|
13
|
-
"dist/**/*",
|
14
|
-
"src/entities/**/*.ts",
|
15
|
-
"src/migrations/**/*.ts",
|
16
|
-
"src/**/*.ejs",
|
17
|
-
"hedhog.yaml"
|
18
|
-
],
|
19
|
-
"keywords": [],
|
20
|
-
"author": "",
|
21
|
-
"license": "MIT",
|
22
|
-
"description": "",
|
23
|
-
"devDependencies": {
|
24
|
-
"@hedhog/locale": "^0.
|
25
|
-
"@hedhog/mail": "^0.
|
26
|
-
"@hedhog/pagination": "^0.
|
27
|
-
"@hedhog/prisma": "^0.
|
28
|
-
"@hedhog/setting": "^0.
|
29
|
-
"@hedhog/utils": "^0.0.27",
|
30
|
-
"@nestjs/mapped-types": "^2.0.5",
|
31
|
-
"ts-node": "^10.9.1",
|
32
|
-
"typescript": "^5.1.3"
|
33
|
-
},
|
34
|
-
"peerDependencies": {
|
35
|
-
"@hedhog/locale": "latest",
|
36
|
-
"@hedhog/mail": "latest",
|
37
|
-
"@hedhog/pagination": "latest",
|
38
|
-
"@hedhog/prisma": "latest",
|
39
|
-
"@hedhog/setting": "latest",
|
40
|
-
"@hedhog/utils": "latest",
|
41
|
-
"@nestjs/jwt": "latest"
|
42
|
-
}
|
43
|
-
}
|
1
|
+
{
|
2
|
+
"name": "@hedhog/admin",
|
3
|
+
"version": "0.7.6",
|
4
|
+
"private": false,
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"scripts": {
|
7
|
+
"clean": "rimraf ./dist",
|
8
|
+
"prebuild": "npm run clean",
|
9
|
+
"build": "tsc --project tsconfig.production.json && npm version patch",
|
10
|
+
"prod": "npm run build && npm publish --access public"
|
11
|
+
},
|
12
|
+
"file": [
|
13
|
+
"dist/**/*",
|
14
|
+
"src/entities/**/*.ts",
|
15
|
+
"src/migrations/**/*.ts",
|
16
|
+
"src/**/*.ejs",
|
17
|
+
"hedhog.yaml"
|
18
|
+
],
|
19
|
+
"keywords": [],
|
20
|
+
"author": "",
|
21
|
+
"license": "MIT",
|
22
|
+
"description": "",
|
23
|
+
"devDependencies": {
|
24
|
+
"@hedhog/locale": "^0.7.6",
|
25
|
+
"@hedhog/mail": "^0.7.1",
|
26
|
+
"@hedhog/pagination": "^0.7.1",
|
27
|
+
"@hedhog/prisma": "^0.7.3",
|
28
|
+
"@hedhog/setting": "^0.7.4",
|
29
|
+
"@hedhog/utils": "^0.0.27",
|
30
|
+
"@nestjs/mapped-types": "^2.0.5",
|
31
|
+
"ts-node": "^10.9.1",
|
32
|
+
"typescript": "^5.1.3"
|
33
|
+
},
|
34
|
+
"peerDependencies": {
|
35
|
+
"@hedhog/locale": "latest",
|
36
|
+
"@hedhog/mail": "latest",
|
37
|
+
"@hedhog/pagination": "latest",
|
38
|
+
"@hedhog/prisma": "latest",
|
39
|
+
"@hedhog/setting": "latest",
|
40
|
+
"@hedhog/utils": "latest",
|
41
|
+
"@nestjs/jwt": "latest"
|
42
|
+
}
|
43
|
+
}
|
package/src/admin.module.ts
CHANGED
@@ -8,10 +8,12 @@ import { RoleModule } from './role/role.module';
|
|
8
8
|
import { RouteModule } from './route/route.module';
|
9
9
|
import { ScreenModule } from './screen/screen.module';
|
10
10
|
import { UserModule } from './user/user.module';
|
11
|
+
import { MailModule } from '@hedhog/mail';
|
11
12
|
|
12
13
|
@Module({
|
13
14
|
imports: [
|
14
15
|
forwardRef(() => AuthModule),
|
16
|
+
forwardRef(() => MailModule),
|
15
17
|
forwardRef(() => MenuModule),
|
16
18
|
forwardRef(() => PaginationModule),
|
17
19
|
forwardRef(() => RoleModule),
|
@@ -24,6 +26,7 @@ import { UserModule } from './user/user.module';
|
|
24
26
|
exports: [
|
25
27
|
UserModule,
|
26
28
|
AuthModule,
|
29
|
+
MailModule,
|
27
30
|
RouteModule,
|
28
31
|
RoleModule,
|
29
32
|
MenuModule,
|
@@ -9,6 +9,7 @@ import {
|
|
9
9
|
import { Role, Public, User } from '@hedhog/core';
|
10
10
|
import { AuthService } from './auth.service';
|
11
11
|
import { ForgetDTO } from './dto/forget.dto';
|
12
|
+
import { ResetDTO } from './dto/reset.dto';
|
12
13
|
import { LoginDTO } from './dto/login.dto';
|
13
14
|
import { OtpDTO } from './dto/otp.dto';
|
14
15
|
import { User as UserType } from './types/user.type';
|
@@ -18,7 +19,7 @@ export class AuthController {
|
|
18
19
|
constructor(
|
19
20
|
@Inject(forwardRef(() => AuthService))
|
20
21
|
private readonly service: AuthService,
|
21
|
-
) {}
|
22
|
+
) { }
|
22
23
|
|
23
24
|
@Role()
|
24
25
|
@Get('verify')
|
@@ -40,7 +41,32 @@ export class AuthController {
|
|
40
41
|
|
41
42
|
@Public()
|
42
43
|
@Post('forget')
|
43
|
-
async forget(@Body() {
|
44
|
-
|
44
|
+
async forget(@Body() {
|
45
|
+
email,
|
46
|
+
subject,
|
47
|
+
body,
|
48
|
+
}: ForgetDTO & {
|
49
|
+
subject: string;
|
50
|
+
body: string;
|
51
|
+
}) {
|
52
|
+
return this.service.forget({
|
53
|
+
email,
|
54
|
+
subject,
|
55
|
+
body,
|
56
|
+
});
|
57
|
+
}
|
58
|
+
|
59
|
+
@Public()
|
60
|
+
@Post('reset')
|
61
|
+
async reset(@Body() {
|
62
|
+
newPassword,
|
63
|
+
confirmNewPassword,
|
64
|
+
code,
|
65
|
+
}: ResetDTO) {
|
66
|
+
return this.service.resetPassword({
|
67
|
+
newPassword,
|
68
|
+
confirmNewPassword,
|
69
|
+
code,
|
70
|
+
});
|
45
71
|
}
|
46
72
|
}
|
package/src/auth/auth.service.ts
CHANGED
@@ -5,13 +5,17 @@ import {
|
|
5
5
|
Inject,
|
6
6
|
Injectable,
|
7
7
|
NotFoundException,
|
8
|
+
BadRequestException,
|
8
9
|
} from '@nestjs/common';
|
9
10
|
import { JwtService } from '@nestjs/jwt';
|
10
|
-
import { compare } from 'bcrypt';
|
11
|
+
import { compare, genSalt, hash } from 'bcrypt';
|
11
12
|
import { ForgetDTO } from './dto/forget.dto';
|
12
13
|
import { LoginDTO } from './dto/login.dto';
|
13
14
|
import { OtpDTO } from './dto/otp.dto';
|
14
15
|
import { MultifactorType } from './enums/multifactor-type.enum';
|
16
|
+
import { User } from 'hcode-core';
|
17
|
+
import { SUBJECT_RECOVERY } from './consts/subject';
|
18
|
+
import { getBody } from './consts/body';
|
15
19
|
|
16
20
|
@Injectable()
|
17
21
|
export class AuthService {
|
@@ -105,7 +109,14 @@ export class AuthService {
|
|
105
109
|
};
|
106
110
|
}
|
107
111
|
|
108
|
-
async forget({
|
112
|
+
async forget({
|
113
|
+
email,
|
114
|
+
subject,
|
115
|
+
body,
|
116
|
+
}: ForgetDTO & {
|
117
|
+
subject?: string;
|
118
|
+
body?: string;
|
119
|
+
}) {
|
109
120
|
const user = await this.prisma.user.findFirst({
|
110
121
|
where: {
|
111
122
|
email,
|
@@ -119,7 +130,11 @@ export class AuthService {
|
|
119
130
|
throw new NotFoundException('User not found');
|
120
131
|
}
|
121
132
|
|
122
|
-
const
|
133
|
+
const payload = {
|
134
|
+
...user,
|
135
|
+
};
|
136
|
+
|
137
|
+
const code = this.jwt.sign(payload);
|
123
138
|
|
124
139
|
await this.prisma.user.update({
|
125
140
|
where: {
|
@@ -132,13 +147,57 @@ export class AuthService {
|
|
132
147
|
|
133
148
|
await this.mail.send({
|
134
149
|
to: email,
|
135
|
-
subject:
|
136
|
-
body:
|
150
|
+
subject: subject ?? SUBJECT_RECOVERY,
|
151
|
+
body:
|
152
|
+
body ??
|
153
|
+
getBody(`${process.env.FRONTEND_URL}/password-recovery/${code}`),
|
137
154
|
});
|
138
155
|
|
139
156
|
return true;
|
140
157
|
}
|
141
158
|
|
159
|
+
async resetPassword({
|
160
|
+
code,
|
161
|
+
newPassword,
|
162
|
+
confirmNewPassword,
|
163
|
+
}: {
|
164
|
+
code: string;
|
165
|
+
newPassword: string;
|
166
|
+
confirmNewPassword: string;
|
167
|
+
}) {
|
168
|
+
if (newPassword !== confirmNewPassword) {
|
169
|
+
throw new BadRequestException("Passwords don't match");
|
170
|
+
}
|
171
|
+
|
172
|
+
const { id } = this.jwt.decode(code) as User;
|
173
|
+
|
174
|
+
const user = await this.prisma.user.findFirst({
|
175
|
+
where: {
|
176
|
+
id,
|
177
|
+
code,
|
178
|
+
},
|
179
|
+
});
|
180
|
+
|
181
|
+
if (user) {
|
182
|
+
const salt = await genSalt();
|
183
|
+
const password = await hash(confirmNewPassword, salt);
|
184
|
+
|
185
|
+
await this.prisma.user.update({
|
186
|
+
where: {
|
187
|
+
id: user.id,
|
188
|
+
},
|
189
|
+
data: {
|
190
|
+
password,
|
191
|
+
code: null,
|
192
|
+
},
|
193
|
+
});
|
194
|
+
|
195
|
+
return this.getToken(user);
|
196
|
+
}
|
197
|
+
|
198
|
+
return false;
|
199
|
+
}
|
200
|
+
|
142
201
|
async otp({ token, code }: OtpDTO) {
|
143
202
|
const data = this.jwt.decode(token);
|
144
203
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
export const getBody = (url: string): string => {
|
2
|
+
return `
|
3
|
+
<body style="font-family: Arial, sans-serif; background-color: #eef2f7; color: #333; margin: 0; padding: 0;">
|
4
|
+
<div style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
|
5
|
+
<div style="text-align: center; margin-bottom: 30px;">
|
6
|
+
<h1 style="color: #2c3e50; font-size: 26px; margin: 0;">Recuperação de Senha</h1>
|
7
|
+
</div>
|
8
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
9
|
+
<p>Olá,</p>
|
10
|
+
<p>Recebemos uma solicitação para redefinir sua senha em nossa plataforma. Para garantir que você é o proprietário desta conta, criamos um link exclusivo para redefinir sua senha.</p>
|
11
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
12
|
+
<p>Para redefinir sua senha, clique no botão abaixo:</p>
|
13
|
+
</div>
|
14
|
+
<div style="text-align: center; margin: 30px 0;">
|
15
|
+
<a href="${url}" style="display: inline-block; padding: 15px 30px; background-color: #3498db; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: bold; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);">Redefinir Senha</a>
|
16
|
+
</div>
|
17
|
+
<div style="font-size: 14px; line-height: 1.7; color: #666;">
|
18
|
+
<p>Por razões de segurança, evite compartilhar suas informações de login ou clicar em links suspeitos.</p>
|
19
|
+
<p>Agradecemos por escolher nossa plataforma!</p>
|
20
|
+
</div>
|
21
|
+
<div style="text-align: center; font-size: 13px; color: #95a5a6; margin-top: 40px; border-top: 1px solid #ecf0f1; padding-top: 20px;">
|
22
|
+
<p>Este email foi enviado automaticamente. Por favor, não responda.</p>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</body>`;
|
26
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export const SUBJECT_RECOVERY = 'Recuperação de Senha';
|