export type ClaimMyNodeRequest = {GH_TOKEN: string}; export type CreateApiPublishersPublisherIdNodesNodeIdClaimMyNodeArgs = {publisherId: string, nodeId: string, body: ClaimMyNodeRequest}; export type CreateApiPublishersPublisherIdNodesNodeIdClaimMyNodeOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Claim nodeId into publisherId for the authenticated publisher * * POST /publishers/{publisherId}/nodes/{nodeId}/claim-my-node */ export const createApiPublishersPublisherIdNodesNodeIdClaimMyNode = async (args: CreateApiPublishersPublisherIdNodesNodeIdClaimMyNodeArgs, options?: CreateApiPublishersPublisherIdNodesNodeIdClaimMyNodeOptions) => { const {baseUrl = "https://api.comfy.org", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/publishers/${encodeURIComponent(String(args.publisherId))}/nodes/${encodeURIComponent(String(args.nodeId))}/claim-my-node${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };