export type GetApiPackagesPackageIdSummaryArgs = {packageId: string}; export type GetApiPackagesPackageIdSummaryOptions = {baseUrl: string, apiKeyScheme?: string | undefined, fetch?: typeof fetch | undefined}; /** * Return json summary for specified package * * GET /packages/{packageId}/summary */ export const getApiPackagesPackageIdSummary = async (args: GetApiPackagesPackageIdSummaryArgs, options: GetApiPackagesPackageIdSummaryOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKeyScheme} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (apiKeyScheme !== undefined) query.set("api_key", apiKeyScheme) const url = `${baseUrl.replace(/\/+$/, '')}/packages/${encodeURIComponent(String(args.packageId))}/summary${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() };