@arsedizioni/ars-utils 22.5.9 → 22.5.12

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,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { signal, computed, inject, Service, DestroyRef, Injector } from '@angular/core';
3
- import { HttpErrorResponse, HttpClient, HttpHeaders, HttpRequest } from '@angular/common/http';
3
+ import { HttpErrorResponse, HttpClient, HttpHeaders } from '@angular/common/http';
4
4
  import { BroadcastService, SystemUtils, SplashService } from '@arsedizioni/ars-utils/core';
5
5
  import { catchError, throwError, of, EMPTY } from 'rxjs';
6
- import { catchError as catchError$1, map, finalize } from 'rxjs/operators';
7
6
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
+ import { catchError as catchError$1, map, finalize } from 'rxjs/operators';
8
8
 
9
9
  const ClipperMessages = {
10
10
  /**
@@ -31,13 +31,8 @@ const ClipperMessages = {
31
31
  // Settings
32
32
  SETTINGS_CHANGED: '$clipper-settings-changed',
33
33
  // Commands
34
- COMMAND_ARCHIVE_ADD: '$clipper-command-archive-add',
35
- COMMAND_CALENDAR_ADD: '$clipper-command-calendar-add',
36
34
  COMMAND_WORKING_OPEN: '$clipper-command-working-documents-open',
37
35
  COMMAND_WORKING_ADD: '$clipper-command-working-documents-add',
38
- COMMAND_NOTES_ADD: '$clipper-command-notes-add',
39
- COMMAND_NOTES_DELETE: '$clipper-command-notes-delete',
40
- COMMAND_NOTES_UPDATE: '$clipper-command-notes-update',
41
36
  COMMAND_SEARCH_RESTORED: '$clipper-command-search-restored',
42
37
  COMMAND_SEARCH_EXECUTED: '$clipper-command-search-executed',
43
38
  COMMAND_SEARCH_EMPTY_RESULT: '$clipper-command-search-empty-result',
@@ -63,17 +58,6 @@ var ClipperServiceFlags;
63
58
  ClipperServiceFlags[ClipperServiceFlags["DisplayConnectionStateMessages"] = 2] = "DisplayConnectionStateMessages";
64
59
  ClipperServiceFlags[ClipperServiceFlags["Embedded"] = 4] = "Embedded";
65
60
  })(ClipperServiceFlags || (ClipperServiceFlags = {}));
66
- var ClipperRecurrenceType;
67
- (function (ClipperRecurrenceType) {
68
- ClipperRecurrenceType[ClipperRecurrenceType["Year"] = 1] = "Year";
69
- ClipperRecurrenceType[ClipperRecurrenceType["Month"] = 2] = "Month";
70
- ClipperRecurrenceType[ClipperRecurrenceType["Day"] = 3] = "Day";
71
- })(ClipperRecurrenceType || (ClipperRecurrenceType = {}));
72
- const ClipperRecurrenceTypes = [
73
- { name: 'Anni', value: ClipperRecurrenceType.Year },
74
- { name: 'Mesi', value: ClipperRecurrenceType.Month },
75
- { name: 'Giorni', value: ClipperRecurrenceType.Day }
76
- ];
77
61
  var ClipperSelectionMode;
78
62
  (function (ClipperSelectionMode) {
79
63
  ClipperSelectionMode[ClipperSelectionMode["None"] = 0] = "None";
@@ -1574,11 +1558,6 @@ const ClipperSources = [
1574
1558
  name: 'Fonti diverse',
1575
1559
  }
1576
1560
  ];
1577
- class ClipperUpdateChannelsStateParams {
1578
- constructor() {
1579
- this.activeChannels = [];
1580
- }
1581
- }
1582
1561
  class ClipperChannelSettings {
1583
1562
  constructor() {
1584
1563
  this.isEnabled = false;
@@ -1799,20 +1778,6 @@ class ClipperDashboard {
1799
1778
  return this.unreadItems().reduce((acc, item) => acc + item[1], 0);
1800
1779
  }
1801
1780
  }
1802
- var ClipperTeamProduct;
1803
- (function (ClipperTeamProduct) {
1804
- ClipperTeamProduct[ClipperTeamProduct["SharedArchive"] = 1004676] = "SharedArchive";
1805
- ClipperTeamProduct[ClipperTeamProduct["SharedCalendar"] = 1004683] = "SharedCalendar";
1806
- ClipperTeamProduct[ClipperTeamProduct["SharedNotes"] = 1013721] = "SharedNotes";
1807
- })(ClipperTeamProduct || (ClipperTeamProduct = {}));
1808
- var ClipperTeamProductPermission;
1809
- (function (ClipperTeamProductPermission) {
1810
- ClipperTeamProductPermission[ClipperTeamProductPermission["SharedNotes"] = 55] = "SharedNotes";
1811
- ClipperTeamProductPermission[ClipperTeamProductPermission["SharedArchive"] = 56] = "SharedArchive";
1812
- ClipperTeamProductPermission[ClipperTeamProductPermission["SharedCalendar"] = 57] = "SharedCalendar";
1813
- })(ClipperTeamProductPermission || (ClipperTeamProductPermission = {}));
1814
- class ClipperTeamInfo {
1815
- }
1816
1781
  var ClipperCalendarState;
1817
1782
  (function (ClipperCalendarState) {
1818
1783
  ClipperCalendarState[ClipperCalendarState["Open"] = 101] = "Open";
@@ -1832,53 +1797,6 @@ class ClipperCalendarSearchParams {
1832
1797
  this.count = 15;
1833
1798
  }
1834
1799
  }
1835
- var ClipperCalendarCopyMode;
1836
- (function (ClipperCalendarCopyMode) {
1837
- ClipperCalendarCopyMode[ClipperCalendarCopyMode["Duplicate"] = 1] = "Duplicate";
1838
- ClipperCalendarCopyMode[ClipperCalendarCopyMode["Move"] = 2] = "Move";
1839
- })(ClipperCalendarCopyMode || (ClipperCalendarCopyMode = {}));
1840
- var ClipperArchiveFileType;
1841
- (function (ClipperArchiveFileType) {
1842
- ClipperArchiveFileType[ClipperArchiveFileType["None"] = 0] = "None";
1843
- ClipperArchiveFileType[ClipperArchiveFileType["Procedure"] = 1] = "Procedure";
1844
- ClipperArchiveFileType[ClipperArchiveFileType["OperatingInstructions"] = 2] = "OperatingInstructions";
1845
- ClipperArchiveFileType[ClipperArchiveFileType["TechnicalReport"] = 3] = "TechnicalReport";
1846
- ClipperArchiveFileType[ClipperArchiveFileType["AdministrativeDocument"] = 4] = "AdministrativeDocument";
1847
- ClipperArchiveFileType[ClipperArchiveFileType["Document"] = 5] = "Document";
1848
- ClipperArchiveFileType[ClipperArchiveFileType["OtherApplicableRules"] = 6] = "OtherApplicableRules";
1849
- ClipperArchiveFileType[ClipperArchiveFileType["Other"] = 7] = "Other";
1850
- ClipperArchiveFileType[ClipperArchiveFileType["File"] = 101] = "File";
1851
- ClipperArchiveFileType[ClipperArchiveFileType["Image"] = 102] = "Image";
1852
- })(ClipperArchiveFileType || (ClipperArchiveFileType = {}));
1853
- const ClipperArchiveFileTypes = [
1854
- { name: 'File', value: ClipperArchiveFileType.File },
1855
- { name: 'Immagine', value: ClipperArchiveFileType.Image },
1856
- { name: 'Procedura', value: ClipperArchiveFileType.Procedure },
1857
- { name: 'Istruzioni operative', value: ClipperArchiveFileType.OperatingInstructions },
1858
- { name: 'Relazione tecnica', value: ClipperArchiveFileType.TechnicalReport },
1859
- { name: 'Documento iter amministrativo', value: ClipperArchiveFileType.AdministrativeDocument },
1860
- { name: 'Documento aziendale', value: ClipperArchiveFileType.Document },
1861
- { name: 'Altre norme applicabili', value: ClipperArchiveFileType.OtherApplicableRules },
1862
- { name: 'Altro', value: ClipperArchiveFileType.Other }
1863
- ];
1864
- var ClipperArchiveFileStorageType;
1865
- (function (ClipperArchiveFileStorageType) {
1866
- ClipperArchiveFileStorageType[ClipperArchiveFileStorageType["ArsCloud"] = 2] = "ArsCloud";
1867
- ClipperArchiveFileStorageType[ClipperArchiveFileStorageType["OtherCloud"] = 3] = "OtherCloud";
1868
- })(ClipperArchiveFileStorageType || (ClipperArchiveFileStorageType = {}));
1869
- const ClipperArchiveFileStorageTypes = [
1870
- { name: 'ARS Cloud', value: ClipperArchiveFileStorageType.ArsCloud },
1871
- { name: 'Altro cloud', value: ClipperArchiveFileStorageType.OtherCloud }
1872
- ];
1873
- class ClipperArchiveFoldersSearchParams {
1874
- }
1875
- class ClipperArchiveFilesSearchParams {
1876
- }
1877
- var ClipperArchiveCopyMode;
1878
- (function (ClipperArchiveCopyMode) {
1879
- ClipperArchiveCopyMode[ClipperArchiveCopyMode["Duplicate"] = 1] = "Duplicate";
1880
- ClipperArchiveCopyMode[ClipperArchiveCopyMode["Move"] = 2] = "Move";
1881
- })(ClipperArchiveCopyMode || (ClipperArchiveCopyMode = {}));
1882
1800
  class ClipperUtils {
1883
1801
  /**
1884
1802
  * Returns `true` when the given model corresponds to a readable document type
@@ -2180,16 +2098,6 @@ class ClipperSearchUtils {
2180
2098
  }
2181
2099
  }
2182
2100
 
2183
- const NotesColors = [{ name: "Verde", value: "#2E8B74" },
2184
- { name: "Viola", value: "#9B59B6" },
2185
- { name: "Giallo", value: "#E8A838" },
2186
- { name: "Ciano", value: "#17A8BA" },
2187
- { name: "Arancione", value: "#FD7E14" },
2188
- { name: "Magenta", value: "#E91E8C" },
2189
- { name: "Grigio", value: "#6C757D" },
2190
- { name: "Indaco", value: "#5B6EBF" }
2191
- ];
2192
-
2193
2101
  /** Minimum milliseconds between consecutive error broadcasts (debounce guard). */
2194
2102
  const ERROR_DEBOUNCE_MS = 5000;
2195
2103
  /**
@@ -2338,14 +2246,6 @@ class ClipperDocumentsService {
2338
2246
  sendTo(params) {
2339
2247
  return this.httpClient.post(this.core.serviceUri + '/documents/send', params);
2340
2248
  }
2341
- /**
2342
- * Sends an email notification about a document note update to the specified recipients.
2343
- * @param params - The notification parameters including recipients and note details.
2344
- * @returns An observable emitting the API result wrapping the note tracking update.
2345
- */
2346
- notifyNoteTo(params) {
2347
- return this.httpClient.post(this.core.serviceUri + '/documents/notes/notify', params);
2348
- }
2349
2249
  /**
2350
2250
  * Retrieves the full document report page.
2351
2251
  * @param id - The ID of the document.
@@ -2381,7 +2281,7 @@ class ClipperDocumentsService {
2381
2281
  /**
2382
2282
  * Gets the last-update metadata for a document.
2383
2283
  * @param id - The ID of the document.
2384
- * @returns An observable emitting the API result wrapping the last update string and its notes.
2284
+ * @returns An observable emitting the API result wrapping the last update string.
2385
2285
  */
2386
2286
  metadata(id) {
2387
2287
  return this.httpClient.get(this.core.serviceUri + '/documents/metadata/' + id);
@@ -2822,8 +2722,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
2822
2722
  * Shared state and bootstrap for the Clipper application.
2823
2723
  *
2824
2724
  * Holds every piece of state used by more than one feature service (service URI,
2825
- * flags, login context, teams, dashboard, working-documents bag, channels and the
2826
- * various UI signals) plus the low-level helpers that mutate that state.
2725
+ * flags, login context, dashboard, working-documents bag, channels and the various
2726
+ * UI signals) plus the low-level helpers that mutate that state.
2827
2727
  *
2828
2728
  * The feature services (`ClipperLoginService`, `ClipperDocumentsService`, ...) inject
2829
2729
  * this service to read shared state and call shared helpers. `ClipperService` (the
@@ -2857,7 +2757,6 @@ class ClipperCoreService {
2857
2757
  ...(ngDevMode ? [{ debugName: "bagTotal" }] : /* istanbul ignore next */ []));
2858
2758
  this.visible = signal(false, /* @ts-ignore */
2859
2759
  ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
2860
- this._teams = [];
2861
2760
  this.availableChannels = signal([], /* @ts-ignore */
2862
2761
  ...(ngDevMode ? [{ debugName: "availableChannels" }] : /* istanbul ignore next */ []));
2863
2762
  this.activeChannels = computed(() => {
@@ -2866,8 +2765,6 @@ class ClipperCoreService {
2866
2765
  ...(ngDevMode ? [{ debugName: "activeChannels" }] : /* istanbul ignore next */ []));
2867
2766
  this.allowTags = signal(false, /* @ts-ignore */
2868
2767
  ...(ngDevMode ? [{ debugName: "allowTags" }] : /* istanbul ignore next */ []));
2869
- this.pendingNotes = signal(undefined, /* @ts-ignore */
2870
- ...(ngDevMode ? [{ debugName: "pendingNotes" }] : /* istanbul ignore next */ []));
2871
2768
  }
2872
2769
  /** @returns The URI of the Clipper web application, or `undefined` if not set. */
2873
2770
  get appUri() {
@@ -2897,10 +2794,6 @@ class ClipperCoreService {
2897
2794
  }
2898
2795
  return this._loginInfo;
2899
2796
  }
2900
- /** @returns The shared teams collection. */
2901
- get teams() {
2902
- return this._teams;
2903
- }
2904
2797
  ////
2905
2798
  // SHARED MUTATORS
2906
2799
  ////
@@ -2924,14 +2817,6 @@ class ClipperCoreService {
2924
2817
  setLoggedIn(value) {
2925
2818
  this._loggedIn.set(value);
2926
2819
  }
2927
- /**
2928
- * Replaces the shared teams collection (populated by the calendar, archive and
2929
- * collaboration queries).
2930
- * @param teams - The teams to store.
2931
- */
2932
- setTeams(teams) {
2933
- this._teams = teams;
2934
- }
2935
2820
  /**
2936
2821
  * Persists the current login context to `localStorage`.
2937
2822
  */
@@ -3090,100 +2975,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
3090
2975
  }] });
3091
2976
 
3092
2977
  /**
3093
- * Account management: password reset/recovery, settings, channel activation, trial info
3094
- * and user links. Channel state lives in `ClipperCoreService`; the channel-mutating
3095
- * helpers (`setChannels`, `setChannelsState`, `updateChannels`) live here.
2978
+ * The two pieces of account state the document views actually move: which channels are
2979
+ * active, and the unread counters on the dashboard.
2980
+ *
2981
+ * Everything else an account can do — password reset and recovery, settings, channel
2982
+ * activation towards the server, trial info, user links, loading the dashboard — belongs to
2983
+ * the application that owns the account, not to a library whose job is showing documents.
2984
+ * It was removed on 2026-08-25 together with the archive, calendar and collaboration worlds;
2985
+ * a product that needs those endpoints calls them itself.
2986
+ *
2987
+ * What is left touches no HTTP: both methods only mutate the shared state in
2988
+ * `ClipperCoreService` and announce the change on the broadcast bus.
3096
2989
  */
3097
2990
  class ClipperAccountService {
3098
2991
  constructor() {
3099
- this.httpClient = inject(HttpClient);
3100
2992
  this.broadcastService = inject(BroadcastService);
3101
2993
  this.core = inject(ClipperCoreService);
3102
2994
  }
3103
- /**
3104
- * Resets the user's password using the provided parameters.
3105
- * @param params - The new password and confirmation data.
3106
- * @returns An observable emitting the API result wrapping the reset password payload.
3107
- */
3108
- resetPassword(params) {
3109
- return this.httpClient.post(this.core.serviceUri + '/account/password/reset', params);
3110
- }
3111
- /**
3112
- * Initiates a password recovery flow by sending a reset link to the user's email.
3113
- * @param params - The password recovery request data.
3114
- * @returns An observable emitting the API result wrapping a boolean success flag.
3115
- */
3116
- recoverPassword(params) {
3117
- return this.httpClient.post(this.core.serviceUri + '/account/password/recover', params);
3118
- }
3119
- /**
3120
- * Gets the current user account settings.
3121
- * @returns An observable emitting the API result wrapping the account settings.
3122
- */
3123
- getSettings() {
3124
- return this.httpClient.get(this.core.serviceUri + '/account/settings');
3125
- }
3126
- /**
3127
- * Updates user account settings and applies any channel configuration changes.
3128
- * @param params - A map of settings key-value pairs to update.
3129
- * @returns An observable emitting the API result wrapping a boolean success flag.
3130
- */
3131
- updateSettings(params) {
3132
- return this.httpClient.post(this.core.serviceUri + '/account/settings/update', params).pipe(map(r => {
3133
- if (r.success) {
3134
- if (params.channels) {
3135
- this.setChannels(params.channels);
3136
- }
3137
- }
3138
- return r;
3139
- }));
3140
- }
3141
- /**
3142
- * Saves updated channel activation states to the server and applies the new dashboard result.
3143
- * @param params - The channel state update parameters.
3144
- * @returns An observable emitting the API result wrapping the dashboard result.
3145
- */
3146
- updateChannelsState(params) {
3147
- return this.httpClient.post(this.core.serviceUri + '/account/settings/channels/update', params).pipe(map(r => {
3148
- if (r.success) {
3149
- this.setChannelsState(r.value);
3150
- }
3151
- return r;
3152
- }));
3153
- }
3154
- /**
3155
- * Applies a new dashboard result: updates channel settings, dashboard counters, and
3156
- * re-initialises the available-channels signal.
3157
- * @param value - The dashboard result containing updated channel and counter data.
3158
- */
3159
- setChannelsState(value) {
3160
- // Update channels
3161
- const info = this.core.loginInfo;
3162
- if (info) {
3163
- info.channels = value.channels ?? [];
3164
- }
3165
- // Update dashboard
3166
- this.core.dashboard.documentUpdates = value.documentUpdates;
3167
- this.core.dashboard.expiredDeadlines = value.expiredDeadlines;
3168
- this.core.dashboard.expiringDeadlines = value.expiringDeadlines;
3169
- this.core.dashboard.isTrial = value.isTrial;
3170
- this.core.dashboard.items.set(value.items ?? []);
3171
- this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
3172
- this.core.storeContext();
3173
- this.core.initializeChannels();
3174
- }
3175
- /**
3176
- * Replaces the stored channel settings and re-initialises the available-channels signal.
3177
- * @param channels - The new channel settings to store and activate.
3178
- */
3179
- setChannels(channels) {
3180
- const info = this.core.loginInfo;
3181
- if (info) {
3182
- info.channels = channels;
3183
- this.core.storeContext();
3184
- this.core.initializeChannels();
3185
- }
3186
- }
3187
2995
  /**
3188
2996
  * Toggles the active state of available channels based on the supplied selection list.
3189
2997
  * @param values - The selected channel items; channels absent from this list are deactivated.
@@ -3195,79 +3003,6 @@ class ClipperAccountService {
3195
3003
  }
3196
3004
  });
3197
3005
  }
3198
- /**
3199
- * Gets the trial info for the current account.
3200
- * @returns An observable emitting the API result wrapping the trial info.
3201
- */
3202
- getTrialInfo() {
3203
- return this.httpClient.get(this.core.serviceUri + '/account/trial');
3204
- }
3205
- /**
3206
- * Refreshes the trial status from the server and updates the stored login context.
3207
- */
3208
- updateTrialInfo() {
3209
- const info = this.core.loginInfo;
3210
- if (!info || info?.context?.hasTrial === false)
3211
- return; // Not supported
3212
- this.getTrialInfo().subscribe((r) => {
3213
- if (r.success) {
3214
- if (info?.context) {
3215
- if (r.value) {
3216
- info.context.hasTrial = true;
3217
- info.context.trialInfo = r.value;
3218
- }
3219
- else {
3220
- info.context.hasTrial = false;
3221
- info.context.trialInfo = undefined;
3222
- }
3223
- }
3224
- }
3225
- });
3226
- }
3227
- /**
3228
- * Creates or updates a user link record.
3229
- * @param item - The user link data to save.
3230
- * @returns An observable emitting the API result wrapping a boolean success flag.
3231
- */
3232
- saveLink(item) {
3233
- return this.httpClient.post(this.core.serviceUri + '/account/links/save', item);
3234
- }
3235
- /**
3236
- * Deletes a user link record.
3237
- * @param item - The user link to remove.
3238
- * @returns An observable emitting the API result wrapping a boolean success flag.
3239
- */
3240
- deleteLink(item) {
3241
- return this.httpClient.post(this.core.serviceUri + '/account/links/delete', item);
3242
- }
3243
- ///
3244
- // DASHBOARD
3245
- ///
3246
- /**
3247
- * Retrieves the current dashboard and applies its counters to the shared dashboard state.
3248
- * @returns The subscription to the dashboard request.
3249
- */
3250
- loadDashboard() {
3251
- return this.httpClient
3252
- .post(this.core.serviceUri + '/account/dashboard', { refreshing: true }).subscribe((r) => {
3253
- if (r.success) {
3254
- this.core.dashboard.documentUpdates = r.value.documentUpdates;
3255
- this.core.dashboard.expiredDeadlines = r.value.expiredDeadlines;
3256
- this.core.dashboard.expiringDeadlines = r.value.expiringDeadlines;
3257
- this.core.dashboard.isTrial = r.value.isTrial;
3258
- this.core.dashboard.items.set(r.value.items ?? []);
3259
- this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
3260
- }
3261
- });
3262
- }
3263
- /**
3264
- * Retrieves documents updated in the last 15 days for the given search parameters.
3265
- * @param params - The search parameters to filter results.
3266
- * @returns An observable emitting the API result wrapping the last-days result.
3267
- */
3268
- last15Days(params) {
3269
- return this.httpClient.post(this.core.serviceUri + '/account/last-15-days', params);
3270
- }
3271
3006
  /**
3272
3007
  * Adjusts the unread-item counter for the given module and broadcasts a dashboard update.
3273
3008
  * @param module - The Clipper module whose counter should be adjusted.
@@ -3288,410 +3023,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
3288
3023
  type: Service
3289
3024
  }] });
3290
3025
 
3291
- /**
3292
- * Document archive: folders and files search, save, copy, delete, import/export and download.
3293
- */
3294
- class ClipperArchiveService {
3295
- constructor() {
3296
- this.httpClient = inject(HttpClient);
3297
- this.core = inject(ClipperCoreService);
3298
- }
3299
- /**
3300
- * Retrieves all archive folders matching the given search parameters and stores the
3301
- * returned teams in the shared state.
3302
- * @param params - The folder search parameters.
3303
- * @returns An observable emitting the API result wrapping the folders search result.
3304
- */
3305
- getArchiveFolders(params) {
3306
- return this.httpClient
3307
- .post(this.core.serviceUri + '/archive/folders', params)
3308
- .pipe(map((r) => {
3309
- // Store teams
3310
- if (r.success) {
3311
- this.core.setTeams(r.value.teams);
3312
- }
3313
- return r;
3314
- }));
3315
- }
3316
- /**
3317
- * Creates or updates an archive folder.
3318
- * @param params - The folder data to save.
3319
- * @returns An observable emitting the API result wrapping the saved folder.
3320
- */
3321
- saveArchiveFolder(params) {
3322
- return this.httpClient.post(this.core.serviceUri + '/archive/folders/save', params);
3323
- }
3324
- /**
3325
- * Exports archive folders as a downloadable file.
3326
- * @param id - The folder ID to export, or `undefined` to export all folders.
3327
- * @param teamId - The optional team ID. Defaults to `undefined` (personal workspace).
3328
- * @returns An observable emitting the exported folders content as a blob.
3329
- */
3330
- exportArchiveFolders(id, teamId) {
3331
- let url = this.core.serviceUri + '/archive/export/?';
3332
- if (id) {
3333
- url += 'id=' + id;
3334
- }
3335
- if (teamId) {
3336
- if (id) {
3337
- url += '&';
3338
- }
3339
- url += 'team=' + teamId;
3340
- }
3341
- return this.httpClient.get(url, {
3342
- headers: new HttpHeaders({
3343
- 'Content-Type': 'application/octet-stram'
3344
- }),
3345
- responseType: 'blob'
3346
- });
3347
- }
3348
- /**
3349
- * Uploads and imports archive folders from a file.
3350
- * @param params - The import parameters including the source file and destination folder.
3351
- * @returns An observable of HTTP events reporting upload progress and the final response.
3352
- */
3353
- importArchiveFolders(params) {
3354
- // Prepare form
3355
- const formData = new FormData();
3356
- formData.append(params.file.name, params.file);
3357
- formData.append('sourceFileName', params.file.name);
3358
- formData.append('overwrite', params.overwrite === true ? "true" : "false");
3359
- if (params.destFolderId) {
3360
- formData.append('destFolderId', params.destFolderId);
3361
- }
3362
- if (params.teamId) {
3363
- formData.append('teamId', params.teamId);
3364
- }
3365
- // Create request
3366
- return this.httpClient.request(new HttpRequest('POST', this.core.serviceUri + '/archive/import/', formData, { reportProgress: true }));
3367
- }
3368
- /**
3369
- * Retrieves archive files and folders matching the given search parameters.
3370
- * @param params - The archive files search parameters.
3371
- * @returns An observable emitting the API result wrapping the files search result.
3372
- */
3373
- queryArchiveItems(params) {
3374
- return this.httpClient.post(this.core.serviceUri + '/archive/files', params);
3375
- }
3376
- /**
3377
- * Deletes one or more archive files or folders.
3378
- * @param params - The delete operation parameters.
3379
- * @returns An observable emitting the API result wrapping the number of deleted items.
3380
- */
3381
- deleteArchiveItems(params) {
3382
- return this.httpClient.post(this.core.serviceUri + '/archive/files/delete', params);
3383
- }
3384
- /**
3385
- * Copies archive files or folders to a destination folder.
3386
- * @param params - The copy operation parameters.
3387
- * @returns An observable emitting the API result wrapping the number of copied items.
3388
- */
3389
- copyArchiveItems(params) {
3390
- return this.httpClient.post(this.core.serviceUri + '/archive/files/copy', params);
3391
- }
3392
- /**
3393
- * Uploads and saves an archive file using multipart form data.
3394
- * @param params - The file metadata and binary content to save.
3395
- * @returns An observable of HTTP events reporting upload progress and the final response.
3396
- */
3397
- saveArchiveFile(params) {
3398
- // Prepare form
3399
- const formData = new FormData();
3400
- if (params.file)
3401
- formData.append(params.file.file.name, params.file.file);
3402
- if (params.id)
3403
- formData.append('id', params.id);
3404
- if (params.folderId) {
3405
- formData.append('folderId', params.folderId);
3406
- }
3407
- if (params.topicId && params.topicPath) {
3408
- formData.append('topicId', params.topicId);
3409
- formData.append('topicPath', params.topicPath);
3410
- }
3411
- if (params.title1)
3412
- formData.append('title1', params.title1);
3413
- if (params.title2)
3414
- formData.append('title2', params.title2);
3415
- if (params.origin)
3416
- formData.append('origin', params.origin);
3417
- if (params.originDescription) {
3418
- formData.append('originDescription', params.originDescription);
3419
- }
3420
- if (params.documentId)
3421
- formData.append('documentId', params.documentId);
3422
- if (params.documentIds)
3423
- formData.append('documentIds', params.documentIds);
3424
- if (params.binaryId)
3425
- formData.append('binaryId', params.binaryId?.toString());
3426
- if (params.tags)
3427
- formData.append('tags', params.tags);
3428
- if (params.notes)
3429
- formData.append('notes', params.notes);
3430
- if (params.fileName)
3431
- formData.append('fileName', params.fileName);
3432
- if (params.fileType)
3433
- formData.append('fileType', params.fileType.toString());
3434
- if (params.storageType)
3435
- formData.append('storageType', params.storageType.toString());
3436
- if (params.model)
3437
- formData.append('model', params.model.toString());
3438
- // Create request
3439
- return this.httpClient.request(new HttpRequest('POST', this.core.serviceUri + '/archive/files/save', formData, { reportProgress: true }));
3440
- }
3441
- /**
3442
- * Retrieves the metadata for a single archive file.
3443
- * @param id - The ID of the archive file to retrieve.
3444
- * @returns An observable emitting the API result wrapping the archive file info.
3445
- */
3446
- getArchiveFile(id) {
3447
- return this.httpClient.get(this.core.serviceUri + '/archive/files/' + id);
3448
- }
3449
- /**
3450
- * Downloads the binary content of an archive file.
3451
- * @param id - The binary ID of the file to download.
3452
- * @param otp - An optional one-time password for authenticated downloads.
3453
- * @returns An observable emitting the file binary content as a blob.
3454
- */
3455
- downloadArchiveFile(id, otp) {
3456
- return this.httpClient.get(this.core.serviceUri + '/archive/files/download/?id=' + id + '&otp=' + (otp ?? ''), { responseType: 'blob' });
3457
- }
3458
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ClipperArchiveService, deps: [], target: i0.ɵɵFactoryTarget.Service }); }
3459
- static { this.ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.3", ngImport: i0, type: ClipperArchiveService }); }
3460
- }
3461
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ClipperArchiveService, decorators: [{
3462
- type: Service
3463
- }] });
3464
-
3465
- /**
3466
- * Calendar deadlines: search, snapshot, save/copy/close/delete and iCalendar export.
3467
- */
3468
- class ClipperCalendarService {
3469
- constructor() {
3470
- this.httpClient = inject(HttpClient);
3471
- this.core = inject(ClipperCoreService);
3472
- }
3473
- /**
3474
- * Queries the calendar and stores the returned teams in the shared state.
3475
- * @param params - The calendar search parameters.
3476
- * @returns An observable emitting the API result wrapping the calendar search result.
3477
- */
3478
- queryCalendar(params) {
3479
- return this.httpClient.post(this.core.serviceUri + '/calendar', params)
3480
- .pipe(map((r) => {
3481
- // Store teams
3482
- if (r.success) {
3483
- this.core.setTeams(r.value.teams);
3484
- }
3485
- return r;
3486
- }));
3487
- }
3488
- /**
3489
- * Gets the calendar snapshot.
3490
- * @param params - The calendar search parameters.
3491
- * @returns An observable emitting the API result wrapping the calendar snapshot result.
3492
- */
3493
- calendarSnapshot(params) {
3494
- return this.httpClient.post(this.core.serviceUri + '/calendar/snapshot', params);
3495
- }
3496
- /**
3497
- * Deletes one or more calendar deadlines by ID.
3498
- * @param ids - The IDs of the deadlines to delete.
3499
- * @returns An observable emitting the API result wrapping the number of deleted deadlines.
3500
- */
3501
- deleteCalendarDeadlines(ids) {
3502
- return this.httpClient.post(this.core.serviceUri + '/calendar/delete', { ids: ids });
3503
- }
3504
- /**
3505
- * Copies one or more calendar deadlines using the given parameters.
3506
- * @param params - The copy operation parameters.
3507
- * @returns An observable emitting the API result wrapping the number of copied deadlines.
3508
- */
3509
- copyCalendarDeadlines(params) {
3510
- return this.httpClient.post(this.core.serviceUri + '/calendar/copy', params);
3511
- }
3512
- /**
3513
- * Marks the given calendar deadline as closed.
3514
- * @param id - The ID of the deadline to close.
3515
- * @returns An observable emitting the API result wrapping the updated deadline.
3516
- */
3517
- closeCalendarDeadline(id) {
3518
- return this.httpClient.post(this.core.serviceUri + '/calendar/close', { id: id });
3519
- }
3520
- /**
3521
- * Creates or updates a calendar deadline.
3522
- * @param params - The deadline data to save.
3523
- * @returns An observable emitting the API result wrapping the saved deadlines.
3524
- */
3525
- saveCalendarDeadline(params) {
3526
- return this.httpClient.post(this.core.serviceUri + '/calendar/save', params);
3527
- }
3528
- /**
3529
- * Retrieves a single calendar deadline by its ID.
3530
- * @param id - The ID of the deadline to retrieve.
3531
- * @returns An observable emitting the API result wrapping the deadline.
3532
- */
3533
- getCalendarDeadline(id) {
3534
- return this.httpClient.get(this.core.serviceUri + '/calendar/' + id);
3535
- }
3536
- /**
3537
- * Exports the selected deadlines in iCalendar (.ics) format.
3538
- * @param ids - The IDs of the deadlines to export.
3539
- * @returns An observable emitting the iCalendar content as a blob.
3540
- */
3541
- exportCalendarDeadlines(ids) {
3542
- return this.httpClient.post(this.core.serviceUri + '/calendar/export', { ids: ids }, {
3543
- responseType: 'blob'
3544
- });
3545
- }
3546
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ClipperCalendarService, deps: [], target: i0.ɵɵFactoryTarget.Service }); }
3547
- static { this.ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.3", ngImport: i0, type: ClipperCalendarService }); }
3548
- }
3549
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ClipperCalendarService, decorators: [{
3550
- type: Service
3551
- }] });
3552
-
3553
- /**
3554
- * Collaboration: teams and team members, contacts and shared document notes.
3555
- */
3556
- class ClipperCollaborationService {
3557
- constructor() {
3558
- this.httpClient = inject(HttpClient);
3559
- this.core = inject(ClipperCoreService);
3560
- }
3561
- /**
3562
- * Renames the current user's team.
3563
- * @param newName - The new display name for the team.
3564
- * @returns An observable emitting the API result wrapping the updated team info.
3565
- */
3566
- renameTeam(newName) {
3567
- return this.httpClient.post(this.core.serviceUri + '/account/teams/update', { title: newName });
3568
- }
3569
- /**
3570
- * Retrieves the list of teams available to the current user. When not querying
3571
- * admins only, the result is also stored in the shared teams state.
3572
- * @param params - The teams search parameters.
3573
- * @returns An observable emitting the API result wrapping the teams search result.
3574
- */
3575
- getTeams(params) {
3576
- return this.httpClient.post(this.core.serviceUri + '/account/teams', params)
3577
- .pipe(map((r) => {
3578
- // Store teams
3579
- if (!params.adminsOnly) {
3580
- this.core.setTeams(r.value.items);
3581
- }
3582
- return r;
3583
- }));
3584
- }
3585
- /**
3586
- * Retrieves the members of a team matching the given search parameters.
3587
- * @param params - The team members search parameters.
3588
- * @returns An observable emitting the API result wrapping the team members search result.
3589
- */
3590
- getTeamMembers(params) {
3591
- return this.httpClient.post(this.core.serviceUri + '/account/teams/members', params);
3592
- }
3593
- /**
3594
- * Removes the specified members from the team.
3595
- * @param teamId - The ID of the team.
3596
- * @param ids - The numeric IDs of the team members to remove.
3597
- * @returns An observable emitting the API result wrapping the number of removed members.
3598
- */
3599
- deleteTeamMembers(teamId, ids) {
3600
- return this.httpClient.post(this.core.serviceUri + '/account/teams/members/delete', { teamId: teamId, ids: ids });
3601
- }
3602
- /**
3603
- * Creates or updates a team member record.
3604
- * @param item - The team member data to save.
3605
- * @returns An observable emitting the API result wrapping the saved team member.
3606
- */
3607
- saveTeamMember(item) {
3608
- return this.httpClient.post(this.core.serviceUri + '/account/teams/members/save', item);
3609
- }
3610
- /**
3611
- * Retrieves contacts matching the given search parameters.
3612
- * @param params - The contacts search parameters.
3613
- * @returns An observable emitting the API result wrapping the contacts query result.
3614
- */
3615
- queryContacts(params) {
3616
- return this.httpClient.post(this.core.serviceUri + '/account/contacts', params);
3617
- }
3618
- /**
3619
- * Deletes the specified contacts.
3620
- * @param ids - The numeric IDs of the contacts to remove.
3621
- * @returns An observable emitting the API result wrapping the number of deleted contacts.
3622
- */
3623
- deleteContacts(ids) {
3624
- return this.httpClient.post(this.core.serviceUri + '/account/contacts/delete', { ids: ids });
3625
- }
3626
- /**
3627
- * Creates or updates a contact record.
3628
- * @param item - The contact data to save.
3629
- * @returns An observable emitting the API result wrapping the saved contact.
3630
- */
3631
- saveContact(item) {
3632
- return this.httpClient.post(this.core.serviceUri + '/account/contacts/save', item);
3633
- }
3634
- /**
3635
- * Retrieves document notes matching the given search parameters and stores the
3636
- * returned teams in the shared state.
3637
- * @param params - The notes search parameters.
3638
- * @returns An observable emitting the API result wrapping the notes search result.
3639
- */
3640
- queryNotes(params) {
3641
- return this.httpClient.post(this.core.serviceUri + '/account/notes', params).pipe(map((r) => {
3642
- // Store teams
3643
- if (r.success) {
3644
- this.core.setTeams(r.value.teams);
3645
- }
3646
- return r;
3647
- }));
3648
- }
3649
- /**
3650
- * Deletes the specified document notes.
3651
- * @param ids - The numeric IDs of the notes to remove.
3652
- * @returns An observable emitting the API result wrapping the number of deleted notes.
3653
- */
3654
- deleteNotes(ids) {
3655
- return this.httpClient.post(this.core.serviceUri + '/account/notes/delete', { ids: ids });
3656
- }
3657
- /**
3658
- * Creates or updates a document note.
3659
- * @param item - The note data to save.
3660
- * @returns An observable emitting the API result wrapping the saved note.
3661
- */
3662
- saveNote(item) {
3663
- return this.httpClient.post(this.core.serviceUri + '/account/notes/save', item);
3664
- }
3665
- /**
3666
- * Retrieves the tracking history for the given document note.
3667
- * @param id - The numeric ID of the note whose tracking records to retrieve.
3668
- * @returns An observable emitting the API result wrapping the note tracking records.
3669
- */
3670
- getNoteTrackings(id) {
3671
- return this.httpClient.get(this.core.serviceUri + '/account/notes/trackings/' + id);
3672
- }
3673
- /**
3674
- * Gets the count of troubled tracking notifications for document notes,
3675
- * which can be used to display an unread counter in the UI.
3676
- * @returns An observable emitting the API result wrapping the troubled tracking count.
3677
- */
3678
- countNotesTrackingsTroubled() {
3679
- return this.httpClient.get(this.core.serviceUri + '/account/notes/trackings/troubled');
3680
- }
3681
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ClipperCollaborationService, deps: [], target: i0.ɵɵFactoryTarget.Service }); }
3682
- static { this.ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.3", ngImport: i0, type: ClipperCollaborationService }); }
3683
- }
3684
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ClipperCollaborationService, decorators: [{
3685
- type: Service
3686
- }] });
3687
-
3688
3026
  /**
3689
3027
  * Barrel / facade for the Clipper application.
3690
3028
  *
3691
3029
  * Exposes the feature services as named properties and re-exports the shared state
3692
3030
  * declared in `ClipperCoreService`. Inject `ClipperService` and reach a feature via
3693
- * its property, e.g. `clipper.login.login(...)`, `clipper.documents.query(...)`,
3694
- * `clipper.calendar.queryCalendar(...)`.
3031
+ * its property, e.g. `clipper.session.login(...)`, `clipper.documents.query(...)`,
3032
+ * `clipper.account.updateUnreadItems(...)`.
3695
3033
  */
3696
3034
  class ClipperService {
3697
3035
  constructor() {
@@ -3700,14 +3038,8 @@ class ClipperService {
3700
3038
  this.session = inject(ClipperLoginService);
3701
3039
  /** Document search, references, export, working-documents bag and saved searches. */
3702
3040
  this.documents = inject(ClipperDocumentsService);
3703
- /** Account settings, dashboard, password, channels, trial info and user links. */
3041
+ /** The account state the document views move: active channels and unread counters. */
3704
3042
  this.account = inject(ClipperAccountService);
3705
- /** Archive folders and files. */
3706
- this.archive = inject(ClipperArchiveService);
3707
- /** Calendar deadlines. */
3708
- this.calendar = inject(ClipperCalendarService);
3709
- /** Teams, contacts and shared notes. */
3710
- this.collaboration = inject(ClipperCollaborationService);
3711
3043
  }
3712
3044
  ////
3713
3045
  // RE-EXPORTED CORE STATE
@@ -3738,16 +3070,12 @@ class ClipperService {
3738
3070
  get bagTotal() { return this.core.bagTotal; }
3739
3071
  /** @returns A signal controlling the Clipper UI visibility. */
3740
3072
  get visible() { return this.core.visible; }
3741
- /** @returns The shared teams collection. */
3742
- get teams() { return this.core.teams; }
3743
3073
  /** @returns A signal holding the available channels. */
3744
3074
  get availableChannels() { return this.core.availableChannels; }
3745
3075
  /** @returns A computed signal with the currently active channels. */
3746
3076
  get activeChannels() { return this.core.activeChannels; }
3747
3077
  /** @returns A signal indicating whether tagging is allowed. */
3748
3078
  get allowTags() { return this.core.allowTags; }
3749
- /** @returns A signal with the number of pending notes, or `undefined` if unknown. */
3750
- get pendingNotes() { return this.core.pendingNotes; }
3751
3079
  ////
3752
3080
  // BOOTSTRAP
3753
3081
  ////
@@ -3788,5 +3116,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
3788
3116
  * Generated bundle index. Do not edit.
3789
3117
  */
3790
3118
 
3791
- export { ClipperAccountService, ClipperArchiveCopyMode, ClipperArchiveFileStorageType, ClipperArchiveFileStorageTypes, ClipperArchiveFileType, ClipperArchiveFileTypes, ClipperArchiveFilesSearchParams, ClipperArchiveFoldersSearchParams, ClipperArchiveService, ClipperAuthors, ClipperCalendarCopyMode, ClipperCalendarSearchParams, ClipperCalendarService, ClipperCalendarState, ClipperCalendarStates, ClipperChannel, ClipperChannelSettings, ClipperChannels, ClipperCollaborationService, ClipperCoreService, ClipperDashboard, ClipperDocumentChangeReasons, ClipperDocumentContainer, ClipperDocumentsService, ClipperExportDocumentsFormat, ClipperFacet, ClipperLoginService, ClipperMessages, ClipperModel, ClipperModels, ClipperModule, ClipperModuleGroup, ClipperModuleGroups, ClipperModules, ClipperQueryDocumentFlags, ClipperQueryReferencesMode, ClipperRecurrenceType, ClipperRecurrenceTypes, ClipperRegions, ClipperSearchCalendarSnapshotResult, ClipperSearchFacetsSnapshot, ClipperSearchParams, ClipperSearchResult, ClipperSearchUtils, ClipperSectorTypes, ClipperSectors, ClipperSelectionMode, ClipperService, ClipperServiceFlags, ClipperSort, ClipperSources, ClipperTeamInfo, ClipperTeamProduct, ClipperTeamProductPermission, ClipperUpdateChannelsStateParams, ClipperUtils, NotesColors, clipperAuthInterceptor };
3119
+ export { ClipperAccountService, ClipperAuthors, ClipperCalendarSearchParams, ClipperCalendarState, ClipperCalendarStates, ClipperChannel, ClipperChannelSettings, ClipperChannels, ClipperCoreService, ClipperDashboard, ClipperDocumentChangeReasons, ClipperDocumentContainer, ClipperDocumentsService, ClipperExportDocumentsFormat, ClipperFacet, ClipperLoginService, ClipperMessages, ClipperModel, ClipperModels, ClipperModule, ClipperModuleGroup, ClipperModuleGroups, ClipperModules, ClipperQueryDocumentFlags, ClipperQueryReferencesMode, ClipperRegions, ClipperSearchCalendarSnapshotResult, ClipperSearchFacetsSnapshot, ClipperSearchParams, ClipperSearchResult, ClipperSearchUtils, ClipperSectorTypes, ClipperSectors, ClipperSelectionMode, ClipperService, ClipperServiceFlags, ClipperSort, ClipperSources, ClipperUtils, clipperAuthInterceptor };
3792
3120
  //# sourceMappingURL=arsedizioni-ars-utils-clipper.common.mjs.map