export type DeleteApiDataDeletionsV30TrackingIdOptions = {baseUrl?: string | undefined, ServiceAccount?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Cancel a Deletion * * DELETE /data-deletions/v3.0/{tracking_id} * * Also accepts auth: ProjectSecret */ export const deleteApiDataDeletionsV30TrackingId = async (options?: DeleteApiDataDeletionsV30TrackingIdOptions) => { const {baseUrl = "https://mixpanel.com/api/query", fetch: fetchFn = fetch, ServiceAccount} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ServiceAccount !== undefined) headers.set('authorization', `Basic ${btoa(`${ServiceAccount.username}:${ServiceAccount.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/data-deletions/v3.0/${encodeURIComponent(String(args.tracking_id))}${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 };