@fiado/api-invoker 1.2.19 → 1.2.20
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/activity-business/ActivityApi.d.ts +1 -0
- package/bin/activity-business/ActivityApi.js +4 -0
- package/bin/activity-business/interfaces/IActivityApi.d.ts +1 -0
- package/package.json +1 -1
- package/src/activity-business/ActivityApi.ts +4 -6
- package/src/activity-business/interfaces/IActivityApi.ts +2 -0
|
@@ -4,6 +4,7 @@ export default class ActivityApi implements IActivityApi {
|
|
|
4
4
|
private httpRequest;
|
|
5
5
|
private readonly baseUrl;
|
|
6
6
|
constructor(httpRequest: IHttpRequest);
|
|
7
|
+
findByDirectoriesList(directories: string[]): Promise<any>;
|
|
7
8
|
getActivityByDirectoryId(directoryId: string, typeOfActivityIds: string[]): Promise<any>;
|
|
8
9
|
getActivityById(typeOfActivityIds: string[]): Promise<any>;
|
|
9
10
|
getActivityHistory(typeOfActivity: string, startDate: string, endDate: string): Promise<any>;
|
|
@@ -18,6 +18,10 @@ let ActivityApi = class ActivityApi {
|
|
|
18
18
|
this.httpRequest = httpRequest;
|
|
19
19
|
this.baseUrl = process.env.ACTIVITY_LAMBDA_URL || "";
|
|
20
20
|
}
|
|
21
|
+
async findByDirectoriesList(directories) {
|
|
22
|
+
const url = `${this.baseUrl}activities/history/directories/?directories=${directories.join(',')}`;
|
|
23
|
+
return await this.httpRequest.get(url);
|
|
24
|
+
}
|
|
21
25
|
async getActivityByDirectoryId(directoryId, typeOfActivityIds) {
|
|
22
26
|
const typeOfActivityQuery = typeOfActivityIds.map(id => `typeOfActivity=${encodeURIComponent(id)}`).join('&');
|
|
23
27
|
const url = `${this.baseUrl}activities/directory/${directoryId}?${typeOfActivityQuery}`;
|
|
@@ -2,4 +2,5 @@ export interface IActivityApi {
|
|
|
2
2
|
getActivityByDirectoryId(directoryId: string, typeOfActivityIds: string[]): Promise<any>;
|
|
3
3
|
getActivityById(typeOfActivityIds: string[]): Promise<any>;
|
|
4
4
|
getActivityHistory(typeOfActivity: string, startDate: string, endDate: string): Promise<any>;
|
|
5
|
+
findByDirectoriesList(directories: string[]): Promise<any>;
|
|
5
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.20",
|
|
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",
|
|
@@ -8,27 +8,25 @@ export default class ActivityApi implements IActivityApi {
|
|
|
8
8
|
private readonly baseUrl = process.env.ACTIVITY_LAMBDA_URL || "";
|
|
9
9
|
|
|
10
10
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
11
|
+
async findByDirectoriesList(directories: string[]): Promise<any> {
|
|
12
|
+
const url = `${this.baseUrl}activities/history/directories/?directories=${directories.join(',')}`;
|
|
13
|
+
return await this.httpRequest.get(url);
|
|
14
|
+
}
|
|
11
15
|
|
|
12
16
|
async getActivityByDirectoryId(directoryId: string, typeOfActivityIds: string[]): Promise<any> {
|
|
13
|
-
|
|
14
17
|
const typeOfActivityQuery = typeOfActivityIds.map(id => `typeOfActivity=${encodeURIComponent(id)}`).join('&');
|
|
15
18
|
const url = `${this.baseUrl}activities/directory/${directoryId}?${typeOfActivityQuery}`;
|
|
16
|
-
|
|
17
19
|
return await this.httpRequest.get(url);
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
async getActivityById(typeOfActivityIds: string[]): Promise<any> {
|
|
21
|
-
|
|
22
23
|
const query = typeOfActivityIds.map(id => `typeOfActivity=${encodeURIComponent(id)}`).join('&');
|
|
23
24
|
const url = `${this.baseUrl}activities?${query}`;
|
|
24
|
-
|
|
25
25
|
return await this.httpRequest.get(url);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
async getActivityHistory(typeOfActivity:string, startDate: string, endDate: string): Promise<any> {
|
|
29
|
-
|
|
30
29
|
const url = `${this.baseUrl}activities/history?typeOfActivity=${typeOfActivity}&startDate=${startDate}&endDate=${endDate}`;
|
|
31
|
-
|
|
32
30
|
return await this.httpRequest.get(url);
|
|
33
31
|
}
|
|
34
32
|
}
|