@shieldiot/pulse-lib 2.0.1450 → 2.0.1452
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/dist/cjs/lib/services/SupportIconService.d.ts +1 -1
- package/dist/cjs/lib/services/SupportLogoService.d.ts +1 -1
- package/dist/cjs/lib/services/SysAccountsService.d.ts +1 -1
- package/dist/cjs/lib/services/UsrAlertsService.d.ts +2 -2
- package/dist/cjs/lib/services/UsrDevicesService.d.ts +1 -1
- package/dist/cjs/lib/services/UsrEventsService.d.ts +2 -2
- package/dist/cjs/lib/services/UsrPrivateTopologyService.d.ts +1 -1
- package/dist/cjs/lib/services/UsrReportsInstanceService.d.ts +1 -1
- package/dist/cjs/lib/services/UsrReportsService.d.ts +1 -1
- package/dist/cjs/lib/services/UsrUserService.d.ts +1 -1
- package/dist/cjs/rest-utils.d.ts +1 -1
- package/dist/cjs/rest-utils.js +16 -23
- package/dist/cjs/rest-utils.js.map +1 -1
- package/dist/esm/lib/services/SupportIconService.d.ts +1 -1
- package/dist/esm/lib/services/SupportLogoService.d.ts +1 -1
- package/dist/esm/lib/services/SysAccountsService.d.ts +1 -1
- package/dist/esm/lib/services/UsrAlertsService.d.ts +2 -2
- package/dist/esm/lib/services/UsrDevicesService.d.ts +1 -1
- package/dist/esm/lib/services/UsrEventsService.d.ts +2 -2
- package/dist/esm/lib/services/UsrPrivateTopologyService.d.ts +1 -1
- package/dist/esm/lib/services/UsrReportsInstanceService.d.ts +1 -1
- package/dist/esm/lib/services/UsrReportsService.d.ts +1 -1
- package/dist/esm/lib/services/UsrUserService.d.ts +1 -1
- package/dist/esm/rest-utils.d.ts +1 -1
- package/dist/esm/rest-utils.js +16 -23
- package/dist/esm/rest-utils.js.map +1 -1
- package/dist/types/lib/services/SupportIconService.d.ts +1 -1
- package/dist/types/lib/services/SupportLogoService.d.ts +1 -1
- package/dist/types/lib/services/SysAccountsService.d.ts +1 -1
- package/dist/types/lib/services/UsrAlertsService.d.ts +2 -2
- package/dist/types/lib/services/UsrDevicesService.d.ts +1 -1
- package/dist/types/lib/services/UsrEventsService.d.ts +2 -2
- package/dist/types/lib/services/UsrPrivateTopologyService.d.ts +1 -1
- package/dist/types/lib/services/UsrReportsInstanceService.d.ts +1 -1
- package/dist/types/lib/services/UsrReportsService.d.ts +1 -1
- package/dist/types/lib/services/UsrUserService.d.ts +1 -1
- package/dist/types/rest-utils.d.ts +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
|
@@ -52,5 +52,5 @@ export declare class SysAccountsService {
|
|
|
52
52
|
/**
|
|
53
53
|
* Export accounts reports by query to a file
|
|
54
54
|
*/
|
|
55
|
-
export(format?: string, search?: string, type?: AccountTypeCode[], status?: AccountStatusCode[], sort?: string, page?: number, size?: number):
|
|
55
|
+
export(format?: string, search?: string, type?: AccountTypeCode[], status?: AccountStatusCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
56
56
|
}
|
|
@@ -32,11 +32,11 @@ export declare class UsrAlertsService {
|
|
|
32
32
|
/**
|
|
33
33
|
* Export alerts by query to a file
|
|
34
34
|
*/
|
|
35
|
-
export(format?: string, streamId?: string, deviceId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number):
|
|
35
|
+
export(format?: string, streamId?: string, deviceId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
36
36
|
/**
|
|
37
37
|
* Export alerts source file as stream of source file (pcap)
|
|
38
38
|
*/
|
|
39
|
-
exportSource(id?: string):
|
|
39
|
+
exportSource(id?: string): import("rxjs").Observable<Blob>;
|
|
40
40
|
/**
|
|
41
41
|
* Apply status on alert
|
|
42
42
|
*/
|
|
@@ -53,7 +53,7 @@ export declare class UsrDevicesService {
|
|
|
53
53
|
/**
|
|
54
54
|
* Export devices by query to a file as a stream of CSV | JSON | XML | XLSX
|
|
55
55
|
*/
|
|
56
|
-
export(format?: string, streamId?: string, search?: string, from?: number, to?: number, type?: DeviceTypeCode[], tag?: string[], status?: DeviceStatusCode[], risk?: SeverityTypeCode[], sort?: string, page?: number, size?: number):
|
|
56
|
+
export(format?: string, streamId?: string, search?: string, from?: number, to?: number, type?: DeviceTypeCode[], tag?: string[], status?: DeviceStatusCode[], risk?: SeverityTypeCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
57
57
|
/**
|
|
58
58
|
* Upload device list from csv file
|
|
59
59
|
*/
|
|
@@ -31,11 +31,11 @@ export declare class UsrEventsService {
|
|
|
31
31
|
/**
|
|
32
32
|
* Export events by query to a file in a stream of CSV | JSON | XML | XLSX
|
|
33
33
|
*/
|
|
34
|
-
export(format?: string, streamId?: string, deviceId?: string, alertId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number):
|
|
34
|
+
export(format?: string, streamId?: string, deviceId?: string, alertId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
35
35
|
/**
|
|
36
36
|
* Export event source file as a stream of source file (pcap)
|
|
37
37
|
*/
|
|
38
|
-
exportSource(id?: string):
|
|
38
|
+
exportSource(id?: string): import("rxjs").Observable<Blob>;
|
|
39
39
|
/**
|
|
40
40
|
* Get top 10 events by their severity and time
|
|
41
41
|
*/
|
|
@@ -27,7 +27,7 @@ export declare class UsrPrivateTopologyService {
|
|
|
27
27
|
/**
|
|
28
28
|
* Export the device list for the given connections as a file
|
|
29
29
|
*/
|
|
30
|
-
exportDevices(format?: string, body?: PrivateTopologyDevicesParams):
|
|
30
|
+
exportDevices(format?: string, body?: PrivateTopologyDevicesParams): import("rxjs").Observable<Blob>;
|
|
31
31
|
/**
|
|
32
32
|
* Get the sessions-per-day timeline for the given connections
|
|
33
33
|
*/
|
|
@@ -33,7 +33,7 @@ export declare class UsrReportsService {
|
|
|
33
33
|
/**
|
|
34
34
|
* Create PDF compliance report
|
|
35
35
|
*/
|
|
36
|
-
getComplianceReport(streamId?: string, from?: number, to?: number):
|
|
36
|
+
getComplianceReport(streamId?: string, from?: number, to?: number): import("rxjs").Observable<Blob>;
|
|
37
37
|
/**
|
|
38
38
|
* Create PDF compliance report and send it by mail to the user's email
|
|
39
39
|
*/
|
package/dist/cjs/rest-utils.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare class RestUtils {
|
|
|
4
4
|
axiosInstance: AxiosInstance;
|
|
5
5
|
constructor(axiosInst: AxiosInstance);
|
|
6
6
|
upload<T>(file: File, url: string, ...params: string[]): void;
|
|
7
|
-
download(fileName: string, url: string, ...params: (string | undefined)[]):
|
|
7
|
+
download(fileName: string, url: string, ...params: (string | undefined)[]): Observable<Blob>;
|
|
8
8
|
get<T>(url: string, ...params: string[]): Observable<T>;
|
|
9
9
|
post<T>(url: string, body?: string, ...params: string[]): Observable<T>;
|
|
10
10
|
put<T>(url: string, body?: string, ...params: string[]): Observable<T>;
|
package/dist/cjs/rest-utils.js
CHANGED
|
@@ -22,30 +22,23 @@ class RestUtils {
|
|
|
22
22
|
// return this.http.request<T>(req);
|
|
23
23
|
//return this.http.request(req);
|
|
24
24
|
}
|
|
25
|
-
// Download is HTTP
|
|
25
|
+
// Download is an HTTP action whose response is a blob. For POST-style file exports the single
|
|
26
|
+
// argument is the serialized JSON request body (the connection list is too large for a query
|
|
27
|
+
// string), not query params; detect that case (a lone param starting with '{' or '[') and issue a
|
|
28
|
+
// POST-with-body blob request instead. Query-param callers (k=v strings) keep the GET behavior
|
|
29
|
+
// (SHIEL-7328 Case 3, Path B — lives in the hand-maintained rest-utils so it survives regen).
|
|
26
30
|
download(fileName, url, ...params) {
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// }
|
|
39
|
-
// });
|
|
40
|
-
// // Set content type for: json / csv / xml / pdf /xslx
|
|
41
|
-
// let contentType = this.getMimeType(downloadLink);
|
|
42
|
-
//
|
|
43
|
-
// return this.http.get(resourceUrl, {
|
|
44
|
-
// responseType: 'blob',
|
|
45
|
-
// reportProgress: true,
|
|
46
|
-
// observe: 'events',
|
|
47
|
-
// headers: new HttpHeaders({ 'Content-Type': contentType })
|
|
48
|
-
// });
|
|
31
|
+
const definedParams = params.filter((p) => p !== undefined);
|
|
32
|
+
// POST-with-body export: a single JSON object/array param is the request body, not a query param.
|
|
33
|
+
if (definedParams.length === 1 && /^\s*[{[]/.test(definedParams[0])) {
|
|
34
|
+
return (0, rxjs_1.defer)(() => this.axiosInstance.post(url, definedParams[0], {
|
|
35
|
+
responseType: 'blob',
|
|
36
|
+
headers: { 'Content-Type': 'application/json' },
|
|
37
|
+
})).pipe((0, rxjs_1.map)((result) => result.data));
|
|
38
|
+
}
|
|
39
|
+
const resourceUrl = this.buildUrl(url, ...definedParams);
|
|
40
|
+
return (0, rxjs_1.defer)(() => this.axiosInstance.get(resourceUrl, { responseType: 'blob' }))
|
|
41
|
+
.pipe((0, rxjs_1.map)((result) => result.data));
|
|
49
42
|
}
|
|
50
43
|
// HTTP GET action
|
|
51
44
|
get(url, ...params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-utils.js","sourceRoot":"","sources":["../../src/rest-utils.ts"],"names":[],"mappings":";;;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B,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,gCAAgC;IACxB,QAAQ,CAAC,GAAW,EAAE,GAAG,MAAgB;QAC/C,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC1G,CAAC;IAED,2CAA2C;IACnC,WAAW,CAAC,QAAgB;QAClC,qDAAqD;QACrD,IAAI,WAAW,GAAG,kBAAkB,CAAC;QACrC,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3C,WAAW,GAAG,UAAU,CAAC;QAC3B,CAAC;aAAM,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAClD,WAAW,GAAG,UAAU,CAAC;QAC3B,CAAC;aAAM,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAClD,WAAW,GAAG,iBAAiB,CAAC;QAClC,CAAC;aAAM,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACnD,WAAW,GAAG,mEAAmE,CAAA;QACnF,CAAC;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;CACF;AArGD,8BAqGC"}
|
|
@@ -52,5 +52,5 @@ export declare class SysAccountsService {
|
|
|
52
52
|
/**
|
|
53
53
|
* Export accounts reports by query to a file
|
|
54
54
|
*/
|
|
55
|
-
export(format?: string, search?: string, type?: AccountTypeCode[], status?: AccountStatusCode[], sort?: string, page?: number, size?: number):
|
|
55
|
+
export(format?: string, search?: string, type?: AccountTypeCode[], status?: AccountStatusCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
56
56
|
}
|
|
@@ -32,11 +32,11 @@ export declare class UsrAlertsService {
|
|
|
32
32
|
/**
|
|
33
33
|
* Export alerts by query to a file
|
|
34
34
|
*/
|
|
35
|
-
export(format?: string, streamId?: string, deviceId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number):
|
|
35
|
+
export(format?: string, streamId?: string, deviceId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
36
36
|
/**
|
|
37
37
|
* Export alerts source file as stream of source file (pcap)
|
|
38
38
|
*/
|
|
39
|
-
exportSource(id?: string):
|
|
39
|
+
exportSource(id?: string): import("rxjs").Observable<Blob>;
|
|
40
40
|
/**
|
|
41
41
|
* Apply status on alert
|
|
42
42
|
*/
|
|
@@ -53,7 +53,7 @@ export declare class UsrDevicesService {
|
|
|
53
53
|
/**
|
|
54
54
|
* Export devices by query to a file as a stream of CSV | JSON | XML | XLSX
|
|
55
55
|
*/
|
|
56
|
-
export(format?: string, streamId?: string, search?: string, from?: number, to?: number, type?: DeviceTypeCode[], tag?: string[], status?: DeviceStatusCode[], risk?: SeverityTypeCode[], sort?: string, page?: number, size?: number):
|
|
56
|
+
export(format?: string, streamId?: string, search?: string, from?: number, to?: number, type?: DeviceTypeCode[], tag?: string[], status?: DeviceStatusCode[], risk?: SeverityTypeCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
57
57
|
/**
|
|
58
58
|
* Upload device list from csv file
|
|
59
59
|
*/
|
|
@@ -31,11 +31,11 @@ export declare class UsrEventsService {
|
|
|
31
31
|
/**
|
|
32
32
|
* Export events by query to a file in a stream of CSV | JSON | XML | XLSX
|
|
33
33
|
*/
|
|
34
|
-
export(format?: string, streamId?: string, deviceId?: string, alertId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number):
|
|
34
|
+
export(format?: string, streamId?: string, deviceId?: string, alertId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
35
35
|
/**
|
|
36
36
|
* Export event source file as a stream of source file (pcap)
|
|
37
37
|
*/
|
|
38
|
-
exportSource(id?: string):
|
|
38
|
+
exportSource(id?: string): import("rxjs").Observable<Blob>;
|
|
39
39
|
/**
|
|
40
40
|
* Get top 10 events by their severity and time
|
|
41
41
|
*/
|
|
@@ -27,7 +27,7 @@ export declare class UsrPrivateTopologyService {
|
|
|
27
27
|
/**
|
|
28
28
|
* Export the device list for the given connections as a file
|
|
29
29
|
*/
|
|
30
|
-
exportDevices(format?: string, body?: PrivateTopologyDevicesParams):
|
|
30
|
+
exportDevices(format?: string, body?: PrivateTopologyDevicesParams): import("rxjs").Observable<Blob>;
|
|
31
31
|
/**
|
|
32
32
|
* Get the sessions-per-day timeline for the given connections
|
|
33
33
|
*/
|
|
@@ -33,7 +33,7 @@ export declare class UsrReportsService {
|
|
|
33
33
|
/**
|
|
34
34
|
* Create PDF compliance report
|
|
35
35
|
*/
|
|
36
|
-
getComplianceReport(streamId?: string, from?: number, to?: number):
|
|
36
|
+
getComplianceReport(streamId?: string, from?: number, to?: number): import("rxjs").Observable<Blob>;
|
|
37
37
|
/**
|
|
38
38
|
* Create PDF compliance report and send it by mail to the user's email
|
|
39
39
|
*/
|
package/dist/esm/rest-utils.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare class RestUtils {
|
|
|
4
4
|
axiosInstance: AxiosInstance;
|
|
5
5
|
constructor(axiosInst: AxiosInstance);
|
|
6
6
|
upload<T>(file: File, url: string, ...params: string[]): void;
|
|
7
|
-
download(fileName: string, url: string, ...params: (string | undefined)[]):
|
|
7
|
+
download(fileName: string, url: string, ...params: (string | undefined)[]): Observable<Blob>;
|
|
8
8
|
get<T>(url: string, ...params: string[]): Observable<T>;
|
|
9
9
|
post<T>(url: string, body?: string, ...params: string[]): Observable<T>;
|
|
10
10
|
put<T>(url: string, body?: string, ...params: string[]): Observable<T>;
|
package/dist/esm/rest-utils.js
CHANGED
|
@@ -19,30 +19,23 @@ export class RestUtils {
|
|
|
19
19
|
// return this.http.request<T>(req);
|
|
20
20
|
//return this.http.request(req);
|
|
21
21
|
}
|
|
22
|
-
// Download is HTTP
|
|
22
|
+
// Download is an HTTP action whose response is a blob. For POST-style file exports the single
|
|
23
|
+
// argument is the serialized JSON request body (the connection list is too large for a query
|
|
24
|
+
// string), not query params; detect that case (a lone param starting with '{' or '[') and issue a
|
|
25
|
+
// POST-with-body blob request instead. Query-param callers (k=v strings) keep the GET behavior
|
|
26
|
+
// (SHIEL-7328 Case 3, Path B — lives in the hand-maintained rest-utils so it survives regen).
|
|
23
27
|
download(fileName, url, ...params) {
|
|
24
|
-
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// }
|
|
36
|
-
// });
|
|
37
|
-
// // Set content type for: json / csv / xml / pdf /xslx
|
|
38
|
-
// let contentType = this.getMimeType(downloadLink);
|
|
39
|
-
//
|
|
40
|
-
// return this.http.get(resourceUrl, {
|
|
41
|
-
// responseType: 'blob',
|
|
42
|
-
// reportProgress: true,
|
|
43
|
-
// observe: 'events',
|
|
44
|
-
// headers: new HttpHeaders({ 'Content-Type': contentType })
|
|
45
|
-
// });
|
|
28
|
+
const definedParams = params.filter((p) => p !== undefined);
|
|
29
|
+
// POST-with-body export: a single JSON object/array param is the request body, not a query param.
|
|
30
|
+
if (definedParams.length === 1 && /^\s*[{[]/.test(definedParams[0])) {
|
|
31
|
+
return defer(() => this.axiosInstance.post(url, definedParams[0], {
|
|
32
|
+
responseType: 'blob',
|
|
33
|
+
headers: { 'Content-Type': 'application/json' },
|
|
34
|
+
})).pipe(map((result) => result.data));
|
|
35
|
+
}
|
|
36
|
+
const resourceUrl = this.buildUrl(url, ...definedParams);
|
|
37
|
+
return defer(() => this.axiosInstance.get(resourceUrl, { responseType: 'blob' }))
|
|
38
|
+
.pipe(map((result) => result.data));
|
|
46
39
|
}
|
|
47
40
|
// HTTP GET action
|
|
48
41
|
get(url, ...params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-utils.js","sourceRoot":"","sources":["../../src/rest-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE9C,4DAA4D;AAC5D,MAAM,OAAO,SAAS;IAIpB,mDAAmD;IACnD,YAAY,SAAwB;QAClC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;IACjC,CAAC;IAED,yDAAyD;IACzD,MAAM,CAAI,IAAU,EAAE,GAAW,EAAE,GAAG,MAAgB;QAEpD,qDAAqD;QACrD,EAAE;QACF,6CAA6C;QAC7C,+CAA+C;QAC/C,EAAE;QACF,+DAA+D;QAC/D,2BAA2B;QAC3B,0BAA0B;QAC1B,MAAM;QACN,oCAAoC;QACpC,gCAAgC;IAClC,CAAC;IAED,
|
|
1
|
+
{"version":3,"file":"rest-utils.js","sourceRoot":"","sources":["../../src/rest-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,GAAG,EA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C,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3C,WAAW,GAAG,UAAU,CAAC;QAC3B,CAAC;aAAM,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAClD,WAAW,GAAG,UAAU,CAAC;QAC3B,CAAC;aAAM,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAClD,WAAW,GAAG,iBAAiB,CAAC;QAClC,CAAC;aAAM,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACnD,WAAW,GAAG,mEAAmE,CAAA;QACnF,CAAC;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;CACF"}
|
|
@@ -52,5 +52,5 @@ export declare class SysAccountsService {
|
|
|
52
52
|
/**
|
|
53
53
|
* Export accounts reports by query to a file
|
|
54
54
|
*/
|
|
55
|
-
export(format?: string, search?: string, type?: AccountTypeCode[], status?: AccountStatusCode[], sort?: string, page?: number, size?: number):
|
|
55
|
+
export(format?: string, search?: string, type?: AccountTypeCode[], status?: AccountStatusCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
56
56
|
}
|
|
@@ -32,11 +32,11 @@ export declare class UsrAlertsService {
|
|
|
32
32
|
/**
|
|
33
33
|
* Export alerts by query to a file
|
|
34
34
|
*/
|
|
35
|
-
export(format?: string, streamId?: string, deviceId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number):
|
|
35
|
+
export(format?: string, streamId?: string, deviceId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
36
36
|
/**
|
|
37
37
|
* Export alerts source file as stream of source file (pcap)
|
|
38
38
|
*/
|
|
39
|
-
exportSource(id?: string):
|
|
39
|
+
exportSource(id?: string): import("rxjs").Observable<Blob>;
|
|
40
40
|
/**
|
|
41
41
|
* Apply status on alert
|
|
42
42
|
*/
|
|
@@ -53,7 +53,7 @@ export declare class UsrDevicesService {
|
|
|
53
53
|
/**
|
|
54
54
|
* Export devices by query to a file as a stream of CSV | JSON | XML | XLSX
|
|
55
55
|
*/
|
|
56
|
-
export(format?: string, streamId?: string, search?: string, from?: number, to?: number, type?: DeviceTypeCode[], tag?: string[], status?: DeviceStatusCode[], risk?: SeverityTypeCode[], sort?: string, page?: number, size?: number):
|
|
56
|
+
export(format?: string, streamId?: string, search?: string, from?: number, to?: number, type?: DeviceTypeCode[], tag?: string[], status?: DeviceStatusCode[], risk?: SeverityTypeCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
57
57
|
/**
|
|
58
58
|
* Upload device list from csv file
|
|
59
59
|
*/
|
|
@@ -31,11 +31,11 @@ export declare class UsrEventsService {
|
|
|
31
31
|
/**
|
|
32
32
|
* Export events by query to a file in a stream of CSV | JSON | XML | XLSX
|
|
33
33
|
*/
|
|
34
|
-
export(format?: string, streamId?: string, deviceId?: string, alertId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number):
|
|
34
|
+
export(format?: string, streamId?: string, deviceId?: string, alertId?: string, search?: string, from?: number, to?: number, type?: EventTypeCode[], severity?: SeverityTypeCode[], category?: EventCategoryCode[], status?: EventStatusCode[], ruleId?: string[], targetIp?: string, ruleType?: RuleTypeCode[], sort?: string, page?: number, size?: number): import("rxjs").Observable<Blob>;
|
|
35
35
|
/**
|
|
36
36
|
* Export event source file as a stream of source file (pcap)
|
|
37
37
|
*/
|
|
38
|
-
exportSource(id?: string):
|
|
38
|
+
exportSource(id?: string): import("rxjs").Observable<Blob>;
|
|
39
39
|
/**
|
|
40
40
|
* Get top 10 events by their severity and time
|
|
41
41
|
*/
|
|
@@ -27,7 +27,7 @@ export declare class UsrPrivateTopologyService {
|
|
|
27
27
|
/**
|
|
28
28
|
* Export the device list for the given connections as a file
|
|
29
29
|
*/
|
|
30
|
-
exportDevices(format?: string, body?: PrivateTopologyDevicesParams):
|
|
30
|
+
exportDevices(format?: string, body?: PrivateTopologyDevicesParams): import("rxjs").Observable<Blob>;
|
|
31
31
|
/**
|
|
32
32
|
* Get the sessions-per-day timeline for the given connections
|
|
33
33
|
*/
|
|
@@ -33,7 +33,7 @@ export declare class UsrReportsService {
|
|
|
33
33
|
/**
|
|
34
34
|
* Create PDF compliance report
|
|
35
35
|
*/
|
|
36
|
-
getComplianceReport(streamId?: string, from?: number, to?: number):
|
|
36
|
+
getComplianceReport(streamId?: string, from?: number, to?: number): import("rxjs").Observable<Blob>;
|
|
37
37
|
/**
|
|
38
38
|
* Create PDF compliance report and send it by mail to the user's email
|
|
39
39
|
*/
|
|
@@ -4,7 +4,7 @@ export declare class RestUtils {
|
|
|
4
4
|
axiosInstance: AxiosInstance;
|
|
5
5
|
constructor(axiosInst: AxiosInstance);
|
|
6
6
|
upload<T>(file: File, url: string, ...params: string[]): void;
|
|
7
|
-
download(fileName: string, url: string, ...params: (string | undefined)[]):
|
|
7
|
+
download(fileName: string, url: string, ...params: (string | undefined)[]): Observable<Blob>;
|
|
8
8
|
get<T>(url: string, ...params: string[]): Observable<T>;
|
|
9
9
|
post<T>(url: string, body?: string, ...params: string[]): Observable<T>;
|
|
10
10
|
put<T>(url: string, body?: string, ...params: string[]): Observable<T>;
|