@fiado/api-invoker 4.46.0 → 4.49.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.
@@ -110,6 +110,8 @@ import { EqualityConnectorApi } from "./equality-connector/index.js";
110
110
  import { ContactsBusinessApi } from "./contacts-business/index.js";
111
111
  // Wallet funding settlement — TransactWriteItems atómico del money path cash-in (spec 15)
112
112
  import { WalletFundingSettlementApi } from "./walletFundingSettlement/index.js";
113
+ // SNS/SES connector — envío SMS/MAIL síncrono (restaurado para RBAC — DEC-002 messages-business)
114
+ import { SnsSesConnectorApi } from "./sns-ses-connector/index.js";
113
115
  export const apiInvokerBindings = new ContainerModule(({ bind }) => {
114
116
  // UTILS bindings
115
117
  bind("InvokerUtils").to(InvokerUtils);
@@ -232,4 +234,6 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
232
234
  // Wallet funding settlement — TransactWriteItems atómico del money path cash-in
233
235
  // (consumido por equality-connector post processor.walletFundingValidate). Ver spec 15.
234
236
  bind("IWalletFundingSettlementApi").to(WalletFundingSettlementApi);
237
+ // SNS/SES connector — envío SMS/MAIL síncrono (restaurado para RBAC — DEC-002 messages-business)
238
+ bind("ISnsSesConnectorApi").to(SnsSesConnectorApi);
235
239
  });
@@ -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
  }
package/bin/index.d.ts CHANGED
@@ -82,3 +82,4 @@ export * from "./equality-connector/index.js";
82
82
  export * from "./contacts-business/index.js";
83
83
  export * from "./uniteller-connector/index.js";
84
84
  export * from "./walletFundingSettlement/index.js";
85
+ export * from "./sns-ses-connector/index.js";
package/bin/index.js CHANGED
@@ -82,3 +82,4 @@ export * from "./equality-connector/index.js";
82
82
  export * from "./contacts-business/index.js";
83
83
  export * from "./uniteller-connector/index.js";
84
84
  export * from "./walletFundingSettlement/index.js";
85
+ export * from "./sns-ses-connector/index.js";
@@ -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
  }
@@ -0,0 +1,11 @@
1
+ import type { IHttpRequest } from '@fiado/http-client';
2
+ import { MessageDeliveryRequest, MessageDeliveryResponse } from '@fiado/type-kit/bin/messaging/index.js';
3
+ import { ISnsSesConnectorApi } from './interfaces/ISnsSesConnectorApi.js';
4
+ type FiadoApiResponse<T> = import('@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js').default<T>;
5
+ export declare class SnsSesConnectorApi implements ISnsSesConnectorApi {
6
+ private readonly httpRequest;
7
+ private readonly baseUrl;
8
+ constructor(httpRequest: IHttpRequest);
9
+ send(request: MessageDeliveryRequest): Promise<FiadoApiResponse<MessageDeliveryResponse>>;
10
+ }
11
+ export {};
@@ -0,0 +1,30 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ import { inject, injectable } from 'inversify';
14
+ let SnsSesConnectorApi = class SnsSesConnectorApi {
15
+ httpRequest;
16
+ baseUrl = process.env.SNS_SES_CONNECTOR_LAMBDA_URL || '';
17
+ constructor(httpRequest) {
18
+ this.httpRequest = httpRequest;
19
+ }
20
+ async send(request) {
21
+ const url = `${this.baseUrl}send`;
22
+ return await this.httpRequest.post(url, request, { 'operationName': 'privateSend' });
23
+ }
24
+ };
25
+ SnsSesConnectorApi = __decorate([
26
+ injectable(),
27
+ __param(0, inject('IHttpRequest')),
28
+ __metadata("design:paramtypes", [Object])
29
+ ], SnsSesConnectorApi);
30
+ export { SnsSesConnectorApi };
@@ -0,0 +1,6 @@
1
+ import { MessageDeliveryRequest, MessageDeliveryResponse } from '@fiado/type-kit/bin/messaging/index.js';
2
+ type FiadoApiResponse<T> = import('@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js').default<T>;
3
+ export interface ISnsSesConnectorApi {
4
+ send(request: MessageDeliveryRequest): Promise<FiadoApiResponse<MessageDeliveryResponse>>;
5
+ }
6
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './api/SnsSesConnectorApi.js';
2
+ export * from './api/interfaces/ISnsSesConnectorApi.js';
@@ -0,0 +1,2 @@
1
+ export * from './api/SnsSesConnectorApi.js';
2
+ export * from './api/interfaces/ISnsSesConnectorApi.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "4.46.0",
3
+ "version": "4.49.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.154.0",
37
+ "@fiado/type-kit": "^3.156.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -169,6 +169,8 @@ import { IEqualityConnectorApi, EqualityConnectorApi } from "./equality-connecto
169
169
  import { IContactsBusinessApi, ContactsBusinessApi } from "./contacts-business/index.js";
170
170
  // Wallet funding settlement — TransactWriteItems atómico del money path cash-in (spec 15)
171
171
  import { IWalletFundingSettlementApi, WalletFundingSettlementApi } from "./walletFundingSettlement/index.js";
172
+ // SNS/SES connector — envío SMS/MAIL síncrono (restaurado para RBAC — DEC-002 messages-business)
173
+ import { ISnsSesConnectorApi, SnsSesConnectorApi } from "./sns-ses-connector/index.js";
172
174
 
173
175
  export const apiInvokerBindings = new ContainerModule(({ bind }) => {
174
176
  // UTILS bindings
@@ -309,4 +311,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
309
311
  // Wallet funding settlement — TransactWriteItems atómico del money path cash-in
310
312
  // (consumido por equality-connector post processor.walletFundingValidate). Ver spec 15.
311
313
  bind<IWalletFundingSettlementApi>("IWalletFundingSettlementApi").to(WalletFundingSettlementApi);
314
+
315
+ // SNS/SES connector — envío SMS/MAIL síncrono (restaurado para RBAC — DEC-002 messages-business)
316
+ bind<ISnsSesConnectorApi>("ISnsSesConnectorApi").to(SnsSesConnectorApi);
312
317
  });
@@ -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 {PeopleUpdateRequest, UploadDocumentRequest} from "@fiado/type-kit/bin/identity/index.js";
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 {PeopleUpdateRequest, UploadDocumentRequest} from "@fiado/type-kit/bin/identity/index.js";
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
  }
package/src/index.ts CHANGED
@@ -82,3 +82,4 @@ export * from "./equality-connector/index.js";
82
82
  export * from "./contacts-business/index.js";
83
83
  export * from "./uniteller-connector/index.js";
84
84
  export * from "./walletFundingSettlement/index.js";
85
+ export * from "./sns-ses-connector/index.js";
@@ -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
+ }
@@ -0,0 +1,18 @@
1
+ import { inject, injectable } from 'inversify';
2
+ import type { IHttpRequest } from '@fiado/http-client';
3
+ import { MessageDeliveryRequest, MessageDeliveryResponse } from '@fiado/type-kit/bin/messaging/index.js';
4
+ import { ISnsSesConnectorApi } from './interfaces/ISnsSesConnectorApi.js';
5
+
6
+ type FiadoApiResponse<T> = import('@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js').default<T>;
7
+
8
+ @injectable()
9
+ export class SnsSesConnectorApi implements ISnsSesConnectorApi {
10
+ private readonly baseUrl = process.env.SNS_SES_CONNECTOR_LAMBDA_URL || '';
11
+
12
+ constructor(@inject('IHttpRequest') private readonly httpRequest: IHttpRequest) {}
13
+
14
+ async send(request: MessageDeliveryRequest): Promise<FiadoApiResponse<MessageDeliveryResponse>> {
15
+ const url = `${this.baseUrl}send`;
16
+ return await this.httpRequest.post(url, request, { 'operationName': 'privateSend' });
17
+ }
18
+ }
@@ -0,0 +1,7 @@
1
+ import { MessageDeliveryRequest, MessageDeliveryResponse } from '@fiado/type-kit/bin/messaging/index.js';
2
+
3
+ type FiadoApiResponse<T> = import('@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js').default<T>;
4
+
5
+ export interface ISnsSesConnectorApi {
6
+ send(request: MessageDeliveryRequest): Promise<FiadoApiResponse<MessageDeliveryResponse>>;
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/SnsSesConnectorApi.js';
2
+ export * from './api/interfaces/ISnsSesConnectorApi.js';