@fiado/api-invoker 1.0.86 → 1.0.88

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.
@@ -6,5 +6,5 @@ export declare class AccountBeneficiaryApi implements IAccountBeneficiaryApi {
6
6
  private httpRequest;
7
7
  private readonly baseUrl;
8
8
  constructor(httpRequest: IHttpRequest);
9
- create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest): Promise<void>;
9
+ create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<void>;
10
10
  }
@@ -1,5 +1,5 @@
1
1
  import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary";
2
2
  import { CountryId } from "@fiado/type-kit/bin/country";
3
3
  export interface IAccountBeneficiaryApi {
4
- create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest): Promise<void>;
4
+ create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<void>;
5
5
  }
@@ -26,6 +26,7 @@ const collector_1 = require("./collector");
26
26
  const P2pContactApi_1 = __importDefault(require("./p2pContact/api/P2pContactApi"));
27
27
  const BankAccountApi_1 = __importDefault(require("./bankAccount/BankAccountApi"));
28
28
  const account_beneficiary_1 = require("./account-beneficiary");
29
+ const stpSpei_1 = require("./stpSpei");
29
30
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
30
31
  bind("IDirectoryApi").to(directory_1.DirectoryApi);
31
32
  bind("IIdentityApi").to(identity_1.IdentityApi);
@@ -48,4 +49,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
48
49
  bind("IP2pContactApi").to(P2pContactApi_1.default);
49
50
  bind("IBankAccountApi").to(BankAccountApi_1.default);
50
51
  bind("IAccountBeneficiaryApi").to(account_beneficiary_1.AccountBeneficiaryApi);
52
+ bind("IStpSpeiApi").to(stpSpei_1.StpSpeiApi);
51
53
  });
package/bin/index.d.ts CHANGED
@@ -19,3 +19,4 @@ export * from "./product-catalog";
19
19
  export * from "./collector";
20
20
  export * from "./p2pContact";
21
21
  export * from "./bankAccount";
22
+ export * from "./stpSpei";
package/bin/index.js CHANGED
@@ -35,3 +35,4 @@ __exportStar(require("./product-catalog"), exports);
35
35
  __exportStar(require("./collector"), exports);
36
36
  __exportStar(require("./p2pContact"), exports);
37
37
  __exportStar(require("./bankAccount"), exports);
38
+ __exportStar(require("./stpSpei"), exports);
@@ -0,0 +1,9 @@
1
+ import { IStpSpeiApi } from "./interfaces/IStpSpeiApi";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import { PutStpOrderRequest } from "@fiado/type-kit/bin/stp";
4
+ export declare class StpSpeiApi implements IStpSpeiApi {
5
+ private httpRequest;
6
+ private readonly baseUrl;
7
+ constructor(httpRequest: IHttpRequest);
8
+ putStpOrder(request: PutStpOrderRequest): Promise<any>;
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
+ 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.StpSpeiApi = void 0;
16
+ const inversify_1 = require("inversify");
17
+ let StpSpeiApi = class StpSpeiApi {
18
+ constructor(httpRequest) {
19
+ this.httpRequest = httpRequest;
20
+ this.baseUrl = process.env.STP_ACCOUNT_LAMBDA_URL || "";
21
+ }
22
+ async putStpOrder(request) {
23
+ const url = `${this.baseUrl}`;
24
+ const headers = {
25
+ 'Content-Type': 'application/json',
26
+ operationName: "putConnectorStpOrders"
27
+ };
28
+ return await this.httpRequest.post(url, request, headers);
29
+ }
30
+ };
31
+ exports.StpSpeiApi = StpSpeiApi;
32
+ exports.StpSpeiApi = StpSpeiApi = __decorate([
33
+ (0, inversify_1.injectable)(),
34
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
35
+ __metadata("design:paramtypes", [Object])
36
+ ], StpSpeiApi);
@@ -0,0 +1,4 @@
1
+ import { PutStpOrderRequest } from "@fiado/type-kit/bin/stp";
2
+ export interface IStpSpeiApi {
3
+ putStpOrder(request: PutStpOrderRequest): 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/IStpSpeiApi';
2
+ export * from './api/StpSpeiApi';
@@ -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/IStpSpeiApi"), exports);
18
+ __exportStar(require("./api/StpSpeiApi"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
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.70",
19
+ "@fiado/type-kit": "^1.1.80",
20
20
  "dotenv": "^16.4.5",
21
21
  "inversify": "^6.0.2",
22
22
  "reflect-metadata": "^0.2.1",
@@ -12,7 +12,7 @@ export class AccountBeneficiaryApi implements IAccountBeneficiaryApi {
12
12
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
13
13
  }
14
14
 
15
- async create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest): Promise<void> {
15
+ async create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<void> {
16
16
  const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
17
17
  return await this.httpRequest.post(url, input);
18
18
  }
@@ -3,6 +3,6 @@ import { CountryId } from "@fiado/type-kit/bin/country";
3
3
 
4
4
  export interface IAccountBeneficiaryApi {
5
5
 
6
- create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest): Promise<void>;
6
+ create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<void>;
7
7
 
8
8
  }
@@ -30,7 +30,8 @@ import {IP2pContactApi} from "./p2pContact";
30
30
  import P2pContactApi from "./p2pContact/api/P2pContactApi";
31
31
  import {IBankAccountApi} from "./bankAccount";
32
32
  import BankAccountApi from "./bankAccount/BankAccountApi";
33
- import { AccountBeneficiaryApi, IAccountBeneficiaryApi } from "./account-beneficiary";
33
+ import {AccountBeneficiaryApi, IAccountBeneficiaryApi} from "./account-beneficiary";
34
+ import {IStpSpeiApi, StpSpeiApi} from "./stpSpei";
34
35
 
35
36
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
36
37
  bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
@@ -54,4 +55,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
54
55
  bind<IP2pContactApi>("IP2pContactApi").to(P2pContactApi);
55
56
  bind<IBankAccountApi>("IBankAccountApi").to(BankAccountApi);
56
57
  bind<IAccountBeneficiaryApi>("IAccountBeneficiaryApi").to(AccountBeneficiaryApi);
58
+ bind<IStpSpeiApi>("IStpSpeiApi").to(StpSpeiApi);
57
59
  });
package/src/index.ts CHANGED
@@ -18,4 +18,5 @@ export * from "./contract-generator";
18
18
  export * from "./product-catalog";
19
19
  export * from "./collector";
20
20
  export * from "./p2pContact";
21
- export * from "./bankAccount";
21
+ export * from "./bankAccount";
22
+ export * from "./stpSpei";
@@ -0,0 +1,21 @@
1
+ import {IStpSpeiApi} from "./interfaces/IStpSpeiApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import {PutStpOrderRequest} from "@fiado/type-kit/bin/stp";
5
+
6
+ @injectable()
7
+ export class StpSpeiApi implements IStpSpeiApi {
8
+ private readonly baseUrl = process.env.STP_ACCOUNT_LAMBDA_URL || "";
9
+
10
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
11
+ }
12
+
13
+ async putStpOrder(request: PutStpOrderRequest): Promise<any> {
14
+ const url = `${this.baseUrl}`;
15
+ const headers = {
16
+ 'Content-Type': 'application/json',
17
+ operationName: "putConnectorStpOrders"
18
+ }
19
+ return await this.httpRequest.post(url, request, headers);
20
+ }
21
+ }
@@ -0,0 +1,5 @@
1
+ import {PutStpOrderRequest} from "@fiado/type-kit/bin/stp";
2
+
3
+ export interface IStpSpeiApi {
4
+ putStpOrder(request: PutStpOrderRequest): Promise<any>;
5
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IStpSpeiApi';
2
+ export * from './api/StpSpeiApi';