@arsedizioni/ars-utils 21.2.203 → 21.2.205

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,8 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, computed, inject, Injectable, NgModule } from '@angular/core';
2
+ import { signal, computed, inject, DestroyRef, Injectable, NgModule } from '@angular/core';
3
3
  import { BroadcastService, SystemUtils } from '@arsedizioni/ars-utils/core';
4
4
  import { EMPTY, throwError, of, catchError as catchError$1 } from 'rxjs';
5
5
  import { HttpClient, HttpHeaders, HttpRequest } from '@angular/common/http';
6
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
7
  import { DialogService } from '@arsedizioni/ars-utils/ui';
7
8
  import { catchError, finalize, map } from 'rxjs/operators';
8
9
 
@@ -2198,8 +2199,10 @@ const PropertiesColors = [{ name: "Verde", value: "#2E8B74" },
2198
2199
  class ClipperService {
2199
2200
  constructor() {
2200
2201
  this.httpClient = inject(HttpClient);
2202
+ this.destroyRef = inject(DestroyRef);
2201
2203
  this.broadcastService = inject(BroadcastService);
2202
2204
  this.dialogService = inject(DialogService);
2205
+ this.broadcastInitialized = false;
2203
2206
  this._serviceUri = '';
2204
2207
  this._flags = ClipperServiceFlags.None;
2205
2208
  this.loggedIn = signal(sessionStorage.getItem("clipper_oauth_token") !== null, ...(ngDevMode ? [{ debugName: "loggedIn" }] : /* istanbul ignore next */ []));
@@ -2209,9 +2212,7 @@ class ClipperService {
2209
2212
  this.referencesSnapshot = signal(undefined, ...(ngDevMode ? [{ debugName: "referencesSnapshot" }] : /* istanbul ignore next */ []));
2210
2213
  this.dashboard = new ClipperDashboard();
2211
2214
  this.bag = signal([], ...(ngDevMode ? [{ debugName: "bag" }] : /* istanbul ignore next */ []));
2212
- this.bagTotal = computed(() => {
2213
- return this.bag().length;
2214
- }, ...(ngDevMode ? [{ debugName: "bagTotal" }] : /* istanbul ignore next */ []));
2215
+ this.bagTotal = computed(() => this.bag().length, ...(ngDevMode ? [{ debugName: "bagTotal" }] : /* istanbul ignore next */ []));
2215
2216
  this.visible = signal(false, ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
2216
2217
  this._teams = [];
2217
2218
  this.currentTeamId = signal(SystemUtils.emptyUUID(), ...(ngDevMode ? [{ debugName: "currentTeamId" }] : /* istanbul ignore next */ []));
@@ -2249,16 +2250,11 @@ class ClipperService {
2249
2250
  get teams() {
2250
2251
  return this._teams;
2251
2252
  }
2252
- ngOnDestroy() {
2253
- if (this.broadcastServiceSubscription) {
2254
- this.broadcastServiceSubscription.unsubscribe();
2255
- }
2256
- }
2257
2253
  /**
2258
- * Initialize service
2259
- * @param serviceUri : the service uri
2260
- * @param appUri : the clipper application uri
2261
- * @param flags: the service flags. Default is none.
2254
+ * Initialises the service with the API base URI, optional app URI, and feature flags.
2255
+ * @param serviceUri - The base URI of the Clipper REST API.
2256
+ * @param appUri - Optional URI of the Clipper web application (used to build document links).
2257
+ * @param flags - Feature flags that control service behaviour. Defaults to `ClipperServiceFlags.None`.
2262
2258
  */
2263
2259
  initialize(serviceUri, appUri, flags = ClipperServiceFlags.None) {
2264
2260
  // Create unique client and machine id
@@ -2272,11 +2268,13 @@ class ClipperService {
2272
2268
  this._appUri = appUri;
2273
2269
  this._flags = flags;
2274
2270
  // React to message broadcasting
2275
- if (!this.broadcastServiceSubscription) {
2276
- this.broadcastServiceSubscription = this.broadcastService.getMessage()
2271
+ if (!this.broadcastInitialized) {
2272
+ this.broadcastInitialized = true;
2273
+ this.broadcastService.getMessage()
2274
+ .pipe(takeUntilDestroyed(this.destroyRef))
2277
2275
  .subscribe(message => {
2278
2276
  if (message.id === ClipperMessages.LOGIN_CHANGED) {
2279
- this.login(null, null, true, message.data?.oauth ?? null, message.data?.oauthAccessToken ?? null).subscribe({
2277
+ this.login(undefined, undefined, true, message.data?.oauth ?? undefined, message.data?.oauthAccessToken ?? undefined).subscribe({
2280
2278
  next: r => {
2281
2279
  if (!r.success) {
2282
2280
  if ((this.flags & ClipperServiceFlags.DisplayConnectionStateMessages) > 0) {
@@ -2337,15 +2335,15 @@ class ClipperService {
2337
2335
  .subscribe();
2338
2336
  }
2339
2337
  /**
2340
- * Store context
2338
+ * Persists the current login context to `localStorage`.
2341
2339
  */
2342
2340
  storeContext() {
2343
2341
  localStorage.setItem('clipper_context', JSON.stringify(this._loginInfo));
2344
2342
  }
2345
2343
  /**
2346
- * Update context
2347
- * @param result: the new context
2348
- */
2344
+ * Updates the stored login context with the values from a fresh login result.
2345
+ * @param result - The login result containing the new user context and channel settings.
2346
+ */
2349
2347
  updateContext(result) {
2350
2348
  if (!this._loginInfo) {
2351
2349
  this._loginInfo = { context: undefined };
@@ -2355,11 +2353,11 @@ class ClipperService {
2355
2353
  this.storeContext();
2356
2354
  }
2357
2355
  /**
2358
- * Perform auto login using current link data
2359
- * @param onSuccess: function to execute on seccess
2360
- */
2356
+ * Attempts an automatic login using the credentials currently stored in session storage.
2357
+ * @param onSuccess - Optional callback invoked with the login result value on success.
2358
+ */
2361
2359
  autoLogin(onSuccess) {
2362
- this.login(null, null, true)
2360
+ this.login(undefined, undefined, true)
2363
2361
  .pipe(finalize(() => this.dialogService.clearBusy()))
2364
2362
  .subscribe({
2365
2363
  next: r => {
@@ -2379,8 +2377,8 @@ class ClipperService {
2379
2377
  });
2380
2378
  }
2381
2379
  /**
2382
- * Perform auto logout
2383
- * @param onSuccess: function to execute on success
2380
+ * Performs an automatic logout and clears the stored session.
2381
+ * @param onSuccess - Optional callback invoked after a successful logout.
2384
2382
  */
2385
2383
  autoLogout(onSuccess) {
2386
2384
  this.logout()
@@ -2406,12 +2404,13 @@ class ClipperService {
2406
2404
  });
2407
2405
  }
2408
2406
  /**
2409
- * Perform login
2410
- * @param email: the optioanl email if using OAuth2
2411
- * @parma password: the optional password if using OAuth2
2412
- * @param remember: remember credentials
2413
- * @param oauth: the optional open authentication supported
2414
- * @param oauthAccessToken: the optional OAuth2 access token
2407
+ * Authenticates the user against the Clipper API, supporting both credential-based and
2408
+ * OAuth2 login flows.
2409
+ * @param email - The user's email address (credential login only).
2410
+ * @param password - The user's password (credential login only).
2411
+ * @param remember - When `true`, the session is remembered across browser restarts.
2412
+ * @param oauth - The OAuth2 provider type, when authenticating via SSO.
2413
+ * @param oauthAccessToken - The OAuth2 bearer token. Defaults to the value stored in session storage.
2415
2414
  */
2416
2415
  login(email, password, remember, oauth, oauthAccessToken = sessionStorage.getItem("clipper_oauth_token") ?? undefined) {
2417
2416
  return this.httpClient
@@ -2448,8 +2447,9 @@ class ClipperService {
2448
2447
  }));
2449
2448
  }
2450
2449
  /**
2451
- * Complete login
2452
- * @param result : the login result
2450
+ * Finalises the login flow by updating the stored context, setting the logged-in signal,
2451
+ * initialising channels, and broadcasting `LOGIN_COMPLETED`.
2452
+ * @param result - The login result returned by the API.
2453
2453
  */
2454
2454
  completeLogin(result) {
2455
2455
  // Update context info
@@ -2462,8 +2462,8 @@ class ClipperService {
2462
2462
  this.broadcastService.sendMessage(ClipperMessages.LOGIN_COMPLETED);
2463
2463
  }
2464
2464
  /**
2465
- * Confirm MFA procedure
2466
- * @param code: the confirm code
2465
+ * Submits the MFA confirmation code to complete a two-factor login flow.
2466
+ * @param code - The one-time confirmation code provided to the user.
2467
2467
  */
2468
2468
  confirmIdentity(code) {
2469
2469
  return this.httpClient
@@ -2478,8 +2478,8 @@ class ClipperService {
2478
2478
  }));
2479
2479
  }
2480
2480
  /**
2481
- * Perform logout
2482
- * @param forget: true to dispose all user informations
2481
+ * Logs the user out and clears the current session.
2482
+ * @param forget - When `true`, all stored user credentials are also removed.
2483
2483
  */
2484
2484
  logout(forget = false) {
2485
2485
  return this.httpClient.post(this._serviceUri + '/logout/?forget=' + forget, {})
@@ -2492,8 +2492,8 @@ class ClipperService {
2492
2492
  }));
2493
2493
  }
2494
2494
  /**
2495
- * Reset login refresh timer and login state
2496
- */
2495
+ * Resets the login state, clears the stored login info, and broadcasts `LOGOUT_COMPLETED`.
2496
+ */
2497
2497
  reset() {
2498
2498
  // Clear login info
2499
2499
  this._loginInfo = undefined;
@@ -2505,8 +2505,8 @@ class ClipperService {
2505
2505
  this.broadcastService.sendMessage(ClipperMessages.LOGOUT_COMPLETED);
2506
2506
  }
2507
2507
  /**
2508
- * Clear login data
2509
- * @param clearOAuthToken: true to clear oauth token also
2508
+ * Clears all session-storage authentication keys and resets the login state.
2509
+ * @param clearOAuthToken - When `true`, the OAuth bearer token is also removed.
2510
2510
  */
2511
2511
  clear(clearOAuthToken = false) {
2512
2512
  // Clear local storage
@@ -2519,8 +2519,9 @@ class ClipperService {
2519
2519
  this.reset();
2520
2520
  }
2521
2521
  /**
2522
- * Update channel state
2523
- * @param value : the new dashboard result with updated channels and dashboard info
2522
+ * Applies a new dashboard result: updates channel settings, dashboard counters, and
2523
+ * re-initialises the available-channels signal.
2524
+ * @param value - The dashboard result containing updated channel and counter data.
2524
2525
  */
2525
2526
  setChannelsState(value) {
2526
2527
  // Update channels
@@ -2538,8 +2539,8 @@ class ClipperService {
2538
2539
  this.initializeChannels();
2539
2540
  }
2540
2541
  /**
2541
- * Update channels
2542
- * @param channels: the new channels settings
2542
+ * Replaces the stored channel settings and re-initialises the available-channels signal.
2543
+ * @param channels - The new channel settings to store and activate.
2543
2544
  */
2544
2545
  setChannels(channels) {
2545
2546
  if (this._loginInfo) {
@@ -2549,13 +2550,13 @@ class ClipperService {
2549
2550
  }
2550
2551
  }
2551
2552
  /**
2552
- * Initialize channels
2553
- */
2553
+ * Rebuilds the `availableChannels` signal from the current login context.
2554
+ */
2554
2555
  initializeChannels() {
2555
2556
  if (this.loginInfo) {
2556
- let channels = [];
2557
+ const channels = [];
2557
2558
  this.loginInfo.channels?.forEach(n => {
2558
- const channelSubscription = this.loginInfo.context.channels.find(x => x.channel === n.channelId);
2559
+ const channelSubscription = this.loginInfo?.context?.channels?.find(x => x.channel === n.channelId);
2559
2560
  n.isSuspended = channelSubscription?.isSuspended === true;
2560
2561
  const channel = ClipperChannels.find(x => x.value === n.channelId);
2561
2562
  if (channel) {
@@ -2569,8 +2570,8 @@ class ClipperService {
2569
2570
  }
2570
2571
  }
2571
2572
  /**
2572
- * Update channels
2573
- * @param values : the new channel values
2573
+ * Toggles the active state of available channels based on the supplied selection list.
2574
+ * @param values - The selected channel items; channels absent from this list are deactivated.
2574
2575
  */
2575
2576
  updateChannels(values) {
2576
2577
  this.availableChannels().forEach(channel => {
@@ -2578,12 +2579,11 @@ class ClipperService {
2578
2579
  channel.active = values?.findIndex(x => x.value === channel.value) !== -1;
2579
2580
  }
2580
2581
  });
2581
- this.availableChannels.update(values => [...values]);
2582
2582
  }
2583
2583
  /**
2584
- * Get a new one time password
2585
- * @param id: the optional repository id
2586
- */
2584
+ * Requests a new one-time password for the given repository.
2585
+ * @param id - The repository ID for which the OTP should be generated.
2586
+ */
2587
2587
  newOTP(id) {
2588
2588
  return this.httpClient.get(this._serviceUri + '/otp/new/?id=' + id);
2589
2589
  }
@@ -2629,6 +2629,10 @@ class ClipperService {
2629
2629
  sendTo(params) {
2630
2630
  return this.httpClient.post(this._serviceUri + '/documents/send', params);
2631
2631
  }
2632
+ /**
2633
+ * Sends an email notification about a document property update to the specified recipients.
2634
+ * @param params - The notification parameters including recipients and property details.
2635
+ */
2632
2636
  notifyPropertyTo(params) {
2633
2637
  return this.httpClient.post(this._serviceUri + '/documents/properties/notify', params);
2634
2638
  }
@@ -2763,18 +2767,18 @@ class ClipperService {
2763
2767
  });
2764
2768
  }
2765
2769
  /**
2766
- * Retrieve last 15 days
2767
- * @param params : the query params
2768
- */
2770
+ * Retrieves documents updated in the last 15 days for the given search parameters.
2771
+ * @param params - The search parameters to filter results.
2772
+ */
2769
2773
  last15Days(params) {
2770
2774
  return this.httpClient.post(this._serviceUri + '/account/last-15-days', params);
2771
2775
  }
2772
2776
  /**
2773
- * Update unread items
2774
- * @param module : the module
2775
- * @param model : the optional model
2776
- * @param increment : the increment (can be negative)
2777
- */
2777
+ * Adjusts the unread-item counter for the given module and broadcasts a dashboard update.
2778
+ * @param module - The Clipper module whose counter should be adjusted.
2779
+ * @param model - Optional document model to further scope the counter update.
2780
+ * @param increment - The signed increment to apply (use negative values to decrement).
2781
+ */
2778
2782
  updateUnreadItems(module, model, increment) {
2779
2783
  increment ??= 0;
2780
2784
  if (increment !== 0) {
@@ -2818,8 +2822,8 @@ class ClipperService {
2818
2822
  });
2819
2823
  }
2820
2824
  /**
2821
- * Add one or more working document
2822
- * @param documentIds : the document ids to add
2825
+ * Adds one or more documents to the working documents bag.
2826
+ * @param documentIds - The IDs of the documents to add.
2823
2827
  */
2824
2828
  addToBag(documentIds) {
2825
2829
  return this.httpClient
@@ -2852,8 +2856,8 @@ class ClipperService {
2852
2856
  });
2853
2857
  }
2854
2858
  /**
2855
- * Remove one working document
2856
- * @param documentId : the document id
2859
+ * Removes a document from the working documents bag.
2860
+ * @param documentId - The ID of the document to remove.
2857
2861
  */
2858
2862
  removeFromBag(documentId) {
2859
2863
  return this.httpClient
@@ -2894,24 +2898,24 @@ class ClipperService {
2894
2898
  // WORKING SEARCHES
2895
2899
  ///
2896
2900
  /**
2897
- * Load working searches
2898
- * @param: module: the module to load searches for
2901
+ * Retrieves the saved searches for the given module.
2902
+ * @param module - The Clipper module whose saved searches to load.
2899
2903
  */
2900
2904
  loadSearches(module) {
2901
2905
  return this.httpClient
2902
2906
  .get(this.serviceUri + '/documents/searches/?module=' + module);
2903
2907
  }
2904
2908
  /**
2905
- * Save a working search
2906
- * @param params : the clipper user search
2909
+ * Persists a user search configuration on the server.
2910
+ * @param params - The search configuration to save.
2907
2911
  */
2908
2912
  saveSearch(params) {
2909
2913
  return this.httpClient
2910
2914
  .post(this.serviceUri + '/documents/searches/save', params);
2911
2915
  }
2912
2916
  /**
2913
- * Remove one working search
2914
- * @param id : the id to remove
2917
+ * Deletes a saved search by its ID.
2918
+ * @param id - The ID of the saved search to remove.
2915
2919
  */
2916
2920
  deleteSearch(id) {
2917
2921
  return this.httpClient
@@ -2940,43 +2944,43 @@ class ClipperService {
2940
2944
  return this.httpClient.post(this._serviceUri + '/calendar/snapshot', params);
2941
2945
  }
2942
2946
  /**
2943
- * Delete one or more items
2944
- * @param ids: ids to delete
2947
+ * Deletes one or more calendar deadlines by ID.
2948
+ * @param ids - The IDs of the deadlines to delete.
2945
2949
  */
2946
2950
  deleteCalendarDeadlines(ids) {
2947
2951
  return this.httpClient.post(this._serviceUri + '/calendar/delete', { ids: ids });
2948
2952
  }
2949
2953
  /**
2950
- * Copy one or more items
2951
- * @param params parameters
2954
+ * Copies one or more calendar deadlines using the given parameters.
2955
+ * @param params - The copy operation parameters.
2952
2956
  */
2953
2957
  copyCalendarDeadlines(params) {
2954
2958
  return this.httpClient.post(this._serviceUri + '/calendar/copy', params);
2955
2959
  }
2956
2960
  /**
2957
- * Close a deadline
2958
- * @param id : the id to close
2961
+ * Marks the given calendar deadline as closed.
2962
+ * @param id - The ID of the deadline to close.
2959
2963
  */
2960
2964
  closeCalendarDeadline(id) {
2961
2965
  return this.httpClient.post(this._serviceUri + '/calendar/close', { id: id });
2962
2966
  }
2963
2967
  /**
2964
- * Save an item
2965
- * @param params parameters
2968
+ * Creates or updates a calendar deadline.
2969
+ * @param params - The deadline data to save.
2966
2970
  */
2967
2971
  saveCalendarDeadline(params) {
2968
2972
  return this.httpClient.post(this._serviceUri + '/calendar/save', params);
2969
2973
  }
2970
2974
  /**
2971
- * Retrive a n item
2972
- * @param id : the item id
2975
+ * Retrieves a single calendar deadline by its ID.
2976
+ * @param id - The ID of the deadline to retrieve.
2973
2977
  */
2974
2978
  getCalendarDeadline(id) {
2975
2979
  return this.httpClient.get(this._serviceUri + '/calendar/' + id);
2976
2980
  }
2977
2981
  /**
2978
- * Export to iCalendar format
2979
- * @param ids : deadlines to export
2982
+ * Exports the selected deadlines in iCalendar (.ics) format.
2983
+ * @param ids - The IDs of the deadlines to export.
2980
2984
  */
2981
2985
  exportCalendarDeadlines(ids) {
2982
2986
  return this.httpClient.post(this._serviceUri + '/calendar/export', { ids: ids }, {
@@ -2987,9 +2991,9 @@ class ClipperService {
2987
2991
  // ARCHIVE
2988
2992
  ///
2989
2993
  /**
2990
- * Retrieve all folders
2991
- * @param params : parameters
2992
- */
2994
+ * Retrieves all archive folders matching the given search parameters.
2995
+ * @param params - The folder search parameters.
2996
+ */
2993
2997
  getArchiveFolders(params) {
2994
2998
  return this.httpClient
2995
2999
  .post(this._serviceUri + '/archive/folders', params)
@@ -2999,20 +3003,19 @@ class ClipperService {
2999
3003
  this._teams = r.value.teams;
3000
3004
  }
3001
3005
  return r;
3002
- return r;
3003
3006
  }));
3004
3007
  }
3005
3008
  /**
3006
- * Save folder
3007
- * @param params : parameters
3009
+ * Creates or updates an archive folder.
3010
+ * @param params - The folder data to save.
3008
3011
  */
3009
3012
  saveArchiveFolder(params) {
3010
3013
  return this.httpClient.post(this._serviceUri + '/archive/folders/save', params);
3011
3014
  }
3012
3015
  /**
3013
- * Export folders
3014
- * @param id: the folder id or undefined to export all folders
3015
- * @param teamId: the optional team id. Default undefined (personal)
3016
+ * Exports archive folders as a downloadable file.
3017
+ * @param id - The folder ID to export, or `undefined` to export all folders.
3018
+ * @param teamId - The optional team ID. Defaults to `undefined` (personal workspace).
3016
3019
  */
3017
3020
  exportArchiveFolders(id, teamId) {
3018
3021
  let url = this._serviceUri + '/archive/export/?';
@@ -3033,8 +3036,8 @@ class ClipperService {
3033
3036
  });
3034
3037
  }
3035
3038
  /**
3036
- * Import folders
3037
- * @param params : parameters
3039
+ * Uploads and imports archive folders from a file.
3040
+ * @param params - The import parameters including the source file and destination folder.
3038
3041
  */
3039
3042
  importArchiveFolders(params) {
3040
3043
  // Prepare form
@@ -3052,33 +3055,33 @@ class ClipperService {
3052
3055
  return this.httpClient.request(new HttpRequest('POST', this._serviceUri + '/archive/import/', formData, { reportProgress: true }));
3053
3056
  }
3054
3057
  /**
3055
- * Get files and folders
3056
- * @param params : parameters
3058
+ * Retrieves archive files and folders matching the given search parameters.
3059
+ * @param params - The archive files search parameters.
3057
3060
  */
3058
3061
  queryArchiveItems(params) {
3059
3062
  return this.httpClient.post(this._serviceUri + '/archive/files', params);
3060
3063
  }
3061
3064
  /**
3062
- * Delete file and folders
3063
- * @param params parameters
3065
+ * Deletes one or more archive files or folders.
3066
+ * @param params - The delete operation parameters.
3064
3067
  */
3065
3068
  deleteArchiveItems(params) {
3066
3069
  return this.httpClient.post(this._serviceUri + '/archive/files/delete', params);
3067
3070
  }
3068
3071
  /**
3069
- * Copy file and folders to another folder or the same
3070
- * @param params parameters
3072
+ * Copies archive files or folders to a destination folder.
3073
+ * @param params - The copy operation parameters.
3071
3074
  */
3072
3075
  copyArchiveItems(params) {
3073
3076
  return this.httpClient.post(this._serviceUri + '/archive/files/copy', params);
3074
3077
  }
3075
3078
  /**
3076
- * Save a file
3077
- * @param params : parameters
3079
+ * Uploads and saves an archive file using multipart form data.
3080
+ * @param params - The file metadata and binary content to save.
3078
3081
  */
3079
3082
  saveArchiveFile(params) {
3080
3083
  // Prepare form
3081
- let formData = new FormData();
3084
+ const formData = new FormData();
3082
3085
  if (params.file)
3083
3086
  formData.append(params.file.file.name, params.file.file);
3084
3087
  if (params.id)
@@ -3121,16 +3124,16 @@ class ClipperService {
3121
3124
  return this.httpClient.request(new HttpRequest('POST', this._serviceUri + '/archive/files/save', formData, { reportProgress: true }));
3122
3125
  }
3123
3126
  /**
3124
- * Get file data
3125
- * @param id : the item id
3127
+ * Retrieves the metadata for a single archive file.
3128
+ * @param id - The ID of the archive file to retrieve.
3126
3129
  */
3127
3130
  getArchiveFile(id) {
3128
3131
  return this.httpClient.get(this._serviceUri + '/archive/files/' + id);
3129
3132
  }
3130
3133
  /**
3131
- * Download file
3132
- * @param id : the binary id to download
3133
- * @param otp : the optional one time password
3134
+ * Downloads the binary content of an archive file.
3135
+ * @param id - The binary ID of the file to download.
3136
+ * @param otp - An optional one-time password for authenticated downloads.
3134
3137
  */
3135
3138
  downloadArchiveFile(id, otp) {
3136
3139
  return this.httpClient.get(this._serviceUri + '/archive/files/download/?id=' + id + '&otp=' + (otp ?? ''), { responseType: 'blob' });
@@ -3139,22 +3142,22 @@ class ClipperService {
3139
3142
  // ACCOUNT AND SETTINGS
3140
3143
  ///
3141
3144
  /**
3142
- * Reset a user password
3143
- * @param params parameters
3144
- */
3145
+ * Resets the user's password using the provided parameters.
3146
+ * @param params - The new password and confirmation data.
3147
+ */
3145
3148
  resetPassword(params) {
3146
3149
  return this.httpClient.post(this._serviceUri + '/account/password/reset', params);
3147
3150
  }
3148
3151
  /**
3149
- * Recover password
3150
- * @param params parameters
3152
+ * Initiates a password recovery flow by sending a reset link to the user's email.
3153
+ * @param params - The password recovery request data.
3151
3154
  */
3152
3155
  recoverPassword(params) {
3153
3156
  return this.httpClient.post(this._serviceUri + '/account/password/recover', params);
3154
3157
  }
3155
3158
  /**
3156
- * Update settings
3157
- * @param params parameters
3159
+ * Updates user account settings and applies any channel configuration changes.
3160
+ * @param params - A map of settings key-value pairs to update.
3158
3161
  */
3159
3162
  updateSettings(params) {
3160
3163
  return this.httpClient.post(this._serviceUri + '/account/settings/update', params).pipe(map(r => {
@@ -3167,8 +3170,8 @@ class ClipperService {
3167
3170
  }));
3168
3171
  }
3169
3172
  /**
3170
- * Update channel state
3171
- * @param id: the channel id (1, 2, 3, 4)
3173
+ * Saves updated channel activation states to the server and applies the new dashboard result.
3174
+ * @param params - The channel state update parameters.
3172
3175
  */
3173
3176
  updateChannelsState(params) {
3174
3177
  return this.httpClient.post(this._serviceUri + '/account/settings/channels/update', params).pipe(map(r => {
@@ -3188,7 +3191,7 @@ class ClipperService {
3188
3191
  return this.httpClient.get(this._serviceUri + '/account/trial');
3189
3192
  }
3190
3193
  /**
3191
- * Update trial info
3194
+ * Refreshes the trial status from the server and updates the stored login context.
3192
3195
  */
3193
3196
  updateTrialInfo() {
3194
3197
  if (!this._loginInfo || this._loginInfo?.context?.hasTrial === false)
@@ -3212,15 +3215,15 @@ class ClipperService {
3212
3215
  // LINKS
3213
3216
  ///
3214
3217
  /**
3215
- * Save a user link
3216
- * @param item: the user link
3217
- */
3218
+ * Creates or updates a user link record.
3219
+ * @param item - The user link data to save.
3220
+ */
3218
3221
  saveLink(item) {
3219
3222
  return this.httpClient.post(this._serviceUri + '/account/links/save', item);
3220
3223
  }
3221
3224
  /**
3222
- * Delete a user link
3223
- * @param item: the user link
3225
+ * Deletes a user link record.
3226
+ * @param item - The user link to remove.
3224
3227
  */
3225
3228
  deleteLink(item) {
3226
3229
  return this.httpClient.post(this._serviceUri + '/account/links/delete', item);
@@ -3229,14 +3232,15 @@ class ClipperService {
3229
3232
  // TEAMS
3230
3233
  ///
3231
3234
  /**
3232
- * Rename a team
3233
- * @param newName : the new name
3234
- */
3235
+ * Renames the current user's team.
3236
+ * @param newName - The new display name for the team.
3237
+ */
3235
3238
  renameTeam(newName) {
3236
3239
  return this.httpClient.post(this._serviceUri + '/account/teams/update', { title: newName });
3237
3240
  }
3238
3241
  /**
3239
- * Retrieve teams
3242
+ * Retrieves the list of teams available to the current user.
3243
+ * @param params - The teams search parameters.
3240
3244
  */
3241
3245
  getTeams(params) {
3242
3246
  return this.httpClient.post(this._serviceUri + '/account/teams', params)
@@ -3249,21 +3253,22 @@ class ClipperService {
3249
3253
  }));
3250
3254
  }
3251
3255
  /**
3252
- * Retrieve team members
3256
+ * Retrieves the members of a team matching the given search parameters.
3257
+ * @param params - The team members search parameters.
3253
3258
  */
3254
3259
  getTeamMembers(params) {
3255
3260
  return this.httpClient.post(this._serviceUri + '/account/teams/members', params);
3256
3261
  }
3257
3262
  /**
3258
- * Delete members
3259
- * @param ids: the id list to delete
3263
+ * Removes the specified members from the team.
3264
+ * @param ids - The numeric IDs of the team members to remove.
3260
3265
  */
3261
3266
  deleteTeamMembers(ids) {
3262
3267
  return this.httpClient.post(this._serviceUri + '/account/teams/members/delete', { ids: ids });
3263
3268
  }
3264
3269
  /**
3265
- * Save member
3266
- * @param item: the item to save
3270
+ * Creates or updates a team member record.
3271
+ * @param item - The team member data to save.
3267
3272
  */
3268
3273
  saveTeamMember(item) {
3269
3274
  return this.httpClient.post(this._serviceUri + '/account/teams/members/save', item);
@@ -3272,21 +3277,22 @@ class ClipperService {
3272
3277
  // CONTACTS
3273
3278
  ///
3274
3279
  /**
3275
- * Retrieve contacts
3280
+ * Retrieves contacts matching the given search parameters.
3281
+ * @param params - The contacts search parameters.
3276
3282
  */
3277
3283
  queryContacts(params) {
3278
3284
  return this.httpClient.post(this._serviceUri + '/account/contacts', params);
3279
3285
  }
3280
3286
  /**
3281
- * Delete contacts
3282
- * @param ids: the id list to delete
3287
+ * Deletes the specified contacts.
3288
+ * @param ids - The numeric IDs of the contacts to remove.
3283
3289
  */
3284
3290
  deleteContacts(ids) {
3285
3291
  return this.httpClient.post(this._serviceUri + '/account/contacts/delete', { ids: ids });
3286
3292
  }
3287
3293
  /**
3288
- * Save contact
3289
- * @param item: the item to save
3294
+ * Creates or updates a contact record.
3295
+ * @param item - The contact data to save.
3290
3296
  */
3291
3297
  saveContact(item) {
3292
3298
  return this.httpClient.post(this._serviceUri + '/account/contacts/save', item);
@@ -3295,28 +3301,29 @@ class ClipperService {
3295
3301
  // PROPERTIES
3296
3302
  ///
3297
3303
  /**
3298
- * Retrieve properties
3304
+ * Retrieves document properties matching the given search parameters.
3305
+ * @param params - The properties search parameters.
3299
3306
  */
3300
3307
  queryProperties(params) {
3301
3308
  return this.httpClient.post(this._serviceUri + '/account/properties', params);
3302
3309
  }
3303
3310
  /**
3304
- * Delete properties
3305
- * @param ids: the id list to delete
3311
+ * Deletes the specified document properties.
3312
+ * @param ids - The numeric IDs of the properties to remove.
3306
3313
  */
3307
3314
  deleteProperties(ids) {
3308
3315
  return this.httpClient.post(this._serviceUri + '/account/properties/delete', { ids: ids });
3309
3316
  }
3310
3317
  /**
3311
- * Save property
3312
- * @param item: the item to save
3318
+ * Creates or updates a document property.
3319
+ * @param item - The property data to save.
3313
3320
  */
3314
3321
  saveProperty(item) {
3315
3322
  return this.httpClient.post(this._serviceUri + '/account/properties/save', item);
3316
3323
  }
3317
3324
  /**
3318
- * Get the property tracking list for a property
3319
- * @param id: the property id
3325
+ * Retrieves the tracking history for the given document property.
3326
+ * @param id - The numeric ID of the property whose tracking records to retrieve.
3320
3327
  */
3321
3328
  getPropertyTrackings(id) {
3322
3329
  return this.httpClient.get(this._serviceUri + '/account/properties/trackings/' + id);