export type GetApiApiV0DeskModelingLibraryZipArgs = {user?: string | undefined, expires?: string | undefined, signature?: string | undefined}; export type GetApiApiV0DeskModelingLibraryZipOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * The modeling library as a zip, through a signed link * * GET /api/v0/desk/modeling/library.zip */ export const getApiApiV0DeskModelingLibraryZip = async (args: GetApiApiV0DeskModelingLibraryZipArgs, options: GetApiApiV0DeskModelingLibraryZipOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.user != null) query.append("user", String(args.user)) if (args.expires != null) query.append("expires", String(args.expires)) if (args.signature != null) query.append("signature", String(args.signature)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v0/desk/modeling/library.zip${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 };