export interface CurrentUserRole { id: string; accountOwner: boolean; role: { id: string; name: string; }; } /** * Names of the server-evaluated `Account.actions` checks the host resolves at startup. * * Each name matches a field on the GraphQL `AccountActions` type. Adding one here takes * two more edits in the host: select it in the `GetUserDetails` query, and map it in * `auth/hooks/accountActions.ts` — both `resolveAccountActions` and `NO_ACCOUNT_ACTIONS` * are typed as a full `Record` of this union, so leaving it unmapped is a compile error * rather than a silent `false`. Miss the query field and the action does resolve to * `false` silently. `User.accountActions` in `UserStoreProviderHost` is already keyed by * this union and needs no change. * * Each name costs a live OpenFGA check on a query that runs on every login and token * renewal, so add one only once a gate is queued to read it — and drop it again if that * gate does not follow. */ export type AccountActionName = "viewUsers" | "manageUsers" | "viewAccount" | "manageAccount" | "viewGroups" | "manageGroups" | "approveAccountSupportAccess" | "requestUserSupportAccess" | "requestAccountSupportAccess" | "requestAccountSupportAccessWithoutApproval" | "requestAccountSupportAccessExtendedPeriod" | "createIdentityProviders" | "updateIdentityProviderAllowedDomains" | "viewLicenseOverview" | "viewPartners" | "managePartners" | "viewConnections" | "manageConnections"; export interface CurrentUserState { clientSideUserId: string | undefined; tasUserId: string | undefined; userName: string | undefined; userRole: string | undefined; userId: number | undefined; customerId: number | undefined; accountId: string | undefined; assumedUser: { userId: number; customerId: number; accountId: string; tasUserId: string | undefined; } | null; email: string | undefined; name: string | undefined; jobTitle: string | undefined; isAssuming: boolean; isTrackunitUser: boolean; isAuthenticated: boolean; isVerified: boolean | undefined; isAccountOwner: boolean | undefined; permissions: Array | undefined; accountActions?: Partial>; } export interface CurrentUserRuntimeApi { getCurrentUserContext: () => Promise; }