export type GetApiVaultsVaultUuidItemsItemUuidFilesFileUuidContentOptions = {baseUrl?: string | undefined, ConnectToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get the content of a File * * GET /vaults/{vaultUuid}/items/{itemUuid}/files/{fileUuid}/content */ export const getApiVaultsVaultUuidItemsItemUuidFilesFileUuidContent = async (options?: GetApiVaultsVaultUuidItemsItemUuidFilesFileUuidContentOptions) => { const {baseUrl = "http://localhost:8080/v1", fetch: fetchFn = fetch, ConnectToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (ConnectToken !== undefined) headers.set('authorization', `Bearer ${ConnectToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/vaults/${encodeURIComponent(String(args.vaultUuid))}/items/${encodeURIComponent(String(args.itemUuid))}/files/${encodeURIComponent(String(args.fileUuid))}/content${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() };