export type DeleteApiEntryEntrySlugArgs = {Accept: 'application/vnd.Creative Force.v2.3+json' | 'application/vnd.Creative Force.v2.3+xml'}; export type DeleteApiEntryEntrySlugOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an entry * * DELETE /entry/{entry_slug} */ export const deleteApiEntryEntrySlug = async (args: DeleteApiEntryEntrySlugArgs, options?: DeleteApiEntryEntrySlugOptions) => { const {baseUrl = "https://api.us.cr4ce.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/entry/${encodeURIComponent(String(args.entry_slug))}${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 };