export type UpdateAnonymizeAfterRequestItem = {anonymize_after: string, channel_id: string, channel_order_id: string, channel_store_id: string, sub_channel_code?: string | undefined}; export type UpdateAnonymizeAfterRequest = {orders: Array}; export type UpdateApiV1OrdersAnonymizeAfterArgs = {body: UpdateAnonymizeAfterRequest}; export type UpdateApiV1OrdersAnonymizeAfterOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * updateAnonymizeAfterDate - Update anonymization date for orders * * PUT /v1/orders/anonymize-after */ export const updateApiV1OrdersAnonymizeAfter = async (args: UpdateApiV1OrdersAnonymizeAfterArgs, options?: UpdateApiV1OrdersAnonymizeAfterOptions) => { const {baseUrl = "https://miraklconnect.com/api/channel-platform", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/orders/anonymize-after${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };