export type GetApiV1VaultsVaultIdOperationsPreparedArgs = {vaultId: string}; export type GetApiV1VaultsVaultIdOperationsPreparedOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Export prepared operations * * GET /v1/vaults/{vaultId}/operations/prepared */ export const getApiV1VaultsVaultIdOperationsPrepared = async (args: GetApiV1VaultsVaultIdOperationsPreparedArgs, options: GetApiV1VaultsVaultIdOperationsPreparedOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/vaults/${encodeURIComponent(String(args.vaultId))}/operations/prepared${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 res.blob() };