@fiado/type-kit 3.38.0 → 3.40.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.
- package/_test_/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.test.ts +77 -0
- package/bin/benefitCenter/dtos/BackofficeInputLabelsUpdateRequest.d.ts +12 -0
- package/bin/benefitCenter/dtos/BackofficeInputLabelsUpdateRequest.js +29 -0
- package/bin/benefitCenter/dtos/BackofficeLeafHelpImageUpdateRequest.d.ts +9 -0
- package/bin/benefitCenter/dtos/BackofficeLeafHelpImageUpdateRequest.js +26 -0
- package/bin/benefitCenter/dtos/BackofficeProductEnabledUpdateRequest.d.ts +9 -0
- package/bin/benefitCenter/dtos/BackofficeProductEnabledUpdateRequest.js +26 -0
- package/bin/benefitCenter/dtos/BackofficeProductHelpImageUpdateRequest.d.ts +9 -0
- package/bin/benefitCenter/dtos/BackofficeProductHelpImageUpdateRequest.js +26 -0
- package/bin/benefitCenter/dtos/BackofficeSubcategoryLogoUpdateRequest.d.ts +10 -0
- package/bin/benefitCenter/dtos/BackofficeSubcategoryLogoUpdateRequest.js +27 -0
- package/bin/benefitCenter/dtos/LeafAssetUploadUrlRequest.d.ts +14 -0
- package/bin/benefitCenter/dtos/LeafAssetUploadUrlRequest.js +36 -0
- package/bin/benefitCenter/dtos/LeafAssetUploadUrlResponse.d.ts +13 -0
- package/bin/benefitCenter/dtos/LeafAssetUploadUrlResponse.js +12 -0
- package/bin/benefitCenter/dtos/ProductItem.d.ts +12 -0
- package/bin/benefitCenter/enums/LeafAssetKindEnum.d.ts +12 -0
- package/bin/benefitCenter/enums/LeafAssetKindEnum.js +16 -0
- package/bin/benefitCenter/index.d.ts +8 -0
- package/bin/benefitCenter/index.js +9 -0
- package/bin/cognitoBackofficeConnector/dtos/AppClientConfig.d.ts +19 -0
- package/bin/cognitoBackofficeConnector/dtos/AppClientConfig.js +74 -0
- package/bin/cognitoBackofficeConnector/dtos/AuthEventsRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/AuthEventsRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/ChangePasswordRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/ChangePasswordRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/ConfirmForgotPasswordRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/ConfirmForgotPasswordRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/CreatePoolRequest.d.ts +19 -0
- package/bin/cognitoBackofficeConnector/dtos/CreatePoolRequest.js +63 -0
- package/bin/cognitoBackofficeConnector/dtos/CreatePoolResponse.d.ts +13 -0
- package/bin/cognitoBackofficeConnector/dtos/CreatePoolResponse.js +13 -0
- package/bin/cognitoBackofficeConnector/dtos/CreateUserRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/CreateUserRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/CustomAttributeSpec.d.ts +9 -0
- package/bin/cognitoBackofficeConnector/dtos/CustomAttributeSpec.js +38 -0
- package/bin/cognitoBackofficeConnector/dtos/DeletePoolRequest.d.ts +13 -0
- package/bin/{messagesConnector/dtos/VerifyOtpRequest.js → cognitoBackofficeConnector/dtos/DeletePoolRequest.js} +14 -12
- package/bin/cognitoBackofficeConnector/dtos/DeleteUserRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/DeleteUserRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/ForgotPasswordRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/ForgotPasswordRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/InitiateAuthRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/InitiateAuthRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.d.ts +7 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.js +31 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaResetRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaResetRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/PasswordPolicyConfig.d.ts +8 -0
- package/bin/cognitoBackofficeConnector/dtos/PasswordPolicyConfig.js +51 -0
- package/bin/cognitoBackofficeConnector/dtos/RefreshTokensRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/RefreshTokensRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/ResendConfirmationRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/ResendConfirmationRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/ResendInvitationRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/ResendInvitationRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/RespondToChallengeRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/RespondToChallengeRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/SetMfaPreferenceRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/SetMfaPreferenceRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/TotpBeginRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/TotpBeginRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/TotpVerifyRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/TotpVerifyRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateEmailRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateEmailRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateProfileRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateProfileRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateUserAttributesRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateUserAttributesRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/UserActionRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/UserActionRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/VerifyEmailRequest.d.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/VerifyEmailRequest.js +6 -0
- package/bin/cognitoBackofficeConnector/index.d.ts +8 -2
- package/bin/cognitoBackofficeConnector/index.js +8 -2
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.d.ts +17 -0
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.js +39 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +7 -1
- package/bin/platformRbac/dtos/AuthContext.d.ts +21 -0
- package/bin/platformRbac/dtos/AuthContext.js +2 -0
- package/bin/platformRbac/dtos/PermissionMeta.d.ts +19 -0
- package/bin/platformRbac/dtos/PermissionMeta.js +2 -0
- package/bin/platformRbac/dtos/RoleAssignmentInfo.d.ts +11 -0
- package/bin/platformRbac/dtos/RoleAssignmentInfo.js +2 -0
- package/bin/platformRbac/enums/Permission.d.ts +93 -0
- package/bin/platformRbac/enums/Permission.js +118 -0
- package/bin/platformRbac/enums/PermissionCategory.d.ts +14 -0
- package/bin/platformRbac/enums/PermissionCategory.js +18 -0
- package/bin/platformRbac/enums/PermissionScope.d.ts +10 -0
- package/bin/platformRbac/enums/PermissionScope.js +14 -0
- package/bin/platformRbac/index.d.ts +6 -0
- package/bin/platformRbac/index.js +18 -0
- package/package.json +6 -3
- package/src/benefitCenter/dtos/BackofficeInputLabelsUpdateRequest.ts +16 -0
- package/src/benefitCenter/dtos/BackofficeLeafHelpImageUpdateRequest.ts +13 -0
- package/src/benefitCenter/dtos/BackofficeProductEnabledUpdateRequest.ts +12 -0
- package/src/benefitCenter/dtos/BackofficeProductHelpImageUpdateRequest.ts +13 -0
- package/src/benefitCenter/dtos/BackofficeSubcategoryLogoUpdateRequest.ts +14 -0
- package/src/benefitCenter/dtos/LeafAssetUploadUrlRequest.ts +23 -0
- package/src/benefitCenter/dtos/LeafAssetUploadUrlResponse.ts +13 -0
- package/src/benefitCenter/dtos/ProductItem.ts +14 -0
- package/src/benefitCenter/enums/LeafAssetKindEnum.ts +12 -0
- package/src/benefitCenter/index.ts +9 -0
- package/src/cognitoBackofficeConnector/dtos/AppClientConfig.ts +22 -0
- package/src/cognitoBackofficeConnector/dtos/AuthEventsRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/ChangePasswordRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/ConfirmForgotPasswordRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/CreatePoolRequest.ts +30 -0
- package/src/cognitoBackofficeConnector/dtos/CreatePoolResponse.ts +13 -0
- package/src/cognitoBackofficeConnector/dtos/CreateUserRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/CustomAttributeSpec.ts +12 -0
- package/src/cognitoBackofficeConnector/dtos/DeletePoolRequest.ts +16 -0
- package/src/cognitoBackofficeConnector/dtos/DeleteUserRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/ForgotPasswordRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/InitiateAuthRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/MfaPoolConfig.ts +16 -0
- package/src/cognitoBackofficeConnector/dtos/MfaResetRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/PasswordPolicyConfig.ts +11 -0
- package/src/cognitoBackofficeConnector/dtos/RefreshTokensRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/ResendConfirmationRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/ResendInvitationRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/RespondToChallengeRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/SetMfaPreferenceRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/TotpBeginRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/TotpVerifyRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/UpdateEmailRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/UpdateProfileRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/UpdateUserAttributesRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/UserActionRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/dtos/VerifyEmailRequest.ts +1 -0
- package/src/cognitoBackofficeConnector/index.ts +8 -2
- package/src/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.ts +29 -0
- package/src/index.ts +6 -0
- package/src/platformRbac/dtos/AuthContext.ts +22 -0
- package/src/platformRbac/dtos/PermissionMeta.ts +20 -0
- package/src/platformRbac/dtos/RoleAssignmentInfo.ts +12 -0
- package/src/platformRbac/enums/Permission.ts +120 -0
- package/src/platformRbac/enums/PermissionCategory.ts +14 -0
- package/src/platformRbac/enums/PermissionScope.ts +10 -0
- package/src/platformRbac/index.ts +17 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.d.ts +0 -20
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.js +0 -11
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.d.ts +0 -4
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.js +0 -6
- package/bin/messagesConnector/dtos/SendMessageRequest.d.ts +0 -20
- package/bin/messagesConnector/dtos/SendMessageRequest.js +0 -118
- package/bin/messagesConnector/dtos/VerifyOtpRequest.d.ts +0 -5
- package/src/cognitoBackofficeConnector/dtos/PoolConfigResponse.ts +0 -18
- package/src/cognitoBackofficeConnector/dtos/PoolsListResponse.ts +0 -5
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IsEnum, IsNotEmpty, IsString } from "class-validator";
|
|
2
|
+
import { LeafAssetKindEnum } from "../enums/LeafAssetKindEnum";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Solicitud del backoffice para subir un asset de un leaf (logo o imagen de
|
|
6
|
+
* ayuda) directamente a S3. El backend responde con una presigned PUT URL y la
|
|
7
|
+
* URL pública final (CloudFront) que luego se asigna al leaf/producto.
|
|
8
|
+
*/
|
|
9
|
+
export class LeafAssetUploadUrlRequest {
|
|
10
|
+
/** Determina la subcarpeta S3 y el whitelist de MIME/tamaño. */
|
|
11
|
+
@IsEnum(LeafAssetKindEnum)
|
|
12
|
+
kind!: LeafAssetKindEnum;
|
|
13
|
+
|
|
14
|
+
/** MIME type del archivo (ej. "image/png"). Debe estar en el whitelist. */
|
|
15
|
+
@IsString()
|
|
16
|
+
@IsNotEmpty()
|
|
17
|
+
contentType!: string;
|
|
18
|
+
|
|
19
|
+
/** Extensión sin punto (ej. "png"). Se usa para componer la key en S3. */
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
fileExtension!: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Respuesta con la presigned URL para subir el asset del leaf directamente a S3.
|
|
3
|
+
* El backoffice hace `PUT uploadUrl` con el `Content-Type` exacto solicitado y
|
|
4
|
+
* body binario (≤ maxSizeBytes). `publicUrl` (CloudFront) es la que se asigna
|
|
5
|
+
* luego al leaf (logo) o producto (helpImage).
|
|
6
|
+
*/
|
|
7
|
+
export class LeafAssetUploadUrlResponse {
|
|
8
|
+
uploadUrl: string;
|
|
9
|
+
publicUrl: string;
|
|
10
|
+
key: string;
|
|
11
|
+
expiresAt: string;
|
|
12
|
+
maxSizeBytes: number;
|
|
13
|
+
}
|
|
@@ -8,4 +8,18 @@ export class ProductItem {
|
|
|
8
8
|
amountType: AmountTypeEnum;
|
|
9
9
|
logo: string;
|
|
10
10
|
helpText: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Imagen de ayuda del producto (ej. dónde escanear la referencia/código).
|
|
14
|
+
* Mapea desde `refSrc` del catálogo nativo. Opcional/aditivo: ausente en
|
|
15
|
+
* datos viejos.
|
|
16
|
+
*/
|
|
17
|
+
helpImage?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Si el producto está habilitado. Opcional/aditivo: la AUSENCIA del campo
|
|
21
|
+
* se interpreta como habilitado (`true`). Solo `enabled === false` oculta
|
|
22
|
+
* el producto del catálogo público.
|
|
23
|
+
*/
|
|
24
|
+
enabled?: boolean;
|
|
11
25
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de asset que el backoffice sube para un leaf del catálogo.
|
|
3
|
+
*
|
|
4
|
+
* Determina la subcarpeta en S3 (logos/ vs help-images/) y el whitelist de
|
|
5
|
+
* MIME types / tamaño de la presigned URL que devuelve el backend.
|
|
6
|
+
*/
|
|
7
|
+
export enum LeafAssetKindEnum {
|
|
8
|
+
/** Logo del servicio (ej. CALLPACKAGE). Va al campo `logo` del leaf. */
|
|
9
|
+
LOGO = "LOGO",
|
|
10
|
+
/** Imagen de ayuda del producto (dónde escanear la referencia). Va a `refSrc`. */
|
|
11
|
+
HELP_IMAGE = "HELP_IMAGE",
|
|
12
|
+
}
|
|
@@ -12,6 +12,7 @@ export * from "./enums/FavoriteDisabledReasonEnum";
|
|
|
12
12
|
export * from "./enums/BenefitPaymentStatusEnum";
|
|
13
13
|
export * from "./enums/BenefitPaymentErrorCodeEnum";
|
|
14
14
|
export * from "./enums/BannerAssetKindEnum";
|
|
15
|
+
export * from "./enums/LeafAssetKindEnum";
|
|
15
16
|
|
|
16
17
|
//DTOs
|
|
17
18
|
export * from "./dtos/BenefitItem";
|
|
@@ -70,6 +71,14 @@ export * from "./dtos/BackofficeSubcategoryOrderUpdateRequest";
|
|
|
70
71
|
export * from "./dtos/BackofficeSubcategoryOrdersResponse";
|
|
71
72
|
//Admin leaves iteration-3 (v3.37.0): ordering por país + bulk reorder (drag-and-drop)
|
|
72
73
|
export * from "./dtos/BackofficeSubcategoryReorderRequest";
|
|
74
|
+
//Admin leaves iteration-4 (v3.39.0): assets (logo + help-image), product enable/disable, input label overrides
|
|
75
|
+
export * from "./dtos/LeafAssetUploadUrlRequest";
|
|
76
|
+
export * from "./dtos/LeafAssetUploadUrlResponse";
|
|
77
|
+
export * from "./dtos/BackofficeSubcategoryLogoUpdateRequest";
|
|
78
|
+
export * from "./dtos/BackofficeLeafHelpImageUpdateRequest";
|
|
79
|
+
export * from "./dtos/BackofficeProductHelpImageUpdateRequest";
|
|
80
|
+
export * from "./dtos/BackofficeProductEnabledUpdateRequest";
|
|
81
|
+
export * from "./dtos/BackofficeInputLabelsUpdateRequest";
|
|
73
82
|
//Banner assets upload (presigned PUT)
|
|
74
83
|
export * from "./dtos/BannerUploadUrlRequest";
|
|
75
84
|
export * from "./dtos/BannerUploadUrlResponse";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsArray, IsBoolean, IsNumber, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Config del único App Client del pool nuevo creado por POST /pools.
|
|
6
|
+
*
|
|
7
|
+
* NO expone `generateSecret` — el connector hardcodea `GenerateSecret: false`
|
|
8
|
+
* en el SDK call (BFF pattern: rbac llama al connector server-to-server vía
|
|
9
|
+
* api-invoker en VPC, sin SPA-to-Cognito directo que requiera client secret).
|
|
10
|
+
* Decisión arquitectónica A21 del connector. Si aparece consumer B2B/M2M con
|
|
11
|
+
* flow `client_credentials`, evaluar con líder + bump major del connector.
|
|
12
|
+
*/
|
|
13
|
+
export class AppClientConfig {
|
|
14
|
+
@Expose() @IsOptional() @IsString() clientName?: string;
|
|
15
|
+
@Expose() @IsArray() @IsString({ each: true }) explicitAuthFlows!: string[];
|
|
16
|
+
@Expose() @IsOptional() @IsString() tokenValidityUnits?: string;
|
|
17
|
+
@Expose() @IsOptional() @IsNumber() accessTokenValidity?: number;
|
|
18
|
+
@Expose() @IsOptional() @IsNumber() idTokenValidity?: number;
|
|
19
|
+
@Expose() @IsOptional() @IsNumber() refreshTokenValidity?: number;
|
|
20
|
+
@Expose() @IsOptional() @IsBoolean() preventUserExistenceErrors?: boolean;
|
|
21
|
+
@Expose() @IsOptional() @IsBoolean() enableTokenRevocation?: boolean;
|
|
22
|
+
}
|
|
@@ -3,5 +3,6 @@ import { IsInt, IsNotEmpty, IsOptional, IsString, Max, Min } from 'class-validat
|
|
|
3
3
|
|
|
4
4
|
export class AuthEventsRequest {
|
|
5
5
|
@Expose() @IsString() @IsNotEmpty() userPoolId!: string;
|
|
6
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
6
7
|
@Expose() @IsOptional() @IsInt() @Min(1) @Max(60) maxResults?: number;
|
|
7
8
|
}
|
|
@@ -2,6 +2,7 @@ import { Expose } from 'class-transformer';
|
|
|
2
2
|
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
export class ChangePasswordRequest {
|
|
5
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
5
6
|
@Expose() @IsString() @IsNotEmpty() accessToken!: string;
|
|
6
7
|
@Expose() @IsString() @IsNotEmpty() previousPassword!: string;
|
|
7
8
|
@Expose() @IsString() @IsNotEmpty() proposedPassword!: string;
|
|
@@ -3,6 +3,7 @@ import { IsNotEmpty, IsString } from 'class-validator';
|
|
|
3
3
|
|
|
4
4
|
export class ConfirmForgotPasswordRequest {
|
|
5
5
|
@Expose() @IsString() @IsNotEmpty() userPoolId!: string;
|
|
6
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
6
7
|
@Expose() @IsString() @IsNotEmpty() clientId!: string;
|
|
7
8
|
@Expose() @IsString() @IsNotEmpty() username!: string;
|
|
8
9
|
@Expose() @IsString() @IsNotEmpty() confirmationCode!: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsArray, IsString, ValidateNested } from 'class-validator';
|
|
3
|
+
import { MfaPoolConfig } from './MfaPoolConfig';
|
|
4
|
+
import { PasswordPolicyConfig } from './PasswordPolicyConfig';
|
|
5
|
+
import { CustomAttributeSpec } from './CustomAttributeSpec';
|
|
6
|
+
import { AppClientConfig } from './AppClientConfig';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Request del endpoint POST /pools (pivote v1.4.1 stateless).
|
|
10
|
+
* Consumido por la saga `TenantOnboardingManager` del `platform-rbac-business`
|
|
11
|
+
* (Flujo 2 v1.2, PASO 4 de la saga). El connector ejecuta CreateUserPool +
|
|
12
|
+
* CreateUserPoolClient en secuencia. Si CreateUserPoolClient falla DESPUÉS de
|
|
13
|
+
* CreateUserPool exitoso, el connector hace DeleteUserPool de cleanup.
|
|
14
|
+
*/
|
|
15
|
+
export class CreatePoolRequest {
|
|
16
|
+
@Expose() @IsString() region!: string;
|
|
17
|
+
@Expose() @IsString() displayName!: string;
|
|
18
|
+
|
|
19
|
+
@Expose() @ValidateNested() @Type(() => MfaPoolConfig)
|
|
20
|
+
mfaConfig!: MfaPoolConfig;
|
|
21
|
+
|
|
22
|
+
@Expose() @ValidateNested() @Type(() => PasswordPolicyConfig)
|
|
23
|
+
passwordPolicy!: PasswordPolicyConfig;
|
|
24
|
+
|
|
25
|
+
@Expose() @IsArray() @ValidateNested({ each: true }) @Type(() => CustomAttributeSpec)
|
|
26
|
+
customAttributes!: CustomAttributeSpec[];
|
|
27
|
+
|
|
28
|
+
@Expose() @ValidateNested() @Type(() => AppClientConfig)
|
|
29
|
+
appClientConfig!: AppClientConfig;
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response del endpoint POST /pools (pivote v1.4.1 stateless).
|
|
3
|
+
*
|
|
4
|
+
* NO expone `clientSecret` — el SDK Cognito no lo devuelve cuando
|
|
5
|
+
* `GenerateSecret: false` (BFF pattern A21). Si aparece consumer B2B/M2M
|
|
6
|
+
* que requiera client secret, evaluar con líder + bump major del connector.
|
|
7
|
+
*/
|
|
8
|
+
export class CreatePoolResponse {
|
|
9
|
+
userPoolId!: string;
|
|
10
|
+
userPoolArn!: string;
|
|
11
|
+
appClientId!: string;
|
|
12
|
+
region!: string;
|
|
13
|
+
}
|
|
@@ -3,6 +3,7 @@ import { IsBoolean, IsEmail, IsNotEmpty, IsOptional, IsString, IsUUID } from 'cl
|
|
|
3
3
|
|
|
4
4
|
export class CreateUserRequest {
|
|
5
5
|
@Expose() @IsString() @IsNotEmpty() userPoolId!: string;
|
|
6
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
6
7
|
@Expose() @IsEmail() email!: string;
|
|
7
8
|
@Expose() @IsOptional() @IsString() displayName?: string;
|
|
8
9
|
@Expose() @IsUUID() tenantId!: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsBoolean, IsIn, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
const ALLOWED_ATTR_TYPES = ['String', 'Number', 'Boolean', 'DateTime'] as const;
|
|
5
|
+
export type AllowedAttrType = (typeof ALLOWED_ATTR_TYPES)[number];
|
|
6
|
+
|
|
7
|
+
export class CustomAttributeSpec {
|
|
8
|
+
@Expose() @IsString() name!: string;
|
|
9
|
+
@Expose() @IsIn(ALLOWED_ATTR_TYPES) type!: AllowedAttrType;
|
|
10
|
+
@Expose() @IsBoolean() mutable!: boolean;
|
|
11
|
+
@Expose() @IsBoolean() required!: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Request del endpoint DELETE /pools/:userPoolId?region=X (pivote v1.4.1 stateless).
|
|
6
|
+
* Consumido por compensation chain de la saga `TenantOnboardingManager` del
|
|
7
|
+
* `platform-rbac-business` cuando falla el paso 5 (CreateUser) o paso 6
|
|
8
|
+
* (TransactWriteItems) — ver Flujo 2 v1.2 del rbac.
|
|
9
|
+
*
|
|
10
|
+
* Requiere pool VACÍO (sin users). Si tiene users, AWS rechaza con
|
|
11
|
+
* ResourceInUseException → CognitoPoolNotEmptyError 409.
|
|
12
|
+
*/
|
|
13
|
+
export class DeletePoolRequest {
|
|
14
|
+
@Expose() @IsString() userPoolId!: string;
|
|
15
|
+
@Expose() @IsString() region!: string;
|
|
16
|
+
}
|
|
@@ -3,6 +3,7 @@ import { IsNotEmpty, IsString } from 'class-validator';
|
|
|
3
3
|
|
|
4
4
|
export class ForgotPasswordRequest {
|
|
5
5
|
@Expose() @IsString() @IsNotEmpty() userPoolId!: string;
|
|
6
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
6
7
|
@Expose() @IsString() @IsNotEmpty() clientId!: string;
|
|
7
8
|
@Expose() @IsString() @IsNotEmpty() username!: string;
|
|
8
9
|
}
|
|
@@ -3,6 +3,7 @@ import { IsNotEmpty, IsString } from 'class-validator';
|
|
|
3
3
|
|
|
4
4
|
export class InitiateAuthRequest {
|
|
5
5
|
@Expose() @IsString() @IsNotEmpty() userPoolId!: string;
|
|
6
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
6
7
|
@Expose() @IsString() @IsNotEmpty() clientId!: string;
|
|
7
8
|
@Expose() @IsString() @IsNotEmpty() authFlow!: string;
|
|
8
9
|
@Expose() @IsString() @IsNotEmpty() username!: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsArray, IsBoolean, IsIn, Validate } from 'class-validator';
|
|
3
|
+
import { MfaTypesRequiresOne } from '../validators/MfaTypesRequiresOne';
|
|
4
|
+
|
|
5
|
+
const ALLOWED_MFA_TYPES = ['SOFTWARE_TOKEN_MFA', 'EMAIL_OTP'] as const;
|
|
6
|
+
export type AllowedMfaType = (typeof ALLOWED_MFA_TYPES)[number];
|
|
7
|
+
|
|
8
|
+
export class MfaPoolConfig {
|
|
9
|
+
@Expose() @IsBoolean() requireMfa!: boolean;
|
|
10
|
+
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsArray()
|
|
13
|
+
@IsIn(ALLOWED_MFA_TYPES, { each: true })
|
|
14
|
+
@Validate(MfaTypesRequiresOne)
|
|
15
|
+
mfaTypes!: AllowedMfaType[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsBoolean, IsNumber, Max, Min } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
export class PasswordPolicyConfig {
|
|
5
|
+
@Expose() @IsNumber() @Min(6) @Max(99) minLength!: number;
|
|
6
|
+
@Expose() @IsBoolean() requireUppercase!: boolean;
|
|
7
|
+
@Expose() @IsBoolean() requireLowercase!: boolean;
|
|
8
|
+
@Expose() @IsBoolean() requireNumbers!: boolean;
|
|
9
|
+
@Expose() @IsBoolean() requireSymbols!: boolean;
|
|
10
|
+
@Expose() @IsNumber() @Min(1) @Max(365) temporaryPasswordValidityDays!: number;
|
|
11
|
+
}
|
|
@@ -3,6 +3,7 @@ import { IsNotEmpty, IsString } from 'class-validator';
|
|
|
3
3
|
|
|
4
4
|
export class RefreshTokensRequest {
|
|
5
5
|
@Expose() @IsString() @IsNotEmpty() userPoolId!: string;
|
|
6
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
6
7
|
@Expose() @IsString() @IsNotEmpty() clientId!: string;
|
|
7
8
|
@Expose() @IsString() @IsNotEmpty() refreshToken!: string;
|
|
8
9
|
}
|
|
@@ -3,6 +3,7 @@ import { IsNotEmpty, IsString } from 'class-validator';
|
|
|
3
3
|
|
|
4
4
|
export class ResendConfirmationRequest {
|
|
5
5
|
@Expose() @IsString() @IsNotEmpty() userPoolId!: string;
|
|
6
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
6
7
|
@Expose() @IsString() @IsNotEmpty() clientId!: string;
|
|
7
8
|
@Expose() @IsString() @IsNotEmpty() username!: string;
|
|
8
9
|
}
|
|
@@ -4,6 +4,7 @@ import { CognitoChallengeType } from '../enums/CognitoChallengeType';
|
|
|
4
4
|
|
|
5
5
|
export class RespondToChallengeRequest {
|
|
6
6
|
@Expose() @IsString() @IsNotEmpty() userPoolId!: string;
|
|
7
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
7
8
|
@Expose() @IsString() @IsNotEmpty() clientId!: string;
|
|
8
9
|
@Expose() @IsEnum(CognitoChallengeType) challengeName!: CognitoChallengeType;
|
|
9
10
|
@Expose() @IsString() @IsNotEmpty() session!: string;
|
|
@@ -3,6 +3,7 @@ import { IsBoolean, IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validat
|
|
|
3
3
|
|
|
4
4
|
export class SetMfaPreferenceRequest {
|
|
5
5
|
@Expose() @IsString() @IsNotEmpty() userPoolId!: string;
|
|
6
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
6
7
|
@Expose() @IsString() @IsNotEmpty() cognitoSub!: string;
|
|
7
8
|
@Expose() @IsBoolean() softwareTokenEnabled!: boolean;
|
|
8
9
|
@Expose() @IsBoolean() emailEnabled!: boolean;
|
|
@@ -2,6 +2,7 @@ import { Expose } from 'class-transformer';
|
|
|
2
2
|
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
export class TotpVerifyRequest {
|
|
5
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
5
6
|
@Expose() @IsString() @IsNotEmpty() accessToken!: string;
|
|
6
7
|
@Expose() @IsString() @IsNotEmpty() userCode!: string;
|
|
7
8
|
@Expose() @IsOptional() @IsString() friendlyDeviceName?: string;
|
|
@@ -2,6 +2,7 @@ import { Expose } from 'class-transformer';
|
|
|
2
2
|
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
export class UpdateEmailRequest {
|
|
5
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
5
6
|
@Expose() @IsString() @IsNotEmpty() accessToken!: string;
|
|
6
7
|
@Expose() @IsEmail() newEmail!: string;
|
|
7
8
|
}
|
|
@@ -8,6 +8,7 @@ import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
|
8
8
|
* benignos.
|
|
9
9
|
*/
|
|
10
10
|
export class UpdateProfileRequest {
|
|
11
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
11
12
|
@Expose() @IsString() @IsNotEmpty() accessToken!: string;
|
|
12
13
|
@Expose() @IsOptional() @IsString() displayName?: string;
|
|
13
14
|
@Expose() @IsOptional() @IsString() phoneNumber?: string;
|
|
@@ -4,6 +4,7 @@ import { NoTenantIdInCustomAttrs } from '../validators/NoTenantIdInCustomAttrs';
|
|
|
4
4
|
|
|
5
5
|
export class UpdateUserAttributesRequest {
|
|
6
6
|
@Expose() @IsString() @IsNotEmpty() userPoolId!: string;
|
|
7
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
7
8
|
@Expose() @IsOptional() @IsString() displayName?: string;
|
|
8
9
|
@Expose() @IsOptional() @IsString() phoneNumber?: string;
|
|
9
10
|
@Expose() @IsOptional() @IsObject() @Validate(NoTenantIdInCustomAttrs)
|
|
@@ -2,6 +2,7 @@ import { Expose } from 'class-transformer';
|
|
|
2
2
|
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
export class VerifyEmailRequest {
|
|
5
|
+
@Expose() @IsString() @IsNotEmpty() region!: string;
|
|
5
6
|
@Expose() @IsString() @IsNotEmpty() accessToken!: string;
|
|
6
7
|
@Expose() @IsString() @IsNotEmpty() confirmationCode!: string;
|
|
7
8
|
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
export * from './enums/CognitoChallengeType';
|
|
11
11
|
export * from './enums/CognitoUserStatus';
|
|
12
12
|
export * from './validators/NoTenantIdInCustomAttrs';
|
|
13
|
+
export * from './validators/MfaTypesRequiresOne';
|
|
13
14
|
export * from './dtos/CreateUserRequest';
|
|
14
15
|
export * from './dtos/CreateUserResponse';
|
|
15
16
|
export * from './dtos/UpdateUserAttributesRequest';
|
|
@@ -39,6 +40,11 @@ export * from './dtos/MfaResetRequest';
|
|
|
39
40
|
export * from './dtos/UpdateEmailRequest';
|
|
40
41
|
export * from './dtos/VerifyEmailRequest';
|
|
41
42
|
export * from './dtos/UpdateProfileRequest';
|
|
42
|
-
export * from './dtos/PoolConfigResponse';
|
|
43
|
-
export * from './dtos/PoolsListResponse';
|
|
44
43
|
export * from './dtos/HealthcheckResponse';
|
|
44
|
+
export * from './dtos/MfaPoolConfig';
|
|
45
|
+
export * from './dtos/PasswordPolicyConfig';
|
|
46
|
+
export * from './dtos/CustomAttributeSpec';
|
|
47
|
+
export * from './dtos/AppClientConfig';
|
|
48
|
+
export * from './dtos/CreatePoolRequest';
|
|
49
|
+
export * from './dtos/CreatePoolResponse';
|
|
50
|
+
export * from './dtos/DeletePoolRequest';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ValidatorConstraint, ValidatorConstraintInterface, ValidationArguments } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Cross-field validator: si `requireMfa: true`, entonces `mfaTypes` debe tener
|
|
5
|
+
* al menos 1 elemento. Si `requireMfa: false`, `mfaTypes` puede ser vacío.
|
|
6
|
+
*
|
|
7
|
+
* Razón: cuando el pool nace con MFA habilitado, el connector llama
|
|
8
|
+
* `SetUserPoolMfaConfigCommand` con la lista de tipos del DTO. Si el array
|
|
9
|
+
* llega vacío con `requireMfa: true`, el SDK rechaza con InvalidParameterException
|
|
10
|
+
* y el pool queda en estado inconsistente (MfaConfiguration:'ON' sin tipos).
|
|
11
|
+
* Mejor rechazar en validación del DTO antes de tocar AWS.
|
|
12
|
+
*
|
|
13
|
+
* Ver pivote v1.4.1 TD-017 cerrado + spec doc §1 R3.
|
|
14
|
+
*/
|
|
15
|
+
@ValidatorConstraint({ name: 'MfaTypesRequiresOneWhenMfaRequired', async: false })
|
|
16
|
+
export class MfaTypesRequiresOne implements ValidatorConstraintInterface {
|
|
17
|
+
validate(mfaTypes: unknown, args: ValidationArguments): boolean {
|
|
18
|
+
const obj = args.object as { requireMfa?: boolean };
|
|
19
|
+
if (obj.requireMfa === true) {
|
|
20
|
+
return Array.isArray(mfaTypes) && mfaTypes.length >= 1;
|
|
21
|
+
}
|
|
22
|
+
// requireMfa: false → cualquier mfaTypes pasa.
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defaultMessage(): string {
|
|
27
|
+
return 'mfaTypes requiere al menos un tipo cuando requireMfa=true';
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -75,5 +75,11 @@ export * as Mdm from './mdm';
|
|
|
75
75
|
export * as MessagesConnector from './messagesConnector';
|
|
76
76
|
export * as CognitoBackofficeConnector from './cognitoBackofficeConnector';
|
|
77
77
|
export * as Rbac from './rbac';
|
|
78
|
+
// PlatformRbac: módulo del lambda platform-rbac-business (Fase 0 SureKeep).
|
|
79
|
+
// Contiene Permission enum + AuthContext + RoleAssignmentInfo + PermissionScope +
|
|
80
|
+
// PermissionCategory + PermissionMeta + (futuro Fase 1.B) DTOs propios del rbac-business.
|
|
81
|
+
// Coexiste con `Rbac` oficial cuando yhonhansen publique componente 01.
|
|
82
|
+
// Cleanup del `Rbac` viejo planeado en bloque 13 post-gate (TD-RBAC en platform-rbac-business).
|
|
83
|
+
export * as PlatformRbac from './platformRbac';
|
|
78
84
|
export * as Remittance from './remittance';
|
|
79
85
|
export * from './messaging';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Permission } from '../enums/Permission';
|
|
2
|
+
import type { RoleAssignmentInfo } from './RoleAssignmentInfo';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shape DESERIALIZADO del authorizer context.
|
|
6
|
+
* El authorizer Lambda (componente 07) lo construye + serializa; el helper
|
|
7
|
+
* `extractTenantContext` lo deserializa para los handlers business.
|
|
8
|
+
*
|
|
9
|
+
* En API Gateway authorizer.context todos los valores son strings:
|
|
10
|
+
* - `permissions` viaja como CSV (`"a.b.c,d.e.f,..."`).
|
|
11
|
+
* - `roleAssignments` viaja como JSON string.
|
|
12
|
+
* Este interface es la forma ya parseada.
|
|
13
|
+
*/
|
|
14
|
+
export interface AuthContext {
|
|
15
|
+
cognitoSub: string;
|
|
16
|
+
tenantId: string;
|
|
17
|
+
email: string;
|
|
18
|
+
roleAssignments: RoleAssignmentInfo[];
|
|
19
|
+
permissions: Permission[];
|
|
20
|
+
resolvedAt: string;
|
|
21
|
+
issuer?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Permission } from '../enums/Permission';
|
|
2
|
+
import type { PermissionScope } from '../enums/PermissionScope';
|
|
3
|
+
import type { PermissionCategory } from '../enums/PermissionCategory';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Metadata enriquecida de una permission del catálogo.
|
|
7
|
+
* Usado para:
|
|
8
|
+
* - Sync del enum a DDB `PlatformPermission_GT` al deploy.
|
|
9
|
+
* - UI del módulo rbac-admin: selector de permissions agrupado.
|
|
10
|
+
* - Reporting / docs.
|
|
11
|
+
*/
|
|
12
|
+
export interface PermissionMeta {
|
|
13
|
+
permissionKey: Permission;
|
|
14
|
+
displayName: string;
|
|
15
|
+
description: string;
|
|
16
|
+
category: PermissionCategory;
|
|
17
|
+
scope: PermissionScope;
|
|
18
|
+
platforms: string[];
|
|
19
|
+
isDeprecated?: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PermissionScope } from '../enums/PermissionScope';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Una asignación de role a un user con scope específico.
|
|
5
|
+
* Shape que el authorizer Lambda (componente 07) serializa como JSON string
|
|
6
|
+
* dentro del API Gateway authorizer context.
|
|
7
|
+
*/
|
|
8
|
+
export interface RoleAssignmentInfo {
|
|
9
|
+
roleId: string;
|
|
10
|
+
scope: PermissionScope;
|
|
11
|
+
scopeRef: string;
|
|
12
|
+
}
|