export type GetApiApiStorePublishedListingsSkusSkuIdArgs = {sku_id: string}; export type GetApiApiStorePublishedListingsSkusSkuIdOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/store/published-listings/skus/{sku_id} */ export const getApiApiStorePublishedListingsSkusSkuId = async (args: GetApiApiStorePublishedListingsSkusSkuIdArgs, options?: GetApiApiStorePublishedListingsSkusSkuIdOptions) => { const {baseUrl = "https://api.rory.server.spacebar.chat", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/store/published-listings/skus/${encodeURIComponent(String(args.sku_id))}${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 };