export type DeleteApiOrchestratorCartsCartIdArgs = {'x-fabric-tenant-id': string, 'x-fabric-request-id'?: string | undefined, 'x-fabric-channel-id': string, cartId: string}; export type DeleteApiOrchestratorCartsCartIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete cart * * DELETE /orchestrator/carts/{cartId} */ export const deleteApiOrchestratorCartsCartId = async (args: DeleteApiOrchestratorCartsCartIdArgs, options?: DeleteApiOrchestratorCartsCartIdOptions) => { const {baseUrl = "https://api.fabric.inc/v3", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-fabric-tenant-id'] != null) headers.set("x-fabric-tenant-id", String(args['x-fabric-tenant-id'])) if (args['x-fabric-request-id'] != null) headers.set("x-fabric-request-id", String(args['x-fabric-request-id'])) if (args['x-fabric-channel-id'] != null) headers.set("x-fabric-channel-id", String(args['x-fabric-channel-id'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/orchestrator/carts/${encodeURIComponent(String(args.cartId))}${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 };