export type CreateApiV1ConversationsConversationIdMarkArgs = {conversationId: string, body: {read?: boolean | undefined}}; export type CreateApiV1ConversationsConversationIdMarkOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Marcar conversación (leída/no leída) * * POST /v1/conversations/{conversationId}/mark */ export const createApiV1ConversationsConversationIdMark = async (args: CreateApiV1ConversationsConversationIdMarkArgs, options?: CreateApiV1ConversationsConversationIdMarkOptions) => { const {baseUrl = "https://connect.cliengo.com", 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(/\/+$/, '')}/v1/conversations/${encodeURIComponent(String(args.conversationId))}/mark${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 };