@arsedizioni/ars-utils 22.0.37 → 22.0.40

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arsedizioni/ars-utils",
3
- "version": "22.0.37",
3
+ "version": "22.0.40",
4
4
  "author": {
5
5
  "email": "software@arsedizioni.it",
6
6
  "name": "Fabio Buscaroli, Alberto Doria"
@@ -1683,17 +1683,29 @@ declare class ClipperLoginService {
1683
1683
  * @returns An observable that completes once the logout request has been processed.
1684
1684
  */
1685
1685
  logout(forget?: boolean): rxjs.Observable<any>;
1686
- /**
1687
- * Clears all session-storage authentication keys and resets the login state.
1688
- * @param clearOAuthToken - When `true`, the OAuth bearer token is also removed.
1689
- */
1690
- clear(clearOAuthToken?: boolean): void;
1691
1686
  /**
1692
1687
  * Requests a new one-time password for the given repository.
1693
1688
  * @param id - The repository ID for which the OTP should be generated.
1694
1689
  * @returns An observable emitting the API result wrapping the generated OTP info.
1695
1690
  */
1696
1691
  newOTP(id: string): rxjs.Observable<ApiResult<ClipperOTPInfo>>;
1692
+ /**
1693
+ * Persists the current login context to `localStorage`.
1694
+ * Delegates to `ClipperCoreService.storeContext()`.
1695
+ */
1696
+ storeContext(): void;
1697
+ /**
1698
+ * Updates the stored login context with the values from a fresh login result.
1699
+ * Delegates to `ClipperCoreService.updateContext()`.
1700
+ * @param result - The login result containing the new user context and channel settings.
1701
+ */
1702
+ updateContext(result: ClipperLoginResult): void;
1703
+ /**
1704
+ * Clears all session-storage authentication keys and resets the login state.
1705
+ * Delegates to `ClipperCoreService.clear()`.
1706
+ * @param clearOAuthToken - When `true`, the OAuth bearer token is also removed.
1707
+ */
1708
+ clear(clearOAuthToken?: boolean): void;
1697
1709
  static ɵfac: i0.ɵɵFactoryDeclaration<ClipperLoginService, never>;
1698
1710
  static ɵprov: i0.ɵɵInjectableDeclaration<ClipperLoginService>;
1699
1711
  }
@@ -1771,5 +1783,111 @@ declare class ClipperService {
1771
1783
  static ɵprov: i0.ɵɵInjectableDeclaration<ClipperService>;
1772
1784
  }
1773
1785
 
1774
- export { ClipperAccountService, ClipperArchiveCopyMode, ClipperArchiveFileStorageType, ClipperArchiveFileStorageTypes, ClipperArchiveFileType, ClipperArchiveFileTypes, ClipperArchiveFilesSearchParams, ClipperArchiveFoldersSearchParams, ClipperArchiveService, ClipperAuthInterceptor, ClipperAuthors, ClipperCalendarCopyMode, ClipperCalendarSearchParams, ClipperCalendarService, ClipperCalendarState, ClipperCalendarStates, ClipperChannel, ClipperChannelSettings, ClipperChannels, ClipperCollaborationService, 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 };
1786
+ /**
1787
+ * Shared state and bootstrap for the Clipper application.
1788
+ *
1789
+ * Holds every piece of state used by more than one feature service (service URI,
1790
+ * flags, login context, teams, dashboard, working-documents bag, channels and the
1791
+ * various UI signals) plus the low-level helpers that mutate that state.
1792
+ *
1793
+ * The feature services (`ClipperLoginService`, `ClipperDocumentsService`, ...) inject
1794
+ * this service to read shared state and call shared helpers. `ClipperService` (the
1795
+ * barrel/facade) re-exports the state declared here.
1796
+ */
1797
+ declare class ClipperCoreService {
1798
+ private readonly httpClient;
1799
+ private readonly destroyRef;
1800
+ private readonly broadcastService;
1801
+ /** Used to lazily resolve feature services inside `initialize`, avoiding circular DI. */
1802
+ private readonly injector;
1803
+ private broadcastInitialized;
1804
+ private _appUri?;
1805
+ /** @returns The URI of the Clipper web application, or `undefined` if not set. */
1806
+ get appUri(): string | undefined;
1807
+ private _serviceUri;
1808
+ /** @returns The base URI of the Clipper REST API. */
1809
+ get serviceUri(): string;
1810
+ private _flags;
1811
+ /** @returns The active feature flags. */
1812
+ get flags(): ClipperServiceFlags;
1813
+ private _loginInfo?;
1814
+ /**
1815
+ * Lazily loads the login context from `localStorage` on first access.
1816
+ * @returns The current login context, or `undefined` if not authenticated.
1817
+ */
1818
+ get loginInfo(): ClipperLoginInfo | undefined;
1819
+ private readonly _loggedIn;
1820
+ readonly loggedIn: Signal<boolean>;
1821
+ readonly loggingIn: i0.WritableSignal<boolean>;
1822
+ readonly snapshot: i0.WritableSignal<ClipperSearchResult>;
1823
+ readonly supportsRS: i0.WritableSignal<boolean>;
1824
+ readonly referencesSnapshot: i0.WritableSignal<ClipperSearchResult>;
1825
+ readonly dashboard: ClipperDashboard;
1826
+ readonly bag: i0.WritableSignal<ClipperDocumentInfo[]>;
1827
+ readonly bagTotal: Signal<number>;
1828
+ readonly visible: i0.WritableSignal<boolean>;
1829
+ private _teams;
1830
+ /** @returns The shared teams collection. */
1831
+ get teams(): NameValueItem<string>[];
1832
+ readonly availableChannels: i0.WritableSignal<ClipperAvailableChannel[]>;
1833
+ readonly activeChannels: Signal<ClipperAvailableChannel[]>;
1834
+ readonly allowTags: i0.WritableSignal<boolean>;
1835
+ readonly pendingNotes: i0.WritableSignal<number>;
1836
+ /**
1837
+ * Ensures a login-info object exists and returns it for further mutation.
1838
+ * Replaces the inline `if (!this._loginInfo) { ... }` guards now that the field
1839
+ * is private to this service.
1840
+ * @returns The existing login-info object, or a freshly created empty one.
1841
+ */
1842
+ ensureLoginInfo(): ClipperLoginInfo;
1843
+ /**
1844
+ * Sets the logged-in state. The backing signal is read-only to consumers, so the
1845
+ * feature services use this method instead.
1846
+ * @param value - The new logged-in state.
1847
+ */
1848
+ setLoggedIn(value: boolean): void;
1849
+ /**
1850
+ * Replaces the shared teams collection (populated by the calendar, archive and
1851
+ * collaboration queries).
1852
+ * @param teams - The teams to store.
1853
+ */
1854
+ setTeams(teams: NameValueItem<string>[]): void;
1855
+ /**
1856
+ * Persists the current login context to `localStorage`.
1857
+ */
1858
+ storeContext(): void;
1859
+ /**
1860
+ * Updates the stored login context with the values from a fresh login result.
1861
+ * @param result - The login result containing the new user context and channel settings.
1862
+ */
1863
+ updateContext(result: ClipperLoginResult): void;
1864
+ /**
1865
+ * Rebuilds the `availableChannels` signal from the current login context.
1866
+ */
1867
+ initializeChannels(): void;
1868
+ /**
1869
+ * Resets the login state, clears the stored login info, and broadcasts `LOGOUT_COMPLETED`.
1870
+ */
1871
+ reset(): void;
1872
+ /**
1873
+ * Clears all session-storage authentication keys and resets the login state.
1874
+ * @param clearOAuthToken - When `true`, the OAuth bearer token is also removed.
1875
+ */
1876
+ clear(clearOAuthToken?: boolean): void;
1877
+ /**
1878
+ * Initialises the service with the API base URI, optional app URI, and feature flags.
1879
+ * @param serviceUri - The base URI of the Clipper REST API.
1880
+ * @param appUri - Optional URI of the Clipper web application (used to build document links).
1881
+ * @param flags - Feature flags that control service behaviour. Defaults to `ClipperServiceFlags.None`.
1882
+ */
1883
+ initialize(serviceUri: string, appUri?: string, flags?: ClipperServiceFlags): void;
1884
+ /**
1885
+ * Ping
1886
+ */
1887
+ ping(): void;
1888
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClipperCoreService, never>;
1889
+ static ɵprov: i0.ɵɵInjectableDeclaration<ClipperCoreService>;
1890
+ }
1891
+
1892
+ export { ClipperAccountService, ClipperArchiveCopyMode, ClipperArchiveFileStorageType, ClipperArchiveFileStorageTypes, ClipperArchiveFileType, ClipperArchiveFileTypes, ClipperArchiveFilesSearchParams, ClipperArchiveFoldersSearchParams, ClipperArchiveService, ClipperAuthInterceptor, 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 };
1775
1893
  export type { ClipperArchiveFileInfo, ClipperArchiveFilesCopyParams, ClipperArchiveFilesDeleteParams, ClipperArchiveFilesSearchResult, ClipperArchiveFolderTree, ClipperArchiveFoldersImportParams, ClipperArchiveFoldersSearchResult, ClipperArsEventInfo, ClipperAvailableChannel, ClipperCalendarCopyDeadlinesParams, ClipperCalendarSaveDeadlineParams, ClipperCalendarSearchResult, ClipperChannelSettingsItem, ClipperContactInfo, ClipperContactsSearchParams, ClipperDashboardItem, ClipperDashboardModelItem, ClipperDashboardResult, ClipperDayGroup, ClipperDayItem, ClipperDeadlineInfo, ClipperDeleteWorkingDocumentsParams, ClipperDocumentAnchorInfo, ClipperDocumentInfo, ClipperDocumentNote, ClipperDocumentNoteTracking, ClipperDocumentRelevantChunkHit, ClipperDocumentRelevants, ClipperDocumentStructure, ClipperDocumentUpdateStateParams, ClipperExportDocumentsParams, ClipperLastDaysResult, ClipperLoginInfo, ClipperLoginResult, ClipperNotesSearchParams, ClipperNotesSearchResult, ClipperNotifyDocumentNoteParams, ClipperOTPInfo, ClipperReferencesSearchParams, ClipperSearchArsEventsParams, ClipperSearchArsEventsResult, ClipperSearchCalendarSnapshotMonth, ClipperSearchFacet, ClipperSearchFacetGroup, ClipperSearchFacetsResult, ClipperSearchFilter, ClipperSendDocumentsByEmailParams, ClipperSettingsInfo, ClipperTaxonomyParams, ClipperTeamMemberInfo, ClipperTeamMembersSearchResult, ClipperTeamProductInfo, ClipperTeamsSearchParams, ClipperTeamsSearchResult, ClipperTopicInfo, ClipperUserChannelInfo, ClipperUserInfo, ClipperUserLink, ClipperUserSearch, ClipperUserTrialInfo, ClipperUserWorkingDocument, EditDialogCompleted, EditDialogData, EditedEventArgs, SectorInfo };