@fiado/api-invoker 1.0.54 → 1.0.56
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-fiadoinc/AccountFiadoIncApi.d.ts +2 -1
- package/bin/account-fiadoinc/AccountFiadoIncApi.js +4 -0
- package/bin/account-fiadoinc/interfaces/IAccountFiadoIncApi.d.ts +2 -1
- package/bin/card/CardApi.d.ts +11 -0
- package/bin/card/CardApi.js +32 -0
- package/bin/card/index.d.ts +2 -0
- package/bin/card/index.js +18 -0
- package/bin/card/interfaces/ICardApi.d.ts +6 -0
- package/bin/card/interfaces/ICardApi.js +2 -0
- package/package.json +2 -2
- package/src/account-fiadoinc/AccountFiadoIncApi.ts +11 -1
- package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +8 -1
- package/src/card/CardApi.ts +26 -0
- package/src/card/index.ts +4 -0
- package/src/card/interfaces/ICardApi.ts +9 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAccountFiadoIncApi } from "./interfaces/IAccountFiadoIncApi";
|
|
2
|
-
import { AccountCreateRequest, AccountCreateResponse, GetAccountResponse } from "@fiado/type-kit/bin/account";
|
|
2
|
+
import { AccountCreateRequest, AccountCreateResponse, GetAccountResponse, GetPocketBalanceResponse } from "@fiado/type-kit/bin/account";
|
|
3
3
|
import { IHttpRequest } from "@fiado/http-client";
|
|
4
4
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
5
5
|
export default class AccountFiadoIncApi implements IAccountFiadoIncApi {
|
|
@@ -8,4 +8,5 @@ export default class AccountFiadoIncApi implements IAccountFiadoIncApi {
|
|
|
8
8
|
constructor(httpRequest: IHttpRequest);
|
|
9
9
|
createAccount(data: AccountCreateRequest): Promise<ApiGatewayResponse<AccountCreateResponse>>;
|
|
10
10
|
getAccountByDirectoryId(directoryId: string): Promise<ApiGatewayResponse<GetAccountResponse[]>>;
|
|
11
|
+
getPocketBalance(directoryId: string): Promise<ApiGatewayResponse<GetPocketBalanceResponse>>;
|
|
11
12
|
}
|
|
@@ -26,6 +26,10 @@ let AccountFiadoIncApi = class AccountFiadoIncApi {
|
|
|
26
26
|
const url = `${this.baseUrl}/${directoryId}`;
|
|
27
27
|
return await this.httpRequest.get(url);
|
|
28
28
|
}
|
|
29
|
+
async getPocketBalance(directoryId) {
|
|
30
|
+
const url = `${this.baseUrl}/pockets/${directoryId}/balance`;
|
|
31
|
+
return await this.httpRequest.get(url);
|
|
32
|
+
}
|
|
29
33
|
};
|
|
30
34
|
AccountFiadoIncApi = __decorate([
|
|
31
35
|
(0, inversify_1.injectable)(),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AccountCreateRequest, AccountCreateResponse, GetAccountResponse } from "@fiado/type-kit/bin/account";
|
|
1
|
+
import { AccountCreateRequest, AccountCreateResponse, GetAccountResponse, GetPocketBalanceResponse } from "@fiado/type-kit/bin/account";
|
|
2
2
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
3
|
export interface IAccountFiadoIncApi {
|
|
4
4
|
createAccount(data: AccountCreateRequest): Promise<ApiGatewayResponse<AccountCreateResponse>>;
|
|
5
5
|
getAccountByDirectoryId(directoryId: string): Promise<ApiGatewayResponse<GetAccountResponse[]>>;
|
|
6
|
+
getPocketBalance(directoryId: string): Promise<ApiGatewayResponse<GetPocketBalanceResponse>>;
|
|
6
7
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { CardResponse } from "@fiado/type-kit/bin/card";
|
|
4
|
+
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
5
|
+
import { ICardApi } from "./interfaces/ICardApi";
|
|
6
|
+
export declare class CardApi implements ICardApi {
|
|
7
|
+
private httpRequest;
|
|
8
|
+
private readonly baseUrl;
|
|
9
|
+
constructor(httpRequest: IHttpRequest);
|
|
10
|
+
getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
|
|
11
|
+
}
|
|
@@ -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.CardApi = void 0;
|
|
16
|
+
const inversify_1 = require("inversify");
|
|
17
|
+
let CardApi = class CardApi {
|
|
18
|
+
constructor(httpRequest) {
|
|
19
|
+
this.httpRequest = httpRequest;
|
|
20
|
+
this.baseUrl = process.env.CARD_LAMBDA_URL || "";
|
|
21
|
+
}
|
|
22
|
+
async getById(id, countryId) {
|
|
23
|
+
const url = `${this.baseUrl}/${countryId}/${countryId}/${id}`;
|
|
24
|
+
return await this.httpRequest.get(url);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.CardApi = CardApi;
|
|
28
|
+
exports.CardApi = CardApi = __decorate([
|
|
29
|
+
(0, inversify_1.injectable)(),
|
|
30
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
31
|
+
__metadata("design:paramtypes", [Object])
|
|
32
|
+
], CardApi);
|
|
@@ -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/ICardApi"), exports);
|
|
18
|
+
__exportStar(require("./CardApi"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { CardResponse } from "@fiado/type-kit/bin/card";
|
|
3
|
+
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
4
|
+
export interface ICardApi {
|
|
5
|
+
getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.56",
|
|
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/api-invoker": "^1.0.19",
|
|
17
17
|
"@fiado/gateway-adapter": "^1.0.30",
|
|
18
18
|
"@fiado/http-client": "^1.0.1",
|
|
19
|
-
"@fiado/type-kit": "^1.1.
|
|
19
|
+
"@fiado/type-kit": "^1.1.9",
|
|
20
20
|
"dotenv": "^16.4.5",
|
|
21
21
|
"inversify": "^6.0.2",
|
|
22
22
|
"reflect-metadata": "^0.2.1",
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import {IAccountFiadoIncApi} from "./interfaces/IAccountFiadoIncApi";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AccountCreateRequest,
|
|
4
|
+
AccountCreateResponse,
|
|
5
|
+
GetAccountResponse,
|
|
6
|
+
GetPocketBalanceResponse
|
|
7
|
+
} from "@fiado/type-kit/bin/account";
|
|
3
8
|
import {inject, injectable} from "inversify";
|
|
4
9
|
import {IHttpRequest} from "@fiado/http-client";
|
|
5
10
|
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
@@ -20,4 +25,9 @@ export default class AccountFiadoIncApi implements IAccountFiadoIncApi {
|
|
|
20
25
|
const url = `${this.baseUrl}/${directoryId}`;
|
|
21
26
|
return await this.httpRequest.get(url);
|
|
22
27
|
}
|
|
28
|
+
|
|
29
|
+
async getPocketBalance(directoryId: string): Promise<ApiGatewayResponse<GetPocketBalanceResponse>> {
|
|
30
|
+
const url = `${this.baseUrl}/pockets/${directoryId}/balance`;
|
|
31
|
+
return await this.httpRequest.get(url);
|
|
32
|
+
}
|
|
23
33
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AccountCreateRequest,
|
|
3
|
+
AccountCreateResponse,
|
|
4
|
+
GetAccountResponse,
|
|
5
|
+
GetPocketBalanceResponse
|
|
6
|
+
} from "@fiado/type-kit/bin/account";
|
|
2
7
|
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
3
8
|
|
|
4
9
|
|
|
@@ -6,4 +11,6 @@ export interface IAccountFiadoIncApi {
|
|
|
6
11
|
createAccount(data: AccountCreateRequest): Promise<ApiGatewayResponse<AccountCreateResponse>>;
|
|
7
12
|
|
|
8
13
|
getAccountByDirectoryId(directoryId: string): Promise<ApiGatewayResponse<GetAccountResponse[]>>;
|
|
14
|
+
|
|
15
|
+
getPocketBalance(directoryId: string): Promise<ApiGatewayResponse<GetPocketBalanceResponse>>;
|
|
9
16
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { CardResponse } from "@fiado/type-kit/bin/card";
|
|
4
|
+
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
5
|
+
import { inject, injectable } from "inversify";
|
|
6
|
+
import { ICardApi } from "./interfaces/ICardApi";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@injectable()
|
|
10
|
+
export class CardApi implements ICardApi {
|
|
11
|
+
|
|
12
|
+
private readonly baseUrl = process.env.CARD_LAMBDA_URL || "";
|
|
13
|
+
|
|
14
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>> {
|
|
18
|
+
|
|
19
|
+
const url = `${this.baseUrl}/${countryId}/${countryId}/${id}`;
|
|
20
|
+
return await this.httpRequest.get(url);
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { CardResponse } from "@fiado/type-kit/bin/card";
|
|
3
|
+
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
4
|
+
|
|
5
|
+
export interface ICardApi {
|
|
6
|
+
|
|
7
|
+
getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
|
|
8
|
+
|
|
9
|
+
}
|