@edgeiq/edgeiq-api-js 1.10.0 → 1.11.1
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/deviceConfigs/models.d.ts +30 -4
- package/dist/deviceTypes/models.d.ts +1 -6
- package/dist/gatewayCommands/models.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/networkInterfaceReports/index.d.ts +9 -0
- package/dist/networkInterfaceReports/index.js +96 -0
- package/dist/networkInterfaceReports/models.d.ts +92 -0
- package/dist/networkInterfaceReports/models.js +1 -0
- package/dist/testConstants.js +0 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Base, Filter, Filters, Pagination } from '../models';
|
|
2
|
+
export declare type ConnectionType = 'cellular' | 'ethernet_lan' | 'ethernet_wan' | 'ethernet_wan_lan' | 'wifi';
|
|
2
3
|
export declare type ModemPreferredNetworkType = '2G' | '3G' | '5G' | 'LTE' | 'AUTO';
|
|
3
4
|
export declare type ApnAuthType = 'none' | 'PAP' | 'CHAP' | 'PAP_CHAP';
|
|
4
5
|
export declare type ApnType = 'default' | 'MMS' | 'SUPL' | 'HIPRI' | 'FOTA' | 'CBS' | 'XCAP';
|
|
@@ -58,9 +59,9 @@ export interface ConnectionConfig {
|
|
|
58
59
|
wifi_hidden?: number;
|
|
59
60
|
}
|
|
60
61
|
export interface Connection {
|
|
61
|
-
type: string;
|
|
62
62
|
name: string;
|
|
63
|
-
|
|
63
|
+
type: ConnectionType;
|
|
64
|
+
config?: ConnectionConfig;
|
|
64
65
|
}
|
|
65
66
|
export interface IPTableAction {
|
|
66
67
|
action?: string;
|
|
@@ -75,18 +76,43 @@ export interface IPTableAction {
|
|
|
75
76
|
destination?: string;
|
|
76
77
|
jump?: string;
|
|
77
78
|
}
|
|
79
|
+
export interface DataCollection {
|
|
80
|
+
enabled: boolean;
|
|
81
|
+
frequency_seconds: number;
|
|
82
|
+
interfaces: string[];
|
|
83
|
+
}
|
|
84
|
+
export interface LatencyTest extends DataCollection {
|
|
85
|
+
hosts: string[];
|
|
86
|
+
type: string;
|
|
87
|
+
options: {
|
|
88
|
+
count: number;
|
|
89
|
+
packet_size: number;
|
|
90
|
+
timeout_seconds: number;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export interface PerformanceTest extends DataCollection {
|
|
94
|
+
type: string;
|
|
95
|
+
options: {
|
|
96
|
+
servers: string[];
|
|
97
|
+
download: boolean;
|
|
98
|
+
upload: boolean;
|
|
99
|
+
timeout_seconds: number;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
78
102
|
export interface DeviceConfigInput {
|
|
103
|
+
company_id: string;
|
|
79
104
|
name: string;
|
|
80
|
-
device_type_id: string;
|
|
81
105
|
connections?: Connection[];
|
|
82
106
|
iptables?: (IPTableAction | undefined)[];
|
|
83
107
|
last_notification_id?: string;
|
|
108
|
+
interface_data_collection?: DataCollection;
|
|
109
|
+
latency_test?: LatencyTest;
|
|
110
|
+
performance_test?: PerformanceTest;
|
|
84
111
|
}
|
|
85
112
|
export interface DeviceConfig extends DeviceConfigInput, Base {
|
|
86
113
|
}
|
|
87
114
|
export interface DeviceConfigsFilters extends Filters {
|
|
88
115
|
name?: Filter;
|
|
89
|
-
device_type_id?: Filter;
|
|
90
116
|
}
|
|
91
117
|
export interface PaginatedDeviceConfigs {
|
|
92
118
|
deviceConfigs: DeviceConfig[];
|
|
@@ -2,11 +2,6 @@ import { AwsThingGroup } from '../models';
|
|
|
2
2
|
import { Base, Filter, Filters, Pagination } from '../models';
|
|
3
3
|
export declare type TypeDeviceType = 'gateway' | 'sensor' | 'cloud_native' | 'modem' | 'lwm2m';
|
|
4
4
|
export declare type DeviceTypeRole = 'gateway' | 'endpoint';
|
|
5
|
-
export interface NetworkConnection {
|
|
6
|
-
type: string;
|
|
7
|
-
interface?: string;
|
|
8
|
-
name: string;
|
|
9
|
-
}
|
|
10
5
|
export interface Peripheral {
|
|
11
6
|
type: string;
|
|
12
7
|
device: string;
|
|
@@ -70,7 +65,6 @@ export interface SMSATCommands {
|
|
|
70
65
|
export interface Capabilities {
|
|
71
66
|
actions: Actions;
|
|
72
67
|
iptables: boolean;
|
|
73
|
-
network_connections: NetworkConnection[];
|
|
74
68
|
firmware: Firmware;
|
|
75
69
|
peripherals: Peripheral[];
|
|
76
70
|
sms_at_commands?: SMSATCommands;
|
|
@@ -102,6 +96,7 @@ export interface DeviceTypeInput {
|
|
|
102
96
|
important_metadata?: ImportantMetadata[];
|
|
103
97
|
device_integration_id?: string;
|
|
104
98
|
cloud_native_integration_id?: string;
|
|
99
|
+
device_network_config_id?: string;
|
|
105
100
|
}
|
|
106
101
|
export interface DeviceType extends DeviceTypeInput, Base {
|
|
107
102
|
}
|
|
@@ -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;
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { GatewayCommands } from './gatewayCommands';
|
|
|
21
21
|
export { Ingestors } from './ingestors';
|
|
22
22
|
export { Integrations } from './integrations';
|
|
23
23
|
export { LWM2M } from './lwm2m';
|
|
24
|
+
export { NetworkInterfaceReports } from './networkInterfaceReports';
|
|
24
25
|
export { Notifications } from './notifications';
|
|
25
26
|
export { PollableAttributes } from './pollableAttributes';
|
|
26
27
|
export { Regions } from './regions';
|
|
@@ -66,6 +67,7 @@ export * from './ingestors/models';
|
|
|
66
67
|
export * from './integrations/models';
|
|
67
68
|
export * from './lwm2m/models';
|
|
68
69
|
export * from './log/models';
|
|
70
|
+
export * from './networkInterfaceReports/models';
|
|
69
71
|
export * from './notifications/models';
|
|
70
72
|
export * from './pollableAttributes/models';
|
|
71
73
|
export * from './reports/models';
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export { GatewayCommands } from './gatewayCommands';
|
|
|
21
21
|
export { Ingestors } from './ingestors';
|
|
22
22
|
export { Integrations } from './integrations';
|
|
23
23
|
export { LWM2M } from './lwm2m';
|
|
24
|
+
export { NetworkInterfaceReports } from './networkInterfaceReports';
|
|
24
25
|
export { Notifications } from './notifications';
|
|
25
26
|
export { PollableAttributes } from './pollableAttributes';
|
|
26
27
|
export { Regions } from './regions';
|
|
@@ -66,6 +67,7 @@ export * from './ingestors/models';
|
|
|
66
67
|
export * from './integrations/models';
|
|
67
68
|
export * from './lwm2m/models';
|
|
68
69
|
export * from './log/models';
|
|
70
|
+
export * from './networkInterfaceReports/models';
|
|
69
71
|
export * from './notifications/models';
|
|
70
72
|
export * from './pollableAttributes/models';
|
|
71
73
|
export * from './reports/models';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NetworkInterfaceAllReports, NetworkInterfaceInfo, NetworkInterfaceLatencyReport, NetworkInterfacePerformanceReport, NetworkInterfaceReport } from './models';
|
|
2
|
+
declare const NetworkInterfaceReports: {
|
|
3
|
+
getDeviceNetworkInterfaceReport: (id: string) => Promise<NetworkInterfaceReport>;
|
|
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
|
+
getDeviceNetworkInterfaceAllReports: (device_id: string, interface_name: string) => Promise<NetworkInterfaceAllReports>;
|
|
8
|
+
};
|
|
9
|
+
export { NetworkInterfaceReports };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { EdgeIQAPI } from '..';
|
|
11
|
+
import { isApiError } from '../helpers';
|
|
12
|
+
const NetworkInterfaceReports = {
|
|
13
|
+
getDeviceNetworkInterfaceReport: (id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
try {
|
|
15
|
+
const axios = EdgeIQAPI.getAxios();
|
|
16
|
+
const result = yield axios.get(`network_interfaces_reports/${id}`);
|
|
17
|
+
return result === null || result === void 0 ? void 0 : result.data;
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (isApiError(error)) {
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}),
|
|
26
|
+
getDeviceNetworkInterfaceInfo: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
var _a;
|
|
28
|
+
try {
|
|
29
|
+
const axios = EdgeIQAPI.getAxios();
|
|
30
|
+
const result = yield axios.get(`network_interface_infos?device_id=${device_id}&interface_name=${interface_name}`);
|
|
31
|
+
return (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a[0];
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (isApiError(error)) {
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
getDeviceNetworkInterfaceLatency: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
var _b;
|
|
42
|
+
try {
|
|
43
|
+
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];
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (isApiError(error)) {
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
}),
|
|
54
|
+
getDeviceNetworkPerformance: (device_id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
+
var _c;
|
|
56
|
+
try {
|
|
57
|
+
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];
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (isApiError(error)) {
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
}),
|
|
68
|
+
getDeviceNetworkInterfaceAllReports: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
+
var _d, _e, _f, _g;
|
|
70
|
+
try {
|
|
71
|
+
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
|
+
}
|
|
83
|
+
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],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (isApiError(error)) {
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}),
|
|
95
|
+
};
|
|
96
|
+
export { NetworkInterfaceReports };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Base, Filter, Filters } from '../models';
|
|
2
|
+
export interface NetworkInterfaceReport extends Base {
|
|
3
|
+
device_id: string;
|
|
4
|
+
device_unique_id: string;
|
|
5
|
+
device_class: string;
|
|
6
|
+
device_type_id: string;
|
|
7
|
+
gateway_command_id: string;
|
|
8
|
+
traceparent: string;
|
|
9
|
+
arrived_at: string;
|
|
10
|
+
internet_reachable: boolean;
|
|
11
|
+
default_dns: string;
|
|
12
|
+
default_route_interface_name: string;
|
|
13
|
+
default_route_ip_address: string;
|
|
14
|
+
routing_table: {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface NetworkInterfaceInfo extends Base {
|
|
19
|
+
network_interfaces_report_id: string;
|
|
20
|
+
device_id: string;
|
|
21
|
+
device_type_id: string;
|
|
22
|
+
gateway_command_id: string;
|
|
23
|
+
arrived_at: string;
|
|
24
|
+
traceparent: string;
|
|
25
|
+
default: boolean;
|
|
26
|
+
link_status: string;
|
|
27
|
+
interface_name: string;
|
|
28
|
+
interface_type: string;
|
|
29
|
+
interface_mac_address: string;
|
|
30
|
+
cellular_strength: string;
|
|
31
|
+
cellular_mode: string;
|
|
32
|
+
ipv4_enabled: boolean;
|
|
33
|
+
ipv4_address: string;
|
|
34
|
+
ipv4_netmask: string;
|
|
35
|
+
ipv4_gateway: string;
|
|
36
|
+
ipv4_dns: string;
|
|
37
|
+
ipv6_enabled: boolean;
|
|
38
|
+
ipv6_address: string;
|
|
39
|
+
ipv6_netmask: string;
|
|
40
|
+
ipv6_gateway: string;
|
|
41
|
+
ipv6_dns: string;
|
|
42
|
+
bytes_sent: number;
|
|
43
|
+
bytes_received: number;
|
|
44
|
+
packets_sent: number;
|
|
45
|
+
packets_received: number;
|
|
46
|
+
packets_sent_errors: number;
|
|
47
|
+
packets_received_errors: number;
|
|
48
|
+
}
|
|
49
|
+
export interface NetworkInterfaceLatencyReport extends Base {
|
|
50
|
+
device_id: string;
|
|
51
|
+
device_unique_id: string;
|
|
52
|
+
device_class: string;
|
|
53
|
+
device_type_id: string;
|
|
54
|
+
gateway_command_id: string;
|
|
55
|
+
interface_name: string;
|
|
56
|
+
arrived_at: string;
|
|
57
|
+
traceparent: string;
|
|
58
|
+
type: string;
|
|
59
|
+
host: string;
|
|
60
|
+
packets_sent: number;
|
|
61
|
+
packets_received: number;
|
|
62
|
+
packet_loss_percent: number;
|
|
63
|
+
min_latency_ms: number;
|
|
64
|
+
max_latency_ms: number;
|
|
65
|
+
avg_latency_ms: number;
|
|
66
|
+
}
|
|
67
|
+
export interface NetworkInterfacePerformanceReport extends Base {
|
|
68
|
+
device_id: string;
|
|
69
|
+
device_unique_id: string;
|
|
70
|
+
device_class: string;
|
|
71
|
+
device_type_id: string;
|
|
72
|
+
gateway_command_id: string;
|
|
73
|
+
arrived_at: string;
|
|
74
|
+
traceparent: string;
|
|
75
|
+
type: string;
|
|
76
|
+
server_id: string;
|
|
77
|
+
latency_ms: number;
|
|
78
|
+
jitter_ms: number;
|
|
79
|
+
packet_loss_percent: number;
|
|
80
|
+
download_speed_mbps: number;
|
|
81
|
+
upload_speed_mbps: number;
|
|
82
|
+
test_duration_seconds: number;
|
|
83
|
+
}
|
|
84
|
+
export interface NetworkInterfaceAllReports {
|
|
85
|
+
info?: NetworkInterfaceInfo;
|
|
86
|
+
latency?: NetworkInterfaceLatencyReport;
|
|
87
|
+
report?: NetworkInterfaceReport;
|
|
88
|
+
}
|
|
89
|
+
export interface NetworkInterfaceFilters extends Filters {
|
|
90
|
+
device_id?: Filter;
|
|
91
|
+
interface_name?: Filter;
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/testConstants.js
CHANGED
|
@@ -160,7 +160,6 @@ const deviceTypeCapabilities = {
|
|
|
160
160
|
upgrade: false,
|
|
161
161
|
},
|
|
162
162
|
iptables: false,
|
|
163
|
-
network_connections: [],
|
|
164
163
|
peripherals: [],
|
|
165
164
|
};
|
|
166
165
|
export const EmptyDeviceType = Object.assign(Object.assign({}, baseModel), { capabilities: deviceTypeCapabilities, manufacturer: '', model: '', name: '', type: 'cloud_native', role: 'endpoint' });
|