@shieldiot/ngx-pulseiot-lib 2.21.1447 → 2.21.1449
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.
|
@@ -4777,13 +4777,16 @@ function NewPrivateNetworkConnection() {
|
|
|
4777
4777
|
|
|
4778
4778
|
// PrivateTopologyDevicesParams request body for distinct device count, device list and export
|
|
4779
4779
|
class PrivateTopologyDevicesParams {
|
|
4780
|
-
constructor(streamId, connections, sort, page, size) {
|
|
4780
|
+
constructor(streamId, connections, snapshotTime, sort, page, size) {
|
|
4781
4781
|
if (streamId !== undefined) {
|
|
4782
4782
|
this.streamId = streamId;
|
|
4783
4783
|
}
|
|
4784
4784
|
if (connections !== undefined) {
|
|
4785
4785
|
this.connections = connections;
|
|
4786
4786
|
}
|
|
4787
|
+
if (snapshotTime !== undefined) {
|
|
4788
|
+
this.snapshotTime = snapshotTime;
|
|
4789
|
+
}
|
|
4787
4790
|
if (sort !== undefined) {
|
|
4788
4791
|
this.sort = sort;
|
|
4789
4792
|
}
|
|
@@ -4800,6 +4803,7 @@ function NewPrivateTopologyDevicesParams() {
|
|
|
4800
4803
|
let result = new PrivateTopologyDevicesParams();
|
|
4801
4804
|
result.streamId = '';
|
|
4802
4805
|
result.connections = [];
|
|
4806
|
+
result.snapshotTime = 0;
|
|
4803
4807
|
result.sort = '';
|
|
4804
4808
|
result.page = 0;
|
|
4805
4809
|
result.size = 0;
|
|
@@ -4808,13 +4812,16 @@ function NewPrivateTopologyDevicesParams() {
|
|
|
4808
4812
|
|
|
4809
4813
|
// PrivateTopologyTimelineParams request body for sessions per day
|
|
4810
4814
|
class PrivateTopologyTimelineParams {
|
|
4811
|
-
constructor(streamId, connections, days) {
|
|
4815
|
+
constructor(streamId, connections, snapshotTime, days) {
|
|
4812
4816
|
if (streamId !== undefined) {
|
|
4813
4817
|
this.streamId = streamId;
|
|
4814
4818
|
}
|
|
4815
4819
|
if (connections !== undefined) {
|
|
4816
4820
|
this.connections = connections;
|
|
4817
4821
|
}
|
|
4822
|
+
if (snapshotTime !== undefined) {
|
|
4823
|
+
this.snapshotTime = snapshotTime;
|
|
4824
|
+
}
|
|
4818
4825
|
if (days !== undefined) {
|
|
4819
4826
|
this.days = days;
|
|
4820
4827
|
}
|
|
@@ -4825,6 +4832,7 @@ function NewPrivateTopologyTimelineParams() {
|
|
|
4825
4832
|
let result = new PrivateTopologyTimelineParams();
|
|
4826
4833
|
result.streamId = '';
|
|
4827
4834
|
result.connections = [];
|
|
4835
|
+
result.snapshotTime = 0;
|
|
4828
4836
|
result.days = 0;
|
|
4829
4837
|
return result;
|
|
4830
4838
|
}
|
|
@@ -4866,12 +4874,25 @@ class RestUtils {
|
|
|
4866
4874
|
});
|
|
4867
4875
|
return this.http.request(req);
|
|
4868
4876
|
}
|
|
4869
|
-
// Download is HTTP GET action
|
|
4877
|
+
// Download is an HTTP GET action whose response is a blob. For POST-style file exports the single
|
|
4878
|
+
// argument is the serialized JSON request body (the connection list is too large for a query
|
|
4879
|
+
// string), not query params; detect that case (a lone param starting with '{' or '[') and issue a
|
|
4880
|
+
// POST-with-body blob request instead. Query-param callers (k=v strings) are unaffected
|
|
4881
|
+
// (SHIEL-7328 Case 3, Path B — lives in the hand-maintained rest-utils so it survives regen).
|
|
4870
4882
|
download(fileName, url, ...params) {
|
|
4871
4883
|
// Query params are plain strings; a POST-style download may also pass a serialized body
|
|
4872
4884
|
// (string | undefined). Drop any undefined so URL building and the filename scan stay string-only
|
|
4873
4885
|
// (no-op for the existing all-string callers).
|
|
4874
4886
|
const definedParams = params.filter((p) => p !== undefined);
|
|
4887
|
+
// POST-with-body export: a single JSON-object/array param is the request body, not a query param.
|
|
4888
|
+
if (definedParams.length === 1 && /^\s*[{[]/.test(definedParams[0])) {
|
|
4889
|
+
return this.http.post(url, definedParams[0], {
|
|
4890
|
+
responseType: 'blob',
|
|
4891
|
+
reportProgress: true,
|
|
4892
|
+
observe: 'events',
|
|
4893
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json' })
|
|
4894
|
+
});
|
|
4895
|
+
}
|
|
4875
4896
|
const resourceUrl = this.buildUrl(url, ...definedParams);
|
|
4876
4897
|
let downloadLink = fileName;
|
|
4877
4898
|
// extract file name
|