export type EventIdList = {eventIdList?: Array | undefined}; export type DeleteApiV1ChannelEventArgs = {body: EventIdList}; export type DeleteApiV1ChannelEventOptions = {baseUrl?: string | undefined, ChannelAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Acknowledge Events * * DELETE /v1/channel/event */ export const deleteApiV1ChannelEvent = async (args: DeleteApiV1ChannelEventArgs, options?: DeleteApiV1ChannelEventOptions) => { const {baseUrl = "https://scx-sbx.api.jtl-software.com", fetch: fetchFn = fetch, ChannelAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ChannelAuth !== undefined) headers.set('authorization', `Bearer ${ChannelAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/channel/event${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };