Specs hooks

Hand-written shim. Generated CRUD hooks via ./specs.gen. The refresh custom-op hook stays hand-written until the React gen learns to emit kind: "custom" ops. Spec members are their own generated top-level entity (`useListSpecMembers` from spec-members.gen).

Hooks

useCreateSpec mutation

Create a spec. Fetches the OpenAPI spec from sourceUrl and generates functions + schemas for every operation.

TypeScript
useCreateSpec(options?: MutationOpts<Spec, CreateSpecParams>)

Types: Spec · CreateSpecParams

useDeleteSpec mutation

Soft-delete a spec. Generated entities cascade-remove via spec_member; the wrapping solution is preserved (unwraps).

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

Types: SuccessResponse

useListSpecs query

List specs.

TypeScript
useListSpecs(params?: Omit<ListSpecsParams, | > & { filter?: SpecFilter; orderBy?: SpecOrderBy[]; } & SpecShorthands, options?: QueryOpts<Page<Spec>>)

Types: ListSpecsParams · SpecFilter · SpecOrderBy · SpecShorthands · Page · Spec

usePurgeSpec composite

Permanently delete a soft-deleted spec.

TypeScript
usePurgeSpec(options?: MutationOpts<SuccessResponse, PurgeSpecParams>)

Types: SuccessResponse · PurgeSpecParams

useRefreshSpec composite

TypeScript
useRefreshSpec(options?: MutationOpts<RefreshSpecResponse, RefreshSpecParams>)

Types: RefreshSpecResponse · RefreshSpecParams

useRestoreSpec composite

Restore a soft-deleted spec.

TypeScript
useRestoreSpec(options?: MutationOpts<Spec, string>)

Types: Spec

useRetrieveSpec query

Get a spec by ID.

TypeScript
useRetrieveSpec(id: string, options?: QueryOpts<Spec>)

Types: Spec

useUpdateSpec mutation

Update a spec's metadata or auth config. Does NOT refetch the spec — call refresh explicitly.

TypeScript
useUpdateSpec(options?: MutationOpts<Spec, UpdateSpecParams>)

Types: Spec · UpdateSpecParams