@fiado/api-invoker 5.15.0 → 5.17.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/{membership/MembershipApi.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 +6 -0
- package/bin/domain-callback/api/DomainCallbackApi.d.ts +15 -0
- package/bin/{notificationWebsockets/NotificationWebsocketApi.js → domain-callback/api/DomainCallbackApi.js} +12 -10
- package/bin/domain-callback/api/interfaces/IDomainCallbackApi.d.ts +19 -0
- package/bin/domain-callback/index.d.ts +2 -0
- package/bin/domain-callback/index.js +2 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +2 -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/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 +13 -0
- package/src/domain-callback/api/DomainCallbackApi.ts +23 -0
- package/src/domain-callback/api/interfaces/IDomainCallbackApi.ts +21 -0
- package/src/domain-callback/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/transactionProcessor/api/TransactionProcessorApi.ts +12 -1
- package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +17 -0
- package/bin/membership/MembershipApi.d.ts +0 -12
- 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 → domain-callback/api/interfaces/IDomainCallbackApi.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
|
@@ -128,6 +128,8 @@ import { ResearchSheetsApi } from "./research-sheets/index.js";
|
|
|
128
128
|
import { AuthBusinessApi } from "./auth-business/index.js";
|
|
129
129
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId (SureKeep F2)
|
|
130
130
|
import { KycVerificationsBusinessApi } from "./kyc/index.js";
|
|
131
|
+
import CollectionEngineApi from "./collection-engine/api/CollectionEngineApi.js";
|
|
132
|
+
import DomainCallbackApi from "./domain-callback/api/DomainCallbackApi.js";
|
|
131
133
|
export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
132
134
|
// UTILS bindings
|
|
133
135
|
bind("InvokerUtils").to(InvokerUtils);
|
|
@@ -271,4 +273,8 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
271
273
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId.
|
|
272
274
|
// La consume el wizard de SureKeep F2 tras el aviso async del stream de `KycVerifications`.
|
|
273
275
|
bind("IKycVerificationsBusinessApi").to(KycVerificationsBusinessApi);
|
|
276
|
+
// Collection engine — motor de cobro central multitenant (collect/registerCollectible/deregister)
|
|
277
|
+
bind("ICollectionEngineApi").to(CollectionEngineApi);
|
|
278
|
+
// Domain callback — el motor notifica al dominio dueño del cargo (applyCollectionResult)
|
|
279
|
+
bind("IDomainCallbackApi").to(DomainCallbackApi);
|
|
274
280
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { ApplyCollectionResultRequest } from "@fiado/type-kit/bin/collection/index.js";
|
|
3
|
+
import { IDomainCallbackApi } from "./interfaces/IDomainCallbackApi.js";
|
|
4
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
5
|
+
/**
|
|
6
|
+
* Cliente genérico del callback de cobro (motor → dominio). La baseUrl no viene de una env
|
|
7
|
+
* fija del constructor: el motor la resuelve por `domain` (registry `domain→API`) y la pasa
|
|
8
|
+
* en cada llamada, así este mismo cliente sirve para cualquier dominio consumidor.
|
|
9
|
+
*/
|
|
10
|
+
export default class DomainCallbackApi implements IDomainCallbackApi {
|
|
11
|
+
private httpRequest;
|
|
12
|
+
constructor(httpRequest: IHttpRequest);
|
|
13
|
+
applyCollectionResult(baseUrl: string, request: ApplyCollectionResultRequest): Promise<FiadoApiResponse<boolean>>;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -11,22 +11,24 @@ 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 genérico del callback de cobro (motor → dominio). La baseUrl no viene de una env
|
|
16
|
+
* fija del constructor: el motor la resuelve por `domain` (registry `domain→API`) y la pasa
|
|
17
|
+
* en cada llamada, así este mismo cliente sirve para cualquier dominio consumidor.
|
|
18
|
+
*/
|
|
19
|
+
let DomainCallbackApi = class DomainCallbackApi {
|
|
17
20
|
httpRequest;
|
|
18
|
-
baseUrl = process.env.NOTIFICATIONS_WEBSOCKET_LAMBDA_URL || "";
|
|
19
21
|
constructor(httpRequest) {
|
|
20
22
|
this.httpRequest = httpRequest;
|
|
21
23
|
}
|
|
22
|
-
async
|
|
23
|
-
const url = `${
|
|
24
|
-
return await this.httpRequest.
|
|
24
|
+
async applyCollectionResult(baseUrl, request) {
|
|
25
|
+
const url = `${baseUrl.replace(/\/+$/, "")}/collection/apply-result`;
|
|
26
|
+
return await this.httpRequest.post(url, request);
|
|
25
27
|
}
|
|
26
28
|
};
|
|
27
|
-
|
|
29
|
+
DomainCallbackApi = __decorate([
|
|
28
30
|
injectable(),
|
|
29
31
|
__param(0, inject("IHttpRequest")),
|
|
30
32
|
__metadata("design:paramtypes", [Object])
|
|
31
|
-
],
|
|
32
|
-
export
|
|
33
|
+
], DomainCallbackApi);
|
|
34
|
+
export default DomainCallbackApi;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ApplyCollectionResultRequest } 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 genérico que usa el motor de cobro central para notificar a cualquier dominio
|
|
5
|
+
* consumidor (une-credit, surekeep-retail, etc.) el resultado de un cobro (total o parcial).
|
|
6
|
+
*
|
|
7
|
+
* A diferencia del resto de los Api de la lib, la baseUrl NO sale de una env fija del
|
|
8
|
+
* constructor: el dispatcher del outbox la resuelve por `domain` (registry `domain→API`,
|
|
9
|
+
* SSM/env) y la pasa por llamada — cada dominio consumidor implementa este mismo endpoint.
|
|
10
|
+
*/
|
|
11
|
+
export interface IDomainCallbackApi {
|
|
12
|
+
/**
|
|
13
|
+
* Notifica el resultado de un intento de cobro (FULL/PARTIAL/NONE) al dominio dueño
|
|
14
|
+
* del cargo. El dominio lo aplica idempotente a su ledger (dedupe por `attemptId`).
|
|
15
|
+
* Backend: POST {baseUrl}/collection/apply-result (privado VPC, expuesto por el dominio).
|
|
16
|
+
*/
|
|
17
|
+
applyCollectionResult(baseUrl: string, request: ApplyCollectionResultRequest): Promise<FiadoApiResponse<boolean>>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
package/bin/index.d.ts
CHANGED
|
@@ -106,3 +106,5 @@ export * from "./beneficiary/index.js";
|
|
|
106
106
|
export * from "./research-sheets/index.js";
|
|
107
107
|
export * from "./auth-business/index.js";
|
|
108
108
|
export * from "./kyc/index.js";
|
|
109
|
+
export * from "./collection-engine/index.js";
|
|
110
|
+
export * from "./domain-callback/index.js";
|
package/bin/index.js
CHANGED
|
@@ -106,3 +106,5 @@ export * from "./beneficiary/index.js";
|
|
|
106
106
|
export * from "./research-sheets/index.js";
|
|
107
107
|
export * from "./auth-business/index.js";
|
|
108
108
|
export * from "./kyc/index.js";
|
|
109
|
+
export * from "./collection-engine/index.js";
|
|
110
|
+
export * from "./domain-callback/index.js";
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.17.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.272.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
|
@@ -192,6 +192,13 @@ import { IResearchSheetsApi, ResearchSheetsApi } from "./research-sheets/index.j
|
|
|
192
192
|
import { IAuthBusinessApi, AuthBusinessApi } from "./auth-business/index.js";
|
|
193
193
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId (SureKeep F2)
|
|
194
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";
|
|
198
|
+
// Domain callback — cliente genérico que usa el motor para notificar a cualquier dominio
|
|
199
|
+
// consumidor el resultado de un cobro (applyCollectionResult); baseUrl viaja por llamada
|
|
200
|
+
import { IDomainCallbackApi } from "./domain-callback/index.js";
|
|
201
|
+
import DomainCallbackApi from "./domain-callback/api/DomainCallbackApi.js";
|
|
195
202
|
|
|
196
203
|
export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
197
204
|
// UTILS bindings
|
|
@@ -358,4 +365,10 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
358
365
|
// KYC verifications business — lectura confirmatoria server-side del KYC por directoryId.
|
|
359
366
|
// La consume el wizard de SureKeep F2 tras el aviso async del stream de `KycVerifications`.
|
|
360
367
|
bind<IKycVerificationsBusinessApi>("IKycVerificationsBusinessApi").to(KycVerificationsBusinessApi);
|
|
368
|
+
|
|
369
|
+
// Collection engine — motor de cobro central multitenant (collect/registerCollectible/deregister)
|
|
370
|
+
bind<ICollectionEngineApi>("ICollectionEngineApi").to(CollectionEngineApi);
|
|
371
|
+
|
|
372
|
+
// Domain callback — el motor notifica al dominio dueño del cargo (applyCollectionResult)
|
|
373
|
+
bind<IDomainCallbackApi>("IDomainCallbackApi").to(DomainCallbackApi);
|
|
361
374
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { ApplyCollectionResultRequest } from "@fiado/type-kit/bin/collection/index.js";
|
|
4
|
+
import { IDomainCallbackApi } from "./interfaces/IDomainCallbackApi.js";
|
|
5
|
+
|
|
6
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Cliente genérico del callback de cobro (motor → dominio). La baseUrl no viene de una env
|
|
10
|
+
* fija del constructor: el motor la resuelve por `domain` (registry `domain→API`) y la pasa
|
|
11
|
+
* en cada llamada, así este mismo cliente sirve para cualquier dominio consumidor.
|
|
12
|
+
*/
|
|
13
|
+
@injectable()
|
|
14
|
+
export default class DomainCallbackApi implements IDomainCallbackApi {
|
|
15
|
+
|
|
16
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async applyCollectionResult(baseUrl: string, request: ApplyCollectionResultRequest): Promise<FiadoApiResponse<boolean>> {
|
|
20
|
+
const url = `${baseUrl.replace(/\/+$/, "")}/collection/apply-result`;
|
|
21
|
+
return await this.httpRequest.post(url, request);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApplyCollectionResultRequest } from "@fiado/type-kit/bin/collection/index.js";
|
|
2
|
+
|
|
3
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Cliente genérico que usa el motor de cobro central para notificar a cualquier dominio
|
|
7
|
+
* consumidor (une-credit, surekeep-retail, etc.) el resultado de un cobro (total o parcial).
|
|
8
|
+
*
|
|
9
|
+
* A diferencia del resto de los Api de la lib, la baseUrl NO sale de una env fija del
|
|
10
|
+
* constructor: el dispatcher del outbox la resuelve por `domain` (registry `domain→API`,
|
|
11
|
+
* SSM/env) y la pasa por llamada — cada dominio consumidor implementa este mismo endpoint.
|
|
12
|
+
*/
|
|
13
|
+
export interface IDomainCallbackApi {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Notifica el resultado de un intento de cobro (FULL/PARTIAL/NONE) al dominio dueño
|
|
17
|
+
* del cargo. El dominio lo aplica idempotente a su ledger (dedupe por `attemptId`).
|
|
18
|
+
* Backend: POST {baseUrl}/collection/apply-result (privado VPC, expuesto por el dominio).
|
|
19
|
+
*/
|
|
20
|
+
applyCollectionResult(baseUrl: string, request: ApplyCollectionResultRequest): Promise<FiadoApiResponse<boolean>>;
|
|
21
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -106,3 +106,5 @@ export * from "./beneficiary/index.js";
|
|
|
106
106
|
export * from "./research-sheets/index.js";
|
|
107
107
|
export * from "./auth-business/index.js";
|
|
108
108
|
export * from "./kyc/index.js";
|
|
109
|
+
export * from "./collection-engine/index.js";
|
|
110
|
+
export * from "./domain-callback/index.js";
|
|
@@ -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
|
}
|
|
@@ -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 {};
|
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
|