/** Typed API functions for the Kontakte (Contact) resource. (FEAT-2) */ import { api, resources } from './client' import { toQueryString, type GridifyQuery } from './gridify' import type { Contact, Paged } from './types' /** Payload for POST /contacts. */ export interface CreateContact { name: string email?: string | null phone?: string | null address?: string | null notes?: string | null } /** Payload for PUT /contacts/{id}. */ export type UpdateContact = Partial export function listContactsPaged(query: GridifyQuery): Promise> { return api.get>(`${resources.contacts}${toQueryString(query)}`) } export function getContact(id: string): Promise { return api.get(`${resources.contacts}/${id}`) } export function createContact(body: CreateContact): Promise { return api.post(resources.contacts, body) } export function updateContact(id: string, body: UpdateContact): Promise { return api.put(`${resources.contacts}/${id}`, body) } export function deleteContact(id: string): Promise { return api.delete(`${resources.contacts}/${id}`) }