@edgeiq/edgeiq-api-js 1.9.6 → 1.9.8
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/companies/index.js +3 -2
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -4
- package/dist/deviceTypes/models.d.ts +4 -3
- package/dist/devices/index.js +3 -2
- package/dist/discoveredDevices/index.js +3 -2
- package/dist/files/index.js +3 -2
- package/dist/softwareUpdates/index.js +3 -2
- package/dist/testConstants.js +48 -0
- package/package.json +1 -1
package/dist/companies/index.js
CHANGED
|
@@ -8,7 +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
|
+
import { Endpoints, FILE_UPLOAD_TIMEOUT } from '../constants';
|
|
12
12
|
import { BaseModelClass } from '../core/ModelClass';
|
|
13
13
|
import { parseFilters } from '../filtersParser';
|
|
14
14
|
import { getReturnDeleteMessage, isApiError, parseResourceError, } from '../helpers';
|
|
@@ -158,13 +158,14 @@ export const Companies = class extends BaseModelClass {
|
|
|
158
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
159
159
|
try {
|
|
160
160
|
this.logAction(`Updating logo of company with id ${id}`);
|
|
161
|
-
const axios = EdgeIQAPI.getAxios(
|
|
161
|
+
const axios = EdgeIQAPI.getAxios();
|
|
162
162
|
const form = new FormData();
|
|
163
163
|
form.append('file', logo);
|
|
164
164
|
const result = yield axios.post(`${Endpoints.company}/${id}/logo`, form, {
|
|
165
165
|
headers: {
|
|
166
166
|
'Content-Type': 'multipart/form-data',
|
|
167
167
|
},
|
|
168
|
+
timeout: FILE_UPLOAD_TIMEOUT,
|
|
168
169
|
});
|
|
169
170
|
return result === null || result === void 0 ? void 0 : result.data;
|
|
170
171
|
}
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
package/dist/core/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class EdgeIQAPI {
|
|
|
12
12
|
private static instance;
|
|
13
13
|
constructor();
|
|
14
14
|
static init(options?: EdgeIQAPIOptions): void;
|
|
15
|
-
static getAxios(
|
|
15
|
+
static getAxios(): AxiosInstance;
|
|
16
16
|
static setSessionToken(token: string): void;
|
|
17
17
|
static logAction(message: string): void;
|
|
18
18
|
static logError(error: string): void;
|
package/dist/core/index.js
CHANGED
|
@@ -35,10 +35,7 @@ export class EdgeIQAPI {
|
|
|
35
35
|
return handleResponseError(error);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
static getAxios(
|
|
39
|
-
if (forFileUpload) {
|
|
40
|
-
return Object.assign(Object.assign({}, EdgeIQAPI.axios), { defaults: Object.assign(Object.assign({}, EdgeIQAPI.axios.defaults), { timeout: 300000 }) });
|
|
41
|
-
}
|
|
38
|
+
static getAxios() {
|
|
42
39
|
return EdgeIQAPI.axios;
|
|
43
40
|
}
|
|
44
41
|
static setSessionToken(token) {
|
|
@@ -41,6 +41,7 @@ export interface Actions {
|
|
|
41
41
|
log_upload: boolean;
|
|
42
42
|
lwm2m_request: boolean;
|
|
43
43
|
mqtt: boolean;
|
|
44
|
+
network_connectivity_monitoring: boolean;
|
|
44
45
|
notification: boolean;
|
|
45
46
|
opcua: boolean;
|
|
46
47
|
provision_marmon_button: boolean;
|
|
@@ -67,11 +68,11 @@ export interface SMSATCommands {
|
|
|
67
68
|
send_config_commands: string[];
|
|
68
69
|
}
|
|
69
70
|
export interface Capabilities {
|
|
70
|
-
|
|
71
|
-
peripherals: Peripheral[];
|
|
71
|
+
actions: Actions;
|
|
72
72
|
iptables: boolean;
|
|
73
|
+
network_connections: NetworkConnection[];
|
|
73
74
|
firmware: Firmware;
|
|
74
|
-
|
|
75
|
+
peripherals: Peripheral[];
|
|
75
76
|
sms_at_commands?: SMSATCommands;
|
|
76
77
|
observable_paths?: string[];
|
|
77
78
|
}
|
package/dist/devices/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { EdgeIQAPI, } from '..';
|
|
11
|
-
import { Endpoints, getAttachMessage } from '../constants';
|
|
11
|
+
import { Endpoints, FILE_UPLOAD_TIMEOUT, getAttachMessage } from '../constants';
|
|
12
12
|
import { BaseModelClass } from '../core/ModelClass';
|
|
13
13
|
import { parseFilters } from '../filtersParser';
|
|
14
14
|
import { getReturnDeleteMessage, isApiError } from '../helpers';
|
|
@@ -338,13 +338,14 @@ export const Devices = class extends BaseModelClass {
|
|
|
338
338
|
return __awaiter(this, void 0, void 0, function* () {
|
|
339
339
|
try {
|
|
340
340
|
this.logAction(`Uploading CSV file with devices`);
|
|
341
|
-
const axios = EdgeIQAPI.getAxios(
|
|
341
|
+
const axios = EdgeIQAPI.getAxios();
|
|
342
342
|
const form = new FormData();
|
|
343
343
|
form.append('gateway_csv_upload', file);
|
|
344
344
|
const result = yield axios.post(`${Endpoints.device}/csv_bulk_upload`, form, {
|
|
345
345
|
headers: {
|
|
346
346
|
'Content-Type': 'multipart/form-data',
|
|
347
347
|
},
|
|
348
|
+
timeout: FILE_UPLOAD_TIMEOUT,
|
|
348
349
|
});
|
|
349
350
|
return result === null || result === void 0 ? void 0 : result.data;
|
|
350
351
|
}
|
|
@@ -8,7 +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
|
+
import { Endpoints, FILE_UPLOAD_TIMEOUT } from '../constants';
|
|
12
12
|
import { BaseModelClass } from '../core/ModelClass';
|
|
13
13
|
import { parseFilters } from '../filtersParser';
|
|
14
14
|
import { getReturnDeleteMessage, isApiError } from '../helpers';
|
|
@@ -184,13 +184,14 @@ export const DiscoveredDevices = class extends BaseModelClass {
|
|
|
184
184
|
return __awaiter(this, void 0, void 0, function* () {
|
|
185
185
|
try {
|
|
186
186
|
this.logAction(`Uploading CSV bulk promotion file`);
|
|
187
|
-
const axios = EdgeIQAPI.getAxios(
|
|
187
|
+
const axios = EdgeIQAPI.getAxios();
|
|
188
188
|
const form = new FormData();
|
|
189
189
|
form.append('csv_upload', file);
|
|
190
190
|
const result = yield axios.post(`${Endpoints.discoveredDevice}/csv_bulk_upload_promote`, form, {
|
|
191
191
|
headers: {
|
|
192
192
|
'Content-Type': 'multipart/form-data',
|
|
193
193
|
},
|
|
194
|
+
timeout: FILE_UPLOAD_TIMEOUT,
|
|
194
195
|
});
|
|
195
196
|
return result === null || result === void 0 ? void 0 : result.data;
|
|
196
197
|
}
|
package/dist/files/index.js
CHANGED
|
@@ -8,7 +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
|
+
import { Endpoints, FILE_UPLOAD_TIMEOUT } from '../constants';
|
|
12
12
|
import { BaseModelClass } from '../core/ModelClass';
|
|
13
13
|
import { parseFilters } from '../filtersParser';
|
|
14
14
|
import { getReturnDeleteMessage, isApiError } from '../helpers';
|
|
@@ -109,13 +109,14 @@ export const EIQFiles = class extends BaseModelClass {
|
|
|
109
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
110
|
try {
|
|
111
111
|
this.logAction(`Uploading file to device`);
|
|
112
|
-
const axios = EdgeIQAPI.getAxios(
|
|
112
|
+
const axios = EdgeIQAPI.getAxios();
|
|
113
113
|
const form = new FormData();
|
|
114
114
|
form.append('file', file);
|
|
115
115
|
const result = yield axios.post(`${Endpoints.file}/${id}`, form, {
|
|
116
116
|
headers: {
|
|
117
117
|
'Content-Type': 'multipart/form-data',
|
|
118
118
|
},
|
|
119
|
+
timeout: FILE_UPLOAD_TIMEOUT,
|
|
119
120
|
});
|
|
120
121
|
return result === null || result === void 0 ? void 0 : result.data;
|
|
121
122
|
}
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { EdgeIQAPI } from '..';
|
|
11
|
-
import { Endpoints, getAttachMessage } from '../constants';
|
|
11
|
+
import { Endpoints, FILE_UPLOAD_TIMEOUT, getAttachMessage } from '../constants';
|
|
12
12
|
import { BaseModelClass } from '../core/ModelClass';
|
|
13
13
|
import { parseFilters } from '../filtersParser';
|
|
14
14
|
import { getReturnDeleteMessage, isApiError } from '../helpers';
|
|
@@ -208,13 +208,14 @@ export const SoftwareUpdates = class extends BaseModelClass {
|
|
|
208
208
|
return __awaiter(this, void 0, void 0, function* () {
|
|
209
209
|
try {
|
|
210
210
|
this.logAction(`Uploading file to software update`);
|
|
211
|
-
const axios = EdgeIQAPI.getAxios(
|
|
211
|
+
const axios = EdgeIQAPI.getAxios();
|
|
212
212
|
const form = new FormData();
|
|
213
213
|
files.forEach((file) => form.append('files[]', file));
|
|
214
214
|
const result = yield axios.post(`${Endpoints.softwareUpdate}/${id}/upload`, form, {
|
|
215
215
|
headers: {
|
|
216
216
|
'Content-Type': 'multipart/form-data',
|
|
217
217
|
},
|
|
218
|
+
timeout: FILE_UPLOAD_TIMEOUT,
|
|
218
219
|
});
|
|
219
220
|
return result === null || result === void 0 ? void 0 : result.data;
|
|
220
221
|
}
|
package/dist/testConstants.js
CHANGED
|
@@ -107,6 +107,54 @@ export const TestCompany = {
|
|
|
107
107
|
export const TestCompany2 = Object.assign(Object.assign({}, TestCompany), { _id: 'edgeiq_api_js_test_account_2', name: 'API Test Account 2' });
|
|
108
108
|
export const NewTestCompanyName = 'API Test Account updated';
|
|
109
109
|
const deviceTypeCapabilities = {
|
|
110
|
+
actions: {
|
|
111
|
+
activate_cloud_native_device: false,
|
|
112
|
+
aws_iot: false,
|
|
113
|
+
azure_iot: false,
|
|
114
|
+
backup: false,
|
|
115
|
+
bacnet: false,
|
|
116
|
+
bluemix_iot: false,
|
|
117
|
+
data_reset: false,
|
|
118
|
+
data_restore: false,
|
|
119
|
+
deactivate_cloud_native_device: false,
|
|
120
|
+
deploy_deployment: true,
|
|
121
|
+
disable_data_restriction: false,
|
|
122
|
+
email: false,
|
|
123
|
+
enable_data_restriction: false,
|
|
124
|
+
file_transfer: false,
|
|
125
|
+
greengrass_initialize: false,
|
|
126
|
+
greengrass_redeploy: false,
|
|
127
|
+
greengrass_restart: false,
|
|
128
|
+
heartbeat: true,
|
|
129
|
+
http_request: false,
|
|
130
|
+
log: true,
|
|
131
|
+
log_config: true,
|
|
132
|
+
log_level: true,
|
|
133
|
+
log_upload: true,
|
|
134
|
+
lwm2m_request: false,
|
|
135
|
+
mqtt: false,
|
|
136
|
+
network_connectivity_monitoring: false,
|
|
137
|
+
notification: false,
|
|
138
|
+
opcua: false,
|
|
139
|
+
provision_marmon_button: false,
|
|
140
|
+
prtg: false,
|
|
141
|
+
reboot: true,
|
|
142
|
+
relay: true,
|
|
143
|
+
remote_terminal: false,
|
|
144
|
+
request_deployment_status: false,
|
|
145
|
+
reset: false,
|
|
146
|
+
restore_backup: false,
|
|
147
|
+
send_config: true,
|
|
148
|
+
sms: false,
|
|
149
|
+
sms_at_command_status_request: false,
|
|
150
|
+
software_update: true,
|
|
151
|
+
software_version: true,
|
|
152
|
+
status: false,
|
|
153
|
+
tcp: false,
|
|
154
|
+
tcp_modbus: false,
|
|
155
|
+
update_edge: true,
|
|
156
|
+
update_firmware: true,
|
|
157
|
+
},
|
|
110
158
|
firmware: {
|
|
111
159
|
backup: false,
|
|
112
160
|
upgrade: false,
|