export type GetApiGbsPsbioServerServiceAcApiPingOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * ping * * GET /gbs-psbio-server/service/ac-api/ping */ export const getApiGbsPsbioServerServiceAcApiPing = async (options?: GetApiGbsPsbioServerServiceAcApiPingOptions) => { const {baseUrl = "http://:8085/gbds/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") const url = `${baseUrl.replace(/\/+$/, '')}/gbs-psbio-server/service/ac-api/ping${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.text() };