/** Support conversations with the ird team. */
import type { Client } from './client.js';
import * as http from './http.js';
import type { Body, Query } from './types.js';
/** GET /contact/threads — List your support threads (cursor-paginated). */
export const listThreads = (client: Client, query?: Query<'/contact/threads', 'get'>) =>
http.get(client, '/contact/threads', { query });
/** Every support thread, following cursor pagination. */
export const listAllThreads = (client: Client, query?: Query<'/contact/threads', 'get'>) =>
http.paginate(client, '/contact/threads', 'threads', { query });
/** POST /contact/threads — Open a support thread. */
export const createThread = (client: Client, body: Body<'/contact/threads', 'post'>) =>
http.post(client, '/contact/threads', { body });
/** GET /contact/threads/{id} — Read a support thread. */
export const getThread = (client: Client, id: string) =>
http.get(client, '/contact/threads/{id}', { params: { id } });
/** POST /contact/threads/{id}/messages — Reply on a support thread. */
export const reply = (client: Client, id: string, body: Body<'/contact/threads/{id}/messages', 'post'>) =>
http.post(client, '/contact/threads/{id}/messages', { params: { id }, body });