···2121*)
2222type t
23232424+(** JSON serialization interface *)
2525+include Jmap_sigs.JSONABLE with type t := t
2626+2427(** Get the server-assigned email identifier.
2528 @param t The email object
2629 @return Email ID if present in the object *)
···148151149152(** Get the value of a specific header field.
150153151151- Retrieves raw header values for headers requested via the Header:{name}
154154+ Retrieves raw header values for headers requested via the Header:[name]
152155 property in Email/get requests.
153156154157 @param t The email object
···236239237240(** Extract the email ID, raising an exception if not present.
238241 @param t The email object
239239- @return The email ID
240240- @raise Failure if the email has no ID *)
242242+ @return The email ID *)
241243val take_id : t -> id
242244243245(** Check if the email is unread.
···285287 @return String summary of email for list display *)
286288val display_summary : t -> string
287289288288-(** Convert email to JSON representation.
289289-290290- Produces JSON object representation including all properties that are
291291- present in the email object. This is the format used in JMAP responses.
292292-293293- @param t The email to convert
294294- @return JSON object with all email fields that are present *)
295295-val to_json : t -> Yojson.Safe.t
296296-297290(** Convert email to JSON with specific properties.
298291299292 Produces JSON object containing only the specified properties, which
···304297 @param properties List of property names to include
305298 @return JSON object with only the specified properties *)
306299val to_json_with_properties : t -> string list -> Yojson.Safe.t
307307-308308-(** Parse email from JSON representation.
309309-310310- Parses email from JSON object as received in JMAP responses.
311311- Handles partial objects where only some properties are present.
312312-313313- @param json JSON object representing an email
314314- @return Result containing parsed email object or parse error *)
315315-val of_json : Yojson.Safe.t -> (t, string) result
316300317301318302(** Email patch operations for Email/set method.
-88
jmap/jmap-email/jmap_email_batch.mli
···11-(** Batch operations for JMAP Email.
22-33- This module provides efficient batch operations for common
44- email management tasks, minimizing round-trips to the server.
55-66- @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.6> RFC 8621 Section 4.6 *)
77-88-(** {1 Batch Operations} *)
99-1010-(** Batch operation builder *)
1111-type t
1212-1313-(** Create a new batch operation *)
1414-val create : unit -> t
1515-1616-(** {2 Email Operations} *)
1717-1818-(** Mark emails as read *)
1919-val mark_read : Jmap.Id.t list -> t -> t
2020-2121-(** Mark emails as unread *)
2222-val mark_unread : Jmap.Id.t list -> t -> t
2323-2424-(** Add flag/star to emails *)
2525-val add_flag : Jmap.Id.t list -> t -> t
2626-2727-(** Remove flag/star from emails *)
2828-val remove_flag : Jmap.Id.t list -> t -> t
2929-3030-(** Add custom keyword to emails *)
3131-val add_keyword : string -> Jmap.Id.t list -> t -> t
3232-3333-(** Remove custom keyword from emails *)
3434-val remove_keyword : string -> Jmap.Id.t list -> t -> t
3535-3636-(** Move emails to a mailbox *)
3737-val move_to_mailbox : mailbox_id:string -> Jmap.Id.t list -> t -> t
3838-3939-(** Copy emails to a mailbox *)
4040-val copy_to_mailbox : mailbox_id:string -> Jmap.Id.t list -> t -> t
4141-4242-(** Remove emails from a mailbox *)
4343-val remove_from_mailbox : mailbox_id:string -> Jmap.Id.t list -> t -> t
4444-4545-(** Move emails to trash *)
4646-val move_to_trash : Jmap.Id.t list -> t -> t
4747-4848-(** Permanently delete emails *)
4949-val delete : Jmap.Id.t list -> t -> t
5050-5151-(** Archive emails (remove from inbox, keep in other mailboxes) *)
5252-val archive : Jmap.Id.t list -> t -> t
5353-5454-(** {2 Mailbox Operations} *)
5555-5656-(** Create a new mailbox *)
5757-val create_mailbox :
5858- name:string ->
5959- ?parent_id:string ->
6060- ?role:string ->
6161- t -> t
6262-6363-(** Rename a mailbox *)
6464-val rename_mailbox : Jmap.Id.t -> string -> t -> t
6565-6666-(** Delete a mailbox *)
6767-val delete_mailbox : Jmap.Id.t -> t -> t
6868-6969-(** {2 Execution} *)
7070-7171-(** Batch operation result *)
7272-type result = {
7373- created : (string * Jmap.Id.t) list; (** Temporary ID -> Server ID mapping *)
7474- updated : Jmap.Id.t list; (** Successfully updated IDs *)
7575- destroyed : Jmap.Id.t list; (** Successfully destroyed IDs *)
7676- not_created : (string * Jmap.Protocol.Error.Set_error.t) list;
7777- not_updated : (Jmap.Id.t * Jmap.Protocol.Error.Set_error.t) list;
7878- not_destroyed : (Jmap.Id.t * Jmap.Protocol.Error.Set_error.t) list;
7979-}
8080-8181-(** {1 Progress Tracking} *)
8282-8383-(** Progress callback for long operations *)
8484-type progress = {
8585- current : int;
8686- total : int;
8787- message : string;
8888-}
-150
jmap/jmap-email/jmap_email_methods.mli
···11-(** JMAP Email method names and builders.
22-33- This module provides type-safe method names and high-level
44- builders for JMAP Email methods.
55-66- @see <https://www.rfc-editor.org/rfc/rfc8621.html> RFC 8621 *)
77-88-(** {1 Method Names} *)
99-1010-(** Email method names as a polymorphic variant type *)
1111-type t = [
1212- | `Email_get
1313- | `Email_query
1414- | `Email_queryChanges
1515- | `Email_set
1616- | `Email_copy
1717- | `Email_import
1818- | `Email_parse
1919- | `EmailSubmission_get
2020- | `EmailSubmission_query
2121- | `EmailSubmission_queryChanges
2222- | `EmailSubmission_set
2323- | `Thread_get
2424- | `Thread_query
2525- | `Mailbox_get
2626- | `Mailbox_query
2727- | `Mailbox_queryChanges
2828- | `Mailbox_set
2929- | `Identity_get
3030- | `Identity_query
3131- | `Identity_set
3232- | `VacationResponse_get
3333- | `VacationResponse_set
3434-]
3535-3636-(** Convert method name to string for wire protocol *)
3737-val to_string : t -> string
3838-3939-(** Parse method name from string *)
4040-val of_string : string -> t option
4141-4242-(** Pretty-print a method name *)
4343-val pp : Format.formatter -> t -> unit
4444-4545-(** {1 Method Call ID Management} *)
4646-4747-(** Method call ID generator *)
4848-module CallId : sig
4949- type t
5050-5151- (** Create a call ID generator *)
5252- val create : unit -> t
5353-5454- (** Generate next call ID with optional prefix *)
5555- val next : ?prefix:string -> t -> string
5656-5757- (** Reset the generator *)
5858- val reset : t -> unit
5959-end
6060-6161-(** {1 Request Builders} *)
6262-6363-(** High-level request builder that manages method chaining *)
6464-module RequestBuilder : sig
6565- type t
6666-6767- (** Create a new request builder *)
6868- val create : unit -> t
6969-7070- (** Add Email/query method *)
7171- val email_query :
7272- ?account_id:string ->
7373- ?filter:Jmap_email_query.Filter.t ->
7474- ?sort:Jmap_email_query.Sort.t list ->
7575- ?limit:int ->
7676- ?position:int ->
7777- t -> t
7878-7979- (** Add Email/get method with automatic result reference *)
8080- val email_get :
8181- ?account_id:string ->
8282- ?ids:Jmap.Id.t list ->
8383- ?properties:Jmap_email_query.property list ->
8484- ?reference_from:string -> (* Call ID to reference *)
8585- t -> t
8686-8787- (** Add Email/set method *)
8888- val email_set :
8989- ?account_id:string ->
9090- ?create:(string * Jmap_email.t) list ->
9191- ?update:(Jmap.Id.t * Jmap.Patch.t) list ->
9292- ?destroy:Jmap.Id.t list ->
9393- t -> t
9494-9595- (** Add Thread/get method *)
9696- val thread_get :
9797- ?account_id:string ->
9898- ?ids:Jmap.Id.t list ->
9999- t -> t
100100-101101- (** Add Mailbox/query method *)
102102- val mailbox_query :
103103- ?account_id:string ->
104104- ?filter:Yojson.Safe.t ->
105105- ?sort:Jmap.Methods.Comparator.t list ->
106106- t -> t
107107-108108- (** Add Mailbox/get method *)
109109- val mailbox_get :
110110- ?account_id:string ->
111111- ?ids:Jmap.Id.t list ->
112112- t -> t
113113-114114- (** Get specific method response by type *)
115115- val get_response :
116116- method_:t ->
117117- ?call_id:string ->
118118- Jmap.Protocol.Response.t ->
119119- (Yojson.Safe.t, Jmap.Protocol.Error.error) result
120120-end
121121-122122-(** {1 Response Parsers} *)
123123-124124-(** Type-safe response extraction *)
125125-module Response : sig
126126- (** Extract and parse Email/query response *)
127127- val parse_email_query :
128128- ?call_id:string ->
129129- Jmap.Protocol.Response.t ->
130130- (Jmap_email_query.query_result, Jmap.Protocol.Error.error) result
131131-132132- (** Extract and parse Email/get response *)
133133- val parse_email_get :
134134- ?call_id:string ->
135135- Jmap.Protocol.Response.t ->
136136- (Jmap_email.t list, Jmap.Protocol.Error.error) result
137137-138138- (** Extract and parse Thread/get response *)
139139- val parse_thread_get :
140140- ?call_id:string ->
141141- Jmap.Protocol.Response.t ->
142142- (Jmap_thread.t list, Jmap.Protocol.Error.error) result
143143-144144- (** Extract and parse Mailbox/get response *)
145145- val parse_mailbox_get :
146146- ?call_id:string ->
147147- Jmap.Protocol.Response.t ->
148148- (Jmap_mailbox.t list, Jmap.Protocol.Error.error) result
149149-end
150150-
+1-1
jmap/jmap-email/jmap_email_query.mli
···991010(** Type-safe email property selectors.
11111212- Uses the canonical polymorphic variant property system from {!Jmap_email_property}.
1212+ Uses the canonical polymorphic variant property system from [Jmap_email_property].
1313 This provides full compatibility with all JMAP Email properties including
1414 header and custom extension properties.
1515*)
+1-2
jmap/jmap-email/jmap_mailbox.mli
···6767type mailbox_t = t
68686969(** JSON serialization interface *)
7070-val to_json : t -> Yojson.Safe.t
7171-val of_json : Yojson.Safe.t -> (t, string) Result.t
7070+include Jmap_sigs.JSONABLE with type t := t
72717372(** {1 Property Accessors} *)
7473
+1-2
jmap/jmap-email/jmap_vacation.mli
···3232type vacation_response = t
33333434(** JSON serialization interface *)
3535-val to_json : t -> Yojson.Safe.t
3636-val of_json : Yojson.Safe.t -> (t, string) Result.t
3535+include Jmap_sigs.JSONABLE with type t := t
37363837(** Get the vacation response ID.
3938 @return Always returns "singleton" for VacationResponse objects *)
+6-9
jmap/jmap-unix/jmap_unix.mli
···567567568568 @param json JSON object representing an email as returned by Email/get
569569 @return Parsed Email object
570570- @raise Failure if JSON structure is invalid
570570+571571 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1> RFC 8621, Section 4.1 *)
572572 (* val from_json : Yojson.Safe.t -> t
573573···575575576576 @param json JSON object with 'email' and optional 'name' fields
577577 @return Parsed EmailAddress object
578578- @raise Failure if JSON structure is invalid
578578+579579 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.2.3> RFC 8621, Section 4.1.2.3 *)
580580 val from_json_address : Yojson.Safe.t -> Email_address.t
581581···583583584584 @param json JSON object mapping keyword strings to boolean values
585585 @return Parsed Keywords set
586586- @raise Failure if JSON structure is invalid
586586+587587 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.1> RFC 8621, Section 4.1.1 *)
588588 val from_json_keywords : Yojson.Safe.t -> Jmap_email.Email_keywords.t *)
589589end
···594594module Auth : sig
595595 (** Read an API key from a file.
596596 @param filename Path to the file containing the API key
597597- @return The API key as a string, with whitespace trimmed
598598- @raise Failure if the file cannot be read or is empty *)
597597+ @return The API key as a string, with whitespace trimmed *)
599598 val read_api_key : string -> string
600599601600 (** Read an API key from the default ".api-key" file in the current directory.
602602- @return The API key as a string, with whitespace trimmed
603603- @raise Failure if the file cannot be read or is empty *)
601601+ @return The API key as a string, with whitespace trimmed *)
604602 val read_api_key_default : unit -> string
605603end
606604···613611 (** Get the primary mail account ID from a session.
614612 Falls back to the first available account if no primary mail account is found.
615613 @param session The JMAP session
616616- @return The account ID to use for mail operations
617617- @raise Failure if no accounts are found *)
614614+ @return The account ID to use for mail operations *)
618615 val get_primary_mail_account : Jmap.Protocol.Session.Session.t -> Jmap.Types.id
619616end
620617
+2-11
jmap/jmap/jmap_date.mli
···1717(** Abstract type representing a JMAP Date. *)
1818type t
19192020-(** JSON serialization interface. *)
2121-2222-(** Convert a JMAP Date to JSON.
2323- @param date The Date to serialize.
2424- @return A JSON string in RFC 3339 format. *)
2525-val to_json : t -> Yojson.Safe.t
2626-2727-(** Parse a JMAP Date from JSON.
2828- @param json The JSON value to parse (expected to be RFC 3339 string).
2929- @return Ok with the parsed Date, or Error with a description of the parsing failure. *)
3030-val of_json : Yojson.Safe.t -> (t, string) result
2020+(** JSON serialization interface *)
2121+include Jmap_sigs.JSONABLE with type t := t
31223223(** {1 Construction and Access} *)
3324
+2-11
jmap/jmap/jmap_id.mli
···1414(** Abstract type representing a JMAP Id. *)
1515type t
16161717-(** JSON serialization interface. *)
1818-1919-(** Convert a JMAP Id to JSON.
2020- @param id The Id to serialize.
2121- @return A JSON string representation. *)
2222-val to_json : t -> Yojson.Safe.t
2323-2424-(** Parse a JMAP Id from JSON.
2525- @param json The JSON value to parse.
2626- @return Ok with the parsed Id, or Error with a description of the parsing failure. *)
2727-val of_json : Yojson.Safe.t -> (t, string) result
1717+(** JSON serialization interface *)
1818+include Jmap_sigs.JSONABLE with type t := t
28192920(** {1 Construction and Access} *)
3021
+2-11
jmap/jmap/jmap_patch.mli
···1919(** Abstract type representing a JMAP Patch Object. *)
2020type t
21212222-(** JSON serialization interface. *)
2323-2424-(** Convert a JMAP Patch to JSON.
2525- @param patch The Patch to serialize.
2626- @return A JSON object representation. *)
2727-val to_json : t -> Yojson.Safe.t
2828-2929-(** Parse a JMAP Patch from JSON.
3030- @param json The JSON value to parse (expected to be an object).
3131- @return Ok with the parsed Patch, or Error with a description of the parsing failure. *)
3232-val of_json : Yojson.Safe.t -> (t, string) result
2222+(** JSON serialization interface *)
2323+include Jmap_sigs.JSONABLE with type t := t
33243425(** {1 Construction and Access} *)
3526
+2-11
jmap/jmap/jmap_uint.mli
···1515(** Abstract type representing a JMAP UnsignedInt. *)
1616type t
17171818-(** JSON serialization interface. *)
1919-2020-(** Convert a JMAP UnsignedInt to JSON.
2121- @param uint The UnsignedInt to serialize.
2222- @return A JSON number representation. *)
2323-val to_json : t -> Yojson.Safe.t
2424-2525-(** Parse a JMAP UnsignedInt from JSON.
2626- @param json The JSON value to parse (expected to be a non-negative number).
2727- @return Ok with the parsed UnsignedInt, or Error with a description of the parsing failure. *)
2828-val of_json : Yojson.Safe.t -> (t, string) result
1818+(** JSON serialization interface *)
1919+include Jmap_sigs.JSONABLE with type t := t
29203021(** {1 Construction and Access} *)
3122