@edgeiq/edgeiq-api-js 1.4.19 → 1.5.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.
@@ -6,6 +6,7 @@ interface CompaniesInterface extends BaseModelInterface<Company, CompanyInput, C
6
6
  getFiles(id: string): Promise<EIQFile[]>;
7
7
  getDescendantsIds(id: string): Promise<string[]>;
8
8
  getAncestors(id: string): Promise<Company[]>;
9
+ uploadCompanyLogo(id: string, logo: File): Promise<string>;
9
10
  }
10
11
  export declare const Companies: CompaniesInterface;
11
12
  export {};
@@ -266,5 +266,35 @@ exports.Companies = (function (_super) {
266
266
  });
267
267
  });
268
268
  };
269
+ class_1.uploadCompanyLogo = function (id, logo) {
270
+ return __awaiter(this, void 0, void 0, function () {
271
+ var axios, form, result, error_9;
272
+ return __generator(this, function (_a) {
273
+ switch (_a.label) {
274
+ case 0:
275
+ _a.trys.push([0, 2, , 3]);
276
+ this.logAction("Updating logo of company with id " + id);
277
+ axios = __1.EdgeIQAPI.getAxios();
278
+ form = new FormData();
279
+ form.append('file', logo);
280
+ return [4, axios.post(constants_1.Endpoints.company + "/" + id + "/logo", form, {
281
+ headers: {
282
+ 'Content-Type': 'multipart/form-data',
283
+ },
284
+ })];
285
+ case 1:
286
+ result = _a.sent();
287
+ return [2, result === null || result === void 0 ? void 0 : result.data];
288
+ case 2:
289
+ error_9 = _a.sent();
290
+ if ((0, helpers_1.isApiError)(error_9)) {
291
+ throw error_9;
292
+ }
293
+ throw error_9;
294
+ case 3: return [2];
295
+ }
296
+ });
297
+ });
298
+ };
269
299
  return class_1;
270
300
  }(ModelClass_1.BaseModelClass));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgeiq/edgeiq-api-js",
3
- "version": "1.4.19",
3
+ "version": "1.5.0",
4
4
  "author": "EdgeIQ",
5
5
  "license": "ISC",
6
6
  "description": "This project presents EdgeIQ API SDK.",