export type CreateApiV1DomainIdRevokeArgs = {id: string}; export type CreateApiV1DomainIdRevokeOptions = {baseUrl: string, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Restore a previously deleted domain (undo delete) * * POST /v1/domain/{id}/revoke */ export const createApiV1DomainIdRevoke = async (args: CreateApiV1DomainIdRevokeArgs, options: CreateApiV1DomainIdRevokeOptions) => { const {baseUrl, fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/domain/${encodeURIComponent(String(args.id))}/revoke${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };