export type GetApiV1FilingsDocumentIdAssetsNameArgs = {documentId: string, name: string}; export type GetApiV1FilingsDocumentIdAssetsNameOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * One of a filing's as-filed images (an 8-K deck slide, logo, figure), stored at capture time. Image names come from the slides metadata endpoint's imageUrls. * * GET /v1/filings/{documentId}/assets/{name} */ export const getApiV1FilingsDocumentIdAssetsName = async (args: GetApiV1FilingsDocumentIdAssetsNameArgs, options?: GetApiV1FilingsDocumentIdAssetsNameOptions) => { const {baseUrl = "https://api.equibles.com", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set('authorization', `Bearer ${ApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/filings/${encodeURIComponent(String(args.documentId))}/assets/${encodeURIComponent(String(args.name))}${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 };