export type CreateApihttpLocalhost8000ProjectIdNodesArgs = {project_id: string, body: {treenode_ids?: string | undefined, connector_ids?: string | undefined, limit?: string | undefined, left: string, top: string, z1: string, right: string, bottom: string, z2: string, format?: string | undefined, with_relation_map?: string | undefined, with_origin?: string | undefined, n_largest_skeletons_limit?: string | undefined, n_last_edited_skeletons_limit?: string | undefined, hidden_last_editor_id?: string | undefined, min_skeleton_length?: string | undefined, order?: string | undefined}}; export type CreateApihttpLocalhost8000ProjectIdNodesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve all nodes intersecting a bounding box * * POST http://localhost:8000/{project_id}/nodes/ */ export const createApihttpLocalhost8000ProjectIdNodes = async (args: CreateApihttpLocalhost8000ProjectIdNodesArgs, options?: CreateApihttpLocalhost8000ProjectIdNodesOptions) => { const {baseUrl = "http://localhost:8000", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/x-www-form-urlencoded") const url = `${baseUrl.replace(/\/+$/, '')}http://localhost:8000/${encodeURIComponent(String(args.project_id))}/nodes/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: new URLSearchParams(Object.entries(args.body).flatMap(([key, value]) => (value == null ? [] : [[key, String(value)]])))}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };