@edgeiq/edgeiq-api-js 1.11.4 → 1.11.6

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.
@@ -5,6 +5,9 @@ export interface DeviceEvent extends Base {
5
5
  device_class: DeviceClass;
6
6
  device_event_type: DeviceEventType;
7
7
  unique_id: string;
8
+ metadata?: {
9
+ [key: string]: unknown;
10
+ };
8
11
  }
9
12
  export interface DeviceEventsFilters extends Filters {
10
13
  device_event_type?: Filter;
@@ -1,9 +1,11 @@
1
- import { NetworkInterfaceAllReports, NetworkInterfaceInfo, NetworkInterfaceLatencyReport, NetworkInterfacePerformanceReport, NetworkInterfaceReport } from './models';
1
+ import { NetworkInterfaceSummary, NetworkInterfaceInfo, NetworkInterfaceLatencyReport, NetworkInterfacePerformanceReport, NetworkInterfaceReport } from './models';
2
2
  declare const NetworkInterfaceReports: {
3
3
  getDeviceNetworkInterfaceReport: (id: string) => Promise<NetworkInterfaceReport>;
4
4
  getDeviceNetworkInterfaceInfo: (device_id: string, interface_name?: string | undefined) => Promise<NetworkInterfaceInfo>;
5
5
  getDeviceNetworkInterfaceLatency: (device_id: string, interface_name?: string | undefined) => Promise<NetworkInterfaceLatencyReport>;
6
6
  getDeviceNetworkInterfacePerformance: (device_id: string, interface_name?: string | undefined) => Promise<NetworkInterfacePerformanceReport>;
7
- getDeviceNetworkInterfaceAllReports: (device_id: string, interface_name: string) => Promise<NetworkInterfaceAllReports>;
7
+ getDeviceNetworkConnectivity: (device_id: string) => Promise<{
8
+ [key: string]: NetworkInterfaceSummary;
9
+ }>;
8
10
  };
9
11
  export { NetworkInterfaceReports };
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { EdgeIQAPI } from '..';
11
+ import { Endpoints } from '../constants';
11
12
  import { isApiError } from '../helpers';
12
13
  const ONE_RESULT_PAGING = `&page_meta=true&page=1&per_page=1`;
13
14
  const NetworkInterfaceReports = {
@@ -66,18 +67,11 @@ const NetworkInterfaceReports = {
66
67
  throw error;
67
68
  }
68
69
  }),
69
- getDeviceNetworkInterfaceAllReports: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
70
- var _g, _h, _j, _k, _l;
70
+ getDeviceNetworkConnectivity: (device_id) => __awaiter(void 0, void 0, void 0, function* () {
71
71
  try {
72
72
  const axios = EdgeIQAPI.getAxios();
73
- const info = yield axios.get(`network_interface_infos?device_id=${device_id}&interface_name=${interface_name}${ONE_RESULT_PAGING}`);
74
- const latency = yield axios.get(`network_interface_latency_reports?device_id=${device_id}&interface_name=${interface_name}${ONE_RESULT_PAGING}`);
75
- const performance = yield axios.get(`network_interface_performance_reports?device_id=${device_id}&interface_name=${interface_name}${ONE_RESULT_PAGING}`);
76
- return {
77
- info: (_h = (_g = info === null || info === void 0 ? void 0 : info.data) === null || _g === void 0 ? void 0 : _g.resources) === null || _h === void 0 ? void 0 : _h[0],
78
- latency: (_k = (_j = latency === null || latency === void 0 ? void 0 : latency.data) === null || _j === void 0 ? void 0 : _j.resources) === null || _k === void 0 ? void 0 : _k[0],
79
- performance: (_l = performance === null || performance === void 0 ? void 0 : performance.data.resources) === null || _l === void 0 ? void 0 : _l[0],
80
- };
73
+ const result = yield axios.get(`${Endpoints.device}/${device_id}/network_connectivity/latest`);
74
+ return result === null || result === void 0 ? void 0 : result.data;
81
75
  }
82
76
  catch (error) {
83
77
  if (isApiError(error)) {
@@ -91,11 +91,10 @@ export interface NetworkInterfacePerformanceReport extends Base {
91
91
  upload_speed_mbps: number;
92
92
  test_duration_seconds: number;
93
93
  }
94
- export interface NetworkInterfaceAllReports {
94
+ export interface NetworkInterfaceSummary {
95
95
  info?: NetworkInterfaceInfo;
96
- latency?: NetworkInterfaceLatencyReport;
97
- report?: NetworkInterfaceReport;
98
- performance?: NetworkInterfacePerformanceReport;
96
+ latency?: NetworkInterfaceLatencyReport[];
97
+ performance?: NetworkInterfacePerformanceReport[];
99
98
  }
100
99
  export interface NetworkInterfaceFilters extends Filters {
101
100
  device_id?: Filter;
@@ -1,6 +1,7 @@
1
1
  import { PaginationFilter } from '..';
2
- import { PaginatedSoftwareVersions, SoftwareVersionsFilters } from './models';
2
+ import { PaginatedSoftwareVersions, SoftwareVersion, SoftwareVersionsFilters } from './models';
3
3
  declare const SoftwareVersions: {
4
4
  list: (filters?: SoftwareVersionsFilters | undefined, pagination?: PaginationFilter | undefined) => Promise<PaginatedSoftwareVersions>;
5
+ listDistinctVersions: () => Promise<SoftwareVersion[]>;
5
6
  };
6
7
  export { SoftwareVersions };
@@ -36,5 +36,19 @@ const SoftwareVersions = {
36
36
  throw error;
37
37
  }
38
38
  }),
39
+ listDistinctVersions: () => __awaiter(void 0, void 0, void 0, function* () {
40
+ try {
41
+ EdgeIQAPI.logAction(`Getting software versions`);
42
+ const axios = EdgeIQAPI.getAxios();
43
+ const result = yield axios.get(`${Endpoints.softwareVersion}/distinct`);
44
+ return result === null || result === void 0 ? void 0 : result.data;
45
+ }
46
+ catch (error) {
47
+ if (isApiError(error)) {
48
+ throw error;
49
+ }
50
+ throw error;
51
+ }
52
+ }),
39
53
  };
40
54
  export { SoftwareVersions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgeiq/edgeiq-api-js",
3
- "version": "1.11.4",
3
+ "version": "1.11.6",
4
4
  "author": "EdgeIQ",
5
5
  "license": "ISC",
6
6
  "description": "This project presents EdgeIQ API SDK.",