@arsedizioni/ars-utils 20.4.5 → 20.4.7

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.
@@ -1033,7 +1033,7 @@ declare class ClipperDocumentMenuComponent implements OnInit, OnDestroy {
1033
1033
  private changeDetector;
1034
1034
  private clipperService;
1035
1035
  readonly useSelections: _angular_core.InputSignal<boolean>;
1036
- readonly selectionSource: _angular_core.InputSignal<"selection" | "bag" | "none">;
1036
+ readonly selectionSource: _angular_core.InputSignal<"selection" | "none" | "bag">;
1037
1037
  protected selection: () => ClipperDocumentInfo[];
1038
1038
  readonly parent: _angular_core.InputSignal<ClipperSearchResultManager>;
1039
1039
  readonly item: _angular_core.InputSignal<ClipperDocumentInfo>;
package/core/index.d.ts CHANGED
@@ -408,6 +408,35 @@ declare class SystemUtils {
408
408
  * @returns true if the color is light
409
409
  */
410
410
  static isColorLight(color: string, minimumLuminance?: number): boolean;
411
+ /**
412
+ * Get a unique machine id
413
+ * @returns : the machine id
414
+ */
415
+ static getMachineId(): string;
416
+ /**
417
+ * Format as guid
418
+ */
419
+ private static formatAsGuid;
420
+ /**
421
+ * Browser fingerprint
422
+ */
423
+ private static collectFingerprint;
424
+ /**
425
+ * Platform
426
+ */
427
+ private static normalizePlatform;
428
+ /**
429
+ * WebGL fingerprinting
430
+ */
431
+ private static getWebGLFingerprint;
432
+ /**
433
+ * Get all fonts
434
+ */
435
+ private static detectFonts;
436
+ /**
437
+ * Generate hash SHA-256-like
438
+ */
439
+ private static generateHash;
411
440
  }
412
441
 
413
442
  interface DoneResult<T> {
@@ -2057,10 +2057,13 @@ class ClipperService {
2057
2057
  * @param flags: the service flags. Default is none.
2058
2058
  */
2059
2059
  initialize(serviceUri, appUri, flags = ClipperServiceFlags.None) {
2060
- // Create unique client id
2060
+ // Create unique client id and machine id
2061
2061
  if (!sessionStorage.getItem('clipper_client_id')) {
2062
2062
  sessionStorage.setItem('clipper_client_id', SystemUtils.generateUUID());
2063
2063
  }
2064
+ if (!sessionStorage.getItem('clipper_machine_id')) {
2065
+ sessionStorage.setItem('clipper_machine_id', SystemUtils.getMachineId());
2066
+ }
2064
2067
  // Initialize
2065
2068
  this._serviceUri = serviceUri;
2066
2069
  this._appUri = appUri;
@@ -3059,7 +3062,8 @@ class ClipperAuthInterceptor {
3059
3062
  withCredentials: true,
3060
3063
  setHeaders: {
3061
3064
  'ngsw-bypass': 'ngsw-bypass',
3062
- 'X-Client-Id': sessionStorage.getItem('clipper_client_id') ?? ''
3065
+ 'X-Client-Id': sessionStorage.getItem('clipper_client_id') ?? '',
3066
+ 'X-Machine-Id': sessionStorage.getItem('clipper_machine_id') ?? ''
3063
3067
  }
3064
3068
  });
3065
3069
  return next.handle(request)