export type OptionsApiV3PlaybooksTqlArgs = {show?: string | undefined}; export type OptionsApiV3PlaybooksTqlOptions = {baseUrl?: string | undefined, APIKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve tql * * OPTIONS /v3/playbooks/tql */ export const optionsApiV3PlaybooksTql = async (args: OptionsApiV3PlaybooksTqlArgs, options?: OptionsApiV3PlaybooksTqlOptions) => { const {baseUrl = "https://app.threatconnect.com/api", fetch: fetchFn = fetch, APIKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.show != null) query.append("show", String(args.show)) if (APIKeyAuth !== undefined) headers.set("Authorization", APIKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v3/playbooks/tql${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "OPTIONS", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };