@fiado/api-invoker 4.50.0 → 4.52.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/authentication/AuthenticationApi.d.ts +6 -2
- package/bin/authentication/AuthenticationApi.js +18 -0
- package/bin/authentication/interfaces/IAuthenticationApi.d.ts +24 -0
- package/bin/authentication/interfaces/LegacyApiResponse.d.ts +7 -0
- package/bin/authentication/interfaces/LegacyApiResponse.js +1 -0
- package/bin/identity/IdentityApi.d.ts +3 -1
- package/bin/identity/IdentityApi.js +14 -0
- package/bin/identity/interfaces/IIdentityApi.d.ts +4 -0
- package/package.json +1 -1
- package/src/authentication/AuthenticationApi.ts +29 -3
- package/src/authentication/index.ts +1 -4
- package/src/authentication/interfaces/IAuthenticationApi.ts +41 -1
- package/src/authentication/interfaces/LegacyApiResponse.ts +11 -0
- package/src/identity/IdentityApi.ts +17 -1
- package/src/identity/interfaces/IIdentityApi.ts +4 -0
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { SignUpAdditionalRequest, SignUpUserBackofficeRequest } from "@fiado/type-kit/bin/authentication/index.js";
|
|
3
|
-
import { IAuthenticationApi } from "./interfaces/IAuthenticationApi.js";
|
|
3
|
+
import { AgentSignInStatusInput, AgentSignUpProspectInput, IAuthenticationApi } from "./interfaces/IAuthenticationApi.js";
|
|
4
|
+
import { LegacyApiResponse } from "./interfaces/LegacyApiResponse.js";
|
|
4
5
|
export declare class AuthenticationApi implements IAuthenticationApi {
|
|
5
6
|
private httpRequest;
|
|
6
7
|
constructor(httpRequest: IHttpRequest);
|
|
7
8
|
signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any>;
|
|
8
9
|
deleteAuthSessionByDirectoryId(directoryId: string): Promise<any>;
|
|
9
10
|
signUpBackofficeBulk(input: SignUpUserBackofficeRequest[]): Promise<any>;
|
|
11
|
+
agentSignInStatus(input: AgentSignInStatusInput, actorEmail: string): Promise<LegacyApiResponse<unknown>>;
|
|
12
|
+
agentSignUpProspect(input: AgentSignUpProspectInput, actorEmail: string): Promise<LegacyApiResponse<unknown>>;
|
|
13
|
+
agentGetSignUpByPhone(phoneNumber: string): Promise<LegacyApiResponse<unknown>>;
|
|
10
14
|
}
|
|
@@ -31,6 +31,24 @@ let AuthenticationApi = class AuthenticationApi {
|
|
|
31
31
|
const operation = "postSignUpBackofficeBulk";
|
|
32
32
|
return await this.httpRequest.post(url, input, { 'operationName': operation });
|
|
33
33
|
}
|
|
34
|
+
async agentSignInStatus(input, actorEmail) {
|
|
35
|
+
const url = `${process.env.AUTH_LAMBDA_URL}`;
|
|
36
|
+
const operation = "postSignInPhoneNumberAgent";
|
|
37
|
+
return await this.httpRequest.post(url, { ...input, actorEmail }, { 'operationName': operation });
|
|
38
|
+
}
|
|
39
|
+
async agentSignUpProspect(input, actorEmail) {
|
|
40
|
+
const url = `${process.env.AUTH_LAMBDA_URL}`;
|
|
41
|
+
const operation = "agentPostSignUp";
|
|
42
|
+
return await this.httpRequest.post(url, { ...input, actorEmail }, { 'operationName': operation });
|
|
43
|
+
}
|
|
44
|
+
async agentGetSignUpByPhone(phoneNumber) {
|
|
45
|
+
if (!phoneNumber) {
|
|
46
|
+
throw new Error("phoneNumber is required.");
|
|
47
|
+
}
|
|
48
|
+
const url = `${process.env.AUTH_LAMBDA_URL}`;
|
|
49
|
+
const operation = "agentGetSignUpByPhoneNumber";
|
|
50
|
+
return await this.httpRequest.post(url, { pathParameters: { phoneNumber } }, { 'operationName': operation });
|
|
51
|
+
}
|
|
34
52
|
};
|
|
35
53
|
AuthenticationApi = __decorate([
|
|
36
54
|
injectable(),
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { DirectoryBatchSummaryResponse, SignUpAdditionalRequest, SignUpUserBackofficeRequest } from "@fiado/type-kit/bin/authentication/index.js";
|
|
2
|
+
import { LegacyApiResponse } from "./LegacyApiResponse.js";
|
|
3
|
+
export interface AgentSignInStatusInput {
|
|
4
|
+
phoneNumber: string;
|
|
5
|
+
app: string;
|
|
6
|
+
platform: string;
|
|
7
|
+
version: string;
|
|
8
|
+
ip?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AgentSignUpProspectInput {
|
|
11
|
+
name: string;
|
|
12
|
+
phoneNumber: string;
|
|
13
|
+
countryOfBirth: string;
|
|
14
|
+
countryOfDomicile: string;
|
|
15
|
+
email: string;
|
|
16
|
+
secondaryPhoneNumber?: string;
|
|
17
|
+
referralCode?: string | null;
|
|
18
|
+
stateOfBirth?: string | null;
|
|
19
|
+
otpCode?: string | null;
|
|
20
|
+
MEX_DebitAccountWish?: boolean;
|
|
21
|
+
USA_DebitAccountWish?: boolean;
|
|
22
|
+
}
|
|
2
23
|
export interface IAuthenticationApi {
|
|
3
24
|
signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any>;
|
|
4
25
|
deleteAuthSessionByDirectoryId(directoryId: string): Promise<any>;
|
|
5
26
|
signUpBackofficeBulk(input: SignUpUserBackofficeRequest[]): Promise<DirectoryBatchSummaryResponse>;
|
|
27
|
+
agentSignInStatus(input: AgentSignInStatusInput, actorEmail: string): Promise<LegacyApiResponse<unknown>>;
|
|
28
|
+
agentSignUpProspect(input: AgentSignUpProspectInput, actorEmail: string): Promise<LegacyApiResponse<unknown>>;
|
|
29
|
+
agentGetSignUpByPhone(phoneNumber: string): Promise<LegacyApiResponse<unknown>>;
|
|
6
30
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IIdentityApi } from "./interfaces/IIdentityApi.js";
|
|
2
2
|
import { LegacyApiResponse } from "./interfaces/LegacyApiResponse.js";
|
|
3
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
4
4
|
import { PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse, PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse } from "@fiado/type-kit/bin/identity/index.js";
|
|
5
5
|
export declare class IdentityApi implements IIdentityApi {
|
|
6
6
|
private httpRequest;
|
|
@@ -18,4 +18,6 @@ export declare class IdentityApi implements IIdentityApi {
|
|
|
18
18
|
privateGetLastAgentDocument(directoryId: string): Promise<LegacyApiResponse<AgentDocumentKeyResponse[]>>;
|
|
19
19
|
privateUploadAgentDocument(directoryId: string, actorDirectoryId: string, document: UploadDocumentRequest): Promise<LegacyApiResponse<DocumentUploadResponse>>;
|
|
20
20
|
privateUpdatePeopleSelfVerified(directoryId: string, data: PeopleSelfVerifiedRequest): Promise<LegacyApiResponse<unknown>>;
|
|
21
|
+
privateSearchPeople(fullName: string): Promise<LegacyApiResponse<PeopleResponse[]>>;
|
|
22
|
+
privateUpdatePeople(directoryId: string, data: PeopleUpdateRequest): Promise<LegacyApiResponse<unknown>>;
|
|
21
23
|
}
|
|
@@ -109,6 +109,20 @@ let IdentityApi = class IdentityApi {
|
|
|
109
109
|
const url = `${this.baseUrl}identities/private/agents/people/${directoryId}/selfverified`;
|
|
110
110
|
return await this.httpRequest.put(url, data);
|
|
111
111
|
}
|
|
112
|
+
async privateSearchPeople(fullName) {
|
|
113
|
+
if (!fullName || !fullName.trim()) {
|
|
114
|
+
throw new Error("fullName is required.");
|
|
115
|
+
}
|
|
116
|
+
const url = `${this.baseUrl}identities/people/search?fullName=${encodeURIComponent(fullName)}`;
|
|
117
|
+
return await this.httpRequest.get(url);
|
|
118
|
+
}
|
|
119
|
+
async privateUpdatePeople(directoryId, data) {
|
|
120
|
+
if (!directoryId) {
|
|
121
|
+
throw new Error("Directory ID is required.");
|
|
122
|
+
}
|
|
123
|
+
const url = `${this.baseUrl}identities/private/agents/people/${directoryId}`;
|
|
124
|
+
return await this.httpRequest.put(url, data);
|
|
125
|
+
}
|
|
112
126
|
};
|
|
113
127
|
IdentityApi = __decorate([
|
|
114
128
|
injectable(),
|
|
@@ -44,4 +44,8 @@ export interface IIdentityApi {
|
|
|
44
44
|
privateUploadAgentDocument(directoryId: string, actorDirectoryId: string, document: UploadDocumentRequest): Promise<LegacyApiResponse<DocumentUploadResponse>>;
|
|
45
45
|
/** Gemelo private de agentPutPeoplePeopleIdSelfVerified. */
|
|
46
46
|
privateUpdatePeopleSelfVerified(directoryId: string, data: PeopleSelfVerifiedRequest): Promise<LegacyApiResponse<unknown>>;
|
|
47
|
+
/** Gemelo private de agentGetPeopleSearch (búsqueda por nombre; devuelve lista). */
|
|
48
|
+
privateSearchPeople(fullName: string): Promise<LegacyApiResponse<PeopleResponse[]>>;
|
|
49
|
+
/** Gemelo private de editar persona (PUT sin /selfverified). */
|
|
50
|
+
privateUpdatePeople(directoryId: string, data: PeopleUpdateRequest): Promise<LegacyApiResponse<unknown>>;
|
|
47
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.52.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",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { SignUpAdditionalRequest, SignUpUserBackofficeRequest } from "@fiado/type-kit/bin/authentication/index.js";
|
|
3
3
|
import { inject, injectable } from "inversify";
|
|
4
|
-
import { IAuthenticationApi } from "./interfaces/IAuthenticationApi.js";
|
|
4
|
+
import { AgentSignInStatusInput, AgentSignUpProspectInput, IAuthenticationApi } from "./interfaces/IAuthenticationApi.js";
|
|
5
|
+
import { LegacyApiResponse } from "./interfaces/LegacyApiResponse.js";
|
|
5
6
|
|
|
6
7
|
@injectable()
|
|
7
8
|
export class AuthenticationApi implements IAuthenticationApi {
|
|
@@ -27,4 +28,29 @@ export class AuthenticationApi implements IAuthenticationApi {
|
|
|
27
28
|
const operation = "postSignUpBackofficeBulk";
|
|
28
29
|
return await this.httpRequest.post(url, input, { 'operationName': operation });
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
async agentSignInStatus(input: AgentSignInStatusInput, actorEmail: string): Promise<LegacyApiResponse<unknown>> {
|
|
33
|
+
const url = `${process.env.AUTH_LAMBDA_URL}`;
|
|
34
|
+
const operation = "postSignInPhoneNumberAgent";
|
|
35
|
+
|
|
36
|
+
return await this.httpRequest.post<LegacyApiResponse<unknown>>(url, { ...input, actorEmail }, { 'operationName': operation });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async agentSignUpProspect(input: AgentSignUpProspectInput, actorEmail: string): Promise<LegacyApiResponse<unknown>> {
|
|
40
|
+
const url = `${process.env.AUTH_LAMBDA_URL}`;
|
|
41
|
+
const operation = "agentPostSignUp";
|
|
42
|
+
|
|
43
|
+
return await this.httpRequest.post<LegacyApiResponse<unknown>>(url, { ...input, actorEmail }, { 'operationName': operation });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async agentGetSignUpByPhone(phoneNumber: string): Promise<LegacyApiResponse<unknown>> {
|
|
47
|
+
if (!phoneNumber) {
|
|
48
|
+
throw new Error("phoneNumber is required.");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const url = `${process.env.AUTH_LAMBDA_URL}`;
|
|
52
|
+
const operation = "agentGetSignUpByPhoneNumber";
|
|
53
|
+
|
|
54
|
+
return await this.httpRequest.post<LegacyApiResponse<unknown>>(url, { pathParameters: { phoneNumber } }, { 'operationName': operation });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
import { DirectoryBatchSummaryResponse, SignUpAdditionalRequest, SignUpUserBackofficeRequest } from "@fiado/type-kit/bin/authentication/index.js";
|
|
2
|
+
import { LegacyApiResponse } from "./LegacyApiResponse.js";
|
|
3
|
+
|
|
4
|
+
// Input del estado de cuenta del cliente (endpoint de agente, se despacha por operationName).
|
|
5
|
+
// Interfaz LOCAL a propósito: NO se agrega al @fiado/type-kit.
|
|
6
|
+
export interface AgentSignInStatusInput {
|
|
7
|
+
phoneNumber: string;
|
|
8
|
+
app: string;
|
|
9
|
+
platform: string;
|
|
10
|
+
version: string;
|
|
11
|
+
ip?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Input del alta de prospecto (endpoint de agente, se despacha por operationName).
|
|
15
|
+
// `email` es el email del PROSPECTO; el email del AGENTE viaja aparte como actorEmail.
|
|
16
|
+
// Interfaz LOCAL a propósito: NO se agrega al @fiado/type-kit.
|
|
17
|
+
export interface AgentSignUpProspectInput {
|
|
18
|
+
name: string;
|
|
19
|
+
phoneNumber: string;
|
|
20
|
+
countryOfBirth: string;
|
|
21
|
+
countryOfDomicile: string;
|
|
22
|
+
email: string;
|
|
23
|
+
secondaryPhoneNumber?: string;
|
|
24
|
+
referralCode?: string | null;
|
|
25
|
+
stateOfBirth?: string | null;
|
|
26
|
+
otpCode?: string | null;
|
|
27
|
+
MEX_DebitAccountWish?: boolean;
|
|
28
|
+
USA_DebitAccountWish?: boolean;
|
|
29
|
+
}
|
|
2
30
|
|
|
3
31
|
export interface IAuthenticationApi {
|
|
4
32
|
|
|
@@ -6,4 +34,16 @@ export interface IAuthenticationApi {
|
|
|
6
34
|
deleteAuthSessionByDirectoryId(directoryId: string): Promise<any>;
|
|
7
35
|
|
|
8
36
|
signUpBackofficeBulk(input: SignUpUserBackofficeRequest[]): Promise<DirectoryBatchSummaryResponse>;
|
|
9
|
-
|
|
37
|
+
|
|
38
|
+
// Endpoints de agente — se despachan por header operationName y devuelven el ENVELOPE legacy
|
|
39
|
+
// COMPLETO (LegacyApiResponse) para que el proxy (people-business) lo re-emita campo por campo (drop-in).
|
|
40
|
+
|
|
41
|
+
// operationName: postSignInPhoneNumberAgent — body { ...input, actorEmail }
|
|
42
|
+
agentSignInStatus(input: AgentSignInStatusInput, actorEmail: string): Promise<LegacyApiResponse<unknown>>;
|
|
43
|
+
|
|
44
|
+
// operationName: agentPostSignUp — body { ...input, actorEmail } (input.email = prospecto; actorEmail = agente)
|
|
45
|
+
agentSignUpProspect(input: AgentSignUpProspectInput, actorEmail: string): Promise<LegacyApiResponse<unknown>>;
|
|
46
|
+
|
|
47
|
+
// operationName: agentGetSignUpByPhoneNumber — body { pathParameters: { phoneNumber } }
|
|
48
|
+
agentGetSignUpByPhone(phoneNumber: string): Promise<LegacyApiResponse<unknown>>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Envelope de respuesta de los lambdas legacy Fiado (@fiado/request-handler + @fiado/backend-toolkit):
|
|
2
|
+
// el body HTTP es { code, description, msg, data, date }. Los métodos que pegan a endpoints legacy
|
|
3
|
+
// devuelven este envelope COMPLETO (httpRequest.post retorna response.data = el body), NO solo `data`.
|
|
4
|
+
// Tiparlo así evita el doble-wrap en el consumidor (que re-emite el envelope campo por campo para ser drop-in).
|
|
5
|
+
export interface LegacyApiResponse<T> {
|
|
6
|
+
code: string;
|
|
7
|
+
description?: string | null;
|
|
8
|
+
msg?: string | null;
|
|
9
|
+
data: T;
|
|
10
|
+
date?: string;
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {inject, injectable} from "inversify";
|
|
2
2
|
import {IIdentityApi} from "./interfaces/IIdentityApi.js";
|
|
3
3
|
import {LegacyApiResponse} from "./interfaces/LegacyApiResponse.js";
|
|
4
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import type {IHttpRequest} from "@fiado/http-client";
|
|
5
5
|
import dotenv from 'dotenv';
|
|
6
6
|
import {
|
|
7
7
|
PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse,
|
|
@@ -135,4 +135,20 @@ export class IdentityApi implements IIdentityApi {
|
|
|
135
135
|
const url = `${this.baseUrl}identities/private/agents/people/${directoryId}/selfverified`;
|
|
136
136
|
return await this.httpRequest.put<LegacyApiResponse<unknown>>(url, data);
|
|
137
137
|
}
|
|
138
|
+
|
|
139
|
+
async privateSearchPeople(fullName: string): Promise<LegacyApiResponse<PeopleResponse[]>> {
|
|
140
|
+
if (!fullName || !fullName.trim()) {
|
|
141
|
+
throw new Error("fullName is required.")
|
|
142
|
+
}
|
|
143
|
+
const url = `${this.baseUrl}identities/people/search?fullName=${encodeURIComponent(fullName)}`;
|
|
144
|
+
return await this.httpRequest.get<LegacyApiResponse<PeopleResponse[]>>(url);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async privateUpdatePeople(directoryId: string, data: PeopleUpdateRequest): Promise<LegacyApiResponse<unknown>> {
|
|
148
|
+
if (!directoryId) {
|
|
149
|
+
throw new Error("Directory ID is required.")
|
|
150
|
+
}
|
|
151
|
+
const url = `${this.baseUrl}identities/private/agents/people/${directoryId}`;
|
|
152
|
+
return await this.httpRequest.put<LegacyApiResponse<unknown>>(url, data);
|
|
153
|
+
}
|
|
138
154
|
}
|
|
@@ -59,4 +59,8 @@ export interface IIdentityApi {
|
|
|
59
59
|
privateUploadAgentDocument(directoryId: string, actorDirectoryId: string, document: UploadDocumentRequest): Promise<LegacyApiResponse<DocumentUploadResponse>>;
|
|
60
60
|
/** Gemelo private de agentPutPeoplePeopleIdSelfVerified. */
|
|
61
61
|
privateUpdatePeopleSelfVerified(directoryId: string, data: PeopleSelfVerifiedRequest): Promise<LegacyApiResponse<unknown>>;
|
|
62
|
+
/** Gemelo private de agentGetPeopleSearch (búsqueda por nombre; devuelve lista). */
|
|
63
|
+
privateSearchPeople(fullName: string): Promise<LegacyApiResponse<PeopleResponse[]>>;
|
|
64
|
+
/** Gemelo private de editar persona (PUT sin /selfverified). */
|
|
65
|
+
privateUpdatePeople(directoryId: string, data: PeopleUpdateRequest): Promise<LegacyApiResponse<unknown>>;
|
|
62
66
|
}
|