@fiado/type-kit 3.45.0 → 3.46.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.
@@ -4,5 +4,5 @@ export declare class InitiateAuthRequest {
4
4
  clientId: string;
5
5
  authFlow: string;
6
6
  username: string;
7
- password: string;
7
+ password?: string;
8
8
  }
@@ -47,7 +47,7 @@ __decorate([
47
47
  ], InitiateAuthRequest.prototype, "username", void 0);
48
48
  __decorate([
49
49
  (0, class_transformer_1.Expose)(),
50
+ (0, class_validator_1.IsOptional)(),
50
51
  (0, class_validator_1.IsString)(),
51
- (0, class_validator_1.IsNotEmpty)(),
52
52
  __metadata("design:type", String)
53
53
  ], InitiateAuthRequest.prototype, "password", void 0);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Request de validación de password (DEC-AUTH-012). El connector valida el
3
+ * password contra Cognito internamente (hoy ADMIN_USER_PASSWORD_AUTH) y devuelve
4
+ * un veredicto. El caller (rbac) NO conoce el mecanismo.
5
+ */
6
+ export declare class VerifyPasswordRequest {
7
+ userPoolId: string;
8
+ region: string;
9
+ clientId: string;
10
+ username: string;
11
+ password: string;
12
+ }
@@ -0,0 +1,52 @@
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.VerifyPasswordRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Request de validación de password (DEC-AUTH-012). El connector valida el
17
+ * password contra Cognito internamente (hoy ADMIN_USER_PASSWORD_AUTH) y devuelve
18
+ * un veredicto. El caller (rbac) NO conoce el mecanismo.
19
+ */
20
+ class VerifyPasswordRequest {
21
+ }
22
+ exports.VerifyPasswordRequest = VerifyPasswordRequest;
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
+ ], VerifyPasswordRequest.prototype, "userPoolId", 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
+ ], VerifyPasswordRequest.prototype, "region", void 0);
35
+ __decorate([
36
+ (0, class_transformer_1.Expose)(),
37
+ (0, class_validator_1.IsString)(),
38
+ (0, class_validator_1.IsNotEmpty)(),
39
+ __metadata("design:type", String)
40
+ ], VerifyPasswordRequest.prototype, "clientId", void 0);
41
+ __decorate([
42
+ (0, class_transformer_1.Expose)(),
43
+ (0, class_validator_1.IsString)(),
44
+ (0, class_validator_1.IsNotEmpty)(),
45
+ __metadata("design:type", String)
46
+ ], VerifyPasswordRequest.prototype, "username", void 0);
47
+ __decorate([
48
+ (0, class_transformer_1.Expose)(),
49
+ (0, class_validator_1.IsString)(),
50
+ (0, class_validator_1.IsNotEmpty)(),
51
+ __metadata("design:type", String)
52
+ ], VerifyPasswordRequest.prototype, "password", void 0);
@@ -0,0 +1,3 @@
1
+ export declare class VerifyPasswordResponse {
2
+ valid: boolean;
3
+ }
@@ -0,0 +1,22 @@
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.VerifyPasswordResponse = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ class VerifyPasswordResponse {
16
+ }
17
+ exports.VerifyPasswordResponse = VerifyPasswordResponse;
18
+ __decorate([
19
+ (0, class_transformer_1.Expose)(),
20
+ (0, class_validator_1.IsBoolean)(),
21
+ __metadata("design:type", Boolean)
22
+ ], VerifyPasswordResponse.prototype, "valid", void 0);
@@ -1,26 +1,24 @@
1
1
  /**
2
2
  * Tipos de Cognito Challenge que el `cognito-backoffice-connector` propaga al
3
- * caller (típicamente el BFF M18). Son los 4 valores canónicos del proyecto.
3
+ * caller (típicamente el BFF M18 / platform-rbac-business).
4
4
  *
5
- * Decisión A17 (MFA exclusivo): el proyecto soporta exclusivamente TOTP +
6
- * Email OTP. Cualquier otro challenge que devuelva el SDK
7
- * (`SELECT_MFA_TYPE`, `SMS_MFA`, `DEVICE_SRP_AUTH`, `DEVICE_PASSWORD_VERIFIER`,
8
- * `CUSTOM_CHALLENGE`, `ADMIN_NO_SRP_AUTH`, etc.) NO se propaga como
9
- * `challengeType` se mapea a `CognitoUnexpectedError` con HTTP 502 en el
10
- * service correspondiente.
5
+ * `CUSTOM_CHALLENGE` (DEC-AUTH-013): único challengeName que viaja a Cognito en
6
+ * el flujo CUSTOM_AUTH. Los sub-tipos `EMAIL_OTP` / `SOFTWARE_TOKEN_MFA` los
7
+ * decide el rbac y viajan en `challengeParameters` — Cognito no los conoce en
8
+ * custom-auth. Cualquier OTRO challenge fuera de este set (`SMS_MFA`,
9
+ * `SELECT_MFA_TYPE`, `DEVICE_SRP_AUTH`, etc.) se mapea a `CognitoUnexpectedError`
10
+ * 502 (misconfig del pool).
11
11
  *
12
- * - `NEW_PASSWORD_REQUIRED` — el usuario fue creado con temp password y debe
13
- * setear una definitiva en el primer login.
14
- * - `MFA_SETUP` — el usuario debe enrolarse en MFA (TOTP o Email) antes de
15
- * obtener tokens.
16
- * - `SOFTWARE_TOKEN_MFA` — el usuario tiene TOTP enrolado y debe enviar el
17
- * código del authenticator.
18
- * - `EMAIL_OTP` — el usuario tiene Email MFA habilitado y debe enviar el OTP
19
- * enviado al email.
12
+ * - `NEW_PASSWORD_REQUIRED` — temp password, debe setear definitiva en primer login.
13
+ * - `MFA_SETUP` debe enrolarse en MFA.
14
+ * - `SOFTWARE_TOKEN_MFA` — TOTP nativo enrolado.
15
+ * - `EMAIL_OTP` — Email MFA nativo.
16
+ * - `CUSTOM_CHALLENGE` — flujo CUSTOM_AUTH orquestado por el rbac.
20
17
  */
21
18
  export declare enum CognitoChallengeType {
22
19
  NEW_PASSWORD_REQUIRED = "NEW_PASSWORD_REQUIRED",
23
20
  MFA_SETUP = "MFA_SETUP",
24
21
  SOFTWARE_TOKEN_MFA = "SOFTWARE_TOKEN_MFA",
25
- EMAIL_OTP = "EMAIL_OTP"
22
+ EMAIL_OTP = "EMAIL_OTP",
23
+ CUSTOM_CHALLENGE = "CUSTOM_CHALLENGE"
26
24
  }
@@ -3,23 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CognitoChallengeType = void 0;
4
4
  /**
5
5
  * Tipos de Cognito Challenge que el `cognito-backoffice-connector` propaga al
6
- * caller (típicamente el BFF M18). Son los 4 valores canónicos del proyecto.
6
+ * caller (típicamente el BFF M18 / platform-rbac-business).
7
7
  *
8
- * Decisión A17 (MFA exclusivo): el proyecto soporta exclusivamente TOTP +
9
- * Email OTP. Cualquier otro challenge que devuelva el SDK
10
- * (`SELECT_MFA_TYPE`, `SMS_MFA`, `DEVICE_SRP_AUTH`, `DEVICE_PASSWORD_VERIFIER`,
11
- * `CUSTOM_CHALLENGE`, `ADMIN_NO_SRP_AUTH`, etc.) NO se propaga como
12
- * `challengeType` se mapea a `CognitoUnexpectedError` con HTTP 502 en el
13
- * service correspondiente.
8
+ * `CUSTOM_CHALLENGE` (DEC-AUTH-013): único challengeName que viaja a Cognito en
9
+ * el flujo CUSTOM_AUTH. Los sub-tipos `EMAIL_OTP` / `SOFTWARE_TOKEN_MFA` los
10
+ * decide el rbac y viajan en `challengeParameters` — Cognito no los conoce en
11
+ * custom-auth. Cualquier OTRO challenge fuera de este set (`SMS_MFA`,
12
+ * `SELECT_MFA_TYPE`, `DEVICE_SRP_AUTH`, etc.) se mapea a `CognitoUnexpectedError`
13
+ * 502 (misconfig del pool).
14
14
  *
15
- * - `NEW_PASSWORD_REQUIRED` — el usuario fue creado con temp password y debe
16
- * setear una definitiva en el primer login.
17
- * - `MFA_SETUP` — el usuario debe enrolarse en MFA (TOTP o Email) antes de
18
- * obtener tokens.
19
- * - `SOFTWARE_TOKEN_MFA` — el usuario tiene TOTP enrolado y debe enviar el
20
- * código del authenticator.
21
- * - `EMAIL_OTP` — el usuario tiene Email MFA habilitado y debe enviar el OTP
22
- * enviado al email.
15
+ * - `NEW_PASSWORD_REQUIRED` — temp password, debe setear definitiva en primer login.
16
+ * - `MFA_SETUP` debe enrolarse en MFA.
17
+ * - `SOFTWARE_TOKEN_MFA` — TOTP nativo enrolado.
18
+ * - `EMAIL_OTP` — Email MFA nativo.
19
+ * - `CUSTOM_CHALLENGE` — flujo CUSTOM_AUTH orquestado por el rbac.
23
20
  */
24
21
  var CognitoChallengeType;
25
22
  (function (CognitoChallengeType) {
@@ -27,4 +24,5 @@ var CognitoChallengeType;
27
24
  CognitoChallengeType["MFA_SETUP"] = "MFA_SETUP";
28
25
  CognitoChallengeType["SOFTWARE_TOKEN_MFA"] = "SOFTWARE_TOKEN_MFA";
29
26
  CognitoChallengeType["EMAIL_OTP"] = "EMAIL_OTP";
27
+ CognitoChallengeType["CUSTOM_CHALLENGE"] = "CUSTOM_CHALLENGE";
30
28
  })(CognitoChallengeType || (exports.CognitoChallengeType = CognitoChallengeType = {}));
@@ -23,6 +23,8 @@ export * from './dtos/AuthEventResponse';
23
23
  export * from './dtos/AuthTokensResponse';
24
24
  export * from './dtos/InitiateAuthRequest';
25
25
  export * from './dtos/InitiateAuthResponse';
26
+ export * from './dtos/VerifyPasswordRequest';
27
+ export * from './dtos/VerifyPasswordResponse';
26
28
  export * from './dtos/RespondToChallengeRequest';
27
29
  export * from './dtos/RespondToChallengeResponse';
28
30
  export * from './dtos/RefreshTokensRequest';
@@ -39,6 +39,8 @@ __exportStar(require("./dtos/AuthEventResponse"), exports);
39
39
  __exportStar(require("./dtos/AuthTokensResponse"), exports);
40
40
  __exportStar(require("./dtos/InitiateAuthRequest"), exports);
41
41
  __exportStar(require("./dtos/InitiateAuthResponse"), exports);
42
+ __exportStar(require("./dtos/VerifyPasswordRequest"), exports);
43
+ __exportStar(require("./dtos/VerifyPasswordResponse"), exports);
42
44
  __exportStar(require("./dtos/RespondToChallengeRequest"), exports);
43
45
  __exportStar(require("./dtos/RespondToChallengeResponse"), exports);
44
46
  __exportStar(require("./dtos/RefreshTokensRequest"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.45.0",
3
+ "version": "3.46.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,11 +1,12 @@
1
- import { Expose } from 'class-transformer';
2
- import { IsNotEmpty, IsString } from 'class-validator';
3
-
4
- export class InitiateAuthRequest {
5
- @Expose() @IsString() @IsNotEmpty() userPoolId!: string;
6
- @Expose() @IsString() @IsNotEmpty() region!: string;
7
- @Expose() @IsString() @IsNotEmpty() clientId!: string;
8
- @Expose() @IsString() @IsNotEmpty() authFlow!: string;
9
- @Expose() @IsString() @IsNotEmpty() username!: string;
10
- @Expose() @IsString() @IsNotEmpty() password!: string;
11
- }
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
3
+
4
+ export class InitiateAuthRequest {
5
+ @Expose() @IsString() @IsNotEmpty() userPoolId!: string;
6
+ @Expose() @IsString() @IsNotEmpty() region!: string;
7
+ @Expose() @IsString() @IsNotEmpty() clientId!: string;
8
+ @Expose() @IsString() @IsNotEmpty() authFlow!: string;
9
+ @Expose() @IsString() @IsNotEmpty() username!: string;
10
+ // CUSTOM_AUTH initiate NO manda password (ya validado por authVerifyPassword, DEC-AUTH-013).
11
+ @Expose() @IsOptional() @IsString() password?: string;
12
+ }
@@ -0,0 +1,15 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /**
5
+ * Request de validación de password (DEC-AUTH-012). El connector valida el
6
+ * password contra Cognito internamente (hoy ADMIN_USER_PASSWORD_AUTH) y devuelve
7
+ * un veredicto. El caller (rbac) NO conoce el mecanismo.
8
+ */
9
+ export class VerifyPasswordRequest {
10
+ @Expose() @IsString() @IsNotEmpty() userPoolId!: string;
11
+ @Expose() @IsString() @IsNotEmpty() region!: string;
12
+ @Expose() @IsString() @IsNotEmpty() clientId!: string;
13
+ @Expose() @IsString() @IsNotEmpty() username!: string;
14
+ @Expose() @IsString() @IsNotEmpty() password!: string;
15
+ }
@@ -0,0 +1,6 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsBoolean } from 'class-validator';
3
+
4
+ export class VerifyPasswordResponse {
5
+ @Expose() @IsBoolean() valid!: boolean;
6
+ }
@@ -1,26 +1,24 @@
1
- /**
2
- * Tipos de Cognito Challenge que el `cognito-backoffice-connector` propaga al
3
- * caller (típicamente el BFF M18). Son los 4 valores canónicos del proyecto.
4
- *
5
- * Decisión A17 (MFA exclusivo): el proyecto soporta exclusivamente TOTP +
6
- * Email OTP. Cualquier otro challenge que devuelva el SDK
7
- * (`SELECT_MFA_TYPE`, `SMS_MFA`, `DEVICE_SRP_AUTH`, `DEVICE_PASSWORD_VERIFIER`,
8
- * `CUSTOM_CHALLENGE`, `ADMIN_NO_SRP_AUTH`, etc.) NO se propaga como
9
- * `challengeType` se mapea a `CognitoUnexpectedError` con HTTP 502 en el
10
- * service correspondiente.
11
- *
12
- * - `NEW_PASSWORD_REQUIRED` — el usuario fue creado con temp password y debe
13
- * setear una definitiva en el primer login.
14
- * - `MFA_SETUP` — el usuario debe enrolarse en MFA (TOTP o Email) antes de
15
- * obtener tokens.
16
- * - `SOFTWARE_TOKEN_MFA` — el usuario tiene TOTP enrolado y debe enviar el
17
- * código del authenticator.
18
- * - `EMAIL_OTP` — el usuario tiene Email MFA habilitado y debe enviar el OTP
19
- * enviado al email.
20
- */
21
- export enum CognitoChallengeType {
22
- NEW_PASSWORD_REQUIRED = 'NEW_PASSWORD_REQUIRED',
23
- MFA_SETUP = 'MFA_SETUP',
24
- SOFTWARE_TOKEN_MFA = 'SOFTWARE_TOKEN_MFA',
25
- EMAIL_OTP = 'EMAIL_OTP',
26
- }
1
+ /**
2
+ * Tipos de Cognito Challenge que el `cognito-backoffice-connector` propaga al
3
+ * caller (típicamente el BFF M18 / platform-rbac-business).
4
+ *
5
+ * `CUSTOM_CHALLENGE` (DEC-AUTH-013): único challengeName que viaja a Cognito en
6
+ * el flujo CUSTOM_AUTH. Los sub-tipos `EMAIL_OTP` / `SOFTWARE_TOKEN_MFA` los
7
+ * decide el rbac y viajan en `challengeParameters` — Cognito no los conoce en
8
+ * custom-auth. Cualquier OTRO challenge fuera de este set (`SMS_MFA`,
9
+ * `SELECT_MFA_TYPE`, `DEVICE_SRP_AUTH`, etc.) se mapea a `CognitoUnexpectedError`
10
+ * 502 (misconfig del pool).
11
+ *
12
+ * - `NEW_PASSWORD_REQUIRED` — temp password, debe setear definitiva en primer login.
13
+ * - `MFA_SETUP` debe enrolarse en MFA.
14
+ * - `SOFTWARE_TOKEN_MFA` — TOTP nativo enrolado.
15
+ * - `EMAIL_OTP` — Email MFA nativo.
16
+ * - `CUSTOM_CHALLENGE` — flujo CUSTOM_AUTH orquestado por el rbac.
17
+ */
18
+ export enum CognitoChallengeType {
19
+ NEW_PASSWORD_REQUIRED = 'NEW_PASSWORD_REQUIRED',
20
+ MFA_SETUP = 'MFA_SETUP',
21
+ SOFTWARE_TOKEN_MFA = 'SOFTWARE_TOKEN_MFA',
22
+ EMAIL_OTP = 'EMAIL_OTP',
23
+ CUSTOM_CHALLENGE = 'CUSTOM_CHALLENGE',
24
+ }
@@ -23,6 +23,8 @@ export * from './dtos/AuthEventResponse';
23
23
  export * from './dtos/AuthTokensResponse';
24
24
  export * from './dtos/InitiateAuthRequest';
25
25
  export * from './dtos/InitiateAuthResponse';
26
+ export * from './dtos/VerifyPasswordRequest';
27
+ export * from './dtos/VerifyPasswordResponse';
26
28
  export * from './dtos/RespondToChallengeRequest';
27
29
  export * from './dtos/RespondToChallengeResponse';
28
30
  export * from './dtos/RefreshTokensRequest';