@fiado/api-invoker 5.110.0 → 5.111.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.
@@ -1,6 +1,6 @@
1
1
  import type { IHttpRequest } from "@fiado/http-client";
2
2
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
3
- import { CreateUserRequest, CreateUserResponse, UpdateUserAttributesRequest, UserActionRequest, ResendInvitationRequest, SetUserPasswordRequest, UserDetailResponse, AuthEventsRequest, AuthEventResponse, InitiateAuthRequest, InitiateAuthResponse, RespondToChallengeRequest, RespondToChallengeResponse, RefreshTokensRequest, RefreshTokensResponse, ForgotPasswordRequest, ConfirmForgotPasswordRequest, ResendConfirmationRequest, ChangePasswordRequest, TotpBeginRequest, TotpBeginResponse, TotpVerifyRequest, MfaVerifyResponse, SetMfaPreferenceRequest, MfaResetRequest, UpdateEmailRequest, VerifyEmailRequest, UpdateProfileRequest, CreatePoolRequest, CreatePoolResponse, CreatePoolClientRequest, CreatePoolClientResponse, HealthcheckResponse, VerifyPasswordRequest, VerifyPasswordResponse, IntrospectRequest, IntrospectResponse } from "@fiado/type-kit/bin/cognitoBackofficeConnector/index.js";
3
+ import { CreateUserRequest, CreateUserResponse, UpdateUserAttributesRequest, UserActionRequest, ResendInvitationRequest, SetUserPasswordRequest, UserDetailResponse, AuthEventsRequest, AuthEventResponse, InitiateAuthRequest, InitiateAuthResponse, RespondToChallengeRequest, RespondToChallengeResponse, RefreshTokensRequest, RefreshTokensResponse, ForgotPasswordRequest, ConfirmForgotPasswordRequest, ResendConfirmationRequest, ChangePasswordRequest, TotpBeginRequest, TotpBeginResponse, TotpVerifyRequest, MfaVerifyResponse, SetMfaPreferenceRequest, MfaResetRequest, UpdateEmailRequest, VerifyEmailRequest, UpdateProfileRequest, CreatePoolRequest, CreatePoolResponse, CreatePoolClientRequest, CreatePoolClientResponse, HealthcheckResponse, VerifyPasswordRequest, VerifyPasswordResponse, AuthStartLoginRequest, AuthStartLoginResponse, IntrospectRequest, IntrospectResponse } from "@fiado/type-kit/bin/cognitoBackofficeConnector/index.js";
4
4
  import { ICognitoBackofficeConnectorApi } from "./interfaces/ICognitoBackofficeConnectorApi.js";
5
5
  /**
6
6
  * Publisher HTTP del lambda `cognito-backoffice-connector` (componente 05 SureKeep Fase 0).
@@ -40,6 +40,7 @@ export default class CognitoBackofficeConnectorApi implements ICognitoBackoffice
40
40
  resetUserMfa(cognitoSub: string, input: MfaResetRequest): Promise<ApiGatewayResponse<void>>;
41
41
  authInitiate(input: InitiateAuthRequest): Promise<ApiGatewayResponse<InitiateAuthResponse>>;
42
42
  authVerifyPassword(input: VerifyPasswordRequest): Promise<ApiGatewayResponse<VerifyPasswordResponse>>;
43
+ authStartLogin(input: AuthStartLoginRequest): Promise<ApiGatewayResponse<AuthStartLoginResponse>>;
43
44
  introspect(input: IntrospectRequest): Promise<ApiGatewayResponse<IntrospectResponse>>;
44
45
  authRespondChallenge(input: RespondToChallengeRequest): Promise<ApiGatewayResponse<RespondToChallengeResponse>>;
45
46
  authRefreshTokens(input: RefreshTokensRequest): Promise<ApiGatewayResponse<RefreshTokensResponse>>;
@@ -97,6 +97,10 @@ let CognitoBackofficeConnectorApi = class CognitoBackofficeConnectorApi {
97
97
  const url = `${this.baseUrl}/auth/verify-password`;
98
98
  return await this.httpRequest.post(url, input);
99
99
  }
100
+ async authStartLogin(input) {
101
+ const url = `${this.baseUrl}/auth/start-login`;
102
+ return await this.httpRequest.post(url, input);
103
+ }
100
104
  async introspect(input) {
101
105
  const url = `${this.baseUrl}/auth/introspect`;
102
106
  return await this.httpRequest.post(url, input);
@@ -1,5 +1,5 @@
1
1
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
- import { CreateUserRequest, CreateUserResponse, UpdateUserAttributesRequest, UserActionRequest, ResendInvitationRequest, SetUserPasswordRequest, UserDetailResponse, AuthEventsRequest, AuthEventResponse, InitiateAuthRequest, InitiateAuthResponse, RespondToChallengeRequest, RespondToChallengeResponse, RefreshTokensRequest, RefreshTokensResponse, ForgotPasswordRequest, ConfirmForgotPasswordRequest, ResendConfirmationRequest, ChangePasswordRequest, TotpBeginRequest, TotpBeginResponse, TotpVerifyRequest, MfaVerifyResponse, SetMfaPreferenceRequest, MfaResetRequest, UpdateEmailRequest, VerifyEmailRequest, UpdateProfileRequest, CreatePoolRequest, CreatePoolResponse, CreatePoolClientRequest, CreatePoolClientResponse, HealthcheckResponse, VerifyPasswordRequest, VerifyPasswordResponse, IntrospectRequest, IntrospectResponse } from "@fiado/type-kit/bin/cognitoBackofficeConnector/index.js";
2
+ import { CreateUserRequest, CreateUserResponse, UpdateUserAttributesRequest, UserActionRequest, ResendInvitationRequest, SetUserPasswordRequest, UserDetailResponse, AuthEventsRequest, AuthEventResponse, InitiateAuthRequest, InitiateAuthResponse, RespondToChallengeRequest, RespondToChallengeResponse, RefreshTokensRequest, RefreshTokensResponse, ForgotPasswordRequest, ConfirmForgotPasswordRequest, ResendConfirmationRequest, ChangePasswordRequest, TotpBeginRequest, TotpBeginResponse, TotpVerifyRequest, MfaVerifyResponse, SetMfaPreferenceRequest, MfaResetRequest, UpdateEmailRequest, VerifyEmailRequest, UpdateProfileRequest, CreatePoolRequest, CreatePoolResponse, CreatePoolClientRequest, CreatePoolClientResponse, HealthcheckResponse, VerifyPasswordRequest, VerifyPasswordResponse, AuthStartLoginRequest, AuthStartLoginResponse, IntrospectRequest, IntrospectResponse } from "@fiado/type-kit/bin/cognitoBackofficeConnector/index.js";
3
3
  /**
4
4
  * Contrato del publisher HTTP del lambda `cognito-backoffice-connector` (componente 05 SureKeep Fase 0).
5
5
  *
@@ -58,6 +58,14 @@ export interface ICognitoBackofficeConnectorApi {
58
58
  * solo un veredicto `{ valid }`. El caller (rbac) NO conoce el mecanismo.
59
59
  */
60
60
  authVerifyPassword(input: VerifyPasswordRequest): Promise<ApiGatewayResponse<VerifyPasswordResponse>>;
61
+ /**
62
+ * POST /auth/start-login — login de un solo flujo (SRP dentro de CUSTOM_AUTH).
63
+ * El connector hace InitiateAuth(CUSTOM_AUTH, SRP_A) y responde PASSWORD_VERIFIER
64
+ * firmado en una sola operacion; la contraseña nunca viaja en claro. Devuelve
65
+ * tokens (2FA apagado) o el challenge pendiente (NEW_PASSWORD_REQUIRED / el
66
+ * CUSTOM_CHALLENGE del 2do factor). El caller (rbac) decide por que rama sigue.
67
+ */
68
+ authStartLogin(input: AuthStartLoginRequest): Promise<ApiGatewayResponse<AuthStartLoginResponse>>;
61
69
  /**
62
70
  * POST /auth/introspect — valida un token (firma + exp + iss + client_id +
63
71
  * token_use) y devuelve `{ valid, cognitoSub?, reason? }`. El connector es
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.110.0",
3
+ "version": "5.111.0",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
5
5
  "type": "module",
6
6
  "main": "bin/index.js",
@@ -31,10 +31,10 @@
31
31
  "license": "ISC",
32
32
  "dependencies": {
33
33
  "@aws-sdk/client-sqs": "^3.919.0",
34
- "@fiado/gateway-adapter": "^3.9.0",
34
+ "@fiado/gateway-adapter": "^3.14.0",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "^3.497.0",
37
+ "@fiado/type-kit": "^3.500.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -38,6 +38,8 @@ import {
38
38
  HealthcheckResponse,
39
39
  VerifyPasswordRequest,
40
40
  VerifyPasswordResponse,
41
+ AuthStartLoginRequest,
42
+ AuthStartLoginResponse,
41
43
  IntrospectRequest,
42
44
  IntrospectResponse,
43
45
  } from "@fiado/type-kit/bin/cognitoBackofficeConnector/index.js";
@@ -190,6 +192,13 @@ export default class CognitoBackofficeConnectorApi implements ICognitoBackoffice
190
192
  return await this.httpRequest.post(url, input);
191
193
  }
192
194
 
195
+ async authStartLogin(
196
+ input: AuthStartLoginRequest,
197
+ ): Promise<ApiGatewayResponse<AuthStartLoginResponse>> {
198
+ const url = `${this.baseUrl}/auth/start-login`;
199
+ return await this.httpRequest.post(url, input);
200
+ }
201
+
193
202
  async introspect(
194
203
  input: IntrospectRequest,
195
204
  ): Promise<ApiGatewayResponse<IntrospectResponse>> {
@@ -36,6 +36,8 @@ import {
36
36
  HealthcheckResponse,
37
37
  VerifyPasswordRequest,
38
38
  VerifyPasswordResponse,
39
+ AuthStartLoginRequest,
40
+ AuthStartLoginResponse,
39
41
  IntrospectRequest,
40
42
  IntrospectResponse,
41
43
  } from "@fiado/type-kit/bin/cognitoBackofficeConnector/index.js";
@@ -141,6 +143,17 @@ export interface ICognitoBackofficeConnectorApi {
141
143
  input: VerifyPasswordRequest,
142
144
  ): Promise<ApiGatewayResponse<VerifyPasswordResponse>>;
143
145
 
146
+ /**
147
+ * POST /auth/start-login — login de un solo flujo (SRP dentro de CUSTOM_AUTH).
148
+ * El connector hace InitiateAuth(CUSTOM_AUTH, SRP_A) y responde PASSWORD_VERIFIER
149
+ * firmado en una sola operacion; la contraseña nunca viaja en claro. Devuelve
150
+ * tokens (2FA apagado) o el challenge pendiente (NEW_PASSWORD_REQUIRED / el
151
+ * CUSTOM_CHALLENGE del 2do factor). El caller (rbac) decide por que rama sigue.
152
+ */
153
+ authStartLogin(
154
+ input: AuthStartLoginRequest,
155
+ ): Promise<ApiGatewayResponse<AuthStartLoginResponse>>;
156
+
144
157
  /**
145
158
  * POST /auth/introspect — valida un token (firma + exp + iss + client_id +
146
159
  * token_use) y devuelve `{ valid, cognitoSub?, reason? }`. El connector es