@nauth-toolkit/core 0.1.109 → 0.1.111

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.
Files changed (42) hide show
  1. package/dist/dto/get-user-devices.dto.d.ts +5 -3
  2. package/dist/dto/get-user-devices.dto.d.ts.map +1 -1
  3. package/dist/dto/get-user-devices.dto.js +3 -1
  4. package/dist/dto/get-user-devices.dto.js.map +1 -1
  5. package/dist/dto/index.d.ts +2 -0
  6. package/dist/dto/index.d.ts.map +1 -1
  7. package/dist/dto/index.js +2 -0
  8. package/dist/dto/index.js.map +1 -1
  9. package/dist/dto/mfa-device-response.dto.d.ts +68 -0
  10. package/dist/dto/mfa-device-response.dto.d.ts.map +1 -0
  11. package/dist/dto/mfa-device-response.dto.js +81 -0
  12. package/dist/dto/mfa-device-response.dto.js.map +1 -0
  13. package/dist/dto/set-preferred-device.dto.d.ts +2 -1
  14. package/dist/dto/set-preferred-device.dto.d.ts.map +1 -1
  15. package/dist/dto/set-preferred-device.dto.js +2 -1
  16. package/dist/dto/set-preferred-device.dto.js.map +1 -1
  17. package/dist/dto/verify-mfa-setup-response.dto.d.ts +18 -0
  18. package/dist/dto/verify-mfa-setup-response.dto.d.ts.map +1 -0
  19. package/dist/dto/verify-mfa-setup-response.dto.js +22 -0
  20. package/dist/dto/verify-mfa-setup-response.dto.js.map +1 -0
  21. package/dist/openapi/components.schemas.json +35 -83
  22. package/dist/services/admin-auth.service.d.ts +7 -0
  23. package/dist/services/admin-auth.service.d.ts.map +1 -1
  24. package/dist/services/admin-auth.service.js +44 -0
  25. package/dist/services/admin-auth.service.js.map +1 -1
  26. package/dist/services/auth.service.d.ts +7 -0
  27. package/dist/services/auth.service.d.ts.map +1 -1
  28. package/dist/services/auth.service.js +36 -0
  29. package/dist/services/auth.service.js.map +1 -1
  30. package/dist/services/challenge.service.d.ts.map +1 -1
  31. package/dist/services/challenge.service.js +1 -3
  32. package/dist/services/challenge.service.js.map +1 -1
  33. package/dist/services/email-verification.service.d.ts.map +1 -1
  34. package/dist/services/email-verification.service.js +3 -9
  35. package/dist/services/email-verification.service.js.map +1 -1
  36. package/dist/services/mfa.service.d.ts.map +1 -1
  37. package/dist/services/mfa.service.js +2 -1
  38. package/dist/services/mfa.service.js.map +1 -1
  39. package/dist/services/phone-verification.service.d.ts.map +1 -1
  40. package/dist/services/phone-verification.service.js +3 -8
  41. package/dist/services/phone-verification.service.js.map +1 -1
  42. package/package.json +2 -2
@@ -9,7 +9,7 @@
9
9
  * const devices = await mfaService.getUserDevices({});
10
10
  * ```
11
11
  */
12
- import { IMFADevice } from '../interfaces/entities.interface';
12
+ import { MFADeviceResponseDTO } from './mfa-device-response.dto';
13
13
  /**
14
14
  * DTO for getting user MFA devices
15
15
  *
@@ -19,11 +19,13 @@ export declare class GetUserDevicesDTO {
19
19
  }
20
20
  /**
21
21
  * Response DTO for user MFA devices
22
+ *
23
+ * Uses outward-facing device DTOs with `isPreferred` instead of internal `isPrimary`
22
24
  */
23
25
  export declare class GetUserDevicesResponseDTO {
24
26
  /**
25
- * Array of user's MFA devices
27
+ * Array of user's MFA devices (outward-facing format)
26
28
  */
27
- devices: IMFADevice[];
29
+ devices: MFADeviceResponseDTO[];
28
30
  }
29
31
  //# sourceMappingURL=get-user-devices.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-user-devices.dto.d.ts","sourceRoot":"","sources":["../../src/dto/get-user-devices.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D;;;;GAIG;AACH,qBAAa,iBAAiB;CAE7B;AAED;;GAEG;AACH,qBAAa,yBAAyB;IACpC;;OAEG;IACH,OAAO,EAAG,UAAU,EAAE,CAAC;CACxB"}
1
+ {"version":3,"file":"get-user-devices.dto.d.ts","sourceRoot":"","sources":["../../src/dto/get-user-devices.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;GAIG;AACH,qBAAa,iBAAiB;CAE7B;AAED;;;;GAIG;AACH,qBAAa,yBAAyB;IACpC;;OAEG;IACH,OAAO,EAAG,oBAAoB,EAAE,CAAC;CAClC"}
@@ -22,10 +22,12 @@ class GetUserDevicesDTO {
22
22
  exports.GetUserDevicesDTO = GetUserDevicesDTO;
23
23
  /**
24
24
  * Response DTO for user MFA devices
25
+ *
26
+ * Uses outward-facing device DTOs with `isPreferred` instead of internal `isPrimary`
25
27
  */
26
28
  class GetUserDevicesResponseDTO {
27
29
  /**
28
- * Array of user's MFA devices
30
+ * Array of user's MFA devices (outward-facing format)
29
31
  */
30
32
  devices;
31
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-user-devices.dto.js","sourceRoot":"","sources":["../../src/dto/get-user-devices.dto.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH;;;;GAIG;AACH,MAAa,iBAAiB;CAE7B;AAFD,8CAEC;AAED;;GAEG;AACH,MAAa,yBAAyB;IACpC;;OAEG;IACH,OAAO,CAAgB;CACxB;AALD,8DAKC"}
1
+ {"version":3,"file":"get-user-devices.dto.js","sourceRoot":"","sources":["../../src/dto/get-user-devices.dto.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAIH;;;;GAIG;AACH,MAAa,iBAAiB;CAE7B;AAFD,8CAEC;AAED;;;;GAIG;AACH,MAAa,yBAAyB;IACpC;;OAEG;IACH,OAAO,CAA0B;CAClC;AALD,8DAKC"}
@@ -32,6 +32,7 @@ export * from './get-available-methods.dto';
32
32
  export * from './get-mfa-status.dto';
33
33
  export * from './admin-get-mfa-status.dto';
34
34
  export * from './get-user-devices.dto';
35
+ export * from './mfa-device-response.dto';
35
36
  export * from './has-provider.dto';
36
37
  export * from './list-providers-response.dto';
37
38
  export * from './remove-device.dto';
@@ -60,6 +61,7 @@ export * from './get-user-sessions.dto';
60
61
  export * from './get-user-sessions-response.dto';
61
62
  export * from './logout-session.dto';
62
63
  export * from './logout-session-response.dto';
64
+ export * from './verify-mfa-setup-response.dto';
63
65
  export * from './admin-revoke-session.dto';
64
66
  export * from './set-must-change-password.dto';
65
67
  export * from './set-must-change-password-response.dto';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,c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BAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAElD,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
package/dist/dto/index.js CHANGED
@@ -49,6 +49,7 @@ __exportStar(require("./get-available-methods.dto"), exports);
49
49
  __exportStar(require("./get-mfa-status.dto"), exports);
50
50
  __exportStar(require("./admin-get-mfa-status.dto"), exports);
51
51
  __exportStar(require("./get-user-devices.dto"), exports);
52
+ __exportStar(require("./mfa-device-response.dto"), exports);
52
53
  __exportStar(require("./has-provider.dto"), exports);
53
54
  __exportStar(require("./list-providers-response.dto"), exports);
54
55
  __exportStar(require("./remove-device.dto"), exports);
@@ -77,6 +78,7 @@ __exportStar(require("./get-user-sessions.dto"), exports);
77
78
  __exportStar(require("./get-user-sessions-response.dto"), exports);
78
79
  __exportStar(require("./logout-session.dto"), exports);
79
80
  __exportStar(require("./logout-session-response.dto"), exports);
81
+ __exportStar(require("./verify-mfa-setup-response.dto"), exports);
80
82
  __exportStar(require("./admin-revoke-session.dto"), exports);
81
83
  __exportStar(require("./set-must-change-password.dto"), exports);
82
84
  __exportStar(require("./set-must-change-password-response.dto"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iBAAiB;AACjB,+CAA6B;AAC7B,qDAAmC;AACnC,4DAA0C;AAC1C,oDAAkC;AAClC,kDAAgC;AAChC,qDAAmC;AACnC,oDAAkC;AAClC,8CAA4B;AAC5B,wDAAsC;AACtC,iEAA+C;AAC/C,sDAAoC;AACpC,oDAAkC;AAClC,+DAA6C;AAC7C,qEAAmD;AACnD,uEAAqD;AACrD,qDAAmC;AACnC,qDAAmC;AACnC,4DAA0C;AAC1C,uDAAqC;AACrC,wDAAsC;AACtC,gEAA8C;AAC9C,sDAAoC;AACpC,sDAAoC;AACpC,uDAAqC;AACrC,2DAAyC;AACzC,0DAAwC;AACxC,uDAAqC;AACrC,gEAA8C;AAC9C,2DAAyC;AACzC,oEAAkD;AAClD,8DAA4C;AAC5C,uDAAqC;AACrC,6DAA2C;AAC3C,yDAAuC;AACvC,qDAAmC;AACnC,gEAA8C;AAC9C,sDAAoC;AACpC,4DAA0C;AAC1C,0DAAwC;AACxC,6DAA2C;AAC3C,mEAAiD;AACjD,kDAAgC;AAChC,wDAAsC;AACtC,wDAAsC;AACtC,gEAA8C;AAC9C,gEAA8C;AAC9C,kEAAgD;AAChD,gEAA8C;AAC9C,oDAAkC;AAClC,6DAA2C;AAC3C,0DAAwC;AACxC,uDAAqC;AACrC,0DAAwC;AACxC,+CAA6B;AAC7B,wDAAsC;AACtC,mDAAiC;AACjC,4DAA0C;AAC1C,yDAAuC;AACvC,0DAAwC;AACxC,mEAAiD;AACjD,uDAAqC;AACrC,gEAA8C;AAC9C,6DAA2C;AAC3C,iEAA+C;AAC/C,0EAAwD;AACxD,2DAAyC;AACzC,6DAA2C;AAC3C,+EAA+E;AAC/E,8DAA4C;AAC5C,mEAAiD;AACjD,8DAA4C;AAC5C,uEAAqD;AACrD,8DAA4C;AAC5C,oEAAkD;AAClD,oEAAkD;AAElD,oDAAkC;AAClC,wDAAsC;AAEtC,+DAA+D;AAC/D,+CAA+C;AAC/C,mCAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iBAAiB;AACjB,+CAA6B;AAC7B,qDAAmC;AACnC,4DAA0C;AAC1C,oDAAkC;AAClC,kDAAgC;AAChC,qDAAmC;AACnC,oDAAkC;AAClC,8CAA4B;AAC5B,wDAAsC;AACtC,iEAA+C;AAC/C,sDAAoC;AACpC,oDAAkC;AAClC,+DAA6C;AAC7C,qEAAmD;AACnD,uEAAqD;AACrD,qDAAmC;AACnC,qDAAmC;AACnC,4DAA0C;AAC1C,uDAAqC;AACrC,wDAAsC;AACtC,gEAA8C;AAC9C,sDAAoC;AACpC,sDAAoC;AACpC,uDAAqC;AACrC,2DAAyC;AACzC,0DAAwC;AACxC,uDAAqC;AACrC,gEAA8C;AAC9C,2DAAyC;AACzC,oEAAkD;AAClD,8DAA4C;AAC5C,uDAAqC;AACrC,6DAA2C;AAC3C,yDAAuC;AACvC,4DAA0C;AAC1C,qDAAmC;AACnC,gEAA8C;AAC9C,sDAAoC;AACpC,4DAA0C;AAC1C,0DAAwC;AACxC,6DAA2C;AAC3C,mEAAiD;AACjD,kDAAgC;AAChC,wDAAsC;AACtC,wDAAsC;AACtC,gEAA8C;AAC9C,gEAA8C;AAC9C,kEAAgD;AAChD,gEAA8C;AAC9C,oDAAkC;AAClC,6DAA2C;AAC3C,0DAAwC;AACxC,uDAAqC;AACrC,0DAAwC;AACxC,+CAA6B;AAC7B,wDAAsC;AACtC,mDAAiC;AACjC,4DAA0C;AAC1C,yDAAuC;AACvC,0DAAwC;AACxC,mEAAiD;AACjD,uDAAqC;AACrC,gEAA8C;AAC9C,kEAAgD;AAChD,6DAA2C;AAC3C,iEAA+C;AAC/C,0EAAwD;AACxD,2DAAyC;AACzC,6DAA2C;AAC3C,+EAA+E;AAC/E,8DAA4C;AAC5C,mEAAiD;AACjD,8DAA4C;AAC5C,uEAAqD;AACrD,8DAA4C;AAC5C,oEAAkD;AAClD,oEAAkD;AAElD,oDAAkC;AAClC,wDAAsC;AAEtC,+DAA+D;AAC/D,+CAA+C;AAC/C,mCAAmC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Outward-facing MFA Device Response DTO
3
+ *
4
+ * This DTO is used for all API responses that return device information.
5
+ * It maps internal `isPrimary` to external `isPreferred` to avoid exposing
6
+ * internal database field names.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const device: MFADeviceResponseDTO = {
11
+ * id: 1,
12
+ * type: 'totp',
13
+ * name: 'My Phone',
14
+ * isPreferred: true,
15
+ * isActive: true,
16
+ * createdAt: new Date()
17
+ * };
18
+ * ```
19
+ */
20
+ import { MFADeviceMethod } from '../enums/mfa-method.enum';
21
+ import { IMFADevice } from '../interfaces/entities.interface';
22
+ /**
23
+ * Outward-facing MFA device information
24
+ *
25
+ * Note: Uses `isPreferred` instead of internal `isPrimary` field
26
+ */
27
+ export declare class MFADeviceResponseDTO {
28
+ /**
29
+ * Unique device identifier
30
+ */
31
+ id: number;
32
+ /**
33
+ * MFA method type (totp, sms, email, passkey)
34
+ */
35
+ type: MFADeviceMethod;
36
+ /**
37
+ * Device name (user-assigned)
38
+ */
39
+ name: string;
40
+ /**
41
+ * Whether this is the preferred device for this method
42
+ * Maps from internal `isPrimary` field
43
+ */
44
+ isPreferred: boolean;
45
+ /**
46
+ * Whether device is currently active
47
+ */
48
+ isActive: boolean;
49
+ /**
50
+ * Device creation timestamp
51
+ */
52
+ createdAt: Date;
53
+ /**
54
+ * Convert internal device entity to outward-facing DTO
55
+ *
56
+ * @param device - Internal device entity
57
+ * @returns Outward-facing device DTO
58
+ */
59
+ static fromEntity(device: IMFADevice): MFADeviceResponseDTO;
60
+ /**
61
+ * Convert array of internal device entities to outward-facing DTOs
62
+ *
63
+ * @param devices - Array of internal device entities
64
+ * @returns Array of outward-facing device DTOs
65
+ */
66
+ static fromEntities(devices: IMFADevice[]): MFADeviceResponseDTO[];
67
+ }
68
+ //# sourceMappingURL=mfa-device-response.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-device-response.dto.d.ts","sourceRoot":"","sources":["../../src/dto/mfa-device-response.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D;;;;GAIG;AACH,qBAAa,oBAAoB;IAC/B;;OAEG;IACH,EAAE,EAAG,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAG,eAAe,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAG,MAAM,CAAC;IAEd;;;OAGG;IACH,WAAW,EAAG,OAAO,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAG,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAG,IAAI,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,oBAAoB;IAW3D;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE;CAGnE"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ /**
3
+ * Outward-facing MFA Device Response DTO
4
+ *
5
+ * This DTO is used for all API responses that return device information.
6
+ * It maps internal `isPrimary` to external `isPreferred` to avoid exposing
7
+ * internal database field names.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const device: MFADeviceResponseDTO = {
12
+ * id: 1,
13
+ * type: 'totp',
14
+ * name: 'My Phone',
15
+ * isPreferred: true,
16
+ * isActive: true,
17
+ * createdAt: new Date()
18
+ * };
19
+ * ```
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.MFADeviceResponseDTO = void 0;
23
+ /**
24
+ * Outward-facing MFA device information
25
+ *
26
+ * Note: Uses `isPreferred` instead of internal `isPrimary` field
27
+ */
28
+ class MFADeviceResponseDTO {
29
+ /**
30
+ * Unique device identifier
31
+ */
32
+ id;
33
+ /**
34
+ * MFA method type (totp, sms, email, passkey)
35
+ */
36
+ type;
37
+ /**
38
+ * Device name (user-assigned)
39
+ */
40
+ name;
41
+ /**
42
+ * Whether this is the preferred device for this method
43
+ * Maps from internal `isPrimary` field
44
+ */
45
+ isPreferred;
46
+ /**
47
+ * Whether device is currently active
48
+ */
49
+ isActive;
50
+ /**
51
+ * Device creation timestamp
52
+ */
53
+ createdAt;
54
+ /**
55
+ * Convert internal device entity to outward-facing DTO
56
+ *
57
+ * @param device - Internal device entity
58
+ * @returns Outward-facing device DTO
59
+ */
60
+ static fromEntity(device) {
61
+ const dto = new MFADeviceResponseDTO();
62
+ dto.id = device.id;
63
+ dto.type = device.type;
64
+ dto.name = device.name;
65
+ dto.isPreferred = device.isPrimary === true;
66
+ dto.isActive = device.isActive;
67
+ dto.createdAt = device.createdAt;
68
+ return dto;
69
+ }
70
+ /**
71
+ * Convert array of internal device entities to outward-facing DTOs
72
+ *
73
+ * @param devices - Array of internal device entities
74
+ * @returns Array of outward-facing device DTOs
75
+ */
76
+ static fromEntities(devices) {
77
+ return devices.map((device) => MFADeviceResponseDTO.fromEntity(device));
78
+ }
79
+ }
80
+ exports.MFADeviceResponseDTO = MFADeviceResponseDTO;
81
+ //# sourceMappingURL=mfa-device-response.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-device-response.dto.js","sourceRoot":"","sources":["../../src/dto/mfa-device-response.dto.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAKH;;;;GAIG;AACH,MAAa,oBAAoB;IAC/B;;OAEG;IACH,EAAE,CAAU;IAEZ;;OAEG;IACH,IAAI,CAAmB;IAEvB;;OAEG;IACH,IAAI,CAAU;IAEd;;;OAGG;IACH,WAAW,CAAW;IAEtB;;OAEG;IACH,QAAQ,CAAW;IAEnB;;OAEG;IACH,SAAS,CAAQ;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAkB;QAClC,MAAM,GAAG,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACvC,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACnB,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACvB,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACvB,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS,KAAK,IAAI,CAAC;QAC5C,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC/B,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QACjC,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,OAAqB;QACvC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,oBAAoB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF;AA1DD,oDA0DC"}
@@ -2,7 +2,8 @@
2
2
  * DTO for setting a user's preferred MFA device.
3
3
  *
4
4
  * This updates which device is used by default during MFA challenges.
5
- * The preferred device is marked with `isPrimary` in the database.
5
+ * The preferred device is marked with `isPrimary` in the database (internal field).
6
+ * API responses expose this as `isPreferred` (outward-facing field).
6
7
  *
7
8
  * @example
8
9
  * ```typescript
@@ -1 +1 @@
1
- {"version":3,"file":"set-preferred-device.dto.d.ts","sourceRoot":"","sources":["../../src/dto/set-preferred-device.dto.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,qBAAa,qBAAqB;IAChC;;;;;;;;;;OAUG;IAUH,QAAQ,EAAG,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,qBAAa,6BAA6B;IACxC;;;;OAIG;IACH,OAAO,EAAG,MAAM,CAAC;CAClB"}
1
+ {"version":3,"file":"set-preferred-device.dto.d.ts","sourceRoot":"","sources":["../../src/dto/set-preferred-device.dto.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAqB;IAChC;;;;;;;;;;OAUG;IAUH,QAAQ,EAAG,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,qBAAa,6BAA6B;IACxC;;;;OAIG;IACH,OAAO,EAAG,MAAM,CAAC;CAClB"}
@@ -16,7 +16,8 @@ const class_transformer_1 = require("class-transformer");
16
16
  * DTO for setting a user's preferred MFA device.
17
17
  *
18
18
  * This updates which device is used by default during MFA challenges.
19
- * The preferred device is marked with `isPrimary` in the database.
19
+ * The preferred device is marked with `isPrimary` in the database (internal field).
20
+ * API responses expose this as `isPreferred` (outward-facing field).
20
21
  *
21
22
  * @example
22
23
  * ```typescript
@@ -1 +1 @@
1
- {"version":3,"file":"set-preferred-device.dto.js","sourceRoot":"","sources":["../../src/dto/set-preferred-device.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoD;AACpD,yDAA8C;AAE9C;;;;;;;;;;;GAWG;AACH,MAAa,qBAAqB;IAChC;;;;;;;;;;OAUG;IAUH,QAAQ,CAAU;CACnB;AAtBD,sDAsBC;AADC;IATC,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACvB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;QAClD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IACD,IAAA,uBAAK,EAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC;IAClD,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;;uDACpC;AAGpB;;;;;;;;;GASG;AACH,MAAa,6BAA6B;IACxC;;;;OAIG;IACH,OAAO,CAAU;CAClB;AAPD,sEAOC"}
1
+ {"version":3,"file":"set-preferred-device.dto.js","sourceRoot":"","sources":["../../src/dto/set-preferred-device.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoD;AACpD,yDAA8C;AAE9C;;;;;;;;;;;;GAYG;AACH,MAAa,qBAAqB;IAChC;;;;;;;;;;OAUG;IAUH,QAAQ,CAAU;CACnB;AAtBD,sDAsBC;AADC;IATC,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACvB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;QAClD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IACD,IAAA,uBAAK,EAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC;IAClD,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;;uDACpC;AAGpB;;;;;;;;;GASG;AACH,MAAa,6BAA6B;IACxC;;;;OAIG;IACH,OAAO,CAAU;CAClB;AAPD,sEAOC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Response DTO for verifying MFA setup
3
+ *
4
+ * Returned when an authenticated user completes MFA device setup verification.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * const result = await provider.verifySetup(setupData);
9
+ * // Returns: { deviceId: 123 }
10
+ * ```
11
+ */
12
+ export declare class VerifyMFASetupResponseDTO {
13
+ /**
14
+ * ID of the newly created MFA device
15
+ */
16
+ deviceId: number;
17
+ }
18
+ //# sourceMappingURL=verify-mfa-setup-response.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-mfa-setup-response.dto.d.ts","sourceRoot":"","sources":["../../src/dto/verify-mfa-setup-response.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,qBAAa,yBAAyB;IACpC;;OAEG;IACH,QAAQ,EAAG,MAAM,CAAC;CACnB"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VerifyMFASetupResponseDTO = void 0;
4
+ /**
5
+ * Response DTO for verifying MFA setup
6
+ *
7
+ * Returned when an authenticated user completes MFA device setup verification.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const result = await provider.verifySetup(setupData);
12
+ * // Returns: { deviceId: 123 }
13
+ * ```
14
+ */
15
+ class VerifyMFASetupResponseDTO {
16
+ /**
17
+ * ID of the newly created MFA device
18
+ */
19
+ deviceId;
20
+ }
21
+ exports.VerifyMFASetupResponseDTO = VerifyMFASetupResponseDTO;
22
+ //# sourceMappingURL=verify-mfa-setup-response.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-mfa-setup-response.dto.js","sourceRoot":"","sources":["../../src/dto/verify-mfa-setup-response.dto.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,MAAa,yBAAyB;IACpC;;OAEG;IACH,QAAQ,CAAU;CACnB;AALD,8DAKC"}
@@ -2262,118 +2262,56 @@
2262
2262
  "devices": {
2263
2263
  "type": "array",
2264
2264
  "items": {
2265
- "$ref": "#/components/schemas/IMFADevice"
2265
+ "$ref": "#/components/schemas/MFADeviceResponseDTO"
2266
2266
  },
2267
- "description": "Array of user's MFA devices"
2267
+ "description": "Array of user's MFA devices (outward-facing format)"
2268
2268
  }
2269
2269
  },
2270
2270
  "required": [
2271
2271
  "devices"
2272
2272
  ],
2273
2273
  "additionalProperties": false,
2274
- "description": "Response DTO for user MFA devices"
2274
+ "description": "Response DTO for user MFA devices\n\nUses outward-facing device DTOs with `isPreferred` instead of internal `isPrimary`"
2275
2275
  },
2276
- "IMFADevice": {
2276
+ "MFADeviceResponseDTO": {
2277
2277
  "type": "object",
2278
2278
  "properties": {
2279
2279
  "id": {
2280
- "type": "number"
2281
- },
2282
- "userId": {
2283
- "type": "number"
2280
+ "type": "number",
2281
+ "description": "Unique device identifier"
2284
2282
  },
2285
2283
  "type": {
2286
- "$ref": "#/components/schemas/MFADeviceMethod"
2284
+ "$ref": "#/components/schemas/MFADeviceMethod",
2285
+ "description": "MFA method type (totp, sms, email, passkey)"
2287
2286
  },
2288
2287
  "name": {
2289
- "type": "string"
2290
- },
2291
- "secret": {
2292
- "type": [
2293
- "string",
2294
- "null"
2295
- ]
2296
- },
2297
- "credentialId": {
2298
- "type": [
2299
- "string",
2300
- "null"
2301
- ]
2302
- },
2303
- "publicKey": {
2304
- "type": [
2305
- "string",
2306
- "null"
2307
- ]
2308
- },
2309
- "counter": {
2310
- "type": [
2311
- "number",
2312
- "null"
2313
- ]
2314
- },
2315
- "transports": {
2316
- "anyOf": [
2317
- {
2318
- "type": "array",
2319
- "items": {
2320
- "type": "string"
2321
- }
2322
- },
2323
- {
2324
- "type": "null"
2325
- }
2326
- ]
2327
- },
2328
- "phoneNumber": {
2329
- "type": [
2330
- "string",
2331
- "null"
2332
- ]
2333
- },
2334
- "email": {
2335
- "type": [
2336
- "string",
2337
- "null"
2338
- ]
2288
+ "type": "string",
2289
+ "description": "Device name (user-assigned)"
2339
2290
  },
2340
- "isPrimary": {
2341
- "type": "boolean"
2291
+ "isPreferred": {
2292
+ "type": "boolean",
2293
+ "description": "Whether this is the preferred device for this method Maps from internal `isPrimary` field"
2342
2294
  },
2343
2295
  "isActive": {
2344
- "type": "boolean"
2345
- },
2346
- "lastUsedAt": {
2347
- "anyOf": [
2348
- {
2349
- "type": "string",
2350
- "format": "date-time"
2351
- },
2352
- {
2353
- "type": "null"
2354
- }
2355
- ]
2296
+ "type": "boolean",
2297
+ "description": "Whether device is currently active"
2356
2298
  },
2357
2299
  "createdAt": {
2358
2300
  "type": "string",
2359
- "format": "date-time"
2301
+ "format": "date-time",
2302
+ "description": "Device creation timestamp"
2360
2303
  }
2361
2304
  },
2362
2305
  "required": [
2363
2306
  "id",
2364
- "userId",
2365
2307
  "type",
2366
2308
  "name",
2367
- "secret",
2368
- "credentialId",
2369
- "publicKey",
2370
- "counter",
2371
- "transports",
2309
+ "isPreferred",
2372
2310
  "isActive",
2373
- "lastUsedAt",
2374
2311
  "createdAt"
2375
2312
  ],
2376
- "additionalProperties": false
2313
+ "additionalProperties": false,
2314
+ "description": "Outward-facing MFA device information\n\nNote: Uses `isPreferred` instead of internal `isPrimary` field"
2377
2315
  },
2378
2316
  "GetUserSessionsDTO": {
2379
2317
  "type": "object",
@@ -3450,7 +3388,7 @@
3450
3388
  "deviceId"
3451
3389
  ],
3452
3390
  "additionalProperties": false,
3453
- "description": "DTO for setting a user's preferred MFA device.\n\nThis updates which device is used by default during MFA challenges. The preferred device is marked with `isPrimary` in the database."
3391
+ "description": "DTO for setting a user's preferred MFA device.\n\nThis updates which device is used by default during MFA challenges. The preferred device is marked with `isPrimary` in the database (internal field). API responses expose this as `isPreferred` (outward-facing field)."
3454
3392
  },
3455
3393
  "SetPreferredDeviceResponseDTO": {
3456
3394
  "type": "object",
@@ -4030,6 +3968,20 @@
4030
3968
  "additionalProperties": false,
4031
3969
  "description": "Response DTO for MFA code verification"
4032
3970
  },
3971
+ "VerifyMFASetupResponseDTO": {
3972
+ "type": "object",
3973
+ "properties": {
3974
+ "deviceId": {
3975
+ "type": "number",
3976
+ "description": "ID of the newly created MFA device"
3977
+ }
3978
+ },
3979
+ "required": [
3980
+ "deviceId"
3981
+ ],
3982
+ "additionalProperties": false,
3983
+ "description": "Response DTO for verifying MFA setup\n\nReturned when an authenticated user completes MFA device setup verification."
3984
+ },
4033
3985
  "VerifyPhoneResponseDTO": {
4034
3986
  "type": "object",
4035
3987
  "properties": {
@@ -303,5 +303,12 @@ export declare class AdminAuthService {
303
303
  * ```
304
304
  */
305
305
  setPassword(dto: AdminSetPasswordDTO): Promise<AdminSetPasswordResponseDTO>;
306
+ /**
307
+ * Calculate grace period status for a user.
308
+ *
309
+ * @param user - User to check
310
+ * @returns Grace period status with isActive flag and endsAt date
311
+ */
312
+ private calculateGracePeriodForUser;
306
313
  }
307
314
  //# sourceMappingURL=admin-auth.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin-auth.service.d.ts","sourceRoot":"","sources":["../../src/services/admin-auth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,wBAAwB,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,oBAAoB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G,oBAAoB,CAAC,GAAG,EAAE,4BAA4B,GAAG,OAAO,CAAC,eAAe,CAAC;IAIvF;;;;;;;;;;;OAWG;IACG,aAAa,CAAC,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,6BAA6B,CAAC;IA+DvF;;;;;;;;;;;OAWG;IACG,oBAAoB,CAAC,GAAG,EAAE,4BAA4B,GAAG,OAAO,CAAC,oCAAoC,CAAC;IAgD5G;;;;;;;;;;;OAWG;IACG,WAAW,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAgDjF;;;;;OAKG;IACH,OAAO,CAAC,2BAA2B;CA4BpC"}
@@ -294,6 +294,8 @@ class AdminAuthService {
294
294
  savedUser = (await this.userRepository.save(user));
295
295
  this.logger?.log?.(`Admin user created successfully: ${dto.email} (sub: ${savedUser.sub})`);
296
296
  try {
297
+ // Calculate grace period status for metadata
298
+ const gracePeriodData = this.calculateGracePeriodForUser(savedUser);
297
299
  await this.auditService?.recordEvent({
298
300
  userId: savedUser.id,
299
301
  eventType: auth_audit_event_type_enum_1.AuthAuditEventType.ACCOUNT_CREATED,
@@ -308,6 +310,12 @@ class AdminAuthService {
308
310
  isPhoneVerified: savedUser.isPhoneVerified,
309
311
  mustChangePassword: savedUser.mustChangePassword,
310
312
  passwordGenerated: !!generatedPassword,
313
+ ...(gracePeriodData.isActive
314
+ ? {
315
+ gracePeriodActive: true,
316
+ gracePeriodEndsAt: gracePeriodData.endsAt?.toISOString(),
317
+ }
318
+ : {}),
311
319
  },
312
320
  });
313
321
  }
@@ -448,6 +456,8 @@ class AdminAuthService {
448
456
  await this.socialAuthService.createOrUpdateSocialAccount(savedUser.id, dto.provider, dto.providerId, dto.providerEmail, dto.socialMetadata);
449
457
  this.logger?.log?.(`Admin social user created successfully: ${dto.email} (sub: ${savedUser.sub})`);
450
458
  try {
459
+ // Calculate grace period status for metadata
460
+ const gracePeriodData = this.calculateGracePeriodForUser(savedUser);
451
461
  await this.auditService?.recordEvent({
452
462
  userId: savedUser.id,
453
463
  eventType: auth_audit_event_type_enum_1.AuthAuditEventType.ACCOUNT_CREATED,
@@ -465,6 +475,12 @@ class AdminAuthService {
465
475
  providerId: dto.providerId,
466
476
  hasPassword: !!dto.password,
467
477
  socialImport: true,
478
+ ...(gracePeriodData.isActive
479
+ ? {
480
+ gracePeriodActive: true,
481
+ gracePeriodEndsAt: gracePeriodData.endsAt?.toISOString(),
482
+ }
483
+ : {}),
468
484
  },
469
485
  });
470
486
  }
@@ -881,6 +897,34 @@ class AdminAuthService {
881
897
  sessionsRevoked,
882
898
  };
883
899
  }
900
+ /**
901
+ * Calculate grace period status for a user.
902
+ *
903
+ * @param user - User to check
904
+ * @returns Grace period status with isActive flag and endsAt date
905
+ */
906
+ calculateGracePeriodForUser(user) {
907
+ const gracePeriod = this.config.mfa?.gracePeriod ?? 7;
908
+ // No grace period
909
+ if (gracePeriod === 0) {
910
+ return { isActive: false };
911
+ }
912
+ // Access createdAt from user interface
913
+ const userWithDates = user;
914
+ const createdAt = userWithDates.createdAt;
915
+ if (!createdAt) {
916
+ // No creation date - grace period not active
917
+ return { isActive: false };
918
+ }
919
+ const gracePeriodEnd = new Date(createdAt);
920
+ gracePeriodEnd.setDate(gracePeriodEnd.getDate() + gracePeriod);
921
+ const now = new Date();
922
+ const isActive = now < gracePeriodEnd;
923
+ return {
924
+ isActive,
925
+ endsAt: isActive ? gracePeriodEnd : undefined,
926
+ };
927
+ }
884
928
  }
885
929
  exports.AdminAuthService = AdminAuthService;
886
930
  //# sourceMappingURL=admin-auth.service.js.map