export type GetApiV2GroupSummaryGroupIdArgs = {groupId: string}; export type GetApiV2GroupSummaryGroupIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get group summary * * GET /v2/group/summary/{groupId} */ export const getApiV2GroupSummaryGroupId = async (args: GetApiV2GroupSummaryGroupIdArgs, options?: GetApiV2GroupSummaryGroupIdOptions) => { const {baseUrl = "https://api.xbl.io", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v2/group/summary/${encodeURIComponent(String(args.groupId))}${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 };