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


search for terms across all the metadata; any of the terms * * GET /api/metadata/search */ export const getApiApiMetadataSearch = async (args: GetApiApiMetadataSearchArgs, options?: GetApiApiMetadataSearchOptions) => { 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/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() };