@fiado/api-invoker 3.0.7 → 3.0.8
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/container.config.js +3 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/platform-error-events/index.d.ts +2 -0
- package/bin/{activity → platform-error-events}/index.js +2 -2
- package/bin/platform-error-events/queue/PlatformErrorEventsPublisher.d.ts +6 -0
- package/bin/{account-fiadoinc/queue/TransactionPublisher.js → platform-error-events/queue/PlatformErrorEventsPublisher.js} +8 -11
- package/bin/platform-error-events/queue/interfaces/IPlatformErrorEventsPublisher.d.ts +4 -0
- package/package.json +2 -2
- package/src/container.config.ts +6 -0
- package/src/index.ts +1 -0
- package/src/platform-error-events/index.ts +2 -0
- package/src/platform-error-events/queue/PlatformErrorEventsPublisher.ts +23 -0
- package/src/platform-error-events/queue/interfaces/IPlatformErrorEventsPublisher.ts +5 -0
- package/bin/account-fiadoinc/queue/TransactionPublisher.d.ts +0 -9
- package/bin/account-fiadoinc/queue/interfaces/ITransactionPublisher.d.ts +0 -7
- package/bin/activity/ActivityApi.d.ts +0 -17
- package/bin/activity/ActivityApi.js +0 -72
- package/bin/activity/index.d.ts +0 -2
- package/bin/activity/interfaces/IActivityApi.d.ts +0 -39
- package/bin/activity/interfaces/IActivityApi.js +0 -2
- package/bin/estafeta/EstafetaApi.d.ts +0 -0
- package/bin/estafeta/EstafetaApi.js +0 -0
- package/bin/referral-business/PayrollApi.d.ts +0 -9
- package/bin/referral-business/PayrollApi.js +0 -37
- /package/bin/{account-fiadoinc/queue/interfaces/ITransactionPublisher.js → platform-error-events/queue/interfaces/IPlatformErrorEventsPublisher.js} +0 -0
package/bin/container.config.js
CHANGED
|
@@ -87,6 +87,7 @@ const CreditNotificationPublisher_1 = __importDefault(require("./credit-engine/q
|
|
|
87
87
|
const CreditStatementPublisher_1 = __importDefault(require("./credit-engine/queue/CreditStatementPublisher"));
|
|
88
88
|
const CreditReconciliationPublisher_1 = __importDefault(require("./credit-engine/queue/CreditReconciliationPublisher"));
|
|
89
89
|
const CreditLienCollectionPublisher_1 = __importDefault(require("./credit-engine/queue/CreditLienCollectionPublisher"));
|
|
90
|
+
const PlatformErrorEventsPublisher_1 = __importDefault(require("./platform-error-events/queue/PlatformErrorEventsPublisher"));
|
|
90
91
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
91
92
|
// UTILS bindings
|
|
92
93
|
bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
|
|
@@ -173,4 +174,6 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
|
173
174
|
bind("ICreditStatementPublisher").to(CreditStatementPublisher_1.default);
|
|
174
175
|
bind("ICreditReconciliationPublisher").to(CreditReconciliationPublisher_1.default);
|
|
175
176
|
bind("ICreditLienCollectionPublisher").to(CreditLienCollectionPublisher_1.default);
|
|
177
|
+
// Platform error events - SQS publisher
|
|
178
|
+
bind("IPlatformErrorEventsPublisher").to(PlatformErrorEventsPublisher_1.default);
|
|
176
179
|
});
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -79,3 +79,4 @@ __exportStar(require("./credit-engine"), exports);
|
|
|
79
79
|
__exportStar(require("./credit-payment"), exports);
|
|
80
80
|
__exportStar(require("./document-generator"), exports);
|
|
81
81
|
__exportStar(require("./commission-business"), exports);
|
|
82
|
+
__exportStar(require("./platform-error-events"), exports);
|
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./queue/PlatformErrorEventsPublisher"), exports);
|
|
18
|
+
__exportStar(require("./queue/interfaces/IPlatformErrorEventsPublisher"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IPlatformErrorEventsPublisher } from "./interfaces/IPlatformErrorEventsPublisher";
|
|
2
|
+
import { PlatformErrorEventMessage } from "@fiado/type-kit/bin/platformErrorEvents";
|
|
3
|
+
export default class PlatformErrorEventsPublisher implements IPlatformErrorEventsPublisher {
|
|
4
|
+
private readonly PLATFORM_ERROR_EVENTS_QUEUE;
|
|
5
|
+
publish(message: PlatformErrorEventMessage): Promise<void>;
|
|
6
|
+
}
|
|
@@ -6,31 +6,28 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.TransactionPublisher = void 0;
|
|
10
9
|
const client_sqs_1 = require("@aws-sdk/client-sqs");
|
|
11
10
|
const inversify_1 = require("inversify");
|
|
12
|
-
let
|
|
11
|
+
let PlatformErrorEventsPublisher = class PlatformErrorEventsPublisher {
|
|
13
12
|
constructor() {
|
|
14
|
-
this.
|
|
13
|
+
this.PLATFORM_ERROR_EVENTS_QUEUE = process.env.PLATFORM_ERROR_EVENTS_QUEUE;
|
|
15
14
|
}
|
|
16
15
|
async publish(message) {
|
|
17
16
|
try {
|
|
18
17
|
const client = new client_sqs_1.SQSClient();
|
|
19
18
|
const sendMessageRequest = {
|
|
20
|
-
QueueUrl: this.
|
|
21
|
-
MessageBody: JSON.stringify(message)
|
|
22
|
-
MessageGroupId: message.externalUserId,
|
|
23
|
-
MessageDeduplicationId: message.externalUserId
|
|
19
|
+
QueueUrl: this.PLATFORM_ERROR_EVENTS_QUEUE,
|
|
20
|
+
MessageBody: JSON.stringify(message)
|
|
24
21
|
};
|
|
25
22
|
const command = new client_sqs_1.SendMessageCommand(sendMessageRequest);
|
|
26
23
|
await client.send(command);
|
|
27
24
|
}
|
|
28
25
|
catch (error) {
|
|
29
|
-
throw new Error(`Error publishing message to
|
|
26
|
+
throw new Error(`Error publishing message to PlatformErrorEventsQueue${': ' + error.message}`);
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
};
|
|
33
|
-
|
|
34
|
-
exports.TransactionPublisher = TransactionPublisher = __decorate([
|
|
30
|
+
PlatformErrorEventsPublisher = __decorate([
|
|
35
31
|
(0, inversify_1.injectable)()
|
|
36
|
-
],
|
|
32
|
+
], PlatformErrorEventsPublisher);
|
|
33
|
+
exports.default = PlatformErrorEventsPublisher;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
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
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@fiado/gateway-adapter": "^1.1.50",
|
|
17
17
|
"@fiado/http-client": "^1.0.7",
|
|
18
18
|
"@fiado/logger": "^1.0.3",
|
|
19
|
-
"@fiado/type-kit": "^3.0.
|
|
19
|
+
"@fiado/type-kit": "^3.0.15",
|
|
20
20
|
"dotenv": "^16.4.7",
|
|
21
21
|
"inversify": "^6.2.2",
|
|
22
22
|
"reflect-metadata": "^0.2.2"
|
package/src/container.config.ts
CHANGED
|
@@ -124,6 +124,9 @@ import CreditNotificationPublisher from "./credit-engine/queue/CreditNotificatio
|
|
|
124
124
|
import CreditStatementPublisher from "./credit-engine/queue/CreditStatementPublisher";
|
|
125
125
|
import CreditReconciliationPublisher from "./credit-engine/queue/CreditReconciliationPublisher";
|
|
126
126
|
import CreditLienCollectionPublisher from "./credit-engine/queue/CreditLienCollectionPublisher";
|
|
127
|
+
// Platform error events - SQS publisher
|
|
128
|
+
import { IPlatformErrorEventsPublisher } from "./platform-error-events";
|
|
129
|
+
import PlatformErrorEventsPublisher from "./platform-error-events/queue/PlatformErrorEventsPublisher";
|
|
127
130
|
|
|
128
131
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
129
132
|
// UTILS bindings
|
|
@@ -214,4 +217,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
|
|
|
214
217
|
bind<ICreditStatementPublisher>("ICreditStatementPublisher").to(CreditStatementPublisher);
|
|
215
218
|
bind<ICreditReconciliationPublisher>("ICreditReconciliationPublisher").to(CreditReconciliationPublisher);
|
|
216
219
|
bind<ICreditLienCollectionPublisher>("ICreditLienCollectionPublisher").to(CreditLienCollectionPublisher);
|
|
220
|
+
|
|
221
|
+
// Platform error events - SQS publisher
|
|
222
|
+
bind<IPlatformErrorEventsPublisher>("IPlatformErrorEventsPublisher").to(PlatformErrorEventsPublisher);
|
|
217
223
|
});
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SendMessageCommand, SendMessageRequest, SQSClient } from "@aws-sdk/client-sqs";
|
|
2
|
+
import { IPlatformErrorEventsPublisher } from "./interfaces/IPlatformErrorEventsPublisher";
|
|
3
|
+
import { PlatformErrorEventMessage } from "@fiado/type-kit/bin/platformErrorEvents";
|
|
4
|
+
import { injectable } from "inversify";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export default class PlatformErrorEventsPublisher implements IPlatformErrorEventsPublisher {
|
|
8
|
+
private readonly PLATFORM_ERROR_EVENTS_QUEUE = process.env.PLATFORM_ERROR_EVENTS_QUEUE;
|
|
9
|
+
|
|
10
|
+
async publish(message: PlatformErrorEventMessage): Promise<void> {
|
|
11
|
+
try {
|
|
12
|
+
const client: SQSClient = new SQSClient();
|
|
13
|
+
const sendMessageRequest: SendMessageRequest = {
|
|
14
|
+
QueueUrl: this.PLATFORM_ERROR_EVENTS_QUEUE,
|
|
15
|
+
MessageBody: JSON.stringify(message)
|
|
16
|
+
};
|
|
17
|
+
const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
|
|
18
|
+
await client.send(command);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
throw new Error(`Error publishing message to PlatformErrorEventsQueue${': ' + error.message}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ITransactionPublisher } from "./interfaces/ITransactionPublisher";
|
|
2
|
-
import { ProviderDocumentUploadRequest } from "@fiado/type-kit/bin/provider";
|
|
3
|
-
export declare class TransactionPublisher implements ITransactionPublisher {
|
|
4
|
-
private readonly FIADO_INC_KYC_MESSAGE_QUEUE;
|
|
5
|
-
publish(message: {
|
|
6
|
-
externalUserId: string;
|
|
7
|
-
input: ProviderDocumentUploadRequest;
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { IActivityApi } from './interfaces/IActivityApi';
|
|
3
|
-
import { TypeOfDirectoryId } from '@fiado/type-kit/bin/directory';
|
|
4
|
-
export declare class ActivityApi implements IActivityApi {
|
|
5
|
-
private httpRequest;
|
|
6
|
-
private readonly baseUrl;
|
|
7
|
-
constructor(httpRequest: IHttpRequest);
|
|
8
|
-
getActivities(typeOfActivities: string[]): Promise<any>;
|
|
9
|
-
getActivitiesByDirectoryIdAndTypeOfActivity(directoryId: string, typeOfActivities: string[]): Promise<any>;
|
|
10
|
-
postActivity(params: {
|
|
11
|
-
directoryId: string;
|
|
12
|
-
typeOfDirectoryId: TypeOfDirectoryId;
|
|
13
|
-
typeOfActivity: string;
|
|
14
|
-
amount: string;
|
|
15
|
-
date: string;
|
|
16
|
-
}): Promise<any>;
|
|
17
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ActivityApi = void 0;
|
|
19
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
20
|
-
const inversify_1 = require("inversify");
|
|
21
|
-
dotenv_1.default.config();
|
|
22
|
-
let ActivityApi = class ActivityApi {
|
|
23
|
-
constructor(httpRequest) {
|
|
24
|
-
this.httpRequest = httpRequest;
|
|
25
|
-
this.baseUrl = process.env.ACTIVITY_LAMBDA_URL || "";
|
|
26
|
-
}
|
|
27
|
-
async getActivities(typeOfActivities) {
|
|
28
|
-
let url = `${this.baseUrl}activities`;
|
|
29
|
-
if (typeOfActivities.length > 0) {
|
|
30
|
-
url = `${this.baseUrl}activities?${typeOfActivities.map(id => `typeOfActivities=${encodeURIComponent(id)}`).join('&')}`;
|
|
31
|
-
}
|
|
32
|
-
const operationName = "getActivities";
|
|
33
|
-
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
34
|
-
}
|
|
35
|
-
async getActivitiesByDirectoryIdAndTypeOfActivity(directoryId, typeOfActivities) {
|
|
36
|
-
if (directoryId == null || directoryId == undefined || directoryId == "") {
|
|
37
|
-
throw new Error("At least directory ID is required.");
|
|
38
|
-
}
|
|
39
|
-
let url = `${this.baseUrl}activities/directory/${directoryId}`;
|
|
40
|
-
if (typeOfActivities.length > 0) {
|
|
41
|
-
url = `${this.baseUrl}activities/directory/${directoryId}?${typeOfActivities.map(id => `typeOfActivities=${encodeURIComponent(id)}`).join('&')}`;
|
|
42
|
-
}
|
|
43
|
-
const operationName = "getActivitiesByDirectoryIdAndTypeOfActivity";
|
|
44
|
-
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
45
|
-
}
|
|
46
|
-
async postActivity(params) {
|
|
47
|
-
if (params.directoryId == null || params.directoryId == undefined || params.directoryId == "") {
|
|
48
|
-
throw new Error("At least directory ID is required.");
|
|
49
|
-
}
|
|
50
|
-
if (params.typeOfDirectoryId == null || params.typeOfDirectoryId == undefined) {
|
|
51
|
-
throw new Error("At least typeOfDirectoryId is required.");
|
|
52
|
-
}
|
|
53
|
-
if (params.typeOfActivity == null || params.typeOfActivity == undefined || params.typeOfActivity == "") {
|
|
54
|
-
throw new Error("At least typeOfActivity is required.");
|
|
55
|
-
}
|
|
56
|
-
if (params.amount == null || params.amount == undefined || params.amount == "") {
|
|
57
|
-
throw new Error("At least amount is required.");
|
|
58
|
-
}
|
|
59
|
-
if (params.date == null || params.date == undefined || params.date == "") {
|
|
60
|
-
throw new Error("At least date is required.");
|
|
61
|
-
}
|
|
62
|
-
const url = `${this.baseUrl}/activities/create`;
|
|
63
|
-
const operationName = "postActivity";
|
|
64
|
-
return await this.httpRequest.post(`${url}`, params, { 'operationName': operationName });
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
exports.ActivityApi = ActivityApi;
|
|
68
|
-
exports.ActivityApi = ActivityApi = __decorate([
|
|
69
|
-
(0, inversify_1.injectable)(),
|
|
70
|
-
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
71
|
-
__metadata("design:paramtypes", [Object])
|
|
72
|
-
], ActivityApi);
|
package/bin/activity/index.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { TypeOfDirectoryId } from "@fiado/type-kit/bin/directory";
|
|
2
|
-
/**
|
|
3
|
-
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
4
|
-
*/
|
|
5
|
-
export interface IActivityApi {
|
|
6
|
-
/**
|
|
7
|
-
* Obtiene una lista de entidades de la tabla ActivityDirectory.
|
|
8
|
-
* @param directoryId Directorio que se va a consultar.
|
|
9
|
-
* @param typeOfActivities Array de tipos de actividades (Opcional).
|
|
10
|
-
* @returns Retorna un arreglo de objetos de ActivityDirectory.
|
|
11
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
|
-
*/
|
|
13
|
-
getActivitiesByDirectoryIdAndTypeOfActivity(directoryId: string, typeOfActivities: string[]): Promise<any>;
|
|
14
|
-
/**
|
|
15
|
-
* Obtener actividades globales.
|
|
16
|
-
* @param typeOfActivity Tipo de actividad
|
|
17
|
-
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
18
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
19
|
-
*/
|
|
20
|
-
getActivities(typeOfActivities: string[]): Promise<any>;
|
|
21
|
-
/**
|
|
22
|
-
* Proceso para agregar a las actividades.
|
|
23
|
-
* @param directoryId Directorio
|
|
24
|
-
* @param typeOfDirectoryId Tipo de directorio
|
|
25
|
-
* @param typeOfActivity Tipo de actividad
|
|
26
|
-
* @param amount Monto de la actividad
|
|
27
|
-
* @param date Fecha de la actividad
|
|
28
|
-
* @returns Retorna un objeto de ActivityDirectory.
|
|
29
|
-
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
30
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
31
|
-
*/
|
|
32
|
-
postActivity(params: {
|
|
33
|
-
directoryId: string;
|
|
34
|
-
typeOfDirectoryId: TypeOfDirectoryId;
|
|
35
|
-
typeOfActivity: string;
|
|
36
|
-
amount: string;
|
|
37
|
-
date: string;
|
|
38
|
-
}): Promise<any>;
|
|
39
|
-
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { IReferralBusinessApi } from "./interfaces/IReferralBusinessApi";
|
|
3
|
-
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
4
|
-
export declare class ReferralBusinessApi implements IReferralBusinessApi {
|
|
5
|
-
private httpRequest;
|
|
6
|
-
private readonly baseUrl;
|
|
7
|
-
constructor(httpRequest: IHttpRequest);
|
|
8
|
-
getByDirectoryId(directoryId: string): Promise<FiadoApiResponse<any>>;
|
|
9
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ReferralBusinessApi = void 0;
|
|
19
|
-
const inversify_1 = require("inversify");
|
|
20
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
21
|
-
dotenv_1.default.config();
|
|
22
|
-
let ReferralBusinessApi = class ReferralBusinessApi {
|
|
23
|
-
constructor(httpRequest) {
|
|
24
|
-
this.httpRequest = httpRequest;
|
|
25
|
-
this.baseUrl = process.env.PAYROLL_BUSINESS_LAMBDA_URL || "";
|
|
26
|
-
}
|
|
27
|
-
async getByDirectoryId(directoryId) {
|
|
28
|
-
const url = `${this.baseUrl}private/agents/directoryId/${directoryId}`;
|
|
29
|
-
return await this.httpRequest.get(url);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
exports.ReferralBusinessApi = ReferralBusinessApi;
|
|
33
|
-
exports.ReferralBusinessApi = ReferralBusinessApi = __decorate([
|
|
34
|
-
(0, inversify_1.injectable)(),
|
|
35
|
-
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
36
|
-
__metadata("design:paramtypes", [Object])
|
|
37
|
-
], ReferralBusinessApi);
|