this repo has no description

agent

Changed files
+22 -46
lib
+5 -4
AGENT.md
···
7. DONE Examine the implementation of fastmail-list as well as the JMAP specs,
and add better typed handling of string responses such as "urn:ietf:params:jmap:mail".
Add these to either `Jmap_mail` or Jmap modules as appropriate.
-
8. Move some of the debug print messages into a debug logging mode, and ensure
+
8. DONE Move some of the debug print messages into a debug logging mode, and ensure
that sensitive API tokens are never printed but redacted instead.
Modify the fastmail-list binary to optionally list only unread messages, and
also list the JMAP labels associated with each message.
-
9. Read the JMAP crash course at https://jmap.io/crash-course.html and especially
-
the bit about result references. Modify the OCaml interfaces appropriately from
-
what you learn here.
+
9. Read the mailbox attribute spec in specs/ and add a typed interface to the
+
JMAP labels defined in there.
+
10. Add an OCaml interface to compose result references together explicitly into a
+
single request, from reading the specs.
+8 -8
lib/dune
···
(library
-
(name jmap)
-
(public_name jmap)
-
(modules jmap)
-
(libraries str ezjsonm ptime cohttp cohttp-lwt-unix uri lwt logs logs.fmt))
+
(name jmap)
+
(public_name jmap)
+
(modules jmap)
+
(libraries str ezjsonm ptime cohttp cohttp-lwt-unix uri lwt logs logs.fmt))
(library
-
(name jmap_mail)
-
(public_name jmap.mail)
-
(modules jmap_mail)
-
(libraries jmap))
+
(name jmap_mail)
+
(public_name jmap.mail)
+
(modules jmap_mail)
+
(libraries jmap))
+7 -23
lib/jmap.ml
···
(** Module for managing JMAP capability URIs and other constants *)
module Capability = struct
-
(** Core JMAP capability URI *)
-
type core = Core
-
(** JMAP capability URI as specified in RFC8620 *)
let core_uri = "urn:ietf:params:jmap:core"
-
(** Convert core capability to URI string *)
-
let string_of_core = function
-
| Core -> core_uri
-
-
(** Parse a string to a core capability, returns None if not a valid capability URI *)
-
let core_of_string = function
-
| s when s = core_uri -> Some Core
-
| _ -> None
-
(** All JMAP capability types *)
type t =
-
| Core of core
-
| Extension of string
+
| Core (** Core JMAP capability *)
+
| Extension of string (** Extension capabilities *)
(** Convert capability to URI string *)
let to_string = function
-
| Core c -> string_of_core c
+
| Core -> core_uri
| Extension s -> s
(** Parse a string to a capability, returns Extension for non-core capabilities *)
let of_string s =
-
match core_of_string s with
-
| Some c -> Core c
-
| None -> Extension s
+
if s = core_uri then Core
+
else Extension s
(** Check if a capability matches a core capability *)
let is_core = function
-
| Core _ -> true
+
| Core -> true
| Extension _ -> false
(** Check if a capability string is a core capability *)
-
let is_core_string s =
-
match of_string s with
-
| Core _ -> true
-
| Extension _ -> false
+
let is_core_string s = s = core_uri
(** Create a list of capability strings *)
let strings_of_capabilities capabilities =
+2 -11
lib/jmap.mli
···
(** Module for managing JMAP capability URIs and other constants *)
module Capability : sig
-
(** Core JMAP capability URI *)
-
type core = Core
-
(** JMAP capability URI as specified in RFC8620 *)
val core_uri : string
-
(** Convert core capability to URI string *)
-
val string_of_core : core -> string
-
-
(** Parse a string to a core capability, returns None if not a valid capability URI *)
-
val core_of_string : string -> core option
-
(** All JMAP capability types *)
type t =
-
| Core of core
-
| Extension of string
+
| Core (** Core JMAP capability *)
+
| Extension of string (** Extension capabilities *)
(** Convert capability to URI string *)
val to_string : t -> string