import { type FunctionArgs, type FunctionReference, type FunctionReturnType, type FunctionType, type FunctionVisibility, getFunctionAddress, getFunctionName, } from "convex/server"; /* Type utils follow */ export type RunQueryCtx = { runQuery: >( query: Query, args: FunctionArgs, ) => Promise>; }; export type RunMutationCtx = RunQueryCtx & { runMutation: >( mutation: Mutation, args: FunctionArgs, ) => Promise>; }; export function safeFunctionName( f: FunctionReference, ) { const address = getFunctionAddress(f); return ( address.name || address.reference || address.functionHandle || getFunctionName(f) ); }