@edgeiq/edgeiq-api-js 1.11.0 → 1.11.2

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.
@@ -1,6 +1,6 @@
1
1
  import { Base, Filter, Filters, Pagination } from '../models';
2
2
  import { RetryOptions } from '../retryOptions/models';
3
- export declare type GatewayCommandType = 'activate_cloud_native_device' | 'backup' | 'data_restriction' | 'deactivate_cloud_native_device' | 'disable_data_restriction' | 'enable_data_restriction' | 'greengrass_initialize' | 'awsiot_attach_thing_groups' | 'awsiot_detach_thing_groups' | 'cancel_password_change' | 'file_from_device' | 'file_to_device' | 'heartbeat' | 'log_level' | 'log_upload' | 'lwm2m_request' | 'lwm2m_file' | 'restore_backup' | 'reboot' | 'reset' | 'send_config' | 'setting' | 'setting_fetch' | 'software_update' | 'software_version' | 'status';
3
+ export declare type GatewayCommandType = 'activate_cloud_native_device' | 'backup' | 'data_restriction' | 'deactivate_cloud_native_device' | 'disable_data_restriction' | 'enable_data_restriction' | 'greengrass_initialize' | 'awsiot_attach_thing_groups' | 'awsiot_detach_thing_groups' | 'cancel_password_change' | 'file_from_device' | 'file_to_device' | 'heartbeat' | 'log_level' | 'log_upload' | 'lwm2m_request' | 'lwm2m_file' | 'network_connectivity_info' | 'network_connectivity_latency_test' | 'network_connectivity_performance_test' | 'restore_backup' | 'reboot' | 'reset' | 'send_config' | 'setting' | 'setting_fetch' | 'software_update' | 'software_version' | 'status';
4
4
  export declare type CommandType = 'download' | 'fileupload' | 'filedownload' | 'execute' | 'observe' | 'observe_stop' | 'read' | 'upload' | 'write';
5
5
  export interface CommandSchedule {
6
6
  start_datetime: string;
@@ -29,6 +29,7 @@ export interface GatewayCommandRequest {
29
29
  filepath?: string;
30
30
  file_id?: string;
31
31
  configuration_id?: string;
32
+ device_config_id?: string;
32
33
  retry_options?: RetryOptions;
33
34
  }
34
35
  export interface Lwm2mRequest extends GatewayCommandRequest {
@@ -1,9 +1,9 @@
1
- import { NetworkInterfaceAllReports, NetworkInterfaceInfo, NetworkInterfaceReport } from './models';
1
+ import { NetworkInterfaceAllReports, NetworkInterfaceInfo, NetworkInterfaceLatencyReport, NetworkInterfacePerformanceReport, NetworkInterfaceReport } from './models';
2
2
  declare const NetworkInterfaceReports: {
3
3
  getDeviceNetworkInterfaceReport: (id: string) => Promise<NetworkInterfaceReport>;
4
- getDeviceNetworkInterfaceInfo: (device_id: string, interface_name: string) => Promise<NetworkInterfaceInfo>;
5
- getDeviceNetworkInterfaceLatency: (device_id: string, interface_name: string) => Promise<NetworkInterfaceInfo>;
6
- getDeviceNetworkInterfacePerformance: (device_id: string, interface_name: string) => Promise<NetworkInterfaceInfo>;
4
+ getDeviceNetworkInterfaceInfo: (device_id: string, interface_name?: string | undefined) => Promise<NetworkInterfaceInfo>;
5
+ getDeviceNetworkInterfaceLatency: (device_id: string, interface_name?: string | undefined) => Promise<NetworkInterfaceLatencyReport>;
6
+ getDeviceNetworkPerformance: (device_id: string) => Promise<NetworkInterfacePerformanceReport>;
7
7
  getDeviceNetworkInterfaceAllReports: (device_id: string, interface_name: string) => Promise<NetworkInterfaceAllReports>;
8
8
  };
9
9
  export { NetworkInterfaceReports };
@@ -11,11 +11,10 @@ import { EdgeIQAPI } from '..';
11
11
  import { isApiError } from '../helpers';
12
12
  const NetworkInterfaceReports = {
13
13
  getDeviceNetworkInterfaceReport: (id) => __awaiter(void 0, void 0, void 0, function* () {
14
- var _a;
15
14
  try {
16
15
  const axios = EdgeIQAPI.getAxios();
17
- const result = yield axios.get(`network_interface_reports/${id}`);
18
- return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.resources;
16
+ const result = yield axios.get(`network_interfaces_reports/${id}`);
17
+ return result === null || result === void 0 ? void 0 : result.data;
19
18
  }
20
19
  catch (error) {
21
20
  if (isApiError(error)) {
@@ -25,11 +24,11 @@ const NetworkInterfaceReports = {
25
24
  }
26
25
  }),
27
26
  getDeviceNetworkInterfaceInfo: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
28
- var _b;
27
+ var _a;
29
28
  try {
30
29
  const axios = EdgeIQAPI.getAxios();
31
30
  const result = yield axios.get(`network_interface_infos?device_id=${device_id}&interface_name=${interface_name}`);
32
- return (_b = result === null || result === void 0 ? void 0 : result.data) === null || _b === void 0 ? void 0 : _b.resources;
31
+ return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a[0];
33
32
  }
34
33
  catch (error) {
35
34
  if (isApiError(error)) {
@@ -39,11 +38,11 @@ const NetworkInterfaceReports = {
39
38
  }
40
39
  }),
41
40
  getDeviceNetworkInterfaceLatency: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
42
- var _c;
41
+ var _b;
43
42
  try {
44
43
  const axios = EdgeIQAPI.getAxios();
45
- const result = yield axios.get(`network_interface_latency_reports?device_id=${device_id}&interface_name=${interface_name}`);
46
- return (_c = result === null || result === void 0 ? void 0 : result.data) === null || _c === void 0 ? void 0 : _c.resources;
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];
47
46
  }
48
47
  catch (error) {
49
48
  if (isApiError(error)) {
@@ -52,12 +51,12 @@ const NetworkInterfaceReports = {
52
51
  throw error;
53
52
  }
54
53
  }),
55
- getDeviceNetworkInterfacePerformance: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
56
- var _d;
54
+ getDeviceNetworkPerformance: (device_id) => __awaiter(void 0, void 0, void 0, function* () {
55
+ var _c;
57
56
  try {
58
57
  const axios = EdgeIQAPI.getAxios();
59
- const result = yield axios.get(`network_interface_performance_reports?device_id=${device_id}&interface_name=${interface_name}`);
60
- return (_d = result === null || result === void 0 ? void 0 : result.data) === null || _d === void 0 ? void 0 : _d.resources;
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];
61
60
  }
62
61
  catch (error) {
63
62
  if (isApiError(error)) {
@@ -67,26 +66,23 @@ const NetworkInterfaceReports = {
67
66
  }
68
67
  }),
69
68
  getDeviceNetworkInterfaceAllReports: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
70
- var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
69
+ var _d, _e, _f, _g;
71
70
  try {
72
71
  const axios = EdgeIQAPI.getAxios();
73
72
  const info = yield axios.get(`network_interface_infos?device_id=${device_id}&interface_name=${interface_name}`);
74
73
  const latency = yield axios.get(`network_interface_latency_reports?device_id=${device_id}&interface_name=${interface_name}`);
75
- const performance = yield axios.get(`network_interface_performance_reports?device_id=${device_id}&interface_name=${interface_name}`);
76
- if (((_e = info === null || info === void 0 ? void 0 : info.data) === null || _e === void 0 ? void 0 : _e.resources) && ((_f = info === null || info === void 0 ? void 0 : info.data) === null || _f === void 0 ? void 0 : _f.resources[0])) {
77
- const infoData = (_g = info === null || info === void 0 ? void 0 : info.data) === null || _g === void 0 ? void 0 : _g.resources[0];
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];
78
76
  const report = yield axios.get(`network_interface_reports/${infoData.network_interfaces_report_id}`);
79
77
  return {
80
- info: (_j = (_h = info === null || info === void 0 ? void 0 : info.data) === null || _h === void 0 ? void 0 : _h.resources) === null || _j === void 0 ? void 0 : _j[0],
81
- latency: (_l = (_k = latency === null || latency === void 0 ? void 0 : latency.data) === null || _k === void 0 ? void 0 : _k.resources) === null || _l === void 0 ? void 0 : _l[0],
82
- performance: (_o = (_m = performance === null || performance === void 0 ? void 0 : performance.data) === null || _m === void 0 ? void 0 : _m.resources) === null || _o === void 0 ? void 0 : _o[0],
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],
83
80
  report: report === null || report === void 0 ? void 0 : report.data,
84
81
  };
85
82
  }
86
83
  return {
87
- info: (_q = (_p = info === null || info === void 0 ? void 0 : info.data) === null || _p === void 0 ? void 0 : _p.resources) === null || _q === void 0 ? void 0 : _q[0],
88
- latency: (_s = (_r = latency === null || latency === void 0 ? void 0 : latency.data) === null || _r === void 0 ? void 0 : _r.resources) === null || _s === void 0 ? void 0 : _s[0],
89
- performance: (_u = (_t = performance === null || performance === void 0 ? void 0 : performance.data) === null || _t === void 0 ? void 0 : _t.resources) === null || _u === void 0 ? void 0 : _u[0],
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],
90
86
  };
91
87
  }
92
88
  catch (error) {
@@ -70,7 +70,6 @@ export interface NetworkInterfacePerformanceReport extends Base {
70
70
  device_class: string;
71
71
  device_type_id: string;
72
72
  gateway_command_id: string;
73
- interface_name: string;
74
73
  arrived_at: string;
75
74
  traceparent: string;
76
75
  type: string;
@@ -83,9 +82,8 @@ export interface NetworkInterfacePerformanceReport extends Base {
83
82
  test_duration_seconds: number;
84
83
  }
85
84
  export interface NetworkInterfaceAllReports {
86
- info: NetworkInterfaceInfo;
87
- latency: NetworkInterfaceLatencyReport;
88
- performance: NetworkInterfacePerformanceReport;
85
+ info?: NetworkInterfaceInfo;
86
+ latency?: NetworkInterfaceLatencyReport;
89
87
  report?: NetworkInterfaceReport;
90
88
  }
91
89
  export interface NetworkInterfaceFilters extends Filters {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgeiq/edgeiq-api-js",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "author": "EdgeIQ",
5
5
  "license": "ISC",
6
6
  "description": "This project presents EdgeIQ API SDK.",