@fiado/api-invoker 3.0.1 → 3.0.2

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.
Files changed (34) hide show
  1. package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +46 -0
  2. package/bin/container.config.js +0 -2
  3. package/bin/credit-payment/CreditPaymentApi.d.ts +8 -13
  4. package/bin/credit-payment/CreditPaymentApi.js +16 -16
  5. package/bin/credit-payment/interfaces/ICreditPaymentApi.d.ts +8 -13
  6. package/bin/index.d.ts +0 -1
  7. package/bin/index.js +0 -1
  8. package/bin/report-processor-business/api/IReportProcessorBusiness.d.ts +3 -0
  9. package/package.json +2 -2
  10. package/src/container.config.ts +0 -2
  11. package/src/credit-payment/CreditPaymentApi.ts +24 -29
  12. package/src/credit-payment/interfaces/ICreditPaymentApi.ts +8 -14
  13. package/src/index.ts +0 -1
  14. package/bin/account-fiadoinc/queue/TransactionPublisher.d.ts +0 -9
  15. package/bin/account-fiadoinc/queue/TransactionPublisher.js +0 -36
  16. package/bin/account-fiadoinc/queue/interfaces/ITransactionPublisher.d.ts +0 -7
  17. package/bin/activity/ActivityApi.d.ts +0 -17
  18. package/bin/activity/ActivityApi.js +0 -72
  19. package/bin/activity/index.d.ts +0 -2
  20. package/bin/activity/index.js +0 -18
  21. package/bin/activity/interfaces/IActivityApi.d.ts +0 -39
  22. package/bin/commission-business/CommissionBusinessApi.d.ts +0 -9
  23. package/bin/commission-business/CommissionBusinessApi.js +0 -37
  24. package/bin/commission-business/index.d.ts +0 -2
  25. package/bin/commission-business/index.js +0 -18
  26. package/bin/commission-business/interfaces/ICommissionBusinessApi.d.ts +0 -13
  27. package/bin/commission-business/interfaces/ICommissionBusinessApi.js +0 -2
  28. package/bin/referral-business/PayrollApi.d.ts +0 -9
  29. package/bin/referral-business/PayrollApi.js +0 -37
  30. package/src/commission-business/CommissionBusinessApi.ts +0 -19
  31. package/src/commission-business/index.ts +0 -3
  32. package/src/commission-business/interfaces/ICommissionBusinessApi.ts +0 -15
  33. /package/bin/{account-fiadoinc/queue/interfaces/ITransactionPublisher.js → cognitoConnector/interfaces/ICognitoConnectorApiV2.js} +0 -0
  34. /package/bin/{activity/interfaces/IActivityApi.js → report-processor-business/api/IReportProcessorBusiness.js} +0 -0
@@ -0,0 +1,46 @@
1
+ import { ChangePasswordRequest, GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector";
2
+ export interface ICognitoApi {
3
+ /**
4
+ * Healthcheck for the cognito-connector
5
+ */
6
+ healthcheck(): Promise<HealthcheckResponse>;
7
+ /**
8
+ * Create a new user in Cognito
9
+ */
10
+ signUp(request: SignUpRequest): Promise<SignUpResponse>;
11
+ /**
12
+ * Confirm sign-up for a user in Cognito
13
+ */
14
+ signUpConfirm(request: SignUpConfirmRequest): Promise<void>;
15
+ /**
16
+ * Sign in a user
17
+ */
18
+ signIn(request: SignInRequest): Promise<SignInResponse>;
19
+ /**
20
+ * Sign out a user
21
+ */
22
+ signOut(): Promise<void>;
23
+ /**
24
+ * Change a user's password
25
+ */
26
+ changePassword(request: ChangePasswordRequest): Promise<void>;
27
+ /**
28
+ * Retrieve user details
29
+ */
30
+ getUser(request: GetUserRequest): Promise<GetUserResponse>;
31
+ /**
32
+ * Refresh a user's tokens
33
+ */
34
+ refreshToken(request: RefreshTokenRequest): Promise<RefreshTokenResponse>;
35
+ /**
36
+ * Respond to an auth challenge
37
+ */
38
+ respondToAuthChallenge(request: RespondToAuthChallengeRequest): Promise<any>;
39
+ /**
40
+ * Reset a user's password
41
+ */
42
+ resetPassword(request: SetPasswordRequest): Promise<void>;
43
+ }
44
+ export interface HealthcheckResponse {
45
+ status: string;
46
+ }
@@ -72,7 +72,6 @@ const PeopleBusinessApi_1 = __importDefault(require("./people-business/api/Peopl
72
72
  const STPBusinessApi_1 = __importDefault(require("./stp-business/api/STPBusinessApi"));
73
73
  const MulticommServicePaymentApi_1 = __importDefault(require("./multicommServicePayment/api/MulticommServicePaymentApi"));
74
74
  const ProductPaymentApi_1 = __importDefault(require("./product-payment/api/ProductPaymentApi"));
75
- const commission_business_1 = require("./commission-business");
76
75
  // Credit module - API clients
77
76
  const credit_engine_1 = require("./credit-engine");
78
77
  const credit_payment_1 = require("./credit-payment");
@@ -157,7 +156,6 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
157
156
  bind("IPeopleBusinessApi").to(PeopleBusinessApi_1.default);
158
157
  bind("ISTPBusinessApi").to(STPBusinessApi_1.default);
159
158
  bind("IProductPaymentApi").to(ProductPaymentApi_1.default);
160
- bind("ICommissionBusinessApi").to(commission_business_1.CommissionBusinessApi);
161
159
  // Credit module - API clients
162
160
  bind("ICreditEngineApi").to(credit_engine_1.CreditEngineApi);
163
161
  bind("ICreditPaymentApi").to(credit_payment_1.CreditPaymentApi);
@@ -1,21 +1,16 @@
1
1
  import { IHttpRequest } from "@fiado/http-client";
2
2
  import { ICreditPaymentApi } from "./interfaces/ICreditPaymentApi";
3
- import { CreditDisbursementRequest, CreditDisbursementResponse } from "@fiado/type-kit/bin/credit";
4
- import { CreditCollectionRequest, CreditCollectionResponse } from "@fiado/type-kit/bin/credit";
5
- import { CreditTransferLoancoRequest, CreditTransferLoancoResponse } from "@fiado/type-kit/bin/credit";
6
- import { CreditReversalRequest, CreditReversalResponse } from "@fiado/type-kit/bin/credit";
7
- import { CreditBalanceResponse } from "@fiado/type-kit/bin/credit";
8
3
  export declare class CreditPaymentApi implements ICreditPaymentApi {
9
4
  private httpRequest;
10
5
  private readonly baseUrl;
11
6
  constructor(httpRequest: IHttpRequest);
12
- disburse(request: CreditDisbursementRequest): Promise<CreditDisbursementResponse>;
13
- collect(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
14
- collectPartial(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
15
- collectLien(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
16
- earlyPayment(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
17
- transferLoanco(request: CreditTransferLoancoRequest): Promise<CreditTransferLoancoResponse>;
18
- reverse(request: CreditReversalRequest): Promise<CreditReversalResponse>;
19
- getBalance(creditId: string): Promise<CreditBalanceResponse>;
7
+ disburse(request: any): Promise<any>;
8
+ collect(request: any): Promise<any>;
9
+ collectPartial(request: any): Promise<any>;
10
+ collectLien(request: any): Promise<any>;
11
+ earlyPayment(request: any): Promise<any>;
12
+ transferLoanco(request: any): Promise<any>;
13
+ reverse(request: any): Promise<any>;
14
+ getBalance(creditId: string): Promise<any>;
20
15
  getHistory(creditId: string): Promise<any>;
21
16
  }
@@ -25,43 +25,43 @@ let CreditPaymentApi = class CreditPaymentApi {
25
25
  this.baseUrl = process.env.CREDIT_PAYMENT_LAMBDA_URL || "";
26
26
  }
27
27
  async disburse(request) {
28
- const url = `${this.baseUrl}credit/disburse`;
29
- const operationName = "creditDisburse";
28
+ const url = `${this.baseUrl}credit-payment/disburse`;
29
+ const operationName = "privateDisburse";
30
30
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
31
31
  }
32
32
  async collect(request) {
33
- const url = `${this.baseUrl}credit/collect`;
34
- const operationName = "creditCollect";
33
+ const url = `${this.baseUrl}credit-payment/collect`;
34
+ const operationName = "privateCollect";
35
35
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
36
36
  }
37
37
  async collectPartial(request) {
38
- const url = `${this.baseUrl}credit/collect-partial`;
39
- const operationName = "creditCollectPartial";
38
+ const url = `${this.baseUrl}credit-payment/collect-partial`;
39
+ const operationName = "privateCollectPartial";
40
40
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
41
41
  }
42
42
  async collectLien(request) {
43
- const url = `${this.baseUrl}credit/collect-lien`;
44
- const operationName = "creditCollectLien";
43
+ const url = `${this.baseUrl}credit-payment/collect-lien`;
44
+ const operationName = "privateCollectLien";
45
45
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
46
46
  }
47
47
  async earlyPayment(request) {
48
- const url = `${this.baseUrl}credit/early-payment`;
49
- const operationName = "creditEarlyPayment";
48
+ const url = `${this.baseUrl}credit-payment/early-payment`;
49
+ const operationName = "privateEarlyPayment";
50
50
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
51
51
  }
52
52
  async transferLoanco(request) {
53
- const url = `${this.baseUrl}credit/transfer-loanco`;
54
- const operationName = "creditTransferLoanco";
53
+ const url = `${this.baseUrl}credit-payment/transfer-loanco`;
54
+ const operationName = "privateTransferLoanco";
55
55
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
56
56
  }
57
57
  async reverse(request) {
58
- const url = `${this.baseUrl}credit/reverse`;
59
- const operationName = "creditReverse";
58
+ const url = `${this.baseUrl}credit-payment/reverse`;
59
+ const operationName = "privateReverse";
60
60
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
61
61
  }
62
62
  async getBalance(creditId) {
63
- const url = `${this.baseUrl}credit/balance/${creditId}`;
64
- const operationName = "creditBalance";
63
+ const url = `${this.baseUrl}credit-payment/balance/${creditId}`;
64
+ const operationName = "privateBalance";
65
65
  return await this.httpRequest.post(url, null, { 'operationName': operationName });
66
66
  }
67
67
  async getHistory(creditId) {
@@ -1,41 +1,36 @@
1
- import { CreditDisbursementRequest, CreditDisbursementResponse } from "@fiado/type-kit/bin/credit";
2
- import { CreditCollectionRequest, CreditCollectionResponse } from "@fiado/type-kit/bin/credit";
3
- import { CreditTransferLoancoRequest, CreditTransferLoancoResponse } from "@fiado/type-kit/bin/credit";
4
- import { CreditReversalRequest, CreditReversalResponse } from "@fiado/type-kit/bin/credit";
5
- import { CreditBalanceResponse } from "@fiado/type-kit/bin/credit";
6
1
  export interface ICreditPaymentApi {
7
2
  /**
8
3
  * Desembolsa el monto del crédito a la cuenta del usuario.
9
4
  */
10
- disburse(request: CreditDisbursementRequest): Promise<CreditDisbursementResponse>;
5
+ disburse(request: any): Promise<any>;
11
6
  /**
12
7
  * Cobra el cupón regular de un crédito.
13
8
  */
14
- collect(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
9
+ collect(request: any): Promise<any>;
15
10
  /**
16
11
  * Cobra un monto parcial (insuficiente para cupón completo).
17
12
  */
18
- collectPartial(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
13
+ collectPartial(request: any): Promise<any>;
19
14
  /**
20
15
  * Cobra por cobro latente (lien sobre depósito).
21
16
  */
22
- collectLien(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
17
+ collectLien(request: any): Promise<any>;
23
18
  /**
24
19
  * Procesa un pago anticipado/adelantado/liquidación.
25
20
  */
26
- earlyPayment(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
21
+ earlyPayment(request: any): Promise<any>;
27
22
  /**
28
23
  * Transfiere fondos recaudados a LoanCo.
29
24
  */
30
- transferLoanco(request: CreditTransferLoancoRequest): Promise<CreditTransferLoancoResponse>;
25
+ transferLoanco(request: any): Promise<any>;
31
26
  /**
32
27
  * Reversa una transacción de crédito.
33
28
  */
34
- reverse(request: CreditReversalRequest): Promise<CreditReversalResponse>;
29
+ reverse(request: any): Promise<any>;
35
30
  /**
36
31
  * Consulta el balance de un crédito.
37
32
  */
38
- getBalance(creditId: string): Promise<CreditBalanceResponse>;
33
+ getBalance(creditId: string): Promise<any>;
39
34
  /**
40
35
  * Obtiene historial de transacciones de un crédito.
41
36
  */
package/bin/index.d.ts CHANGED
@@ -62,4 +62,3 @@ export * from "./product-payment";
62
62
  export * from "./credit-engine";
63
63
  export * from "./credit-payment";
64
64
  export * from "./document-generator";
65
- export * from "./commission-business";
package/bin/index.js CHANGED
@@ -78,4 +78,3 @@ __exportStar(require("./product-payment"), exports);
78
78
  __exportStar(require("./credit-engine"), exports);
79
79
  __exportStar(require("./credit-payment"), exports);
80
80
  __exportStar(require("./document-generator"), exports);
81
- __exportStar(require("./commission-business"), exports);
@@ -0,0 +1,3 @@
1
+ export interface IReportProcessorBusiness {
2
+ processReports(key: string): Promise<void>;
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
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.1",
19
+ "@fiado/type-kit": "^3.0.0",
20
20
  "dotenv": "^16.4.7",
21
21
  "inversify": "^6.2.2",
22
22
  "reflect-metadata": "^0.2.2"
@@ -96,7 +96,6 @@ import { IMulticommServicePaymentApi } from "./multicommServicePayment";
96
96
  import MulticommServicePaymentApi from "./multicommServicePayment/api/MulticommServicePaymentApi";
97
97
  import { IProductPaymentApi } from "./product-payment";
98
98
  import ProductPaymentApi from "./product-payment/api/ProductPaymentApi";
99
- import { CommissionBusinessApi, ICommissionBusinessApi } from "./commission-business";
100
99
  // Credit module - API clients
101
100
  import { CreditEngineApi, ICreditEngineApi } from "./credit-engine";
102
101
  import { CreditPaymentApi, ICreditPaymentApi } from "./credit-payment";
@@ -196,7 +195,6 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
196
195
  bind<IPeopleBusinessApi>("IPeopleBusinessApi").to(PeopleBusinessApi);
197
196
  bind<ISTPBusinessApi>("ISTPBusinessApi").to(STPBusinessApi);
198
197
  bind<IProductPaymentApi>("IProductPaymentApi").to(ProductPaymentApi);
199
- bind<ICommissionBusinessApi>("ICommissionBusinessApi").to(CommissionBusinessApi);
200
198
 
201
199
  // Credit module - API clients
202
200
  bind<ICreditEngineApi>("ICreditEngineApi").to(CreditEngineApi);
@@ -2,11 +2,6 @@ import dotenv from 'dotenv';
2
2
  import { inject, injectable } from "inversify";
3
3
  import { IHttpRequest } from "@fiado/http-client";
4
4
  import { ICreditPaymentApi } from "./interfaces/ICreditPaymentApi";
5
- import { CreditDisbursementRequest, CreditDisbursementResponse } from "@fiado/type-kit/bin/credit";
6
- import { CreditCollectionRequest, CreditCollectionResponse } from "@fiado/type-kit/bin/credit";
7
- import { CreditTransferLoancoRequest, CreditTransferLoancoResponse } from "@fiado/type-kit/bin/credit";
8
- import { CreditReversalRequest, CreditReversalResponse } from "@fiado/type-kit/bin/credit";
9
- import { CreditBalanceResponse } from "@fiado/type-kit/bin/credit";
10
5
  dotenv.config();
11
6
 
12
7
  @injectable()
@@ -16,51 +11,51 @@ export class CreditPaymentApi implements ICreditPaymentApi {
16
11
 
17
12
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
18
13
 
19
- public async disburse(request: CreditDisbursementRequest): Promise<CreditDisbursementResponse> {
20
- const url = `${this.baseUrl}credit/disburse`;
21
- const operationName = "creditDisburse";
14
+ public async disburse(request: any): Promise<any> {
15
+ const url = `${this.baseUrl}credit-payment/disburse`;
16
+ const operationName = "privateDisburse";
22
17
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
23
18
  }
24
19
 
25
- public async collect(request: CreditCollectionRequest): Promise<CreditCollectionResponse> {
26
- const url = `${this.baseUrl}credit/collect`;
27
- const operationName = "creditCollect";
20
+ public async collect(request: any): Promise<any> {
21
+ const url = `${this.baseUrl}credit-payment/collect`;
22
+ const operationName = "privateCollect";
28
23
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
29
24
  }
30
25
 
31
- public async collectPartial(request: CreditCollectionRequest): Promise<CreditCollectionResponse> {
32
- const url = `${this.baseUrl}credit/collect-partial`;
33
- const operationName = "creditCollectPartial";
26
+ public async collectPartial(request: any): Promise<any> {
27
+ const url = `${this.baseUrl}credit-payment/collect-partial`;
28
+ const operationName = "privateCollectPartial";
34
29
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
35
30
  }
36
31
 
37
- public async collectLien(request: CreditCollectionRequest): Promise<CreditCollectionResponse> {
38
- const url = `${this.baseUrl}credit/collect-lien`;
39
- const operationName = "creditCollectLien";
32
+ public async collectLien(request: any): Promise<any> {
33
+ const url = `${this.baseUrl}credit-payment/collect-lien`;
34
+ const operationName = "privateCollectLien";
40
35
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
41
36
  }
42
37
 
43
- public async earlyPayment(request: CreditCollectionRequest): Promise<CreditCollectionResponse> {
44
- const url = `${this.baseUrl}credit/early-payment`;
45
- const operationName = "creditEarlyPayment";
38
+ public async earlyPayment(request: any): Promise<any> {
39
+ const url = `${this.baseUrl}credit-payment/early-payment`;
40
+ const operationName = "privateEarlyPayment";
46
41
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
47
42
  }
48
43
 
49
- public async transferLoanco(request: CreditTransferLoancoRequest): Promise<CreditTransferLoancoResponse> {
50
- const url = `${this.baseUrl}credit/transfer-loanco`;
51
- const operationName = "creditTransferLoanco";
44
+ public async transferLoanco(request: any): Promise<any> {
45
+ const url = `${this.baseUrl}credit-payment/transfer-loanco`;
46
+ const operationName = "privateTransferLoanco";
52
47
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
53
48
  }
54
49
 
55
- public async reverse(request: CreditReversalRequest): Promise<CreditReversalResponse> {
56
- const url = `${this.baseUrl}credit/reverse`;
57
- const operationName = "creditReverse";
50
+ public async reverse(request: any): Promise<any> {
51
+ const url = `${this.baseUrl}credit-payment/reverse`;
52
+ const operationName = "privateReverse";
58
53
  return await this.httpRequest.post(url, request, { 'operationName': operationName });
59
54
  }
60
55
 
61
- public async getBalance(creditId: string): Promise<CreditBalanceResponse> {
62
- const url = `${this.baseUrl}credit/balance/${creditId}`;
63
- const operationName = "creditBalance";
56
+ public async getBalance(creditId: string): Promise<any> {
57
+ const url = `${this.baseUrl}credit-payment/balance/${creditId}`;
58
+ const operationName = "privateBalance";
64
59
  return await this.httpRequest.post(url, null, { 'operationName': operationName });
65
60
  }
66
61
 
@@ -1,49 +1,43 @@
1
- import { CreditDisbursementRequest, CreditDisbursementResponse } from "@fiado/type-kit/bin/credit";
2
- import { CreditCollectionRequest, CreditCollectionResponse } from "@fiado/type-kit/bin/credit";
3
- import { CreditTransferLoancoRequest, CreditTransferLoancoResponse } from "@fiado/type-kit/bin/credit";
4
- import { CreditReversalRequest, CreditReversalResponse } from "@fiado/type-kit/bin/credit";
5
- import { CreditBalanceResponse } from "@fiado/type-kit/bin/credit";
6
-
7
1
  export interface ICreditPaymentApi {
8
2
  /**
9
3
  * Desembolsa el monto del crédito a la cuenta del usuario.
10
4
  */
11
- disburse(request: CreditDisbursementRequest): Promise<CreditDisbursementResponse>;
5
+ disburse(request: any): Promise<any>;
12
6
 
13
7
  /**
14
8
  * Cobra el cupón regular de un crédito.
15
9
  */
16
- collect(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
10
+ collect(request: any): Promise<any>;
17
11
 
18
12
  /**
19
13
  * Cobra un monto parcial (insuficiente para cupón completo).
20
14
  */
21
- collectPartial(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
15
+ collectPartial(request: any): Promise<any>;
22
16
 
23
17
  /**
24
18
  * Cobra por cobro latente (lien sobre depósito).
25
19
  */
26
- collectLien(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
20
+ collectLien(request: any): Promise<any>;
27
21
 
28
22
  /**
29
23
  * Procesa un pago anticipado/adelantado/liquidación.
30
24
  */
31
- earlyPayment(request: CreditCollectionRequest): Promise<CreditCollectionResponse>;
25
+ earlyPayment(request: any): Promise<any>;
32
26
 
33
27
  /**
34
28
  * Transfiere fondos recaudados a LoanCo.
35
29
  */
36
- transferLoanco(request: CreditTransferLoancoRequest): Promise<CreditTransferLoancoResponse>;
30
+ transferLoanco(request: any): Promise<any>;
37
31
 
38
32
  /**
39
33
  * Reversa una transacción de crédito.
40
34
  */
41
- reverse(request: CreditReversalRequest): Promise<CreditReversalResponse>;
35
+ reverse(request: any): Promise<any>;
42
36
 
43
37
  /**
44
38
  * Consulta el balance de un crédito.
45
39
  */
46
- getBalance(creditId: string): Promise<CreditBalanceResponse>;
40
+ getBalance(creditId: string): Promise<any>;
47
41
 
48
42
  /**
49
43
  * Obtiene historial de transacciones de un crédito.
package/src/index.ts CHANGED
@@ -62,5 +62,4 @@ export * from "./product-payment";
62
62
  export * from "./credit-engine";
63
63
  export * from "./credit-payment";
64
64
  export * from "./document-generator";
65
- export * from "./commission-business";
66
65
 
@@ -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,36 +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
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.TransactionPublisher = void 0;
10
- const client_sqs_1 = require("@aws-sdk/client-sqs");
11
- const inversify_1 = require("inversify");
12
- let TransactionPublisher = class TransactionPublisher {
13
- constructor() {
14
- this.FIADO_INC_KYC_MESSAGE_QUEUE = process.env.FIADO_INC_KYC_MESSAGE_QUEUE;
15
- }
16
- async publish(message) {
17
- try {
18
- const client = new client_sqs_1.SQSClient();
19
- const sendMessageRequest = {
20
- QueueUrl: this.FIADO_INC_KYC_MESSAGE_QUEUE,
21
- MessageBody: JSON.stringify(message),
22
- MessageGroupId: message.externalUserId,
23
- MessageDeduplicationId: message.externalUserId
24
- };
25
- const command = new client_sqs_1.SendMessageCommand(sendMessageRequest);
26
- await client.send(command);
27
- }
28
- catch (error) {
29
- throw new Error(`Error publishing message to queue ${': ' + error.message}`);
30
- }
31
- }
32
- };
33
- exports.TransactionPublisher = TransactionPublisher;
34
- exports.TransactionPublisher = TransactionPublisher = __decorate([
35
- (0, inversify_1.injectable)()
36
- ], TransactionPublisher);
@@ -1,7 +0,0 @@
1
- import { ProviderDocumentUploadRequest } from "@fiado/type-kit/bin/provider";
2
- export interface ITransactionPublisher {
3
- publish(params: {
4
- externalUserId: string;
5
- input: ProviderDocumentUploadRequest;
6
- }): Promise<void>;
7
- }
@@ -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);
@@ -1,2 +0,0 @@
1
- export * from './interfaces/IActivityApi';
2
- export * from './ActivityApi';
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./interfaces/IActivityApi"), exports);
18
- __exportStar(require("./ActivityApi"), exports);
@@ -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
- }
@@ -1,9 +0,0 @@
1
- import { IHttpRequest } from "@fiado/http-client";
2
- import { ICommissionBusinessApi } from "./interfaces/ICommissionBusinessApi";
3
- import { CreatePaymentMadeRequest } from "@fiado/type-kit/bin/comission-business";
4
- export declare class CommissionBusinessApi implements ICommissionBusinessApi {
5
- private httpRequest;
6
- private readonly baseUrl;
7
- constructor(httpRequest: IHttpRequest);
8
- createPaymentMade(body: CreatePaymentMadeRequest): Promise<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.CommissionBusinessApi = void 0;
19
- const inversify_1 = require("inversify");
20
- const dotenv_1 = __importDefault(require("dotenv"));
21
- dotenv_1.default.config();
22
- let CommissionBusinessApi = class CommissionBusinessApi {
23
- constructor(httpRequest) {
24
- this.httpRequest = httpRequest;
25
- this.baseUrl = process.env.COMMISSION_BUSINESS_LAMBDA_URL || "";
26
- }
27
- async createPaymentMade(body) {
28
- const url = `${this.baseUrl}private/commission-payment-made`;
29
- return await this.httpRequest.post(url, body);
30
- }
31
- };
32
- exports.CommissionBusinessApi = CommissionBusinessApi;
33
- exports.CommissionBusinessApi = CommissionBusinessApi = __decorate([
34
- (0, inversify_1.injectable)(),
35
- __param(0, (0, inversify_1.inject)("IHttpRequest")),
36
- __metadata("design:paramtypes", [Object])
37
- ], CommissionBusinessApi);
@@ -1,2 +0,0 @@
1
- export * from './interfaces/ICommissionBusinessApi';
2
- export * from './CommissionBusinessApi';
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./interfaces/ICommissionBusinessApi"), exports);
18
- __exportStar(require("./CommissionBusinessApi"), exports);
@@ -1,13 +0,0 @@
1
- import { CreatePaymentMadeRequest } from "@fiado/type-kit/bin/comission-business";
2
- /**
3
- * Interfaz que define las operaciones del servicio de commission-business.
4
- */
5
- export interface ICommissionBusinessApi {
6
- /**
7
- * Crear un registro de pago de comisión (CommissionPaymentsMade)
8
- * @param body datos del pago a crear.
9
- * @returns Una promesa con el resultado de la operación.
10
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
11
- */
12
- createPaymentMade(body: CreatePaymentMadeRequest): Promise<any>;
13
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -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);
@@ -1,19 +0,0 @@
1
- import { inject, injectable } from "inversify";
2
- import { IHttpRequest } from "@fiado/http-client";
3
- import dotenv from 'dotenv';
4
- import { ICommissionBusinessApi } from "./interfaces/ICommissionBusinessApi";
5
- import { CreatePaymentMadeRequest } from "@fiado/type-kit/bin/comission-business";
6
-
7
- dotenv.config();
8
-
9
- @injectable()
10
- export class CommissionBusinessApi implements ICommissionBusinessApi {
11
- private readonly baseUrl = process.env.COMMISSION_BUSINESS_LAMBDA_URL || "";
12
-
13
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
14
-
15
- async createPaymentMade(body: CreatePaymentMadeRequest): Promise<any> {
16
- const url = `${this.baseUrl}private/commission-payment-made`;
17
- return await this.httpRequest.post(url, body);
18
- }
19
- }
@@ -1,3 +0,0 @@
1
-
2
- export * from './interfaces/ICommissionBusinessApi';
3
- export * from './CommissionBusinessApi';
@@ -1,15 +0,0 @@
1
- import { CreatePaymentMadeRequest } from "@fiado/type-kit/bin/comission-business";
2
-
3
- /**
4
- * Interfaz que define las operaciones del servicio de commission-business.
5
- */
6
- export interface ICommissionBusinessApi {
7
-
8
- /**
9
- * Crear un registro de pago de comisión (CommissionPaymentsMade)
10
- * @param body datos del pago a crear.
11
- * @returns Una promesa con el resultado de la operación.
12
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
13
- */
14
- createPaymentMade(body: CreatePaymentMadeRequest): Promise<any>;
15
- }