@mtgame/core 0.0.72 → 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.
@@ -2590,14 +2590,18 @@ var FileApi = /** @class */ (function () {
2590
2590
  this.httpClient = httpClient;
2591
2591
  this.configService = configService;
2592
2592
  }
2593
- FileApi.prototype.upload = function (fileData, filename) {
2593
+ FileApi.prototype.upload = function (fileData, filename, width, height) {
2594
2594
  return __awaiter(this, void 0, void 0, function () {
2595
- var formData;
2595
+ var params, formData;
2596
2596
  return __generator(this, function (_a) {
2597
+ params = new HttpParams();
2598
+ if (width && height) {
2599
+ params.set('width', width.toString()).set('height', height.toString());
2600
+ }
2597
2601
  formData = new FormData();
2598
2602
  formData.append('file', fileData, filename);
2599
2603
  return [2 /*return*/, this.httpClient
2600
- .post(this.configService.get('apiUrl') + "/api/v1/file/", formData)
2604
+ .post(this.configService.get('apiUrl') + "/api/v1/file/", formData, { params: params })
2601
2605
  .pipe(map(function (data) { return File.toFront(data); }))
2602
2606
  .toPromise()];
2603
2607
  });
@@ -8394,8 +8398,9 @@ function fileSizeValidator(maxFileSize) {
8394
8398
  }
8395
8399
 
8396
8400
  var HttpCookieInterceptor = /** @class */ (function () {
8397
- function HttpCookieInterceptor(injector, platformId) {
8401
+ function HttpCookieInterceptor(injector, configService, platformId) {
8398
8402
  this.injector = injector;
8403
+ this.configService = configService;
8399
8404
  this.platformId = platformId;
8400
8405
  this.isBrowser = isPlatformBrowser(this.platformId);
8401
8406
  }
@@ -8403,7 +8408,8 @@ var HttpCookieInterceptor = /** @class */ (function () {
8403
8408
  if (!this.isBrowser) {
8404
8409
  return next.handle(req);
8405
8410
  }
8406
- if (req.withCredentials !== false) {
8411
+ var apiUrl = this.configService.get('apiUrl');
8412
+ if (apiUrl === req.url.substr(0, apiUrl.length)) {
8407
8413
  req = req.clone({ withCredentials: true });
8408
8414
  }
8409
8415
  var csrf = getCookie('csrftoken');
@@ -8416,11 +8422,12 @@ var HttpCookieInterceptor = /** @class */ (function () {
8416
8422
  };
8417
8423
  HttpCookieInterceptor.ctorParameters = function () { return [
8418
8424
  { type: Injector },
8425
+ { type: ConfigService },
8419
8426
  { type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
8420
8427
  ]; };
8421
8428
  HttpCookieInterceptor = __decorate([
8422
8429
  Injectable(),
8423
- __param(1, Inject(PLATFORM_ID))
8430
+ __param(2, Inject(PLATFORM_ID))
8424
8431
  ], HttpCookieInterceptor);
8425
8432
  return HttpCookieInterceptor;
8426
8433
  }());