@fiado/api-invoker 5.13.1 → 5.14.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, ResolvedPermissions, ResolveInput } from "@fiado/gateway-adapter";
3
- import { DefineNextChallengeRequest, DefineNextChallengeResponse, PrepareChallengeRequest, PrepareChallengeResponse, VerifyChallengeRequest, VerifyChallengeResponse, AuthorizeRequest, AuthorizeResponse, EffectivePermissionsResponse, InjectableUserAttributesResponse, PermissionScope, CreateLevelEntityRequest, CreateLevelEntityResponse, CreateTenantUserRequest, CreateTenantUserResponse } from "@fiado/type-kit/bin/platformRbac/index.js";
3
+ import { DefineNextChallengeRequest, DefineNextChallengeResponse, PrepareChallengeRequest, PrepareChallengeResponse, VerifyChallengeRequest, VerifyChallengeResponse, AuthorizeRequest, AuthorizeResponse, EffectivePermissionsResponse, InjectableUserAttributesResponse, PermissionScope, CreateLevelEntityRequest, CreateLevelEntityResponse, CreateTenantUserRequest, CreateTenantUserResponse, UserProfileResponse } from "@fiado/type-kit/bin/platformRbac/index.js";
4
4
  import { IPlatformRbacBusinessApi } from "./interfaces/IPlatformRbacBusinessApi.js";
5
5
  /**
6
6
  * Publisher HTTP del lambda `platform-rbac-business` (componente 06 SureKeep Fase 0)
@@ -28,4 +28,5 @@ export default class PlatformRbacBusinessApi implements IPlatformRbacBusinessApi
28
28
  resolvePermissions(input: ResolveInput): Promise<ApiGatewayResponse<ResolvedPermissions>>;
29
29
  createLevelEntity(tenantId: string, level: PermissionScope, input: CreateLevelEntityRequest): Promise<ApiGatewayResponse<CreateLevelEntityResponse>>;
30
30
  createTenantUser(tenantId: string, input: CreateTenantUserRequest): Promise<ApiGatewayResponse<CreateTenantUserResponse>>;
31
+ getUserProfile(cognitoSub: string, tenantId: string): Promise<ApiGatewayResponse<UserProfileResponse>>;
31
32
  }
@@ -76,6 +76,10 @@ let PlatformRbacBusinessApi = class PlatformRbacBusinessApi {
76
76
  const url = `${this.baseUrl}/internal/tenants/${encodeURIComponent(tenantId)}/users`;
77
77
  return await this.httpRequest.post(url, input);
78
78
  }
79
+ async getUserProfile(cognitoSub, tenantId) {
80
+ const url = `${this.baseUrl}/internal/users/${encodeURIComponent(cognitoSub)}/profile?tenantId=${encodeURIComponent(tenantId)}`;
81
+ return await this.httpRequest.get(url);
82
+ }
79
83
  };
80
84
  PlatformRbacBusinessApi = __decorate([
81
85
  injectable(),
@@ -1,5 +1,5 @@
1
1
  import { ApiGatewayResponse, ResolvedPermissions, ResolveInput } from "@fiado/gateway-adapter";
2
- import { DefineNextChallengeRequest, DefineNextChallengeResponse, PrepareChallengeRequest, PrepareChallengeResponse, VerifyChallengeRequest, VerifyChallengeResponse, AuthorizeRequest, AuthorizeResponse, EffectivePermissionsResponse, InjectableUserAttributesResponse, PermissionScope, CreateLevelEntityRequest, CreateLevelEntityResponse, CreateTenantUserRequest, CreateTenantUserResponse } from "@fiado/type-kit/bin/platformRbac/index.js";
2
+ import { DefineNextChallengeRequest, DefineNextChallengeResponse, PrepareChallengeRequest, PrepareChallengeResponse, VerifyChallengeRequest, VerifyChallengeResponse, AuthorizeRequest, AuthorizeResponse, EffectivePermissionsResponse, InjectableUserAttributesResponse, PermissionScope, CreateLevelEntityRequest, CreateLevelEntityResponse, CreateTenantUserRequest, CreateTenantUserResponse, UserProfileResponse } from "@fiado/type-kit/bin/platformRbac/index.js";
3
3
  /**
4
4
  * Contrato del publisher HTTP del lambda `platform-rbac-business` (componente 06 SureKeep Fase 0)
5
5
  * para los 3 endpoints internos del Custom Auth Challenge flow (MFA).
@@ -75,4 +75,6 @@ export interface IPlatformRbacBusinessApi {
75
75
  * queda INVITED (mitiga orphan) y retail-org guarda el `cognitoSub` retornado. Idempotente por identidad Cognito.
76
76
  */
77
77
  createTenantUser(tenantId: string, input: CreateTenantUserRequest): Promise<ApiGatewayResponse<CreateTenantUserResponse>>;
78
+ /** GET /internal/users/{cognitoSub}/profile?tenantId= — perfil básico del SharedUser (displayName, email, phone, status). */
79
+ getUserProfile(cognitoSub: string, tenantId: string): Promise<ApiGatewayResponse<UserProfileResponse>>;
78
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.13.1",
3
+ "version": "5.14.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",
@@ -34,7 +34,7 @@
34
34
  "@fiado/gateway-adapter": "^3.9.0",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "^3.253.0",
37
+ "@fiado/type-kit": "^3.258.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -18,6 +18,7 @@ import {
18
18
  CreateLevelEntityResponse,
19
19
  CreateTenantUserRequest,
20
20
  CreateTenantUserResponse,
21
+ UserProfileResponse,
21
22
  } from "@fiado/type-kit/bin/platformRbac/index.js";
22
23
  import { IPlatformRbacBusinessApi } from "./interfaces/IPlatformRbacBusinessApi.js";
23
24
 
@@ -117,4 +118,12 @@ export default class PlatformRbacBusinessApi implements IPlatformRbacBusinessApi
117
118
  const url = `${this.baseUrl}/internal/tenants/${encodeURIComponent(tenantId)}/users`;
118
119
  return await this.httpRequest.post(url, input);
119
120
  }
121
+
122
+ async getUserProfile(
123
+ cognitoSub: string,
124
+ tenantId: string,
125
+ ): Promise<ApiGatewayResponse<UserProfileResponse>> {
126
+ const url = `${this.baseUrl}/internal/users/${encodeURIComponent(cognitoSub)}/profile?tenantId=${encodeURIComponent(tenantId)}`;
127
+ return await this.httpRequest.get(url);
128
+ }
120
129
  }
@@ -15,6 +15,7 @@ import {
15
15
  CreateLevelEntityResponse,
16
16
  CreateTenantUserRequest,
17
17
  CreateTenantUserResponse,
18
+ UserProfileResponse,
18
19
  } from "@fiado/type-kit/bin/platformRbac/index.js";
19
20
 
20
21
  /**
@@ -121,4 +122,10 @@ export interface IPlatformRbacBusinessApi {
121
122
  tenantId: string,
122
123
  input: CreateTenantUserRequest,
123
124
  ): Promise<ApiGatewayResponse<CreateTenantUserResponse>>;
125
+
126
+ /** GET /internal/users/{cognitoSub}/profile?tenantId= — perfil básico del SharedUser (displayName, email, phone, status). */
127
+ getUserProfile(
128
+ cognitoSub: string,
129
+ tenantId: string,
130
+ ): Promise<ApiGatewayResponse<UserProfileResponse>>;
124
131
  }