@fiado/api-invoker 1.3.8 → 1.3.10

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,15 +1,15 @@
1
1
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
2
  import { IHttpRequest } from "@fiado/http-client";
3
3
  import { CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest } from "@fiado/type-kit/bin/card";
4
- import { CountryId } from "@fiado/type-kit/bin/country";
5
4
  import { ICardApi } from "./interfaces/ICardApi";
6
5
  import { Provider } from "@fiado/type-kit/bin/provider";
7
6
  export declare class CardApi implements ICardApi {
8
7
  private httpRequest;
9
8
  private readonly baseUrl;
10
9
  constructor(httpRequest: IHttpRequest);
11
- getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
12
- getByExternalId(externalId: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
10
+ getByDirectoryId(provider: Provider, directoryId: string): Promise<ApiGatewayResponse<CardResponse>>;
11
+ getById(provider: Provider, id: string): Promise<ApiGatewayResponse<CardResponse>>;
12
+ getByExternalId(provider: Provider, externalId: string): Promise<ApiGatewayResponse<CardResponse>>;
13
13
  evaluateAccountLevelUpdate(directoryId: string): Promise<void>;
14
14
  findCardIssuanceByIds(directoryIds: string[]): Promise<ApiGatewayResponse<any>>;
15
15
  updateIssuance(provider: Provider, input: CardUpdateIssuanceRequest): Promise<ApiGatewayResponse<void>>;
@@ -19,12 +19,16 @@ let CardApi = class CardApi {
19
19
  this.httpRequest = httpRequest;
20
20
  this.baseUrl = process.env.CARD_LAMBDA_URL || "";
21
21
  }
22
- async getById(id, countryId) {
23
- const url = `${this.baseUrl}/${countryId}?cardId=${id}`;
22
+ async getByDirectoryId(provider, directoryId) {
23
+ const url = `${this.baseUrl}${provider}/${directoryId}/find`;
24
24
  return await this.httpRequest.get(url);
25
25
  }
26
- async getByExternalId(externalId, countryId) {
27
- const url = `${this.baseUrl}/${countryId}?externalCardId=${externalId}`;
26
+ async getById(provider, id) {
27
+ const url = `${this.baseUrl}/${provider}?cardId=${id}`;
28
+ return await this.httpRequest.get(url);
29
+ }
30
+ async getByExternalId(provider, externalId) {
31
+ const url = `${this.baseUrl}/${provider}?externalCardId=${externalId}`;
28
32
  return await this.httpRequest.get(url);
29
33
  }
30
34
  async evaluateAccountLevelUpdate(directoryId) {
@@ -1,5 +1,5 @@
1
1
  import { IHttpRequest } from "@fiado/http-client";
2
- import { BankAccountP2pTransferRequest, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountSensitiveInformationResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
2
+ import { BankAccountP2pTransferRequest, BankAccountPocketTransferRequest, BankAccountPocketTransferResponse, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountSensitiveInformationResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
3
3
  import { BankAccountP2pTransferResponse } from "@fiado/type-kit/bin/account/dtos/BankAccountP2pTransferResponse";
4
4
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
5
5
  import { CreateExternalBankAccountRequest, CreateExternalBankAccountResponse } from "@fiado/type-kit/bin/bankAccount";
@@ -45,6 +45,7 @@ export declare class CentralPaymentsConnectorApi implements ICentralPaymentsConn
45
45
  getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>>;
46
46
  getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
47
47
  executeCardToCardTransaction(request: BankAccountP2pTransferRequest): Promise<FiadoApiResponse<BankAccountP2pTransferResponse>>;
48
+ executeFinancialOperation(request: BankAccountPocketTransferRequest[]): Promise<FiadoApiResponse<BankAccountPocketTransferResponse[]>>;
48
49
  getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
49
50
  createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;
50
51
  getACHBankAccountDetail(bankAccountId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
@@ -149,6 +149,10 @@ let CentralPaymentsConnectorApi = class CentralPaymentsConnectorApi {
149
149
  const url = `${this.baseUrl}/transactions/p2p/transfer`;
150
150
  return await this.httpRequest.post(url, request);
151
151
  }
152
+ async executeFinancialOperation(request) {
153
+ const url = `${this.baseUrl}/transactions/pocket/transfer`;
154
+ return await this.httpRequest.post(url, request);
155
+ }
152
156
  /* ACH BANK ACCOUNTS */
153
157
  async getCardholderACHBankAccounts(externalUserId) {
154
158
  const url = `${this.baseUrl}/ach/bank-accounts/cardholders/${externalUserId}`;
@@ -1,4 +1,4 @@
1
- import { BankAccountP2pTransferRequest, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountSensitiveInformationResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
1
+ import { BankAccountP2pTransferRequest, BankAccountPocketTransferRequest, BankAccountPocketTransferResponse, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountSensitiveInformationResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
2
2
  import { BankAccountP2pTransferResponse } from "@fiado/type-kit/bin/account/dtos/BankAccountP2pTransferResponse";
3
3
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
4
4
  import { CreateExternalBankAccountRequest, CreateExternalBankAccountResponse } from "@fiado/type-kit/bin/bankAccount";
@@ -38,6 +38,7 @@ export interface ICentralPaymentsConnectorApi {
38
38
  getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>>;
39
39
  getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
40
40
  executeCardToCardTransaction(request: BankAccountP2pTransferRequest): Promise<FiadoApiResponse<BankAccountP2pTransferResponse>>;
41
+ executeFinancialOperation(request: BankAccountPocketTransferRequest[]): Promise<FiadoApiResponse<BankAccountPocketTransferResponse[]>>;
41
42
  getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
42
43
  createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;
43
44
  getACHBankAccountDetail(bankAccountId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
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.40",
17
17
  "@fiado/http-client": "^1.0.5",
18
18
  "@fiado/logger": "^1.0.3",
19
- "@fiado/type-kit": "^1.8.81",
19
+ "@fiado/type-kit": "^1.8.83",
20
20
  "dotenv": "^16.4.7",
21
21
  "inversify": "^6.2.2",
22
22
  "reflect-metadata": "^0.2.2"
@@ -1,7 +1,6 @@
1
1
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
2
  import { IHttpRequest } from "@fiado/http-client";
3
3
  import { CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest } from "@fiado/type-kit/bin/card";
4
- import { CountryId } from "@fiado/type-kit/bin/country";
5
4
  import { inject, injectable } from "inversify";
6
5
  import { ICardApi } from "./interfaces/ICardApi";
7
6
  import { Provider } from "@fiado/type-kit/bin/provider";
@@ -14,15 +13,22 @@ export class CardApi implements ICardApi {
14
13
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
15
14
  }
16
15
 
17
- async getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>> {
16
+ async getByDirectoryId(provider: Provider, directoryId: string): Promise<ApiGatewayResponse<CardResponse>> {
18
17
 
19
- const url = `${this.baseUrl}/${countryId}?cardId=${id}`;
18
+ const url = `${this.baseUrl}${provider}/${directoryId}/find`;
19
+ return await this.httpRequest.get(url);
20
+
21
+ }
22
+
23
+ async getById(provider: Provider, id: string): Promise<ApiGatewayResponse<CardResponse>> {
24
+
25
+ const url = `${this.baseUrl}/${provider}?cardId=${id}`;
20
26
  return await this.httpRequest.get(url);
21
27
  }
22
28
 
23
- async getByExternalId(externalId: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>> {
29
+ async getByExternalId(provider: Provider, externalId: string): Promise<ApiGatewayResponse<CardResponse>> {
24
30
 
25
- const url = `${this.baseUrl}/${countryId}?externalCardId=${externalId}`;
31
+ const url = `${this.baseUrl}/${provider}?externalCardId=${externalId}`;
26
32
  return await this.httpRequest.get(url);
27
33
  }
28
34
 
@@ -1,6 +1,8 @@
1
1
  import { IHttpRequest } from "@fiado/http-client";
2
2
  import {
3
3
  BankAccountP2pTransferRequest,
4
+ BankAccountPocketTransferRequest,
5
+ BankAccountPocketTransferResponse,
4
6
  CreateBankAccountUserRequest,
5
7
  CreateBankAccountUserResponse,
6
8
  GetBankAccountResponse,
@@ -212,6 +214,11 @@ export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi
212
214
  return await this.httpRequest.post(url, request);
213
215
  }
214
216
 
217
+ async executeFinancialOperation(request: BankAccountPocketTransferRequest[]): Promise<FiadoApiResponse<BankAccountPocketTransferResponse[]>> {
218
+ const url = `${this.baseUrl}/transactions/pocket/transfer`;
219
+ return await this.httpRequest.post(url, request);
220
+ }
221
+
215
222
  /* ACH BANK ACCOUNTS */
216
223
  async getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>> {
217
224
  const url = `${this.baseUrl}/ach/bank-accounts/cardholders/${externalUserId}`;
@@ -1,5 +1,7 @@
1
1
  import {
2
2
  BankAccountP2pTransferRequest,
3
+ BankAccountPocketTransferRequest,
4
+ BankAccountPocketTransferResponse,
3
5
  CreateBankAccountUserRequest,
4
6
  CreateBankAccountUserResponse,
5
7
  GetBankAccountResponse,
@@ -100,6 +102,8 @@ export interface ICentralPaymentsConnectorApi {
100
102
 
101
103
  executeCardToCardTransaction(request: BankAccountP2pTransferRequest): Promise<FiadoApiResponse<BankAccountP2pTransferResponse>>;
102
104
 
105
+ executeFinancialOperation(request: BankAccountPocketTransferRequest[]): Promise<FiadoApiResponse<BankAccountPocketTransferResponse[]>>;
106
+
103
107
  getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
104
108
 
105
109
  createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;