@fiado/api-invoker 5.14.0 → 5.16.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/collection-engine/api/CollectionEngineApi.d.ts +17 -0
- package/bin/{notificationWebsockets/NotificationWebsocketApi.js → collection-engine/api/CollectionEngineApi.js} +20 -10
- package/bin/collection-engine/api/interfaces/ICollectionEngineApi.d.ts +30 -0
- package/bin/collection-engine/index.d.ts +2 -0
- package/bin/collection-engine/index.js +2 -0
- package/bin/container.config.js +5 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/transactionProcessor/api/TransactionProcessorApi.d.ts +3 -1
- package/bin/transactionProcessor/api/TransactionProcessorApi.js +4 -0
- package/bin/transactionProcessor/api/interfaces/ITransactionProcessorApi.d.ts +11 -0
- package/bin/zendesk/index.d.ts +2 -0
- package/bin/zendesk/index.js +2 -0
- package/bin/zendesk/queue/ZendeskAlertsPublisher.d.ts +9 -0
- package/bin/zendesk/queue/ZendeskAlertsPublisher.js +37 -0
- package/bin/zendesk/queue/interfaces/IZendeskAlertsPublisher.d.ts +15 -0
- package/package.json +2 -2
- package/src/collection-engine/api/CollectionEngineApi.ts +38 -0
- package/src/collection-engine/api/interfaces/ICollectionEngineApi.ts +38 -0
- package/src/collection-engine/index.ts +2 -0
- package/src/container.config.ts +9 -0
- package/src/index.ts +1 -0
- package/src/transactionProcessor/api/TransactionProcessorApi.ts +12 -1
- package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +17 -0
- package/src/zendesk/index.ts +2 -0
- package/src/zendesk/queue/ZendeskAlertsPublisher.ts +38 -0
- package/src/zendesk/queue/interfaces/IZendeskAlertsPublisher.ts +17 -0
- package/bin/membership/MembershipApi.d.ts +0 -12
- package/bin/membership/MembershipApi.js +0 -32
- package/bin/membership/index.d.ts +0 -2
- package/bin/membership/index.js +0 -2
- package/bin/membership/interfaces/IMembershipApi.d.ts +0 -15
- package/bin/notificationWebsockets/NotificationWebsocketApi.d.ts +0 -12
- package/bin/notificationWebsockets/interfaces/INotificationWebsocketApi.d.ts +0 -15
- package/bin/performance-profile/PerformanceProfileApi.d.ts +0 -12
- package/bin/performance-profile/PerformanceProfileApi.js +0 -32
- package/bin/performance-profile/index.d.ts +0 -2
- package/bin/performance-profile/index.js +0 -2
- package/bin/performance-profile/interfaces/IPerformanceProfileApi.d.ts +0 -15
- package/bin/performance-profile/interfaces/IPerformanceProfileApi.js +0 -1
- package/bin/presence-websocket/PresenceWebsocketApi.d.ts +0 -12
- package/bin/presence-websocket/PresenceWebsocketApi.js +0 -32
- package/bin/presence-websocket/index.d.ts +0 -2
- package/bin/presence-websocket/index.js +0 -2
- package/bin/presence-websocket/interfaces/IPresenceWebsocketApi.d.ts +0 -15
- package/bin/presence-websocket/interfaces/IPresenceWebsocketApi.js +0 -1
- /package/bin/{membership/interfaces/IMembershipApi.js → collection-engine/api/interfaces/ICollectionEngineApi.js} +0 -0
- /package/bin/{notificationWebsockets/interfaces/INotificationWebsocketApi.js → zendesk/queue/interfaces/IZendeskAlertsPublisher.js} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { CollectRequest, CollectResponse, RegisterCollectibleRequest } from "@fiado/type-kit/bin/collection/index.js";
|
|
3
|
+
import { ICollectionEngineApi } from "./interfaces/ICollectionEngineApi.js";
|
|
4
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
5
|
+
/**
|
|
6
|
+
* Cliente concreto para los endpoints privados del `collection-engine-business` Lambda.
|
|
7
|
+
* Base URL viene de `COLLECTION_ENGINE_LAMBDA_URL`.
|
|
8
|
+
*/
|
|
9
|
+
export default class CollectionEngineApi implements ICollectionEngineApi {
|
|
10
|
+
private httpRequest;
|
|
11
|
+
private readonly baseUrl;
|
|
12
|
+
constructor(httpRequest: IHttpRequest);
|
|
13
|
+
collect(request: CollectRequest): Promise<FiadoApiResponse<CollectResponse>>;
|
|
14
|
+
registerCollectible(request: RegisterCollectibleRequest): Promise<FiadoApiResponse<boolean>>;
|
|
15
|
+
deregister(ownerRef: string, productId: string, chargeId: string): Promise<FiadoApiResponse<boolean>>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -11,22 +11,32 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
13
|
import { inject, injectable } from "inversify";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Cliente concreto para los endpoints privados del `collection-engine-business` Lambda.
|
|
16
|
+
* Base URL viene de `COLLECTION_ENGINE_LAMBDA_URL`.
|
|
17
|
+
*/
|
|
18
|
+
let CollectionEngineApi = class CollectionEngineApi {
|
|
17
19
|
httpRequest;
|
|
18
|
-
baseUrl = process.env.
|
|
20
|
+
baseUrl = process.env.COLLECTION_ENGINE_LAMBDA_URL || "";
|
|
19
21
|
constructor(httpRequest) {
|
|
20
22
|
this.httpRequest = httpRequest;
|
|
21
23
|
}
|
|
22
|
-
async
|
|
23
|
-
const url = `${this.baseUrl}
|
|
24
|
-
return await this.httpRequest.
|
|
24
|
+
async collect(request) {
|
|
25
|
+
const url = `${this.baseUrl}collection/collect`;
|
|
26
|
+
return await this.httpRequest.post(url, request);
|
|
27
|
+
}
|
|
28
|
+
async registerCollectible(request) {
|
|
29
|
+
const url = `${this.baseUrl}collection/register`;
|
|
30
|
+
return await this.httpRequest.post(url, request);
|
|
31
|
+
}
|
|
32
|
+
async deregister(ownerRef, productId, chargeId) {
|
|
33
|
+
const url = `${this.baseUrl}collection/deregister`;
|
|
34
|
+
return await this.httpRequest.post(url, { ownerRef, productId, chargeId });
|
|
25
35
|
}
|
|
26
36
|
};
|
|
27
|
-
|
|
37
|
+
CollectionEngineApi = __decorate([
|
|
28
38
|
injectable(),
|
|
29
39
|
__param(0, inject("IHttpRequest")),
|
|
30
40
|
__metadata("design:paramtypes", [Object])
|
|
31
|
-
],
|
|
32
|
-
export
|
|
41
|
+
], CollectionEngineApi);
|
|
42
|
+
export default CollectionEngineApi;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CollectRequest, CollectResponse, RegisterCollectibleRequest } from "@fiado/type-kit/bin/collection/index.js";
|
|
2
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
3
|
+
/**
|
|
4
|
+
* Cliente para invocar los endpoints privados del lambda `collection-engine-business`.
|
|
5
|
+
*
|
|
6
|
+
* Los endpoints viven bajo `COLLECTION_ENGINE_LAMBDA_URL` (API Gateway privado / VPC).
|
|
7
|
+
* El motor es agnóstico de proveedores/cuentas — los dominios (une-credit,
|
|
8
|
+
* surekeep-retail, etc.) sólo hablan el contrato genérico de `PendingCharge`.
|
|
9
|
+
*/
|
|
10
|
+
export interface ICollectionEngineApi {
|
|
11
|
+
/**
|
|
12
|
+
* Cobro on-demand síncrono. El dominio pide al motor que intente cobrar
|
|
13
|
+
* un cargo puntual (fuera del barrido normal de la cascada).
|
|
14
|
+
* Backend: POST /collection/collect (privado VPC).
|
|
15
|
+
*/
|
|
16
|
+
collect(request: CollectRequest): Promise<FiadoApiResponse<CollectResponse>>;
|
|
17
|
+
/**
|
|
18
|
+
* Alta de un cargo cobrable en el índice del motor. Lo invoca el dominio
|
|
19
|
+
* dueño cuando nace una deuda cobrable (installment, cuota, etc.).
|
|
20
|
+
* Backend: POST /collection/register (privado VPC).
|
|
21
|
+
*/
|
|
22
|
+
registerCollectible(request: RegisterCollectibleRequest): Promise<FiadoApiResponse<boolean>>;
|
|
23
|
+
/**
|
|
24
|
+
* Baja de un cargo del índice del motor (equivalente a cancelar el intent
|
|
25
|
+
* en curso). Lo invoca el dominio dueño cuando el cargo deja de ser cobrable.
|
|
26
|
+
* Backend: POST /collection/deregister (privado VPC).
|
|
27
|
+
*/
|
|
28
|
+
deregister(ownerRef: string, productId: string, chargeId: string): Promise<FiadoApiResponse<boolean>>;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
package/bin/container.config.js
CHANGED
|
@@ -48,6 +48,7 @@ import TransactionAlertApi from "./riskProfile/api/TransactionAlertApi.js";
|
|
|
48
48
|
import { DirectoriesApi } from "./directories/index.js";
|
|
49
49
|
import CognitoConnectorApi from "./cognitoConnector/CognitoConnectorApi.js";
|
|
50
50
|
import { ZendeskApi } from "./zendesk/index.js";
|
|
51
|
+
import ZendeskAlertsPublisher from "./zendesk/queue/ZendeskAlertsPublisher.js";
|
|
51
52
|
import { BlackListApi } from "./blacklist/index.js";
|
|
52
53
|
import { DeviceApi } from "./device/index.js";
|
|
53
54
|
import { ObservationsApi } from "./observations/index.js";
|
|
@@ -127,6 +128,7 @@ import { ResearchSheetsApi } from "./research-sheets/index.js";
|
|
|
127
128
|
import { AuthBusinessApi } from "./auth-business/index.js";
|
|
128
129
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId (SureKeep F2)
|
|
129
130
|
import { KycVerificationsBusinessApi } from "./kyc/index.js";
|
|
131
|
+
import CollectionEngineApi from "./collection-engine/api/CollectionEngineApi.js";
|
|
130
132
|
export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
131
133
|
// UTILS bindings
|
|
132
134
|
bind("InvokerUtils").to(InvokerUtils);
|
|
@@ -182,6 +184,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
182
184
|
bind("ICognitoConnectorApi").to(CognitoConnectorApi);
|
|
183
185
|
bind("ICognitoV2Api").to(CognitoApi);
|
|
184
186
|
bind("IZendeskApi").to(ZendeskApi);
|
|
187
|
+
bind("IZendeskAlertsPublisher").to(ZendeskAlertsPublisher);
|
|
185
188
|
bind("IBlackListApi").to(BlackListApi);
|
|
186
189
|
bind("IDeviceApi").to(DeviceApi);
|
|
187
190
|
bind("IObservationsApi").to(ObservationsApi);
|
|
@@ -269,4 +272,6 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
269
272
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId.
|
|
270
273
|
// La consume el wizard de SureKeep F2 tras el aviso async del stream de `KycVerifications`.
|
|
271
274
|
bind("IKycVerificationsBusinessApi").to(KycVerificationsBusinessApi);
|
|
275
|
+
// Collection engine — motor de cobro central multitenant (collect/registerCollectible/deregister)
|
|
276
|
+
bind("ICollectionEngineApi").to(CollectionEngineApi);
|
|
272
277
|
});
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ITransactionProcessorApi } from "./interfaces/ITransactionProcessorApi.js";
|
|
2
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import { AuthorizeCollectorOrderRequest, AuthorizeCollectorOrderResponse, AuthorizeCollectorTransactionRequest, AuthorizeCreditCardPurchaseRequest, AuthorizeSpeiBankTransferNcRequest, AuthorizeSpeiMexBankTransferInRequest, AuthorizeRenewalPreAuthRequest, AuthorizeRenewalPreAuthResponse } from "@fiado/type-kit/bin/transactionProcessor/index.js";
|
|
4
4
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
5
5
|
import { ValidateWalletFundingRequest, ValidateWalletFundingResponse, CreditWalletFundingRequest, CreditWalletFundingResponse, ReverseWalletFundingRequest, ReverseWalletFundingResponse, GetWalletFundingLimitRequest, GetWalletFundingLimitResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
6
6
|
import { RemittanceCreditBackRequest, RemittanceCreditBackResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
7
|
+
import { AuthorizeCollectionMovementRequest, AuthorizeCollectionMovementResponse } from "@fiado/type-kit/bin/collection/index.js";
|
|
7
8
|
type ProcessUpdateLevelRequest = import("@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest.js").default;
|
|
8
9
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
9
10
|
export default class TransactionProcessorApi implements ITransactionProcessorApi {
|
|
@@ -22,5 +23,6 @@ export default class TransactionProcessorApi implements ITransactionProcessorApi
|
|
|
22
23
|
walletFundingReverse(request: ReverseWalletFundingRequest): Promise<ApiGatewayResponse<ReverseWalletFundingResponse>>;
|
|
23
24
|
walletFundingGetLimit(request: GetWalletFundingLimitRequest): Promise<ApiGatewayResponse<GetWalletFundingLimitResponse>>;
|
|
24
25
|
creditBack(request: RemittanceCreditBackRequest): Promise<FiadoApiResponse<RemittanceCreditBackResponse>>;
|
|
26
|
+
authorizeCollectionMovement(request: AuthorizeCollectionMovementRequest): Promise<FiadoApiResponse<AuthorizeCollectionMovementResponse>>;
|
|
25
27
|
}
|
|
26
28
|
export {};
|
|
@@ -65,6 +65,10 @@ let TransactionProcessorApi = class TransactionProcessorApi {
|
|
|
65
65
|
const url = `${this.baseUrl}remittance/credit-back`;
|
|
66
66
|
return await this.httpRequest.post(url, request);
|
|
67
67
|
}
|
|
68
|
+
async authorizeCollectionMovement(request) {
|
|
69
|
+
const url = `${this.baseUrl}collection/authorize`;
|
|
70
|
+
return await this.httpRequest.post(url, request);
|
|
71
|
+
}
|
|
68
72
|
};
|
|
69
73
|
TransactionProcessorApi = __decorate([
|
|
70
74
|
injectable(),
|
|
@@ -3,6 +3,7 @@ import { AuthorizeCollectorOrderRequest, AuthorizeCollectorOrderResponse, Author
|
|
|
3
3
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
4
4
|
import { ValidateWalletFundingRequest, ValidateWalletFundingResponse, CreditWalletFundingRequest, CreditWalletFundingResponse, ReverseWalletFundingRequest, ReverseWalletFundingResponse, GetWalletFundingLimitRequest, GetWalletFundingLimitResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
5
5
|
import { RemittanceCreditBackRequest, RemittanceCreditBackResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
6
|
+
import { AuthorizeCollectionMovementRequest, AuthorizeCollectionMovementResponse } from "@fiado/type-kit/bin/collection/index.js";
|
|
6
7
|
type ProcessUpdateLevelRequest = import("@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest.js").default;
|
|
7
8
|
export interface ITransactionProcessorApi {
|
|
8
9
|
authorizeTransaction(request: AuthorizeCreditCardPurchaseRequest): Promise<any>;
|
|
@@ -43,5 +44,15 @@ export interface ITransactionProcessorApi {
|
|
|
43
44
|
* Backend: POST /transaction-processor/remittance/credit-back (privado VPC).
|
|
44
45
|
*/
|
|
45
46
|
creditBack(request: RemittanceCreditBackRequest): Promise<FiadoApiResponse<RemittanceCreditBackResponse>>;
|
|
47
|
+
/**
|
|
48
|
+
* Autoriza un movimiento de cobro pedido por el motor de cobro central
|
|
49
|
+
* (collection-engine-business). Endpoint nuevo y aditivo — reusa
|
|
50
|
+
* internamente los ejecutores ya existentes (executeFinancialOperation
|
|
51
|
+
* para el lock del pocket USD preauth, updateAccountBalance para
|
|
52
|
+
* principal USD/MXN). No altera los rails existentes de la app.
|
|
53
|
+
* Backend: POST /transaction-processor/collection/authorize (privado VPC).
|
|
54
|
+
* Idempotente por `executionId` (@IdempotencyController).
|
|
55
|
+
*/
|
|
56
|
+
authorizeCollectionMovement(request: AuthorizeCollectionMovementRequest): Promise<FiadoApiResponse<AuthorizeCollectionMovementResponse>>;
|
|
46
57
|
}
|
|
47
58
|
export {};
|
package/bin/zendesk/index.d.ts
CHANGED
package/bin/zendesk/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ZendeskInternalAlertRequest } from "@fiado/type-kit/bin/helpdesk/index.js";
|
|
2
|
+
import { SendProactiveMessageRequest } from "@fiado/type-kit/bin/zendeskMessaging/index.js";
|
|
3
|
+
import { IZendeskAlertsPublisher } from "./interfaces/IZendeskAlertsPublisher.js";
|
|
4
|
+
export default class ZendeskAlertsPublisher implements IZendeskAlertsPublisher {
|
|
5
|
+
private readonly ZENDESK_ALERTS_QUEUE;
|
|
6
|
+
createInternalNote(alert: ZendeskInternalAlertRequest): Promise<void>;
|
|
7
|
+
sendProactiveMessage(message: SendProactiveMessageRequest): Promise<void>;
|
|
8
|
+
private publish;
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import { injectable } from "inversify";
|
|
8
|
+
import { SendMessageCommand, SQSClient } from "@aws-sdk/client-sqs";
|
|
9
|
+
import { ZendeskAlertKind } from "@fiado/type-kit/bin/helpdesk/index.js";
|
|
10
|
+
let ZendeskAlertsPublisher = class ZendeskAlertsPublisher {
|
|
11
|
+
ZENDESK_ALERTS_QUEUE = process.env.ZENDESK_ALERTS_QUEUE;
|
|
12
|
+
async createInternalNote(alert) {
|
|
13
|
+
await this.publish({ kind: ZendeskAlertKind.INTERNAL_NOTE, payload: alert });
|
|
14
|
+
}
|
|
15
|
+
async sendProactiveMessage(message) {
|
|
16
|
+
await this.publish({ kind: ZendeskAlertKind.PROACTIVE_MESSAGE, payload: message });
|
|
17
|
+
}
|
|
18
|
+
async publish(message) {
|
|
19
|
+
try {
|
|
20
|
+
const client = new SQSClient();
|
|
21
|
+
const sendMessageRequest = {
|
|
22
|
+
QueueUrl: this.ZENDESK_ALERTS_QUEUE,
|
|
23
|
+
MessageBody: JSON.stringify(message)
|
|
24
|
+
};
|
|
25
|
+
const command = new SendMessageCommand(sendMessageRequest);
|
|
26
|
+
await client.send(command);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
30
|
+
throw new Error(`Error publishing message to queue ${': ' + errorMessage}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
ZendeskAlertsPublisher = __decorate([
|
|
35
|
+
injectable()
|
|
36
|
+
], ZendeskAlertsPublisher);
|
|
37
|
+
export default ZendeskAlertsPublisher;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ZendeskInternalAlertRequest } from "@fiado/type-kit/bin/helpdesk/index.js";
|
|
2
|
+
import { SendProactiveMessageRequest } from "@fiado/type-kit/bin/zendeskMessaging/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Publica alertas hacia Zendesk sin pagar su latencia: el caller encola y sigue.
|
|
5
|
+
* Consume zendesk-business.
|
|
6
|
+
*/
|
|
7
|
+
export interface IZendeskAlertsPublisher {
|
|
8
|
+
/** Nota interna sobre un usuario. Solo la ven los agentes. */
|
|
9
|
+
createInternalNote(alert: ZendeskInternalAlertRequest): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Mensaje al chat del usuario. Si el usuario está esperando la respuesta ahora, conviene
|
|
12
|
+
* el endpoint síncrono `IZendeskApi.sendProactiveMessage`: acá el fallo no es inmediato.
|
|
13
|
+
*/
|
|
14
|
+
sendProactiveMessage(message: SendProactiveMessageRequest): Promise<void>;
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.16.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.265.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import {
|
|
4
|
+
CollectRequest,
|
|
5
|
+
CollectResponse,
|
|
6
|
+
RegisterCollectibleRequest,
|
|
7
|
+
} from "@fiado/type-kit/bin/collection/index.js";
|
|
8
|
+
import { ICollectionEngineApi } from "./interfaces/ICollectionEngineApi.js";
|
|
9
|
+
|
|
10
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Cliente concreto para los endpoints privados del `collection-engine-business` Lambda.
|
|
14
|
+
* Base URL viene de `COLLECTION_ENGINE_LAMBDA_URL`.
|
|
15
|
+
*/
|
|
16
|
+
@injectable()
|
|
17
|
+
export default class CollectionEngineApi implements ICollectionEngineApi {
|
|
18
|
+
|
|
19
|
+
private readonly baseUrl = process.env.COLLECTION_ENGINE_LAMBDA_URL || "";
|
|
20
|
+
|
|
21
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async collect(request: CollectRequest): Promise<FiadoApiResponse<CollectResponse>> {
|
|
25
|
+
const url = `${this.baseUrl}collection/collect`;
|
|
26
|
+
return await this.httpRequest.post(url, request);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async registerCollectible(request: RegisterCollectibleRequest): Promise<FiadoApiResponse<boolean>> {
|
|
30
|
+
const url = `${this.baseUrl}collection/register`;
|
|
31
|
+
return await this.httpRequest.post(url, request);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async deregister(ownerRef: string, productId: string, chargeId: string): Promise<FiadoApiResponse<boolean>> {
|
|
35
|
+
const url = `${this.baseUrl}collection/deregister`;
|
|
36
|
+
return await this.httpRequest.post(url, { ownerRef, productId, chargeId });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CollectRequest,
|
|
3
|
+
CollectResponse,
|
|
4
|
+
RegisterCollectibleRequest,
|
|
5
|
+
} from "@fiado/type-kit/bin/collection/index.js";
|
|
6
|
+
|
|
7
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Cliente para invocar los endpoints privados del lambda `collection-engine-business`.
|
|
11
|
+
*
|
|
12
|
+
* Los endpoints viven bajo `COLLECTION_ENGINE_LAMBDA_URL` (API Gateway privado / VPC).
|
|
13
|
+
* El motor es agnóstico de proveedores/cuentas — los dominios (une-credit,
|
|
14
|
+
* surekeep-retail, etc.) sólo hablan el contrato genérico de `PendingCharge`.
|
|
15
|
+
*/
|
|
16
|
+
export interface ICollectionEngineApi {
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Cobro on-demand síncrono. El dominio pide al motor que intente cobrar
|
|
20
|
+
* un cargo puntual (fuera del barrido normal de la cascada).
|
|
21
|
+
* Backend: POST /collection/collect (privado VPC).
|
|
22
|
+
*/
|
|
23
|
+
collect(request: CollectRequest): Promise<FiadoApiResponse<CollectResponse>>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Alta de un cargo cobrable en el índice del motor. Lo invoca el dominio
|
|
27
|
+
* dueño cuando nace una deuda cobrable (installment, cuota, etc.).
|
|
28
|
+
* Backend: POST /collection/register (privado VPC).
|
|
29
|
+
*/
|
|
30
|
+
registerCollectible(request: RegisterCollectibleRequest): Promise<FiadoApiResponse<boolean>>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Baja de un cargo del índice del motor (equivalente a cancelar el intent
|
|
34
|
+
* en curso). Lo invoca el dominio dueño cuando el cargo deja de ser cobrable.
|
|
35
|
+
* Backend: POST /collection/deregister (privado VPC).
|
|
36
|
+
*/
|
|
37
|
+
deregister(ownerRef: string, productId: string, chargeId: string): Promise<FiadoApiResponse<boolean>>;
|
|
38
|
+
}
|
package/src/container.config.ts
CHANGED
|
@@ -75,6 +75,8 @@ import { DirectoriesApi, IDirectoriesApi } from "./directories/index.js";
|
|
|
75
75
|
import { ICognitoConnectorApi, ICognitoV2Api } from "./cognitoConnector/index.js";
|
|
76
76
|
import CognitoConnectorApi from "./cognitoConnector/CognitoConnectorApi.js";
|
|
77
77
|
import { IZendeskApi, ZendeskApi } from "./zendesk/index.js";
|
|
78
|
+
import ZendeskAlertsPublisher from "./zendesk/queue/ZendeskAlertsPublisher.js";
|
|
79
|
+
import { IZendeskAlertsPublisher } from "./zendesk/queue/interfaces/IZendeskAlertsPublisher.js";
|
|
78
80
|
import { BlackListApi, IBlackListApi } from "./blacklist/index.js";
|
|
79
81
|
import { DeviceApi, IDeviceApi } from "./device/index.js";
|
|
80
82
|
import { IObservationsApi, ObservationsApi } from "./observations/index.js";
|
|
@@ -190,6 +192,9 @@ import { IResearchSheetsApi, ResearchSheetsApi } from "./research-sheets/index.j
|
|
|
190
192
|
import { IAuthBusinessApi, AuthBusinessApi } from "./auth-business/index.js";
|
|
191
193
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId (SureKeep F2)
|
|
192
194
|
import { IKycVerificationsBusinessApi, KycVerificationsBusinessApi } from "./kyc/index.js";
|
|
195
|
+
// Collection engine — cliente del motor de cobro central (collect/registerCollectible/deregister)
|
|
196
|
+
import { ICollectionEngineApi } from "./collection-engine/index.js";
|
|
197
|
+
import CollectionEngineApi from "./collection-engine/api/CollectionEngineApi.js";
|
|
193
198
|
|
|
194
199
|
export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
195
200
|
// UTILS bindings
|
|
@@ -247,6 +252,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
247
252
|
bind<ICognitoConnectorApi>("ICognitoConnectorApi").to(CognitoConnectorApi);
|
|
248
253
|
bind<ICognitoV2Api>("ICognitoV2Api").to(CognitoApi);
|
|
249
254
|
bind<IZendeskApi>("IZendeskApi").to(ZendeskApi);
|
|
255
|
+
bind<IZendeskAlertsPublisher>("IZendeskAlertsPublisher").to(ZendeskAlertsPublisher);
|
|
250
256
|
bind<IBlackListApi>("IBlackListApi").to(BlackListApi);
|
|
251
257
|
bind<IDeviceApi>("IDeviceApi").to(DeviceApi);
|
|
252
258
|
bind<IObservationsApi>("IObservationsApi").to(ObservationsApi);
|
|
@@ -355,4 +361,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
355
361
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId.
|
|
356
362
|
// La consume el wizard de SureKeep F2 tras el aviso async del stream de `KycVerifications`.
|
|
357
363
|
bind<IKycVerificationsBusinessApi>("IKycVerificationsBusinessApi").to(KycVerificationsBusinessApi);
|
|
364
|
+
|
|
365
|
+
// Collection engine — motor de cobro central multitenant (collect/registerCollectible/deregister)
|
|
366
|
+
bind<ICollectionEngineApi>("ICollectionEngineApi").to(CollectionEngineApi);
|
|
358
367
|
});
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITransactionProcessorApi } from "./interfaces/ITransactionProcessorApi.js";
|
|
2
2
|
import { inject, injectable } from "inversify";
|
|
3
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
4
4
|
import {
|
|
5
5
|
AuthorizeCollectorOrderRequest,
|
|
6
6
|
AuthorizeCollectorOrderResponse,
|
|
@@ -22,6 +22,10 @@ import {
|
|
|
22
22
|
GetWalletFundingLimitResponse,
|
|
23
23
|
} from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
24
24
|
import { RemittanceCreditBackRequest, RemittanceCreditBackResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
25
|
+
import {
|
|
26
|
+
AuthorizeCollectionMovementRequest,
|
|
27
|
+
AuthorizeCollectionMovementResponse,
|
|
28
|
+
} from "@fiado/type-kit/bin/collection/index.js";
|
|
25
29
|
type ProcessUpdateLevelRequest = import("@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest.js").default;
|
|
26
30
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
27
31
|
|
|
@@ -102,4 +106,11 @@ export default class TransactionProcessorApi implements ITransactionProcessorApi
|
|
|
102
106
|
const url = `${this.baseUrl}remittance/credit-back`;
|
|
103
107
|
return await this.httpRequest.post(url, request);
|
|
104
108
|
}
|
|
109
|
+
|
|
110
|
+
async authorizeCollectionMovement(
|
|
111
|
+
request: AuthorizeCollectionMovementRequest,
|
|
112
|
+
): Promise<FiadoApiResponse<AuthorizeCollectionMovementResponse>> {
|
|
113
|
+
const url = `${this.baseUrl}collection/authorize`;
|
|
114
|
+
return await this.httpRequest.post(url, request);
|
|
115
|
+
}
|
|
105
116
|
}
|
|
@@ -21,6 +21,10 @@ import {
|
|
|
21
21
|
GetWalletFundingLimitResponse,
|
|
22
22
|
} from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
23
23
|
import { RemittanceCreditBackRequest, RemittanceCreditBackResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
24
|
+
import {
|
|
25
|
+
AuthorizeCollectionMovementRequest,
|
|
26
|
+
AuthorizeCollectionMovementResponse,
|
|
27
|
+
} from "@fiado/type-kit/bin/collection/index.js";
|
|
24
28
|
type ProcessUpdateLevelRequest = import("@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest.js").default;
|
|
25
29
|
|
|
26
30
|
export interface ITransactionProcessorApi {
|
|
@@ -84,4 +88,17 @@ export interface ITransactionProcessorApi {
|
|
|
84
88
|
creditBack(
|
|
85
89
|
request: RemittanceCreditBackRequest,
|
|
86
90
|
): Promise<FiadoApiResponse<RemittanceCreditBackResponse>>;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Autoriza un movimiento de cobro pedido por el motor de cobro central
|
|
94
|
+
* (collection-engine-business). Endpoint nuevo y aditivo — reusa
|
|
95
|
+
* internamente los ejecutores ya existentes (executeFinancialOperation
|
|
96
|
+
* para el lock del pocket USD preauth, updateAccountBalance para
|
|
97
|
+
* principal USD/MXN). No altera los rails existentes de la app.
|
|
98
|
+
* Backend: POST /transaction-processor/collection/authorize (privado VPC).
|
|
99
|
+
* Idempotente por `executionId` (@IdempotencyController).
|
|
100
|
+
*/
|
|
101
|
+
authorizeCollectionMovement(
|
|
102
|
+
request: AuthorizeCollectionMovementRequest,
|
|
103
|
+
): Promise<FiadoApiResponse<AuthorizeCollectionMovementResponse>>;
|
|
87
104
|
}
|
package/src/zendesk/index.ts
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { injectable } from "inversify";
|
|
2
|
+
import { SendMessageCommand, SendMessageRequest, SQSClient } from "@aws-sdk/client-sqs";
|
|
3
|
+
import {
|
|
4
|
+
IZendeskAlertMessage,
|
|
5
|
+
ZendeskAlertKind,
|
|
6
|
+
ZendeskInternalAlertRequest
|
|
7
|
+
} from "@fiado/type-kit/bin/helpdesk/index.js";
|
|
8
|
+
import { SendProactiveMessageRequest } from "@fiado/type-kit/bin/zendeskMessaging/index.js";
|
|
9
|
+
import { IZendeskAlertsPublisher } from "./interfaces/IZendeskAlertsPublisher.js";
|
|
10
|
+
|
|
11
|
+
@injectable()
|
|
12
|
+
export default class ZendeskAlertsPublisher implements IZendeskAlertsPublisher {
|
|
13
|
+
|
|
14
|
+
private readonly ZENDESK_ALERTS_QUEUE = process.env.ZENDESK_ALERTS_QUEUE;
|
|
15
|
+
|
|
16
|
+
async createInternalNote(alert: ZendeskInternalAlertRequest): Promise<void> {
|
|
17
|
+
await this.publish({ kind: ZendeskAlertKind.INTERNAL_NOTE, payload: alert });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async sendProactiveMessage(message: SendProactiveMessageRequest): Promise<void> {
|
|
21
|
+
await this.publish({ kind: ZendeskAlertKind.PROACTIVE_MESSAGE, payload: message });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private async publish(message: IZendeskAlertMessage): Promise<void> {
|
|
25
|
+
try {
|
|
26
|
+
const client: SQSClient = new SQSClient();
|
|
27
|
+
const sendMessageRequest: SendMessageRequest = {
|
|
28
|
+
QueueUrl: this.ZENDESK_ALERTS_QUEUE,
|
|
29
|
+
MessageBody: JSON.stringify(message)
|
|
30
|
+
};
|
|
31
|
+
const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
|
|
32
|
+
await client.send(command);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
35
|
+
throw new Error(`Error publishing message to queue ${': ' + errorMessage}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ZendeskInternalAlertRequest } from "@fiado/type-kit/bin/helpdesk/index.js";
|
|
2
|
+
import { SendProactiveMessageRequest } from "@fiado/type-kit/bin/zendeskMessaging/index.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Publica alertas hacia Zendesk sin pagar su latencia: el caller encola y sigue.
|
|
6
|
+
* Consume zendesk-business.
|
|
7
|
+
*/
|
|
8
|
+
export interface IZendeskAlertsPublisher {
|
|
9
|
+
/** Nota interna sobre un usuario. Solo la ven los agentes. */
|
|
10
|
+
createInternalNote(alert: ZendeskInternalAlertRequest): Promise<void>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Mensaje al chat del usuario. Si el usuario está esperando la respuesta ahora, conviene
|
|
14
|
+
* el endpoint síncrono `IZendeskApi.sendProactiveMessage`: acá el fallo no es inmediato.
|
|
15
|
+
*/
|
|
16
|
+
sendProactiveMessage(message: SendProactiveMessageRequest): Promise<void>;
|
|
17
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { IMembershipApi } from "./interfaces/IMembershipApi.js";
|
|
3
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
4
|
-
export declare class MembershipApi implements IMembershipApi {
|
|
5
|
-
private httpRequest;
|
|
6
|
-
private readonly baseUrl;
|
|
7
|
-
constructor(httpRequest: IHttpRequest);
|
|
8
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
9
|
-
deletedCount: number;
|
|
10
|
-
}>>;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
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 MembershipApi = class MembershipApi {
|
|
17
|
-
httpRequest;
|
|
18
|
-
baseUrl = process.env.MEMBERSHIP_BUSINESS_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
|
-
MembershipApi = __decorate([
|
|
28
|
-
injectable(),
|
|
29
|
-
__param(0, inject("IHttpRequest")),
|
|
30
|
-
__metadata("design:paramtypes", [Object])
|
|
31
|
-
], MembershipApi);
|
|
32
|
-
export { MembershipApi };
|
package/bin/membership/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
|
-
/**
|
|
3
|
-
* Interfaz para el servicio Membership (membership-business).
|
|
4
|
-
*/
|
|
5
|
-
export interface IMembershipApi {
|
|
6
|
-
/**
|
|
7
|
-
* Borra en cascada las membresías asociadas a un directoryId.
|
|
8
|
-
* @param directoryId ID del directorio.
|
|
9
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
10
|
-
*/
|
|
11
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
12
|
-
deletedCount: number;
|
|
13
|
-
}>>;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { INotificationWebsocketApi } from "./interfaces/INotificationWebsocketApi.js";
|
|
3
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
4
|
-
export declare class NotificationWebsocketApi implements INotificationWebsocketApi {
|
|
5
|
-
private httpRequest;
|
|
6
|
-
private readonly baseUrl;
|
|
7
|
-
constructor(httpRequest: IHttpRequest);
|
|
8
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
9
|
-
deletedCount: number;
|
|
10
|
-
}>>;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
|
-
/**
|
|
3
|
-
* Interfaz para el servicio Notifications Websocket (notifications-websocket).
|
|
4
|
-
*/
|
|
5
|
-
export interface INotificationWebsocketApi {
|
|
6
|
-
/**
|
|
7
|
-
* Borra en cascada las conexiones/notificaciones WS asociadas a un directoryId.
|
|
8
|
-
* @param directoryId ID del directorio.
|
|
9
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
10
|
-
*/
|
|
11
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
12
|
-
deletedCount: number;
|
|
13
|
-
}>>;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { IPerformanceProfileApi } from "./interfaces/IPerformanceProfileApi.js";
|
|
3
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
4
|
-
export declare class PerformanceProfileApi implements IPerformanceProfileApi {
|
|
5
|
-
private httpRequest;
|
|
6
|
-
private readonly baseUrl;
|
|
7
|
-
constructor(httpRequest: IHttpRequest);
|
|
8
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
9
|
-
deletedCount: number;
|
|
10
|
-
}>>;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
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 PerformanceProfileApi = class PerformanceProfileApi {
|
|
17
|
-
httpRequest;
|
|
18
|
-
baseUrl = process.env.PERFORMANCE_PROFILE_BUSINESS_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
|
-
PerformanceProfileApi = __decorate([
|
|
28
|
-
injectable(),
|
|
29
|
-
__param(0, inject("IHttpRequest")),
|
|
30
|
-
__metadata("design:paramtypes", [Object])
|
|
31
|
-
], PerformanceProfileApi);
|
|
32
|
-
export { PerformanceProfileApi };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
|
-
/**
|
|
3
|
-
* Interfaz para el servicio Performance Profile (performance-profile-business).
|
|
4
|
-
*/
|
|
5
|
-
export interface IPerformanceProfileApi {
|
|
6
|
-
/**
|
|
7
|
-
* Borra en cascada los perfiles de desempeño asociados a un directoryId.
|
|
8
|
-
* @param directoryId ID del directorio.
|
|
9
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
10
|
-
*/
|
|
11
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
12
|
-
deletedCount: number;
|
|
13
|
-
}>>;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { IPresenceWebsocketApi } from "./interfaces/IPresenceWebsocketApi.js";
|
|
3
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
4
|
-
export declare class PresenceWebsocketApi implements IPresenceWebsocketApi {
|
|
5
|
-
private httpRequest;
|
|
6
|
-
private readonly baseUrl;
|
|
7
|
-
constructor(httpRequest: IHttpRequest);
|
|
8
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
9
|
-
deletedCount: number;
|
|
10
|
-
}>>;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
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 PresenceWebsocketApi = class PresenceWebsocketApi {
|
|
17
|
-
httpRequest;
|
|
18
|
-
baseUrl = process.env.PRESENCE_WEBSOCKET_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
|
-
PresenceWebsocketApi = __decorate([
|
|
28
|
-
injectable(),
|
|
29
|
-
__param(0, inject("IHttpRequest")),
|
|
30
|
-
__metadata("design:paramtypes", [Object])
|
|
31
|
-
], PresenceWebsocketApi);
|
|
32
|
-
export { PresenceWebsocketApi };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
|
-
/**
|
|
3
|
-
* Interfaz para el servicio Presence Websocket (presence-websocket).
|
|
4
|
-
*/
|
|
5
|
-
export interface IPresenceWebsocketApi {
|
|
6
|
-
/**
|
|
7
|
-
* Borra en cascada los registros de presencia asociados a un directoryId.
|
|
8
|
-
* @param directoryId ID del directorio.
|
|
9
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
10
|
-
*/
|
|
11
|
-
deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
|
|
12
|
-
deletedCount: number;
|
|
13
|
-
}>>;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|