export type GetApiDiV2ExperimentExpIdExportFlowJsonArgs = {exp_id: string}; export type GetApiDiV2ExperimentExpIdExportFlowJsonOptions = {baseUrl?: string | undefined, basicAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * ExportExperimentFlowJson * * GET /di/v2/experiment/{exp_id}/export_flow_json * * Also accepts auth: watsonAuthToken, watsonAuthTokenQuery */ export const getApiDiV2ExperimentExpIdExportFlowJson = async (args: GetApiDiV2ExperimentExpIdExportFlowJsonArgs, options?: GetApiDiV2ExperimentExpIdExportFlowJsonOptions) => { const {baseUrl = "https://di.prophecis.com", fetch: fetchFn = fetch, basicAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (basicAuthToken !== undefined) headers.set("Authorization", basicAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/di/v2/experiment/${encodeURIComponent(String(args.exp_id))}/export_flow_json${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 };