@fiado/api-invoker 1.2.80 → 1.2.82

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.
@@ -1,6 +1,6 @@
1
1
  import { ICentralPaymentsConnectorApi } from "./interfaces/ICentralPaymentsConnectorApi";
2
2
  import { IHttpRequest } from "@fiado/http-client";
3
- import { CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
3
+ import { BankAccountP2pTransferRequest, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
4
4
  import { HealthcheckResponse, OOWQuestionsResponse, SubmitOOWQuestionAnswersRequest } from "@fiado/type-kit/bin/centralPayments";
5
5
  import { ActivateBankAccountCardRequest, ActivateBankAccountCardResponse, CardBatchRequest, CardBatchResponse, CardStatementListResponse, CreateBankAccountCardRequest, CreateBankAccountCardResponse, GetBankAccountCardBalanceResponse, GetBankAccountCardResponse, StatementDocumentResponse, UpdateBankAccountCardRequest, UpdateBankAccountCardResponse } from "@fiado/type-kit/bin/card";
6
6
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
@@ -9,6 +9,7 @@ import { InvokerUtils } from "../utils/InvokerUtils";
9
9
  import { ProviderDocumentUploadRequest } from "@fiado/type-kit/bin/provider";
10
10
  import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
11
11
  import { CreateExternalBankAccountRequest, CreateExternalBankAccountResponse } from "@fiado/type-kit/bin/bankAccount";
12
+ import { BankAccountP2pTransferResponse } from "@fiado/type-kit/bin/account/dtos/BankAccountP2pTransferResponse";
12
13
  export declare class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
13
14
  private readonly httpRequest;
14
15
  private readonly _invokerUtils;
@@ -41,6 +42,7 @@ export declare class CentralPaymentsConnectorApi implements ICentralPaymentsConn
41
42
  getStatementDocument(statementId: string): Promise<FiadoApiResponse<StatementDocumentResponse>>;
42
43
  getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>>;
43
44
  getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
45
+ executeCardToCardTransaction(request: BankAccountP2pTransferRequest): Promise<FiadoApiResponse<BankAccountP2pTransferResponse>>;
44
46
  getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
45
47
  createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;
46
48
  getACHBankAccountDetail(bankAccountId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
@@ -137,6 +137,10 @@ let CentralPaymentsConnectorApi = class CentralPaymentsConnectorApi {
137
137
  const url = `${this.baseUrl}/transactions/${externalTransactionId}`;
138
138
  return await this.httpRequest.get(url);
139
139
  }
140
+ async executeCardToCardTransaction(request) {
141
+ const url = `${this.baseUrl}/transactions/p2p/transfer`;
142
+ return await this.httpRequest.post(url, request);
143
+ }
140
144
  /* ACH BANK ACCOUNTS */
141
145
  async getCardholderACHBankAccounts(externalUserId) {
142
146
  const url = `${this.baseUrl}/bank-accounts/cardholder/${externalUserId}`;
@@ -1,4 +1,4 @@
1
- import { CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
1
+ import { BankAccountP2pTransferRequest, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
2
2
  import { HealthcheckResponse, OOWQuestionsResponse, SubmitOOWQuestionAnswersRequest } from "@fiado/type-kit/bin/centralPayments";
3
3
  import { ActivateBankAccountCardRequest, ActivateBankAccountCardResponse, CardBatchRequest, CardBatchResponse, CardStatementListResponse, CreateBankAccountCardRequest, CreateBankAccountCardResponse, GetBankAccountCardBalanceResponse, GetBankAccountCardResponse, StatementDocumentResponse, UpdateBankAccountCardRequest, UpdateBankAccountCardResponse } from "@fiado/type-kit/bin/card";
4
4
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
@@ -6,6 +6,7 @@ import { CentralPaymentsQueryParams, CentralPaymentsTransactionItem, Transaction
6
6
  import { ProviderDocumentUploadRequest } from "@fiado/type-kit/bin/provider";
7
7
  import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
8
8
  import { CreateExternalBankAccountRequest, CreateExternalBankAccountResponse } from "@fiado/type-kit/bin/bankAccount";
9
+ import { BankAccountP2pTransferResponse } from "@fiado/type-kit/bin/account/dtos/BankAccountP2pTransferResponse";
9
10
  export interface ICentralPaymentsConnectorApi {
10
11
  healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
11
12
  createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
@@ -34,6 +35,7 @@ export interface ICentralPaymentsConnectorApi {
34
35
  getStatementDocument(statementId: string): Promise<FiadoApiResponse<StatementDocumentResponse>>;
35
36
  getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>>;
36
37
  getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
38
+ executeCardToCardTransaction(request: BankAccountP2pTransferRequest): Promise<FiadoApiResponse<BankAccountP2pTransferResponse>>;
37
39
  getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
38
40
  createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;
39
41
  getACHBankAccountDetail(bankAccountId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
@@ -5,6 +5,7 @@ export declare class DeviceApi implements IDeviceApi {
5
5
  private httpRequest;
6
6
  private readonly baseUrl;
7
7
  constructor(httpRequest: IHttpRequest);
8
+ getById(id: string): Promise<void>;
8
9
  registerDevice(params: RegisterDeviceRequest): Promise<void>;
9
10
  getDevicesByDirectoryIdAndStatus(params: {
10
11
  directoryId: string;
@@ -24,12 +24,16 @@ let DeviceApi = class DeviceApi {
24
24
  this.httpRequest = httpRequest;
25
25
  this.baseUrl = process.env.DEVICE_BUSINESS_URL || "";
26
26
  }
27
+ async getById(id) {
28
+ const url = `${this.baseUrl}devices/get/${id}`;
29
+ return await this.httpRequest.get(url);
30
+ }
27
31
  async registerDevice(params) {
28
- const url = `${this.baseUrl}/devices`;
32
+ const url = `${this.baseUrl}devices`;
29
33
  return await this.httpRequest.post(url, params);
30
34
  }
31
35
  async getDevicesByDirectoryIdAndStatus(params) {
32
- const url = `${this.baseUrl}/devices/directories/${params.directoryId}?status=${params.status}`;
36
+ const url = `${this.baseUrl}devices/directories/${params.directoryId}?status=${params.status}`;
33
37
  return await this.httpRequest.get(url);
34
38
  }
35
39
  };
@@ -20,4 +20,11 @@ export interface IDeviceApi {
20
20
  directoryId: string;
21
21
  status: string;
22
22
  }): Promise<void>;
23
+ /**
24
+ * Consultar dispositivos por id
25
+ * @param value valor del parametro.
26
+ * @returns Una promesa que resuelve a void.
27
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
28
+ */
29
+ getById(id: string): Promise<void>;
23
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.2.80",
3
+ "version": "1.2.82",
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",
@@ -2,6 +2,7 @@ import {ICentralPaymentsConnectorApi} from "./interfaces/ICentralPaymentsConnect
2
2
  import {inject, injectable} from "inversify";
3
3
  import {IHttpRequest} from "@fiado/http-client";
4
4
  import {
5
+ BankAccountP2pTransferRequest,
5
6
  CreateBankAccountUserRequest,
6
7
  CreateBankAccountUserResponse,
7
8
  GetBankAccountResponse,
@@ -37,6 +38,7 @@ import {InvokerUtils} from "../utils/InvokerUtils";
37
38
  import {ProviderDocumentUploadRequest} from "@fiado/type-kit/bin/provider";
38
39
  import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
39
40
  import {CreateExternalBankAccountRequest, CreateExternalBankAccountResponse} from "@fiado/type-kit/bin/bankAccount";
41
+ import {BankAccountP2pTransferResponse} from "@fiado/type-kit/bin/account/dtos/BankAccountP2pTransferResponse";
40
42
 
41
43
  @injectable()
42
44
  export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
@@ -192,6 +194,11 @@ export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi
192
194
  return await this.httpRequest.get(url);
193
195
  }
194
196
 
197
+ async executeCardToCardTransaction(request: BankAccountP2pTransferRequest): Promise<FiadoApiResponse<BankAccountP2pTransferResponse>> {
198
+ const url = `${this.baseUrl}/transactions/p2p/transfer`;
199
+ return await this.httpRequest.post(url, request);
200
+ }
201
+
195
202
  /* ACH BANK ACCOUNTS */
196
203
  async getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>> {
197
204
  const url = `${this.baseUrl}/bank-accounts/cardholder/${externalUserId}`;
@@ -1,4 +1,5 @@
1
1
  import {
2
+ BankAccountP2pTransferRequest,
2
3
  CreateBankAccountUserRequest,
3
4
  CreateBankAccountUserResponse,
4
5
  GetBankAccountResponse,
@@ -33,6 +34,7 @@ import {
33
34
  import {ProviderDocumentUploadRequest} from "@fiado/type-kit/bin/provider";
34
35
  import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
35
36
  import {CreateExternalBankAccountRequest, CreateExternalBankAccountResponse} from "@fiado/type-kit/bin/bankAccount";
37
+ import {BankAccountP2pTransferResponse} from "@fiado/type-kit/bin/account/dtos/BankAccountP2pTransferResponse";
36
38
 
37
39
  export interface ICentralPaymentsConnectorApi {
38
40
  healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
@@ -89,6 +91,8 @@ export interface ICentralPaymentsConnectorApi {
89
91
 
90
92
  getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
91
93
 
94
+ executeCardToCardTransaction(request: BankAccountP2pTransferRequest): Promise<FiadoApiResponse<BankAccountP2pTransferResponse>>;
95
+
92
96
  getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
93
97
 
94
98
  createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;
@@ -10,14 +10,18 @@ export class DeviceApi implements IDeviceApi {
10
10
  private readonly baseUrl = process.env.DEVICE_BUSINESS_URL || "";
11
11
 
12
12
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
13
+ async getById(id: string): Promise<void> {
14
+ const url = `${this.baseUrl}devices/get/${id}`;
15
+ return await this.httpRequest.get(url);
16
+ }
13
17
 
14
18
  async registerDevice(params: RegisterDeviceRequest): Promise<void> {
15
- const url = `${this.baseUrl}/devices`;
19
+ const url = `${this.baseUrl}devices`;
16
20
  return await this.httpRequest.post(url, params);
17
21
  }
18
22
 
19
23
  async getDevicesByDirectoryIdAndStatus(params: { directoryId: string; status: string; }): Promise<void> {
20
- const url = `${this.baseUrl}/devices/directories/${params.directoryId}?status=${params.status}`;
24
+ const url = `${this.baseUrl}devices/directories/${params.directoryId}?status=${params.status}`;
21
25
  return await this.httpRequest.get(url);
22
26
  }
23
27
 
@@ -21,4 +21,12 @@ export interface IDeviceApi {
21
21
  */
22
22
  getDevicesByDirectoryIdAndStatus(params: { directoryId: string; status: string; }): Promise<void>;
23
23
 
24
+ /**
25
+ * Consultar dispositivos por id
26
+ * @param value valor del parametro.
27
+ * @returns Una promesa que resuelve a void.
28
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
29
+ */
30
+ getById(id: string): Promise<void>;
31
+
24
32
  }