@linagora/linid-im-front-corelib 0.0.78 → 0.0.79

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.
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Composable to manage user preferences lifecycle and synchronization
3
+ * between backend API and local Pinia store.
4
+ * @returns Composable exposing methods to interact with user preferences and the underlying store.
5
+ */
6
+ export declare function useLinidUserPreference(): {
7
+ init: () => Promise<void>;
8
+ saveUserPreference: (key: string, value: string) => Promise<void>;
9
+ deleteUserPreference: (key: string) => Promise<void>;
10
+ userPreferenceStore: import("pinia").Store<"LinidUserPreferenceStore", import("../stores/linidUserPreferenceStore").LinidUserPreferenceState, {}, {
11
+ setUserPreferences(values: Record<string, string>): void;
12
+ setUserPreference(key: string, value: string): void;
13
+ removeUserPreference(key: string): void;
14
+ }>;
15
+ };
@@ -8,6 +8,10 @@ import { LinidFilter } from './linidFilter';
8
8
  * [`spring-query-filter`](https://github.com/Zorin95670/spring-query-filter).
9
9
  */
10
10
  export declare class LinidFilterSet {
11
+ /**
12
+ * Unique identifier of the filter set.
13
+ */
14
+ id: string;
11
15
  /**
12
16
  * User-friendly name of the favorite search (e.g. "My Active Projects").
13
17
  */
@@ -18,10 +22,11 @@ export declare class LinidFilterSet {
18
22
  filters: LinidFilter[];
19
23
  /**
20
24
  * Creates a new filter set.
25
+ * @param id - Unique identifier of the filter set.
21
26
  * @param label - User-friendly name of the favorite search.
22
27
  * @param filters - Collection of filters composing the favorite search.
23
28
  */
24
- constructor(label: string, filters: LinidFilter[]);
29
+ constructor(id: string, label: string, filters: LinidFilter[]);
25
30
  /**
26
31
  * Parses a string representation of a filter set, as produced by {@link LinidFilterSet.toString},
27
32
  * into a new {@link LinidFilterSet} instance.
@@ -35,11 +40,12 @@ export declare class LinidFilterSet {
35
40
  * `value` tolerates `null`/`undefined`/any non-string at runtime (e.g. `localStorage.getItem(...)`,
36
41
  * or across a Module Federation boundary): like an empty string, it produces an empty `filters`
37
42
  * array instead of throwing.
43
+ * @param id - Unique identifier of the filter set.
38
44
  * @param label - User-friendly name of the favorite search.
39
45
  * @param value - The `&`-separated string of `name=value` pairs, as produced by `toString()`.
40
46
  * @returns The parsed filter set.
41
47
  */
42
- static fromString(label: string, value: string | null | undefined): LinidFilterSet;
48
+ static fromString(id: string, label: string, value: string | null | undefined): LinidFilterSet;
43
49
  /**
44
50
  * Reconstructs the filter set as a `&`-separated string of `name=value` pairs, one per filter,
45
51
  * ready to use with APIs powered by `spring-query-filter` or to store in user preferences.
@@ -12,10 +12,12 @@ export { useScopedI18n } from './composables/useScopedI18n';
12
12
  export { useTree } from './composables/useTree';
13
13
  export { useUiDesign } from './composables/useUiDesign';
14
14
  export { useLinidFilterUrl } from './composables/useLinidFilterUrl';
15
+ export { useLinidUserPreference } from './composables/useLinidUserPreference';
15
16
  export { useLinidConfigurationStore } from './stores/linidConfigurationStore';
16
17
  export { useLinidUiStore } from './stores/linidUiStore';
17
18
  export { useLinidUserStore } from './stores/linidUserStore';
18
19
  export { useLinidZoneStore } from './stores/linidZoneStore';
20
+ export { useLinidUserPreferenceStore } from './stores/linidUserPreferenceStore';
19
21
  export { getDayjsInstance, setDayjsInstance } from './services/dayjsService';
20
22
  export { getModuleFederation, loadAsyncComponent, setModuleFederation, } from './services/federationService';
21
23
  export { getHttpClient, setHttpClient } from './services/httpClientService';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * State interface for the Linid User Preference Store.
3
+ */
4
+ export interface LinidUserPreferenceState {
5
+ /** Collection of user preferences indexed by key. */
6
+ userPreferences: Record<string, string>;
7
+ }
8
+ /**
9
+ * Returns the Linid User Preference Store instance.
10
+ * @returns The Linid User Preference Store instance.
11
+ */
12
+ export declare const useLinidUserPreferenceStore: () => import("pinia").Store<"LinidUserPreferenceStore", LinidUserPreferenceState, {}, {
13
+ /**
14
+ * Replaces all user preferences with the provided collection.
15
+ * @param values The complete set of user preferences.
16
+ */
17
+ setUserPreferences(values: Record<string, string>): void;
18
+ /**
19
+ * Creates or updates a user preference.
20
+ * @param key The user preference key.
21
+ * @param value The user preference value.
22
+ */
23
+ setUserPreference(key: string, value: string): void;
24
+ /**
25
+ * Removes a user preference by its key.
26
+ * @param key The user preference key to remove.
27
+ */
28
+ removeUserPreference(key: string): void;
29
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linagora/linid-im-front-corelib",
3
- "version": "0.0.78",
3
+ "version": "0.0.79",
4
4
  "description": "Core library of the LinID Identity Manager project. Provides shared types, services, components, and utilities for front-end and plugin, enabling consistent integration across the LinID ecosystem.",
5
5
  "type": "module",
6
6
  "files": [