@mtgame/core 0.0.73 → 0.0.74

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/api/file-api.d.ts CHANGED
@@ -5,7 +5,7 @@ export declare class FileApi {
5
5
  private httpClient;
6
6
  private configService;
7
7
  constructor(httpClient: HttpClient, configService: ConfigService);
8
- upload(fileData: any, filename?: string): Promise<File>;
8
+ upload(fileData: any, filename?: string, width?: number, height?: number): Promise<File>;
9
9
  createZipArchive(files: {
10
10
  file: any;
11
11
  filename: string;
@@ -2803,14 +2803,18 @@
2803
2803
  this.httpClient = httpClient;
2804
2804
  this.configService = configService;
2805
2805
  }
2806
- FileApi.prototype.upload = function (fileData, filename) {
2806
+ FileApi.prototype.upload = function (fileData, filename, width, height) {
2807
2807
  return __awaiter(this, void 0, void 0, function () {
2808
- var formData;
2808
+ var params, formData;
2809
2809
  return __generator(this, function (_a) {
2810
+ params = new http.HttpParams();
2811
+ if (width && height) {
2812
+ params.set('width', width.toString()).set('height', height.toString());
2813
+ }
2810
2814
  formData = new FormData();
2811
2815
  formData.append('file', fileData, filename);
2812
2816
  return [2 /*return*/, this.httpClient
2813
- .post(this.configService.get('apiUrl') + "/api/v1/file/", formData)
2817
+ .post(this.configService.get('apiUrl') + "/api/v1/file/", formData, { params: params })
2814
2818
  .pipe(operators.map(function (data) { return File.toFront(data); }))
2815
2819
  .toPromise()];
2816
2820
  });