this repo has no description
1(** JMAP Email Submission.
2 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)
3
4open Jmap.Types
5open Jmap.Methods
6
7(** Address object for Envelope.
8 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)
9type envelope_address = {
10 env_addr_email : string;
11 env_addr_parameters : Yojson.Safe.t string_map option;
12}
13
14(** Envelope object.
15 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)
16type envelope = {
17 env_mail_from : envelope_address;
18 env_rcpt_to : envelope_address list;
19}
20
21(** Delivery status for a recipient.
22 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)
23type delivery_status = {
24 delivery_smtp_reply : string;
25 delivery_delivered : [ `Queued | `Yes | `No | `Unknown ];
26 delivery_displayed : [ `Yes | `Unknown ];
27}
28
29(** EmailSubmission object.
30 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)
31type email_submission = {
32 email_sub_id : id; (** immutable, server-set *)
33 identity_id : id; (** immutable *)
34 email_id : id; (** immutable *)
35 thread_id : id; (** immutable, server-set *)
36 envelope : envelope option; (** immutable *)
37 send_at : utc_date; (** immutable, server-set *)
38 undo_status : [ `Pending | `Final | `Canceled ];
39 delivery_status : delivery_status string_map option; (** server-set *)
40 dsn_blob_ids : id list; (** server-set *)
41 mdn_blob_ids : id list; (** server-set *)
42}
43
44(** EmailSubmission object for creation.
45 Excludes server-set fields.
46 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)
47type email_submission_create = {
48 email_sub_create_identity_id : id;
49 email_sub_create_email_id : id;
50 email_sub_create_envelope : envelope option;
51}
52
53(** EmailSubmission object for update.
54 Only undoStatus can be updated (to 'canceled').
55 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7> RFC 8621, Section 7 *)
56type email_submission_update = patch_object
57
58(** Server-set info for created email submission.
59 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7.5> RFC 8621, Section 7.5 *)
60type email_submission_created_info = {
61 email_sub_created_id : id;
62 email_sub_created_thread_id : id;
63 email_sub_created_send_at : utc_date;
64}
65
66(** Server-set/computed info for updated email submission.
67 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7.5> RFC 8621, Section 7.5 *)
68type email_submission_updated_info = email_submission (* Contains only changed server-set props *)
69
70(** FilterCondition for EmailSubmission/query.
71 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7.3> RFC 8621, Section 7.3 *)
72type email_submission_filter_condition = {
73 filter_identity_ids : id list option;
74 filter_email_ids : id list option;
75 filter_thread_ids : id list option;
76 filter_undo_status : [ `Pending | `Final | `Canceled ] option;
77 filter_before : utc_date option;
78 filter_after : utc_date option;
79}
80
81(** EmailSubmission/get: Args type (specialized from ['record Get_args.t]). *)
82module Email_submission_get_args : sig
83 type t = email_submission Get_args.t
84end
85
86(** EmailSubmission/get: Response type (specialized from ['record Get_response.t]). *)
87module Email_submission_get_response : sig
88 type t = email_submission Get_response.t
89end
90
91(** EmailSubmission/changes: Args type (specialized from [Changes_args.t]). *)
92module Email_submission_changes_args : sig
93 type t = Changes_args.t
94end
95
96(** EmailSubmission/changes: Response type (specialized from [Changes_response.t]). *)
97module Email_submission_changes_response : sig
98 type t = Changes_response.t
99end
100
101(** EmailSubmission/query: Args type (specialized from [Query_args.t]). *)
102module Email_submission_query_args : sig
103 type t = Query_args.t
104end
105
106(** EmailSubmission/query: Response type (specialized from [Query_response.t]). *)
107module Email_submission_query_response : sig
108 type t = Query_response.t
109end
110
111(** EmailSubmission/queryChanges: Args type (specialized from [Query_changes_args.t]). *)
112module Email_submission_query_changes_args : sig
113 type t = Query_changes_args.t
114end
115
116(** EmailSubmission/queryChanges: Response type (specialized from [Query_changes_response.t]). *)
117module Email_submission_query_changes_response : sig
118 type t = Query_changes_response.t
119end
120
121(** EmailSubmission/set: Args type (specialized from [('c, 'u) set_args]).
122 Includes onSuccess arguments.
123 @see <https://www.rfc-editor.org/rfc/rfc8621.html#section-7.5> RFC 8621, Section 7.5 *)
124type email_submission_set_args = {
125 set_account_id : id;
126 set_if_in_state : string option;
127 set_create : email_submission_create id_map option;
128 set_update : email_submission_update id_map option;
129 set_destroy : id list option;
130 set_on_success_destroy_email : id list option;
131}
132
133(** EmailSubmission/set: Response type (specialized from [('c, 'u) Set_response.t]). *)
134module Email_submission_set_response : sig
135 type t = (email_submission_created_info, email_submission_updated_info) Set_response.t
136end