@fiado/api-invoker 3.0.33 → 3.0.34
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/countries-business/CountriesBusinessApi.d.ts +2 -2
- package/bin/countries-business/CountriesBusinessApi.js +6 -1
- package/bin/countries-business/interfaces/ICountriesBusinessApi.d.ts +18 -1
- package/package.json +1 -1
- package/src/countries-business/CountriesBusinessApi.ts +9 -3
- package/src/countries-business/interfaces/ICountriesBusinessApi.ts +19 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ICountriesBusinessApi } from "./interfaces/ICountriesBusinessApi";
|
|
1
|
+
import { CountriesGetListRequest, ICountriesBusinessApi } from "./interfaces/ICountriesBusinessApi";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
export default class CountriesBusinessApi implements ICountriesBusinessApi {
|
|
4
4
|
private httpRequest;
|
|
5
5
|
private readonly baseUrl;
|
|
6
6
|
constructor(httpRequest: IHttpRequest);
|
|
7
7
|
getAll(): Promise<any>;
|
|
8
|
-
getList(params:
|
|
8
|
+
getList(params: CountriesGetListRequest): Promise<any>;
|
|
9
9
|
}
|
|
@@ -25,10 +25,15 @@ let CountriesBusinessApi = class CountriesBusinessApi {
|
|
|
25
25
|
return await this.httpRequest.post(this.baseUrl, null, headers);
|
|
26
26
|
}
|
|
27
27
|
async getList(params) {
|
|
28
|
+
const queryParams = Object.entries(params)
|
|
29
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
30
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
31
|
+
.join('&');
|
|
32
|
+
const url = queryParams ? `${this.baseUrl}?${queryParams}` : this.baseUrl;
|
|
28
33
|
const headers = {
|
|
29
34
|
"operationName": "privateGetList"
|
|
30
35
|
};
|
|
31
|
-
return await this.httpRequest.post(
|
|
36
|
+
return await this.httpRequest.post(url, null, headers);
|
|
32
37
|
}
|
|
33
38
|
};
|
|
34
39
|
CountriesBusinessApi = __decorate([
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
+
export interface CountriesGetListRequest {
|
|
2
|
+
index?: string;
|
|
3
|
+
pageSize?: number;
|
|
4
|
+
filter1?: string;
|
|
5
|
+
filter2?: string;
|
|
6
|
+
filter3?: string;
|
|
7
|
+
filter4?: string;
|
|
8
|
+
filter5?: string;
|
|
9
|
+
filter6?: string;
|
|
10
|
+
filter7?: string;
|
|
11
|
+
filter8?: string;
|
|
12
|
+
filter9?: string;
|
|
13
|
+
filter10?: string;
|
|
14
|
+
isEnabled?: boolean;
|
|
15
|
+
iso2?: string;
|
|
16
|
+
iso3?: string;
|
|
17
|
+
}
|
|
1
18
|
export interface ICountriesBusinessApi {
|
|
2
19
|
getAll(): Promise<any>;
|
|
3
|
-
getList(params:
|
|
20
|
+
getList(params: CountriesGetListRequest): Promise<any>;
|
|
4
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.34",
|
|
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",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICountriesBusinessApi } from "./interfaces/ICountriesBusinessApi";
|
|
1
|
+
import { CountriesGetListRequest, ICountriesBusinessApi } from "./interfaces/ICountriesBusinessApi";
|
|
2
2
|
import { inject, injectable } from "inversify";
|
|
3
3
|
import { IHttpRequest } from "@fiado/http-client";
|
|
4
4
|
|
|
@@ -16,10 +16,16 @@ export default class CountriesBusinessApi implements ICountriesBusinessApi {
|
|
|
16
16
|
return await this.httpRequest.post(this.baseUrl, null, headers);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
async getList(params:
|
|
19
|
+
async getList(params: CountriesGetListRequest): Promise<any> {
|
|
20
|
+
const queryParams = Object.entries(params)
|
|
21
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
22
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
23
|
+
.join('&');
|
|
24
|
+
|
|
25
|
+
const url = queryParams ? `${this.baseUrl}?${queryParams}` : this.baseUrl;
|
|
20
26
|
const headers = {
|
|
21
27
|
"operationName": "privateGetList"
|
|
22
28
|
}
|
|
23
|
-
return await this.httpRequest.post(
|
|
29
|
+
return await this.httpRequest.post(url, null, headers);
|
|
24
30
|
}
|
|
25
31
|
}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
+
export interface CountriesGetListRequest {
|
|
2
|
+
index?: string;
|
|
3
|
+
pageSize?: number;
|
|
4
|
+
filter1?: string;
|
|
5
|
+
filter2?: string;
|
|
6
|
+
filter3?: string;
|
|
7
|
+
filter4?: string;
|
|
8
|
+
filter5?: string;
|
|
9
|
+
filter6?: string;
|
|
10
|
+
filter7?: string;
|
|
11
|
+
filter8?: string;
|
|
12
|
+
filter9?: string;
|
|
13
|
+
filter10?: string;
|
|
14
|
+
isEnabled?: boolean;
|
|
15
|
+
iso2?: string;
|
|
16
|
+
iso3?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
1
19
|
export interface ICountriesBusinessApi {
|
|
2
20
|
getAll(): Promise<any>;
|
|
3
|
-
getList(params:
|
|
21
|
+
getList(params: CountriesGetListRequest): Promise<any>;
|
|
4
22
|
}
|