@linagora/linid-im-front-corelib 0.0.53 → 0.0.54

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.
@@ -10,6 +10,7 @@ export { useUiDesign } from './composables/useUiDesign';
10
10
  export { useLinidConfigurationStore } from './stores/linidConfigurationStore';
11
11
  export { useLinidUiStore } from './stores/linidUiStore';
12
12
  export { useLinidZoneStore } from './stores/linidZoneStore';
13
+ export { useLinidUserStore } from './stores/linidUserStore';
13
14
  export { getModuleFederation, loadAsyncComponent, setModuleFederation, } from './services/federationService';
14
15
  export { getHttpClient, setHttpClient } from './services/httpClientService';
15
16
  export { getI18nInstance, setI18nInstance } from './services/i18nService';
@@ -35,3 +36,4 @@ export type { UiEvent } from './types/uiEvent';
35
36
  export type { ValidatorName } from './types/fieldValidation';
36
37
  export type { LinidApiErrorResponseBody } from './types/linidApi';
37
38
  export type { DialogEvent } from './types/dialogType';
39
+ export type { LinidUser } from './types/linidUser';
@@ -0,0 +1,25 @@
1
+ import type { IdTokenClaims } from 'oidc-client-ts';
2
+ import type { LinidUser } from '../types/linidUser';
3
+ /**
4
+ * State interface for the Linid User Store.
5
+ */
6
+ interface LinidUserState {
7
+ /** The current user information. */
8
+ user: LinidUser;
9
+ /** Flag indicating whether the user is authenticated. */
10
+ isAuthenticated: boolean;
11
+ }
12
+ /**
13
+ * Returns the Linid User Store instance.
14
+ * @returns The Linid User Store instance.
15
+ */
16
+ export declare const useLinidUserStore: () => import("pinia").Store<"LinidUserStore", LinidUserState, {}, {
17
+ /**
18
+ * Populates the store from the claims of an OIDC ID token.
19
+ * Maps `sub` → username, `email`, `name` → fullName, `roles` → roles,
20
+ * and flips `isAuthenticated` to true.
21
+ * @param claims The decoded ID token claims provided by oidc-client-ts.
22
+ */
23
+ setUserFromClaims(claims: IdTokenClaims): void;
24
+ }>;
25
+ export {};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Represents a user in the system.
3
+ */
4
+ export interface LinidUser {
5
+ /**
6
+ * Username of the user.
7
+ */
8
+ username: string;
9
+ /**
10
+ * Email address of the user.
11
+ */
12
+ email: string;
13
+ /**
14
+ * Full name of the user.
15
+ */
16
+ fullName: string;
17
+ /**
18
+ * The list of roles assigned to the user.
19
+ */
20
+ roles: string[];
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linagora/linid-im-front-corelib",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
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": [
@@ -65,6 +65,7 @@
65
65
  "eslint-plugin-jsdoc": "62.8.0",
66
66
  "eslint-plugin-vue": "10.8.0",
67
67
  "happy-dom": "20.8.3",
68
+ "oidc-client-ts": "3.5.0",
68
69
  "prettier": "3.8.1",
69
70
  "typescript": "5.9.3",
70
71
  "vite": "7.3.1",