export type CreateApiExperimentsExperimentIdResultsShareableUiLinkArgs = {experimentId: number}; export type CreateApiExperimentsExperimentIdResultsShareableUiLinkOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Share experiment new result page UI * * POST /experiments/{experimentId}/results/shareable-ui-link */ export const createApiExperimentsExperimentIdResultsShareableUiLink = async (args: CreateApiExperimentsExperimentIdResultsShareableUiLinkArgs, options?: CreateApiExperimentsExperimentIdResultsShareableUiLinkOptions) => { const {baseUrl = "https://api.kameleoon.com", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/experiments/${encodeURIComponent(String(args.experimentId))}/results/shareable-ui-link${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };