@edgeiq/edgeiq-api-js 1.9.9 → 1.11.0
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/constants.d.ts +2 -0
- package/dist/constants.js +2 -0
- package/dist/deviceConfigs/models.d.ts +30 -4
- package/dist/deviceEvents/index.d.ts +8 -0
- package/dist/deviceEvents/index.js +58 -0
- package/dist/deviceEvents/models.d.ts +16 -0
- package/dist/deviceEvents/models.js +1 -0
- package/dist/deviceTypes/models.d.ts +1 -6
- package/dist/devices/models.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/networkInterfaceReports/index.d.ts +9 -0
- package/dist/networkInterfaceReports/index.js +100 -0
- package/dist/networkInterfaceReports/models.d.ts +94 -0
- package/dist/networkInterfaceReports/models.js +1 -0
- package/dist/testConstants.js +0 -1
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export declare const BaseEndpoints: {
|
|
|
64
64
|
configuration: string;
|
|
65
65
|
deviceConfig: string;
|
|
66
66
|
deviceError: string;
|
|
67
|
+
deviceEvent: string;
|
|
67
68
|
deviceTransferRequest: string;
|
|
68
69
|
deviceTemplate: string;
|
|
69
70
|
deviceType: string;
|
|
@@ -118,6 +119,7 @@ export declare const Endpoints: {
|
|
|
118
119
|
company: string;
|
|
119
120
|
configuration: string;
|
|
120
121
|
deviceConfig: string;
|
|
122
|
+
deviceEvent: string;
|
|
121
123
|
deviceError: string;
|
|
122
124
|
deviceTransferRequest: string;
|
|
123
125
|
deviceTemplate: string;
|
package/dist/constants.js
CHANGED
|
@@ -66,6 +66,7 @@ export const BaseEndpoints = {
|
|
|
66
66
|
configuration: 'configurations',
|
|
67
67
|
deviceConfig: 'device_configs',
|
|
68
68
|
deviceError: 'device_errors',
|
|
69
|
+
deviceEvent: 'device_events',
|
|
69
70
|
deviceTransferRequest: 'device_transfer_requests',
|
|
70
71
|
deviceTemplate: 'device_templates',
|
|
71
72
|
deviceType: 'device_types',
|
|
@@ -120,6 +121,7 @@ export const Endpoints = {
|
|
|
120
121
|
company: `${BaseEndpoints.company}`,
|
|
121
122
|
configuration: `${BaseEndpoints.configuration}`,
|
|
122
123
|
deviceConfig: `${BaseEndpoints.deviceConfig}`,
|
|
124
|
+
deviceEvent: `${BaseEndpoints.deviceEvent}`,
|
|
123
125
|
deviceError: `${BaseEndpoints.deviceError}`,
|
|
124
126
|
deviceTransferRequest: `${BaseEndpoints.deviceTransferRequest}`,
|
|
125
127
|
deviceTemplate: `${BaseEndpoints.deviceTemplate}`,
|
|
@@ -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[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PaginationFilter } from '../models';
|
|
2
|
+
import { DeviceEvent, DeviceEventsFilters, PaginatedDeviceEvents } from './models';
|
|
3
|
+
interface DeviceEventsInterface {
|
|
4
|
+
list(filters?: DeviceEventsFilters, pagination?: PaginationFilter): Promise<PaginatedDeviceEvents>;
|
|
5
|
+
getOneById(id: string): Promise<DeviceEvent>;
|
|
6
|
+
}
|
|
7
|
+
export declare const DeviceEvents: DeviceEventsInterface;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { Endpoints } from '../constants';
|
|
12
|
+
import { BaseModelClass } from '../core/ModelClass';
|
|
13
|
+
import { parseFilters } from '../filtersParser';
|
|
14
|
+
import { isApiError } from '../helpers';
|
|
15
|
+
export const DeviceEvents = class extends BaseModelClass {
|
|
16
|
+
static list(filters, pagination) {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
try {
|
|
20
|
+
this.logAction(`Listing device events with following filters: ${filters !== null && filters !== void 0 ? filters : '{}'}.\n And pagination ${pagination !== null && pagination !== void 0 ? pagination : '{}'}`);
|
|
21
|
+
const axios = EdgeIQAPI.getAxios();
|
|
22
|
+
const result = yield axios.get(Endpoints.deviceEvent, {
|
|
23
|
+
params: parseFilters(filters, pagination),
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
deviceEvents: (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.resources,
|
|
27
|
+
pagination: {
|
|
28
|
+
page: (_b = result === null || result === void 0 ? void 0 : result.data) === null || _b === void 0 ? void 0 : _b.page,
|
|
29
|
+
itemsPerPage: (_c = result === null || result === void 0 ? void 0 : result.data) === null || _c === void 0 ? void 0 : _c.per_page,
|
|
30
|
+
total: (_d = result === null || result === void 0 ? void 0 : result.data) === null || _d === void 0 ? void 0 : _d.total,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (isApiError(error)) {
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
static getOneById(id) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
try {
|
|
45
|
+
this.logAction(`Getting DeviceEvent with id: ${id}`);
|
|
46
|
+
const axios = EdgeIQAPI.getAxios();
|
|
47
|
+
const result = yield axios.get(`${Endpoints.deviceEvent}/${id}`);
|
|
48
|
+
return result === null || result === void 0 ? void 0 : result.data;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
if (isApiError(error)) {
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DeviceClass } from '../devices/models';
|
|
2
|
+
import { Base, Filter, Filters, Pagination } from '../models';
|
|
3
|
+
export declare type DeviceEventType = 'create' | 'connect' | 'delete' | 'disconnect' | 'heartbeat_status_change' | 'password_change_successful' | 'register' | 'touch' | 'update_edge_version';
|
|
4
|
+
export interface DeviceEvent extends Base {
|
|
5
|
+
device_class: DeviceClass;
|
|
6
|
+
device_event_type: DeviceEventType;
|
|
7
|
+
unique_id: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DeviceEventsFilters extends Filters {
|
|
10
|
+
device_event_type?: Filter;
|
|
11
|
+
unique_id?: Filter;
|
|
12
|
+
}
|
|
13
|
+
export interface PaginatedDeviceEvents {
|
|
14
|
+
deviceEvents: DeviceEvent[];
|
|
15
|
+
pagination: Pagination;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
}
|
package/dist/devices/models.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { DeviceConfigs } from './deviceConfigs';
|
|
|
9
9
|
export { DeviceLocationObservations } from './deviceLocationObservations';
|
|
10
10
|
export { Devices } from './devices';
|
|
11
11
|
export { DeviceErrors } from './deviceErrors';
|
|
12
|
+
export { DeviceEvents } from './deviceEvents';
|
|
12
13
|
export { DeviceTemplates } from './deviceTemplates';
|
|
13
14
|
export { DeviceTransferRequests } from './deviceTransferRequests';
|
|
14
15
|
export { DeviceTypes } from './deviceTypes';
|
|
@@ -20,6 +21,7 @@ export { GatewayCommands } from './gatewayCommands';
|
|
|
20
21
|
export { Ingestors } from './ingestors';
|
|
21
22
|
export { Integrations } from './integrations';
|
|
22
23
|
export { LWM2M } from './lwm2m';
|
|
24
|
+
export { NetworkInterfaceReports } from './networkInterfaceReports';
|
|
23
25
|
export { Notifications } from './notifications';
|
|
24
26
|
export { PollableAttributes } from './pollableAttributes';
|
|
25
27
|
export { Regions } from './regions';
|
|
@@ -53,6 +55,7 @@ export * from './deviceLocationObservations/models';
|
|
|
53
55
|
export * from './devices/models';
|
|
54
56
|
export * from './discoveredDevices/models';
|
|
55
57
|
export * from './deviceErrors/models';
|
|
58
|
+
export * from './deviceEvents/models';
|
|
56
59
|
export * from './deviceTemplates/models';
|
|
57
60
|
export * from './deviceTransferRequests/models';
|
|
58
61
|
export * from './deviceTypes/models';
|
|
@@ -64,6 +67,7 @@ export * from './ingestors/models';
|
|
|
64
67
|
export * from './integrations/models';
|
|
65
68
|
export * from './lwm2m/models';
|
|
66
69
|
export * from './log/models';
|
|
70
|
+
export * from './networkInterfaceReports/models';
|
|
67
71
|
export * from './notifications/models';
|
|
68
72
|
export * from './pollableAttributes/models';
|
|
69
73
|
export * from './reports/models';
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { DeviceConfigs } from './deviceConfigs';
|
|
|
9
9
|
export { DeviceLocationObservations } from './deviceLocationObservations';
|
|
10
10
|
export { Devices } from './devices';
|
|
11
11
|
export { DeviceErrors } from './deviceErrors';
|
|
12
|
+
export { DeviceEvents } from './deviceEvents';
|
|
12
13
|
export { DeviceTemplates } from './deviceTemplates';
|
|
13
14
|
export { DeviceTransferRequests } from './deviceTransferRequests';
|
|
14
15
|
export { DeviceTypes } from './deviceTypes';
|
|
@@ -20,6 +21,7 @@ export { GatewayCommands } from './gatewayCommands';
|
|
|
20
21
|
export { Ingestors } from './ingestors';
|
|
21
22
|
export { Integrations } from './integrations';
|
|
22
23
|
export { LWM2M } from './lwm2m';
|
|
24
|
+
export { NetworkInterfaceReports } from './networkInterfaceReports';
|
|
23
25
|
export { Notifications } from './notifications';
|
|
24
26
|
export { PollableAttributes } from './pollableAttributes';
|
|
25
27
|
export { Regions } from './regions';
|
|
@@ -53,6 +55,7 @@ export * from './deviceLocationObservations/models';
|
|
|
53
55
|
export * from './devices/models';
|
|
54
56
|
export * from './discoveredDevices/models';
|
|
55
57
|
export * from './deviceErrors/models';
|
|
58
|
+
export * from './deviceEvents/models';
|
|
56
59
|
export * from './deviceTemplates/models';
|
|
57
60
|
export * from './deviceTransferRequests/models';
|
|
58
61
|
export * from './deviceTypes/models';
|
|
@@ -64,6 +67,7 @@ export * from './ingestors/models';
|
|
|
64
67
|
export * from './integrations/models';
|
|
65
68
|
export * from './lwm2m/models';
|
|
66
69
|
export * from './log/models';
|
|
70
|
+
export * from './networkInterfaceReports/models';
|
|
67
71
|
export * from './notifications/models';
|
|
68
72
|
export * from './pollableAttributes/models';
|
|
69
73
|
export * from './reports/models';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NetworkInterfaceAllReports, NetworkInterfaceInfo, NetworkInterfaceReport } from './models';
|
|
2
|
+
declare const NetworkInterfaceReports: {
|
|
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>;
|
|
7
|
+
getDeviceNetworkInterfaceAllReports: (device_id: string, interface_name: string) => Promise<NetworkInterfaceAllReports>;
|
|
8
|
+
};
|
|
9
|
+
export { NetworkInterfaceReports };
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
var _a;
|
|
15
|
+
try {
|
|
16
|
+
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;
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
if (isApiError(error)) {
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
getDeviceNetworkInterfaceInfo: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
var _b;
|
|
29
|
+
try {
|
|
30
|
+
const axios = EdgeIQAPI.getAxios();
|
|
31
|
+
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;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (isApiError(error)) {
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}),
|
|
41
|
+
getDeviceNetworkInterfaceLatency: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
+
var _c;
|
|
43
|
+
try {
|
|
44
|
+
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;
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
if (isApiError(error)) {
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
getDeviceNetworkInterfacePerformance: (device_id, interface_name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
var _d;
|
|
57
|
+
try {
|
|
58
|
+
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;
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (isApiError(error)) {
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
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;
|
|
71
|
+
try {
|
|
72
|
+
const axios = EdgeIQAPI.getAxios();
|
|
73
|
+
const info = yield axios.get(`network_interface_infos?device_id=${device_id}&interface_name=${interface_name}`);
|
|
74
|
+
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];
|
|
78
|
+
const report = yield axios.get(`network_interface_reports/${infoData.network_interfaces_report_id}`);
|
|
79
|
+
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],
|
|
83
|
+
report: report === null || report === void 0 ? void 0 : report.data,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
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],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
if (isApiError(error)) {
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
};
|
|
100
|
+
export { NetworkInterfaceReports };
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
interface_name: string;
|
|
74
|
+
arrived_at: string;
|
|
75
|
+
traceparent: string;
|
|
76
|
+
type: string;
|
|
77
|
+
server_id: string;
|
|
78
|
+
latency_ms: number;
|
|
79
|
+
jitter_ms: number;
|
|
80
|
+
packet_loss_percent: number;
|
|
81
|
+
download_speed_mbps: number;
|
|
82
|
+
upload_speed_mbps: number;
|
|
83
|
+
test_duration_seconds: number;
|
|
84
|
+
}
|
|
85
|
+
export interface NetworkInterfaceAllReports {
|
|
86
|
+
info: NetworkInterfaceInfo;
|
|
87
|
+
latency: NetworkInterfaceLatencyReport;
|
|
88
|
+
performance: NetworkInterfacePerformanceReport;
|
|
89
|
+
report?: NetworkInterfaceReport;
|
|
90
|
+
}
|
|
91
|
+
export interface NetworkInterfaceFilters extends Filters {
|
|
92
|
+
device_id?: Filter;
|
|
93
|
+
interface_name?: Filter;
|
|
94
|
+
}
|
|
@@ -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' });
|