From d0eb63840f4aa1b9a780d8e1503240af60031ae2 Mon Sep 17 00:00:00 2001 From: Ulas Kalayci Date: Mon, 4 May 2026 18:37:05 +0200 Subject: [PATCH] docs(openapi): add CardDAV routes and update contacts routes Document 8 CardDAV management routes (accounts, addressbooks, sync) and update 3 existing contacts routes to reflect multi-value field support. Co-Authored-By: Claude Sonnet 4.5 --- server/openapi.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/server/openapi.js b/server/openapi.js index 62ba5fb..f7c46f6 100644 --- a/server/openapi.js +++ b/server/openapi.js @@ -457,11 +457,34 @@ function buildPaths() { }, '/api/v1/contacts': { get: op({ summary: 'List contacts', tag: 'Contacts' }), - post: op({ summary: 'Create contact', tag: 'Contacts', stateChanging: true, requestBody: jsonBody(null) }), + post: op({ summary: 'Create contact with multi-value fields', tag: 'Contacts', stateChanging: true, requestBody: jsonBody(null) }), }, '/api/v1/contacts/meta': { get: op({ summary: 'Get contact metadata', tag: 'Contacts' }) }, + '/api/v1/contacts/cardav/accounts': { + get: op({ summary: 'List CardDAV accounts', tag: 'Contacts' }), + post: op({ summary: 'Add CardDAV account', tag: 'Contacts', stateChanging: true, requestBody: jsonBody(null) }), + }, + '/api/v1/contacts/cardav/accounts/{id}': { + delete: op({ summary: 'Delete CardDAV account', tag: 'Contacts', params: [idParam()], stateChanging: true }), + }, + '/api/v1/contacts/cardav/accounts/{id}/test': { + post: op({ summary: 'Test CardDAV connection', tag: 'Contacts', params: [idParam()] }), + }, + '/api/v1/contacts/cardav/accounts/{id}/addressbooks': { + get: op({ summary: 'List addressbooks for account', tag: 'Contacts', params: [idParam()] }), + }, + '/api/v1/contacts/cardav/accounts/{id}/addressbooks/refresh': { + post: op({ summary: 'Refresh addressbooks for account', tag: 'Contacts', params: [idParam()], stateChanging: true }), + }, + '/api/v1/contacts/cardav/addressbooks/{id}': { + put: op({ summary: 'Toggle addressbook enabled state', tag: 'Contacts', params: [idParam()], stateChanging: true, requestBody: jsonBody(null) }), + }, + '/api/v1/contacts/cardav/accounts/{id}/sync': { + post: op({ summary: 'Sync CardDAV account', tag: 'Contacts', params: [idParam()], stateChanging: true }), + }, '/api/v1/contacts/{id}': { - put: op({ summary: 'Update contact', tag: 'Contacts', params: [idParam()], stateChanging: true, requestBody: jsonBody(null) }), + get: op({ summary: 'Get contact with multi-value fields', tag: 'Contacts', params: [idParam()] }), + put: op({ summary: 'Update contact with multi-value fields', tag: 'Contacts', params: [idParam()], stateChanging: true, requestBody: jsonBody(null) }), delete: op({ summary: 'Delete contact', tag: 'Contacts', params: [idParam()], stateChanging: true }), }, '/api/v1/contacts/{id}/vcard': { get: op({ summary: 'Download contact as vCard', tag: 'Contacts', params: [idParam()] }) },