@fiado/type-kit 3.99.2 → 3.100.0

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 (85) hide show
  1. package/bin/index.d.ts +0 -1
  2. package/bin/index.js +1 -2
  3. package/bin/walletFunding/dtos/GetWalletFundingLimitRequest.d.ts +14 -0
  4. package/bin/{emailVerification/dtos/EmailConfirmRequest.js → walletFunding/dtos/GetWalletFundingLimitRequest.js} +19 -13
  5. package/bin/walletFunding/dtos/GetWalletFundingLimitResponse.d.ts +22 -0
  6. package/bin/walletFunding/dtos/GetWalletFundingLimitResponse.js +22 -0
  7. package/bin/walletFunding/dtos/index.d.ts +2 -0
  8. package/bin/walletFunding/dtos/index.js +2 -0
  9. package/package.json +1 -1
  10. package/src/index.ts +0 -1
  11. package/src/walletFunding/dtos/GetWalletFundingLimitRequest.ts +16 -0
  12. package/src/walletFunding/dtos/GetWalletFundingLimitResponse.ts +22 -0
  13. package/src/walletFunding/dtos/index.ts +2 -0
  14. package/_test_/unit/emailVerification/dtos/EmailConfirmRequest.test.ts +0 -38
  15. package/_test_/unit/emailVerification/dtos/EmailVerificationStartRequest.test.ts +0 -44
  16. package/_test_/unit/emailVerification/dtos/internal/PrimaryEmailByDirectoryRequest.test.ts +0 -22
  17. package/_test_/unit/emailVerification/enums/EmailVerificationStatusEnum.test.ts +0 -17
  18. package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.d.ts +0 -7
  19. package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.js +0 -36
  20. package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.d.ts +0 -20
  21. package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.js +0 -11
  22. package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.d.ts +0 -4
  23. package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.js +0 -6
  24. package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.d.ts +0 -17
  25. package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.js +0 -39
  26. package/bin/emailVerification/dtos/EmailConfirmRequest.d.ts +0 -9
  27. package/bin/emailVerification/dtos/EmailDeleteRequest.d.ts +0 -7
  28. package/bin/emailVerification/dtos/EmailDeleteRequest.js +0 -30
  29. package/bin/emailVerification/dtos/EmailDeleteResponse.d.ts +0 -7
  30. package/bin/emailVerification/dtos/EmailDeleteResponse.js +0 -27
  31. package/bin/emailVerification/dtos/EmailItem.d.ts +0 -12
  32. package/bin/emailVerification/dtos/EmailItem.js +0 -41
  33. package/bin/emailVerification/dtos/EmailListResponse.d.ts +0 -7
  34. package/bin/emailVerification/dtos/EmailListResponse.js +0 -23
  35. package/bin/emailVerification/dtos/EmailSetPrincipalRequest.d.ts +0 -7
  36. package/bin/emailVerification/dtos/EmailSetPrincipalRequest.js +0 -30
  37. package/bin/emailVerification/dtos/EmailSetPrincipalResponse.d.ts +0 -7
  38. package/bin/emailVerification/dtos/EmailSetPrincipalResponse.js +0 -27
  39. package/bin/emailVerification/dtos/EmailVerificationResendRequest.d.ts +0 -7
  40. package/bin/emailVerification/dtos/EmailVerificationResendRequest.js +0 -30
  41. package/bin/emailVerification/dtos/EmailVerificationResendResponse.d.ts +0 -8
  42. package/bin/emailVerification/dtos/EmailVerificationResendResponse.js +0 -28
  43. package/bin/emailVerification/dtos/EmailVerificationStartRequest.d.ts +0 -9
  44. package/bin/emailVerification/dtos/EmailVerificationStartRequest.js +0 -32
  45. package/bin/emailVerification/dtos/EmailVerificationStartResponse.d.ts +0 -9
  46. package/bin/emailVerification/dtos/EmailVerificationStartResponse.js +0 -32
  47. package/bin/emailVerification/dtos/EmailVerificationStatusRequest.d.ts +0 -7
  48. package/bin/emailVerification/dtos/EmailVerificationStatusRequest.js +0 -30
  49. package/bin/emailVerification/dtos/EmailVerificationStatusResponse.d.ts +0 -10
  50. package/bin/emailVerification/dtos/EmailVerificationStatusResponse.js +0 -36
  51. package/bin/emailVerification/dtos/internal/EmailsByDirectoryRequest.d.ts +0 -6
  52. package/bin/emailVerification/dtos/internal/EmailsByDirectoryRequest.js +0 -25
  53. package/bin/emailVerification/dtos/internal/EmailsByDirectoryResponse.d.ts +0 -7
  54. package/bin/emailVerification/dtos/internal/EmailsByDirectoryResponse.js +0 -23
  55. package/bin/emailVerification/dtos/internal/PrimaryEmailByDirectoryRequest.d.ts +0 -7
  56. package/bin/emailVerification/dtos/internal/PrimaryEmailByDirectoryRequest.js +0 -26
  57. package/bin/emailVerification/dtos/internal/PrimaryEmailResponse.d.ts +0 -9
  58. package/bin/emailVerification/dtos/internal/PrimaryEmailResponse.js +0 -32
  59. package/bin/emailVerification/enums/EmailVerificationStatusEnum.d.ts +0 -15
  60. package/bin/emailVerification/enums/EmailVerificationStatusEnum.js +0 -19
  61. package/bin/emailVerification/index.d.ts +0 -18
  62. package/bin/emailVerification/index.js +0 -34
  63. package/bin/rbac/enums/PoolKind.d.ts +0 -16
  64. package/bin/rbac/enums/PoolKind.js +0 -20
  65. package/bin/rbac/index.d.ts +0 -1
  66. package/bin/rbac/index.js +0 -17
  67. package/src/emailVerification/dtos/EmailConfirmRequest.ts +0 -19
  68. package/src/emailVerification/dtos/EmailDeleteRequest.ts +0 -15
  69. package/src/emailVerification/dtos/EmailDeleteResponse.ts +0 -12
  70. package/src/emailVerification/dtos/EmailItem.ts +0 -23
  71. package/src/emailVerification/dtos/EmailListResponse.ts +0 -10
  72. package/src/emailVerification/dtos/EmailSetPrincipalRequest.ts +0 -15
  73. package/src/emailVerification/dtos/EmailSetPrincipalResponse.ts +0 -12
  74. package/src/emailVerification/dtos/EmailVerificationResendRequest.ts +0 -15
  75. package/src/emailVerification/dtos/EmailVerificationResendResponse.ts +0 -13
  76. package/src/emailVerification/dtos/EmailVerificationStartRequest.ts +0 -17
  77. package/src/emailVerification/dtos/EmailVerificationStartResponse.ts +0 -16
  78. package/src/emailVerification/dtos/EmailVerificationStatusRequest.ts +0 -15
  79. package/src/emailVerification/dtos/EmailVerificationStatusResponse.ts +0 -19
  80. package/src/emailVerification/dtos/internal/EmailsByDirectoryRequest.ts +0 -11
  81. package/src/emailVerification/dtos/internal/EmailsByDirectoryResponse.ts +0 -10
  82. package/src/emailVerification/dtos/internal/PrimaryEmailByDirectoryRequest.ts +0 -12
  83. package/src/emailVerification/dtos/internal/PrimaryEmailResponse.ts +0 -16
  84. package/src/emailVerification/enums/EmailVerificationStatusEnum.ts +0 -15
  85. package/src/emailVerification/index.ts +0 -18
package/bin/index.d.ts CHANGED
@@ -81,6 +81,5 @@ export * as Remittance from './remittance';
81
81
  export * as WalletFunding from './walletFunding';
82
82
  export * as TotpSecurity from './totpSecurity';
83
83
  export * as NetworkConnector from './networkConnector';
84
- export * as EmailVerification from './emailVerification';
85
84
  export * from './messaging';
86
85
  export * from './complaint';
package/bin/index.js CHANGED
@@ -37,7 +37,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Company = exports.Services = exports.AccountIssuanceBusiness = exports.AppSelectionData = exports.Device = exports.Observations = exports.IssuanceBusiness = exports.Blacklist = exports.CentralPayments = exports.Helpdesk = exports.FiadoApiResponse = exports.Auth = exports.LegalDocumentsBusiness = exports.Role = exports.STPAccount = exports.RiskProfile = exports.FraudPreventionEngine = exports.BBVARst = exports.Stp = exports.BenefitCenter = exports.BankAccount = exports.P2pContact = exports.CreditContract = exports.Contract = exports.ProductCatalog = exports.ContactInfo = exports.TransactionAnalytics = exports.Transaction = exports.TransactionProcessor = exports.GenericMessage = exports.EventBridgeMessage = exports.SessionActivity = exports.NotificationMessages = exports.ServicePayment = exports.Header = exports.Identity = exports.Group = exports.File = exports.ExchangeRate = exports.Directory = exports.Currency = exports.Country = exports.Card = exports.Authentication = exports.App = exports.Address = exports.Beneficiary = exports.Activity = exports.Account = exports.Crypto = void 0;
40
- exports.EmailVerification = exports.NetworkConnector = exports.TotpSecurity = exports.WalletFunding = exports.Remittance = exports.PlatformRbac = exports.CognitoBackofficeConnector = exports.TwilioConnector = exports.MessagesConnector = exports.Mdm = exports.MilestoneBusiness = exports.CirculoCredito = exports.CreditStatements = exports.Sentry = exports.AiEngine = exports.Funnel = exports.TeamsConnector = exports.PlatformErrorEvents = exports.CustomerFile = exports.CreditBackoffice = exports.CreditDashboard = exports.CreditEngine = exports.Credit = exports.ComissionBusiness = exports.ReferralBusiness = exports.ZendeskMessaging = exports.NotificationWS = exports.Event = exports.PayrollBusiness = exports.Cnbv = exports.DirectorySetting = exports.InvoiceCollector = exports.Collector = exports.Pricelist = void 0;
40
+ exports.NetworkConnector = exports.TotpSecurity = exports.WalletFunding = exports.Remittance = exports.PlatformRbac = exports.CognitoBackofficeConnector = exports.TwilioConnector = exports.MessagesConnector = exports.Mdm = exports.MilestoneBusiness = exports.CirculoCredito = exports.CreditStatements = exports.Sentry = exports.AiEngine = exports.Funnel = exports.TeamsConnector = exports.PlatformErrorEvents = exports.CustomerFile = exports.CreditBackoffice = exports.CreditDashboard = exports.CreditEngine = exports.Credit = exports.ComissionBusiness = exports.ReferralBusiness = exports.ZendeskMessaging = exports.NotificationWS = exports.Event = exports.PayrollBusiness = exports.Cnbv = exports.DirectorySetting = exports.InvoiceCollector = exports.Collector = exports.Pricelist = void 0;
41
41
  exports.Crypto = __importStar(require("./crypto"));
42
42
  exports.Account = __importStar(require("./account"));
43
43
  exports.Activity = __importStar(require("./activity"));
@@ -128,6 +128,5 @@ exports.TotpSecurity = __importStar(require("./totpSecurity"));
128
128
  // NetworkConnector: módulo del lambda fiado-network-business (Access Card / Digital Business Card).
129
129
  // Contiene DTOs y enums para perfiles, leads, lead groups y fotos.
130
130
  exports.NetworkConnector = __importStar(require("./networkConnector"));
131
- exports.EmailVerification = __importStar(require("./emailVerification"));
132
131
  __exportStar(require("./messaging"), exports);
133
132
  __exportStar(require("./complaint"), exports);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Request del endpoint `POST /wallet-funding/limit` (processor) — devuelve el
3
+ * cap mensual del nivel del usuario y cuanto le queda disponible este mes,
4
+ * sin validar un monto especifico.
5
+ *
6
+ * Reusa los campos basicos de ValidateWalletFundingRequest (mismo flow de
7
+ * resolucion de cuenta + nivel), pero SIN `amount`/`providerName`/
8
+ * `providerReference`/`providerTxId` — no hay transaccion en curso.
9
+ */
10
+ export declare class GetWalletFundingLimitRequest {
11
+ directoryId: string;
12
+ walletAccountId: string;
13
+ currencyCode: string;
14
+ }
@@ -9,26 +9,32 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.EmailConfirmRequest = void 0;
13
- const class_transformer_1 = require("class-transformer");
12
+ exports.GetWalletFundingLimitRequest = void 0;
14
13
  const class_validator_1 = require("class-validator");
15
14
  /**
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).
15
+ * Request del endpoint `POST /wallet-funding/limit` (processor) devuelve el
16
+ * cap mensual del nivel del usuario y cuanto le queda disponible este mes,
17
+ * sin validar un monto especifico.
18
+ *
19
+ * Reusa los campos basicos de ValidateWalletFundingRequest (mismo flow de
20
+ * resolucion de cuenta + nivel), pero SIN `amount`/`providerName`/
21
+ * `providerReference`/`providerTxId` — no hay transaccion en curso.
19
22
  */
20
- class EmailConfirmRequest {
23
+ class GetWalletFundingLimitRequest {
21
24
  }
22
- exports.EmailConfirmRequest = EmailConfirmRequest;
25
+ exports.GetWalletFundingLimitRequest = GetWalletFundingLimitRequest;
23
26
  __decorate([
24
- (0, class_transformer_1.Expose)(),
25
27
  (0, class_validator_1.IsString)(),
26
- (0, class_validator_1.IsNotEmpty)(),
28
+ (0, class_validator_1.MaxLength)(64),
27
29
  __metadata("design:type", String)
28
- ], EmailConfirmRequest.prototype, "vid", void 0);
30
+ ], GetWalletFundingLimitRequest.prototype, "directoryId", void 0);
29
31
  __decorate([
30
- (0, class_transformer_1.Expose)(),
31
32
  (0, class_validator_1.IsString)(),
32
- (0, class_validator_1.IsNotEmpty)(),
33
+ (0, class_validator_1.MaxLength)(64),
33
34
  __metadata("design:type", String)
34
- ], EmailConfirmRequest.prototype, "t", void 0);
35
+ ], GetWalletFundingLimitRequest.prototype, "walletAccountId", void 0);
36
+ __decorate([
37
+ (0, class_validator_1.IsString)(),
38
+ (0, class_validator_1.Length)(3, 3),
39
+ __metadata("design:type", String)
40
+ ], GetWalletFundingLimitRequest.prototype, "currencyCode", void 0);
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Response del endpoint `POST /wallet-funding/limit` (processor).
3
+ *
4
+ * Reporta el cap mensual del nivel del usuario (en MXN) y cuanto le queda
5
+ * disponible este mes, para que el wallet-app pueda mostrar "Disponible este
6
+ * mes: $X" antes de que el usuario haga cualquier deposito.
7
+ *
8
+ * Semantica de los campos opcionales:
9
+ * - `monthlyLimit === undefined` → el nivel del usuario es ILIMITADO (el
10
+ * accountLevel tiene `maxMonthlyIncomingAmount = 0` en UDIs). En ese caso
11
+ * `remainingAmount` tambien viene undefined; el front muestra "Sin limite".
12
+ * - `monthlyLimit` definido → hay cap. `remainingAmount = max(0, monthlyLimit
13
+ * − monthlyConsumed)`. Si el usuario ya copo el cap, `remainingAmount = 0`.
14
+ *
15
+ * `currency` siempre presente (default "MXN").
16
+ */
17
+ export declare class GetWalletFundingLimitResponse {
18
+ monthlyLimit?: number;
19
+ monthlyConsumed?: number;
20
+ remainingAmount?: number;
21
+ currency: string;
22
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetWalletFundingLimitResponse = void 0;
4
+ /**
5
+ * Response del endpoint `POST /wallet-funding/limit` (processor).
6
+ *
7
+ * Reporta el cap mensual del nivel del usuario (en MXN) y cuanto le queda
8
+ * disponible este mes, para que el wallet-app pueda mostrar "Disponible este
9
+ * mes: $X" antes de que el usuario haga cualquier deposito.
10
+ *
11
+ * Semantica de los campos opcionales:
12
+ * - `monthlyLimit === undefined` → el nivel del usuario es ILIMITADO (el
13
+ * accountLevel tiene `maxMonthlyIncomingAmount = 0` en UDIs). En ese caso
14
+ * `remainingAmount` tambien viene undefined; el front muestra "Sin limite".
15
+ * - `monthlyLimit` definido → hay cap. `remainingAmount = max(0, monthlyLimit
16
+ * − monthlyConsumed)`. Si el usuario ya copo el cap, `remainingAmount = 0`.
17
+ *
18
+ * `currency` siempre presente (default "MXN").
19
+ */
20
+ class GetWalletFundingLimitResponse {
21
+ }
22
+ exports.GetWalletFundingLimitResponse = GetWalletFundingLimitResponse;
@@ -15,6 +15,8 @@ export * from "./ListFundingReferencesRequest";
15
15
  export * from "./ListFundingReferencesResponse";
16
16
  export * from "./ValidateWalletFundingRequest";
17
17
  export * from "./ValidateWalletFundingResponse";
18
+ export * from "./GetWalletFundingLimitRequest";
19
+ export * from "./GetWalletFundingLimitResponse";
18
20
  export * from "./CreditWalletFundingRequest";
19
21
  export * from "./CreditWalletFundingResponse";
20
22
  export * from "./ReverseWalletFundingRequest";
@@ -31,6 +31,8 @@ __exportStar(require("./ListFundingReferencesRequest"), exports);
31
31
  __exportStar(require("./ListFundingReferencesResponse"), exports);
32
32
  __exportStar(require("./ValidateWalletFundingRequest"), exports);
33
33
  __exportStar(require("./ValidateWalletFundingResponse"), exports);
34
+ __exportStar(require("./GetWalletFundingLimitRequest"), exports);
35
+ __exportStar(require("./GetWalletFundingLimitResponse"), exports);
34
36
  __exportStar(require("./CreditWalletFundingRequest"), exports);
35
37
  __exportStar(require("./CreditWalletFundingResponse"), exports);
36
38
  __exportStar(require("./ReverseWalletFundingRequest"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.99.2",
3
+ "version": "3.100.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
package/src/index.ts CHANGED
@@ -88,6 +88,5 @@ export * as TotpSecurity from './totpSecurity';
88
88
  // NetworkConnector: módulo del lambda fiado-network-business (Access Card / Digital Business Card).
89
89
  // Contiene DTOs y enums para perfiles, leads, lead groups y fotos.
90
90
  export * as NetworkConnector from './networkConnector';
91
- export * as EmailVerification from './emailVerification';
92
91
  export * from './messaging';
93
92
  export * from './complaint';
@@ -0,0 +1,16 @@
1
+ import { IsString, Length, MaxLength } from "class-validator";
2
+
3
+ /**
4
+ * Request del endpoint `POST /wallet-funding/limit` (processor) — devuelve el
5
+ * cap mensual del nivel del usuario y cuanto le queda disponible este mes,
6
+ * sin validar un monto especifico.
7
+ *
8
+ * Reusa los campos basicos de ValidateWalletFundingRequest (mismo flow de
9
+ * resolucion de cuenta + nivel), pero SIN `amount`/`providerName`/
10
+ * `providerReference`/`providerTxId` — no hay transaccion en curso.
11
+ */
12
+ export class GetWalletFundingLimitRequest {
13
+ @IsString() @MaxLength(64) directoryId!: string;
14
+ @IsString() @MaxLength(64) walletAccountId!: string;
15
+ @IsString() @Length(3, 3) currencyCode!: string;
16
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Response del endpoint `POST /wallet-funding/limit` (processor).
3
+ *
4
+ * Reporta el cap mensual del nivel del usuario (en MXN) y cuanto le queda
5
+ * disponible este mes, para que el wallet-app pueda mostrar "Disponible este
6
+ * mes: $X" antes de que el usuario haga cualquier deposito.
7
+ *
8
+ * Semantica de los campos opcionales:
9
+ * - `monthlyLimit === undefined` → el nivel del usuario es ILIMITADO (el
10
+ * accountLevel tiene `maxMonthlyIncomingAmount = 0` en UDIs). En ese caso
11
+ * `remainingAmount` tambien viene undefined; el front muestra "Sin limite".
12
+ * - `monthlyLimit` definido → hay cap. `remainingAmount = max(0, monthlyLimit
13
+ * − monthlyConsumed)`. Si el usuario ya copo el cap, `remainingAmount = 0`.
14
+ *
15
+ * `currency` siempre presente (default "MXN").
16
+ */
17
+ export class GetWalletFundingLimitResponse {
18
+ monthlyLimit?: number;
19
+ monthlyConsumed?: number;
20
+ remainingAmount?: number;
21
+ currency!: string;
22
+ }
@@ -15,6 +15,8 @@ export * from "./ListFundingReferencesRequest";
15
15
  export * from "./ListFundingReferencesResponse";
16
16
  export * from "./ValidateWalletFundingRequest";
17
17
  export * from "./ValidateWalletFundingResponse";
18
+ export * from "./GetWalletFundingLimitRequest";
19
+ export * from "./GetWalletFundingLimitResponse";
18
20
  export * from "./CreditWalletFundingRequest";
19
21
  export * from "./CreditWalletFundingResponse";
20
22
  export * from "./ReverseWalletFundingRequest";
@@ -1,38 +0,0 @@
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
- });
@@ -1,44 +0,0 @@
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
- });
@@ -1,22 +0,0 @@
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
- });
@@ -1,17 +0,0 @@
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
- });
@@ -1,7 +0,0 @@
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 {};
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.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);
@@ -1,20 +0,0 @@
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
- }
@@ -1,11 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- import { PoolConfigResponse } from './PoolConfigResponse';
2
- export declare class PoolsListResponse {
3
- pools: PoolConfigResponse[];
4
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PoolsListResponse = void 0;
4
- class PoolsListResponse {
5
- }
6
- exports.PoolsListResponse = PoolsListResponse;
@@ -1,17 +0,0 @@
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
- }
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.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);
@@ -1,9 +0,0 @@
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
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * Body para eliminar un email asociado a un directorio.
3
- */
4
- export declare class EmailDeleteRequest {
5
- directoryId: string;
6
- email: string;
7
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- 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);
@@ -1,7 +0,0 @@
1
- /**
2
- * Respuesta al eliminar un email.
3
- */
4
- export declare class EmailDeleteResponse {
5
- email: string;
6
- deleted: boolean;
7
- }
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.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);
@@ -1,12 +0,0 @@
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
- }