@fiado/api-invoker 3.0.22 → 3.0.23
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/stpServicePayment/api/StpServicePaymentApi.d.ts +3 -1
- package/bin/stpServicePayment/api/StpServicePaymentApi.js +11 -0
- package/bin/stpServicePayment/api/interfaces/IStpServicePaymentApi.d.ts +3 -1
- package/package.json +2 -2
- package/src/stpServicePayment/api/StpServicePaymentApi.ts +13 -1
- package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +4 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IStpServicePaymentApi } from "./interfaces/IStpServicePaymentApi";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse } from "@fiado/type-kit/bin/servicePayment";
|
|
3
|
+
import { GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse, GetFavoritesParams, GetFavoritesResponse } from "@fiado/type-kit/bin/servicePayment";
|
|
4
4
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
5
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
5
6
|
export default class StpServicePaymentApi implements IStpServicePaymentApi {
|
|
6
7
|
private httpRequest;
|
|
7
8
|
private readonly baseUrl;
|
|
@@ -18,4 +19,5 @@ export default class StpServicePaymentApi implements IStpServicePaymentApi {
|
|
|
18
19
|
getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
|
|
19
20
|
getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>>;
|
|
20
21
|
verificateReference(request: ReferenceVerificationRequest): Promise<ApiGatewayResponse<ReferenceVerificationResponse>>;
|
|
22
|
+
getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
|
|
21
23
|
}
|
|
@@ -49,6 +49,17 @@ let StpServicePaymentApi = class StpServicePaymentApi {
|
|
|
49
49
|
const url = `${this.baseUrl}verificateReference`;
|
|
50
50
|
return await this.httpRequest.post(url, request);
|
|
51
51
|
}
|
|
52
|
+
async getTransactions(params) {
|
|
53
|
+
const { directoryId, ...queryParams } = params;
|
|
54
|
+
let url = `${this.baseUrl}transactions/${directoryId}`;
|
|
55
|
+
const query = Object.keys(queryParams)
|
|
56
|
+
.filter(key => queryParams[key] !== undefined)
|
|
57
|
+
.map(key => `${key}=${encodeURIComponent(queryParams[key])}`)
|
|
58
|
+
.join('&');
|
|
59
|
+
if (query)
|
|
60
|
+
url += `?${query}`;
|
|
61
|
+
return await this.httpRequest.get(url);
|
|
62
|
+
}
|
|
52
63
|
};
|
|
53
64
|
StpServicePaymentApi = __decorate([
|
|
54
65
|
(0, inversify_1.injectable)(),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse } from "@fiado/type-kit/bin/servicePayment";
|
|
1
|
+
import { GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse, GetFavoritesParams, GetFavoritesResponse } from "@fiado/type-kit/bin/servicePayment";
|
|
2
2
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
3
4
|
export interface IStpServicePaymentApi {
|
|
4
5
|
pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>>;
|
|
5
6
|
getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
|
|
@@ -13,4 +14,5 @@ export interface IStpServicePaymentApi {
|
|
|
13
14
|
sort?: string;
|
|
14
15
|
}): Promise<ApiGatewayResponse<any>>;
|
|
15
16
|
verificateReference(request: ReferenceVerificationRequest): Promise<ApiGatewayResponse<ReferenceVerificationResponse>>;
|
|
17
|
+
getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
|
|
16
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.23",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través 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.50",
|
|
17
17
|
"@fiado/http-client": "^1.0.7",
|
|
18
18
|
"@fiado/logger": "^1.0.3",
|
|
19
|
-
"@fiado/type-kit": "^3.0.
|
|
19
|
+
"@fiado/type-kit": "^3.0.28",
|
|
20
20
|
"dotenv": "^16.4.7",
|
|
21
21
|
"inversify": "^6.2.2",
|
|
22
22
|
"reflect-metadata": "^0.2.2"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {IStpServicePaymentApi} from "./interfaces/IStpServicePaymentApi";
|
|
2
2
|
import {inject, injectable} from "inversify";
|
|
3
3
|
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse} from "@fiado/type-kit/bin/servicePayment";
|
|
4
|
+
import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse, TransactionModelResponse, GetFavoritesParams, GetFavoritesResponse} from "@fiado/type-kit/bin/servicePayment";
|
|
5
5
|
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
6
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
6
7
|
|
|
7
8
|
@injectable()
|
|
8
9
|
export default class StpServicePaymentApi implements IStpServicePaymentApi {
|
|
@@ -47,4 +48,15 @@ export default class StpServicePaymentApi implements IStpServicePaymentApi {
|
|
|
47
48
|
const url = `${this.baseUrl}verificateReference`;
|
|
48
49
|
return await this.httpRequest.post(url, request);
|
|
49
50
|
}
|
|
51
|
+
|
|
52
|
+
async getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>> {
|
|
53
|
+
const { directoryId, ...queryParams } = params;
|
|
54
|
+
let url = `${this.baseUrl}transactions/${directoryId}`;
|
|
55
|
+
const query = Object.keys(queryParams)
|
|
56
|
+
.filter(key => queryParams[key] !== undefined)
|
|
57
|
+
.map(key => `${key}=${encodeURIComponent(queryParams[key])}`)
|
|
58
|
+
.join('&');
|
|
59
|
+
if (query) url += `?${query}`;
|
|
60
|
+
return await this.httpRequest.get(url);
|
|
61
|
+
}
|
|
50
62
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse} from "@fiado/type-kit/bin/servicePayment";
|
|
1
|
+
import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse, TransactionModelResponse, GetFavoritesParams, GetFavoritesResponse} from "@fiado/type-kit/bin/servicePayment";
|
|
2
2
|
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
3
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
3
4
|
|
|
4
5
|
export interface IStpServicePaymentApi {
|
|
5
6
|
pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>>;
|
|
@@ -15,4 +16,6 @@ export interface IStpServicePaymentApi {
|
|
|
15
16
|
getSTPTransactionDownload(params: {date: string,index?:string,pageSize?:number, sort?:string}): Promise<ApiGatewayResponse<any>>;
|
|
16
17
|
|
|
17
18
|
verificateReference(request: ReferenceVerificationRequest): Promise<ApiGatewayResponse<ReferenceVerificationResponse>>;
|
|
19
|
+
|
|
20
|
+
getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>
|
|
18
21
|
}
|