@fiado/api-invoker 1.2.56 → 1.2.57

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, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
3
+ import { CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
4
4
  import { CentralPaymentsDocumentUploadRequest, HealthcheckResponse, OOWQuestionsResponse, SubmitOOWQuestionAnswersRequest } from "@fiado/type-kit/bin/centralPayments";
5
5
  import { ActivateBankAccountCardRequest, ActivateBankAccountCardResponse, CardBatchRequest, CardBatchResponse, CardStatementListResponse, GetBankAccountCardBalanceResponse, GetBankAccountCardResponse, StatementDocumentResponse, UpdateBankAccountCardRequest, UpdateBankAccountCardResponse } from "@fiado/type-kit/bin/card";
6
6
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
@@ -29,6 +29,7 @@ export declare class CentralPaymentsConnectorApi implements ICentralPaymentsConn
29
29
  orderPhysicalCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
30
30
  createSecondaryCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
31
31
  getCardsByUserId(externalUserId: string, includeSecondary?: boolean): Promise<FiadoApiResponse<GetBankAccountCardResponse[]>>;
32
+ getAccountsByUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountResponse[]>>;
32
33
  generateCardsInBatch(request: CardBatchRequest): Promise<FiadoApiResponse<CardBatchResponse>>;
33
34
  getCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
34
35
  deleteCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
@@ -98,6 +98,10 @@ let CentralPaymentsConnectorApi = class CentralPaymentsConnectorApi {
98
98
  const param = includeSecondary ? `?includeSecondary=${includeSecondary}` : null;
99
99
  return await this.httpRequest.get(`${url}${param ?? ""}`);
100
100
  }
101
+ async getAccountsByUserId(externalUserId) {
102
+ const url = `${this.baseUrl}/accounts/cardholders/${externalUserId}`;
103
+ return await this.httpRequest.get(url);
104
+ }
101
105
  async generateCardsInBatch(request) {
102
106
  const url = `${this.baseUrl}/cards/batch`;
103
107
  return await this.httpRequest.post(url, request);
@@ -1,4 +1,4 @@
1
- import { CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
1
+ import { CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
2
2
  import { CentralPaymentsDocumentUploadRequest, HealthcheckResponse, OOWQuestionsResponse, SubmitOOWQuestionAnswersRequest } from "@fiado/type-kit/bin/centralPayments";
3
3
  import { ActivateBankAccountCardRequest, ActivateBankAccountCardResponse, CardBatchRequest, CardBatchResponse, CardStatementListResponse, GetBankAccountCardBalanceResponse, GetBankAccountCardResponse, StatementDocumentResponse, UpdateBankAccountCardRequest, UpdateBankAccountCardResponse } from "@fiado/type-kit/bin/card";
4
4
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
@@ -22,6 +22,7 @@ export interface ICentralPaymentsConnectorApi {
22
22
  orderPhysicalCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
23
23
  createSecondaryCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
24
24
  getCardsByUserId(externalUserId: string, includeSecondary?: boolean): Promise<FiadoApiResponse<GetBankAccountCardResponse[]>>;
25
+ getAccountsByUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountResponse[]>>;
25
26
  generateCardsInBatch(request: CardBatchRequest): Promise<FiadoApiResponse<CardBatchResponse>>;
26
27
  getCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
27
28
  deleteCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.2.56",
3
+ "version": "1.2.57",
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.4",
18
18
  "@fiado/logger": "^1.0.3",
19
- "@fiado/type-kit": "^1.8.25",
19
+ "@fiado/type-kit": "^1.8.26",
20
20
  "dotenv": "^16.4.7",
21
21
  "inversify": "^6.2.2",
22
22
  "reflect-metadata": "^0.2.2"
@@ -3,7 +3,7 @@ import { inject, injectable } from "inversify";
3
3
  import { IHttpRequest } from "@fiado/http-client";
4
4
  import {
5
5
  CreateBankAccountUserRequest,
6
- CreateBankAccountUserResponse,
6
+ CreateBankAccountUserResponse, GetBankAccountResponse,
7
7
  GetBankAccountUserResponse,
8
8
  UpdateBankAccountUserRequest
9
9
  } from "@fiado/type-kit/bin/account";
@@ -139,6 +139,11 @@ export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi
139
139
  return await this.httpRequest.get(`${url}${param ?? ""}`);
140
140
  }
141
141
 
142
+ async getAccountsByUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountResponse[]>> {
143
+ const url = `${this.baseUrl}/accounts/cardholders/${externalUserId}`;
144
+ return await this.httpRequest.get(url);
145
+ }
146
+
142
147
  async generateCardsInBatch(request: CardBatchRequest): Promise<FiadoApiResponse<CardBatchResponse>> {
143
148
  const url = `${this.baseUrl}/cards/batch`;
144
149
  return await this.httpRequest.post(url, request);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CreateBankAccountUserRequest,
3
- CreateBankAccountUserResponse,
3
+ CreateBankAccountUserResponse, GetBankAccountResponse,
4
4
  GetBankAccountUserResponse,
5
5
  UpdateBankAccountUserRequest
6
6
  } from "@fiado/type-kit/bin/account";
@@ -66,6 +66,8 @@ export interface ICentralPaymentsConnectorApi {
66
66
 
67
67
  getCardsByUserId(externalUserId: string, includeSecondary?: boolean): Promise<FiadoApiResponse<GetBankAccountCardResponse[]>>;
68
68
 
69
+ getAccountsByUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountResponse[]>>;
70
+
69
71
  generateCardsInBatch(request: CardBatchRequest): Promise<FiadoApiResponse<CardBatchResponse>>;
70
72
 
71
73
  getCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;