Commit Graph

5 Commits

Author SHA1 Message Date
Pascal Bleser
98144177f8 groupware: simplify JMAP integration tests with Stalwart 0.16
* don't run the Stalwart container in recovery mode first, just run it
   in "proper" mode, import the configuration and use it like that,
   which only requires skipping the "destroy" steps

 * add code documentation and logging

 * replace the text templating of the Stalwart snapshot by doing the
   same as the formatting script was doing, but directly in Go, removing
   an additional step to perform when modifying a Stalwart
   configuration to use in the integration tests
2026-06-16 16:51:37 +02:00
Pascal Bleser
8690f7c6cb groupware: port tests to Stalwart 0.16.7 2026-06-16 16:51:37 +02:00
Pascal Bleser
7e8caab979 groupware: add strongly typed aliases for AccountId, PrincipalId and SupplierId
Purpose is to make APIs and parameters easier to understand, since plain
strings are used all over the place for all sorts of identifiers.
2026-06-16 16:51:37 +02:00
Pascal Bleser
3e8c37a13b groupware: refactoring for pagination and support for multiple query suppliers
* refactor APIs in JMAP and Groupware in order to implement pagination
   across multiple accountIds and multiple suppliers (currently
   implemented using a mock supplier for contacts)

 * requires go 1.26 due to use of self-reflecting generics type
   constraints

 * still missing: query criteria and sorting parameters

 * still missing: multi-accountId support for emails

 * errors are now all just 'error' in the APIs, instead of the
   specialized implementations, and are interpreted dynamically where
   necessary in order to transform them into HTTP responses

 * remove position, anchor, anchorOffset as individual query parameters
   as we now only support a 'next=...' token for subsequent pages
   (except in emails for now), and use jmap.QueryParams instead; those
   tokens have a header character for the format, followed by a JSON
   encoded QueryParams map, all wrapped into base62 to make it clearer
   that it is meant to be an opaque token, and not a parameter clients
   should tinker with or construct themselves

 * introduce QueryParamsSupplier as an interface to provide QueryParams
   for various scenarios (single supplier, multiple supplier, ...) per
   accountId

 * implement multi-supplier template methods slist and squery
2026-06-16 16:51:37 +02:00
Pascal Bleser
92aa5fca67 groupware: refactor responses to a jmap.Response object
* in the JMAP API as well as in several places in the Groupware
   framework, use a single jmap.Response[T] object to return the
   payload, the language, the session state and the etag/state instead
   of individual multi-valued return values
2026-06-16 16:51:37 +02:00