import { StoreDefinition, PiniaCustomStateProperties } from 'pinia'; /** * `useUserStore` is a Pinia store for managing user authentication, session, and related user data. * * The store includes state variables for managing user session details, actions for logging in and out, * validating sessions, and interacting with authentication systems like Keycloak and Alfresco, * as well as getters for computed properties like `displayName`. * * State: * - `token` {string} - Stores the authentication token. * - `isAdmin` {boolean} - Indicates whether the current user is an administrator. * - `isLoggedIn` {boolean} - Tracks whether the user is currently logged in. * - `person` {object|null} - Stores the person details of the logged-in user. * - `keycloak` {object|null} - Represents Keycloak authentication configuration. * - `homeFolder` {string|null} - Stores the user's home folder path. * * Getters: * - `displayName` {string} - Returns the display name of the logged-in user, or an empty string if no user is logged in. * * Actions: * - `logout` - Logs out the current user and stops the auto-renew for the OIDC connection. * - `validateSession` - Checks if the client is logged in and retrieves the Alfresco ticket using the Keycloak Bearer Token. * - `connectKeycloak` - Handles the redirection and connection to Keycloak for unauthenticated users. * - `keycloakReady` - Stores the Keycloak object and retrieves the Alfresco ticket using the Keycloak Bearer Token. * - `getAlfTicket` - Logs into Alfresco with the Bearer token and retrieves the Alfresco ticket. * - `getPerson` - Retrieves the person details for the currently authenticated user. * - `login` - Attempts to log in a user with a username and password. * - `apiLogin` - Handles Basic Authentication with Alfresco. * - `publiclogoff` - Logs off a public account if currently authenticated. * - `publiclogin` - Logs in with a public account from a specified public workspace. */ export const useUserStore: StoreDefinition<"UserStore", { token: string; isAdmin: boolean; isLoggedIn: boolean; person: any; keycloak: any; homeFolder: any; isPristyAdmin: any; }, { displayName(state: { token: string; isAdmin: boolean; isLoggedIn: boolean; person: any; keycloak: any; homeFolder: any; isPristyAdmin: any; } & PiniaCustomStateProperties<{ token: string; isAdmin: boolean; isLoggedIn: boolean; person: any; keycloak: any; homeFolder: any; isPristyAdmin: any; }>): any; }, { /** * Logout current user and stop auto-renew for oidc connection * @return {Promise>} */ logout(): Promise>; /** * Check if the client is logged and get alf_ticket using Keycloak Bearer Token * @return {Promise<{id:string}>} Current alf_token */ validateSession(): Promise<{ id: string; }>; /** * Redirect to Keycloak if unauthent, else retrieve current Person * form Alfresco. * @return {Promise} */ connectKeycloak: () => Promise; /** * Store Keycloak object and get alf_ticket using Keycloak Bearer Token. * We will ask alf_ticket every ALF_TOKEN_TTL_MS (60s) * @param {any} _keycloak Keycloak object yet authenticate * @return {Promise<{id: string}>} */ keycloakReady(_keycloak: any): Promise<{ id: string; }>; /** * Log to Alfresco with Bearer token and set alf_token * @return {Promise<{id:string} | undefined>} Current alf_token or undefined if not using OIDC */ getAlfTicket(): Promise<{ id: string; } | undefined>; /** * Get Person for user '-me-'. Help to check if we are always authenticate * @return {Promise} Person object of current user. */ getPerson(): Promise; /** * Checks if the current user is a Pristy admin. * The result is cached in the `isPristyAdmin` state. */ checkPristyAdminStatus(): Promise; /** * Attempt to login a user * @param {string} user Username * @param {string} password User password * @return {Promise} Returns false if credentials are missing, void otherwise */ login(user: string, password: string): Promise; /** * Do a Basic Authent to Alfresco * @param {string} a Username * @param {string} p Password * @return {Promise} Promise resolving to person data */ apiLogin(a: string, p: string): Promise; /** * Log Off Public Account ("user_publication_*") * @return {Promise} */ publiclogoff(): Promise; /** * Log In with the Public Account from a Public workspace. * @param {string} espace_id Workspace ID that have a Public Account * @return {Promise} alf_ticket */ publiclogin(espace_id: string): Promise; }>; //# sourceMappingURL=user.d.ts.map