@fiado/api-invoker 3.0.23 → 3.0.26
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/multicommServicePayment/api/MulticommServicePaymentApi.d.ts +3 -1
- package/bin/multicommServicePayment/api/MulticommServicePaymentApi.js +11 -0
- package/bin/multicommServicePayment/api/interfaces/IMulticommServicePaymentApi.d.ts +3 -1
- package/package.json +2 -2
- package/src/multicommServicePayment/api/MulticommServicePaymentApi.ts +13 -1
- package/src/multicommServicePayment/api/interfaces/IMulticommServicePaymentApi.ts +4 -1
- package/src/stpServicePayment/api/StpServicePaymentApi.ts +1 -1
- package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IMulticommServicePaymentApi } from "./interfaces/IMulticommServicePaymentApi";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { GetCatalogParams, ServicePaymentRequest } from "@fiado/type-kit/bin/servicePayment";
|
|
3
|
+
import { GetCatalogParams, GetFavoritesParams, GetFavoritesResponse, ServicePaymentRequest } 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 MulticommServicePaymentApi implements IMulticommServicePaymentApi {
|
|
6
7
|
private httpRequest;
|
|
7
8
|
private readonly baseUrl;
|
|
@@ -22,4 +23,5 @@ export default class MulticommServicePaymentApi implements IMulticommServicePaym
|
|
|
22
23
|
date: string;
|
|
23
24
|
serviceId: string;
|
|
24
25
|
}): Promise<ApiGatewayResponse<any>>;
|
|
26
|
+
getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
|
|
25
27
|
}
|
|
@@ -49,6 +49,17 @@ let MulticommServicePaymentApi = class MulticommServicePaymentApi {
|
|
|
49
49
|
const url = `${this.baseUrl}consult-transaction?${Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&')}`;
|
|
50
50
|
return await this.httpRequest.get(url);
|
|
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
|
MulticommServicePaymentApi = __decorate([
|
|
54
65
|
(0, inversify_1.injectable)(),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GetCatalogParams, ServicePaymentRequest } from "@fiado/type-kit/bin/servicePayment";
|
|
1
|
+
import { GetCatalogParams, GetFavoritesParams, GetFavoritesResponse, ServicePaymentRequest } 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 IMulticommServicePaymentApi {
|
|
4
5
|
pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>>;
|
|
5
6
|
getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
|
|
@@ -17,4 +18,5 @@ export interface IMulticommServicePaymentApi {
|
|
|
17
18
|
date: string;
|
|
18
19
|
serviceId: string;
|
|
19
20
|
}): Promise<ApiGatewayResponse<any>>;
|
|
21
|
+
getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
|
|
20
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.26",
|
|
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.29",
|
|
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 {IMulticommServicePaymentApi} from "./interfaces/IMulticommServicePaymentApi";
|
|
2
2
|
import {inject, injectable} from "inversify";
|
|
3
3
|
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
|
|
4
|
+
import {GetCatalogParams, GetFavoritesParams, GetFavoritesResponse, ServicePaymentRequest} 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 MulticommServicePaymentApi implements IMulticommServicePaymentApi {
|
|
@@ -47,4 +48,15 @@ export default class MulticommServicePaymentApi implements IMulticommServicePaym
|
|
|
47
48
|
const url = `${this.baseUrl}consult-transaction?${Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&')}`;
|
|
48
49
|
return await this.httpRequest.get(url);
|
|
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} from "@fiado/type-kit/bin/servicePayment";
|
|
1
|
+
import {GetCatalogParams, GetFavoritesParams, GetFavoritesResponse, ServicePaymentRequest} 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 IMulticommServicePaymentApi {
|
|
5
6
|
pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>>;
|
|
@@ -15,4 +16,6 @@ export interface IMulticommServicePaymentApi {
|
|
|
15
16
|
getSTPTransactionDownload(params: {date: string,index?:string,pageSize?:number, sort?:string}): Promise<ApiGatewayResponse<any>>;
|
|
16
17
|
|
|
17
18
|
consultTransaction(params: {transactionNumber: string, date: string, serviceId: string}): Promise<ApiGatewayResponse<any>>;
|
|
19
|
+
|
|
20
|
+
getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
|
|
18
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
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,
|
|
4
|
+
import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse, GetFavoritesParams, GetFavoritesResponse} from "@fiado/type-kit/bin/servicePayment";
|
|
5
5
|
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
6
6
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse,
|
|
1
|
+
import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse, GetFavoritesParams, GetFavoritesResponse} from "@fiado/type-kit/bin/servicePayment";
|
|
2
2
|
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
3
3
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
4
4
|
|