UNPKG

@better-auth-ui/core

Version:

Authentication components and data utilities for [Better Auth](https://better-auth.com), available for React and Solid.

43 lines (42 loc) 3.7 kB
import { DashAuditLogsResponse, DashGetAllAuditLogsInput, DashGetAuditLogsInput } from '@better-auth/infra/client'; import { QueryClient, skipToken } from '@tanstack/query-core'; import { DashAuthClient } from './dash-auth-client'; type DashResultError = { message?: string; status: number; statusText: string; }; /** Error returned by the Infrastructure Dash client. */ export declare class DashClientError extends Error { readonly status: number; readonly statusText: string; constructor(error: DashResultError); } export type DashAuditLogsParams = Omit<DashGetAuditLogsInput, "session" | "user" | "userId">; export type DashAllAuditLogsParams = Omit<DashGetAllAuditLogsInput, "session" | "userId">; export type DashUserAuditLogsParams = Omit<DashGetAllAuditLogsInput, "organizationId" | "session" | "userId">; /** Query options for the signed-in user's audit logs. */ export declare function dashAuditLogsOptions(authClient: DashAuthClient, userId?: string, params?: DashAuditLogsParams): { queryKey: readonly ["auth", "user", string | undefined, "dash", "audit-logs", DashAuditLogsParams]; queryFn: typeof skipToken | (() => Promise<DashAuditLogsResponse>); }; /** Query options for organization-wide audit logs available to owners/admins. */ export declare function dashAllAuditLogsOptions(authClient: DashAuthClient, userId?: string, params?: DashAllAuditLogsParams): { queryKey: readonly ["auth", "user", string | undefined, "dash", "all-audit-logs", DashAllAuditLogsParams]; queryFn: typeof skipToken | (() => Promise<DashAuditLogsResponse>); }; /** Query options for one user's audit logs available to owners/admins. */ export declare function dashUserAuditLogsOptions(authClient: DashAuthClient, actorUserId?: string, userId?: string, params?: DashUserAuditLogsParams): { queryKey: readonly ["auth", "user", string | undefined, "dash", "user-audit-logs", string | undefined, DashUserAuditLogsParams]; queryFn: typeof skipToken | (() => Promise<DashAuditLogsResponse>); }; export declare const ensureDashAuditLogs: (queryClient: QueryClient, authClient: DashAuthClient, userId: string, params?: DashAuditLogsParams) => Promise<DashAuditLogsResponse>; export declare const prefetchDashAuditLogs: (queryClient: QueryClient, authClient: DashAuthClient, userId: string, params?: DashAuditLogsParams) => Promise<void>; export declare const fetchDashAuditLogs: (queryClient: QueryClient, authClient: DashAuthClient, userId: string, params?: DashAuditLogsParams) => Promise<DashAuditLogsResponse>; export declare const ensureDashAllAuditLogs: (queryClient: QueryClient, authClient: DashAuthClient, userId: string, params?: DashAllAuditLogsParams) => Promise<DashAuditLogsResponse>; export declare const prefetchDashAllAuditLogs: (queryClient: QueryClient, authClient: DashAuthClient, userId: string, params?: DashAllAuditLogsParams) => Promise<void>; export declare const fetchDashAllAuditLogs: (queryClient: QueryClient, authClient: DashAuthClient, userId: string, params?: DashAllAuditLogsParams) => Promise<DashAuditLogsResponse>; export declare const ensureDashUserAuditLogs: (queryClient: QueryClient, authClient: DashAuthClient, actorUserId: string, userId: string, params?: DashUserAuditLogsParams) => Promise<DashAuditLogsResponse>; export declare const prefetchDashUserAuditLogs: (queryClient: QueryClient, authClient: DashAuthClient, actorUserId: string, userId: string, params?: DashUserAuditLogsParams) => Promise<void>; export declare const fetchDashUserAuditLogs: (queryClient: QueryClient, authClient: DashAuthClient, actorUserId: string, userId: string, params?: DashUserAuditLogsParams) => Promise<DashAuditLogsResponse>; export {};