Testing a Gemini codegen run

trim

Changed files
-86
output
-82
output/full_response.json
···
-
[
-
{
-
"filename": "dune-project",
-
"contents": "(lang dune 3.17)"
-
},
-
{
-
"filename": "dune",
-
"contents": "(library\n (name jmap)\n (public_name jmap)\n (libraries yojson uri)\n (modules_without_implementation\n jmap\n jmap_types\n jmap_error\n jmap_wire\n jmap_session\n jmap_methods\n jmap_binary\n jmap_push\n jmap_email_types\n jmap_mailbox\n jmap_thread\n jmap_email\n jmap_search_snippet\n jmap_identity\n jmap_submission\n jmap_vacation\n jmap_email\n jmap_unix\n ))"
-
},
-
{
-
"filename": "jmap_types.mli",
-
"contents": "(** Basic JMAP types as defined in RFC 8620. *)\n\n(** The Id data type.\n A string of 1 to 255 octets, using URL-safe base64 characters.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-1.2> RFC 8620, Section 1.2 *)\ntype id = string\n\n(** The Int data type.\n An integer in the range [-2^53+1, 2^53-1]. Represented as OCaml's standard [int].\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-1.3> RFC 8620, Section 1.3 *)\ntype jint = int\n\n(** The UnsignedInt data type.\n An integer in the range [0, 2^53-1]. Represented as OCaml's standard [int].\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-1.3> RFC 8620, Section 1.3 *)\ntype uint = int\n\n(** The Date data type.\n A string in RFC 3339 \"date-time\" format.\n Represented as a float using Unix time.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-1.4> RFC 8620, Section 1.4 *)\ntype date = float\n\n(** The UTCDate data type.\n A string in RFC 3339 \"date-time\" format, restricted to UTC (Z timezone).\n Represented as a float using Unix time.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-1.4> RFC 8620, Section 1.4 *)\ntype utc_date = float\n\n(** Represents a JSON object used as a map String -> V. *)\ntype 'v string_map = (string, 'v) Hashtbl.t\n\n(** Represents a JSON object used as a map Id -> V. *)\ntype 'v id_map = (id, 'v) Hashtbl.t\n\n(** Represents a JSON Pointer path with JMAP extensions.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.7> RFC 8620, Section 3.7 *)\ntype json_pointer = string"
-
},
-
{
-
"filename": "jmap_error.mli",
-
"contents": "(** JMAP Error Types. *)\n\nopen Jmap_types\n\n(** Problem details object for HTTP-level errors.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.1> RFC 8620, Section 3.6.1\n @see <https://www.rfc-editor.org/rfc/rfc7807.html> RFC 7807 *)\ntype problem_details = {\n problem_type : string; (** The \"type\" field from RFC 7807. *)\n status : int option; (** The \"status\" field. *)\n detail : string option; (** The \"detail\" field. *)\n limit : string option; (** For \"urn:ietf:params:jmap:error:limit\" *)\n other_fields : Yojson.Safe.t string_map; (** Catch-all for extra fields *)\n}\n\n(** Standard Method-level error types.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.2> RFC 8620, Section 3.6.2 *)\ntype method_error_type = [\n | `ServerUnavailable\n | `ServerFail\n | `ServerPartialFail\n | `UnknownMethod\n | `InvalidArguments\n | `InvalidResultReference\n | `Forbidden\n | `AccountNotFound\n | `AccountNotSupportedByMethod\n | `AccountReadOnly\n | `RequestTooLarge (* From /get *)\n | `CannotCalculateChanges (* From /changes, /queryChanges *)\n | `StateMismatch (* From /set, /copy *)\n | `AnchorNotFound (* From /query *)\n | `UnsupportedSort (* From /query *)\n | `UnsupportedFilter (* From /query *)\n | `TooManyChanges (* From /queryChanges *)\n | `FromAccountNotFound (* From /copy, Blob/copy *)\n | `FromAccountNotSupportedByMethod (* From /copy *)\n | `Other_method_error of string (* For future or custom errors *)\n]\n\n(** Description for method errors. May contain additional details.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.2> RFC 8620, Section 3.6.2 *)\ntype method_error_description = {\n description : string option;\n}\n\n(** Represents a method-level error response invocation part.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.2> RFC 8620, Section 3.6.2 *)\ntype method_error = {\n err_type : method_error_type;\n err_description : method_error_description option;\n}\n\n(** Standard SetError types.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.3> RFC 8620, Section 5.3 *)\ntype set_error_type = [\n | `Forbidden\n | `OverQuota\n | `TooLarge\n | `RateLimit\n | `NotFound\n | `InvalidPatch\n | `WillDestroy\n | `InvalidProperties\n | `Singleton\n | `AlreadyExists (* From /copy *)\n | `MailboxHasChild (* RFC 8621 *)\n | `MailboxHasEmail (* RFC 8621 *)\n | `BlobNotFound (* RFC 8621 *)\n | `TooManyKeywords (* RFC 8621 *)\n | `TooManyMailboxes (* RFC 8621 *)\n | `InvalidEmail (* RFC 8621 *)\n | `TooManyRecipients (* RFC 8621 *)\n | `NoRecipients (* RFC 8621 *)\n | `InvalidRecipients (* RFC 8621 *)\n | `ForbiddenMailFrom (* RFC 8621 *)\n | `ForbiddenFrom (* RFC 8621 *)\n | `ForbiddenToSend (* RFC 8621 *)\n | `CannotUnsend (* RFC 8621 *)\n | `Other_set_error of string (* For future or custom errors *)\n]\n\n(** SetError object.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.3> RFC 8620, Section 5.3 *)\ntype set_error = {\n set_err_type : set_error_type;\n set_err_description : string option;\n set_err_properties : string list option; (** For InvalidProperties *)\n set_err_existing_id : id option; (** For AlreadyExists *)\n set_err_max_recipients : uint option; (** For TooManyRecipients *)\n set_err_invalid_recipients : string list option; (** For InvalidRecipients *)\n set_err_max_size : uint option; (** For TooLarge *)\n set_err_not_found_blob_ids : id list option; (** For BlobNotFound *)\n}"
-
},
-
{
-
"filename": "jmap_wire.mli",
-
"contents": "(** JMAP Wire Protocol Structures (Request/Response). *)\n\nopen Jmap_types\nopen Jmap_error\n\n(** An invocation tuple within a request or response.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.2> RFC 8620, Section 3.2 *)\ntype invocation = {\n method_name : string;\n arguments : Yojson.Safe.t;\n method_call_id : string;\n}\n\n(** A reference to a previous method call's result.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.7> RFC 8620, Section 3.7 *)\ntype result_reference = {\n result_of : string; (** The method call id of the previous call *)\n name : string; (** The required response name *)\n path : json_pointer; (** JSON Pointer path *)\n}\n\n(** The Request object.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.3> RFC 8620, Section 3.3 *)\ntype request = {\n using : string list;\n method_calls : invocation list;\n created_ids : id id_map option;\n}\n\n(** A response invocation part, which can be a standard response or an error.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.4> RFC 8620, Section 3.4\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.6.2> RFC 8620, Section 3.6.2 *)\ntype response_invocation =\n | Response of invocation\n | Error of method_error * string (* string is the method_call_id *)\n\n(** The Response object.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-3.4> RFC 8620, Section 3.4 *)\ntype response = {\n method_responses : response_invocation list;\n created_ids : id id_map option;\n session_state : string;\n}"
-
},
-
{
-
"filename": "jmap_session.mli",
-
"contents": "(** JMAP Session Resource.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-2> RFC 8620, Section 2 *)\n\nopen Jmap_types\n\n(** Core capability information.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-2> RFC 8620, Section 2 *)\ntype core_capability = {\n max_size_upload : uint;\n max_concurrent_upload : uint;\n max_size_request : uint;\n max_concurrent_requests : uint;\n max_calls_in_request : uint;\n max_objects_in_get : uint;\n max_objects_in_set : uint;\n collation_algorithms : string list;\n}\n\n(** Account capability information.\n The value is capability-specific.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-2> RFC 8620, Section 2 *)\ntype account_capability_value = Yojson.Safe.t\n\n(** An Account object.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-2> RFC 8620, Section 2 *)\ntype account = {\n acc_name : string;\n is_personal : bool;\n is_read_only : bool;\n account_capabilities : account_capability_value string_map;\n}\n\n(** Server capability information.\n The value is capability-specific.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-2> RFC 8620, Section 2 *)\ntype server_capability_value = Yojson.Safe.t\n\n(** The Session object.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-2> RFC 8620, Section 2 *)\ntype session = {\n capabilities : server_capability_value string_map;\n accounts : account id_map;\n primary_accounts : id string_map;\n username : string;\n api_url : Uri.t;\n download_url : Uri.t; (** Must be a Level 1 URI Template *) \n upload_url : Uri.t; (** Must be a Level 1 URI Template *)\n event_source_url : Uri.t; (** Must be a Level 1 URI Template *)\n state : string;\n}\n\n(** Function to perform service autodiscovery.\n Returns the session URL if found.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-2.2> RFC 8620, Section 2.2 *)\nval discover : domain:string -> Uri.t option Lwt.t\n\n(** Function to fetch the session object from a given URL.\n Requires authentication handling (details TBD/outside this signature). *)\nval get_session : url:Uri.t -> session Lwt.t"
-
},
-
{
-
"filename": "jmap_methods.mli",
-
"contents": "(** Standard JMAP Methods and Core/echo.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-4> RFC 8620, Section 4\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5> RFC 8620, Section 5 *)\n\nopen Jmap_types\nopen Jmap_error\n\n(** Generic representation of a record type. Actual types defined elsewhere. *)\ntype generic_record\n\n(** Arguments for /get methods.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.1> RFC 8620, Section 5.1 *)\ntype 'record get_args = {\n get_account_id : id;\n get_ids : id list option;\n get_properties : string list option;\n}\n\n(** Response for /get methods.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.1> RFC 8620, Section 5.1 *)\ntype 'record get_response = {\n get_resp_account_id : id;\n get_resp_state : string;\n get_resp_list : 'record list;\n get_resp_not_found : id list;\n}\n\n(** Arguments for /changes methods.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.2> RFC 8620, Section 5.2 *)\ntype changes_args = {\n changes_account_id : id;\n changes_since_state : string;\n changes_max_changes : uint option;\n}\n\n(** Response for /changes methods.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.2> RFC 8620, Section 5.2 *)\ntype changes_response = {\n changes_resp_account_id : id;\n changes_resp_old_state : string;\n changes_resp_new_state : string;\n changes_resp_has_more_changes : bool;\n changes_resp_created : id list;\n changes_resp_updated : id list;\n changes_resp_destroyed : id list;\n changes_resp_updated_properties : string list option; (* Mailbox/changes specific *)\n}\n\n(** Patch object for /set update.\n A list of (JSON Pointer path, value) pairs.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.3> RFC 8620, Section 5.3 *)\ntype patch_object = (json_pointer * Yojson.Safe.t) list\n\n(** Arguments for /set methods.\n ['create_record] is the record type without server-set/immutable fields.\n ['update_record] is the patch object type (usually [patch_object]).\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.3> RFC 8620, Section 5.3 *)\ntype ('create_record, 'update_record) set_args = {\n set_account_id : id;\n set_if_in_state : string option;\n set_create : 'create_record id_map option;\n set_update : 'update_record id_map option;\n set_destroy : id list option;\n set_on_success_destroy_original : bool option; (* For /copy *)\n set_destroy_from_if_in_state : string option; (* For /copy *)\n set_on_destroy_remove_emails : bool option; (* For Mailbox/set *)\n}\n\n(** Response for /set methods.\n ['created_record_info] is the server-set info for created records.\n ['updated_record_info] is the server-set/computed info for updated records.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.3> RFC 8620, Section 5.3 *)\ntype ('created_record_info, 'updated_record_info) set_response = {\n set_resp_account_id : id;\n set_resp_old_state : string option;\n set_resp_new_state : string;\n set_resp_created : 'created_record_info id_map option;\n set_resp_updated : 'updated_record_info option id_map option;\n set_resp_destroyed : id list option;\n set_resp_not_created : set_error id_map option;\n set_resp_not_updated : set_error id_map option;\n set_resp_not_destroyed : set_error id_map option;\n}\n\n(** Arguments for /copy methods.\n ['copy_record_override] contains the record id and override properties.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.4> RFC 8620, Section 5.4 *)\ntype 'copy_record_override copy_args = {\n copy_from_account_id : id;\n copy_if_from_in_state : string option;\n copy_account_id : id;\n copy_if_in_state : string option;\n copy_create : 'copy_record_override id_map; (* Map from creation id *)\n copy_on_success_destroy_original : bool; (* default: false *)\n copy_destroy_from_if_in_state : string option;\n}\n\n(** Response for /copy methods.\n ['created_record_info] is the server-set info for the created copy.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.4> RFC 8620, Section 5.4 *)\ntype 'created_record_info copy_response = {\n copy_resp_from_account_id : id;\n copy_resp_account_id : id;\n copy_resp_old_state : string option;\n copy_resp_new_state : string;\n copy_resp_created : 'created_record_info id_map option;\n copy_resp_not_created : set_error id_map option;\n}\n\n(** Base filter operator type.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.5> RFC 8620, Section 5.5 *)\ntype filter_operator = {\n operator : [ `AND | `OR | `NOT ];\n conditions : filter list;\n}\n(** Represents either a filter operator or a filter condition.\n ['condition] is the type of the specific FilterCondition object.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.5> RFC 8620, Section 5.5 *)\nand filter = \n | Filter_operator of filter_operator\n | Filter_condition of Yojson.Safe.t (* Placeholder for specific condition type *)\n\n(** Comparator for sorting.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.5> RFC 8620, Section 5.5 *)\ntype comparator = {\n property : string;\n is_ascending : bool option; (* default: true *)\n collation : string option;\n keyword : string option; (* For Email/query keyword sorts *)\n other_fields : Yojson.Safe.t string_map; (** Catch-all for extra fields *)\n}\n\n(** Arguments for /query methods.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.5> RFC 8620, Section 5.5 *)\ntype query_args = {\n query_account_id : id;\n query_filter : filter option;\n query_sort : comparator list option;\n query_position : jint option; (* default: 0 *)\n query_anchor : id option;\n query_anchor_offset : jint option; (* default: 0 *)\n query_limit : uint option;\n query_calculate_total : bool option; (* default: false *)\n query_collapse_threads : bool option; (* For Email/query *)\n query_sort_as_tree : bool option; (* For Mailbox/query *)\n query_filter_as_tree : bool option; (* For Mailbox/query *)\n}\n\n(** Response for /query methods.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.5> RFC 8620, Section 5.5 *)\ntype query_response = {\n query_resp_account_id : id;\n query_resp_query_state : string;\n query_resp_can_calculate_changes : bool;\n query_resp_position : uint;\n query_resp_ids : id list;\n query_resp_total : uint option;\n query_resp_limit : uint option;\n}\n\n(** Item indicating an added record in /queryChanges.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.6> RFC 8620, Section 5.6 *)\ntype added_item = {\n added_item_id : id;\n added_item_index : uint;\n}\n\n(** Arguments for /queryChanges methods.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.6> RFC 8620, Section 5.6 *)\ntype query_changes_args = {\n query_changes_account_id : id;\n query_changes_filter : filter option;\n query_changes_sort : comparator list option;\n query_changes_since_query_state : string;\n query_changes_max_changes : uint option;\n query_changes_up_to_id : id option;\n query_changes_calculate_total : bool option; (* default: false *)\n query_changes_collapse_threads : bool option; (* For Email/queryChanges *)\n}\n\n(** Response for /queryChanges methods.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.6> RFC 8620, Section 5.6 *)\ntype query_changes_response = {\n query_changes_resp_account_id : id;\n query_changes_resp_old_query_state : string;\n query_changes_resp_new_query_state : string;\n query_changes_resp_total : uint option;\n query_changes_resp_removed : id list;\n query_changes_resp_added : added_item list;\n}\n\n(** Core/echo method: Arguments are mirrored in the response.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-4> RFC 8620, Section 4 *)\ntype core_echo_args = Yojson.Safe.t\ntype core_echo_response = Yojson.Safe.t"
-
},
-
{
-
"filename": "jmap_binary.mli",
-
"contents": "(** JMAP Binary Data Handling.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-6> RFC 8620, Section 6 *)\n\nopen Jmap_types\nopen Jmap_error\n\n(** Response from uploading binary data.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-6.1> RFC 8620, Section 6.1 *)\ntype upload_response = {\n upload_resp_account_id : id;\n upload_resp_blob_id : id;\n upload_resp_type : string;\n upload_resp_size : uint;\n}\n\n(** Arguments for Blob/copy.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-6.3> RFC 8620, Section 6.3 *)\ntype blob_copy_args = {\n blob_copy_from_account_id : id;\n blob_copy_account_id : id;\n blob_copy_blob_ids : id list;\n}\n\n(** Response for Blob/copy.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-6.3> RFC 8620, Section 6.3 *)\ntype blob_copy_response = {\n blob_copy_resp_from_account_id : id;\n blob_copy_resp_account_id : id;\n blob_copy_resp_copied : id id_map option;\n blob_copy_resp_not_copied : set_error id_map option;\n}"
-
},
-
{
-
"filename": "jmap_push.mli",
-
"contents": "(** JMAP Push Notifications.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7> RFC 8620, Section 7 *)\n\nopen Jmap_types\nopen Jmap_methods\n\n(** TypeState object map (TypeName -> StateString).\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.1> RFC 8620, Section 7.1 *)\ntype type_state = string string_map\n\n(** StateChange object.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.1> RFC 8620, Section 7.1 *)\ntype state_change = {\n (* type field is implicitly \"StateChange\" *)\n changed : type_state id_map;\n}\n\n(** PushSubscription encryption keys.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2> RFC 8620, Section 7.2 *)\ntype push_encryption_keys = {\n p256dh : string; (** P-256 ECDH public key (URL-safe base64) *)\n auth : string; (** Authentication secret (URL-safe base64) *)\n}\n\n(** PushSubscription object.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2> RFC 8620, Section 7.2 *)\ntype push_subscription = {\n push_sub_id : id; (** server-set, immutable *)\n device_client_id : string; (** immutable *)\n url : Uri.t; (** immutable *)\n keys : push_encryption_keys option; (** immutable *)\n verification_code : string option;\n expires : utc_date option;\n types : string list option;\n}\n\n(** PushSubscription object for creation (omits server-set fields).\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2> RFC 8620, Section 7.2 *)\ntype push_subscription_create = {\n push_sub_create_device_client_id : string;\n push_sub_create_url : Uri.t;\n push_sub_create_keys : push_encryption_keys option;\n push_sub_create_expires : utc_date option;\n push_sub_create_types : string list option;\n}\n\n(** PushSubscription object for update patch.\n Only verification_code and expires can be updated.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2> RFC 8620, Section 7.2\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2.2> RFC 8620, Section 7.2.2 *)\ntype push_subscription_update = patch_object\n\n(** Arguments for PushSubscription/get.\n Extends standard /get args.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2.1> RFC 8620, Section 7.2.1 *)\ntype push_subscription_get_args = {\n push_sub_get_ids : id list option;\n push_sub_get_properties : string list option;\n}\n\n(** Response for PushSubscription/get.\n Extends standard /get response.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2.1> RFC 8620, Section 7.2.1 *)\ntype push_subscription_get_response = {\n push_sub_get_resp_list : push_subscription list;\n push_sub_get_resp_not_found : id list;\n}\n\n(** Arguments for PushSubscription/set.\n Extends standard /set args.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2.2> RFC 8620, Section 7.2.2 *)\ntype push_subscription_set_args = {\n push_sub_set_create : push_subscription_create id_map option;\n push_sub_set_update : push_subscription_update id_map option;\n push_sub_set_destroy : id list option;\n}\n\n(** Server-set information for created PushSubscription.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2.2> RFC 8620, Section 7.2.2 *)\ntype push_subscription_created_info = {\n push_sub_created_id : id;\n push_sub_created_expires : utc_date option;\n}\n\n(** Server-set information for updated PushSubscription.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2.2> RFC 8620, Section 7.2.2 *)\ntype push_subscription_updated_info = {\n push_sub_updated_expires : utc_date option;\n}\n\n(** Response for PushSubscription/set.\n Extends standard /set response.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2.2> RFC 8620, Section 7.2.2 *)\ntype push_subscription_set_response = {\n push_sub_set_resp_created : push_subscription_created_info id_map option;\n push_sub_set_resp_updated : push_subscription_updated_info option id_map option;\n push_sub_set_resp_destroyed : id list option;\n push_sub_set_resp_not_created : set_error id_map option;\n push_sub_set_resp_not_updated : set_error id_map option;\n push_sub_set_resp_not_destroyed : set_error id_map option;\n}\n\n(** PushVerification object.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.2.2> RFC 8620, Section 7.2.2 *)\ntype push_verification = {\n (* type field is implicitly \"PushVerification\" *)\n push_verification_push_subscription_id : id;\n push_verification_verification_code : string;\n}\n\n(** Data for EventSource ping event.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.3> RFC 8620, Section 7.3 *)\ntype event_source_ping_data = {\n interval : uint;\n}"
-
},
-
{
-
"filename": "jmap_email_types.mli",
-
"contents": "(** Common types for JMAP Mail (RFC 8621). *)\n\nopen Jmap_types\n\n(** Represents an email address with an optional name.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.2.3> RFC 8621, Section 4.1.2.3 *)\ntype email_address = {\n email_addr_name : string option;\n email_addr_email : string;\n}\n\n(** Represents a group of email addresses.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.2.4> RFC 8621, Section 4.1.2.4 *)\ntype email_address_group = {\n email_group_name : string option;\n email_group_addresses : email_address list;\n}\n\n(** Represents a header field (name and raw value).\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.3> RFC 8621, Section 4.1.3 *)\ntype email_header = {\n header_name : string;\n header_value : string; (* Raw form *)\n}\n\n(** Represents a body part within an Email's MIME structure.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.4> RFC 8621, Section 4.1.4 *)\ntype email_body_part = {\n part_id : string option; (** null only for multipart/* *)\n part_blob_id : id option; (** null only for multipart/* *)\n part_size : uint;\n part_headers : email_header list;\n part_name : string option;\n part_type : string;\n part_charset : string option;\n part_disposition : string option;\n part_cid : string option;\n part_language : string list option;\n part_location : string option;\n part_sub_parts : email_body_part list option; (** only for multipart/* *)\n part_other_headers : Yojson.Safe.t string_map; (** Requested header:* properties *)\n}\n\n(** Represents the decoded value of a text body part.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.4> RFC 8621, Section 4.1.4 *)\ntype email_body_value = {\n body_value : string;\n is_encoding_problem : bool; (* default: false *)\n is_truncated : bool; (* default: false *)\n}"
-
},
-
{
-
"filename": "jmap_mailbox.mli",
-
"contents": "(** JMAP Mailbox.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2> RFC 8621, Section 2 *)\n\nopen Jmap_types\nopen Jmap_methods\n\n(** Mailbox access rights.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2> RFC 8621, Section 2 *)\ntype mailbox_rights = {\n may_read_items : bool;\n may_add_items : bool;\n may_remove_items : bool;\n may_set_seen : bool;\n may_set_keywords : bool;\n may_create_child : bool;\n may_rename : bool;\n may_delete : bool;\n may_submit : bool;\n}\n\n(** Mailbox object.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2> RFC 8621, Section 2 *)\ntype mailbox = {\n mailbox_id : id; (** immutable, server-set *)\n name : string;\n parent_id : id option;\n role : string option;\n sort_order : uint; (* default: 0 *)\n total_emails : uint; (** server-set *)\n unread_emails : uint; (** server-set *)\n total_threads : uint; (** server-set *)\n unread_threads : uint; (** server-set *)\n my_rights : mailbox_rights; (** server-set *)\n is_subscribed : bool;\n}\n\n(** Mailbox object for creation.\n Excludes server-set fields.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2> RFC 8621, Section 2 *)\ntype mailbox_create = {\n mailbox_create_name : string;\n mailbox_create_parent_id : id option;\n mailbox_create_role : string option;\n mailbox_create_sort_order : uint option;\n mailbox_create_is_subscribed : bool option;\n}\n\n(** Mailbox object for update.\n Patch object, specific structure not enforced here.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2.5> RFC 8621, Section 2.5 *)\ntype mailbox_update = patch_object\n\n(** Server-set info for created mailbox.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2.5> RFC 8621, Section 2.5 *)\ntype mailbox_created_info = {\n mailbox_created_id : id;\n mailbox_created_role : string option; (** If default used *)\n mailbox_created_sort_order : uint; (** If default used *)\n mailbox_created_total_emails : uint;\n mailbox_created_unread_emails : uint;\n mailbox_created_total_threads : uint;\n mailbox_created_unread_threads : uint;\n mailbox_created_my_rights : mailbox_rights;\n mailbox_created_is_subscribed : bool; (** If default used *)\n}\n\n(** Server-set/computed info for updated mailbox.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2.5> RFC 8621, Section 2.5 *)\ntype mailbox_updated_info = mailbox (* Contains only changed server-set props *)\n\n(** FilterCondition for Mailbox/query.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2.3> RFC 8621, Section 2.3 *)\ntype mailbox_filter_condition = {\n filter_parent_id : id option option; (* Use option option for explicit null *)\n filter_name : string option;\n filter_role : string option option; (* Use option option for explicit null *)\n filter_has_any_role : bool option;\n filter_is_subscribed : bool option;\n}\n\n(** Mailbox/get: Args type (specialized from ['record get_args]). *)\ntype mailbox_get_args = mailbox get_args\n\n(** Mailbox/get: Response type (specialized from ['record get_response]). *)\ntype mailbox_get_response = mailbox get_response\n\n(** Mailbox/changes: Args type (specialized from [changes_args]). *)\ntype mailbox_changes_args = changes_args\n\n(** Mailbox/changes: Response type (specialized from [changes_response]). *)\ntype mailbox_changes_response = changes_response\n\n(** Mailbox/query: Args type (specialized from [query_args]). *)\ntype mailbox_query_args = query_args\n\n(** Mailbox/query: Response type (specialized from [query_response]). *)\ntype mailbox_query_response = query_response\n\n(** Mailbox/queryChanges: Args type (specialized from [query_changes_args]). *)\ntype mailbox_query_changes_args = query_changes_args\n\n(** Mailbox/queryChanges: Response type (specialized from [query_changes_response]). *)\ntype mailbox_query_changes_response = query_changes_response\n\n(** Mailbox/set: Args type (specialized from [('c, 'u) set_args]). *)\ntype mailbox_set_args = (mailbox_create, mailbox_update) set_args\n\n(** Mailbox/set: Response type (specialized from [('c, 'u) set_response]). *)\ntype mailbox_set_response = (mailbox_created_info, mailbox_updated_info) set_response"
-
},
-
{
-
"filename": "jmap_thread.mli",
-
"contents": "(** JMAP Thread.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-3> RFC 8621, Section 3 *)\n\nopen Jmap_types\nopen Jmap_methods\n\n(** Thread object.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-3> RFC 8621, Section 3 *)\ntype thread = {\n thread_id : id; (** immutable, server-set *)\n email_ids : id list; (** server-set *)\n}\n\n(** Thread/get: Args type (specialized from ['record get_args]). *)\ntype thread_get_args = thread get_args\n\n(** Thread/get: Response type (specialized from ['record get_response]). *)\ntype thread_get_response = thread get_response\n\n(** Thread/changes: Args type (specialized from [changes_args]). *)\ntype thread_changes_args = changes_args\n\n(** Thread/changes: Response type (specialized from [changes_response]). *)\ntype thread_changes_response = changes_response"
-
},
-
{
-
"filename": "jmap_email.mli",
-
"contents": "(** JMAP Email.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4> RFC 8621, Section 4 *)\n\nopen Jmap_types\nopen Jmap_email_types\nopen Jmap_methods\n\n(** Email object.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1> RFC 8621, Section 4.1 *)\ntype email = {\n (* Metadata *)\n email_id : id; (** immutable, server-set *)\n blob_id : id; (** immutable, server-set *)\n thread_id : id; (** immutable, server-set *)\n mailbox_ids : bool id_map;\n keywords : bool string_map; (* default: {} *)\n size : uint; (** immutable, server-set *)\n received_at : utc_date; (** immutable, server-set *)\n\n (* Header Fields (Convenience properties) *)\n message_id : string list option; (** immutable *)\n in_reply_to : string list option; (** immutable *)\n references : string list option; (** immutable *)\n sender : email_address list option; (** immutable *)\n from : email_address list option; (** immutable *)\n to_ : email_address list option; (** immutable *)\n cc : email_address list option; (** immutable *)\n bcc : email_address list option; (** immutable *)\n reply_to : email_address list option; (** immutable *)\n subject : string option; (** immutable *)\n sent_at : date option; (** immutable *)\n\n (* Header Fields (Low-level and custom) *)\n headers : email_header list; (** immutable *)\n header_fields : Yojson.Safe.t string_map; (** Requested header:* properties *)\n\n (* Body Parts *)\n body_structure : email_body_part; (** immutable *)\n body_values : email_body_value string_map; (** immutable *)\n text_body : email_body_part list; (** immutable *)\n html_body : email_body_part list; (** immutable *)\n attachments : email_body_part list; (** immutable *)\n has_attachment : bool; (** immutable, server-set *)\n preview : string; (** immutable, server-set *)\n}\n\n(** Email object for creation.\n Excludes server-set fields and requires specific structure for bodies/headers.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.6> RFC 8621, Section 4.6 *)\ntype email_create = {\n email_create_mailbox_ids : bool id_map;\n email_create_keywords : bool string_map option;\n email_create_received_at : utc_date option; (* Only for drafts *)\n\n (* Header fields must be set individually using header:* syntax or convenience props *)\n email_create_header_fields : Yojson.Safe.t string_map;\n\n (* Body: MUST provide exactly one of these body specifications *)\n email_create_body_structure : email_body_part option;\n email_create_body_values : email_body_value string_map option;\n email_create_text_body : email_body_part option;\n email_create_html_body : email_body_part option;\n email_create_attachments : email_body_part list option;\n\n (* If body_structure not given, bodyValues MUST correspond to partIds in\n text/html/attachments *) \n}\n\n(** Email object for update.\n Patch object, specific structure not enforced here.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.6> RFC 8621, Section 4.6 *)\ntype email_update = patch_object\n\n(** Server-set info for created email.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.6> RFC 8621, Section 4.6 *)\ntype email_created_info = {\n email_created_id : id;\n email_created_blob_id : id;\n email_created_thread_id : id;\n email_created_size : uint;\n}\n\n(** Server-set/computed info for updated email.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.6> RFC 8621, Section 4.6 *)\ntype email_updated_info = email (* Contains only changed server-set props *)\n\n(** FilterCondition for Email/query.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.4.1> RFC 8621, Section 4.4.1 *)\ntype email_filter_condition = {\n filter_in_mailbox : id option;\n filter_in_mailbox_other_than : id list option;\n filter_before : utc_date option;\n filter_after : utc_date option;\n filter_min_size : uint option;\n filter_max_size : uint option;\n filter_all_in_thread_have_keyword : string option;\n filter_some_in_thread_have_keyword : string option;\n filter_none_in_thread_have_keyword : string option;\n filter_has_keyword : string option;\n filter_not_keyword : string option;\n filter_has_attachment : bool option;\n filter_text : string option;\n filter_from : string option;\n filter_to : string option;\n filter_cc : string option;\n filter_bcc : string option;\n filter_subject : string option;\n filter_body : string option;\n filter_header : string list option; (* [ name ] or [ name, value ] *)\n}\n\n(** Override properties for Email/copy.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.7> RFC 8621, Section 4.7 *)\ntype email_copy_override = {\n email_copy_override_id : id; (* id of email to copy *)\n email_copy_override_mailbox_ids : bool id_map option;\n email_copy_override_keywords : bool string_map option;\n email_copy_override_received_at : utc_date option;\n}\n\n(** EmailImport object for Email/import.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.8> RFC 8621, Section 4.8 *)\ntype email_import = {\n email_import_blob_id : id;\n email_import_mailbox_ids : bool id_map;\n email_import_keywords : bool string_map option;\n email_import_received_at : utc_date option;\n}\n\n(** Email/get: Args type (specialized from ['record get_args]).\n Adds body fetching options.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.2> RFC 8621, Section 4.2 *)\ntype email_get_args = {\n get_account_id : id;\n get_ids : id list option;\n get_properties : string list option;\n get_body_properties : string list option;\n get_fetch_text_body_values : bool option; (* default: false *)\n get_fetch_html_body_values : bool option; (* default: false *)\n get_fetch_all_body_values : bool option; (* default: false *)\n get_max_body_value_bytes : uint option; (* default: 0 *)\n}\n\n(** Email/get: Response type (specialized from ['record get_response]). *)\ntype email_get_response = email get_response\n\n(** Email/changes: Args type (specialized from [changes_args]). *)\ntype email_changes_args = changes_args\n\n(** Email/changes: Response type (specialized from [changes_response]). *)\ntype email_changes_response = changes_response\n\n(** Email/query: Args type (specialized from [query_args]). *)\ntype email_query_args = query_args\n\n(** Email/query: Response type (specialized from [query_response]). *)\ntype email_query_response = query_response\n\n(** Email/queryChanges: Args type (specialized from [query_changes_args]). *)\ntype email_query_changes_args = query_changes_args\n\n(** Email/queryChanges: Response type (specialized from [query_changes_response]). *)\ntype email_query_changes_response = query_changes_response\n\n(** Email/set: Args type (specialized from [('c, 'u) set_args]). *)\ntype email_set_args = (email_create, email_update) set_args\n\n(** Email/set: Response type (specialized from [('c, 'u) set_response]). *)\ntype email_set_response = (email_created_info, email_updated_info) set_response\n\n(** Email/copy: Args type (specialized from ['override copy_args]). *)\ntype email_copy_args = email_copy_override copy_args\n\n(** Email/copy: Response type (specialized from ['created copy_response]). *)\ntype email_copy_response = email_created_info copy_response\n\n(** Email/import: Args type.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.8> RFC 8621, Section 4.8 *)\ntype email_import_args = {\n import_account_id : id;\n import_if_in_state : string option;\n import_emails : email_import id_map;\n}\n\n(** Email/import: Response type.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.8> RFC 8621, Section 4.8 *)\ntype email_import_response = {\n import_resp_account_id : id;\n import_resp_old_state : string option;\n import_resp_new_state : string;\n import_resp_created : email_created_info id_map option;\n import_resp_not_created : set_error id_map option;\n}\n\n(** Email/parse: Args type.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.9> RFC 8621, Section 4.9 *)\ntype email_parse_args = {\n parse_account_id : id;\n parse_blob_ids : id list;\n parse_properties : string list option;\n parse_body_properties : string list option;\n parse_fetch_text_body_values : bool option; (* default: false *)\n parse_fetch_html_body_values : bool option; (* default: false *)\n parse_fetch_all_body_values : bool option; (* default: false *)\n parse_max_body_value_bytes : uint option; (* default: 0 *)\n}\n\n(** Email/parse: Response type.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.9> RFC 8621, Section 4.9 *)\ntype email_parse_response = {\n parse_resp_account_id : id;\n parse_resp_parsed : email id_map option;\n parse_resp_not_parsable : id list option;\n parse_resp_not_found : id list option;\n}"
-
},
-
{
-
"filename": "jmap_search_snippet.mli",
-
"contents": "(** JMAP Search Snippet.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-5> RFC 8621, Section 5 *)\n\nopen Jmap_types\nopen Jmap_methods\n\n(** SearchSnippet object.\n Note: Does not have an 'id' property.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-5> RFC 8621, Section 5 *)\ntype search_snippet = {\n snippet_email_id : id;\n snippet_subject : string option;\n snippet_preview : string option;\n}\n\n(** SearchSnippet/get: Args type.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-5.1> RFC 8621, Section 5.1 *)\ntype search_snippet_get_args = {\n snippet_get_account_id : id;\n snippet_get_filter : filter option;\n snippet_get_email_ids : id list;\n}\n\n(** SearchSnippet/get: Response type.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-5.1> RFC 8621, Section 5.1 *)\ntype search_snippet_get_response = {\n snippet_get_resp_account_id : id;\n snippet_get_resp_list : search_snippet list;\n snippet_get_resp_not_found : id list option;\n}"
-
},
-
{
-
"filename": "jmap_identity.mli",
-
"contents": "(** JMAP Identity.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-6> RFC 8621, Section 6 *)\n\nopen Jmap_types\nopen Jmap_email_types\nopen Jmap_methods\n\n(** Identity object.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-6> RFC 8621, Section 6 *)\ntype identity = {\n identity_id : id; (** immutable, server-set *)\n name : string; (* default: \"\" *)\n email : string; (** immutable *)\n reply_to : email_address list option;\n bcc : email_address list option;\n text_signature : string; (* default: \"\" *)\n html_signature : string; (* default: \"\" *)\n may_delete : bool; (** server-set *)\n}\n\n(** Identity object for creation.\n Excludes server-set fields.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-6> RFC 8621, Section 6 *)\ntype identity_create = {\n identity_create_name : string option;\n identity_create_email : string;\n identity_create_reply_to : email_address list option;\n identity_create_bcc : email_address list option;\n identity_create_text_signature : string option;\n identity_create_html_signature : string option;\n}\n\n(** Identity object for update.\n Patch object, specific structure not enforced here.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-6.3> RFC 8621, Section 6.3 *)\ntype identity_update = patch_object\n\n(** Server-set info for created identity.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-6.3> RFC 8621, Section 6.3 *)\ntype identity_created_info = {\n identity_created_id : id;\n identity_created_may_delete : bool;\n}\n\n(** Server-set/computed info for updated identity.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-6.3> RFC 8621, Section 6.3 *)\ntype identity_updated_info = identity (* Contains only changed server-set props *)\n\n(** Identity/get: Args type (specialized from ['record get_args]). *)\ntype identity_get_args = identity get_args\n\n(** Identity/get: Response type (specialized from ['record get_response]). *)\ntype identity_get_response = identity get_response\n\n(** Identity/changes: Args type (specialized from [changes_args]). *)\ntype identity_changes_args = changes_args\n\n(** Identity/changes: Response type (specialized from [changes_response]). *)\ntype identity_changes_response = changes_response\n\n(** Identity/set: Args type (specialized from [('c, 'u) set_args]). *)\ntype identity_set_args = (identity_create, identity_update) set_args\n\n(** Identity/set: Response type (specialized from [('c, 'u) set_response]). *)\ntype identity_set_response = (identity_created_info, identity_updated_info) set_response"
-
},
-
{
-
"filename": "jmap_submission.mli",
-
"contents": "(** JMAP Email Submission.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)\n\nopen Jmap_types\nopen Jmap_methods\n\n(** Address object for Envelope.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)\ntype envelope_address = {\n env_addr_email : string;\n env_addr_parameters : Yojson.Safe.t string_map option;\n}\n\n(** Envelope object.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)\ntype envelope = {\n env_mail_from : envelope_address;\n env_rcpt_to : envelope_address list;\n}\n\n(** Delivery status for a recipient.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)\ntype delivery_status = {\n delivery_smtp_reply : string;\n delivery_delivered : [ `Queued | `Yes | `No | `Unknown ];\n delivery_displayed : [ `Yes | `Unknown ];\n}\n\n(** EmailSubmission object.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)\ntype email_submission = {\n email_sub_id : id; (** immutable, server-set *)\n identity_id : id; (** immutable *)\n email_id : id; (** immutable *)\n thread_id : id; (** immutable, server-set *)\n envelope : envelope option; (** immutable *)\n send_at : utc_date; (** immutable, server-set *)\n undo_status : [ `Pending | `Final | `Canceled ];\n delivery_status : delivery_status string_map option; (** server-set *)\n dsn_blob_ids : id list; (** server-set *)\n mdn_blob_ids : id list; (** server-set *)\n}\n\n(** EmailSubmission object for creation.\n Excludes server-set fields.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)\ntype email_submission_create = {\n email_sub_create_identity_id : id;\n email_sub_create_email_id : id;\n email_sub_create_envelope : envelope option;\n}\n\n(** EmailSubmission object for update.\n Only undoStatus can be updated (to 'canceled').\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)\ntype email_submission_update = patch_object\n\n(** Server-set info for created email submission.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7.5> RFC 8621, Section 7.5 *)\ntype email_submission_created_info = {\n email_sub_created_id : id;\n email_sub_created_thread_id : id;\n email_sub_created_send_at : utc_date;\n}\n\n(** Server-set/computed info for updated email submission.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7.5> RFC 8621, Section 7.5 *)\ntype email_submission_updated_info = email_submission (* Contains only changed server-set props *)\n\n(** FilterCondition for EmailSubmission/query.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7.3> RFC 8621, Section 7.3 *)\ntype email_submission_filter_condition = {\n filter_identity_ids : id list option;\n filter_email_ids : id list option;\n filter_thread_ids : id list option;\n filter_undo_status : [ `Pending | `Final | `Canceled ] option;\n filter_before : utc_date option;\n filter_after : utc_date option;\n}\n\n(** EmailSubmission/get: Args type (specialized from ['record get_args]). *)\ntype email_submission_get_args = email_submission get_args\n\n(** EmailSubmission/get: Response type (specialized from ['record get_response]). *)\ntype email_submission_get_response = email_submission get_response\n\n(** EmailSubmission/changes: Args type (specialized from [changes_args]). *)\ntype email_submission_changes_args = changes_args\n\n(** EmailSubmission/changes: Response type (specialized from [changes_response]). *)\ntype email_submission_changes_response = changes_response\n\n(** EmailSubmission/query: Args type (specialized from [query_args]). *)\ntype email_submission_query_args = query_args\n\n(** EmailSubmission/query: Response type (specialized from [query_response]). *)\ntype email_submission_query_response = query_response\n\n(** EmailSubmission/queryChanges: Args type (specialized from [query_changes_args]). *)\ntype email_submission_query_changes_args = query_changes_args\n\n(** EmailSubmission/queryChanges: Response type (specialized from [query_changes_response]). *)\ntype email_submission_query_changes_response = query_changes_response\n\n(** EmailSubmission/set: Args type (specialized from [('c, 'u) set_args]).\n Includes onSuccess arguments.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7.5> RFC 8621, Section 7.5 *)\ntype email_submission_set_args = {\n set_account_id : id;\n set_if_in_state : string option;\n set_create : email_submission_create id_map option;\n set_update : email_submission_update id_map option;\n set_destroy : id list option;\n set_on_success_update_email : Jmap_email.email_update id_map option;\n set_on_success_destroy_email : id list option;\n}\n\n(** EmailSubmission/set: Response type (specialized from [('c, 'u) set_response]). *)\ntype email_submission_set_response = (email_submission_created_info, email_submission_updated_info) set_response"
-
},
-
{
-
"filename": "jmap_vacation.mli",
-
"contents": "(** JMAP Vacation Response.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-8> RFC 8621, Section 8 *)\n\nopen Jmap_types\nopen Jmap_methods\n\n(** VacationResponse object.\n Note: id is always \"singleton\".\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-8> RFC 8621, Section 8 *)\ntype vacation_response_obj = {\n vacation_id : id; (** immutable, server-set, MUST be \"singleton\" *)\n is_enabled : bool;\n from_date : utc_date option;\n to_date : utc_date option;\n subject : string option;\n text_body : string option;\n html_body : string option;\n}\n\n(** VacationResponse object for update.\n Patch object, specific structure not enforced here.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-8.2> RFC 8621, Section 8.2 *)\ntype vacation_response_update = patch_object\n\n(** VacationResponse/get: Args type (specialized from ['record get_args]). *)\ntype vacation_response_get_args = vacation_response_obj get_args\n\n(** VacationResponse/get: Response type (specialized from ['record get_response]). *)\ntype vacation_response_get_response = vacation_response_obj get_response\n\n(** VacationResponse/set: Args type.\n Only allows update, id must be \"singleton\".\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-8.2> RFC 8621, Section 8.2 *)\ntype vacation_response_set_args = {\n set_account_id : id;\n set_if_in_state : string option;\n set_update : vacation_response_update id_map option;\n}\n\n(** VacationResponse/set: Response type.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-8.2> RFC 8621, Section 8.2 *)\ntype vacation_response_set_response = {\n set_resp_account_id : id;\n set_resp_old_state : string option;\n set_resp_new_state : string;\n set_resp_updated : vacation_response_obj option id_map option;\n set_resp_not_updated : set_error id_map option;\n}"
-
},
-
{
-
"filename": "jmap_email.mli",
-
"contents": "(** JMAP Mail Extension (RFC 8621).\n\n This module provides types and signatures for interacting with JMAP Mail\n data types: Mailbox, Thread, Email, SearchSnippet, Identity, EmailSubmission,\n and VacationResponse.\n*)\n\n(** {1 Core Types} *)\nmodule Types = Jmap_email_types\n\n(** {1 Mailbox} \n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-2> RFC 8621, Section 2 *)\nmodule Mailbox : sig\n include module type of Jmap_mailbox\nend\n\n(** {1 Thread}\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-3> RFC 8621, Section 3 *)\nmodule Thread : sig\n include module type of Jmap_thread\nend\n\n(** {1 Email}\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4> RFC 8621, Section 4 *)\nmodule Email : sig\n include module type of Jmap_email\nend\n\n(** {1 Search Snippet}\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-5> RFC 8621, Section 5 *)\nmodule SearchSnippet : sig\n include module type of Jmap_search_snippet\nend\n\n(** {1 Identity}\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-6> RFC 8621, Section 6 *)\nmodule Identity : sig\n include module type of Jmap_identity\nend\n\n(** {1 Email Submission}\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)\nmodule Submission : sig\n include module type of Jmap_submission\nend\n\n(** {1 Vacation Response}\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-8> RFC 8621, Section 8 *)\nmodule Vacation : sig\n include module type of Jmap_vacation\nend\n\n(** Capability URI for JMAP Mail.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-1.3.1> RFC 8621, Section 1.3.1 *)\nval capability_mail : string\n\n(** Capability URI for JMAP Submission.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-1.3.2> RFC 8621, Section 1.3.2 *)\nval capability_submission : string\n\n(** Capability URI for JMAP Vacation Response.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-1.3.3> RFC 8621, Section 1.3.3 *)\nval capability_vacationresponse : string\n\n(** Type name for EmailDelivery push notifications.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-1.5> RFC 8621, Section 1.5 *)\nval push_event_type_email_delivery : string\n\n(** JMAP keywords corresponding to IMAP system flags.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.1> RFC 8621, Section 4.1.1 *)\nval keyword_draft : string\nval keyword_seen : string\nval keyword_flagged : string\nval keyword_answered : string\n\n(** Common JMAP keywords from RFC 5788.\n @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4.1.1> RFC 8621, Section 4.1.1 *)\nval keyword_forwarded : string\nval keyword_phishing : string\nval keyword_junk : string\nval keyword_notjunk : string"
-
},
-
{
-
"filename": "jmap_unix.mli",
-
"contents": "(** Unix-specific JMAP client implementation interface.\n\n This module provides functions to interact with a JMAP server using\n Unix sockets for network communication.\n*)\n\nopen Jmap_types\nopen Jmap_wire\nopen Jmap_session\nopen Jmap_push\n\n(** Represents an active JMAP connection context. Opaque type. *)\ntype context\n\n(** Represents an active EventSource connection. Opaque type. *)\ntype event_source_connection\n\n(** Exception raised for JMAP communication errors. *)\nexception Jmap_error of Jmap_error.problem_details\n\n(** Connect to a JMAP server and retrieve the session.\n This handles discovery (if needed) and authentication (mechanism TBD).\n [host] is the server hostname.\n [port] is the server port (default 443 if TLS enabled, TBD if not).\n [credentials] is an opaque type representing authentication credentials.\n @param ?session_url Optional direct URL to the Session resource.\n @param ?username Optional username (e.g., email address) for discovery.\n*)\nval connect : \n ?session_url:Uri.t ->\n ?username:string ->\n host:string -> \n ?port:int -> \n credentials:'a -> \n (context * session) Lwt.t\n\n(** Perform a JMAP API request.\n @param ctx The connection context.\n @param request The JMAP request object.\n*)\nval request : context -> request -> response Lwt.t\n\n(** Upload binary data.\n @param ctx The connection context.\n @param account_id The target account ID.\n @param content_type The MIME type of the data.\n @param data_stream A stream providing the binary data chunks.\n*)\nval upload : \n context -> \n account_id:id -> \n content_type:string -> \n data_stream:string Lwt_stream.t -> \n Jmap_binary.upload_response Lwt.t\n\n(** Download binary data.\n @param ctx The connection context.\n @param account_id The account ID.\n @param blob_id The blob ID to download.\n @param content_type The desired Content-Type for the download response.\n @param name The desired filename for the download response.\n @return A stream producing the binary data chunks.\n*)\nval download : \n context -> \n account_id:id -> \n blob_id:id -> \n content_type:string -> \n name:string -> \n string Lwt_stream.t Lwt.t\n\n(** Connect to the EventSource for push notifications.\n @param ctx The connection context.\n @param ?types List of types to subscribe to (default \"*\").\n @param ?close_after Request server to close after first state event.\n @param ?ping Request ping interval in seconds (default 0).\n @return A tuple of the connection handle and a stream of push events.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-7.3> RFC 8620, Section 7.3 *)\nval connect_event_source : \n context -> \n ?types:string list -> \n ?close_after:[`State | `No] -> \n ?ping:uint ->\n (event_source_connection * \n ([`State of state_change | `Ping of event_source_ping_data ] Lwt_stream.t)) Lwt.t\n\n(** Close an EventSource connection.\n @param conn The EventSource connection handle.\n*)\nval close_event_source : event_source_connection -> unit Lwt.t\n\n(** Close the JMAP connection context. *)\nval close : context -> unit Lwt.t"
-
},
-
{
-
"filename": "jmap.mli",
-
"contents": "(** JMAP Client Library Interface (RFC 8620 & RFC 8621)\n\n This library provides OCaml types and function signatures for interacting\n with a JMAP server.\n\n Modules:\n - {!Jmap_types}: Basic data types (Id, Date, etc.).\n - {!Jmap_error}: Error types (ProblemDetails, MethodError, SetError).\n - {!Jmap_wire}: Request and Response structures.\n - {!Jmap_session}: Session object and discovery.\n - {!Jmap_methods}: Standard method patterns (/get, /set, etc.) and Core/echo.\n - {!Jmap_binary}: Binary data upload/download types.\n - {!Jmap_push}: Push notification types (StateChange, PushSubscription).\n - {!Jmap_email}: Mail extension (RFC 8621) types and methods.\n - {!Jmap_unix}: Example interface for a Unix-based implementation.\n\n @see <https://www.rfc-editor.org/rfc/rfc8620.html> RFC 8620: Core JMAP\n @see <https://www.rfc-editor.org/rfc/rfc8621.html> RFC 8621: JMAP for Mail\n*)\n\n(** {1 Core JMAP Types and Modules} *)\n\nmodule Types = Jmap_types\nmodule Error = Jmap_error\nmodule Wire = Jmap_wire\nmodule Session = Jmap_session\nmodule Methods = Jmap_methods\nmodule Binary = Jmap_binary\nmodule Push = Jmap_push\n\n(** {1 Mail Extension (RFC 8621)} *)\n\nmodule Email = Jmap_email\n\n(** {1 Unix Implementation Interface} *)\n\nmodule Unix : sig\n include module type of Jmap_unix\nend\n\n(** {1 Example Usage Sketch}\n\n{[ \n (* OCaml 5.1 required for Lwt let operators *) \n open Lwt.Syntax \n open Jmap \n open Jmap.Types \n open Jmap.Wire \n open Jmap.Methods \n open Jmap.Email \n\n let list_unread_from_sender ctx session sender_email = \n (* Find the primary mail account *) \n let primary_mail_account_id = \n Hashtbl.find session.primary_accounts capability_mail \n in \n (* Construct the filter *) \n let filter : filter = \n Filter_operator {\n operator = `AND;\n conditions = [\n Filter_condition (Yojson.Safe.to_basic (`Assoc [\n (\"from\", `String sender_email);\n ]));\n Filter_condition (Yojson.Safe.to_basic (`Assoc [\n (\"hasKeyword\", `String keyword_seen);\n (\"value\", `Bool false);\n ]));\n ]\n }\n in\n (* Prepare the Email/query invocation *) \n let query_args : email_query_args = { \n query_account_id = primary_mail_account_id;\n query_filter = Some filter;\n query_sort = Some [ { property = \"receivedAt\"; is_ascending = Some false; collation = None; keyword = None; other_fields = Hashtbl.create 0 } ];\n query_position = Some 0;\n query_anchor = None;\n query_anchor_offset = None;\n query_limit = Some 20; (* Get latest 20 *)\n query_calculate_total = Some false;\n query_collapse_threads = Some false;\n query_sort_as_tree = None;\n query_filter_as_tree = None;\n } in\n let query_invocation : invocation = {\n method_name = \"Email/query\";\n arguments = (* Yojson conversion of query_args needed here *);\n method_call_id = \"q1\";\n } in\n\n (* Prepare the Email/get invocation using a back-reference *) \n let get_args : email_get_args = {\n get_account_id = primary_mail_account_id;\n get_ids = None; (* Use back-reference instead *)\n get_properties = Some [\"id\"; \"subject\"; \"receivedAt\"; \"from\"];\n get_body_properties = None;\n get_fetch_text_body_values = None;\n get_fetch_html_body_values = None;\n get_fetch_all_body_values = None;\n get_max_body_value_bytes = None;\n } in\n let get_invocation : invocation = {\n method_name = \"Email/get\";\n arguments = (* Yojson conversion of get_args, with ids replaced by a ResultReference to q1 needed here *);\n method_call_id = \"g1\";\n } in\n\n (* Prepare the JMAP request *) \n let request : request = { \n using = [ Jmap.Session.capability_core; Email.capability_mail ];\n method_calls = [ query_invocation; get_invocation ];\n created_ids = None;\n } in\n\n (* Send the request *) \n let* response = Jmap.Unix.request ctx request in\n\n (* Process the response (extract Email/get results) *) \n (* ... Omitted: find the Email/get response in response.method_responses ... *) \n Lwt.return_unit \n\n let main () = \n (* Authentication details are placeholder *) \n let credentials = \"my_auth_token\" in \n let* (ctx, session) = Jmap.Unix.connect ~host:\"jmap.example.com\" ~credentials in \n let* () = list_unread_from_sender ctx session \"boss@example.com\" in \n Jmap.Unix.close ctx \n\n (* Lwt_main.run (main ()) *) \n]} *)\n\n(** Capability URI for JMAP Core.\n @see <https://www.rfc-editor.org/rfc/rfc8620.html#section-2> RFC 8620, Section 2 *)\nval capability_core : string"
-
}
-
]
-4
output/jmap_email.mli
···
@see <https://www.rfc-editor.org/rfc/rfc8621.html#section-3> RFC 8621, Section 3 *)
module Thread = Jmap_thread
-
(** {1 Email}
-
@see <https://www.rfc-editor.org/rfc/rfc8621.html#section-4> RFC 8621, Section 4 *)
-
module Email = Jmap_email
-
(** {1 Search Snippet}
@see <https://www.rfc-editor.org/rfc/rfc8621.html#section-5> RFC 8621, Section 5 *)
module SearchSnippet = Jmap_search_snippet