Commit Graph

9 Commits

Author SHA1 Message Date
Pascal Bleser
14bd930b92 groupware: JMAP WS push notifications support 2025-12-09 09:15:39 +01:00
Pascal Bleser
0b393de47f groupware: implement Mailbox modification endpoints + refactor ETag/state in the framework
* add endpoints for Mailboxes:
   - PATCH mailboxes/{id}
   - DELETE mailboxes/{id}
   - POST mailboxes

 * refactor the pkg/jmap and groupware framework to systematically
   return a jmap.State out-of-band of the per-method payloads, since
   they are almost always present in JMAP responses, which lead to the
   artificial creation of a lot of composed struct types just to also
   return the State; on the downside, it adds yet another return
   parameter
2025-12-09 09:15:39 +01:00
Pascal Bleser
4fee45379b start websocket implementation, add endpoint for email summaries
* feat(groupware): start implementing JMAP websocket support for push
   notifications (unfinished)

 * groupware: add GetLatestEmailsSummaryForAllAccounts

 * add new vendored dependency: github.com/gorilla/websocket

 * jmap: add QueryEmailSummaries

 * openapi: start adding examples

 * openapi: add new tooling for api-examples.yaml injection

 * apidoc-process.ts: make it more typescript-y

 * bump @redocly/cli from 2.0.8 to latest 2.2.0
2025-12-09 09:15:37 +01:00
Pascal Bleser
c31d7c57bb fix(groupware): fix JMAP error handling
* the JMAP error handling was not working properly, fixed it and added
   error definitions accordingly

 * add operations to retrieve mailbox roles and mailboxes by role for
   all accounts
2025-12-09 09:15:37 +01:00
Pascal Bleser
6224ded8b5 refactor(groupware): add max requests check
* move jmap.request() to jmap.Client.request() and pass the Session
   and a Logger to introduce checking the number of methodCalls within a
   request not exceeding the limit of the Session, as well as error
   handling and logging there instead of in each caller

 * a few bugfixes:
   - add a few missing Send() calls in logs
   - correct the response tag matching for
     GetMailboxChangesForMultipleAccounts
   - fix typo in Identity.ReplyTo json serialization rune
   - fix response tag in pkg/jmap/testdata/mailboxes1.json after
     changing them to be prefixed by the accountId
2025-12-09 09:15:37 +01:00
Pascal Bleser
d214cfa2b7 groupware: initial related emails implementation with SSE 2025-12-09 09:15:36 +01:00
Pascal Bleser
8d9c3b0c4e Groupware improvements
* ensure that all the jmap responses contain the SessionState

 * implement missing errors that were marked as TODO

 * moved common functions from pkg/jmap and pkg/services/groupware to
   pkg/log and pkg/structs to commonalize them across both source trees

 * implement error handling for SetError occurences

 * Email: replace anonymous map[string]bool for mailbox rights with a
   MailboxRights struct, as the keys are well-defined, which allows for
   properly documenting them

 * introduce ObjectType as an "enum"

 * fix JSON marshalling and unmarshalling of EmailBodyStructure

 * move the swagger documentation structs from groupware_api.go to
   groupware_docs.go

 * fix: change verb for /groupware/accounts/*/vacation from POST to PUT
2025-12-09 09:15:36 +01:00
Pascal Bleser
0d2a5e992c groupware: further implementation and improvements 2025-12-09 09:15:36 +01:00
Pascal Bleser
2191b1d011 groupware: implement JSON:API's error response format, with a revamped error handling in jmap and services/groupware 2025-12-09 09:15:36 +01:00