Pages hooks

Hand-written shim. Generated CRUD via ./pages.gen. The hooks below cover `move` (positional swap) and `resolve` (slug-path lookup) — neither fits the manifest's standard CRUD kinds.

Hooks

useCreatePage mutation

Create a page.

TypeScript
useCreatePage(options?: MutationOpts<PageEntity, CreatePageParams>)

Types: PageEntity · CreatePageParams

useDeletePage mutation

Soft-delete a page.

TypeScript
useDeletePage(options?: MutationOpts<SuccessResponse, string>)

Types: SuccessResponse

useListPages query

List pages.

TypeScript
useListPages(params?: Omit<ListPagesParams, | > & { filter?: PageFilter; orderBy?: PageOrderBy[]; } & PageShorthands, options?: QueryOpts<Page<PageEntity>>)

Types: ListPagesParams · PageFilter · PageOrderBy · PageShorthands · Page · PageEntity

useMovePage composite

Move a page up or down within its siblings. Auto-invalidates page queries so the tree reflects the new ordering.

TypeScript
useMovePage(options?: MutationOpts<Page, MovePageParams>)

Types: Page · MovePageParams

TypeScript
const move = useMovePage();
move.mutate({ id: "pag_abc", direction: "up" });

usePurgePage composite

Permanently delete a soft-deleted page.

TypeScript
usePurgePage(options?: MutationOpts<SuccessResponse, PurgePageParams>)

Types: SuccessResponse · PurgePageParams

useResolvePagePath composite

Resolve a slash-separated slug path to a page row.

TypeScript
useResolvePagePath(params: ResolvePagePathParams | undefined, options?: QueryOpts<Page>)

Types: ResolvePagePathParams · Page

TypeScript
const { data: page } = useResolvePagePath({
  workspaceId: "wsp_abc",
  path: "runbooks/ingest/retry-policy",
});

useRestorePage composite

Restore a soft-deleted page.

TypeScript
useRestorePage(options?: MutationOpts<PageEntity, string>)

Types: PageEntity

useRetrievePage query

Get a page by ID.

TypeScript
useRetrievePage(id: string, options?: QueryOpts<PageEntity>)

Types: PageEntity

useUpdatePage mutation

Update a page.

TypeScript
useUpdatePage(options?: MutationOpts<PageEntity, UpdatePageParams>)

Types: PageEntity · UpdatePageParams