export type GetApiKapisApplicationKubesphereIoV2CrCrnameOptions = {baseUrl: string, BearerToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /kapis/application.kubesphere.io/v2/cr/{crname} */ export const getApiKapisApplicationKubesphereIoV2CrCrname = async (options: GetApiKapisApplicationKubesphereIoV2CrCrnameOptions) => { const {baseUrl, fetch: fetchFn = fetch, BearerToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerToken !== undefined) headers.set("Authorization", BearerToken) const url = `${baseUrl.replace(/\/+$/, '')}/kapis/application.kubesphere.io/v2/cr/${encodeURIComponent(String(args.crname))}${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 };