@arsedizioni/ars-utils 22.0.35 → 22.0.37

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.
@@ -2396,47 +2396,6 @@ class ClipperDocumentsService {
2396
2396
  return this.httpClient.get(this.core.serviceUri + '/tags');
2397
2397
  }
2398
2398
  ///
2399
- // DASHBOARD
2400
- ///
2401
- /**
2402
- * Retrieves the current dashboard and applies its counters to the shared dashboard state.
2403
- * @returns The subscription to the dashboard request.
2404
- */
2405
- loadDashboard() {
2406
- return this.httpClient
2407
- .post(this.core.serviceUri + '/account/dashboard', { refreshing: true }).subscribe((r) => {
2408
- if (r.success) {
2409
- this.core.dashboard.documentUpdates = r.value.documentUpdates;
2410
- this.core.dashboard.expiredDeadlines = r.value.expiredDeadlines;
2411
- this.core.dashboard.expiringDeadlines = r.value.expiringDeadlines;
2412
- this.core.dashboard.isTrial = r.value.isTrial;
2413
- this.core.dashboard.items.set(r.value.items ?? []);
2414
- this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
2415
- }
2416
- });
2417
- }
2418
- /**
2419
- * Retrieves documents updated in the last 15 days for the given search parameters.
2420
- * @param params - The search parameters to filter results.
2421
- * @returns An observable emitting the API result wrapping the last-days result.
2422
- */
2423
- last15Days(params) {
2424
- return this.httpClient.post(this.core.serviceUri + '/account/last-15-days', params);
2425
- }
2426
- /**
2427
- * Adjusts the unread-item counter for the given module and broadcasts a dashboard update.
2428
- * @param module - The Clipper module whose counter should be adjusted.
2429
- * @param model - Optional document model to further scope the counter update.
2430
- * @param increment - The signed increment to apply (use negative values to decrement).
2431
- */
2432
- updateUnreadItems(module, model, increment) {
2433
- increment ??= 0;
2434
- if (increment !== 0) {
2435
- this.core.dashboard.updateUnreadItems(module, model, increment);
2436
- }
2437
- this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
2438
- }
2439
- ///
2440
2399
  // BAG
2441
2400
  ///
2442
2401
  /**
@@ -2732,6 +2691,13 @@ class ClipperLoginService {
2732
2691
  return of([]);
2733
2692
  }));
2734
2693
  }
2694
+ /**
2695
+ * Clears all session-storage authentication keys and resets the login state.
2696
+ * @param clearOAuthToken - When `true`, the OAuth bearer token is also removed.
2697
+ */
2698
+ clear(clearOAuthToken = false) {
2699
+ this.core.clear(clearOAuthToken);
2700
+ }
2735
2701
  /**
2736
2702
  * Requests a new one-time password for the given repository.
2737
2703
  * @param id - The repository ID for which the OTP should be generated.
@@ -3169,6 +3135,47 @@ class ClipperAccountService {
3169
3135
  deleteLink(item) {
3170
3136
  return this.httpClient.post(this.core.serviceUri + '/account/links/delete', item);
3171
3137
  }
3138
+ ///
3139
+ // DASHBOARD
3140
+ ///
3141
+ /**
3142
+ * Retrieves the current dashboard and applies its counters to the shared dashboard state.
3143
+ * @returns The subscription to the dashboard request.
3144
+ */
3145
+ loadDashboard() {
3146
+ return this.httpClient
3147
+ .post(this.core.serviceUri + '/account/dashboard', { refreshing: true }).subscribe((r) => {
3148
+ if (r.success) {
3149
+ this.core.dashboard.documentUpdates = r.value.documentUpdates;
3150
+ this.core.dashboard.expiredDeadlines = r.value.expiredDeadlines;
3151
+ this.core.dashboard.expiringDeadlines = r.value.expiringDeadlines;
3152
+ this.core.dashboard.isTrial = r.value.isTrial;
3153
+ this.core.dashboard.items.set(r.value.items ?? []);
3154
+ this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
3155
+ }
3156
+ });
3157
+ }
3158
+ /**
3159
+ * Retrieves documents updated in the last 15 days for the given search parameters.
3160
+ * @param params - The search parameters to filter results.
3161
+ * @returns An observable emitting the API result wrapping the last-days result.
3162
+ */
3163
+ last15Days(params) {
3164
+ return this.httpClient.post(this.core.serviceUri + '/account/last-15-days', params);
3165
+ }
3166
+ /**
3167
+ * Adjusts the unread-item counter for the given module and broadcasts a dashboard update.
3168
+ * @param module - The Clipper module whose counter should be adjusted.
3169
+ * @param model - Optional document model to further scope the counter update.
3170
+ * @param increment - The signed increment to apply (use negative values to decrement).
3171
+ */
3172
+ updateUnreadItems(module, model, increment) {
3173
+ increment ??= 0;
3174
+ if (increment !== 0) {
3175
+ this.core.dashboard.updateUnreadItems(module, model, increment);
3176
+ }
3177
+ this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
3178
+ }
3172
3179
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: ClipperAccountService, deps: [], target: i0.ɵɵFactoryTarget.Service }); }
3173
3180
  static { this.ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.1", ngImport: i0, type: ClipperAccountService }); }
3174
3181
  }
@@ -3586,9 +3593,9 @@ class ClipperService {
3586
3593
  this.core = inject(ClipperCoreService);
3587
3594
  /** Authentication: login/logout, MFA, OTP. */
3588
3595
  this.session = inject(ClipperLoginService);
3589
- /** Document search, references, export, dashboard, working-documents bag and saved searches. */
3596
+ /** Document search, references, export, working-documents bag and saved searches. */
3590
3597
  this.documents = inject(ClipperDocumentsService);
3591
- /** Account settings, password, channels, trial info and user links. */
3598
+ /** Account settings, dashboard, password, channels, trial info and user links. */
3592
3599
  this.account = inject(ClipperAccountService);
3593
3600
  /** Archive folders and files. */
3594
3601
  this.archive = inject(ClipperArchiveService);