My agentic slop goes here. Not intended for anyone else!
1(** JMAP Mailbox Type *)
2
3open Jmap_core
4
5(** Mailbox access rights (RFC 8621 Section 2.1) *)
6module Rights : sig
7 type t = {
8 may_read_items : bool;
9 may_add_items : bool;
10 may_remove_items : bool;
11 may_set_seen : bool;
12 may_set_keywords : bool;
13 may_create_child : bool;
14 may_rename : bool;
15 may_delete : bool;
16 may_submit : bool;
17 }
18
19 (** Accessors *)
20 val may_read_items : t -> bool
21 val may_add_items : t -> bool
22 val may_remove_items : t -> bool
23 val may_set_seen : t -> bool
24 val may_set_keywords : t -> bool
25 val may_create_child : t -> bool
26 val may_rename : t -> bool
27 val may_delete : t -> bool
28 val may_submit : t -> bool
29
30 (** Constructor *)
31 val v :
32 may_read_items:bool ->
33 may_add_items:bool ->
34 may_remove_items:bool ->
35 may_set_seen:bool ->
36 may_set_keywords:bool ->
37 may_create_child:bool ->
38 may_rename:bool ->
39 may_delete:bool ->
40 may_submit:bool ->
41 t
42
43 val of_json : Ezjsonm.value -> t
44 val to_json : t -> Ezjsonm.value
45end
46
47(** Mailbox object type *)
48type t = {
49 id : Id.t;
50 name : string;
51 parent_id : Id.t option;
52 role : string option;
53 sort_order : Primitives.UnsignedInt.t;
54 total_emails : Primitives.UnsignedInt.t;
55 unread_emails : Primitives.UnsignedInt.t;
56 total_threads : Primitives.UnsignedInt.t;
57 unread_threads : Primitives.UnsignedInt.t;
58 my_rights : Rights.t;
59 is_subscribed : bool;
60}
61
62(** Accessors *)
63val id : t -> Id.t
64val name : t -> string
65val parent_id : t -> Id.t option
66val role : t -> string option
67val sort_order : t -> Primitives.UnsignedInt.t
68val total_emails : t -> Primitives.UnsignedInt.t
69val unread_emails : t -> Primitives.UnsignedInt.t
70val total_threads : t -> Primitives.UnsignedInt.t
71val unread_threads : t -> Primitives.UnsignedInt.t
72val my_rights : t -> Rights.t
73val is_subscribed : t -> bool
74
75(** Constructor *)
76val v :
77 id:Id.t ->
78 name:string ->
79 ?parent_id:Id.t ->
80 ?role:string ->
81 sort_order:Primitives.UnsignedInt.t ->
82 total_emails:Primitives.UnsignedInt.t ->
83 unread_emails:Primitives.UnsignedInt.t ->
84 total_threads:Primitives.UnsignedInt.t ->
85 unread_threads:Primitives.UnsignedInt.t ->
86 my_rights:Rights.t ->
87 is_subscribed:bool ->
88 unit ->
89 t
90
91(** Standard /get method *)
92module Get : sig
93 type request = t Standard_methods.Get.request
94 type response = t Standard_methods.Get.response
95
96 val request_v : account_id:Id.t -> ?ids:Id.t list -> ?properties:string list -> unit -> request
97 val request_to_json : request -> Ezjsonm.value
98 val request_of_json : Ezjsonm.value -> request
99 val response_of_json : Ezjsonm.value -> response
100end
101
102(** Standard /changes method *)
103module Changes : sig
104 type request = Standard_methods.Changes.request
105 type response = Standard_methods.Changes.response
106
107 val request_of_json : Ezjsonm.value -> request
108 val response_of_json : Ezjsonm.value -> response
109end
110
111(** Mailbox-specific filter for /query *)
112module Filter : sig
113 type t = {
114 parent_id : Id.t option;
115 name : string option;
116 role : string option;
117 has_any_role : bool option;
118 is_subscribed : bool option;
119 }
120
121 (** Accessors *)
122 val parent_id : t -> Id.t option
123 val name : t -> string option
124 val role : t -> string option
125 val has_any_role : t -> bool option
126 val is_subscribed : t -> bool option
127
128 (** Constructor *)
129 val v :
130 ?parent_id:Id.t ->
131 ?name:string ->
132 ?role:string ->
133 ?has_any_role:bool ->
134 ?is_subscribed:bool ->
135 unit ->
136 t
137
138 val to_json : t -> Ezjsonm.value
139 val of_json : Ezjsonm.value -> t
140end
141
142(** Standard /query method with Mailbox-specific extensions *)
143module Query : sig
144 type request = {
145 account_id : Id.t;
146 filter : Filter.t Jmap_core.Filter.t option;
147 sort : Comparator.t list option;
148 position : Primitives.Int53.t option;
149 anchor : Id.t option;
150 anchor_offset : Primitives.Int53.t option;
151 limit : Primitives.UnsignedInt.t option;
152 calculate_total : bool option;
153 sort_as_tree : bool option;
154 filter_as_tree : bool option;
155 }
156
157 type response = Standard_methods.Query.response
158
159 (** Accessors for request *)
160 val account_id : request -> Id.t
161 val filter : request -> Filter.t Jmap_core.Filter.t option
162 val sort : request -> Comparator.t list option
163 val position : request -> Primitives.Int53.t option
164 val anchor : request -> Id.t option
165 val anchor_offset : request -> Primitives.Int53.t option
166 val limit : request -> Primitives.UnsignedInt.t option
167 val calculate_total : request -> bool option
168 val sort_as_tree : request -> bool option
169 val filter_as_tree : request -> bool option
170
171 (** Constructor for request *)
172 val request_v :
173 account_id:Id.t ->
174 ?filter:Filter.t Jmap_core.Filter.t ->
175 ?sort:Comparator.t list ->
176 ?position:Primitives.Int53.t ->
177 ?anchor:Id.t ->
178 ?anchor_offset:Primitives.Int53.t ->
179 ?limit:Primitives.UnsignedInt.t ->
180 ?calculate_total:bool ->
181 ?sort_as_tree:bool ->
182 ?filter_as_tree:bool ->
183 unit ->
184 request
185
186 val request_to_json : request -> Ezjsonm.value
187 val request_of_json : Ezjsonm.value -> request
188 val response_of_json : Ezjsonm.value -> response
189end
190
191(** Standard /queryChanges method *)
192module QueryChanges : sig
193 type request = Filter.t Standard_methods.QueryChanges.request
194 type response = Standard_methods.QueryChanges.response
195
196 val request_of_json : Ezjsonm.value -> request
197 val response_of_json : Ezjsonm.value -> response
198end
199
200(** Standard /set method *)
201module Set : sig
202 type request = t Standard_methods.Set.request
203 type response = t Standard_methods.Set.response
204
205 val request_of_json : Ezjsonm.value -> request
206 val response_of_json : Ezjsonm.value -> response
207end
208
209(** Parser submodule *)
210module Parser : sig
211 val of_json : Ezjsonm.value -> t
212 val to_json : t -> Ezjsonm.value
213end
214
215(** Standard mailbox role values (RFC 8621 Section 2.1) *)
216module Role : sig
217 val inbox : string
218 val archive : string
219 val drafts : string
220 val sent : string
221 val trash : string
222 val junk : string
223 val important : string
224 val all : string
225end