@fiado/api-invoker 1.2.79 → 1.2.81

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.
@@ -0,0 +1,9 @@
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
+ }
@@ -0,0 +1,36 @@
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);
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,17 @@
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
+ }
@@ -0,0 +1,72 @@
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);
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IActivityApi';
2
+ export * from './ActivityApi';
@@ -0,0 +1,18 @@
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);
@@ -0,0 +1,39 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,6 +7,8 @@ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiRespo
7
7
  import { CentralPaymentsQueryParams, CentralPaymentsTransactionItem, TransactionListResponse } from "@fiado/type-kit/bin/transaction";
8
8
  import { InvokerUtils } from "../utils/InvokerUtils";
9
9
  import { ProviderDocumentUploadRequest } from "@fiado/type-kit/bin/provider";
10
+ import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
11
+ import { CreateExternalBankAccountRequest, CreateExternalBankAccountResponse } from "@fiado/type-kit/bin/bankAccount";
10
12
  export declare class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
11
13
  private readonly httpRequest;
12
14
  private readonly _invokerUtils;
@@ -39,4 +41,9 @@ export declare class CentralPaymentsConnectorApi implements ICentralPaymentsConn
39
41
  getStatementDocument(statementId: string): Promise<FiadoApiResponse<StatementDocumentResponse>>;
40
42
  getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>>;
41
43
  getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
44
+ getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
45
+ createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;
46
+ getACHBankAccountDetail(bankAccountId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
47
+ deleteACHBankAccount(bankAccountId: string): Promise<FiadoApiResponse<null>>;
48
+ verifyACHBankAccount(bankAccountId: string, request: any): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
42
49
  }
@@ -137,6 +137,28 @@ let CentralPaymentsConnectorApi = class CentralPaymentsConnectorApi {
137
137
  const url = `${this.baseUrl}/transactions/${externalTransactionId}`;
138
138
  return await this.httpRequest.get(url);
139
139
  }
140
+ /* ACH BANK ACCOUNTS */
141
+ async getCardholderACHBankAccounts(externalUserId) {
142
+ const url = `${this.baseUrl}/bank-accounts/cardholder/${externalUserId}`;
143
+ return await this.httpRequest.get(url);
144
+ }
145
+ async createCardholderACHBankAccount(externalUserId, request) {
146
+ const url = `${this.baseUrl}/bank-accounts/cardholder/${externalUserId}`;
147
+ return await this.httpRequest.post(url, request);
148
+ }
149
+ async getACHBankAccountDetail(bankAccountId) {
150
+ const url = `${this.baseUrl}/bank-accounts/${bankAccountId}`;
151
+ return await this.httpRequest.get(url);
152
+ }
153
+ async deleteACHBankAccount(bankAccountId) {
154
+ const url = `${this.baseUrl}/bank-accounts/${bankAccountId}`;
155
+ return await this.httpRequest.delete(url);
156
+ }
157
+ async verifyACHBankAccount(bankAccountId, request) {
158
+ const url = `${this.baseUrl}/bank-accounts/${bankAccountId}`;
159
+ // TODO FALTA DEFINIR EL BODY
160
+ return await this.httpRequest.put(url, request);
161
+ }
140
162
  };
141
163
  exports.CentralPaymentsConnectorApi = CentralPaymentsConnectorApi;
142
164
  exports.CentralPaymentsConnectorApi = CentralPaymentsConnectorApi = __decorate([
@@ -4,6 +4,8 @@ import { ActivateBankAccountCardRequest, ActivateBankAccountCardResponse, CardBa
4
4
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
5
5
  import { CentralPaymentsQueryParams, CentralPaymentsTransactionItem, TransactionListResponse } from "@fiado/type-kit/bin/transaction";
6
6
  import { ProviderDocumentUploadRequest } from "@fiado/type-kit/bin/provider";
7
+ import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
8
+ import { CreateExternalBankAccountRequest, CreateExternalBankAccountResponse } from "@fiado/type-kit/bin/bankAccount";
7
9
  export interface ICentralPaymentsConnectorApi {
8
10
  healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
9
11
  createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
@@ -32,4 +34,9 @@ export interface ICentralPaymentsConnectorApi {
32
34
  getStatementDocument(statementId: string): Promise<FiadoApiResponse<StatementDocumentResponse>>;
33
35
  getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>>;
34
36
  getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
37
+ getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
38
+ createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;
39
+ getACHBankAccountDetail(bankAccountId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
40
+ deleteACHBankAccount(bankAccountId: string): Promise<FiadoApiResponse<null>>;
41
+ verifyACHBankAccount(bankAccountId: string, request: any): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
35
42
  }
@@ -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.79",
3
+ "version": "1.2.81",
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.34",
19
+ "@fiado/type-kit": "^1.8.44",
20
20
  "dotenv": "^16.4.7",
21
21
  "inversify": "^6.2.2",
22
22
  "reflect-metadata": "^0.2.2"
@@ -18,7 +18,9 @@ import {
18
18
  ActivateBankAccountCardResponse,
19
19
  CardBatchRequest,
20
20
  CardBatchResponse,
21
- CardStatementListResponse, CreateBankAccountCardRequest, CreateBankAccountCardResponse,
21
+ CardStatementListResponse,
22
+ CreateBankAccountCardRequest,
23
+ CreateBankAccountCardResponse,
22
24
  GetBankAccountCardBalanceResponse,
23
25
  GetBankAccountCardResponse,
24
26
  StatementDocumentResponse,
@@ -33,6 +35,8 @@ import {
33
35
  } from "@fiado/type-kit/bin/transaction";
34
36
  import {InvokerUtils} from "../utils/InvokerUtils";
35
37
  import {ProviderDocumentUploadRequest} from "@fiado/type-kit/bin/provider";
38
+ import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
39
+ import {CreateExternalBankAccountRequest, CreateExternalBankAccountResponse} from "@fiado/type-kit/bin/bankAccount";
36
40
 
37
41
  @injectable()
38
42
  export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
@@ -187,4 +191,31 @@ export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi
187
191
  const url = `${this.baseUrl}/transactions/${externalTransactionId}`;
188
192
  return await this.httpRequest.get(url);
189
193
  }
194
+
195
+ /* ACH BANK ACCOUNTS */
196
+ async getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>> {
197
+ const url = `${this.baseUrl}/bank-accounts/cardholder/${externalUserId}`;
198
+ return await this.httpRequest.get(url);
199
+ }
200
+
201
+ async createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>> {
202
+ const url = `${this.baseUrl}/bank-accounts/cardholder/${externalUserId}`;
203
+ return await this.httpRequest.post(url, request);
204
+ }
205
+
206
+ async getACHBankAccountDetail(bankAccountId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse>> {
207
+ const url = `${this.baseUrl}/bank-accounts/${bankAccountId}`;
208
+ return await this.httpRequest.get(url);
209
+ }
210
+
211
+ async deleteACHBankAccount(bankAccountId: string): Promise<FiadoApiResponse<null>> {
212
+ const url = `${this.baseUrl}/bank-accounts/${bankAccountId}`;
213
+ return await this.httpRequest.delete(url);
214
+ }
215
+
216
+ async verifyACHBankAccount(bankAccountId: string, request: any): Promise<FiadoApiResponse<GetExternalBankAccountResponse>> {
217
+ const url = `${this.baseUrl}/bank-accounts/${bankAccountId}`;
218
+ // TODO FALTA DEFINIR EL BODY
219
+ return await this.httpRequest.put(url, request);
220
+ }
190
221
  }
@@ -31,6 +31,8 @@ import {
31
31
  TransactionListResponse
32
32
  } from "@fiado/type-kit/bin/transaction";
33
33
  import {ProviderDocumentUploadRequest} from "@fiado/type-kit/bin/provider";
34
+ import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
35
+ import {CreateExternalBankAccountRequest, CreateExternalBankAccountResponse} from "@fiado/type-kit/bin/bankAccount";
34
36
 
35
37
  export interface ICentralPaymentsConnectorApi {
36
38
  healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
@@ -87,5 +89,13 @@ export interface ICentralPaymentsConnectorApi {
87
89
 
88
90
  getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
89
91
 
90
- // TODO CREATE VIRTUAL CARD
92
+ getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
93
+
94
+ createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;
95
+
96
+ getACHBankAccountDetail(bankAccountId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
97
+
98
+ deleteACHBankAccount(bankAccountId: string): Promise<FiadoApiResponse<null>>;
99
+
100
+ verifyACHBankAccount(bankAccountId: string, request: any): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
91
101
  }
@@ -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
  }
@@ -1,46 +0,0 @@
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
- }