objective categorical abstract machine language personal data server

Fix hermes blob type

futur.blue 4fc0f7e9 5fc980ac

verified
+30 -6
+4 -1
hermes/lib/hermes.ml
··· 1 - type blob = Types.blob = {ref_: Cid.t; mime_type: string; size: int64} 2 3 exception Xrpc_error = Types.Xrpc_error 4 ··· 23 let make_credential_manager = Credential_manager.make 24 25 let login = Credential_manager.login 26 27 let resume = Credential_manager.resume 28
··· 1 + type blob = Types.blob = 2 + {type_: string; ref: Cid.t; mime_type: string; size: int64} 3 4 exception Xrpc_error = Types.Xrpc_error 5 ··· 24 let make_credential_manager = Credential_manager.make 25 26 let login = Credential_manager.login 27 + 28 + let login_client = Credential_manager.login_client 29 30 let resume = Credential_manager.resume 31
+19 -1
hermes/lib/hermes.mli
··· 1 - type blob = {ref_: Cid.t; mime_type: string; size: int64} 2 3 exception Xrpc_error of {status: int; error: string; message: string option} 4 ··· 24 25 val login : 26 credential_manager 27 -> identifier:string 28 -> password:string 29 -> ?auth_factor_token:string ··· 186 187 val login : 188 t 189 -> identifier:string 190 -> password:string 191 -> ?auth_factor_token:string
··· 1 + type blob = {type_: string; ref: Cid.t; mime_type: string; size: int64} 2 3 exception Xrpc_error of {status: int; error: string; message: string option} 4 ··· 24 25 val login : 26 credential_manager 27 + -> identifier:string 28 + -> password:string 29 + -> ?auth_factor_token:string 30 + -> unit 31 + -> client Lwt.t 32 + 33 + val login_client : 34 + credential_manager 35 + -> client 36 -> identifier:string 37 -> password:string 38 -> ?auth_factor_token:string ··· 195 196 val login : 197 t 198 + -> identifier:string 199 + -> password:string 200 + -> ?auth_factor_token:string 201 + -> unit 202 + -> Client.t Lwt.t 203 + 204 + val login_client : 205 + t 206 + -> Client.t 207 -> identifier:string 208 -> password:string 209 -> ?auth_factor_token:string
+5 -2
hermes/lib/types.ml
··· 1 (* core types for xrpc client *) 2 3 type blob = 4 - {ref_: Cid.t [@key "$link"]; mime_type: string [@key "mimeType"]; size: int64} 5 - [@@deriving yojson] 6 7 type xrpc_error_payload = {error: string; message: string option [@default None]} 8 [@@deriving yojson {strict= false}]
··· 1 (* core types for xrpc client *) 2 3 type blob = 4 + { type_: string [@key "$type"] 5 + ; ref: Cid.t 6 + ; mime_type: string [@key "mimeType"] 7 + ; size: int64 } 8 + [@@deriving yojson {strict= false}] 9 10 type xrpc_error_payload = {error: string; message: string option [@default None]} 11 [@@deriving yojson {strict= false}]
+2 -2
hermes/test/test_types.ml
··· 13 match cid with 14 | Ok cid -> ( 15 let blob : Hermes.blob = 16 - {ref_= cid; mime_type= "image/png"; size= 12345L} 17 in 18 let json = Hermes.blob_to_yojson blob in 19 let json_str = Yojson.Safe.to_string json in ··· 38 match cid with 39 | Ok cid -> ( 40 let original : Hermes.blob = 41 - {ref_= cid; mime_type= "image/jpeg"; size= 54321L} 42 in 43 let json = Hermes.blob_to_yojson original in 44 match Hermes.blob_of_yojson json with
··· 13 match cid with 14 | Ok cid -> ( 15 let blob : Hermes.blob = 16 + {type_= "blob"; ref= cid; mime_type= "image/png"; size= 12345L} 17 in 18 let json = Hermes.blob_to_yojson blob in 19 let json_str = Yojson.Safe.to_string json in ··· 38 match cid with 39 | Ok cid -> ( 40 let original : Hermes.blob = 41 + {type_= "blob"; ref= cid; mime_type= "image/jpeg"; size= 54321L} 42 in 43 let json = Hermes.blob_to_yojson original in 44 match Hermes.blob_of_yojson json with