export type GetApiApiEventEventArgs = {event: string, activeOnly?: boolean | undefined}; export type GetApiApiEventEventOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get event handlers for a given event * * GET /api/event/{event} */ export const getApiApiEventEvent = async (args: GetApiApiEventEventArgs, options?: GetApiApiEventEventOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.activeOnly != null) query.append("activeOnly", String(args.activeOnly)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/event/${encodeURIComponent(String(args.event))}${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() };