export type DeleteApiV1ApiProductsProductExternalIdArgs = {productExternalId: string}; export type DeleteApiV1ApiProductsProductExternalIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete product with the specified external product id * * DELETE /v1/api/products/{productExternalId} */ export const deleteApiV1ApiProductsProductExternalId = async (args: DeleteApiV1ApiProductsProductExternalIdArgs, options?: DeleteApiV1ApiProductsProductExternalIdOptions) => { const {baseUrl = "http://products_url", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/api/products/${encodeURIComponent(String(args.productExternalId))}${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 };