export type DeleteApiPrimsMetadataArgs = {prim_path: string}; export type DeleteApiPrimsMetadataOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Remove Prim Metadata * * DELETE /prims/metadata */ export const deleteApiPrimsMetadata = async (args: DeleteApiPrimsMetadataArgs, options: DeleteApiPrimsMetadataOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.prim_path != null) query.append("prim_path", String(args.prim_path)) const url = `${baseUrl.replace(/\/+$/, '')}/prims/metadata${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 };