This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

agent

+22 -46
+5 -4
AGENT.md
··· 38 38 7. DONE Examine the implementation of fastmail-list as well as the JMAP specs, 39 39 and add better typed handling of string responses such as "urn:ietf:params:jmap:mail". 40 40 Add these to either `Jmap_mail` or Jmap modules as appropriate. 41 - 8. Move some of the debug print messages into a debug logging mode, and ensure 41 + 8. DONE Move some of the debug print messages into a debug logging mode, and ensure 42 42 that sensitive API tokens are never printed but redacted instead. 43 43 Modify the fastmail-list binary to optionally list only unread messages, and 44 44 also list the JMAP labels associated with each message. 45 - 9. Read the JMAP crash course at https://jmap.io/crash-course.html and especially 46 - the bit about result references. Modify the OCaml interfaces appropriately from 47 - what you learn here. 45 + 9. Read the mailbox attribute spec in specs/ and add a typed interface to the 46 + JMAP labels defined in there. 47 + 10. Add an OCaml interface to compose result references together explicitly into a 48 + single request, from reading the specs.
+8 -8
lib/dune
··· 1 1 (library 2 - (name jmap) 3 - (public_name jmap) 4 - (modules jmap) 5 - (libraries str ezjsonm ptime cohttp cohttp-lwt-unix uri lwt logs logs.fmt)) 2 + (name jmap) 3 + (public_name jmap) 4 + (modules jmap) 5 + (libraries str ezjsonm ptime cohttp cohttp-lwt-unix uri lwt logs logs.fmt)) 6 6 7 7 (library 8 - (name jmap_mail) 9 - (public_name jmap.mail) 10 - (modules jmap_mail) 11 - (libraries jmap)) 8 + (name jmap_mail) 9 + (public_name jmap.mail) 10 + (modules jmap_mail) 11 + (libraries jmap))
+7 -23
lib/jmap.ml
··· 47 47 48 48 (** Module for managing JMAP capability URIs and other constants *) 49 49 module Capability = struct 50 - (** Core JMAP capability URI *) 51 - type core = Core 52 - 53 50 (** JMAP capability URI as specified in RFC8620 *) 54 51 let core_uri = "urn:ietf:params:jmap:core" 55 52 56 - (** Convert core capability to URI string *) 57 - let string_of_core = function 58 - | Core -> core_uri 59 - 60 - (** Parse a string to a core capability, returns None if not a valid capability URI *) 61 - let core_of_string = function 62 - | s when s = core_uri -> Some Core 63 - | _ -> None 64 - 65 53 (** All JMAP capability types *) 66 54 type t = 67 - | Core of core 68 - | Extension of string 55 + | Core (** Core JMAP capability *) 56 + | Extension of string (** Extension capabilities *) 69 57 70 58 (** Convert capability to URI string *) 71 59 let to_string = function 72 - | Core c -> string_of_core c 60 + | Core -> core_uri 73 61 | Extension s -> s 74 62 75 63 (** Parse a string to a capability, returns Extension for non-core capabilities *) 76 64 let of_string s = 77 - match core_of_string s with 78 - | Some c -> Core c 79 - | None -> Extension s 65 + if s = core_uri then Core 66 + else Extension s 80 67 81 68 (** Check if a capability matches a core capability *) 82 69 let is_core = function 83 - | Core _ -> true 70 + | Core -> true 84 71 | Extension _ -> false 85 72 86 73 (** Check if a capability string is a core capability *) 87 - let is_core_string s = 88 - match of_string s with 89 - | Core _ -> true 90 - | Extension _ -> false 74 + let is_core_string s = s = core_uri 91 75 92 76 (** Create a list of capability strings *) 93 77 let strings_of_capabilities capabilities =
+2 -11
lib/jmap.mli
··· 11 11 12 12 (** Module for managing JMAP capability URIs and other constants *) 13 13 module Capability : sig 14 - (** Core JMAP capability URI *) 15 - type core = Core 16 - 17 14 (** JMAP capability URI as specified in RFC8620 *) 18 15 val core_uri : string 19 16 20 - (** Convert core capability to URI string *) 21 - val string_of_core : core -> string 22 - 23 - (** Parse a string to a core capability, returns None if not a valid capability URI *) 24 - val core_of_string : string -> core option 25 - 26 17 (** All JMAP capability types *) 27 18 type t = 28 - | Core of core 29 - | Extension of string 19 + | Core (** Core JMAP capability *) 20 + | Extension of string (** Extension capabilities *) 30 21 31 22 (** Convert capability to URI string *) 32 23 val to_string : t -> string