@edgeiq/edgeiq-api-js 1.9.4 → 1.9.5

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.
@@ -158,7 +158,7 @@ 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(true);
162
162
  const form = new FormData();
163
163
  form.append('file', logo);
164
164
  const result = yield axios.post(`${Endpoints.company}/${id}/logo`, form, {
@@ -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(): AxiosInstance;
15
+ static getAxios(forFileUpload?: boolean): AxiosInstance;
16
16
  static setSessionToken(token: string): void;
17
17
  static logAction(message: string): void;
18
18
  static logError(error: string): void;
@@ -35,7 +35,10 @@ export class EdgeIQAPI {
35
35
  return handleResponseError(error);
36
36
  });
37
37
  }
38
- static getAxios() {
38
+ static getAxios(forFileUpload = false) {
39
+ if (forFileUpload) {
40
+ return Object.assign(Object.assign({}, EdgeIQAPI.axios), { defaults: Object.assign(Object.assign({}, EdgeIQAPI.axios.defaults), { timeout: 300000 }) });
41
+ }
39
42
  return EdgeIQAPI.axios;
40
43
  }
41
44
  static setSessionToken(token) {
@@ -338,7 +338,7 @@ 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(true);
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, {
@@ -184,7 +184,7 @@ 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(true);
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, {
@@ -109,7 +109,7 @@ 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(true);
113
113
  const form = new FormData();
114
114
  form.append('file', file);
115
115
  const result = yield axios.post(`${Endpoints.file}/${id}`, form, {
@@ -208,7 +208,7 @@ 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(true);
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, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgeiq/edgeiq-api-js",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "author": "EdgeIQ",
5
5
  "license": "ISC",
6
6
  "description": "This project presents EdgeIQ API SDK.",