feat: add Authentik access widgets

This commit is contained in:
Developer
2026-07-14 21:41:24 +00:00
parent 4562a9dfca
commit 17976eab80
21 changed files with 1082 additions and 214 deletions
+31 -1
View File
@@ -1,6 +1,9 @@
/** Hooks for the Authentik directory + messaging tabs. */
/** Hooks for Authentik directory, access metadata, and messaging tabs. */
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import {
fetchAuthentikAccessSummary,
fetchAuthentikApplications,
fetchAuthentikGroups,
fetchAuthentikMessageStatus,
fetchAuthentikUsers,
sendAuthentikMessage,
@@ -17,6 +20,33 @@ export function useAuthentikUsers(
});
}
export function useAuthentikAccessSummary(
serviceId: string,
params: { search?: string; page?: number; page_size?: number },
) {
return useQuery({
queryKey: ["authentik", "access-summary", serviceId, params],
queryFn: () => fetchAuthentikAccessSummary(serviceId, params),
staleTime: 10_000,
});
}
export function useAuthentikGroups(serviceId: string, limit = 100) {
return useQuery({
queryKey: ["authentik", "groups", serviceId, limit],
queryFn: () => fetchAuthentikGroups(serviceId, limit),
staleTime: 30_000,
});
}
export function useAuthentikApplications(serviceId: string, limit = 100) {
return useQuery({
queryKey: ["authentik", "applications", serviceId, limit],
queryFn: () => fetchAuthentikApplications(serviceId, limit),
staleTime: 30_000,
});
}
export function useSendAuthentikMessage(serviceId: string) {
const queryClient = useQueryClient();
return useMutation({