export type DeleteApihttpLocalhost8000ClientDatastoresNameArgs = {name: string}; export type DeleteApihttpLocalhost8000ClientDatastoresNameOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a key-value store datastore for the client. * * DELETE http://localhost:8000/client/datastores/{name} */ export const deleteApihttpLocalhost8000ClientDatastoresName = async (args: DeleteApihttpLocalhost8000ClientDatastoresNameArgs, options?: DeleteApihttpLocalhost8000ClientDatastoresNameOptions) => { const {baseUrl = "http://localhost:8000", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}http://localhost:8000/client/datastores/${encodeURIComponent(String(args.name))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };