export type CreateApiPublishersPublisherIdNodesNodeIdBanArgs = {publisherId: string, nodeId: string}; export type CreateApiPublishersPublisherIdNodesNodeIdBanOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Ban a publisher's Node * * POST /publishers/{publisherId}/nodes/{nodeId}/ban */ export const createApiPublishersPublisherIdNodesNodeIdBan = async (args: CreateApiPublishersPublisherIdNodesNodeIdBanArgs, options?: CreateApiPublishersPublisherIdNodesNodeIdBanOptions) => { const {baseUrl = "https://api.comfy.org", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/publishers/${encodeURIComponent(String(args.publisherId))}/nodes/${encodeURIComponent(String(args.nodeId))}/ban${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 };