XML response builders and small request parsers for the CardDAV endpoints. Generates Multi-Status (RFC 4918) responses with the CardDAV (RFC 6352) namespace extensions.
Summary
Functions
Render a Multi-Status XML document from a list of <response> elements.
Parse an addressbook-query body for prop-filters. Returns a map with
Parse MKCOL / MKCALENDAR-style body for displayname / description.
Parse an addressbook-multiget body to extract the list of <href> values.
Parse PROPPATCH body — best-effort for displayname / description.
Parse a sync-collection REPORT body. Returns the integer version
encoded in the sync-token (or nil for an empty/initial token) and
whether address-data was requested.
Build a single <d:response> element. props_with_status is a list
of {status_string, [{prop_tag, attrs, children}]} tuples — each
group is wrapped in its own <d:propstat>.
Build a deletion-style <d:response> (no <d:propstat>, just a
top-level <d:status>). Used by sync-collection to signal removed
resources.
Functions
Render a Multi-Status XML document from a list of <response> elements.
Parse an addressbook-query body for prop-filters. Returns a map with:
:fn_match— text-match value for FN, or nil:email_match— text-match value for EMAIL, or nil:any_match— text-match with param-filter=any, or nil
Parse MKCOL / MKCALENDAR-style body for displayname / description.
Parse an addressbook-multiget body to extract the list of <href> values.
Parse PROPPATCH body — best-effort for displayname / description.
Parse a sync-collection REPORT body. Returns the integer version
encoded in the sync-token (or nil for an empty/initial token) and
whether address-data was requested.
Build a single <d:response> element. props_with_status is a list
of {status_string, [{prop_tag, attrs, children}]} tuples — each
group is wrapped in its own <d:propstat>.
Build a deletion-style <d:response> (no <d:propstat>, just a
top-level <d:status>). Used by sync-collection to signal removed
resources.