@fiado/api-invoker 1.0.74 → 1.0.75

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 (71) hide show
  1. package/README.md +64 -64
  2. package/bin/container.config.js +0 -2
  3. package/bin/index.d.ts +0 -1
  4. package/bin/index.js +0 -1
  5. package/bin/tern/api/TernApi.d.ts +2 -1
  6. package/bin/tern/api/TernApi.js +4 -0
  7. package/bin/tern/api/interfaces/ITernApi.d.ts +1 -0
  8. package/package.json +28 -28
  9. package/src/account-fiadoinc/AccountFiadoIncApi.ts +37 -37
  10. package/src/account-fiadoinc/index.ts +1 -1
  11. package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +17 -17
  12. package/src/account-fiadosa/AccountFiadoSAApi.ts +22 -22
  13. package/src/account-fiadosa/index.ts +1 -1
  14. package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +9 -9
  15. package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +22 -22
  16. package/src/account-pagoconfiado/index.ts +2 -2
  17. package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +8 -8
  18. package/src/address/AddressApi.ts +46 -46
  19. package/src/address/index.ts +3 -3
  20. package/src/address/interfaces/IAddressApi.ts +30 -30
  21. package/src/authentication/AuthenticationApi.ts +16 -16
  22. package/src/authentication/index.ts +4 -4
  23. package/src/authentication/interfaces/IAuthenticationApi.ts +5 -5
  24. package/src/card/CardApi.ts +33 -33
  25. package/src/card/index.ts +3 -3
  26. package/src/card/interfaces/ICardApi.ts +10 -10
  27. package/src/container.config.ts +49 -52
  28. package/src/contract-generator/ContractGeneratorApi.ts +18 -18
  29. package/src/contract-generator/index.ts +2 -2
  30. package/src/contract-generator/interfaces/IContractGeneratorApi.ts +16 -16
  31. package/src/directory/DirectoryApi.ts +74 -74
  32. package/src/directory/index.ts +3 -3
  33. package/src/directory/interfaces/IDirectoryApi.ts +53 -53
  34. package/src/exchangeRates/ExchangeRatesApi.ts +18 -18
  35. package/src/exchangeRates/index.ts +1 -1
  36. package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +5 -5
  37. package/src/identity/IdentityApi.ts +47 -47
  38. package/src/identity/index.ts +3 -3
  39. package/src/identity/interfaces/IIdentityApi.ts +33 -33
  40. package/src/index.ts +17 -18
  41. package/src/notificationMessages/index.ts +1 -1
  42. package/src/notificationMessages/queue/NotificationMessagePublisher.ts +22 -22
  43. package/src/notificationMessages/queue/interfaces/INotificationMessagesPublisher.ts +4 -4
  44. package/src/pomelo/api/PomeloApi.ts +99 -99
  45. package/src/pomelo/api/interfaces/IPomeloApi.ts +27 -27
  46. package/src/pomelo/index.ts +1 -1
  47. package/src/product-catalog/ProductCatalogApi.ts +17 -17
  48. package/src/product-catalog/index.ts +1 -1
  49. package/src/product-catalog/interfaces/IProductCatalogApi.ts +6 -6
  50. package/src/sessionActivity/index.ts +2 -2
  51. package/src/sessionActivity/queue/SessionActivityPublisher.ts +22 -22
  52. package/src/sessionActivity/queue/interfaces/ISessionActivityPublisher.ts +4 -4
  53. package/src/stpAccount/api/STPAccountApi.ts +102 -102
  54. package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +6 -6
  55. package/src/stpAccount/index.ts +1 -1
  56. package/src/tern/api/TernApi.ts +96 -85
  57. package/src/tern/api/interfaces/ITernApi.ts +29 -27
  58. package/src/tern/index.ts +1 -1
  59. package/src/transaction/index.ts +2 -2
  60. package/src/transaction/queue/TransactionPublisher.ts +24 -24
  61. package/src/transaction/queue/interfaces/ITransactionPublisher.ts +4 -4
  62. package/tsconfig.json +21 -21
  63. package/bin/collector/CollectorApi.d.ts +0 -9
  64. package/bin/collector/CollectorApi.js +0 -37
  65. package/bin/collector/index.d.ts +0 -2
  66. package/bin/collector/index.js +0 -18
  67. package/bin/collector/interfaces/ICollectorApi.d.ts +0 -14
  68. package/bin/collector/interfaces/ICollectorApi.js +0 -2
  69. package/src/collector/CollectorApi.ts +0 -21
  70. package/src/collector/index.ts +0 -3
  71. package/src/collector/interfaces/ICollectorApi.ts +0 -19
@@ -1,28 +1,30 @@
1
- import {CreateBankAccountRequest, CreateBankAccountUserRequest} from "@fiado/type-kit/bin/account";
2
- import {GetBankAccountUserRequest} from "@fiado/type-kit/bin/account/dtos/GetBankAccountUserRequest";
3
- import {GetBankAccountRequest} from "@fiado/type-kit/bin/account/dtos/GetBankAccountRequest";
4
- import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
5
-
6
- export interface ITernApi {
7
- getUser(request: GetBankAccountUserRequest): Promise<any>;
8
-
9
- getAccount(request: GetBankAccountRequest): Promise<any>;
10
-
11
- createUser(request: CreateBankAccountUserRequest): Promise<any>;
12
-
13
- createAccount(request: CreateBankAccountRequest): Promise<any>
14
-
15
- getCardsById(externalCardId: string): Promise<any>;
16
-
17
- createCard(request: CreateBankAccountCardRequest): Promise<any>;
18
-
19
- blockCard(request: UpdateBankAccountCardRequest): Promise<any>;
20
-
21
- changePin(request: UpdateBankAccountCardRequest): Promise<any>;
22
-
23
- updateCard(request: UpdateBankAccountCardRequest): Promise<any>;
24
-
25
- activateCard(request: ActivateBankAccountCardRequest): Promise<any>;
26
-
27
- assignCardToUser(request: AssignCardRequest): Promise<any>;
1
+ import {CreateBankAccountRequest, CreateBankAccountUserRequest} from "@fiado/type-kit/bin/account";
2
+ import {GetBankAccountUserRequest} from "@fiado/type-kit/bin/account/dtos/GetBankAccountUserRequest";
3
+ import {GetBankAccountRequest} from "@fiado/type-kit/bin/account/dtos/GetBankAccountRequest";
4
+ import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
5
+
6
+ export interface ITernApi {
7
+ getUser(request: GetBankAccountUserRequest): Promise<any>;
8
+
9
+ getAccount(request: GetBankAccountRequest): Promise<any>;
10
+
11
+ createUser(request: CreateBankAccountUserRequest): Promise<any>;
12
+
13
+ createAccount(request: CreateBankAccountRequest): Promise<any>
14
+
15
+ getCardsById(externalCardId: string): Promise<any>;
16
+
17
+ createCard(request: CreateBankAccountCardRequest): Promise<any>;
18
+
19
+ blockCard(request: UpdateBankAccountCardRequest): Promise<any>;
20
+
21
+ changePin(request: UpdateBankAccountCardRequest): Promise<any>;
22
+
23
+ updateCard(request: UpdateBankAccountCardRequest): Promise<any>;
24
+
25
+ activateCard(request: ActivateBankAccountCardRequest): Promise<any>;
26
+
27
+ assignCardToUser(request: AssignCardRequest): Promise<any>;
28
+
29
+ p2pTransfer(request: any): Promise<any>
28
30
  }
package/src/tern/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './api/TernApi';
1
+ export * from './api/TernApi';
2
2
  export * from './api/interfaces/ITernApi';
@@ -1,2 +1,2 @@
1
- export * from './queue/TransactionPublisher';
2
- export * from './queue/interfaces/ITransactionPublisher';
1
+ export * from './queue/TransactionPublisher';
2
+ export * from './queue/interfaces/ITransactionPublisher';
@@ -1,25 +1,25 @@
1
- import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
2
- import {ITransactionPublisher} from "./interfaces/ITransactionPublisher";
3
- import {injectable} from "inversify";
4
- import {TransactionCreateRequest} from "@fiado/type-kit/bin/transaction";
5
-
6
- @injectable()
7
- export class TransactionPublisher implements ITransactionPublisher {
8
- private readonly TRANSACTION_QUEUE = process.env.TRANSACTION_QUEUE
9
-
10
- async publish(message: TransactionCreateRequest): Promise<void> {
11
- try {
12
- const client: SQSClient = new SQSClient();
13
- const sendMessageRequest: SendMessageRequest = {
14
- QueueUrl: this.TRANSACTION_QUEUE,
15
- MessageBody: JSON.stringify(message),
16
- MessageGroupId: message.transactionNumber,
17
- MessageDeduplicationId: message.transactionNumber
18
- };
19
- const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
20
- await client.send(command);
21
- } catch (error) {
22
- throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
23
- }
24
- }
1
+ import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
2
+ import {ITransactionPublisher} from "./interfaces/ITransactionPublisher";
3
+ import {injectable} from "inversify";
4
+ import {TransactionCreateRequest} from "@fiado/type-kit/bin/transaction";
5
+
6
+ @injectable()
7
+ export class TransactionPublisher implements ITransactionPublisher {
8
+ private readonly TRANSACTION_QUEUE = process.env.TRANSACTION_QUEUE
9
+
10
+ async publish(message: TransactionCreateRequest): Promise<void> {
11
+ try {
12
+ const client: SQSClient = new SQSClient();
13
+ const sendMessageRequest: SendMessageRequest = {
14
+ QueueUrl: this.TRANSACTION_QUEUE,
15
+ MessageBody: JSON.stringify(message),
16
+ MessageGroupId: message.transactionNumber,
17
+ MessageDeduplicationId: message.transactionNumber
18
+ };
19
+ const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
20
+ await client.send(command);
21
+ } catch (error) {
22
+ throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
23
+ }
24
+ }
25
25
  }
@@ -1,5 +1,5 @@
1
- import { TransactionCreateRequest } from "@fiado/type-kit/bin/transaction";
2
-
3
- export interface ITransactionPublisher {
4
- publish(message: TransactionCreateRequest): Promise<void>;
1
+ import { TransactionCreateRequest } from "@fiado/type-kit/bin/transaction";
2
+
3
+ export interface ITransactionPublisher {
4
+ publish(message: TransactionCreateRequest): Promise<void>;
5
5
  }
package/tsconfig.json CHANGED
@@ -1,21 +1,21 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "commonjs",
5
- "esModuleInterop": true,
6
- "skipLibCheck": true,
7
- "forceConsistentCasingInFileNames": true,
8
- "experimentalDecorators": true,
9
- "emitDecoratorMetadata": true,
10
- "outDir": "./bin",
11
- "rootDir": "./src",
12
- "moduleResolution": "node",
13
- "declaration": true,
14
- },
15
- "include": [
16
- "./src/**/*"
17
- ],
18
- "exclude": [
19
- "node_modules"
20
- ]
21
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "esModuleInterop": true,
6
+ "skipLibCheck": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "experimentalDecorators": true,
9
+ "emitDecoratorMetadata": true,
10
+ "outDir": "./bin",
11
+ "rootDir": "./src",
12
+ "moduleResolution": "node",
13
+ "declaration": true,
14
+ },
15
+ "include": [
16
+ "./src/**/*"
17
+ ],
18
+ "exclude": [
19
+ "node_modules"
20
+ ]
21
+ }
@@ -1,9 +0,0 @@
1
- import { IHttpRequest } from "@fiado/http-client";
2
- import { ICollectorApi } from './interfaces/ICollectorApi';
3
- import CreditContractCreateRequest from '@fiado/type-kit/bin/creditContract/dtos/CreditContractCreateRequest';
4
- export declare class CollectorApi implements ICollectorApi {
5
- private httpRequest;
6
- private readonly baseUrl;
7
- constructor(httpRequest: IHttpRequest);
8
- createCreditContract(object: CreditContractCreateRequest): 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.CollectorApi = void 0;
19
- const dotenv_1 = __importDefault(require("dotenv"));
20
- const inversify_1 = require("inversify");
21
- dotenv_1.default.config();
22
- let CollectorApi = class CollectorApi {
23
- constructor(httpRequest) {
24
- this.httpRequest = httpRequest;
25
- this.baseUrl = process.env.COLLECTOR_LAMBDA_URL || "";
26
- }
27
- async createCreditContract(object) {
28
- const url = `${this.baseUrl}collector/creditcontracts/create`;
29
- return await this.httpRequest.post(url, object);
30
- }
31
- };
32
- exports.CollectorApi = CollectorApi;
33
- exports.CollectorApi = CollectorApi = __decorate([
34
- (0, inversify_1.injectable)(),
35
- __param(0, (0, inversify_1.inject)("IHttpRequest")),
36
- __metadata("design:paramtypes", [Object])
37
- ], CollectorApi);
@@ -1,2 +0,0 @@
1
- export * from './interfaces/ICollectorApi';
2
- export * from './CollectorApi';
@@ -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/ICollectorApi"), exports);
18
- __exportStar(require("./CollectorApi"), exports);
@@ -1,14 +0,0 @@
1
- import CreditContractCreateRequest from "@fiado/type-kit/bin/creditContract/dtos/CreditContractCreateRequest";
2
- /**
3
- * Interfaz para el servicio Contract Generator.
4
- */
5
- export interface ICollectorApi {
6
- /**
7
- * Crea un nuevo contrato de crédito.
8
- * @param CreditContractCreateRequest Objeto con la información necesaria para crear el contrato.
9
- * @returns Una promesa que resuelve a un arreglo de objetos de people.
10
- * Puede devolver un arreglo vacío si no se encuentran coincidencias.
11
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
12
- */
13
- createCreditContract(object: CreditContractCreateRequest): Promise<any>;
14
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +0,0 @@
1
- import dotenv from 'dotenv';
2
- import { inject, injectable } from "inversify";
3
- import { IHttpRequest } from "@fiado/http-client";
4
- import { ICollectorApi } from './interfaces/ICollectorApi';
5
- import CreditContractCreateRequest from '@fiado/type-kit/bin/creditContract/dtos/CreditContractCreateRequest';
6
-
7
- dotenv.config();
8
-
9
- @injectable()
10
- export class CollectorApi implements ICollectorApi {
11
-
12
- private readonly baseUrl = process.env.COLLECTOR_LAMBDA_URL || "";
13
-
14
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
15
-
16
- async createCreditContract(object: CreditContractCreateRequest): Promise<any> {
17
- const url = `${this.baseUrl}collector/creditcontracts/create`;
18
- return await this.httpRequest.post(url, object);
19
- }
20
-
21
- }
@@ -1,3 +0,0 @@
1
-
2
- export * from './interfaces/ICollectorApi';
3
- export * from './CollectorApi';
@@ -1,19 +0,0 @@
1
- import { ContractCreateRequest } from "@fiado/type-kit/bin/contract";
2
- import CreditContractCreateRequest from "@fiado/type-kit/bin/creditContract/dtos/CreditContractCreateRequest";
3
-
4
- /**
5
- * Interfaz para el servicio Contract Generator.
6
- */
7
- export interface ICollectorApi {
8
-
9
- /**
10
- * Crea un nuevo contrato de crédito.
11
- * @param CreditContractCreateRequest Objeto con la información necesaria para crear el contrato.
12
- * @returns Una promesa que resuelve a un arreglo de objetos de people.
13
- * Puede devolver un arreglo vacío si no se encuentran coincidencias.
14
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
15
- */
16
- createCreditContract(object: CreditContractCreateRequest): Promise<any>
17
-
18
-
19
- }