Testing a Gemini codegen run
at main 4.8 kB view raw
1(** JMAP Mail Extension (RFC 8621). 2 3 This module provides types and signatures for interacting with JMAP Mail 4 data types: Mailbox, Thread, Email, SearchSnippet, Identity, EmailSubmission, 5 and VacationResponse. 6*) 7 8(** {1 Core Types} *) 9module Types = Jmap_email_types 10 11(** {1 Mailbox} 12 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2> RFC 8621, Section 2 *) 13module Mailbox = Jmap_mailbox 14 15(** {1 Thread} 16 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-3> RFC 8621, Section 3 *) 17module Thread = Jmap_thread 18 19(** {1 Search Snippet} 20 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-5> RFC 8621, Section 5 *) 21module SearchSnippet = Jmap_search_snippet 22 23(** {1 Identity} 24 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-6> RFC 8621, Section 6 *) 25module Identity = Jmap_identity 26 27(** {1 Email Submission} 28 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *) 29module Submission = Jmap_submission 30 31(** {1 Vacation Response} 32 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-8> RFC 8621, Section 8 *) 33module Vacation = Jmap_vacation 34 35(** Capability URI for JMAP Mail. 36 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-1.3.1> RFC 8621, Section 1.3.1 *) 37val capability_mail : string 38 39(** Capability URI for JMAP Submission. 40 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-1.3.2> RFC 8621, Section 1.3.2 *) 41val capability_submission : string 42 43(** Capability URI for JMAP Vacation Response. 44 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-1.3.3> RFC 8621, Section 1.3.3 *) 45val capability_vacationresponse : string 46 47(** Type name for EmailDelivery push notifications. 48 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-1.5> RFC 8621, Section 1.5 *) 49val push_event_type_email_delivery : string 50 51(** JMAP keywords corresponding to IMAP system flags. 52 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.1> RFC 8621, Section 4.1.1 *) 53val keyword_draft : string 54val keyword_seen : string 55val keyword_flagged : string 56val keyword_answered : string 57 58(** Common JMAP keywords from RFC 5788. 59 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.1> RFC 8621, Section 4.1.1 *) 60val keyword_forwarded : string 61val keyword_phishing : string 62val keyword_junk : string 63val keyword_notjunk : string 64 65(** Functions to manipulate email flags/keywords *) 66module Keyword_ops : sig 67 (** Add a keyword/flag to an email *) 68 val add : Types.Email.t -> Types.Keywords.keyword -> Types.Email.t 69 70 (** Remove a keyword/flag from an email *) 71 val remove : Types.Email.t -> Types.Keywords.keyword -> Types.Email.t 72 73 (** Mark an email as seen/read *) 74 val mark_as_seen : Types.Email.t -> Types.Email.t 75 76 (** Mark an email as unseen/unread *) 77 val mark_as_unseen : Types.Email.t -> Types.Email.t 78 79 (** Mark an email as flagged/important *) 80 val mark_as_flagged : Types.Email.t -> Types.Email.t 81 82 (** Remove flagged/important marking from an email *) 83 val unmark_flagged : Types.Email.t -> Types.Email.t 84 85 (** Mark an email as a draft *) 86 val mark_as_draft : Types.Email.t -> Types.Email.t 87 88 (** Remove draft marking from an email *) 89 val unmark_draft : Types.Email.t -> Types.Email.t 90 91 (** Mark an email as answered/replied *) 92 val mark_as_answered : Types.Email.t -> Types.Email.t 93 94 (** Remove answered/replied marking from an email *) 95 val unmark_answered : Types.Email.t -> Types.Email.t 96 97 (** Mark an email as forwarded *) 98 val mark_as_forwarded : Types.Email.t -> Types.Email.t 99 100 (** Mark an email as spam/junk *) 101 val mark_as_junk : Types.Email.t -> Types.Email.t 102 103 (** Mark an email as not spam/junk *) 104 val mark_as_not_junk : Types.Email.t -> Types.Email.t 105 106 (** Mark an email as phishing *) 107 val mark_as_phishing : Types.Email.t -> Types.Email.t 108 109 (** Add a custom keyword to an email *) 110 val add_custom : Types.Email.t -> string -> Types.Email.t 111 112 (** Remove a custom keyword from an email *) 113 val remove_custom : Types.Email.t -> string -> Types.Email.t 114end 115 116(** Conversion functions for JMAP/IMAP compatibility *) 117module Conversion : sig 118 (** Convert a JMAP keyword variant to IMAP flag *) 119 val keyword_to_imap_flag : Types.Keywords.keyword -> string 120 121 (** Convert an IMAP flag to JMAP keyword variant *) 122 val imap_flag_to_keyword : string -> Types.Keywords.keyword 123 124 (** Check if a string is valid for use as a custom keyword according to RFC 8621 *) 125 val is_valid_custom_keyword : string -> bool 126 127 (** Get the JMAP protocol string representation of a keyword *) 128 val keyword_to_string : Types.Keywords.keyword -> string 129 130 (** Parse a JMAP protocol string into a keyword variant *) 131 val string_to_keyword : string -> Types.Keywords.keyword 132end