export type GetApiApiMetadataEdgeSearchArgs = {terms: Array}; export type GetApiApiMetadataEdgeSearchOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Allowed user roles:


search for terms * * GET /api/metadata/edge/search */ export const getApiApiMetadataEdgeSearch = async (args: GetApiApiMetadataEdgeSearchArgs, options?: GetApiApiMetadataEdgeSearchOptions) => { const {baseUrl = "https://api.burstiq.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") for (const item of args.terms ?? []) query.append("terms", String(item)) const url = `${baseUrl.replace(/\/+$/, '')}/api/metadata/edge/search${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() };