export type DeleteApiLinksPageIdArgs = {id: string}; export type DeleteApiLinksPageIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete AI page * * DELETE /links/page/{id} */ export const deleteApiLinksPageId = async (args: DeleteApiLinksPageIdArgs, options?: DeleteApiLinksPageIdOptions) => { const {baseUrl = "https://api.short.io", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/links/page/${encodeURIComponent(String(args.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 };