export type GetApiV2NameBlobsUploadsSessionIdArgs = {name: string, session_id: string}; export type GetApiV2NameBlobsUploadsSessionIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Get image blob/layer upload * * GET /v2/{name}/blobs/uploads/{session_id} */ export const getApiV2NameBlobsUploadsSessionId = async (args: GetApiV2NameBlobsUploadsSessionIdArgs, options: GetApiV2NameBlobsUploadsSessionIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v2/${encodeURIComponent(String(args.name))}/blobs/uploads/${encodeURIComponent(String(args.session_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };