@fiado/api-invoker 5.106.0 → 5.108.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/bin/cognitoBackofficeConnector/api/CognitoBackofficeConnectorApi.d.ts +2 -1
- package/bin/cognitoBackofficeConnector/api/CognitoBackofficeConnectorApi.js +4 -0
- package/bin/cognitoBackofficeConnector/api/interfaces/ICognitoBackofficeConnectorApi.d.ts +3 -1
- package/bin/cognitoConnector/CognitoConnectorApi.d.ts +8 -2
- package/bin/cognitoConnector/CognitoConnectorApi.js +8 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApi.d.ts +7 -0
- package/bin/fiadoMessages/api/FiadoMessagesApi.d.ts +4 -2
- package/bin/fiadoMessages/api/FiadoMessagesApi.js +4 -0
- package/bin/fiadoMessages/api/interfaces/IFiadoMessagesApi.d.ts +21 -0
- package/bin/file-storage/FileStorageApi.d.ts +2 -1
- package/bin/file-storage/FileStorageApi.js +6 -0
- package/bin/file-storage/interfaces/IFileStorageApi.d.ts +10 -0
- package/bin/onboarding/api/OnboardingApi.d.ts +2 -0
- package/bin/onboarding/api/OnboardingApi.js +4 -0
- package/bin/onboarding/api/interfaces/IOnboardingApi.d.ts +2 -0
- package/bin/platformRbac/resolver/ApiInvokerPermissionResolver.d.ts +2 -14
- package/bin/platformRbac/resolver/ApiInvokerPermissionResolver.js +3 -24
- package/package.json +2 -2
- package/src/cognitoBackofficeConnector/api/CognitoBackofficeConnectorApi.ts +10 -0
- package/src/cognitoBackofficeConnector/api/interfaces/ICognitoBackofficeConnectorApi.ts +5 -0
- package/src/cognitoConnector/CognitoConnectorApi.ts +11 -4
- package/src/cognitoConnector/interfaces/ICognitoConnectorApi.ts +8 -0
- package/src/fiadoMessages/api/FiadoMessagesApi.ts +8 -3
- package/src/fiadoMessages/api/interfaces/IFiadoMessagesApi.ts +23 -1
- package/src/file-storage/FileStorageApi.ts +10 -1
- package/src/file-storage/interfaces/IFileStorageApi.ts +8 -0
- package/src/onboarding/api/OnboardingApi.ts +5 -0
- package/src/onboarding/api/interfaces/IOnboardingApi.ts +2 -0
- package/src/platformRbac/resolver/ApiInvokerPermissionResolver.ts +4 -25
|
@@ -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, 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, 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).
|
|
@@ -52,6 +52,7 @@ export default class CognitoBackofficeConnectorApi implements ICognitoBackoffice
|
|
|
52
52
|
updateProfile(input: UpdateProfileRequest): Promise<ApiGatewayResponse<void>>;
|
|
53
53
|
listUserAuthEvents(cognitoSub: string, input: AuthEventsRequest): Promise<ApiGatewayResponse<AuthEventResponse[]>>;
|
|
54
54
|
createPool(input: CreatePoolRequest): Promise<ApiGatewayResponse<CreatePoolResponse>>;
|
|
55
|
+
createPoolClient(userPoolId: string, input: CreatePoolClientRequest): Promise<ApiGatewayResponse<CreatePoolClientResponse>>;
|
|
55
56
|
deletePool(userPoolId: string, region: string): Promise<ApiGatewayResponse<void>>;
|
|
56
57
|
healthcheck(): Promise<ApiGatewayResponse<HealthcheckResponse>>;
|
|
57
58
|
}
|
|
@@ -147,6 +147,10 @@ let CognitoBackofficeConnectorApi = class CognitoBackofficeConnectorApi {
|
|
|
147
147
|
const url = `${this.baseUrl}/pools`;
|
|
148
148
|
return await this.httpRequest.post(url, input);
|
|
149
149
|
}
|
|
150
|
+
async createPoolClient(userPoolId, input) {
|
|
151
|
+
const url = `${this.baseUrl}/pools/${encodeURIComponent(userPoolId)}/clients`;
|
|
152
|
+
return await this.httpRequest.post(url, input);
|
|
153
|
+
}
|
|
150
154
|
async deletePool(userPoolId, region) {
|
|
151
155
|
const url = `${this.baseUrl}/pools/${encodeURIComponent(userPoolId)}`;
|
|
152
156
|
return await this.httpRequest.delete(url, { region });
|
|
@@ -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, 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, 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
|
*
|
|
@@ -93,6 +93,8 @@ export interface ICognitoBackofficeConnectorApi {
|
|
|
93
93
|
* SetUserPoolMfaConfig + CreateUserPoolClient con cleanup chain observable.
|
|
94
94
|
*/
|
|
95
95
|
createPool(input: CreatePoolRequest): Promise<ApiGatewayResponse<CreatePoolResponse>>;
|
|
96
|
+
/** POST /pools/{userPoolId}/clients — app client extra sobre un pool existente (usuarios de API). */
|
|
97
|
+
createPoolClient(userPoolId: string, input: CreatePoolClientRequest): Promise<ApiGatewayResponse<CreatePoolClientResponse>>;
|
|
96
98
|
/**
|
|
97
99
|
* DELETE /pools/{userPoolId}?region=X — elimina un user pool vacío (pivote
|
|
98
100
|
* v1.4.1 — compensation chain de saga). Requiere pool sin users; si tiene
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector/index.js";
|
|
3
|
-
import { ICognitoConnectorApi } from "./interfaces/ICognitoConnectorApi.js";
|
|
3
|
+
import type { CognitoUpdatePhoneNumberRequest, ICognitoConnectorApi } from "./interfaces/ICognitoConnectorApi.js";
|
|
4
4
|
import { TypeOfDirectoryId } from "@fiado/type-kit/bin/directory/index.js";
|
|
5
5
|
export default class CognitoConnectorApi implements ICognitoConnectorApi {
|
|
6
6
|
private httpRequest;
|
|
@@ -15,4 +15,10 @@ export default class CognitoConnectorApi implements ICognitoConnectorApi {
|
|
|
15
15
|
changePassword(input: SetPasswordRequest): Promise<void>;
|
|
16
16
|
respondToNewPasswordChallenge(input: RespondToAuthChallengeRequest): Promise<SignInResponse>;
|
|
17
17
|
resetPassword(username: string, typeOfDirectoryId: string): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Cambia el phone_number de un usuario (PUT cognito/user del conector). Mismo contrato que
|
|
20
|
+
* CognitoAdapter.updateAttribute de fiado-directory-lambda: `username` es el identityId del usuario
|
|
21
|
+
* o, si no lo tiene, su teléfono actual.
|
|
22
|
+
*/
|
|
23
|
+
updatePhoneNumber(input: CognitoUpdatePhoneNumberRequest): Promise<void>;
|
|
18
24
|
}
|
|
@@ -84,6 +84,14 @@ let CognitoConnectorApi = class CognitoConnectorApi {
|
|
|
84
84
|
const url = `${this.baseUrl}cognito/resetPassword`;
|
|
85
85
|
return await this.httpRequest.post(url, { username, typeOfDirectoryId }, { operationName: "postConnectorCognitoResetPassword" });
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Cambia el phone_number de un usuario (PUT cognito/user del conector). Mismo contrato que
|
|
89
|
+
* CognitoAdapter.updateAttribute de fiado-directory-lambda: `username` es el identityId del usuario
|
|
90
|
+
* o, si no lo tiene, su teléfono actual.
|
|
91
|
+
*/
|
|
92
|
+
async updatePhoneNumber(input) {
|
|
93
|
+
await this.httpRequest.put(`${this.baseUrl}cognito/user`, input);
|
|
94
|
+
}
|
|
87
95
|
};
|
|
88
96
|
CognitoConnectorApi = __decorate([
|
|
89
97
|
injectable(),
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector/index.js";
|
|
2
2
|
import { TypeOfDirectoryId } from "@fiado/type-kit/bin/directory/index.js";
|
|
3
|
+
/** Body de PUT cognito/user: `username` es el identityId o, si no hay, el teléfono actual. */
|
|
4
|
+
export interface CognitoUpdatePhoneNumberRequest {
|
|
5
|
+
username: string;
|
|
6
|
+
phoneNumber: string;
|
|
7
|
+
typeOfDirectoryId: TypeOfDirectoryId;
|
|
8
|
+
}
|
|
3
9
|
export interface ICognitoConnectorApi {
|
|
4
10
|
signUp(input: SignUpRequest): Promise<SignUpResponse>;
|
|
5
11
|
signIn(input: SignInRequest): Promise<SignInResponse>;
|
|
@@ -10,4 +16,5 @@ export interface ICognitoConnectorApi {
|
|
|
10
16
|
respondToNewPasswordChallenge(input: RespondToAuthChallengeRequest): Promise<SignInResponse>;
|
|
11
17
|
resetPassword(username: string, typeOfDirectoryId: TypeOfDirectoryId): Promise<void>;
|
|
12
18
|
deleteCognitoUser(identityId: string, typeOfDirectoryId?: TypeOfDirectoryId): Promise<void>;
|
|
19
|
+
updatePhoneNumber(input: CognitoUpdatePhoneNumberRequest): Promise<void>;
|
|
13
20
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { IFiadoMessagesApi } from "./interfaces/IFiadoMessagesApi.js";
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import type { IFiadoMessagesApi, SendMessageRequest } from "./interfaces/IFiadoMessagesApi.js";
|
|
3
3
|
export declare class FiadoMessagesApi implements IFiadoMessagesApi {
|
|
4
4
|
private httpRequest;
|
|
5
5
|
private readonly baseUrl;
|
|
6
6
|
constructor(httpRequest: IHttpRequest);
|
|
7
7
|
getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any>;
|
|
8
|
+
/** Envía un mensaje (SMS, etc.) por fiado-messages-lambda. Mismo contrato que MessageAdapter.sendSMS de fiado-directory-lambda. */
|
|
9
|
+
sendMessage(message: SendMessageRequest): Promise<any>;
|
|
8
10
|
}
|
|
@@ -26,6 +26,10 @@ let FiadoMessagesApi = class FiadoMessagesApi {
|
|
|
26
26
|
};
|
|
27
27
|
return await this.httpRequest.post(`${url}`, request, { 'operationName': operationName });
|
|
28
28
|
}
|
|
29
|
+
/** Envía un mensaje (SMS, etc.) por fiado-messages-lambda. Mismo contrato que MessageAdapter.sendSMS de fiado-directory-lambda. */
|
|
30
|
+
async sendMessage(message) {
|
|
31
|
+
return await this.httpRequest.post(this.baseUrl, message, { operationName: "postSendMessage", app: "USERS_APP" });
|
|
32
|
+
}
|
|
29
33
|
};
|
|
30
34
|
FiadoMessagesApi = __decorate([
|
|
31
35
|
injectable(),
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/** Body de postSendMessage en fiado-messages-lambda (NotificationPush de los lambdas legacy). */
|
|
2
|
+
export interface SendMessageRequest {
|
|
3
|
+
messageType: string;
|
|
4
|
+
channelType: string;
|
|
5
|
+
directoryId: string | null;
|
|
6
|
+
typeOfDirectory: string | null;
|
|
7
|
+
destination: string;
|
|
8
|
+
language: string;
|
|
9
|
+
referenceMessageId: string | null;
|
|
10
|
+
country: string;
|
|
11
|
+
beneficiaryDirectoryId: string | null;
|
|
12
|
+
beneficiaryTypeOfDirectoryId: string | null;
|
|
13
|
+
status: string;
|
|
14
|
+
transactionNumber: string;
|
|
15
|
+
var1: unknown;
|
|
16
|
+
var2: unknown;
|
|
17
|
+
var3: unknown;
|
|
18
|
+
var4: unknown;
|
|
19
|
+
options: unknown;
|
|
20
|
+
}
|
|
1
21
|
export interface IFiadoMessagesApi {
|
|
2
22
|
getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any>;
|
|
23
|
+
sendMessage(message: SendMessageRequest): Promise<any>;
|
|
3
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import type { UserDocumentItem } from "@fiado/type-kit/bin/fileStorage/index.js";
|
|
3
|
-
import type { IFileStorageApi } from "./interfaces/IFileStorageApi.js";
|
|
3
|
+
import type { IFileStorageApi, SaveFilesRequest } from "./interfaces/IFileStorageApi.js";
|
|
4
4
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
5
5
|
export declare class FileStorageApi implements IFileStorageApi {
|
|
6
6
|
private readonly httpRequest;
|
|
@@ -11,5 +11,6 @@ export declare class FileStorageApi implements IFileStorageApi {
|
|
|
11
11
|
getUserDocumentSignUrl(key: string): Promise<FiadoApiResponse<{
|
|
12
12
|
url: string;
|
|
13
13
|
}>>;
|
|
14
|
+
saveFiles(request: SaveFilesRequest): Promise<FiadoApiResponse<unknown>>;
|
|
14
15
|
}
|
|
15
16
|
export {};
|
|
@@ -37,6 +37,12 @@ let FileStorageApi = class FileStorageApi {
|
|
|
37
37
|
}
|
|
38
38
|
return await this.httpRequest.post(this.baseUrl, { key }, { operationName: "getUserDocumentSignUrl" });
|
|
39
39
|
}
|
|
40
|
+
async saveFiles(request) {
|
|
41
|
+
if (!request?.path || !request.files?.length) {
|
|
42
|
+
throw new Error("path and at least one file are required.");
|
|
43
|
+
}
|
|
44
|
+
return await this.httpRequest.post(this.baseUrl, request, { operationName: "postDocumentCheck" });
|
|
45
|
+
}
|
|
40
46
|
};
|
|
41
47
|
FileStorageApi = __decorate([
|
|
42
48
|
injectable(),
|
|
@@ -4,6 +4,14 @@ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApi
|
|
|
4
4
|
* Cliente de fiado-s3-lambda (documentos de usuario en S3). Una sola ruta POST; la operación viaja en el
|
|
5
5
|
* header `operationName`. Mismo contrato que consumía el S3Adapter de fiado-identity-lambda.
|
|
6
6
|
*/
|
|
7
|
+
/** Archivos en base64 (sin el prefijo `data:...;base64,`) a guardar bajo `path`, p. ej. `USER/{directoryId}`. */
|
|
8
|
+
export interface SaveFilesRequest {
|
|
9
|
+
path: string;
|
|
10
|
+
files: Array<{
|
|
11
|
+
fileName: string;
|
|
12
|
+
content: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
7
15
|
export interface IFileStorageApi {
|
|
8
16
|
/** Lista los objetos bajo un prefijo, p. ej. `USER/{directoryId}`. Devuelve key completa, lastModified, sizeKb y url firmada. */
|
|
9
17
|
listDirectoryDocuments(directory: string): Promise<FiadoApiResponse<UserDocumentItem[]>>;
|
|
@@ -13,5 +21,7 @@ export interface IFileStorageApi {
|
|
|
13
21
|
getUserDocumentSignUrl(key: string): Promise<FiadoApiResponse<{
|
|
14
22
|
url: string;
|
|
15
23
|
}>>;
|
|
24
|
+
/** Guarda archivos (operación postDocumentCheck). Mismo contrato que DocumentAdapter.saveFileToS3 de fiado-directory-lambda. */
|
|
25
|
+
saveFiles(request: SaveFilesRequest): Promise<FiadoApiResponse<unknown>>;
|
|
16
26
|
}
|
|
17
27
|
export {};
|
|
@@ -9,4 +9,6 @@ export default class OnboardingApi implements IOnboardingApi {
|
|
|
9
9
|
getOnboardingSteps(directoryId: string, countryId: string): Promise<OnboardingStepsEnvelope>;
|
|
10
10
|
/** Onboardings por lote de fiado-onboarding-lambda (GET ids?directoryId=...). Lo usa la actividad diaria del backoffice. */
|
|
11
11
|
getByIds(directoryIds: string[]): Promise<any>;
|
|
12
|
+
/** Cambia el teléfono del onboarding (PUT raíz de fiado-onboarding-lambda). Lo usa el cambio de teléfono del backoffice. */
|
|
13
|
+
updatePhoneNumber(directoryId: string, phoneNumber: string): Promise<any>;
|
|
12
14
|
}
|
|
@@ -37,6 +37,10 @@ let OnboardingApi = class OnboardingApi {
|
|
|
37
37
|
const query = directoryIds.map((id) => `directoryId=${encodeURIComponent(id)}`).join("&");
|
|
38
38
|
return await this.httpRequest.get(`${this.baseUrl}ids?${query}`);
|
|
39
39
|
}
|
|
40
|
+
/** Cambia el teléfono del onboarding (PUT raíz de fiado-onboarding-lambda). Lo usa el cambio de teléfono del backoffice. */
|
|
41
|
+
async updatePhoneNumber(directoryId, phoneNumber) {
|
|
42
|
+
return await this.httpRequest.put(this.baseUrl, { directoryId, phoneNumber });
|
|
43
|
+
}
|
|
40
44
|
};
|
|
41
45
|
OnboardingApi = __decorate([
|
|
42
46
|
injectable(),
|
|
@@ -12,4 +12,6 @@ export interface IOnboardingApi {
|
|
|
12
12
|
getOnboardingSteps(directoryId: string, countryId: string): Promise<OnboardingStepsEnvelope>;
|
|
13
13
|
/** Onboardings por lote (envelope con data: onboarding[] con id = directoryId y referralCode). */
|
|
14
14
|
getByIds(directoryIds: string[]): Promise<any>;
|
|
15
|
+
/** PUT raíz de fiado-onboarding-lambda con {directoryId, phoneNumber}. */
|
|
16
|
+
updatePhoneNumber(directoryId: string, phoneNumber: string): Promise<any>;
|
|
15
17
|
}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import type { ResolveInput, ResolvedPermissions } from "@fiado/gateway-adapter";
|
|
2
2
|
import type { IPlatformRbacBusinessApi } from "../api/interfaces/IPlatformRbacBusinessApi.js";
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* tipado (HTTP sobre VpcEndpoint), reemplazando la lectura directa de DDB. Cachea la rama fallback;
|
|
6
|
-
* la rama token-trust NO se cachea (paridad con DdbPermissionResolver, evita poisoning).
|
|
7
|
-
* Cache key = `${issuer}#${cognitoSub}` (decisión consciente: el cliente no conoce el tenantId antes
|
|
8
|
-
* de invocar; issuer<->tenantId mapean 1:1 vía el pool).
|
|
9
|
-
*
|
|
10
|
-
* NOTA (TD-AI-002): `@fiado/gateway-adapter` NO re-exporta el tipo `IPermissionResolver` desde su
|
|
11
|
-
* barrel (`bin/index.d.ts` solo expone ResolveInput/ResolvedPermissions/ScopedAssignment/PERMISSION_RESOLVER)
|
|
12
|
-
* y su `exports` map bloquea el deep-import del sub-path bajo nodenext. Por eso esta clase implementa
|
|
13
|
-
* el contrato ESTRUCTURALMENTE (`resolve(input): Promise<ResolvedPermissions>`) sin la cláusula
|
|
14
|
-
* `implements IPermissionResolver`. TypeScript es structural-typed: la instancia es asignable al
|
|
15
|
-
* símbolo PERMISSION_RESOLVER en el binding. Ver docs/TECH_DEBT.md.
|
|
16
|
-
*/
|
|
3
|
+
/** Resuelve permisos vía el endpoint privado de rbac-business y cachea solo el fallback (sin roles del token).
|
|
4
|
+
* Llave de caché: `${principalType}#${issuer}#${cognitoSub}`. */
|
|
17
5
|
export declare class ApiInvokerPermissionResolver {
|
|
18
6
|
private readonly _api;
|
|
19
7
|
private readonly _cache;
|
|
@@ -12,20 +12,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
};
|
|
13
13
|
import { injectable, inject } from "inversify";
|
|
14
14
|
import { TtlCache } from "@fiado/gateway-adapter";
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* tipado (HTTP sobre VpcEndpoint), reemplazando la lectura directa de DDB. Cachea la rama fallback;
|
|
18
|
-
* la rama token-trust NO se cachea (paridad con DdbPermissionResolver, evita poisoning).
|
|
19
|
-
* Cache key = `${issuer}#${cognitoSub}` (decisión consciente: el cliente no conoce el tenantId antes
|
|
20
|
-
* de invocar; issuer<->tenantId mapean 1:1 vía el pool).
|
|
21
|
-
*
|
|
22
|
-
* NOTA (TD-AI-002): `@fiado/gateway-adapter` NO re-exporta el tipo `IPermissionResolver` desde su
|
|
23
|
-
* barrel (`bin/index.d.ts` solo expone ResolveInput/ResolvedPermissions/ScopedAssignment/PERMISSION_RESOLVER)
|
|
24
|
-
* y su `exports` map bloquea el deep-import del sub-path bajo nodenext. Por eso esta clase implementa
|
|
25
|
-
* el contrato ESTRUCTURALMENTE (`resolve(input): Promise<ResolvedPermissions>`) sin la cláusula
|
|
26
|
-
* `implements IPermissionResolver`. TypeScript es structural-typed: la instancia es asignable al
|
|
27
|
-
* símbolo PERMISSION_RESOLVER en el binding. Ver docs/TECH_DEBT.md.
|
|
28
|
-
*/
|
|
15
|
+
/** Resuelve permisos vía el endpoint privado de rbac-business y cachea solo el fallback (sin roles del token).
|
|
16
|
+
* Llave de caché: `${principalType}#${issuer}#${cognitoSub}`. */
|
|
29
17
|
let ApiInvokerPermissionResolver = class ApiInvokerPermissionResolver {
|
|
30
18
|
_api;
|
|
31
19
|
_cache;
|
|
@@ -38,16 +26,7 @@ let ApiInvokerPermissionResolver = class ApiInvokerPermissionResolver {
|
|
|
38
26
|
}
|
|
39
27
|
async resolve(input) {
|
|
40
28
|
const cacheable = input.roleAssignmentsFromToken === undefined;
|
|
41
|
-
//
|
|
42
|
-
// —los subs de integración llevan prefijo `INT#` y no chocan con un UUID de Cognito— sino
|
|
43
|
-
// para que el canal quede explícito y un cambio futuro de formato no cause aliasing
|
|
44
|
-
// silencioso entre un usuario y una integración.
|
|
45
|
-
//
|
|
46
|
-
// Se lee con cast en vez de tiparlo desde `ResolveInput` A PROPÓSITO: `principalType` recién
|
|
47
|
-
// existe en `@fiado/gateway-adapter` 4.x, y esta lib la consume toda la flota. Atarla al
|
|
48
|
-
// prerelease obligaría a todos a subir de major. Así compila igual contra 3.x y 4.x, y el
|
|
49
|
-
// reenvío al endpoint privado funciona en runtime porque `resolvePermissions(input)` manda
|
|
50
|
-
// el objeto entero sin filtrar campos.
|
|
29
|
+
// El tipo de principal va en la llave: USER, INTEGRATION y API_USER nunca comparten entrada.
|
|
51
30
|
const principalType = input.principalType ?? "USER";
|
|
52
31
|
const key = `${principalType}#${input.issuer ?? ""}#${input.cognitoSub}`;
|
|
53
32
|
if (cacheable) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.108.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.
|
|
37
|
+
"@fiado/type-kit": "^3.488.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -32,6 +32,8 @@ import {
|
|
|
32
32
|
UpdateProfileRequest,
|
|
33
33
|
CreatePoolRequest,
|
|
34
34
|
CreatePoolResponse,
|
|
35
|
+
CreatePoolClientRequest,
|
|
36
|
+
CreatePoolClientResponse,
|
|
35
37
|
DeletePoolRequest,
|
|
36
38
|
HealthcheckResponse,
|
|
37
39
|
VerifyPasswordRequest,
|
|
@@ -269,6 +271,14 @@ export default class CognitoBackofficeConnectorApi implements ICognitoBackoffice
|
|
|
269
271
|
return await this.httpRequest.post(url, input);
|
|
270
272
|
}
|
|
271
273
|
|
|
274
|
+
async createPoolClient(
|
|
275
|
+
userPoolId: string,
|
|
276
|
+
input: CreatePoolClientRequest,
|
|
277
|
+
): Promise<ApiGatewayResponse<CreatePoolClientResponse>> {
|
|
278
|
+
const url = `${this.baseUrl}/pools/${encodeURIComponent(userPoolId)}/clients`;
|
|
279
|
+
return await this.httpRequest.post(url, input);
|
|
280
|
+
}
|
|
281
|
+
|
|
272
282
|
async deletePool(userPoolId: string, region: string): Promise<ApiGatewayResponse<void>> {
|
|
273
283
|
const url = `${this.baseUrl}/pools/${encodeURIComponent(userPoolId)}`;
|
|
274
284
|
return await this.httpRequest.delete(url, { region });
|
|
@@ -30,6 +30,8 @@ import {
|
|
|
30
30
|
UpdateProfileRequest,
|
|
31
31
|
CreatePoolRequest,
|
|
32
32
|
CreatePoolResponse,
|
|
33
|
+
CreatePoolClientRequest,
|
|
34
|
+
CreatePoolClientResponse,
|
|
33
35
|
DeletePoolRequest,
|
|
34
36
|
HealthcheckResponse,
|
|
35
37
|
VerifyPasswordRequest,
|
|
@@ -203,6 +205,9 @@ export interface ICognitoBackofficeConnectorApi {
|
|
|
203
205
|
*/
|
|
204
206
|
createPool(input: CreatePoolRequest): Promise<ApiGatewayResponse<CreatePoolResponse>>;
|
|
205
207
|
|
|
208
|
+
/** POST /pools/{userPoolId}/clients — app client extra sobre un pool existente (usuarios de API). */
|
|
209
|
+
createPoolClient(userPoolId: string, input: CreatePoolClientRequest): Promise<ApiGatewayResponse<CreatePoolClientResponse>>;
|
|
210
|
+
|
|
206
211
|
/**
|
|
207
212
|
* DELETE /pools/{userPoolId}?region=X — elimina un user pool vacío (pivote
|
|
208
213
|
* v1.4.1 — compensation chain de saga). Requiere pool sin users; si tiene
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector/index.js";
|
|
3
3
|
import { inject, injectable } from "inversify";
|
|
4
|
-
import { ICognitoConnectorApi } from "./interfaces/ICognitoConnectorApi.js";
|
|
4
|
+
import type { CognitoUpdatePhoneNumberRequest, ICognitoConnectorApi } from "./interfaces/ICognitoConnectorApi.js";
|
|
5
5
|
import { TypeOfDirectoryId } from "@fiado/type-kit/bin/directory/index.js";
|
|
6
6
|
|
|
7
7
|
@injectable()
|
|
@@ -107,6 +107,13 @@ export default class CognitoConnectorApi implements ICognitoConnectorApi {
|
|
|
107
107
|
const url = `${this.baseUrl}cognito/resetPassword`;
|
|
108
108
|
return await this.httpRequest.post(url, { username, typeOfDirectoryId }, { operationName: "postConnectorCognitoResetPassword" });
|
|
109
109
|
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Cambia el phone_number de un usuario (PUT cognito/user del conector). Mismo contrato que
|
|
113
|
+
* CognitoAdapter.updateAttribute de fiado-directory-lambda: `username` es el identityId del usuario
|
|
114
|
+
* o, si no lo tiene, su teléfono actual.
|
|
115
|
+
*/
|
|
116
|
+
async updatePhoneNumber(input: CognitoUpdatePhoneNumberRequest): Promise<void> {
|
|
117
|
+
await this.httpRequest.put(`${this.baseUrl}cognito/user`, input);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -3,6 +3,13 @@ import { TypeOfDirectoryId } from "@fiado/type-kit/bin/directory/index.js";
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
/** Body de PUT cognito/user: `username` es el identityId o, si no hay, el teléfono actual. */
|
|
7
|
+
export interface CognitoUpdatePhoneNumberRequest {
|
|
8
|
+
username: string;
|
|
9
|
+
phoneNumber: string;
|
|
10
|
+
typeOfDirectoryId: TypeOfDirectoryId;
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
export interface ICognitoConnectorApi {
|
|
7
14
|
|
|
8
15
|
signUp(input: SignUpRequest): Promise<SignUpResponse>;
|
|
@@ -14,4 +21,5 @@ export interface ICognitoConnectorApi {
|
|
|
14
21
|
respondToNewPasswordChallenge(input: RespondToAuthChallengeRequest): Promise<SignInResponse>;
|
|
15
22
|
resetPassword(username: string, typeOfDirectoryId: TypeOfDirectoryId): Promise<void>;
|
|
16
23
|
deleteCognitoUser(identityId: string, typeOfDirectoryId?: TypeOfDirectoryId): Promise<void>;
|
|
24
|
+
updatePhoneNumber(input: CognitoUpdatePhoneNumberRequest): Promise<void>;
|
|
17
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {inject, injectable} from "inversify";
|
|
2
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
3
|
-
import {IFiadoMessagesApi} from "./interfaces/IFiadoMessagesApi.js";
|
|
2
|
+
import type {IHttpRequest} from "@fiado/http-client";
|
|
3
|
+
import type {IFiadoMessagesApi, SendMessageRequest} from "./interfaces/IFiadoMessagesApi.js";
|
|
4
4
|
|
|
5
5
|
@injectable()
|
|
6
6
|
export class FiadoMessagesApi implements IFiadoMessagesApi {
|
|
@@ -18,4 +18,9 @@ export class FiadoMessagesApi implements IFiadoMessagesApi {
|
|
|
18
18
|
};
|
|
19
19
|
return await this.httpRequest.post(`${url}`, request, {'operationName': operationName});
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
/** Envía un mensaje (SMS, etc.) por fiado-messages-lambda. Mismo contrato que MessageAdapter.sendSMS de fiado-directory-lambda. */
|
|
23
|
+
async sendMessage(message: SendMessageRequest): Promise<any> {
|
|
24
|
+
return await this.httpRequest.post(this.baseUrl, message, { operationName: "postSendMessage", app: "USERS_APP" });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/** Body de postSendMessage en fiado-messages-lambda (NotificationPush de los lambdas legacy). */
|
|
2
|
+
export interface SendMessageRequest {
|
|
3
|
+
messageType: string;
|
|
4
|
+
channelType: string;
|
|
5
|
+
directoryId: string | null;
|
|
6
|
+
typeOfDirectory: string | null;
|
|
7
|
+
destination: string;
|
|
8
|
+
language: string;
|
|
9
|
+
referenceMessageId: string | null;
|
|
10
|
+
country: string;
|
|
11
|
+
beneficiaryDirectoryId: string | null;
|
|
12
|
+
beneficiaryTypeOfDirectoryId: string | null;
|
|
13
|
+
status: string;
|
|
14
|
+
transactionNumber: string;
|
|
15
|
+
var1: unknown;
|
|
16
|
+
var2: unknown;
|
|
17
|
+
var3: unknown;
|
|
18
|
+
var4: unknown;
|
|
19
|
+
options: unknown;
|
|
20
|
+
}
|
|
21
|
+
|
|
1
22
|
export interface IFiadoMessagesApi {
|
|
2
23
|
getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any>;
|
|
3
|
-
|
|
24
|
+
sendMessage(message: SendMessageRequest): Promise<any>;
|
|
25
|
+
}
|
|
@@ -2,7 +2,7 @@ import { inject, injectable } from "inversify";
|
|
|
2
2
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import dotenv from "dotenv";
|
|
4
4
|
import type { UserDocumentItem } from "@fiado/type-kit/bin/fileStorage/index.js";
|
|
5
|
-
import type { IFileStorageApi } from "./interfaces/IFileStorageApi.js";
|
|
5
|
+
import type { IFileStorageApi, SaveFilesRequest } from "./interfaces/IFileStorageApi.js";
|
|
6
6
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
7
7
|
|
|
8
8
|
dotenv.config();
|
|
@@ -40,4 +40,13 @@ export class FileStorageApi implements IFileStorageApi {
|
|
|
40
40
|
this.baseUrl, { key }, { operationName: "getUserDocumentSignUrl" },
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
async saveFiles(request: SaveFilesRequest): Promise<FiadoApiResponse<unknown>> {
|
|
45
|
+
if (!request?.path || !request.files?.length) {
|
|
46
|
+
throw new Error("path and at least one file are required.");
|
|
47
|
+
}
|
|
48
|
+
return await this.httpRequest.post<FiadoApiResponse<unknown>>(
|
|
49
|
+
this.baseUrl, request, { operationName: "postDocumentCheck" },
|
|
50
|
+
);
|
|
51
|
+
}
|
|
43
52
|
}
|
|
@@ -5,6 +5,12 @@ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApi
|
|
|
5
5
|
* Cliente de fiado-s3-lambda (documentos de usuario en S3). Una sola ruta POST; la operación viaja en el
|
|
6
6
|
* header `operationName`. Mismo contrato que consumía el S3Adapter de fiado-identity-lambda.
|
|
7
7
|
*/
|
|
8
|
+
/** Archivos en base64 (sin el prefijo `data:...;base64,`) a guardar bajo `path`, p. ej. `USER/{directoryId}`. */
|
|
9
|
+
export interface SaveFilesRequest {
|
|
10
|
+
path: string;
|
|
11
|
+
files: Array<{ fileName: string; content: string }>;
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
export interface IFileStorageApi {
|
|
9
15
|
/** Lista los objetos bajo un prefijo, p. ej. `USER/{directoryId}`. Devuelve key completa, lastModified, sizeKb y url firmada. */
|
|
10
16
|
listDirectoryDocuments(directory: string): Promise<FiadoApiResponse<UserDocumentItem[]>>;
|
|
@@ -12,4 +18,6 @@ export interface IFileStorageApi {
|
|
|
12
18
|
deleteUserDocument(fileName: string): Promise<FiadoApiResponse<void>>;
|
|
13
19
|
/** URL firmada de lectura para una key completa. */
|
|
14
20
|
getUserDocumentSignUrl(key: string): Promise<FiadoApiResponse<{ url: string }>>;
|
|
21
|
+
/** Guarda archivos (operación postDocumentCheck). Mismo contrato que DocumentAdapter.saveFileToS3 de fiado-directory-lambda. */
|
|
22
|
+
saveFiles(request: SaveFilesRequest): Promise<FiadoApiResponse<unknown>>;
|
|
15
23
|
}
|
|
@@ -33,4 +33,9 @@ export default class OnboardingApi implements IOnboardingApi {
|
|
|
33
33
|
const query = directoryIds.map((id) => `directoryId=${encodeURIComponent(id)}`).join("&");
|
|
34
34
|
return await this.httpRequest.get(`${this.baseUrl}ids?${query}`);
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
/** Cambia el teléfono del onboarding (PUT raíz de fiado-onboarding-lambda). Lo usa el cambio de teléfono del backoffice. */
|
|
38
|
+
async updatePhoneNumber(directoryId: string, phoneNumber: string): Promise<any> {
|
|
39
|
+
return await this.httpRequest.put(this.baseUrl, { directoryId, phoneNumber });
|
|
40
|
+
}
|
|
36
41
|
}
|
|
@@ -14,5 +14,7 @@ export interface IOnboardingApi {
|
|
|
14
14
|
|
|
15
15
|
/** Onboardings por lote (envelope con data: onboarding[] con id = directoryId y referralCode). */
|
|
16
16
|
getByIds(directoryIds: string[]): Promise<any>;
|
|
17
|
+
/** PUT raíz de fiado-onboarding-lambda con {directoryId, phoneNumber}. */
|
|
18
|
+
updatePhoneNumber(directoryId: string, phoneNumber: string): Promise<any>;
|
|
17
19
|
|
|
18
20
|
}
|
|
@@ -3,20 +3,8 @@ import type { ResolveInput, ResolvedPermissions } from "@fiado/gateway-adapter";
|
|
|
3
3
|
import { TtlCache } from "@fiado/gateway-adapter";
|
|
4
4
|
import type { IPlatformRbacBusinessApi } from "../api/interfaces/IPlatformRbacBusinessApi.js";
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* tipado (HTTP sobre VpcEndpoint), reemplazando la lectura directa de DDB. Cachea la rama fallback;
|
|
9
|
-
* la rama token-trust NO se cachea (paridad con DdbPermissionResolver, evita poisoning).
|
|
10
|
-
* Cache key = `${issuer}#${cognitoSub}` (decisión consciente: el cliente no conoce el tenantId antes
|
|
11
|
-
* de invocar; issuer<->tenantId mapean 1:1 vía el pool).
|
|
12
|
-
*
|
|
13
|
-
* NOTA (TD-AI-002): `@fiado/gateway-adapter` NO re-exporta el tipo `IPermissionResolver` desde su
|
|
14
|
-
* barrel (`bin/index.d.ts` solo expone ResolveInput/ResolvedPermissions/ScopedAssignment/PERMISSION_RESOLVER)
|
|
15
|
-
* y su `exports` map bloquea el deep-import del sub-path bajo nodenext. Por eso esta clase implementa
|
|
16
|
-
* el contrato ESTRUCTURALMENTE (`resolve(input): Promise<ResolvedPermissions>`) sin la cláusula
|
|
17
|
-
* `implements IPermissionResolver`. TypeScript es structural-typed: la instancia es asignable al
|
|
18
|
-
* símbolo PERMISSION_RESOLVER en el binding. Ver docs/TECH_DEBT.md.
|
|
19
|
-
*/
|
|
6
|
+
/** Resuelve permisos vía el endpoint privado de rbac-business y cachea solo el fallback (sin roles del token).
|
|
7
|
+
* Llave de caché: `${principalType}#${issuer}#${cognitoSub}`. */
|
|
20
8
|
@injectable()
|
|
21
9
|
export class ApiInvokerPermissionResolver {
|
|
22
10
|
private readonly _cache: TtlCache<ResolvedPermissions>;
|
|
@@ -31,17 +19,8 @@ export class ApiInvokerPermissionResolver {
|
|
|
31
19
|
}
|
|
32
20
|
async resolve(input: ResolveInput): Promise<ResolvedPermissions> {
|
|
33
21
|
const cacheable = input.roleAssignmentsFromToken === undefined;
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
// para que el canal quede explícito y un cambio futuro de formato no cause aliasing
|
|
37
|
-
// silencioso entre un usuario y una integración.
|
|
38
|
-
//
|
|
39
|
-
// Se lee con cast en vez de tiparlo desde `ResolveInput` A PROPÓSITO: `principalType` recién
|
|
40
|
-
// existe en `@fiado/gateway-adapter` 4.x, y esta lib la consume toda la flota. Atarla al
|
|
41
|
-
// prerelease obligaría a todos a subir de major. Así compila igual contra 3.x y 4.x, y el
|
|
42
|
-
// reenvío al endpoint privado funciona en runtime porque `resolvePermissions(input)` manda
|
|
43
|
-
// el objeto entero sin filtrar campos.
|
|
44
|
-
const principalType = (input as { principalType?: string }).principalType ?? "USER";
|
|
22
|
+
// El tipo de principal va en la llave: USER, INTEGRATION y API_USER nunca comparten entrada.
|
|
23
|
+
const principalType = input.principalType ?? "USER";
|
|
45
24
|
const key = `${principalType}#${input.issuer ?? ""}#${input.cognitoSub}`;
|
|
46
25
|
if (cacheable) {
|
|
47
26
|
const hit = this._cache.get(key);
|