export type CanonicalProductDeleteEnvelopeDto = {external_store_id?: string | undefined, event_id?: string | undefined, external_id: string}; export type CreateApiApiPublicAppsAppIdEventsProductDeleteArgs = {'x-vambe-timestamp': string, 'x-vambe-signature': string, appId: string, body: CanonicalProductDeleteEnvelopeDto}; export type CreateApiApiPublicAppsAppIdEventsProductDeleteOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Product delete event * * POST /api/public/apps/{appId}/events/product/delete */ export const createApiApiPublicAppsAppIdEventsProductDelete = async (args: CreateApiApiPublicAppsAppIdEventsProductDeleteArgs, options?: CreateApiApiPublicAppsAppIdEventsProductDeleteOptions) => { const {baseUrl = "https://api.vambe.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['x-vambe-timestamp'] != null) headers.set("x-vambe-timestamp", String(args['x-vambe-timestamp'])) if (args['x-vambe-signature'] != null) headers.set("x-vambe-signature", String(args['x-vambe-signature'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/public/apps/${encodeURIComponent(String(args.appId))}/events/product/delete${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };