@nauth-toolkit/core 0.1.32 → 0.1.33
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/dto/admin-signup-social.dto.d.ts +257 -0
- package/dist/dto/admin-signup-social.dto.d.ts.map +1 -0
- package/dist/dto/admin-signup-social.dto.js +389 -0
- package/dist/dto/admin-signup-social.dto.js.map +1 -0
- package/dist/dto/delete-user.dto.d.ts +71 -0
- package/dist/dto/delete-user.dto.d.ts.map +1 -0
- package/dist/dto/delete-user.dto.js +82 -0
- package/dist/dto/delete-user.dto.js.map +1 -0
- package/dist/dto/disable-user.dto.d.ts +61 -0
- package/dist/dto/disable-user.dto.d.ts.map +1 -0
- package/dist/dto/disable-user.dto.js +86 -0
- package/dist/dto/disable-user.dto.js.map +1 -0
- package/dist/dto/enable-user.dto.d.ts +44 -0
- package/dist/dto/enable-user.dto.d.ts.map +1 -0
- package/dist/dto/enable-user.dto.js +63 -0
- package/dist/dto/enable-user.dto.js.map +1 -0
- package/dist/dto/get-users.dto.d.ts +154 -0
- package/dist/dto/get-users.dto.d.ts.map +1 -0
- package/dist/dto/get-users.dto.js +250 -0
- package/dist/dto/get-users.dto.js.map +1 -0
- package/dist/dto/index.d.ts +5 -0
- package/dist/dto/index.d.ts.map +1 -1
- package/dist/dto/index.js +5 -0
- package/dist/dto/index.js.map +1 -1
- package/dist/dto/user-response.dto.d.ts +5 -0
- package/dist/dto/user-response.dto.d.ts.map +1 -1
- package/dist/dto/user-response.dto.js +6 -0
- package/dist/dto/user-response.dto.js.map +1 -1
- package/dist/dto/verify-email.dto.d.ts +10 -0
- package/dist/dto/verify-email.dto.d.ts.map +1 -1
- package/dist/dto/verify-email.dto.js +16 -0
- package/dist/dto/verify-email.dto.js.map +1 -1
- package/dist/entities/user.entity.d.ts +18 -2
- package/dist/entities/user.entity.d.ts.map +1 -1
- package/dist/entities/user.entity.js +18 -2
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/enums/auth-audit-event-type.enum.d.ts +5 -0
- package/dist/enums/auth-audit-event-type.enum.d.ts.map +1 -1
- package/dist/enums/auth-audit-event-type.enum.js +5 -0
- package/dist/enums/auth-audit-event-type.enum.js.map +1 -1
- package/dist/enums/error-codes.enum.d.ts +13 -0
- package/dist/enums/error-codes.enum.d.ts.map +1 -1
- package/dist/enums/error-codes.enum.js +13 -0
- package/dist/enums/error-codes.enum.js.map +1 -1
- package/dist/services/auth.service.d.ts +172 -2
- package/dist/services/auth.service.d.ts.map +1 -1
- package/dist/services/auth.service.js +862 -2
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/email-verification.service.d.ts.map +1 -1
- package/dist/services/email-verification.service.js +7 -7
- package/dist/services/email-verification.service.js.map +1 -1
- package/dist/services/social-auth-base.service.d.ts +5 -1
- package/dist/services/social-auth-base.service.d.ts.map +1 -1
- package/dist/services/social-auth-base.service.js +62 -2
- package/dist/services/social-auth-base.service.js.map +1 -1
- package/dist/services/social-auth.service.d.ts +2 -1
- package/dist/services/social-auth.service.d.ts.map +1 -1
- package/dist/services/social-auth.service.js +5 -1
- package/dist/services/social-auth.service.js.map +1 -1
- package/dist/utils/setup/init-services.d.ts.map +1 -1
- package/dist/utils/setup/init-services.js +2 -1
- package/dist/utils/setup/init-services.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DTO for administrative user deletion
|
|
3
|
+
*
|
|
4
|
+
* Permanently deletes user and ALL associated data:
|
|
5
|
+
* - Sessions, verification tokens, MFA devices, trusted devices
|
|
6
|
+
* - Social accounts, login attempts, challenge sessions, audit logs
|
|
7
|
+
*
|
|
8
|
+
* Warning: IRREVERSIBLE - All user data permanently removed from database.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const result = await authService.deleteUser({
|
|
13
|
+
* sub: 'user-uuid-123'
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare class DeleteUserDTO {
|
|
18
|
+
/**
|
|
19
|
+
* User UUID (sub) to delete
|
|
20
|
+
*
|
|
21
|
+
* Must be valid UUID format
|
|
22
|
+
*/
|
|
23
|
+
sub: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Response DTO for administrative user deletion
|
|
27
|
+
*
|
|
28
|
+
* Confirms deletion and provides counts of cascade-deleted records.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* {
|
|
33
|
+
* success: true,
|
|
34
|
+
* deletedUserId: 'user-uuid-123',
|
|
35
|
+
* deletedRecords: {
|
|
36
|
+
* sessions: 5,
|
|
37
|
+
* verificationTokens: 2,
|
|
38
|
+
* mfaDevices: 1,
|
|
39
|
+
* trustedDevices: 3,
|
|
40
|
+
* socialAccounts: 2,
|
|
41
|
+
* loginAttempts: 10,
|
|
42
|
+
* challengeSessions: 1,
|
|
43
|
+
* auditLogs: 50
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare class DeleteUserResponseDTO {
|
|
49
|
+
/**
|
|
50
|
+
* Deletion success flag
|
|
51
|
+
*/
|
|
52
|
+
success: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Deleted user's UUID
|
|
55
|
+
*/
|
|
56
|
+
deletedUserId: string;
|
|
57
|
+
/**
|
|
58
|
+
* Count of cascade-deleted records by table
|
|
59
|
+
*/
|
|
60
|
+
deletedRecords: {
|
|
61
|
+
sessions: number;
|
|
62
|
+
verificationTokens: number;
|
|
63
|
+
mfaDevices: number;
|
|
64
|
+
trustedDevices: number;
|
|
65
|
+
socialAccounts: number;
|
|
66
|
+
loginAttempts: number;
|
|
67
|
+
challengeSessions: number;
|
|
68
|
+
auditLogs: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=delete-user.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-user.dto.d.ts","sourceRoot":"","sources":["../../src/dto/delete-user.dto.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAa;IACxB;;;;OAIG;IAGH,GAAG,EAAG,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,qBAAqB;IAChC;;OAEG;IACH,OAAO,EAAG,OAAO,CAAC;IAElB;;OAEG;IACH,aAAa,EAAG,MAAM,CAAC;IAEvB;;OAEG;IACH,cAAc,EAAG;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH"}
|
|
@@ -0,0 +1,82 @@
|
|
|
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.DeleteUserResponseDTO = exports.DeleteUserDTO = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/**
|
|
15
|
+
* DTO for administrative user deletion
|
|
16
|
+
*
|
|
17
|
+
* Permanently deletes user and ALL associated data:
|
|
18
|
+
* - Sessions, verification tokens, MFA devices, trusted devices
|
|
19
|
+
* - Social accounts, login attempts, challenge sessions, audit logs
|
|
20
|
+
*
|
|
21
|
+
* Warning: IRREVERSIBLE - All user data permanently removed from database.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const result = await authService.deleteUser({
|
|
26
|
+
* sub: 'user-uuid-123'
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
class DeleteUserDTO {
|
|
31
|
+
/**
|
|
32
|
+
* User UUID (sub) to delete
|
|
33
|
+
*
|
|
34
|
+
* Must be valid UUID format
|
|
35
|
+
*/
|
|
36
|
+
sub;
|
|
37
|
+
}
|
|
38
|
+
exports.DeleteUserDTO = DeleteUserDTO;
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
(0, class_validator_1.IsUUID)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], DeleteUserDTO.prototype, "sub", void 0);
|
|
44
|
+
/**
|
|
45
|
+
* Response DTO for administrative user deletion
|
|
46
|
+
*
|
|
47
|
+
* Confirms deletion and provides counts of cascade-deleted records.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* {
|
|
52
|
+
* success: true,
|
|
53
|
+
* deletedUserId: 'user-uuid-123',
|
|
54
|
+
* deletedRecords: {
|
|
55
|
+
* sessions: 5,
|
|
56
|
+
* verificationTokens: 2,
|
|
57
|
+
* mfaDevices: 1,
|
|
58
|
+
* trustedDevices: 3,
|
|
59
|
+
* socialAccounts: 2,
|
|
60
|
+
* loginAttempts: 10,
|
|
61
|
+
* challengeSessions: 1,
|
|
62
|
+
* auditLogs: 50
|
|
63
|
+
* }
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
class DeleteUserResponseDTO {
|
|
68
|
+
/**
|
|
69
|
+
* Deletion success flag
|
|
70
|
+
*/
|
|
71
|
+
success;
|
|
72
|
+
/**
|
|
73
|
+
* Deleted user's UUID
|
|
74
|
+
*/
|
|
75
|
+
deletedUserId;
|
|
76
|
+
/**
|
|
77
|
+
* Count of cascade-deleted records by table
|
|
78
|
+
*/
|
|
79
|
+
deletedRecords;
|
|
80
|
+
}
|
|
81
|
+
exports.DeleteUserResponseDTO = DeleteUserResponseDTO;
|
|
82
|
+
//# sourceMappingURL=delete-user.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-user.dto.js","sourceRoot":"","sources":["../../src/dto/delete-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmD;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,MAAa,aAAa;IACxB;;;;OAIG;IAGH,GAAG,CAAU;CACd;AATD,sCASC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAM,GAAE;;0CACI;AAGf;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAa,qBAAqB;IAChC;;OAEG;IACH,OAAO,CAAW;IAElB;;OAEG;IACH,aAAa,CAAU;IAEvB;;OAEG;IACH,cAAc,CASZ;CACH;AAxBD,sDAwBC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { UserResponseDto } from './user-response.dto';
|
|
2
|
+
/**
|
|
3
|
+
* DTO for administrative permanent account locking
|
|
4
|
+
*
|
|
5
|
+
* Locks user account permanently (lockedUntil=NULL) and revokes all active sessions.
|
|
6
|
+
* Uses existing rate-limit lock fields (isLocked, lockReason, lockedAt, lockedUntil).
|
|
7
|
+
*
|
|
8
|
+
* Permanent vs Temporary locks:
|
|
9
|
+
* - Rate limiting: lockedUntil = future date (temporary auto-unlock)
|
|
10
|
+
* - Admin disableUser: lockedUntil = NULL (permanent manual lock)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const result = await authService.disableUser({
|
|
15
|
+
* sub: 'user-uuid-123',
|
|
16
|
+
* reason: 'Suspicious activity detected'
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class DisableUserDTO {
|
|
21
|
+
/**
|
|
22
|
+
* User UUID (sub) to disable
|
|
23
|
+
*
|
|
24
|
+
* Must be valid UUID format
|
|
25
|
+
*/
|
|
26
|
+
sub: string;
|
|
27
|
+
/**
|
|
28
|
+
* Optional reason for locking account
|
|
29
|
+
*
|
|
30
|
+
* Recorded in lockReason field and audit trail.
|
|
31
|
+
* Max 500 characters.
|
|
32
|
+
*/
|
|
33
|
+
reason?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Response DTO for administrative account locking
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* {
|
|
41
|
+
* success: true,
|
|
42
|
+
* user: { sub: '...', email: '...', isLocked: true, ... },
|
|
43
|
+
* revokedSessions: 3
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare class DisableUserResponseDTO {
|
|
48
|
+
/**
|
|
49
|
+
* Lock success flag
|
|
50
|
+
*/
|
|
51
|
+
success: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Sanitized user object with updated lock status
|
|
54
|
+
*/
|
|
55
|
+
user: UserResponseDto;
|
|
56
|
+
/**
|
|
57
|
+
* Number of sessions revoked (forced logout)
|
|
58
|
+
*/
|
|
59
|
+
revokedSessions: number;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=disable-user.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disable-user.dto.d.ts","sourceRoot":"","sources":["../../src/dto/disable-user.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,cAAc;IACzB;;;;OAIG;IAGH,GAAG,EAAG,MAAM,CAAC;IAEb;;;;;OAKG;IAIH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,sBAAsB;IACjC;;OAEG;IACH,OAAO,EAAG,OAAO,CAAC;IAElB;;OAEG;IACH,IAAI,EAAG,eAAe,CAAC;IAEvB;;OAEG;IACH,eAAe,EAAG,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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.DisableUserResponseDTO = exports.DisableUserDTO = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/**
|
|
15
|
+
* DTO for administrative permanent account locking
|
|
16
|
+
*
|
|
17
|
+
* Locks user account permanently (lockedUntil=NULL) and revokes all active sessions.
|
|
18
|
+
* Uses existing rate-limit lock fields (isLocked, lockReason, lockedAt, lockedUntil).
|
|
19
|
+
*
|
|
20
|
+
* Permanent vs Temporary locks:
|
|
21
|
+
* - Rate limiting: lockedUntil = future date (temporary auto-unlock)
|
|
22
|
+
* - Admin disableUser: lockedUntil = NULL (permanent manual lock)
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const result = await authService.disableUser({
|
|
27
|
+
* sub: 'user-uuid-123',
|
|
28
|
+
* reason: 'Suspicious activity detected'
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
class DisableUserDTO {
|
|
33
|
+
/**
|
|
34
|
+
* User UUID (sub) to disable
|
|
35
|
+
*
|
|
36
|
+
* Must be valid UUID format
|
|
37
|
+
*/
|
|
38
|
+
sub;
|
|
39
|
+
/**
|
|
40
|
+
* Optional reason for locking account
|
|
41
|
+
*
|
|
42
|
+
* Recorded in lockReason field and audit trail.
|
|
43
|
+
* Max 500 characters.
|
|
44
|
+
*/
|
|
45
|
+
reason;
|
|
46
|
+
}
|
|
47
|
+
exports.DisableUserDTO = DisableUserDTO;
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsString)(),
|
|
50
|
+
(0, class_validator_1.IsUUID)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], DisableUserDTO.prototype, "sub", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_validator_1.IsOptional)(),
|
|
55
|
+
(0, class_validator_1.IsString)(),
|
|
56
|
+
(0, class_validator_1.MaxLength)(500),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], DisableUserDTO.prototype, "reason", void 0);
|
|
59
|
+
/**
|
|
60
|
+
* Response DTO for administrative account locking
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* {
|
|
65
|
+
* success: true,
|
|
66
|
+
* user: { sub: '...', email: '...', isLocked: true, ... },
|
|
67
|
+
* revokedSessions: 3
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
class DisableUserResponseDTO {
|
|
72
|
+
/**
|
|
73
|
+
* Lock success flag
|
|
74
|
+
*/
|
|
75
|
+
success;
|
|
76
|
+
/**
|
|
77
|
+
* Sanitized user object with updated lock status
|
|
78
|
+
*/
|
|
79
|
+
user;
|
|
80
|
+
/**
|
|
81
|
+
* Number of sessions revoked (forced logout)
|
|
82
|
+
*/
|
|
83
|
+
revokedSessions;
|
|
84
|
+
}
|
|
85
|
+
exports.DisableUserResponseDTO = DisableUserResponseDTO;
|
|
86
|
+
//# sourceMappingURL=disable-user.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disable-user.dto.js","sourceRoot":"","sources":["../../src/dto/disable-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0E;AAG1E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,cAAc;IACzB;;;;OAIG;IAGH,GAAG,CAAU;IAEb;;;;;OAKG;IAIH,MAAM,CAAU;CACjB;AApBD,wCAoBC;AAZC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAM,GAAE;;2CACI;AAWb;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;;8CACC;AAGlB;;;;;;;;;;;GAWG;AACH,MAAa,sBAAsB;IACjC;;OAEG;IACH,OAAO,CAAW;IAElB;;OAEG;IACH,IAAI,CAAmB;IAEvB;;OAEG;IACH,eAAe,CAAU;CAC1B;AAfD,wDAeC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { UserResponseDto } from './user-response.dto';
|
|
2
|
+
/**
|
|
3
|
+
* DTO for administrative account unlocking
|
|
4
|
+
*
|
|
5
|
+
* Unlocks a previously locked user account by clearing lock fields.
|
|
6
|
+
* This reverses the effect of disableUser() or rate-limit lockouts.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const result = await authService.enableUser({
|
|
11
|
+
* sub: 'user-uuid-123'
|
|
12
|
+
* });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class EnableUserDTO {
|
|
16
|
+
/**
|
|
17
|
+
* User UUID (sub) to enable
|
|
18
|
+
*
|
|
19
|
+
* Must be valid UUID format
|
|
20
|
+
*/
|
|
21
|
+
sub: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Response DTO for administrative account unlocking
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* {
|
|
29
|
+
* success: true,
|
|
30
|
+
* user: { sub: '...', email: '...', isLocked: false, ... }
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class EnableUserResponseDTO {
|
|
35
|
+
/**
|
|
36
|
+
* Unlock success flag
|
|
37
|
+
*/
|
|
38
|
+
success: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Sanitized user object with updated lock status
|
|
41
|
+
*/
|
|
42
|
+
user: UserResponseDto;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=enable-user.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable-user.dto.d.ts","sourceRoot":"","sources":["../../src/dto/enable-user.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAa;IACxB;;;;OAIG;IAGH,GAAG,EAAG,MAAM,CAAC;CACd;AAED;;;;;;;;;;GAUG;AACH,qBAAa,qBAAqB;IAChC;;OAEG;IACH,OAAO,EAAG,OAAO,CAAC;IAElB;;OAEG;IACH,IAAI,EAAG,eAAe,CAAC;CACxB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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.EnableUserResponseDTO = exports.EnableUserDTO = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/**
|
|
15
|
+
* DTO for administrative account unlocking
|
|
16
|
+
*
|
|
17
|
+
* Unlocks a previously locked user account by clearing lock fields.
|
|
18
|
+
* This reverses the effect of disableUser() or rate-limit lockouts.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const result = await authService.enableUser({
|
|
23
|
+
* sub: 'user-uuid-123'
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
class EnableUserDTO {
|
|
28
|
+
/**
|
|
29
|
+
* User UUID (sub) to enable
|
|
30
|
+
*
|
|
31
|
+
* Must be valid UUID format
|
|
32
|
+
*/
|
|
33
|
+
sub;
|
|
34
|
+
}
|
|
35
|
+
exports.EnableUserDTO = EnableUserDTO;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
(0, class_validator_1.IsUUID)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], EnableUserDTO.prototype, "sub", void 0);
|
|
41
|
+
/**
|
|
42
|
+
* Response DTO for administrative account unlocking
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* {
|
|
47
|
+
* success: true,
|
|
48
|
+
* user: { sub: '...', email: '...', isLocked: false, ... }
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
class EnableUserResponseDTO {
|
|
53
|
+
/**
|
|
54
|
+
* Unlock success flag
|
|
55
|
+
*/
|
|
56
|
+
success;
|
|
57
|
+
/**
|
|
58
|
+
* Sanitized user object with updated lock status
|
|
59
|
+
*/
|
|
60
|
+
user;
|
|
61
|
+
}
|
|
62
|
+
exports.EnableUserResponseDTO = EnableUserResponseDTO;
|
|
63
|
+
//# sourceMappingURL=enable-user.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable-user.dto.js","sourceRoot":"","sources":["../../src/dto/enable-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmD;AAGnD;;;;;;;;;;;;GAYG;AACH,MAAa,aAAa;IACxB;;;;OAIG;IAGH,GAAG,CAAU;CACd;AATD,sCASC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAM,GAAE;;0CACI;AAGf;;;;;;;;;;GAUG;AACH,MAAa,qBAAqB;IAChC;;OAEG;IACH,OAAO,CAAW;IAElB;;OAEG;IACH,IAAI,CAAmB;CACxB;AAVD,sDAUC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { UserResponseDto } from './user-response.dto';
|
|
2
|
+
/**
|
|
3
|
+
* Date filter with operator support
|
|
4
|
+
*
|
|
5
|
+
* Supports gt (greater than), gte (greater than or equal), lt (less than),
|
|
6
|
+
* lte (less than or equal), eq (equal) operators for date comparisons.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* {
|
|
11
|
+
* operator: 'gte',
|
|
12
|
+
* value: new Date('2024-01-01')
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class DateFilterDTO {
|
|
17
|
+
/**
|
|
18
|
+
* Comparison operator
|
|
19
|
+
*
|
|
20
|
+
* - gt: greater than
|
|
21
|
+
* - gte: greater than or equal
|
|
22
|
+
* - lt: less than
|
|
23
|
+
* - lte: less than or equal
|
|
24
|
+
* - eq: equal
|
|
25
|
+
*/
|
|
26
|
+
operator: 'gt' | 'gte' | 'lt' | 'lte' | 'eq';
|
|
27
|
+
/**
|
|
28
|
+
* Date value to compare against
|
|
29
|
+
*/
|
|
30
|
+
value: Date;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* DTO for paginated user listing with advanced filtering
|
|
34
|
+
*
|
|
35
|
+
* Supports pagination, boolean filters, exact match filters,
|
|
36
|
+
* date filters with operators, and flexible sorting.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const result = await authService.getUsers({
|
|
41
|
+
* page: 1,
|
|
42
|
+
* limit: 20,
|
|
43
|
+
* isEmailVerified: true,
|
|
44
|
+
* hasSocialAuth: true,
|
|
45
|
+
* createdAt: { operator: 'gte', value: new Date('2024-01-01') },
|
|
46
|
+
* sortBy: 'email',
|
|
47
|
+
* sortOrder: 'ASC'
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare class GetUsersDTO {
|
|
52
|
+
/**
|
|
53
|
+
* Page number (1-indexed)
|
|
54
|
+
*
|
|
55
|
+
* Default: 1
|
|
56
|
+
*/
|
|
57
|
+
page?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Number of records per page
|
|
60
|
+
*
|
|
61
|
+
* Default: 10, Max: 100
|
|
62
|
+
*/
|
|
63
|
+
limit?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Filter by email address (partial match)
|
|
66
|
+
*
|
|
67
|
+
* Supports partial matching using LIKE query.
|
|
68
|
+
* Example: "john" will match "john@example.com", "johnny@test.com", etc.
|
|
69
|
+
*/
|
|
70
|
+
email?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Filter by phone number (partial match)
|
|
73
|
+
*
|
|
74
|
+
* Supports partial matching using LIKE query.
|
|
75
|
+
* Example: "+1" will match "+14155552671", "+12025551234", etc.
|
|
76
|
+
*/
|
|
77
|
+
phone?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Filter by email verification status
|
|
80
|
+
*/
|
|
81
|
+
isEmailVerified?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Filter by phone verification status
|
|
84
|
+
*/
|
|
85
|
+
isPhoneVerified?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Filter by social auth presence
|
|
88
|
+
*/
|
|
89
|
+
hasSocialAuth?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Filter by account lock status
|
|
92
|
+
*/
|
|
93
|
+
isLocked?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Filter by MFA enabled status
|
|
96
|
+
*/
|
|
97
|
+
mfaEnabled?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Filter by account creation date
|
|
100
|
+
*
|
|
101
|
+
* Supports operators: gt, gte, lt, lte, eq
|
|
102
|
+
*/
|
|
103
|
+
createdAt?: DateFilterDTO;
|
|
104
|
+
/**
|
|
105
|
+
* Filter by last update date
|
|
106
|
+
*
|
|
107
|
+
* Supports operators: gt, gte, lt, lte, eq
|
|
108
|
+
*/
|
|
109
|
+
updatedAt?: DateFilterDTO;
|
|
110
|
+
/**
|
|
111
|
+
* Field to sort by
|
|
112
|
+
*
|
|
113
|
+
* Default: createdAt
|
|
114
|
+
*/
|
|
115
|
+
sortBy?: 'email' | 'createdAt' | 'updatedAt' | 'username' | 'phone';
|
|
116
|
+
/**
|
|
117
|
+
* Sort order
|
|
118
|
+
*
|
|
119
|
+
* Default: DESC
|
|
120
|
+
*/
|
|
121
|
+
sortOrder?: 'ASC' | 'DESC';
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Response DTO for paginated user listing
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* {
|
|
129
|
+
* users: [{ sub: '...', email: '...', ... }],
|
|
130
|
+
* pagination: {
|
|
131
|
+
* page: 1,
|
|
132
|
+
* limit: 20,
|
|
133
|
+
* total: 150,
|
|
134
|
+
* totalPages: 8
|
|
135
|
+
* }
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export declare class GetUsersResponseDTO {
|
|
140
|
+
/**
|
|
141
|
+
* Array of sanitized user objects
|
|
142
|
+
*/
|
|
143
|
+
users: UserResponseDto[];
|
|
144
|
+
/**
|
|
145
|
+
* Pagination metadata
|
|
146
|
+
*/
|
|
147
|
+
pagination: {
|
|
148
|
+
page: number;
|
|
149
|
+
limit: number;
|
|
150
|
+
total: number;
|
|
151
|
+
totalPages: number;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=get-users.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-users.dto.d.ts","sourceRoot":"","sources":["../../src/dto/get-users.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AACH,qBAAa,aAAa;IACxB;;;;;;;;OAQG;IAEH,QAAQ,EAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC;IAE9C;;OAEG;IAEH,KAAK,EAAG,IAAI,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,WAAW;IACtB;;;;OAIG;IAKH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IAMH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IAGH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IAGH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IAIH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IAIH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IAIH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IAIH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IAIH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IAIH,SAAS,CAAC,EAAE,aAAa,CAAC;IAE1B;;;;OAIG;IAIH,SAAS,CAAC,EAAE,aAAa,CAAC;IAE1B;;;;OAIG;IAGH,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;IAEpE;;;;OAIG;IAGH,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,mBAAmB;IAC9B;;OAEG;IACH,KAAK,EAAG,eAAe,EAAE,CAAC;IAE1B;;OAEG;IACH,UAAU,EAAG;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
|