@fiado/api-invoker 1.1.1 → 1.1.3

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 { IBBVARstApi } from "./interfaces/IBBVARstApi";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import { CreateRSTTransactionRequest } from "@fiado/type-kit/bin/bbvaRst";
4
+ export declare class BBVARstApi implements IBBVARstApi {
5
+ private httpRequest;
6
+ private readonly baseUrl;
7
+ constructor(httpRequest: IHttpRequest);
8
+ create(request: CreateRSTTransactionRequest): Promise<any>;
9
+ }
@@ -0,0 +1,32 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.BBVARstApi = void 0;
16
+ const inversify_1 = require("inversify");
17
+ let BBVARstApi = class BBVARstApi {
18
+ constructor(httpRequest) {
19
+ this.httpRequest = httpRequest;
20
+ this.baseUrl = process.env.BBVA_RSTA_LAMBDA_URL || "";
21
+ }
22
+ async create(request) {
23
+ const url = `${this.baseUrl}/create`;
24
+ return await this.httpRequest.post(url, request);
25
+ }
26
+ };
27
+ exports.BBVARstApi = BBVARstApi;
28
+ exports.BBVARstApi = BBVARstApi = __decorate([
29
+ (0, inversify_1.injectable)(),
30
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
31
+ __metadata("design:paramtypes", [Object])
32
+ ], BBVARstApi);
@@ -0,0 +1,4 @@
1
+ import { CreateRSTTransactionRequest } from "@fiado/type-kit/bin/bbvaRst";
2
+ export interface IBBVARstApi {
3
+ create(request: CreateRSTTransactionRequest): Promise<any>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IBBVARstApi';
2
+ export * from './api/BBVARstApi';
@@ -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("./api/interfaces/IBBVARstApi"), exports);
18
+ __exportStar(require("./api/BBVARstApi"), exports);
@@ -28,6 +28,7 @@ const BankAccountApi_1 = __importDefault(require("./bankAccount/BankAccountApi")
28
28
  const account_beneficiary_1 = require("./account-beneficiary");
29
29
  const stpSpei_1 = require("./stpSpei");
30
30
  const StpServicePaymentApi_1 = __importDefault(require("./stpServicePayment/api/StpServicePaymentApi"));
31
+ const bbvaRst_1 = require("./bbvaRst");
31
32
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
32
33
  bind("IDirectoryApi").to(directory_1.DirectoryApi);
33
34
  bind("IIdentityApi").to(identity_1.IdentityApi);
@@ -52,4 +53,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
52
53
  bind("IAccountBeneficiaryApi").to(account_beneficiary_1.AccountBeneficiaryApi);
53
54
  bind("IStpSpeiApi").to(stpSpei_1.StpSpeiApi);
54
55
  bind("IStpServicePaymentApi").to(StpServicePaymentApi_1.default);
56
+ bind("IBBVARstApi").to(bbvaRst_1.BBVARstApi);
55
57
  });
package/bin/index.d.ts CHANGED
@@ -21,3 +21,4 @@ export * from "./p2pContact";
21
21
  export * from "./bankAccount";
22
22
  export * from "./stpSpei";
23
23
  export * from "./stpServicePayment";
24
+ export * from "./bbvaRst";
package/bin/index.js CHANGED
@@ -37,3 +37,4 @@ __exportStar(require("./p2pContact"), exports);
37
37
  __exportStar(require("./bankAccount"), exports);
38
38
  __exportStar(require("./stpSpei"), exports);
39
39
  __exportStar(require("./stpServicePayment"), exports);
40
+ __exportStar(require("./bbvaRst"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a traves 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.31",
17
17
  "@fiado/http-client": "^1.0.2",
18
18
  "@fiado/logger": "^1.0.2",
19
- "@fiado/type-kit": "^1.1.90",
19
+ "@fiado/type-kit": "^1.2.1",
20
20
  "dotenv": "^16.4.5",
21
21
  "inversify": "^6.0.2",
22
22
  "reflect-metadata": "^0.2.1",
@@ -0,0 +1,17 @@
1
+ import {IBBVARstApi} from "./interfaces/IBBVARstApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import {CreateRSTTransactionRequest} from "@fiado/type-kit/bin/bbvaRst";
5
+
6
+ @injectable()
7
+ export class BBVARstApi implements IBBVARstApi {
8
+ private readonly baseUrl = process.env.BBVA_RSTA_LAMBDA_URL || "";
9
+
10
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
11
+ }
12
+
13
+ async create(request: CreateRSTTransactionRequest): Promise<any> {
14
+ const url = `${this.baseUrl}/create`;
15
+ return await this.httpRequest.post(url, request);
16
+ }
17
+ }
@@ -0,0 +1,5 @@
1
+ import {CreateRSTTransactionRequest} from "@fiado/type-kit/bin/bbvaRst";
2
+
3
+ export interface IBBVARstApi {
4
+ create(request: CreateRSTTransactionRequest): Promise<any>;
5
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IBBVARstApi';
2
+ export * from './api/BBVARstApi';
@@ -34,6 +34,7 @@ import {AccountBeneficiaryApi, IAccountBeneficiaryApi} from "./account-beneficia
34
34
  import {IStpSpeiApi, StpSpeiApi} from "./stpSpei";
35
35
  import StpServicePaymentApi from "./stpServicePayment/api/StpServicePaymentApi";
36
36
  import {IStpServicePaymentApi} from "./stpServicePayment";
37
+ import {BBVARstApi, IBBVARstApi} from "./bbvaRst";
37
38
 
38
39
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
39
40
  bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
@@ -59,4 +60,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
59
60
  bind<IAccountBeneficiaryApi>("IAccountBeneficiaryApi").to(AccountBeneficiaryApi);
60
61
  bind<IStpSpeiApi>("IStpSpeiApi").to(StpSpeiApi);
61
62
  bind<IStpServicePaymentApi>("IStpServicePaymentApi").to(StpServicePaymentApi);
63
+ bind<IBBVARstApi>("IBBVARstApi").to(BBVARstApi);
62
64
  });
package/src/index.ts CHANGED
@@ -20,4 +20,5 @@ export * from "./collector";
20
20
  export * from "./p2pContact";
21
21
  export * from "./bankAccount";
22
22
  export * from "./stpSpei";
23
- export * from "./stpServicePayment";
23
+ export * from "./stpServicePayment";
24
+ export * from "./bbvaRst";