forked from
anil.recoil.org/ocaml-jmap
this repo has no description
1# ocaml-jmap - JMAP Protocol Implementation for OCaml
2
3A complete implementation of the JSON Meta Application Protocol (JMAP) as specified in RFC 8620 (core) and RFC 8621 (mail).
4
5## Libraries
6
7The `jmap` package provides:
8
9- **jmap** - Core JMAP protocol types and serialization
10- **jmap.eio** - JMAP client using Eio for async I/O
11- **jmap.brr** - JMAP client for browsers using js_of_ocaml
12
13## Key Features
14
15- Full RFC 8620 (JMAP Core) support: sessions, accounts, method calls, and error handling
16- Full RFC 8621 (JMAP Mail) support: mailboxes, emails, threads, identities, and submissions
17- Type-safe request chaining with result references
18- Multiple backends: Eio for native async, Brr for browser-based clients
19- JSON serialization via jsont
20
21## Usage
22
23```ocaml
24(* Query emails from a mailbox using the Chain API *)
25open Jmap
26
27let query_and_fetch ~account_id ~mailbox_id =
28 let open Chain in
29 let filter = Email.Filter_condition.(Condition { ... }) in
30 let* query_handle = email_query ~account_id ~filter () in
31 let* get_handle = email_get ~account_id ~ids:(Some (from_query query_handle)) () in
32 return (query_handle, get_handle)
33```
34
35## Installation
36
37```
38opam install jmap
39```
40
41To use the Eio client, ensure `eio` and `requests` are installed:
42
43```
44opam install eio requests
45```
46
47For browser-based applications with `js_of_ocaml`:
48
49```
50opam install brr
51```
52
53## Documentation
54
55API documentation is available via:
56
57```
58opam install jmap odoc
59dune build @doc
60```
61
62## License
63
64ISC