@fiado/type-kit 3.99.1 → 3.99.2

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 (77) hide show
  1. package/_test_/unit/emailVerification/dtos/EmailConfirmRequest.test.ts +38 -0
  2. package/_test_/unit/emailVerification/dtos/EmailVerificationStartRequest.test.ts +44 -0
  3. package/_test_/unit/emailVerification/dtos/internal/PrimaryEmailByDirectoryRequest.test.ts +22 -0
  4. package/_test_/unit/emailVerification/enums/EmailVerificationStatusEnum.test.ts +17 -0
  5. package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.d.ts +7 -0
  6. package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.js +36 -0
  7. package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.d.ts +20 -0
  8. package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.js +11 -0
  9. package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.d.ts +4 -0
  10. package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.js +6 -0
  11. package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.d.ts +17 -0
  12. package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.js +39 -0
  13. package/bin/emailVerification/dtos/EmailConfirmRequest.d.ts +9 -0
  14. package/bin/emailVerification/dtos/EmailConfirmRequest.js +34 -0
  15. package/bin/emailVerification/dtos/EmailDeleteRequest.d.ts +7 -0
  16. package/bin/emailVerification/dtos/EmailDeleteRequest.js +30 -0
  17. package/bin/emailVerification/dtos/EmailDeleteResponse.d.ts +7 -0
  18. package/bin/emailVerification/dtos/EmailDeleteResponse.js +27 -0
  19. package/bin/emailVerification/dtos/EmailItem.d.ts +12 -0
  20. package/bin/emailVerification/dtos/EmailItem.js +41 -0
  21. package/bin/emailVerification/dtos/EmailListResponse.d.ts +7 -0
  22. package/bin/emailVerification/dtos/EmailListResponse.js +23 -0
  23. package/bin/emailVerification/dtos/EmailSetPrincipalRequest.d.ts +7 -0
  24. package/bin/emailVerification/dtos/EmailSetPrincipalRequest.js +30 -0
  25. package/bin/emailVerification/dtos/EmailSetPrincipalResponse.d.ts +7 -0
  26. package/bin/emailVerification/dtos/EmailSetPrincipalResponse.js +27 -0
  27. package/bin/emailVerification/dtos/EmailVerificationResendRequest.d.ts +7 -0
  28. package/bin/emailVerification/dtos/EmailVerificationResendRequest.js +30 -0
  29. package/bin/emailVerification/dtos/EmailVerificationResendResponse.d.ts +8 -0
  30. package/bin/emailVerification/dtos/EmailVerificationResendResponse.js +28 -0
  31. package/bin/emailVerification/dtos/EmailVerificationStartRequest.d.ts +9 -0
  32. package/bin/emailVerification/dtos/EmailVerificationStartRequest.js +32 -0
  33. package/bin/emailVerification/dtos/EmailVerificationStartResponse.d.ts +9 -0
  34. package/bin/emailVerification/dtos/EmailVerificationStartResponse.js +32 -0
  35. package/bin/emailVerification/dtos/EmailVerificationStatusRequest.d.ts +7 -0
  36. package/bin/emailVerification/dtos/EmailVerificationStatusRequest.js +30 -0
  37. package/bin/emailVerification/dtos/EmailVerificationStatusResponse.d.ts +10 -0
  38. package/bin/emailVerification/dtos/EmailVerificationStatusResponse.js +36 -0
  39. package/bin/emailVerification/dtos/internal/EmailsByDirectoryRequest.d.ts +6 -0
  40. package/bin/emailVerification/dtos/internal/EmailsByDirectoryRequest.js +25 -0
  41. package/bin/emailVerification/dtos/internal/EmailsByDirectoryResponse.d.ts +7 -0
  42. package/bin/emailVerification/dtos/internal/EmailsByDirectoryResponse.js +23 -0
  43. package/bin/emailVerification/dtos/internal/PrimaryEmailByDirectoryRequest.d.ts +7 -0
  44. package/bin/emailVerification/dtos/internal/PrimaryEmailByDirectoryRequest.js +26 -0
  45. package/bin/emailVerification/dtos/internal/PrimaryEmailResponse.d.ts +9 -0
  46. package/bin/emailVerification/dtos/internal/PrimaryEmailResponse.js +32 -0
  47. package/bin/emailVerification/enums/EmailVerificationStatusEnum.d.ts +15 -0
  48. package/bin/emailVerification/enums/EmailVerificationStatusEnum.js +19 -0
  49. package/bin/emailVerification/index.d.ts +18 -0
  50. package/bin/emailVerification/index.js +34 -0
  51. package/bin/index.d.ts +1 -0
  52. package/bin/index.js +2 -1
  53. package/bin/rbac/enums/PoolKind.d.ts +16 -0
  54. package/bin/rbac/enums/PoolKind.js +20 -0
  55. package/bin/rbac/index.d.ts +1 -0
  56. package/bin/rbac/index.js +17 -0
  57. package/package.json +1 -1
  58. package/src/emailVerification/dtos/EmailConfirmRequest.ts +19 -0
  59. package/src/emailVerification/dtos/EmailDeleteRequest.ts +15 -0
  60. package/src/emailVerification/dtos/EmailDeleteResponse.ts +12 -0
  61. package/src/emailVerification/dtos/EmailItem.ts +23 -0
  62. package/src/emailVerification/dtos/EmailListResponse.ts +10 -0
  63. package/src/emailVerification/dtos/EmailSetPrincipalRequest.ts +15 -0
  64. package/src/emailVerification/dtos/EmailSetPrincipalResponse.ts +12 -0
  65. package/src/emailVerification/dtos/EmailVerificationResendRequest.ts +15 -0
  66. package/src/emailVerification/dtos/EmailVerificationResendResponse.ts +13 -0
  67. package/src/emailVerification/dtos/EmailVerificationStartRequest.ts +17 -0
  68. package/src/emailVerification/dtos/EmailVerificationStartResponse.ts +16 -0
  69. package/src/emailVerification/dtos/EmailVerificationStatusRequest.ts +15 -0
  70. package/src/emailVerification/dtos/EmailVerificationStatusResponse.ts +19 -0
  71. package/src/emailVerification/dtos/internal/EmailsByDirectoryRequest.ts +11 -0
  72. package/src/emailVerification/dtos/internal/EmailsByDirectoryResponse.ts +10 -0
  73. package/src/emailVerification/dtos/internal/PrimaryEmailByDirectoryRequest.ts +12 -0
  74. package/src/emailVerification/dtos/internal/PrimaryEmailResponse.ts +16 -0
  75. package/src/emailVerification/enums/EmailVerificationStatusEnum.ts +15 -0
  76. package/src/emailVerification/index.ts +18 -0
  77. package/src/index.ts +1 -0
@@ -0,0 +1,38 @@
1
+ import 'reflect-metadata';
2
+ import { plainToInstance } from 'class-transformer';
3
+ import { validate } from 'class-validator';
4
+ import { EmailConfirmRequest } from '../../../../src/emailVerification/dtos/EmailConfirmRequest';
5
+
6
+ describe('EmailConfirmRequest', () => {
7
+ const valid = {
8
+ vid: '01890000-0000-7000-8000-000000000000',
9
+ t: 'token-opaco-de-verificacion',
10
+ };
11
+
12
+ it('valida happy path (0 errores)', async () => {
13
+ const dto = plainToInstance(EmailConfirmRequest, valid);
14
+ const errors = await validate(dto);
15
+ expect(errors).toEqual([]);
16
+ });
17
+
18
+ it('falla si vid está vacío (@IsNotEmpty)', async () => {
19
+ const dto = plainToInstance(EmailConfirmRequest, { ...valid, vid: '' });
20
+ const errors = await validate(dto);
21
+ expect(errors.some(e => e.property === 'vid')).toBe(true);
22
+ });
23
+
24
+ it('falla si t está vacío (@IsNotEmpty)', async () => {
25
+ const dto = plainToInstance(EmailConfirmRequest, { ...valid, t: '' });
26
+ const errors = await validate(dto);
27
+ expect(errors.some(e => e.property === 't')).toBe(true);
28
+ });
29
+
30
+ it('falla si t no es string', async () => {
31
+ const dto = plainToInstance(EmailConfirmRequest, {
32
+ ...valid,
33
+ t: 123 as unknown as string,
34
+ });
35
+ const errors = await validate(dto);
36
+ expect(errors.some(e => e.property === 't')).toBe(true);
37
+ });
38
+ });
@@ -0,0 +1,44 @@
1
+ import 'reflect-metadata';
2
+ import { plainToInstance } from 'class-transformer';
3
+ import { validate } from 'class-validator';
4
+ import { EmailVerificationStartRequest } from '../../../../src/emailVerification/dtos/EmailVerificationStartRequest';
5
+
6
+ describe('EmailVerificationStartRequest', () => {
7
+ const valid = {
8
+ directoryId: '01890000-0000-7000-8000-000000000000', // cognitoSub UUID v7
9
+ email: 'user@acme.com',
10
+ };
11
+
12
+ it('valida happy path (0 errores)', async () => {
13
+ const dto = plainToInstance(EmailVerificationStartRequest, valid);
14
+ const errors = await validate(dto);
15
+ expect(errors).toEqual([]);
16
+ });
17
+
18
+ it('acepta directoryId con forma de UUID v7 (es @IsString, no @IsUUID)', async () => {
19
+ const dto = plainToInstance(EmailVerificationStartRequest, {
20
+ ...valid,
21
+ directoryId: '01890000-0000-7000-8000-000000000000',
22
+ });
23
+ const errors = await validate(dto);
24
+ expect(errors.some(e => e.property === 'directoryId')).toBe(false);
25
+ });
26
+
27
+ it('falla si email no es un email válido', async () => {
28
+ const dto = plainToInstance(EmailVerificationStartRequest, {
29
+ ...valid,
30
+ email: 'no-es-email',
31
+ });
32
+ const errors = await validate(dto);
33
+ expect(errors.some(e => e.property === 'email')).toBe(true);
34
+ });
35
+
36
+ it('falla si directoryId no es string', async () => {
37
+ const dto = plainToInstance(EmailVerificationStartRequest, {
38
+ ...valid,
39
+ directoryId: 12345 as unknown as string,
40
+ });
41
+ const errors = await validate(dto);
42
+ expect(errors.some(e => e.property === 'directoryId')).toBe(true);
43
+ });
44
+ });
@@ -0,0 +1,22 @@
1
+ import 'reflect-metadata';
2
+ import { plainToInstance } from 'class-transformer';
3
+ import { validate } from 'class-validator';
4
+ import { PrimaryEmailByDirectoryRequest } from '../../../../../src/emailVerification/dtos/internal/PrimaryEmailByDirectoryRequest';
5
+
6
+ describe('PrimaryEmailByDirectoryRequest', () => {
7
+ it('valida happy path (0 errores)', async () => {
8
+ const dto = plainToInstance(PrimaryEmailByDirectoryRequest, {
9
+ directoryId: '01890000-0000-7000-8000-000000000000',
10
+ });
11
+ const errors = await validate(dto);
12
+ expect(errors).toEqual([]);
13
+ });
14
+
15
+ it('falla si directoryId no es string', async () => {
16
+ const dto = plainToInstance(PrimaryEmailByDirectoryRequest, {
17
+ directoryId: 42 as unknown as string,
18
+ });
19
+ const errors = await validate(dto);
20
+ expect(errors.some(e => e.property === 'directoryId')).toBe(true);
21
+ });
22
+ });
@@ -0,0 +1,17 @@
1
+ import { EmailVerificationStatusEnum } from '../../../../src/emailVerification/enums/EmailVerificationStatusEnum';
2
+
3
+ describe('EmailVerificationStatusEnum', () => {
4
+ it('contiene exactamente los 5 estados del contrato con value === key', () => {
5
+ expect(EmailVerificationStatusEnum.PENDING).toBe('PENDING');
6
+ expect(EmailVerificationStatusEnum.SENT).toBe('SENT');
7
+ expect(EmailVerificationStatusEnum.VERIFIED).toBe('VERIFIED');
8
+ expect(EmailVerificationStatusEnum.EXPIRED).toBe('EXPIRED');
9
+ expect(EmailVerificationStatusEnum.FAILED).toBe('FAILED');
10
+ });
11
+
12
+ it('no tiene estados de más', () => {
13
+ expect(Object.values(EmailVerificationStatusEnum).sort()).toEqual(
14
+ ['EXPIRED', 'FAILED', 'PENDING', 'SENT', 'VERIFIED'],
15
+ );
16
+ });
17
+ });
@@ -0,0 +1,7 @@
1
+ declare const ALLOWED_MFA_TYPES: readonly ["SOFTWARE_TOKEN_MFA"];
2
+ export type AllowedMfaType = (typeof ALLOWED_MFA_TYPES)[number];
3
+ export declare class MfaPoolConfig {
4
+ requireMfa: boolean;
5
+ mfaTypes: AllowedMfaType[];
6
+ }
7
+ export {};
@@ -0,0 +1,36 @@
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.MfaPoolConfig = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const MfaTypesRequiresOne_1 = require("../validators/MfaTypesRequiresOne");
16
+ // EMAIL_OTP removido (3.41.0): el cognito-backoffice-connector no provisiona
17
+ // EmailMfaConfiguration a nivel pool (requiere infra SES que no está montada
18
+ // y la integración con messages-lambda aún no tiene diseño). Ver TD-020 +
19
+ // DEC-001 en cognito-backoffice-connector/docs/. Si se reintroduce, agregar
20
+ // 'EMAIL_OTP' a este array.
21
+ const ALLOWED_MFA_TYPES = ['SOFTWARE_TOKEN_MFA'];
22
+ class MfaPoolConfig {
23
+ }
24
+ exports.MfaPoolConfig = MfaPoolConfig;
25
+ __decorate([
26
+ (0, class_transformer_1.Expose)(),
27
+ (0, class_validator_1.IsBoolean)(),
28
+ __metadata("design:type", Boolean)
29
+ ], MfaPoolConfig.prototype, "requireMfa", void 0);
30
+ __decorate([
31
+ (0, class_transformer_1.Expose)(),
32
+ (0, class_validator_1.IsArray)(),
33
+ (0, class_validator_1.IsIn)(ALLOWED_MFA_TYPES, { each: true }),
34
+ (0, class_validator_1.Validate)(MfaTypesRequiresOne_1.MfaTypesRequiresOne),
35
+ __metadata("design:type", Array)
36
+ ], MfaPoolConfig.prototype, "mfaTypes", void 0);
@@ -0,0 +1,20 @@
1
+ import { PoolKind } from '../../rbac/enums/PoolKind';
2
+ /**
3
+ * Shape del `PoolConfigRow` expuesto al caller (BFF M18 / otros lambdas Fiado).
4
+ * Refleja la configuración de un Cognito User Pool registrado en la tabla
5
+ * `PoolConfigs_GT` del lambda `cognito-backoffice-connector`.
6
+ */
7
+ export declare class PoolConfigResponse {
8
+ userPoolId: string;
9
+ userPoolArn: string;
10
+ region: string;
11
+ poolKind: PoolKind;
12
+ displayName: string;
13
+ appClients: Record<string, {
14
+ clientId: string;
15
+ clientName: string;
16
+ }>;
17
+ status: 'active' | 'deprecated';
18
+ createdAt: number;
19
+ updatedAt: number;
20
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PoolConfigResponse = void 0;
4
+ /**
5
+ * Shape del `PoolConfigRow` expuesto al caller (BFF M18 / otros lambdas Fiado).
6
+ * Refleja la configuración de un Cognito User Pool registrado en la tabla
7
+ * `PoolConfigs_GT` del lambda `cognito-backoffice-connector`.
8
+ */
9
+ class PoolConfigResponse {
10
+ }
11
+ exports.PoolConfigResponse = PoolConfigResponse;
@@ -0,0 +1,4 @@
1
+ import { PoolConfigResponse } from './PoolConfigResponse';
2
+ export declare class PoolsListResponse {
3
+ pools: PoolConfigResponse[];
4
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PoolsListResponse = void 0;
4
+ class PoolsListResponse {
5
+ }
6
+ exports.PoolsListResponse = PoolsListResponse;
@@ -0,0 +1,17 @@
1
+ import { ValidatorConstraintInterface, ValidationArguments } from 'class-validator';
2
+ /**
3
+ * Cross-field validator: si `requireMfa: true`, entonces `mfaTypes` debe tener
4
+ * al menos 1 elemento. Si `requireMfa: false`, `mfaTypes` puede ser vacío.
5
+ *
6
+ * Razón: cuando el pool nace con MFA habilitado, el connector llama
7
+ * `SetUserPoolMfaConfigCommand` con la lista de tipos del DTO. Si el array
8
+ * llega vacío con `requireMfa: true`, el SDK rechaza con InvalidParameterException
9
+ * y el pool queda en estado inconsistente (MfaConfiguration:'ON' sin tipos).
10
+ * Mejor rechazar en validación del DTO antes de tocar AWS.
11
+ *
12
+ * Ver pivote v1.4.1 TD-017 cerrado + spec doc §1 R3.
13
+ */
14
+ export declare class MfaTypesRequiresOne implements ValidatorConstraintInterface {
15
+ validate(mfaTypes: unknown, args: ValidationArguments): boolean;
16
+ defaultMessage(): string;
17
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.MfaTypesRequiresOne = void 0;
10
+ const class_validator_1 = require("class-validator");
11
+ /**
12
+ * Cross-field validator: si `requireMfa: true`, entonces `mfaTypes` debe tener
13
+ * al menos 1 elemento. Si `requireMfa: false`, `mfaTypes` puede ser vacío.
14
+ *
15
+ * Razón: cuando el pool nace con MFA habilitado, el connector llama
16
+ * `SetUserPoolMfaConfigCommand` con la lista de tipos del DTO. Si el array
17
+ * llega vacío con `requireMfa: true`, el SDK rechaza con InvalidParameterException
18
+ * y el pool queda en estado inconsistente (MfaConfiguration:'ON' sin tipos).
19
+ * Mejor rechazar en validación del DTO antes de tocar AWS.
20
+ *
21
+ * Ver pivote v1.4.1 TD-017 cerrado + spec doc §1 R3.
22
+ */
23
+ let MfaTypesRequiresOne = class MfaTypesRequiresOne {
24
+ validate(mfaTypes, args) {
25
+ const obj = args.object;
26
+ if (obj.requireMfa === true) {
27
+ return Array.isArray(mfaTypes) && mfaTypes.length >= 1;
28
+ }
29
+ // requireMfa: false → cualquier mfaTypes pasa.
30
+ return true;
31
+ }
32
+ defaultMessage() {
33
+ return 'mfaTypes requiere al menos un tipo cuando requireMfa=true';
34
+ }
35
+ };
36
+ exports.MfaTypesRequiresOne = MfaTypesRequiresOne;
37
+ exports.MfaTypesRequiresOne = MfaTypesRequiresOne = __decorate([
38
+ (0, class_validator_1.ValidatorConstraint)({ name: 'MfaTypesRequiresOneWhenMfaRequired', async: false })
39
+ ], MfaTypesRequiresOne);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Datos de confirmación que llegan desde el link del correo de verificación.
3
+ * `vid` = verificationId; `t` = token opaco de un solo uso.
4
+ * Ambos son opacos para el cliente: @IsString + @IsNotEmpty (no se parsean).
5
+ */
6
+ export declare class EmailConfirmRequest {
7
+ vid: string;
8
+ t: string;
9
+ }
@@ -0,0 +1,34 @@
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.EmailConfirmRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Datos de confirmación que llegan desde el link del correo de verificación.
17
+ * `vid` = verificationId; `t` = token opaco de un solo uso.
18
+ * Ambos son opacos para el cliente: @IsString + @IsNotEmpty (no se parsean).
19
+ */
20
+ class EmailConfirmRequest {
21
+ }
22
+ exports.EmailConfirmRequest = EmailConfirmRequest;
23
+ __decorate([
24
+ (0, class_transformer_1.Expose)(),
25
+ (0, class_validator_1.IsString)(),
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ __metadata("design:type", String)
28
+ ], EmailConfirmRequest.prototype, "vid", void 0);
29
+ __decorate([
30
+ (0, class_transformer_1.Expose)(),
31
+ (0, class_validator_1.IsString)(),
32
+ (0, class_validator_1.IsNotEmpty)(),
33
+ __metadata("design:type", String)
34
+ ], EmailConfirmRequest.prototype, "t", void 0);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Body para eliminar un email asociado a un directorio.
3
+ */
4
+ export declare class EmailDeleteRequest {
5
+ directoryId: string;
6
+ email: string;
7
+ }
@@ -0,0 +1,30 @@
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.EmailDeleteRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Body para eliminar un email asociado a un directorio.
17
+ */
18
+ class EmailDeleteRequest {
19
+ }
20
+ exports.EmailDeleteRequest = EmailDeleteRequest;
21
+ __decorate([
22
+ (0, class_transformer_1.Expose)(),
23
+ (0, class_validator_1.IsString)(),
24
+ __metadata("design:type", String)
25
+ ], EmailDeleteRequest.prototype, "directoryId", void 0);
26
+ __decorate([
27
+ (0, class_transformer_1.Expose)(),
28
+ (0, class_validator_1.IsEmail)(),
29
+ __metadata("design:type", String)
30
+ ], EmailDeleteRequest.prototype, "email", void 0);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Respuesta al eliminar un email.
3
+ */
4
+ export declare class EmailDeleteResponse {
5
+ email: string;
6
+ deleted: boolean;
7
+ }
@@ -0,0 +1,27 @@
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.EmailDeleteResponse = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ /**
15
+ * Respuesta al eliminar un email.
16
+ */
17
+ class EmailDeleteResponse {
18
+ }
19
+ exports.EmailDeleteResponse = EmailDeleteResponse;
20
+ __decorate([
21
+ (0, class_transformer_1.Expose)(),
22
+ __metadata("design:type", String)
23
+ ], EmailDeleteResponse.prototype, "email", void 0);
24
+ __decorate([
25
+ (0, class_transformer_1.Expose)(),
26
+ __metadata("design:type", Boolean)
27
+ ], EmailDeleteResponse.prototype, "deleted", void 0);
@@ -0,0 +1,12 @@
1
+ import { EmailVerificationStatusEnum } from '../enums/EmailVerificationStatusEnum';
2
+ /**
3
+ * Item de email asociado a un directorio. Se reutiliza en EmailListResponse
4
+ * (público) y en EmailsByDirectoryResponse (interno).
5
+ */
6
+ export declare class EmailItem {
7
+ email: string;
8
+ isVerified: boolean;
9
+ isPrincipal: boolean;
10
+ status: EmailVerificationStatusEnum;
11
+ verifiedAt?: number;
12
+ }
@@ -0,0 +1,41 @@
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.EmailItem = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const EmailVerificationStatusEnum_1 = require("../enums/EmailVerificationStatusEnum");
15
+ /**
16
+ * Item de email asociado a un directorio. Se reutiliza en EmailListResponse
17
+ * (público) y en EmailsByDirectoryResponse (interno).
18
+ */
19
+ class EmailItem {
20
+ }
21
+ exports.EmailItem = EmailItem;
22
+ __decorate([
23
+ (0, class_transformer_1.Expose)(),
24
+ __metadata("design:type", String)
25
+ ], EmailItem.prototype, "email", void 0);
26
+ __decorate([
27
+ (0, class_transformer_1.Expose)(),
28
+ __metadata("design:type", Boolean)
29
+ ], EmailItem.prototype, "isVerified", void 0);
30
+ __decorate([
31
+ (0, class_transformer_1.Expose)(),
32
+ __metadata("design:type", Boolean)
33
+ ], EmailItem.prototype, "isPrincipal", void 0);
34
+ __decorate([
35
+ (0, class_transformer_1.Expose)(),
36
+ __metadata("design:type", String)
37
+ ], EmailItem.prototype, "status", void 0);
38
+ __decorate([
39
+ (0, class_transformer_1.Expose)(),
40
+ __metadata("design:type", Number)
41
+ ], EmailItem.prototype, "verifiedAt", void 0);
@@ -0,0 +1,7 @@
1
+ import { EmailItem } from './EmailItem';
2
+ /**
3
+ * Lista de emails asociados a un directorio (endpoint público de listado).
4
+ */
5
+ export declare class EmailListResponse {
6
+ items: EmailItem[];
7
+ }
@@ -0,0 +1,23 @@
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.EmailListResponse = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ /**
15
+ * Lista de emails asociados a un directorio (endpoint público de listado).
16
+ */
17
+ class EmailListResponse {
18
+ }
19
+ exports.EmailListResponse = EmailListResponse;
20
+ __decorate([
21
+ (0, class_transformer_1.Expose)(),
22
+ __metadata("design:type", Array)
23
+ ], EmailListResponse.prototype, "items", void 0);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Body para marcar un email como principal del directorio.
3
+ */
4
+ export declare class EmailSetPrincipalRequest {
5
+ directoryId: string;
6
+ email: string;
7
+ }
@@ -0,0 +1,30 @@
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.EmailSetPrincipalRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Body para marcar un email como principal del directorio.
17
+ */
18
+ class EmailSetPrincipalRequest {
19
+ }
20
+ exports.EmailSetPrincipalRequest = EmailSetPrincipalRequest;
21
+ __decorate([
22
+ (0, class_transformer_1.Expose)(),
23
+ (0, class_validator_1.IsString)(),
24
+ __metadata("design:type", String)
25
+ ], EmailSetPrincipalRequest.prototype, "directoryId", void 0);
26
+ __decorate([
27
+ (0, class_transformer_1.Expose)(),
28
+ (0, class_validator_1.IsEmail)(),
29
+ __metadata("design:type", String)
30
+ ], EmailSetPrincipalRequest.prototype, "email", void 0);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Respuesta al marcar un email como principal.
3
+ */
4
+ export declare class EmailSetPrincipalResponse {
5
+ email: string;
6
+ isPrincipal: boolean;
7
+ }
@@ -0,0 +1,27 @@
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.EmailSetPrincipalResponse = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ /**
15
+ * Respuesta al marcar un email como principal.
16
+ */
17
+ class EmailSetPrincipalResponse {
18
+ }
19
+ exports.EmailSetPrincipalResponse = EmailSetPrincipalResponse;
20
+ __decorate([
21
+ (0, class_transformer_1.Expose)(),
22
+ __metadata("design:type", String)
23
+ ], EmailSetPrincipalResponse.prototype, "email", void 0);
24
+ __decorate([
25
+ (0, class_transformer_1.Expose)(),
26
+ __metadata("design:type", Boolean)
27
+ ], EmailSetPrincipalResponse.prototype, "isPrincipal", void 0);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Body para reenviar el correo de verificación de un email ya iniciado.
3
+ */
4
+ export declare class EmailVerificationResendRequest {
5
+ directoryId: string;
6
+ email: string;
7
+ }
@@ -0,0 +1,30 @@
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.EmailVerificationResendRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Body para reenviar el correo de verificación de un email ya iniciado.
17
+ */
18
+ class EmailVerificationResendRequest {
19
+ }
20
+ exports.EmailVerificationResendRequest = EmailVerificationResendRequest;
21
+ __decorate([
22
+ (0, class_transformer_1.Expose)(),
23
+ (0, class_validator_1.IsString)(),
24
+ __metadata("design:type", String)
25
+ ], EmailVerificationResendRequest.prototype, "directoryId", void 0);
26
+ __decorate([
27
+ (0, class_transformer_1.Expose)(),
28
+ (0, class_validator_1.IsEmail)(),
29
+ __metadata("design:type", String)
30
+ ], EmailVerificationResendRequest.prototype, "email", void 0);
@@ -0,0 +1,8 @@
1
+ import { EmailVerificationStatusEnum } from '../enums/EmailVerificationStatusEnum';
2
+ /**
3
+ * Respuesta al reenviar el correo de verificación.
4
+ */
5
+ export declare class EmailVerificationResendResponse {
6
+ verificationId: string;
7
+ status: EmailVerificationStatusEnum;
8
+ }
@@ -0,0 +1,28 @@
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.EmailVerificationResendResponse = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const EmailVerificationStatusEnum_1 = require("../enums/EmailVerificationStatusEnum");
15
+ /**
16
+ * Respuesta al reenviar el correo de verificación.
17
+ */
18
+ class EmailVerificationResendResponse {
19
+ }
20
+ exports.EmailVerificationResendResponse = EmailVerificationResendResponse;
21
+ __decorate([
22
+ (0, class_transformer_1.Expose)(),
23
+ __metadata("design:type", String)
24
+ ], EmailVerificationResendResponse.prototype, "verificationId", void 0);
25
+ __decorate([
26
+ (0, class_transformer_1.Expose)(),
27
+ __metadata("design:type", String)
28
+ ], EmailVerificationResendResponse.prototype, "status", void 0);