Functions hooks
Hand-written hooks for `Function`. CRUD comes from `functions.gen.ts`; this file adds the custom `invoke` op which the generator skips. Mirror to docs/client-functions.md / Worker Loader pattern: `invokeFunction` fires off the function as a Cloudflare Dynamic Worker and returns `{ ok, result, error, durationMs }`.
Hooks
useCreateFunction mutation
Create a function.
useCreateFunction(options?: MutationOpts<Function, CreateFunctionParams>)Types: Function · CreateFunctionParams
useDeleteFunction mutation
Soft-delete a function.
useDeleteFunction(options?: MutationOpts<SuccessResponse, string>)Types: SuccessResponse
useInvokeFunction composite
Invoke a function. The runner loads the matching version's source bundle into an isolate via the Worker Loader binding and returns the function's JSON response.
useInvokeFunction(options?: MutationOpts<InvokeFunctionResponse, InvokeFunctionParams>)Types: InvokeFunctionResponse · InvokeFunctionParams
useListFunctions query
List functions.
useListFunctions(params?: Omit<ListFunctionsParams, | > & { filter?: FunctionFilter; orderBy?: FunctionOrderBy[]; } & FunctionShorthands, options?: QueryOpts<Page<Function>>)Types: ListFunctionsParams · FunctionFilter · FunctionOrderBy · FunctionShorthands · Page · Function
usePurgeFunction composite
Permanently delete a soft-deleted function.
usePurgeFunction(options?: MutationOpts<SuccessResponse, PurgeFunctionParams>)Types: SuccessResponse · PurgeFunctionParams
useRestoreFunction composite
Restore a soft-deleted function.
useRestoreFunction(options?: MutationOpts<Function, string>)Types: Function
useRetrieveFunction query
Get a function by ID.
useRetrieveFunction(id: string, options?: QueryOpts<Function>)Types: Function
useUpdateFunction mutation
Update a function.
useUpdateFunction(options?: MutationOpts<Function, UpdateFunctionParams>)Types: Function · UpdateFunctionParams