export type Channel = string; export type SellerId = string; export type DeleteApiV1SellerChannelChannelSellerIdArgs = {channel: Channel, sellerId: SellerId}; export type DeleteApiV1SellerChannelChannelSellerIdOptions = {baseUrl?: string | undefined, SellerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unlink Seller from Channel * * DELETE /v1/seller/channel/{channel}/{sellerId} */ export const deleteApiV1SellerChannelChannelSellerId = async (args: DeleteApiV1SellerChannelChannelSellerIdArgs, options?: DeleteApiV1SellerChannelChannelSellerIdOptions) => { const {baseUrl = "https://scx-sbx.api.jtl-software.com", fetch: fetchFn = fetch, SellerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (SellerAuth !== undefined) headers.set('authorization', `Bearer ${SellerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/seller/channel/${encodeURIComponent(String(args.channel))}/${encodeURIComponent(String(args.sellerId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };