@edgeiq/edgeiq-api-js 1.11.3 → 1.11.4

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.
@@ -3,7 +3,7 @@ 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
- getDeviceNetworkPerformance: (device_id: string) => Promise<NetworkInterfacePerformanceReport>;
6
+ getDeviceNetworkInterfacePerformance: (device_id: string, interface_name?: string | undefined) => Promise<NetworkInterfacePerformanceReport>;
7
7
  getDeviceNetworkInterfaceAllReports: (device_id: string, interface_name: string) => Promise<NetworkInterfaceAllReports>;
8
8
  };
9
9
  export { NetworkInterfaceReports };
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { EdgeIQAPI } from '..';
11
11
  import { isApiError } from '../helpers';
12
+ const ONE_RESULT_PAGING = `&page_meta=true&page=1&per_page=1`;
12
13
  const NetworkInterfaceReports = {
13
14
  getDeviceNetworkInterfaceReport: (id) => __awaiter(void 0, void 0, void 0, function* () {
14
15
  try {
@@ -24,11 +25,11 @@ const NetworkInterfaceReports = {
24
25
  }
25
26
  }),
26
27
  getDeviceNetworkInterfaceInfo: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
27
- var _a;
28
+ var _a, _b;
28
29
  try {
29
30
  const axios = EdgeIQAPI.getAxios();
30
- const result = yield axios.get(`network_interface_infos?device_id=${device_id}${interface_name ? `&interface_name=${interface_name}` : ''}`);
31
- return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a[0];
31
+ const result = yield axios.get(`network_interface_infos?device_id=${device_id}${interface_name ? `&interface_name=${interface_name}` : ''}${ONE_RESULT_PAGING}`);
32
+ return (_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.resources) === null || _b === void 0 ? void 0 : _b[0];
32
33
  }
33
34
  catch (error) {
34
35
  if (isApiError(error)) {
@@ -38,11 +39,11 @@ const NetworkInterfaceReports = {
38
39
  }
39
40
  }),
40
41
  getDeviceNetworkInterfaceLatency: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
41
- var _b;
42
+ var _c, _d;
42
43
  try {
43
44
  const axios = EdgeIQAPI.getAxios();
44
- const result = yield axios.get(`network_interface_latency_reports?device_id=${device_id}${interface_name ? `&interface_name=${interface_name}` : ''}`);
45
- return (_b = result === null || result === void 0 ? void 0 : result.data) === null || _b === void 0 ? void 0 : _b[0];
45
+ const result = yield axios.get(`network_interface_latency_reports?device_id=${device_id}${interface_name ? `&interface_name=${interface_name}` : ''}${ONE_RESULT_PAGING}`);
46
+ return (_d = (_c = result === null || result === void 0 ? void 0 : result.data) === null || _c === void 0 ? void 0 : _c.resources) === null || _d === void 0 ? void 0 : _d[0];
46
47
  }
47
48
  catch (error) {
48
49
  if (isApiError(error)) {
@@ -51,12 +52,12 @@ const NetworkInterfaceReports = {
51
52
  throw error;
52
53
  }
53
54
  }),
54
- getDeviceNetworkPerformance: (device_id) => __awaiter(void 0, void 0, void 0, function* () {
55
- var _c;
55
+ getDeviceNetworkInterfacePerformance: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
56
+ var _e, _f;
56
57
  try {
57
58
  const axios = EdgeIQAPI.getAxios();
58
- const result = yield axios.get(`network_interface_performance_reports?device_id=${device_id}`);
59
- return (_c = result === null || result === void 0 ? void 0 : result.data) === null || _c === void 0 ? void 0 : _c[0];
59
+ const result = yield axios.get(`network_interface_performance_reports?device_id=${device_id}${interface_name ? `&interface_name=${interface_name}` : ''}${ONE_RESULT_PAGING}`);
60
+ return (_f = (_e = result === null || result === void 0 ? void 0 : result.data) === null || _e === void 0 ? void 0 : _e.resources) === null || _f === void 0 ? void 0 : _f[0];
60
61
  }
61
62
  catch (error) {
62
63
  if (isApiError(error)) {
@@ -66,23 +67,16 @@ const NetworkInterfaceReports = {
66
67
  }
67
68
  }),
68
69
  getDeviceNetworkInterfaceAllReports: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
69
- var _d, _e, _f, _g;
70
+ var _g, _h, _j, _k, _l;
70
71
  try {
71
72
  const axios = EdgeIQAPI.getAxios();
72
- const info = yield axios.get(`network_interface_infos?device_id=${device_id}&interface_name=${interface_name}`);
73
- const latency = yield axios.get(`network_interface_latency_reports?device_id=${device_id}&interface_name=${interface_name}`);
74
- if ((info === null || info === void 0 ? void 0 : info.data) && (info === null || info === void 0 ? void 0 : info.data[0])) {
75
- const infoData = info === null || info === void 0 ? void 0 : info.data[0];
76
- const report = yield axios.get(`network_interface_reports/${infoData.network_interfaces_report_id}`);
77
- return {
78
- info: (_d = info === null || info === void 0 ? void 0 : info.data) === null || _d === void 0 ? void 0 : _d[0],
79
- latency: (_e = latency === null || latency === void 0 ? void 0 : latency.data) === null || _e === void 0 ? void 0 : _e[0],
80
- report: report === null || report === void 0 ? void 0 : report.data,
81
- };
82
- }
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}`);
83
76
  return {
84
- info: (_f = info === null || info === void 0 ? void 0 : info.data) === null || _f === void 0 ? void 0 : _f[0],
85
- latency: (_g = latency === null || latency === void 0 ? void 0 : latency.data) === null || _g === void 0 ? void 0 : _g[0],
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],
86
80
  };
87
81
  }
88
82
  catch (error) {
@@ -29,6 +29,16 @@ export interface NetworkInterfaceInfo extends Base {
29
29
  interface_mac_address: string;
30
30
  cellular_strength: string;
31
31
  cellular_mode: string;
32
+ cellular_modem_name: string;
33
+ cellular_modem_manufacturer: string;
34
+ cellular_modem_revision: string;
35
+ cellular_3gpp_imei: string;
36
+ cellular_3gpp_operator_code: string;
37
+ cellular_3gpp_operator_name: string;
38
+ cellular_3gpp_registration_state: string;
39
+ cellular_modem_additional_info: {
40
+ [key: string]: string;
41
+ };
32
42
  ipv4_enabled: boolean;
33
43
  ipv4_address: string;
34
44
  ipv4_netmask: string;
@@ -85,6 +95,7 @@ export interface NetworkInterfaceAllReports {
85
95
  info?: NetworkInterfaceInfo;
86
96
  latency?: NetworkInterfaceLatencyReport;
87
97
  report?: NetworkInterfaceReport;
98
+ performance?: NetworkInterfacePerformanceReport;
88
99
  }
89
100
  export interface NetworkInterfaceFilters extends Filters {
90
101
  device_id?: Filter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgeiq/edgeiq-api-js",
3
- "version": "1.11.3",
3
+ "version": "1.11.4",
4
4
  "author": "EdgeIQ",
5
5
  "license": "ISC",
6
6
  "description": "This project presents EdgeIQ API SDK.",