@fiado/api-invoker 5.1.0 → 5.3.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/activity-business/ActivityApi.d.ts +0 -5
- package/bin/activity-business/ActivityApi.js +0 -4
- package/bin/activity-business/interfaces/IActivityApi.d.ts +0 -10
- package/bin/container.config.js +2 -8
- package/bin/event-history-business/EventHistoryApi.d.ts +5 -0
- package/bin/event-history-business/EventHistoryApi.js +4 -0
- package/bin/index.d.ts +1 -3
- package/bin/index.js +1 -3
- package/bin/kyc/queue/RetailKycInboundPublisher.d.ts +2 -3
- package/bin/kyc/queue/RetailKycInboundPublisher.js +5 -2
- package/bin/kyc/queue/interfaces/IRetailKycInboundPublisher.d.ts +17 -7
- package/bin/notificationWebsockets/index.d.ts +0 -2
- package/bin/notificationWebsockets/index.js +0 -2
- package/bin/research-sheets/ResearchSheetsApi.d.ts +12 -0
- package/bin/research-sheets/ResearchSheetsApi.js +32 -0
- package/bin/research-sheets/index.d.ts +2 -0
- package/bin/research-sheets/index.js +2 -0
- package/{src/presence-websocket/interfaces/IPresenceWebsocketApi.ts → bin/research-sheets/interfaces/IResearchSheetsApi.d.ts} +7 -7
- package/bin/research-sheets/interfaces/IResearchSheetsApi.js +1 -0
- package/bin/shortlink/api/ShortlinkBusinessApi.d.ts +5 -0
- package/bin/shortlink/api/ShortlinkBusinessApi.js +4 -0
- package/bin/shortlink/api/interfaces/IShortlinkBusinessApi.d.ts +10 -0
- package/package.json +2 -2
- package/src/activity-business/ActivityApi.ts +0 -6
- package/src/activity-business/interfaces/IActivityApi.ts +0 -10
- package/src/container.config.ts +2 -8
- package/src/event-history-business/EventHistoryApi.ts +6 -0
- package/src/index.ts +1 -3
- package/src/kyc/queue/RetailKycInboundPublisher.ts +7 -5
- package/src/kyc/queue/interfaces/IRetailKycInboundPublisher.ts +18 -7
- package/src/notificationWebsockets/index.ts +1 -3
- package/src/{membership/MembershipApi.ts → research-sheets/ResearchSheetsApi.ts} +3 -3
- package/src/research-sheets/index.ts +2 -0
- package/src/{membership/interfaces/IMembershipApi.ts → research-sheets/interfaces/IResearchSheetsApi.ts} +3 -3
- package/src/shortlink/api/ShortlinkBusinessApi.ts +8 -0
- package/src/shortlink/api/interfaces/IShortlinkBusinessApi.ts +9 -0
- package/src/membership/index.ts +0 -2
- package/src/notificationWebsockets/NotificationWebsocketApi.ts +0 -20
- package/src/notificationWebsockets/interfaces/INotificationWebsocketApi.ts +0 -15
- package/src/performance-profile/PerformanceProfileApi.ts +0 -20
- package/src/performance-profile/index.ts +0 -2
- package/src/performance-profile/interfaces/IPerformanceProfileApi.ts +0 -15
- package/src/presence-websocket/PresenceWebsocketApi.ts +0 -20
- package/src/presence-websocket/index.ts +0 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { IActivityApi } from "./interfaces/IActivityApi.js";
|
|
3
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
4
3
|
export default class ActivityApi implements IActivityApi {
|
|
5
4
|
private httpRequest;
|
|
6
5
|
private readonly baseUrl;
|
|
@@ -10,8 +9,4 @@ export default class ActivityApi implements IActivityApi {
|
|
|
10
9
|
getActivityByDirectoryId(directoryId: string, typeOfActivityIds: string[], table?: "PRINCIPAL" | "DETAIL"): Promise<any>;
|
|
11
10
|
getActivityById(typeOfActivityIds: string[]): Promise<any>;
|
|
12
11
|
getActivityHistory(typeOfActivity: string, startDate: string, endDate: string): Promise<any>;
|
|
13
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
14
|
-
deletedCount: number;
|
|
15
|
-
}>>;
|
|
16
12
|
}
|
|
17
|
-
export {};
|
|
@@ -39,10 +39,6 @@ let ActivityApi = class ActivityApi {
|
|
|
39
39
|
const url = `${this.baseUrl}activities/history?typeOfActivity=${typeOfActivity}&startDate=${startDate}&endDate=${endDate}`;
|
|
40
40
|
return await this.httpRequest.get(url);
|
|
41
41
|
}
|
|
42
|
-
async deleteByDirectoryId(directoryId) {
|
|
43
|
-
const url = `${this.baseUrl}private/directory/${directoryId}`;
|
|
44
|
-
return await this.httpRequest.delete(url);
|
|
45
|
-
}
|
|
46
42
|
};
|
|
47
43
|
ActivityApi = __decorate([
|
|
48
44
|
injectable(),
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
1
|
export interface IActivityApi {
|
|
3
2
|
getActivityByDirectoryId(directoryId: string, typeOfActivityIds: string[], table?: "PRINCIPAL" | "DETAIL"): Promise<any>;
|
|
4
3
|
getActivityById(typeOfActivityIds: string[]): Promise<any>;
|
|
5
4
|
getActivityHistory(typeOfActivity: string, startDate: string, endDate: string): Promise<any>;
|
|
6
5
|
findByDirectoriesList(directories: string[]): Promise<any>;
|
|
7
6
|
correctCounters(): Promise<any>;
|
|
8
|
-
/**
|
|
9
|
-
* Borra en cascada las actividades asociadas a un directoryId.
|
|
10
|
-
* @param directoryId ID del directorio.
|
|
11
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
|
-
*/
|
|
13
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
14
|
-
deletedCount: number;
|
|
15
|
-
}>>;
|
|
16
7
|
}
|
|
17
|
-
export {};
|
package/bin/container.config.js
CHANGED
|
@@ -120,11 +120,8 @@ import { SnsSesConnectorApi } from "./sns-ses-connector/index.js";
|
|
|
120
120
|
// Remittance business — pricingResolve (Dashboard Ops Fase B, puente de resolución de precio en send-time)
|
|
121
121
|
import { RemittanceBusinessApi } from "./remittance-business/index.js";
|
|
122
122
|
import { BeneficiaryApi } from "./beneficiary/index.js";
|
|
123
|
-
import {
|
|
124
|
-
import { PerformanceProfileApi } from "./performance-profile/index.js";
|
|
123
|
+
import { ResearchSheetsApi } from "./research-sheets/index.js";
|
|
125
124
|
import { AuthBusinessApi } from "./auth-business/index.js";
|
|
126
|
-
import { PresenceWebsocketApi } from "./presence-websocket/index.js";
|
|
127
|
-
import { NotificationWebsocketApi } from "./notificationWebsockets/index.js";
|
|
128
125
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId (SureKeep F2)
|
|
129
126
|
import { KycVerificationsBusinessApi } from "./kyc/index.js";
|
|
130
127
|
export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
@@ -261,11 +258,8 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
261
258
|
bind("IRemittanceBusinessApi").to(RemittanceBusinessApi);
|
|
262
259
|
// Borrado en cascada del directorio — deleteByDirectoryId por dominio
|
|
263
260
|
bind("IBeneficiaryApi").to(BeneficiaryApi);
|
|
264
|
-
bind("
|
|
265
|
-
bind("IPerformanceProfileApi").to(PerformanceProfileApi);
|
|
261
|
+
bind("IResearchSheetsApi").to(ResearchSheetsApi);
|
|
266
262
|
bind("IAuthBusinessApi").to(AuthBusinessApi);
|
|
267
|
-
bind("IPresenceWebsocketApi").to(PresenceWebsocketApi);
|
|
268
|
-
bind("INotificationWebsocketApi").to(NotificationWebsocketApi);
|
|
269
263
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId.
|
|
270
264
|
// La consume el wizard de SureKeep F2 tras el aviso async del stream de `KycVerifications`.
|
|
271
265
|
bind("IKycVerificationsBusinessApi").to(KycVerificationsBusinessApi);
|
|
@@ -2,6 +2,7 @@ import { IHttpRequest } from "@fiado/http-client";
|
|
|
2
2
|
import { IEventHistoryApi } from "./interfaces/IEventHistoryApi.js";
|
|
3
3
|
import { CreateDirectoryUserEventRequest } from "@fiado/type-kit/bin/directory/dtos/CreateDirectoryUserEventRequest.js";
|
|
4
4
|
import { CreateAccountEventRequest } from "@fiado/type-kit/bin/account/dtos/CreateAccountEventRequest.js";
|
|
5
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
5
6
|
export declare class EventHistoryApi implements IEventHistoryApi {
|
|
6
7
|
private httpRequest;
|
|
7
8
|
private readonly baseUrl;
|
|
@@ -42,4 +43,8 @@ export declare class EventHistoryApi implements IEventHistoryApi {
|
|
|
42
43
|
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
43
44
|
*/
|
|
44
45
|
createAccountEvent(request: CreateAccountEventRequest): Promise<any>;
|
|
46
|
+
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
47
|
+
deletedCount: number;
|
|
48
|
+
}>>;
|
|
45
49
|
}
|
|
50
|
+
export {};
|
|
@@ -93,6 +93,10 @@ let EventHistoryApi = class EventHistoryApi {
|
|
|
93
93
|
const url = `${this.baseUrl}accounts/events`;
|
|
94
94
|
return await this.httpRequest.post(`${url}`, request);
|
|
95
95
|
}
|
|
96
|
+
async deleteByDirectoryId(directoryId) {
|
|
97
|
+
const url = `${this.baseUrl}private/directory/${directoryId}`;
|
|
98
|
+
return await this.httpRequest.delete(url);
|
|
99
|
+
}
|
|
96
100
|
};
|
|
97
101
|
EventHistoryApi = __decorate([
|
|
98
102
|
injectable(),
|
package/bin/index.d.ts
CHANGED
|
@@ -100,8 +100,6 @@ export * from "./sns-ses-connector/index.js";
|
|
|
100
100
|
export * from "./remittance-business/index.js";
|
|
101
101
|
export * from "./modelias-connector/index.js";
|
|
102
102
|
export * from "./beneficiary/index.js";
|
|
103
|
-
export * from "./
|
|
104
|
-
export * from "./performance-profile/index.js";
|
|
103
|
+
export * from "./research-sheets/index.js";
|
|
105
104
|
export * from "./auth-business/index.js";
|
|
106
|
-
export * from "./presence-websocket/index.js";
|
|
107
105
|
export * from "./kyc/index.js";
|
package/bin/index.js
CHANGED
|
@@ -100,8 +100,6 @@ export * from "./sns-ses-connector/index.js";
|
|
|
100
100
|
export * from "./remittance-business/index.js";
|
|
101
101
|
export * from "./modelias-connector/index.js";
|
|
102
102
|
export * from "./beneficiary/index.js";
|
|
103
|
-
export * from "./
|
|
104
|
-
export * from "./performance-profile/index.js";
|
|
103
|
+
export * from "./research-sheets/index.js";
|
|
105
104
|
export * from "./auth-business/index.js";
|
|
106
|
-
export * from "./presence-websocket/index.js";
|
|
107
105
|
export * from "./kyc/index.js";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IRetailKycInboundPublisher } from "./interfaces/IRetailKycInboundPublisher.js";
|
|
1
|
+
import { IRetailKycInboundPublisher, RetailKycInboundMessage } from "./interfaces/IRetailKycInboundPublisher.js";
|
|
3
2
|
export declare class RetailKycInboundPublisher implements IRetailKycInboundPublisher {
|
|
4
3
|
private readonly RETAIL_KYC_INBOUND_QUEUE_URL;
|
|
5
|
-
publish(message:
|
|
4
|
+
publish(message: RetailKycInboundMessage): Promise<void>;
|
|
6
5
|
}
|
|
@@ -11,8 +11,11 @@ let RetailKycInboundPublisher = class RetailKycInboundPublisher {
|
|
|
11
11
|
async publish(message) {
|
|
12
12
|
try {
|
|
13
13
|
const client = new SQSClient();
|
|
14
|
-
// Cola ESTÁNDAR (no FIFO): sin MessageGroupId/MessageDeduplicationId
|
|
15
|
-
// la hace el consumidor con la llave de negocio
|
|
14
|
+
// Cola ESTÁNDAR (no FIFO): sin MessageGroupId/MessageDeduplicationId, y por lo tanto SIN
|
|
15
|
+
// orden garantizado. La deduplicación la hace el consumidor con la llave de negocio: el
|
|
16
|
+
// cierre por (directoryId + verificationId + status + result), la estación por
|
|
17
|
+
// (verificationId + step) — su escritura ya es idempotente. El reordenamiento lo resuelve
|
|
18
|
+
// el `occurredAt` de cada estación, no la cola.
|
|
16
19
|
const sendMessageRequest = {
|
|
17
20
|
QueueUrl: this.RETAIL_KYC_INBOUND_QUEUE_URL,
|
|
18
21
|
MessageBody: JSON.stringify(message),
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { KycVerificationChangedV1 } from "@fiado/type-kit/bin/kyc/index.js";
|
|
1
|
+
import { KycVerificationChangedV1, KycStepCompletedV1 } from "@fiado/type-kit/bin/kyc/index.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Todo lo que `RetailKycInboundQueue` transporta:
|
|
4
|
+
* - `KycVerificationChangedV1` — el CIERRE de la verificación, con el resultado consolidado.
|
|
5
|
+
* - `KycStepCompletedV1` — el resultado de UNA estación, en cuanto Metamap la cierra.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Es una unión cerrada y no un `unknown` a propósito: el consumidor rutea por `eventType`, así que
|
|
8
|
+
* agregar un tipo acá obliga a tocar también el consumidor — que es exactamente la conversación que
|
|
9
|
+
* tiene que pasar antes de meter un mensaje nuevo en una cola compartida.
|
|
10
|
+
*/
|
|
11
|
+
export type RetailKycInboundMessage = KycVerificationChangedV1 | KycStepCompletedV1;
|
|
12
|
+
/**
|
|
13
|
+
* Publisher del KYC hacia `RetailKycInboundQueue`, que consume `retail-wizard-business` (SureKeep F2).
|
|
14
|
+
*
|
|
15
|
+
* Lo produce `kyc-metamap-webhook`: el cierre cuando la verificación pasa a COMPLETED, y una estación
|
|
16
|
+
* por cada `step_completed`. Vive acá —y no como SDK crudo en el webhook— porque la cola es COMPARTIDA
|
|
17
|
+
* cross-lambda: el estándar Fiado publica a una cola compartida vía Publisher de `@fiado/api-invoker`
|
|
18
|
+
* (mismo patrón que `ITransactionPublisher`).
|
|
9
19
|
*/
|
|
10
20
|
export interface IRetailKycInboundPublisher {
|
|
11
|
-
publish(message:
|
|
21
|
+
publish(message: RetailKycInboundMessage): Promise<void>;
|
|
12
22
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { IResearchSheetsApi } from "./interfaces/IResearchSheetsApi.js";
|
|
3
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
4
|
+
export declare class ResearchSheetsApi implements IResearchSheetsApi {
|
|
5
|
+
private httpRequest;
|
|
6
|
+
private readonly baseUrl;
|
|
7
|
+
constructor(httpRequest: IHttpRequest);
|
|
8
|
+
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
9
|
+
deletedCount: number;
|
|
10
|
+
}>>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
import dotenv from 'dotenv';
|
|
15
|
+
dotenv.config();
|
|
16
|
+
let ResearchSheetsApi = class ResearchSheetsApi {
|
|
17
|
+
httpRequest;
|
|
18
|
+
baseUrl = process.env.RESEARCH_SHEETS_LAMBDA_URL || "";
|
|
19
|
+
constructor(httpRequest) {
|
|
20
|
+
this.httpRequest = httpRequest;
|
|
21
|
+
}
|
|
22
|
+
async deleteByDirectoryId(directoryId) {
|
|
23
|
+
const url = `${this.baseUrl}private/directory/${directoryId}`;
|
|
24
|
+
return await this.httpRequest.delete(url);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
ResearchSheetsApi = __decorate([
|
|
28
|
+
injectable(),
|
|
29
|
+
__param(0, inject("IHttpRequest")),
|
|
30
|
+
__metadata("design:paramtypes", [Object])
|
|
31
|
+
], ResearchSheetsApi);
|
|
32
|
+
export { ResearchSheetsApi };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
|
-
* Interfaz para el servicio
|
|
3
|
+
* Interfaz para el servicio Research Sheets (research-sheets).
|
|
5
4
|
*/
|
|
6
|
-
export interface
|
|
7
|
-
|
|
5
|
+
export interface IResearchSheetsApi {
|
|
8
6
|
/**
|
|
9
|
-
* Borra en cascada
|
|
7
|
+
* Borra en cascada las research sheets asociadas a un directoryId.
|
|
10
8
|
* @param directoryId ID del directorio.
|
|
11
9
|
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
10
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
12
|
+
deletedCount: number;
|
|
13
|
+
}>>;
|
|
15
14
|
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,9 +2,14 @@ import { IHttpRequest } from "@fiado/http-client";
|
|
|
2
2
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
3
|
import { CreateShortLinkRequest, CreateShortLinkResponse } from "@fiado/type-kit/bin/shortlink/index.js";
|
|
4
4
|
import { IShortlinkBusinessApi } from "./interfaces/IShortlinkBusinessApi.js";
|
|
5
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
5
6
|
export default class ShortlinkBusinessApi implements IShortlinkBusinessApi {
|
|
6
7
|
private httpRequest;
|
|
7
8
|
private readonly baseUrl;
|
|
8
9
|
constructor(httpRequest: IHttpRequest);
|
|
9
10
|
createLink(payload: CreateShortLinkRequest): Promise<StandardResponse<CreateShortLinkResponse>>;
|
|
11
|
+
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
12
|
+
deletedCount: number;
|
|
13
|
+
}>>;
|
|
10
14
|
}
|
|
15
|
+
export {};
|
|
@@ -23,6 +23,10 @@ let ShortlinkBusinessApi = class ShortlinkBusinessApi {
|
|
|
23
23
|
const url = `${this.baseUrl}/private/links`;
|
|
24
24
|
return await this.httpRequest.post(url, payload);
|
|
25
25
|
}
|
|
26
|
+
async deleteByDirectoryId(directoryId) {
|
|
27
|
+
const url = `${this.baseUrl}/private/directory/${directoryId}`;
|
|
28
|
+
return await this.httpRequest.delete(url);
|
|
29
|
+
}
|
|
26
30
|
};
|
|
27
31
|
ShortlinkBusinessApi = __decorate([
|
|
28
32
|
injectable(),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import { CreateShortLinkRequest, CreateShortLinkResponse } from "@fiado/type-kit/bin/shortlink/index.js";
|
|
3
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
3
4
|
/**
|
|
4
5
|
* Contrato del publisher HTTP del lambda `shortlink-business` para su endpoint privado
|
|
5
6
|
* de creación de links (service-to-service, VPC-only).
|
|
@@ -22,4 +23,13 @@ export interface IShortlinkBusinessApi {
|
|
|
22
23
|
* `payload.destination` debe ser **HTTPS** o responde 400 `INVALID_DESTINATION_URL`.
|
|
23
24
|
*/
|
|
24
25
|
createLink(payload: CreateShortLinkRequest): Promise<StandardResponse<CreateShortLinkResponse>>;
|
|
26
|
+
/**
|
|
27
|
+
* Borra en cascada los shortlinks asociados a un directoryId.
|
|
28
|
+
* @param directoryId ID del directorio.
|
|
29
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
30
|
+
*/
|
|
31
|
+
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
32
|
+
deletedCount: number;
|
|
33
|
+
}>>;
|
|
25
34
|
}
|
|
35
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.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.221.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { inject, injectable } from "inversify";
|
|
3
3
|
import { IActivityApi } from "./interfaces/IActivityApi.js";
|
|
4
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
5
4
|
|
|
6
5
|
@injectable()
|
|
7
6
|
export default class ActivityApi implements IActivityApi {
|
|
@@ -34,9 +33,4 @@ export default class ActivityApi implements IActivityApi {
|
|
|
34
33
|
const url = `${this.baseUrl}activities/history?typeOfActivity=${typeOfActivity}&startDate=${startDate}&endDate=${endDate}`;
|
|
35
34
|
return await this.httpRequest.get(url);
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
async deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>> {
|
|
39
|
-
const url = `${this.baseUrl}private/directory/${directoryId}`;
|
|
40
|
-
return await this.httpRequest.delete<FiadoApiResponse<{ deletedCount: number }>>(url);
|
|
41
|
-
}
|
|
42
36
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
|
-
|
|
3
1
|
export interface IActivityApi {
|
|
4
2
|
|
|
5
3
|
getActivityByDirectoryId(directoryId: string, typeOfActivityIds: string[], table?: "PRINCIPAL" | "DETAIL"): Promise<any>
|
|
@@ -11,12 +9,4 @@ export interface IActivityApi {
|
|
|
11
9
|
findByDirectoriesList(directories: string[]): Promise<any>
|
|
12
10
|
|
|
13
11
|
correctCounters(): Promise<any>
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Borra en cascada las actividades asociadas a un directoryId.
|
|
17
|
-
* @param directoryId ID del directorio.
|
|
18
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
19
|
-
*/
|
|
20
|
-
// TODO(type-kit): swap a Directory.DeleteByDirectoryResponse cuando se publique
|
|
21
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>>
|
|
22
12
|
}
|
package/src/container.config.ts
CHANGED
|
@@ -180,11 +180,8 @@ import { ISnsSesConnectorApi, SnsSesConnectorApi } from "./sns-ses-connector/ind
|
|
|
180
180
|
// Remittance business — pricingResolve (Dashboard Ops Fase B, puente de resolución de precio en send-time)
|
|
181
181
|
import { IRemittanceBusinessApi, RemittanceBusinessApi } from "./remittance-business/index.js";
|
|
182
182
|
import { IBeneficiaryApi, BeneficiaryApi } from "./beneficiary/index.js";
|
|
183
|
-
import {
|
|
184
|
-
import { IPerformanceProfileApi, PerformanceProfileApi } from "./performance-profile/index.js";
|
|
183
|
+
import { IResearchSheetsApi, ResearchSheetsApi } from "./research-sheets/index.js";
|
|
185
184
|
import { IAuthBusinessApi, AuthBusinessApi } from "./auth-business/index.js";
|
|
186
|
-
import { IPresenceWebsocketApi, PresenceWebsocketApi } from "./presence-websocket/index.js";
|
|
187
|
-
import { INotificationWebsocketApi, NotificationWebsocketApi } from "./notificationWebsockets/index.js";
|
|
188
185
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId (SureKeep F2)
|
|
189
186
|
import { IKycVerificationsBusinessApi, KycVerificationsBusinessApi } from "./kyc/index.js";
|
|
190
187
|
|
|
@@ -343,11 +340,8 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
343
340
|
|
|
344
341
|
// Borrado en cascada del directorio — deleteByDirectoryId por dominio
|
|
345
342
|
bind<IBeneficiaryApi>("IBeneficiaryApi").to(BeneficiaryApi);
|
|
346
|
-
bind<
|
|
347
|
-
bind<IPerformanceProfileApi>("IPerformanceProfileApi").to(PerformanceProfileApi);
|
|
343
|
+
bind<IResearchSheetsApi>("IResearchSheetsApi").to(ResearchSheetsApi);
|
|
348
344
|
bind<IAuthBusinessApi>("IAuthBusinessApi").to(AuthBusinessApi);
|
|
349
|
-
bind<IPresenceWebsocketApi>("IPresenceWebsocketApi").to(PresenceWebsocketApi);
|
|
350
|
-
bind<INotificationWebsocketApi>("INotificationWebsocketApi").to(NotificationWebsocketApi);
|
|
351
345
|
|
|
352
346
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId.
|
|
353
347
|
// La consume el wizard de SureKeep F2 tras el aviso async del stream de `KycVerifications`.
|
|
@@ -4,6 +4,7 @@ import { IHttpRequest } from "@fiado/http-client";
|
|
|
4
4
|
import { IEventHistoryApi } from "./interfaces/IEventHistoryApi.js";
|
|
5
5
|
import { CreateDirectoryUserEventRequest } from "@fiado/type-kit/bin/directory/dtos/CreateDirectoryUserEventRequest.js";
|
|
6
6
|
import { CreateAccountEventRequest } from "@fiado/type-kit/bin/account/dtos/CreateAccountEventRequest.js";
|
|
7
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
7
8
|
|
|
8
9
|
dotenv.config();
|
|
9
10
|
|
|
@@ -105,4 +106,9 @@ export class EventHistoryApi implements IEventHistoryApi {
|
|
|
105
106
|
const url = `${this.baseUrl}accounts/events`;
|
|
106
107
|
return await this.httpRequest.post(`${url}`, request);
|
|
107
108
|
}
|
|
109
|
+
|
|
110
|
+
async deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>> {
|
|
111
|
+
const url = `${this.baseUrl}private/directory/${directoryId}`;
|
|
112
|
+
return await this.httpRequest.delete<FiadoApiResponse<{ deletedCount: number }>>(url);
|
|
113
|
+
}
|
|
108
114
|
}
|
package/src/index.ts
CHANGED
|
@@ -100,8 +100,6 @@ export * from "./sns-ses-connector/index.js";
|
|
|
100
100
|
export * from "./remittance-business/index.js";
|
|
101
101
|
export * from "./modelias-connector/index.js";
|
|
102
102
|
export * from "./beneficiary/index.js";
|
|
103
|
-
export * from "./
|
|
104
|
-
export * from "./performance-profile/index.js";
|
|
103
|
+
export * from "./research-sheets/index.js";
|
|
105
104
|
export * from "./auth-business/index.js";
|
|
106
|
-
export * from "./presence-websocket/index.js";
|
|
107
105
|
export * from "./kyc/index.js";
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { SendMessageCommand, SendMessageRequest, SQSClient } from "@aws-sdk/client-sqs";
|
|
2
2
|
import { injectable } from "inversify";
|
|
3
|
-
import {
|
|
4
|
-
import { IRetailKycInboundPublisher } from "./interfaces/IRetailKycInboundPublisher.js";
|
|
3
|
+
import { IRetailKycInboundPublisher, RetailKycInboundMessage } from "./interfaces/IRetailKycInboundPublisher.js";
|
|
5
4
|
|
|
6
5
|
@injectable()
|
|
7
6
|
export class RetailKycInboundPublisher implements IRetailKycInboundPublisher {
|
|
8
7
|
private readonly RETAIL_KYC_INBOUND_QUEUE_URL = process.env.RETAIL_KYC_INBOUND_QUEUE_URL;
|
|
9
8
|
|
|
10
|
-
async publish(message:
|
|
9
|
+
async publish(message: RetailKycInboundMessage): Promise<void> {
|
|
11
10
|
try {
|
|
12
11
|
const client: SQSClient = new SQSClient();
|
|
13
|
-
// Cola ESTÁNDAR (no FIFO): sin MessageGroupId/MessageDeduplicationId
|
|
14
|
-
// la hace el consumidor con la llave de negocio
|
|
12
|
+
// Cola ESTÁNDAR (no FIFO): sin MessageGroupId/MessageDeduplicationId, y por lo tanto SIN
|
|
13
|
+
// orden garantizado. La deduplicación la hace el consumidor con la llave de negocio: el
|
|
14
|
+
// cierre por (directoryId + verificationId + status + result), la estación por
|
|
15
|
+
// (verificationId + step) — su escritura ya es idempotente. El reordenamiento lo resuelve
|
|
16
|
+
// el `occurredAt` de cada estación, no la cola.
|
|
15
17
|
const sendMessageRequest: SendMessageRequest = {
|
|
16
18
|
QueueUrl: this.RETAIL_KYC_INBOUND_QUEUE_URL,
|
|
17
19
|
MessageBody: JSON.stringify(message),
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import { KycVerificationChangedV1 } from "@fiado/type-kit/bin/kyc/index.js";
|
|
1
|
+
import { KycVerificationChangedV1, KycStepCompletedV1 } from "@fiado/type-kit/bin/kyc/index.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Todo lo que `RetailKycInboundQueue` transporta:
|
|
5
|
+
* - `KycVerificationChangedV1` — el CIERRE de la verificación, con el resultado consolidado.
|
|
6
|
+
* - `KycStepCompletedV1` — el resultado de UNA estación, en cuanto Metamap la cierra.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Es una unión cerrada y no un `unknown` a propósito: el consumidor rutea por `eventType`, así que
|
|
9
|
+
* agregar un tipo acá obliga a tocar también el consumidor — que es exactamente la conversación que
|
|
10
|
+
* tiene que pasar antes de meter un mensaje nuevo en una cola compartida.
|
|
11
|
+
*/
|
|
12
|
+
export type RetailKycInboundMessage = KycVerificationChangedV1 | KycStepCompletedV1;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Publisher del KYC hacia `RetailKycInboundQueue`, que consume `retail-wizard-business` (SureKeep F2).
|
|
16
|
+
*
|
|
17
|
+
* Lo produce `kyc-metamap-webhook`: el cierre cuando la verificación pasa a COMPLETED, y una estación
|
|
18
|
+
* por cada `step_completed`. Vive acá —y no como SDK crudo en el webhook— porque la cola es COMPARTIDA
|
|
19
|
+
* cross-lambda: el estándar Fiado publica a una cola compartida vía Publisher de `@fiado/api-invoker`
|
|
20
|
+
* (mismo patrón que `ITransactionPublisher`).
|
|
10
21
|
*/
|
|
11
22
|
export interface IRetailKycInboundPublisher {
|
|
12
|
-
publish(message:
|
|
23
|
+
publish(message: RetailKycInboundMessage): Promise<void>;
|
|
13
24
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
export * from './queue/NotificationWSMessagePublisher.js';
|
|
2
|
-
export * from './queue/interfaces/INotificationWSMessagesPublisher.js';
|
|
3
|
-
export * from './interfaces/INotificationWebsocketApi.js';
|
|
4
|
-
export * from './NotificationWebsocketApi.js';
|
|
2
|
+
export * from './queue/interfaces/INotificationWSMessagesPublisher.js';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { inject, injectable } from "inversify";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import dotenv from 'dotenv';
|
|
4
|
-
import {
|
|
4
|
+
import { IResearchSheetsApi } from "./interfaces/IResearchSheetsApi.js";
|
|
5
5
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
6
6
|
|
|
7
7
|
dotenv.config();
|
|
8
8
|
|
|
9
9
|
@injectable()
|
|
10
|
-
export class
|
|
10
|
+
export class ResearchSheetsApi implements IResearchSheetsApi {
|
|
11
11
|
|
|
12
|
-
private readonly baseUrl = process.env.
|
|
12
|
+
private readonly baseUrl = process.env.RESEARCH_SHEETS_LAMBDA_URL || "";
|
|
13
13
|
|
|
14
14
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
15
15
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Interfaz para el servicio
|
|
4
|
+
* Interfaz para el servicio Research Sheets (research-sheets).
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface IResearchSheetsApi {
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Borra en cascada las
|
|
9
|
+
* Borra en cascada las research sheets asociadas a un directoryId.
|
|
10
10
|
* @param directoryId ID del directorio.
|
|
11
11
|
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
12
|
*/
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
CreateShortLinkResponse,
|
|
7
7
|
} from "@fiado/type-kit/bin/shortlink/index.js";
|
|
8
8
|
import { IShortlinkBusinessApi } from "./interfaces/IShortlinkBusinessApi.js";
|
|
9
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
9
10
|
|
|
10
11
|
@injectable()
|
|
11
12
|
export default class ShortlinkBusinessApi implements IShortlinkBusinessApi {
|
|
@@ -21,4 +22,11 @@ export default class ShortlinkBusinessApi implements IShortlinkBusinessApi {
|
|
|
21
22
|
const url = `${this.baseUrl}/private/links`;
|
|
22
23
|
return await this.httpRequest.post(url, payload);
|
|
23
24
|
}
|
|
25
|
+
|
|
26
|
+
async deleteByDirectoryId(
|
|
27
|
+
directoryId: string,
|
|
28
|
+
): Promise<FiadoApiResponse<{ deletedCount: number }>> {
|
|
29
|
+
const url = `${this.baseUrl}/private/directory/${directoryId}`;
|
|
30
|
+
return await this.httpRequest.delete<FiadoApiResponse<{ deletedCount: number }>>(url);
|
|
31
|
+
}
|
|
24
32
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
CreateShortLinkRequest,
|
|
4
4
|
CreateShortLinkResponse,
|
|
5
5
|
} from "@fiado/type-kit/bin/shortlink/index.js";
|
|
6
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Contrato del publisher HTTP del lambda `shortlink-business` para su endpoint privado
|
|
@@ -26,4 +27,12 @@ export interface IShortlinkBusinessApi {
|
|
|
26
27
|
* `payload.destination` debe ser **HTTPS** o responde 400 `INVALID_DESTINATION_URL`.
|
|
27
28
|
*/
|
|
28
29
|
createLink(payload: CreateShortLinkRequest): Promise<StandardResponse<CreateShortLinkResponse>>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Borra en cascada los shortlinks asociados a un directoryId.
|
|
33
|
+
* @param directoryId ID del directorio.
|
|
34
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
35
|
+
*/
|
|
36
|
+
// TODO(type-kit): swap a Directory.DeleteByDirectoryResponse cuando se publique
|
|
37
|
+
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>>;
|
|
29
38
|
}
|
package/src/membership/index.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { inject, injectable } from "inversify";
|
|
2
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import dotenv from 'dotenv';
|
|
4
|
-
import { INotificationWebsocketApi } from "./interfaces/INotificationWebsocketApi.js";
|
|
5
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
6
|
-
|
|
7
|
-
dotenv.config();
|
|
8
|
-
|
|
9
|
-
@injectable()
|
|
10
|
-
export class NotificationWebsocketApi implements INotificationWebsocketApi {
|
|
11
|
-
|
|
12
|
-
private readonly baseUrl = process.env.NOTIFICATIONS_WEBSOCKET_LAMBDA_URL || "";
|
|
13
|
-
|
|
14
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
15
|
-
|
|
16
|
-
async deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>> {
|
|
17
|
-
const url = `${this.baseUrl}private/directory/${directoryId}`;
|
|
18
|
-
return await this.httpRequest.delete<FiadoApiResponse<{ deletedCount: number }>>(url);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Interfaz para el servicio Notifications Websocket (notifications-websocket).
|
|
5
|
-
*/
|
|
6
|
-
export interface INotificationWebsocketApi {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Borra en cascada las conexiones/notificaciones WS asociadas a un directoryId.
|
|
10
|
-
* @param directoryId ID del directorio.
|
|
11
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
|
-
*/
|
|
13
|
-
// TODO(type-kit): swap a Directory.DeleteByDirectoryResponse cuando se publique
|
|
14
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>>;
|
|
15
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { inject, injectable } from "inversify";
|
|
2
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import dotenv from 'dotenv';
|
|
4
|
-
import { IPerformanceProfileApi } from "./interfaces/IPerformanceProfileApi.js";
|
|
5
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
6
|
-
|
|
7
|
-
dotenv.config();
|
|
8
|
-
|
|
9
|
-
@injectable()
|
|
10
|
-
export class PerformanceProfileApi implements IPerformanceProfileApi {
|
|
11
|
-
|
|
12
|
-
private readonly baseUrl = process.env.PERFORMANCE_PROFILE_BUSINESS_LAMBDA_URL || "";
|
|
13
|
-
|
|
14
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
15
|
-
|
|
16
|
-
async deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>> {
|
|
17
|
-
const url = `${this.baseUrl}private/directory/${directoryId}`;
|
|
18
|
-
return await this.httpRequest.delete<FiadoApiResponse<{ deletedCount: number }>>(url);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Interfaz para el servicio Performance Profile (performance-profile-business).
|
|
5
|
-
*/
|
|
6
|
-
export interface IPerformanceProfileApi {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Borra en cascada los perfiles de desempeño asociados a un directoryId.
|
|
10
|
-
* @param directoryId ID del directorio.
|
|
11
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
|
-
*/
|
|
13
|
-
// TODO(type-kit): swap a Directory.DeleteByDirectoryResponse cuando se publique
|
|
14
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>>;
|
|
15
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { inject, injectable } from "inversify";
|
|
2
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import dotenv from 'dotenv';
|
|
4
|
-
import { IPresenceWebsocketApi } from "./interfaces/IPresenceWebsocketApi.js";
|
|
5
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
6
|
-
|
|
7
|
-
dotenv.config();
|
|
8
|
-
|
|
9
|
-
@injectable()
|
|
10
|
-
export class PresenceWebsocketApi implements IPresenceWebsocketApi {
|
|
11
|
-
|
|
12
|
-
private readonly baseUrl = process.env.PRESENCE_WEBSOCKET_LAMBDA_URL || "";
|
|
13
|
-
|
|
14
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
15
|
-
|
|
16
|
-
async deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>> {
|
|
17
|
-
const url = `${this.baseUrl}private/directory/${directoryId}`;
|
|
18
|
-
return await this.httpRequest.delete<FiadoApiResponse<{ deletedCount: number }>>(url);
|
|
19
|
-
}
|
|
20
|
-
}
|