@fiado/api-invoker 1.0.83 → 1.0.85
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.
- package/bin/account-beneficiary/AccountBeneficiaryApi.d.ts +10 -0
- package/bin/account-beneficiary/AccountBeneficiaryApi.js +32 -0
- package/bin/account-beneficiary/index.d.ts +2 -0
- package/bin/account-beneficiary/index.js +18 -0
- package/bin/account-beneficiary/interfaces/IAccountBeneficiaryApi.d.ts +5 -0
- package/bin/account-beneficiary/interfaces/IAccountBeneficiaryApi.js +2 -0
- package/bin/bankAccount/BankAccountApi.d.ts +9 -0
- package/bin/bankAccount/BankAccountApi.js +49 -0
- package/bin/bankAccount/index.d.ts +2 -0
- package/bin/bankAccount/index.js +18 -0
- package/bin/bankAccount/interfaces/IBankAccountApi.d.ts +4 -0
- package/bin/bankAccount/interfaces/IBankAccountApi.js +2 -0
- package/bin/container.config.js +2 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +2 -0
- package/package.json +2 -2
- package/src/account-beneficiary/AccountBeneficiaryApi.ts +19 -0
- package/src/account-beneficiary/index.ts +3 -0
- package/src/account-beneficiary/interfaces/IAccountBeneficiaryApi.ts +8 -0
- package/src/bankAccount/BankAccountApi.ts +38 -0
- package/src/bankAccount/index.ts +2 -0
- package/src/bankAccount/interfaces/IBankAccountApi.ts +5 -0
- package/src/container.config.ts +4 -2
- package/src/index.ts +3 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAccountBeneficiaryApi } from "./interfaces/IAccountBeneficiaryApi";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary";
|
|
4
|
+
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
5
|
+
export declare class AccountBeneficiaryApi implements IAccountBeneficiaryApi {
|
|
6
|
+
private httpRequest;
|
|
7
|
+
private readonly baseUrl;
|
|
8
|
+
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest): Promise<void>;
|
|
10
|
+
}
|
|
@@ -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.AccountBeneficiaryApi = void 0;
|
|
16
|
+
const inversify_1 = require("inversify");
|
|
17
|
+
let AccountBeneficiaryApi = class AccountBeneficiaryApi {
|
|
18
|
+
constructor(httpRequest) {
|
|
19
|
+
this.httpRequest = httpRequest;
|
|
20
|
+
this.baseUrl = process.env.ACCOUNT_BENEFICIARY_LAMBDA_URL || "";
|
|
21
|
+
}
|
|
22
|
+
async create(directoryId, countryId, input) {
|
|
23
|
+
const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
|
|
24
|
+
return await this.httpRequest.post(url, input);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.AccountBeneficiaryApi = AccountBeneficiaryApi;
|
|
28
|
+
exports.AccountBeneficiaryApi = AccountBeneficiaryApi = __decorate([
|
|
29
|
+
(0, inversify_1.injectable)(),
|
|
30
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
31
|
+
__metadata("design:paramtypes", [Object])
|
|
32
|
+
], AccountBeneficiaryApi);
|
|
@@ -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/IAccountBeneficiaryApi"), exports);
|
|
18
|
+
__exportStar(require("./AccountBeneficiaryApi"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary";
|
|
2
|
+
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
3
|
+
export interface IAccountBeneficiaryApi {
|
|
4
|
+
create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest): Promise<void>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IBankAccountApi } from "./interfaces/IBankAccountApi";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
export default class BankAccountApi implements IBankAccountApi {
|
|
4
|
+
private httpRequest;
|
|
5
|
+
private readonly baseUrl;
|
|
6
|
+
constructor(httpRequest: IHttpRequest);
|
|
7
|
+
getBankAccountById(bankAccountId: string): Promise<any>;
|
|
8
|
+
getBankById(bankId: string): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
let BankAccountApi = class BankAccountApi {
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
this.baseUrl = process.env.BANK_ACCOUNT_LAMBDA_UR || "";
|
|
20
|
+
}
|
|
21
|
+
async getBankAccountById(bankAccountId) {
|
|
22
|
+
const url = `${this.baseUrl}`;
|
|
23
|
+
const body = {
|
|
24
|
+
accountId: bankAccountId
|
|
25
|
+
};
|
|
26
|
+
const headers = {
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
operationName: "postBankAccountId"
|
|
29
|
+
};
|
|
30
|
+
return await this.httpRequest.post(url, body, headers);
|
|
31
|
+
}
|
|
32
|
+
async getBankById(bankId) {
|
|
33
|
+
const url = `${this.baseUrl}`;
|
|
34
|
+
const body = {
|
|
35
|
+
bankId: bankId
|
|
36
|
+
};
|
|
37
|
+
const headers = {
|
|
38
|
+
'Content-Type': 'application/json',
|
|
39
|
+
operationName: "getBanksBankId"
|
|
40
|
+
};
|
|
41
|
+
return await this.httpRequest.post(url, body, headers);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
BankAccountApi = __decorate([
|
|
45
|
+
(0, inversify_1.injectable)(),
|
|
46
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
47
|
+
__metadata("design:paramtypes", [Object])
|
|
48
|
+
], BankAccountApi);
|
|
49
|
+
exports.default = BankAccountApi;
|
|
@@ -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/IBankAccountApi"), exports);
|
|
18
|
+
__exportStar(require("./BankAccountApi"), exports);
|
package/bin/container.config.js
CHANGED
|
@@ -24,6 +24,7 @@ const contract_generator_1 = require("./contract-generator");
|
|
|
24
24
|
const ProductCatalogApi_1 = __importDefault(require("./product-catalog/ProductCatalogApi"));
|
|
25
25
|
const collector_1 = require("./collector");
|
|
26
26
|
const P2pContactApi_1 = __importDefault(require("./p2pContact/api/P2pContactApi"));
|
|
27
|
+
const BankAccountApi_1 = __importDefault(require("./bankAccount/BankAccountApi"));
|
|
27
28
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
28
29
|
bind("IDirectoryApi").to(directory_1.DirectoryApi);
|
|
29
30
|
bind("IIdentityApi").to(identity_1.IdentityApi);
|
|
@@ -44,4 +45,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
|
44
45
|
bind("ICollectorApi").to(collector_1.CollectorApi);
|
|
45
46
|
bind("IProductCatalogApi").to(ProductCatalogApi_1.default);
|
|
46
47
|
bind("IP2pContactApi").to(P2pContactApi_1.default);
|
|
48
|
+
bind("IBankAccountApi").to(BankAccountApi_1.default);
|
|
47
49
|
});
|
package/bin/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./container.config";
|
|
|
10
10
|
export * from "./account-fiadoinc";
|
|
11
11
|
export * from "./account-fiadosa";
|
|
12
12
|
export * from "./account-pagoconfiado";
|
|
13
|
+
export * from "./account-beneficiary";
|
|
13
14
|
export * from "./exchangeRates";
|
|
14
15
|
export * from "./authentication";
|
|
15
16
|
export * from "./transaction";
|
|
@@ -17,3 +18,4 @@ export * from "./contract-generator";
|
|
|
17
18
|
export * from "./product-catalog";
|
|
18
19
|
export * from "./collector";
|
|
19
20
|
export * from "./p2pContact";
|
|
21
|
+
export * from "./bankAccount";
|
package/bin/index.js
CHANGED
|
@@ -26,6 +26,7 @@ __exportStar(require("./container.config"), exports);
|
|
|
26
26
|
__exportStar(require("./account-fiadoinc"), exports);
|
|
27
27
|
__exportStar(require("./account-fiadosa"), exports);
|
|
28
28
|
__exportStar(require("./account-pagoconfiado"), exports);
|
|
29
|
+
__exportStar(require("./account-beneficiary"), exports);
|
|
29
30
|
__exportStar(require("./exchangeRates"), exports);
|
|
30
31
|
__exportStar(require("./authentication"), exports);
|
|
31
32
|
__exportStar(require("./transaction"), exports);
|
|
@@ -33,3 +34,4 @@ __exportStar(require("./contract-generator"), exports);
|
|
|
33
34
|
__exportStar(require("./product-catalog"), exports);
|
|
34
35
|
__exportStar(require("./collector"), exports);
|
|
35
36
|
__exportStar(require("./p2pContact"), exports);
|
|
37
|
+
__exportStar(require("./bankAccount"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.85",
|
|
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.
|
|
19
|
+
"@fiado/type-kit": "^1.1.70",
|
|
20
20
|
"dotenv": "^16.4.5",
|
|
21
21
|
"inversify": "^6.0.2",
|
|
22
22
|
"reflect-metadata": "^0.2.1",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import { IAccountBeneficiaryApi } from "./interfaces/IAccountBeneficiaryApi";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary";
|
|
5
|
+
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export class AccountBeneficiaryApi implements IAccountBeneficiaryApi {
|
|
10
|
+
private readonly baseUrl = process.env.ACCOUNT_BENEFICIARY_LAMBDA_URL || "";
|
|
11
|
+
|
|
12
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest): Promise<void> {
|
|
16
|
+
const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
|
|
17
|
+
return await this.httpRequest.post(url, input);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary";
|
|
2
|
+
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
3
|
+
|
|
4
|
+
export interface IAccountBeneficiaryApi {
|
|
5
|
+
|
|
6
|
+
create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest): Promise<void>;
|
|
7
|
+
|
|
8
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {inject, injectable} from "inversify";
|
|
2
|
+
import {IBankAccountApi} from "./interfaces/IBankAccountApi";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import GetExternalBankAccountRequest from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountRequest";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export default class BankAccountApi implements IBankAccountApi {
|
|
8
|
+
private readonly baseUrl = process.env.BANK_ACCOUNT_LAMBDA_UR || "";
|
|
9
|
+
|
|
10
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async getBankAccountById(bankAccountId: string): Promise<any> {
|
|
14
|
+
const url = `${this.baseUrl}`;
|
|
15
|
+
const body: GetExternalBankAccountRequest = {
|
|
16
|
+
accountId: bankAccountId
|
|
17
|
+
} as GetExternalBankAccountRequest;
|
|
18
|
+
const headers = {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
operationName: "postBankAccountId"
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return await this.httpRequest.post(url, body, headers);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async getBankById(bankId: string): Promise<any> {
|
|
27
|
+
const url = `${this.baseUrl}`;
|
|
28
|
+
const body: GetExternalBankAccountRequest = {
|
|
29
|
+
bankId: bankId
|
|
30
|
+
} as GetExternalBankAccountRequest;
|
|
31
|
+
const headers = {
|
|
32
|
+
'Content-Type': 'application/json',
|
|
33
|
+
operationName: "getBanksBankId"
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return await this.httpRequest.post(url, body, headers);
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/container.config.ts
CHANGED
|
@@ -25,10 +25,11 @@ import {ITransactionPublisher, TransactionPublisher} from "./transaction";
|
|
|
25
25
|
import {ContractGeneratorApi, IContractGeneratorApi} from "./contract-generator";
|
|
26
26
|
import {IProductCatalogApi} from "./product-catalog";
|
|
27
27
|
import ProductCatalogApi from "./product-catalog/ProductCatalogApi";
|
|
28
|
-
import {ICollectorApi} from "./collector";
|
|
29
|
-
import {CollectorApi} from "./collector";
|
|
28
|
+
import {CollectorApi, ICollectorApi} from "./collector";
|
|
30
29
|
import {IP2pContactApi} from "./p2pContact";
|
|
31
30
|
import P2pContactApi from "./p2pContact/api/P2pContactApi";
|
|
31
|
+
import {IBankAccountApi} from "./bankAccount";
|
|
32
|
+
import BankAccountApi from "./bankAccount/BankAccountApi";
|
|
32
33
|
|
|
33
34
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
34
35
|
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
@@ -50,4 +51,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
|
|
|
50
51
|
bind<ICollectorApi>("ICollectorApi").to(CollectorApi);
|
|
51
52
|
bind<IProductCatalogApi>("IProductCatalogApi").to(ProductCatalogApi);
|
|
52
53
|
bind<IP2pContactApi>("IP2pContactApi").to(P2pContactApi);
|
|
54
|
+
bind<IBankAccountApi>("IBankAccountApi").to(BankAccountApi);
|
|
53
55
|
});
|
package/src/index.ts
CHANGED
|
@@ -10,10 +10,12 @@ export * from "./container.config";
|
|
|
10
10
|
export * from "./account-fiadoinc";
|
|
11
11
|
export * from "./account-fiadosa";
|
|
12
12
|
export * from "./account-pagoconfiado";
|
|
13
|
+
export * from "./account-beneficiary";
|
|
13
14
|
export * from "./exchangeRates";
|
|
14
15
|
export * from "./authentication";
|
|
15
16
|
export * from "./transaction";
|
|
16
17
|
export * from "./contract-generator";
|
|
17
18
|
export * from "./product-catalog";
|
|
18
19
|
export * from "./collector";
|
|
19
|
-
export * from "./p2pContact";
|
|
20
|
+
export * from "./p2pContact";
|
|
21
|
+
export * from "./bankAccount";
|