@fiado/api-invoker 4.46.0 → 4.48.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/identity/IdentityApi.d.ts +5 -1
- package/bin/identity/IdentityApi.js +32 -0
- package/bin/identity/interfaces/IIdentityApi.d.ts +9 -1
- package/bin/onboarding/api/OnboardingApi.d.ts +3 -2
- package/bin/onboarding/api/OnboardingApi.js +5 -0
- package/bin/onboarding/api/interfaces/IOnboardingApi.d.ts +9 -0
- package/package.json +2 -2
- package/src/identity/IdentityApi.ts +40 -1
- package/src/identity/interfaces/IIdentityApi.ts +14 -1
- package/src/onboarding/api/OnboardingApi.ts +8 -2
- package/src/onboarding/api/interfaces/IOnboardingApi.ts +11 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IIdentityApi } from "./interfaces/IIdentityApi.js";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { PeopleUpdateRequest, UploadDocumentRequest } from "@fiado/type-kit/bin/identity/index.js";
|
|
3
|
+
import { PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse, PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse } from "@fiado/type-kit/bin/identity/index.js";
|
|
4
4
|
export declare class IdentityApi implements IIdentityApi {
|
|
5
5
|
private httpRequest;
|
|
6
6
|
private readonly baseUrl;
|
|
@@ -13,4 +13,8 @@ export declare class IdentityApi implements IIdentityApi {
|
|
|
13
13
|
getPeopleByFullName(fullName: string): Promise<any>;
|
|
14
14
|
privateGetDocumentsUrlSigned(directoryId: string, documentNames: string[]): Promise<any>;
|
|
15
15
|
getUserDocuments(directoryId: string): Promise<any>;
|
|
16
|
+
privateGetPeopleByDirectoryId(directoryId: string): Promise<PeopleResponse>;
|
|
17
|
+
privateGetLastAgentDocument(directoryId: string): Promise<AgentDocumentKeyResponse[]>;
|
|
18
|
+
privateUploadAgentDocument(directoryId: string, actorDirectoryId: string, document: UploadDocumentRequest): Promise<DocumentUploadResponse>;
|
|
19
|
+
privateUpdatePeopleSelfVerified(directoryId: string, data: PeopleSelfVerifiedRequest): Promise<void>;
|
|
16
20
|
}
|
|
@@ -75,6 +75,38 @@ let IdentityApi = class IdentityApi {
|
|
|
75
75
|
const url = `${this.baseUrl}identities/private/people/${directoryId}/documents`;
|
|
76
76
|
return await this.httpRequest.get(url);
|
|
77
77
|
}
|
|
78
|
+
// ── Gemelos PRIVATE de los endpoints de agentes (proxy RBAC v2, DEC-PROT-011) ──
|
|
79
|
+
async privateGetPeopleByDirectoryId(directoryId) {
|
|
80
|
+
if (!directoryId) {
|
|
81
|
+
throw new Error("Directory ID is required.");
|
|
82
|
+
}
|
|
83
|
+
const url = `${this.baseUrl}identities/private/agents/people/${directoryId}`;
|
|
84
|
+
return await this.httpRequest.get(url);
|
|
85
|
+
}
|
|
86
|
+
async privateGetLastAgentDocument(directoryId) {
|
|
87
|
+
if (!directoryId) {
|
|
88
|
+
throw new Error("Directory ID is required.");
|
|
89
|
+
}
|
|
90
|
+
const url = `${this.baseUrl}identities/private/agents/documents/${directoryId}/last`;
|
|
91
|
+
return await this.httpRequest.get(url);
|
|
92
|
+
}
|
|
93
|
+
async privateUploadAgentDocument(directoryId, actorDirectoryId, document) {
|
|
94
|
+
if (!directoryId) {
|
|
95
|
+
throw new Error("Directory ID is required.");
|
|
96
|
+
}
|
|
97
|
+
if (!actorDirectoryId) {
|
|
98
|
+
throw new Error("actorDirectoryId is required.");
|
|
99
|
+
}
|
|
100
|
+
const url = `${this.baseUrl}identities/private/agents/documents/${directoryId}/upload?actorDirectoryId=${encodeURIComponent(actorDirectoryId)}`;
|
|
101
|
+
return await this.httpRequest.put(url, document);
|
|
102
|
+
}
|
|
103
|
+
async privateUpdatePeopleSelfVerified(directoryId, data) {
|
|
104
|
+
if (!directoryId) {
|
|
105
|
+
throw new Error("Directory ID is required.");
|
|
106
|
+
}
|
|
107
|
+
const url = `${this.baseUrl}identities/private/agents/people/${directoryId}/selfverified`;
|
|
108
|
+
await this.httpRequest.put(url, data);
|
|
109
|
+
}
|
|
78
110
|
};
|
|
79
111
|
IdentityApi = __decorate([
|
|
80
112
|
injectable(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PeopleUpdateRequest, UploadDocumentRequest } from "@fiado/type-kit/bin/identity/index.js";
|
|
1
|
+
import { PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse, PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse } from "@fiado/type-kit/bin/identity/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
4
4
|
*/
|
|
@@ -35,4 +35,12 @@ export interface IIdentityApi {
|
|
|
35
35
|
* Retorna { directoryId, keys: string[] }.
|
|
36
36
|
*/
|
|
37
37
|
getUserDocuments(directoryId: string): Promise<any>;
|
|
38
|
+
/** Gemelo private de agentGetPeopleByDirectoryId (con masking del manager). */
|
|
39
|
+
privateGetPeopleByDirectoryId(directoryId: string): Promise<PeopleResponse>;
|
|
40
|
+
/** Gemelo private de getUserDocumentsAgents (último documento). */
|
|
41
|
+
privateGetLastAgentDocument(directoryId: string): Promise<AgentDocumentKeyResponse[]>;
|
|
42
|
+
/** Gemelo private de uploadDocumentAgent. actorDirectoryId = autor de la observación (DEC-PROT-012). */
|
|
43
|
+
privateUploadAgentDocument(directoryId: string, actorDirectoryId: string, document: UploadDocumentRequest): Promise<DocumentUploadResponse>;
|
|
44
|
+
/** Gemelo private de agentPutPeoplePeopleIdSelfVerified. */
|
|
45
|
+
privateUpdatePeopleSelfVerified(directoryId: string, data: PeopleSelfVerifiedRequest): Promise<void>;
|
|
38
46
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { IOnboardingApi } from "./interfaces/IOnboardingApi.js";
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { IOnboardingApi, OnboardingStepsEnvelope } from "./interfaces/IOnboardingApi.js";
|
|
3
3
|
export default class OnboardingApi implements IOnboardingApi {
|
|
4
4
|
private httpRequest;
|
|
5
5
|
private readonly baseUrl;
|
|
6
6
|
constructor(httpRequest: IHttpRequest);
|
|
7
7
|
getByReferralDirectoryId(referralDirectoryId: string): Promise<any>;
|
|
8
8
|
delete(id: string): Promise<any>;
|
|
9
|
+
getOnboardingSteps(directoryId: string, countryId: string): Promise<OnboardingStepsEnvelope>;
|
|
9
10
|
}
|
|
@@ -25,6 +25,11 @@ let OnboardingApi = class OnboardingApi {
|
|
|
25
25
|
const url = `${this.baseUrl}onboarding/${id}`;
|
|
26
26
|
return await this.httpRequest.delete(`${url}`);
|
|
27
27
|
}
|
|
28
|
+
async getOnboardingSteps(directoryId, countryId) {
|
|
29
|
+
return await this.httpRequest.get(`${this.baseUrl}agents/steps`, {
|
|
30
|
+
directoryId, countryId, typeOfDirectoryId: "USER",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
28
33
|
};
|
|
29
34
|
OnboardingApi = __decorate([
|
|
30
35
|
injectable(),
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
export interface OnboardingStepsEnvelope {
|
|
2
|
+
code: string;
|
|
3
|
+
data: Record<string, unknown> | null;
|
|
4
|
+
msg?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
date?: string;
|
|
7
|
+
httpCode?: number;
|
|
8
|
+
}
|
|
1
9
|
export interface IOnboardingApi {
|
|
2
10
|
delete(id: string): Promise<any>;
|
|
3
11
|
getByReferralDirectoryId(referralDirectoryId: string): Promise<any>;
|
|
12
|
+
getOnboardingSteps(directoryId: string, countryId: string): Promise<OnboardingStepsEnvelope>;
|
|
4
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.48.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.156.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -2,7 +2,10 @@ import {inject, injectable} from "inversify";
|
|
|
2
2
|
import {IIdentityApi} from "./interfaces/IIdentityApi.js";
|
|
3
3
|
import {IHttpRequest} from "@fiado/http-client";
|
|
4
4
|
import dotenv from 'dotenv';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse,
|
|
7
|
+
PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse,
|
|
8
|
+
} from "@fiado/type-kit/bin/identity/index.js";
|
|
6
9
|
|
|
7
10
|
dotenv.config();
|
|
8
11
|
|
|
@@ -93,4 +96,40 @@ export class IdentityApi implements IIdentityApi {
|
|
|
93
96
|
const url = `${this.baseUrl}identities/private/people/${directoryId}/documents`;
|
|
94
97
|
return await this.httpRequest.get(url);
|
|
95
98
|
}
|
|
99
|
+
|
|
100
|
+
// ── Gemelos PRIVATE de los endpoints de agentes (proxy RBAC v2, DEC-PROT-011) ──
|
|
101
|
+
async privateGetPeopleByDirectoryId(directoryId: string): Promise<PeopleResponse> {
|
|
102
|
+
if (!directoryId) {
|
|
103
|
+
throw new Error("Directory ID is required.")
|
|
104
|
+
}
|
|
105
|
+
const url = `${this.baseUrl}identities/private/agents/people/${directoryId}`;
|
|
106
|
+
return await this.httpRequest.get<PeopleResponse>(url);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async privateGetLastAgentDocument(directoryId: string): Promise<AgentDocumentKeyResponse[]> {
|
|
110
|
+
if (!directoryId) {
|
|
111
|
+
throw new Error("Directory ID is required.")
|
|
112
|
+
}
|
|
113
|
+
const url = `${this.baseUrl}identities/private/agents/documents/${directoryId}/last`;
|
|
114
|
+
return await this.httpRequest.get<AgentDocumentKeyResponse[]>(url);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async privateUploadAgentDocument(directoryId: string, actorDirectoryId: string, document: UploadDocumentRequest): Promise<DocumentUploadResponse> {
|
|
118
|
+
if (!directoryId) {
|
|
119
|
+
throw new Error("Directory ID is required.")
|
|
120
|
+
}
|
|
121
|
+
if (!actorDirectoryId) {
|
|
122
|
+
throw new Error("actorDirectoryId is required.")
|
|
123
|
+
}
|
|
124
|
+
const url = `${this.baseUrl}identities/private/agents/documents/${directoryId}/upload?actorDirectoryId=${encodeURIComponent(actorDirectoryId)}`;
|
|
125
|
+
return await this.httpRequest.put<DocumentUploadResponse>(url, document);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async privateUpdatePeopleSelfVerified(directoryId: string, data: PeopleSelfVerifiedRequest): Promise<void> {
|
|
129
|
+
if (!directoryId) {
|
|
130
|
+
throw new Error("Directory ID is required.")
|
|
131
|
+
}
|
|
132
|
+
const url = `${this.baseUrl}identities/private/agents/people/${directoryId}/selfverified`;
|
|
133
|
+
await this.httpRequest.put<void>(url, data);
|
|
134
|
+
}
|
|
96
135
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse,
|
|
3
|
+
PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse,
|
|
4
|
+
} from "@fiado/type-kit/bin/identity/index.js";
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
@@ -43,4 +46,14 @@ export interface IIdentityApi {
|
|
|
43
46
|
* Retorna { directoryId, keys: string[] }.
|
|
44
47
|
*/
|
|
45
48
|
getUserDocuments(directoryId: string): Promise<any>
|
|
49
|
+
|
|
50
|
+
// ── Gemelos PRIVATE de los endpoints de agentes (proxy RBAC v2, DEC-PROT-011) ──
|
|
51
|
+
/** Gemelo private de agentGetPeopleByDirectoryId (con masking del manager). */
|
|
52
|
+
privateGetPeopleByDirectoryId(directoryId: string): Promise<PeopleResponse>;
|
|
53
|
+
/** Gemelo private de getUserDocumentsAgents (último documento). */
|
|
54
|
+
privateGetLastAgentDocument(directoryId: string): Promise<AgentDocumentKeyResponse[]>;
|
|
55
|
+
/** Gemelo private de uploadDocumentAgent. actorDirectoryId = autor de la observación (DEC-PROT-012). */
|
|
56
|
+
privateUploadAgentDocument(directoryId: string, actorDirectoryId: string, document: UploadDocumentRequest): Promise<DocumentUploadResponse>;
|
|
57
|
+
/** Gemelo private de agentPutPeoplePeopleIdSelfVerified. */
|
|
58
|
+
privateUpdatePeopleSelfVerified(directoryId: string, data: PeopleSelfVerifiedRequest): Promise<void>;
|
|
46
59
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject, injectable } from "inversify";
|
|
2
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { IOnboardingApi } from "./interfaces/IOnboardingApi.js";
|
|
2
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { IOnboardingApi, OnboardingStepsEnvelope } from "./interfaces/IOnboardingApi.js";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
@injectable()
|
|
@@ -20,4 +20,10 @@ export default class OnboardingApi implements IOnboardingApi {
|
|
|
20
20
|
const url = `${this.baseUrl}onboarding/${id}`;
|
|
21
21
|
return await this.httpRequest.delete(`${url}`);
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
async getOnboardingSteps(directoryId: string, countryId: string): Promise<OnboardingStepsEnvelope> {
|
|
25
|
+
return await this.httpRequest.get<OnboardingStepsEnvelope>(`${this.baseUrl}agents/steps`, {
|
|
26
|
+
directoryId, countryId, typeOfDirectoryId: "USER",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
23
29
|
}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
export interface OnboardingStepsEnvelope {
|
|
2
|
+
code: string;
|
|
3
|
+
data: Record<string, unknown> | null;
|
|
4
|
+
msg?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
date?: string;
|
|
7
|
+
httpCode?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
1
10
|
export interface IOnboardingApi {
|
|
2
11
|
delete(id: string): Promise<any>
|
|
3
12
|
getByReferralDirectoryId(referralDirectoryId: string): Promise<any>
|
|
4
|
-
|
|
13
|
+
getOnboardingSteps(directoryId: string, countryId: string): Promise<OnboardingStepsEnvelope>
|
|
14
|
+
}
|