@yuuvis/client-core 2.3.7 → 2.3.9

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.
@@ -1,9 +1,9 @@
1
1
  import * as i1 from '@ngx-translate/core';
2
2
  import { TranslateService, TranslateLoader, MissingTranslationHandler, TranslateModule } from '@ngx-translate/core';
3
3
  export { TranslateDirective, TranslateLoader, TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core';
4
- import { HttpErrorResponse, HttpClient, HttpHeaders, HttpParams, HttpRequest, HttpResponse, HttpEventType, provideHttpClient, withInterceptors } from '@angular/common/http';
4
+ import { HttpErrorResponse, HttpClient, HttpHeaders, HttpRequest, HttpParams, HttpResponse, HttpEventType, provideHttpClient, withInterceptors } from '@angular/common/http';
5
5
  import * as i0 from '@angular/core';
6
- import { inject, Injectable, InjectionToken, Inject, signal, Directive, Pipe, importProvidersFrom, provideAppInitializer } from '@angular/core';
6
+ import { inject, Injectable, InjectionToken, Inject, signal, Directive, Pipe, makeEnvironmentProviders, importProvidersFrom, provideAppInitializer } from '@angular/core';
7
7
  import { tap, finalize, shareReplay, catchError, map, switchMap, first, filter, scan, delay } from 'rxjs/operators';
8
8
  import { EMPTY, of, forkJoin, Observable, ReplaySubject, Subject, fromEvent, BehaviorSubject, tap as tap$1, map as map$1, merge, filter as filter$1, debounceTime, throwError, isObservable, switchMap as switchMap$1 } from 'rxjs';
9
9
  import { StorageMap } from '@ngx-pwa/local-storage';
@@ -1040,11 +1040,17 @@ class BackendService {
1040
1040
  * @param uri The target REST URI
1041
1041
  * @param formData FormData to be 'posted'
1042
1042
  * @param base The Base URI (backend service) to be used
1043
- * @param requestOptions Additional request options
1043
+ * @param requestOptions Additional request options (see HttpRequest for details)
1044
1044
  * @returns The return value of the target POST endpoint
1045
1045
  */
1046
1046
  postMultiPart(uri, formData, base, requestOptions) {
1047
- return this.#http.post(`${this.getApiBase(base)}${uri}`, formData, this.getHttpOptions(requestOptions));
1047
+ // Creating a multipart/form-data request like this ensures that the Content-Type is set correctly including
1048
+ // the multipart boundary which is required by the server to parse the request.
1049
+ // If we would set the Content-Type header to multipart/form-data manually the boundary would be missing
1050
+ // and the request would fail.
1051
+ // As our post method already sets the Content-Type to application/json we can't use it for multipart requests.
1052
+ const req = new HttpRequest('POST', `${this.getApiBase(base)}${uri}`, formData, requestOptions);
1053
+ return this.#http.request(req);
1048
1054
  }
1049
1055
  /**
1050
1056
  * Wrapped HTTP PATCH method
@@ -3762,6 +3768,18 @@ class DmsService {
3762
3768
  }))
3763
3769
  .pipe(this.triggerEvent(YuvEventType.DMS_OBJECT_LOADED, '', silent));
3764
3770
  }
3771
+ /**
3772
+ * Get tags of a dms object.
3773
+ * @param objectData Data field of the dms object
3774
+ */
3775
+ getDmsObjectTags(objectData) {
3776
+ return (objectData[BaseObjectTypeField.TAGS] || []).map((row) => ({
3777
+ name: row[0],
3778
+ state: row[1],
3779
+ creationDate: new Date(row[2]),
3780
+ traceId: row[3]
3781
+ }));
3782
+ }
3765
3783
  /**
3766
3784
  * Updates a tag on a dms object.
3767
3785
  * @param id The ID of the object
@@ -5452,7 +5470,7 @@ EoxTranslateJsonLoader = __decorate([
5452
5470
  ], EoxTranslateJsonLoader);
5453
5471
 
5454
5472
  const provideYuvClientCore = (options = { translations: [] }) => {
5455
- return [
5473
+ return makeEnvironmentProviders([
5456
5474
  importProvidersFrom(TranslateModule.forRoot()),
5457
5475
  provideHttpClient(withInterceptors([AuthInterceptorFnc, OfflineInterceptorFnc])),
5458
5476
  { provide: CORE_CONFIG, useClass: CoreConfig, deps: [CUSTOM_CONFIG] },
@@ -5477,7 +5495,7 @@ const provideYuvClientCore = (options = { translations: [] }) => {
5477
5495
  translations: options.translations
5478
5496
  }
5479
5497
  }
5480
- ];
5498
+ ]);
5481
5499
  };
5482
5500
 
5483
5501
  /**