objective categorical abstract machine language personal data server
65
fork

Configure Feed

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

Formatting

futurGH 0d72fb31 32addf60

+4579 -4935
+1 -1
.ocamlformat-ignore
··· 1 - pegasus/lib/lexicons/* 1 + pegasus/lexicons/*
+2 -2
bin/main.ml
··· 2 2 open Dream 3 3 4 4 let () = 5 - Rate_limiter.Shared.register ~name:"repo-write-hour" ~duration_ms:Util.Time.hour 6 - ~points:5000 ; 5 + Rate_limiter.Shared.register ~name:"repo-write-hour" 6 + ~duration_ms:Util.Time.hour ~points:5000 ; 7 7 Rate_limiter.Shared.register ~name:"repo-write-day" ~duration_ms:Util.Time.day 8 8 ~points:35000 9 9
+1 -3
hermes-cli/lib/lexicon_types.ml
··· 88 88 ; record: object_spec 89 89 ; description: string option } 90 90 91 - and lex_permission = 92 - { resource: string 93 - ; extra: (string * Yojson.Safe.t) list } 91 + and lex_permission = {resource: string; extra: (string * Yojson.Safe.t) list} 94 92 95 93 and permission_set_spec = 96 94 { title: string option
+3 -4
ipld/lib/dag_cbor.ml
··· 12 12 13 13 (* returns bindings sorted in dag-cbor canonical order *) 14 14 let ordered_map_bindings (m : 'a String_map.t) : (string * 'a) list = 15 - String_map.bindings m |> List.sort (fun (a, _) (b, _) -> dag_cbor_key_compare a b) 15 + String_map.bindings m 16 + |> List.sort (fun (a, _) (b, _) -> dag_cbor_key_compare a b) 16 17 17 18 let type_info_length len = 18 19 if len < 24 then 1 ··· 201 202 let len = String_map.cardinal m in 202 203 write_type_and_argument t 5 (Int64.of_int len) ; 203 204 ordered_map_bindings m 204 - |> List.iter (fun (k, v) -> 205 - write_string t k ; 206 - write_value t v ) 205 + |> List.iter (fun (k, v) -> write_string t k ; write_value t v) 207 206 | `Link cid -> 208 207 write_cid t cid 209 208
+88 -63
mist/bench/bench_mst.ml
··· 3 3 module Mem_mst = Mst.Make (Storage.Memory_blockstore) 4 4 module String_map = Dag_cbor.String_map 5 5 6 - type timing_result = {name: string; iterations: int; total_s: float; per_iter_s: float} 6 + type timing_result = 7 + {name: string; iterations: int; total_s: float; per_iter_s: float} 7 8 8 9 let time_it name f : timing_result Lwt.t = 9 10 let start = Unix.gettimeofday () in ··· 14 15 let time_it_n name n f : timing_result Lwt.t = 15 16 let start = Unix.gettimeofday () in 16 17 let%lwt () = 17 - let rec loop i = if i >= n then Lwt.return_unit else f () >>= fun _ -> loop (i + 1) in 18 + let rec loop i = 19 + if i >= n then Lwt.return_unit else f () >>= fun _ -> loop (i + 1) 20 + in 18 21 loop 0 19 22 in 20 23 let elapsed = Unix.gettimeofday () -. start in 21 - Lwt.return {name; iterations= n; total_s= elapsed; per_iter_s= elapsed /. float_of_int n} 24 + Lwt.return 25 + { name 26 + ; iterations= n 27 + ; total_s= elapsed 28 + ; per_iter_s= elapsed /. float_of_int n } 22 29 23 30 let print_result r = 24 31 if r.iterations = 1 then Printf.printf " %-50s %10.4f s\n%!" r.name r.total_s 25 32 else 26 - Printf.printf " %-50s %10.4f s total, %10.6f s/iter (%d iters)\n%!" r.name r.total_s 27 - r.per_iter_s r.iterations 33 + Printf.printf " %-50s %10.4f s total, %10.6f s/iter (%d iters)\n%!" r.name 34 + r.total_s r.per_iter_s r.iterations 28 35 29 36 let print_header name = Printf.printf "\n=== %s ===\n%!" name 30 37 ··· 84 91 let store = Storage.Memory_blockstore.create () in 85 92 let%lwt data = generate_bulk_data store size in 86 93 let%lwt r = 87 - time_it (Printf.sprintf "of_assoc %d records" size) (fun () -> Mem_mst.of_assoc store data) 94 + time_it (Printf.sprintf "of_assoc %d records" size) (fun () -> 95 + Mem_mst.of_assoc store data ) 88 96 in 89 97 print_result r ; Lwt.return_unit ) 90 98 sizes ··· 98 106 let shuffled = shuffle data in 99 107 (* incremental add *) 100 108 let%lwt mst_base = 101 - match%lwt Mem_mst.create_empty store with Ok mst -> Lwt.return mst | Error e -> raise e 109 + match%lwt Mem_mst.create_empty store with 110 + | Ok mst -> 111 + Lwt.return mst 112 + | Error e -> 113 + raise e 102 114 in 103 115 let%lwt r1 = 104 - time_it 105 - (Printf.sprintf "add (incremental) %d records" size) 106 - (fun () -> Lwt_list.fold_left_s (fun t (k, v) -> Mem_mst.add t k v) mst_base shuffled) 116 + time_it (Printf.sprintf "add (incremental) %d records" size) (fun () -> 117 + Lwt_list.fold_left_s 118 + (fun t (k, v) -> Mem_mst.add t k v) 119 + mst_base shuffled ) 107 120 in 108 121 print_result r1 ; 109 122 (* add_rebuild for comparison *) 110 123 let%lwt mst_base2 = 111 - match%lwt Mem_mst.create_empty store with Ok mst -> Lwt.return mst | Error e -> raise e 124 + match%lwt Mem_mst.create_empty store with 125 + | Ok mst -> 126 + Lwt.return mst 127 + | Error e -> 128 + raise e 112 129 in 113 130 let%lwt r2 = 114 - time_it 115 - (Printf.sprintf "add_rebuild %d records" size) 116 - (fun () -> 117 - Lwt_list.fold_left_s (fun t (k, v) -> Mem_mst.add_rebuild t k v) mst_base2 shuffled ) 131 + time_it (Printf.sprintf "add_rebuild %d records" size) (fun () -> 132 + Lwt_list.fold_left_s 133 + (fun t (k, v) -> Mem_mst.add_rebuild t k v) 134 + mst_base2 shuffled ) 118 135 in 119 136 print_result r2 ; 120 137 let speedup = r2.total_s /. r1.total_s in ··· 130 147 let store = Storage.Memory_blockstore.create () in 131 148 let%lwt data = generate_bulk_data store tree_size in 132 149 let%lwt mst = Mem_mst.of_assoc store data in 133 - let to_delete = shuffle data |> List.filteri (fun i _ -> i < delete_count) in 150 + let to_delete = 151 + shuffle data |> List.filteri (fun i _ -> i < delete_count) 152 + in 134 153 (* incremental delete *) 135 154 let%lwt r1 = 136 155 time_it 137 156 (Printf.sprintf "delete (incr) %d from %d" delete_count tree_size) 138 - (fun () -> Lwt_list.fold_left_s (fun t (k, _) -> Mem_mst.delete t k) mst to_delete) 157 + (fun () -> 158 + Lwt_list.fold_left_s 159 + (fun t (k, _) -> Mem_mst.delete t k) 160 + mst to_delete ) 139 161 in 140 162 print_result r1 ; 141 163 (* rebuild the tree for delete_rebuild test *) ··· 144 166 time_it 145 167 (Printf.sprintf "delete_rebuild %d from %d" delete_count tree_size) 146 168 (fun () -> 147 - Lwt_list.fold_left_s (fun t (k, _) -> Mem_mst.delete_rebuild t k) mst2 to_delete ) 169 + Lwt_list.fold_left_s 170 + (fun t (k, _) -> Mem_mst.delete_rebuild t k) 171 + mst2 to_delete ) 148 172 in 149 173 print_result r2 ; 150 174 let speedup = r2.total_s /. r1.total_s in ··· 163 187 let%lwt mst = Mem_mst.of_assoc store data in 164 188 let%lwt extra_data = generate_bulk_data store iterations in 165 189 let%lwt r = 166 - time_it_n 167 - (Printf.sprintf "single add to %d-record tree" size) 168 - iterations 169 - (fun () -> 190 + time_it_n (Printf.sprintf "single add to %d-record tree" size) 191 + iterations (fun () -> 170 192 let k, v = List.nth extra_data (Random.int iterations) in 171 193 Mem_mst.add mst k v >|= fun _ -> () ) 172 194 in ··· 184 206 let shuffled = shuffle data in 185 207 let idx = ref 0 in 186 208 let%lwt r = 187 - time_it_n 188 - (Printf.sprintf "single delete from %d-record tree" size) 189 - (min iterations size) 190 - (fun () -> 209 + time_it_n (Printf.sprintf "single delete from %d-record tree" size) 210 + (min iterations size) (fun () -> 191 211 let k, _ = List.nth shuffled !idx in 192 212 idx := !idx + 1 ; 193 213 Mem_mst.delete mst k >|= fun _ -> () ) ··· 203 223 let%lwt data = generate_bulk_data store size in 204 224 let%lwt mst = Mem_mst.of_assoc store data in 205 225 let%lwt r1 = 206 - time_it (Printf.sprintf "build_map %d records" size) (fun () -> Mem_mst.build_map mst) 226 + time_it (Printf.sprintf "build_map %d records" size) (fun () -> 227 + Mem_mst.build_map mst ) 207 228 in 208 229 print_result r1 ; 209 230 let%lwt r2 = 210 - time_it 211 - (Printf.sprintf "leaves_of_root %d records" size) 212 - (fun () -> Mem_mst.leaves_of_root mst) 231 + time_it (Printf.sprintf "leaves_of_root %d records" size) (fun () -> 232 + Mem_mst.leaves_of_root mst ) 213 233 in 214 234 print_result r2 ; 215 235 let%lwt r3 = 216 - time_it (Printf.sprintf "leaf_count %d records" size) (fun () -> Mem_mst.leaf_count mst) 236 + time_it (Printf.sprintf "leaf_count %d records" size) (fun () -> 237 + Mem_mst.leaf_count mst ) 217 238 in 218 239 print_result r3 ; 219 240 let%lwt r4 = 220 - time_it (Printf.sprintf "all_nodes %d records" size) (fun () -> Mem_mst.all_nodes mst) 241 + time_it (Printf.sprintf "all_nodes %d records" size) (fun () -> 242 + Mem_mst.all_nodes mst ) 221 243 in 222 244 print_result r4 ; 223 245 let%lwt r5 = 224 - time_it 225 - (Printf.sprintf "collect_nodes_and_leaves %d records" size) 226 - (fun () -> Mem_mst.collect_nodes_and_leaves mst) 246 + time_it (Printf.sprintf "collect_nodes_and_leaves %d records" size) 247 + (fun () -> Mem_mst.collect_nodes_and_leaves mst ) 227 248 in 228 249 print_result r5 ; Lwt.return_unit ) 229 250 sizes ··· 236 257 let%lwt data = generate_bulk_data store size in 237 258 let%lwt mst = Mem_mst.of_assoc store data in 238 259 let%lwt r1 = 239 - time_it 240 - (Printf.sprintf "to_blocks_stream consume %d" size) 241 - (fun () -> 260 + time_it (Printf.sprintf "to_blocks_stream consume %d" size) (fun () -> 242 261 let stream = Mem_mst.to_blocks_stream mst in 243 262 Lwt_seq.fold_left_s (fun count _ -> Lwt.return (count + 1)) 0 stream ) 244 263 in 245 264 print_result r1 ; 246 265 let%lwt r2 = 247 - time_it 248 - (Printf.sprintf "to_ordered_stream consume %d" size) 249 - (fun () -> 266 + time_it (Printf.sprintf "to_ordered_stream consume %d" size) (fun () -> 250 267 let stream = Mem_mst.to_ordered_stream mst in 251 268 Lwt_seq.fold_left_s (fun count _ -> Lwt.return (count + 1)) 0 stream ) 252 269 in ··· 266 283 in 267 284 let%lwt r = 268 285 time_it 269 - (Printf.sprintf "proof_for_key %d proofs, %d-record tree" num_proofs size) 270 - (fun () -> 286 + (Printf.sprintf "proof_for_key %d proofs, %d-record tree" num_proofs 287 + size ) (fun () -> 271 288 Lwt_list.iter_s 272 289 (fun k -> Mem_mst.proof_for_key mst mst.root k >|= fun _ -> ()) 273 290 test_keys ) 274 291 in 275 292 print_result r ; 276 - Printf.printf " (%.6f s per proof)\n%!" (r.total_s /. float_of_int num_proofs) ; 293 + Printf.printf " (%.6f s per proof)\n%!" 294 + (r.total_s /. float_of_int num_proofs) ; 277 295 Lwt.return_unit ) 278 296 sizes 279 297 ··· 286 304 let%lwt mst1 = Mem_mst.of_assoc store data in 287 305 let%lwt mst2 = Mem_mst.of_assoc store (shuffle data) in 288 306 let%lwt r = 289 - time_it 290 - (Printf.sprintf "equal (identical trees) %d records" size) 291 - (fun () -> Mem_mst.equal mst1 mst2) 307 + time_it (Printf.sprintf "equal (identical trees) %d records" size) 308 + (fun () -> Mem_mst.equal mst1 mst2 ) 292 309 in 293 310 print_result r ; Lwt.return_unit ) 294 311 sizes ··· 306 323 let pending_adds = ref (shuffle extra_data) in 307 324 let%lwt r = 308 325 time_it 309 - (Printf.sprintf "mixed %d ops on %d-record tree" 310 - num_ops initial_size ) 326 + (Printf.sprintf "mixed %d ops on %d-record tree" num_ops initial_size) 311 327 (fun () -> 312 328 let rec loop mst i = 313 329 if i >= num_ops then Lwt.return mst ··· 345 361 loop mst 0 ) 346 362 in 347 363 print_result r ; 348 - Printf.printf " (%.6f s per op avg)\n%!" (r.total_s /. float_of_int num_ops) ; 364 + Printf.printf " (%.6f s per op avg)\n%!" 365 + (r.total_s /. float_of_int num_ops) ; 349 366 Lwt.return_unit ) 350 367 configs 351 368 ··· 361 378 let%lwt batch_data = generate_bulk_data store batch_size in 362 379 let%lwt r1 = 363 380 time_it 364 - (Printf.sprintf "batch add (incremental) %d to %d tree" batch_size tree_size) 365 - (fun () -> Lwt_list.fold_left_s (fun t (k, v) -> Mem_mst.add t k v) mst batch_data) 381 + (Printf.sprintf "batch add (incremental) %d to %d tree" batch_size 382 + tree_size ) (fun () -> 383 + Lwt_list.fold_left_s 384 + (fun t (k, v) -> Mem_mst.add t k v) 385 + mst batch_data ) 366 386 in 367 387 print_result r1 ; 368 388 let%lwt r2 = 369 389 time_it 370 - (Printf.sprintf "batch add (rebuild) %d to %d tree" batch_size tree_size) 371 - (fun () -> Mem_mst.of_assoc store (initial_data @ batch_data)) 390 + (Printf.sprintf "batch add (rebuild) %d to %d tree" batch_size 391 + tree_size ) (fun () -> 392 + Mem_mst.of_assoc store (initial_data @ batch_data) ) 372 393 in 373 394 print_result r2 ; 374 395 let speedup = r2.total_s /. r1.total_s in 375 - Printf.printf " -> incremental is %.2fx %s for batch of %d\n%!" (abs_float speedup) 396 + Printf.printf " -> incremental is %.2fx %s for batch of %d\n%!" 397 + (abs_float speedup) 376 398 (if speedup > 1.0 then "faster" else "slower") 377 399 batch_size ; 378 400 Lwt.return_unit ) ··· 401 423 print_result r1 ; 402 424 (* last n keys *) 403 425 let late_keys = 404 - List.filteri (fun i _ -> i >= List.length sorted_keys - num_lookups) sorted_keys 426 + List.filteri 427 + (fun i _ -> i >= List.length sorted_keys - num_lookups) 428 + sorted_keys 405 429 in 406 430 let%lwt r2 = 407 431 time_it ··· 413 437 in 414 438 print_result r2 ; 415 439 (* random keys *) 416 - let random_keys = shuffle sorted_keys |> List.filteri (fun i _ -> i < num_lookups) in 440 + let random_keys = 441 + shuffle sorted_keys |> List.filteri (fun i _ -> i < num_lookups) 442 + in 417 443 let%lwt r3 = 418 444 time_it 419 445 (Printf.sprintf "proof random keys (%d from %d tree)" num_lookups size) ··· 442 468 in 443 469 let iterations = 100 in 444 470 let%lwt r = 445 - time_it_n 446 - (Printf.sprintf "serialize root node (%d-record tree)" size) 447 - iterations 448 - (fun () -> Mem_mst.serialize mst root_node >|= fun _ -> ()) 471 + time_it_n (Printf.sprintf "serialize root node (%d-record tree)" size) 472 + iterations (fun () -> 473 + Mem_mst.serialize mst root_node >|= fun _ -> () ) 449 474 in 450 475 print_result r ; Lwt.return_unit ) 451 476 sizes ··· 459 484 let%lwt mst = Mem_mst.of_assoc store data in 460 485 let iterations = 1000 in 461 486 let%lwt r = 462 - time_it_n (Printf.sprintf "layer query (%d-record tree)" size) iterations (fun () -> 463 - Mem_mst.layer mst >|= fun _ -> () ) 487 + time_it_n (Printf.sprintf "layer query (%d-record tree)" size) 488 + iterations (fun () -> Mem_mst.layer mst >|= fun _ -> () ) 464 489 in 465 490 print_result r ; Lwt.return_unit ) 466 491 sizes
+6 -3
mist/test/test_mst.ml
··· 876 876 let%lwt mst = Mem_mst.add mst "com.example/mmm" cid1 in 877 877 let%lwt min_single = Mem_mst.get_min_key mst mst.root in 878 878 let%lwt max_single = Mem_mst.get_max_key mst mst.root in 879 - Alcotest.(check (option string)) "single min" (Some "com.example/mmm") min_single ; 880 - Alcotest.(check (option string)) "single max" (Some "com.example/mmm") max_single ; 879 + Alcotest.(check (option string)) 880 + "single min" (Some "com.example/mmm") min_single ; 881 + Alcotest.(check (option string)) 882 + "single max" (Some "com.example/mmm") max_single ; 881 883 (* multiple entries at different layers *) 882 884 let%lwt mst = Mem_mst.add mst "com.example/aaa" cid1 in 883 885 let%lwt mst = Mem_mst.add mst "com.example/zzz" cid1 in ··· 892 894 let%lwt mst = Mem_mst.add mst "com.example.record/3jqfcqzm3fn2j" cid1 in 893 895 let%lwt min_deep = Mem_mst.get_min_key mst mst.root in 894 896 let%lwt max_deep = Mem_mst.get_max_key mst mst.root in 895 - Alcotest.(check (option string)) "deep min" (Some "com.example.record/3jqfcqzm3fn2j") min_deep ; 897 + Alcotest.(check (option string)) 898 + "deep min" (Some "com.example.record/3jqfcqzm3fn2j") min_deep ; 896 899 Alcotest.(check (option string)) "deep max" (Some "com.example/zzz") max_deep ; 897 900 Lwt.return_ok () 898 901
+128 -75
pegasus/bench/bench_repository.ml
··· 8 8 module Mst = Mist.Mst.Make (User_store) 9 9 module Mem_mst = Mist.Mst.Make (Mist.Storage.Memory_blockstore) 10 10 11 - type timing_result = {name: string; iterations: int; total_s: float; per_iter_s: float} 11 + type timing_result = 12 + {name: string; iterations: int; total_s: float; per_iter_s: float} 12 13 13 14 let time_it name f : timing_result Lwt.t = 14 15 let start = Unix.gettimeofday () in ··· 19 20 let time_it_n name n f : timing_result Lwt.t = 20 21 let start = Unix.gettimeofday () in 21 22 let%lwt () = 22 - let rec loop i = if i >= n then Lwt.return_unit else f () >>= fun _ -> loop (i + 1) in 23 + let rec loop i = 24 + if i >= n then Lwt.return_unit else f () >>= fun _ -> loop (i + 1) 25 + in 23 26 loop 0 24 27 in 25 28 let elapsed = Unix.gettimeofday () -. start in 26 - Lwt.return {name; iterations= n; total_s= elapsed; per_iter_s= elapsed /. float_of_int n} 29 + Lwt.return 30 + { name 31 + ; iterations= n 32 + ; total_s= elapsed 33 + ; per_iter_s= elapsed /. float_of_int n } 27 34 28 35 let print_result r = 29 36 if r.iterations = 1 then Printf.printf " %-55s %10.4f s\n%!" r.name r.total_s 30 37 else 31 - Printf.printf " %-55s %10.4f s total, %10.6f s/iter (%d iters)\n%!" r.name r.total_s 32 - r.per_iter_s r.iterations 38 + Printf.printf " %-55s %10.4f s total, %10.6f s/iter (%d iters)\n%!" r.name 39 + r.total_s r.per_iter_s r.iterations 33 40 34 41 let print_header name = Printf.printf "\n=== %s ===\n%!" name 35 42 ··· 38 45 let create_temp_db () = 39 46 incr temp_db_counter ; 40 47 let path = 41 - Printf.sprintf "/tmp/pegasus_bench_%d_%d.db" (Unix.getpid ()) !temp_db_counter 48 + Printf.sprintf "/tmp/pegasus_bench_%d_%d.db" (Unix.getpid ()) 49 + !temp_db_counter 42 50 in 43 51 let uri = Uri.of_string ("sqlite3://" ^ path) in 44 52 (path, uri) 45 53 46 54 let cleanup_temp_db path = 47 - try Unix.unlink path with Unix.Unix_error _ -> () ; 48 - try Unix.unlink (path ^ "-wal") with Unix.Unix_error _ -> () ; 49 - try Unix.unlink (path ^ "-shm") with Unix.Unix_error _ -> () 55 + try Unix.unlink path 56 + with Unix.Unix_error _ -> ( 57 + () ; 58 + try Unix.unlink (path ^ "-wal") 59 + with Unix.Unix_error _ -> ( 60 + () ; 61 + try Unix.unlink (path ^ "-shm") with Unix.Unix_error _ -> () ) ) 50 62 51 63 let setup_test_db () : (User_store.t * string) Lwt.t = 52 64 let path, uri = create_temp_db () in ··· 84 96 if n <= 0 then acc 85 97 else 86 98 let p = make_path () in 87 - if List.mem p acc then unique_paths n acc else unique_paths (n - 1) (p :: acc) 99 + if List.mem p acc then unique_paths n acc 100 + else unique_paths (n - 1) (p :: acc) 88 101 89 - let generate_blocks count = 90 - List.init count (fun _ -> random_block ()) 102 + let generate_blocks count = List.init count (fun _ -> random_block ()) 91 103 92 104 let generate_record_data count = 93 105 let paths = unique_paths count [] in ··· 139 151 time_it_n "get_bytes (single, missing)" 1000 (fun () -> 140 152 User_store.get_bytes db missing_cid >|= fun _ -> () ) 141 153 in 142 - print_result r3 ; 143 - cleanup_temp_db path ; Lwt.return_unit 154 + print_result r3 ; cleanup_temp_db path ; Lwt.return_unit 144 155 145 156 let bench_batch_block_ops () = 146 157 print_header "batch block ops" ; ··· 150 161 let%lwt db, path = setup_test_db () in 151 162 let blocks = generate_blocks batch_size in 152 163 let block_map = 153 - List.fold_left (fun acc (cid, data) -> Block_map.set cid data acc) Block_map.empty blocks 164 + List.fold_left 165 + (fun acc (cid, data) -> Block_map.set cid data acc) 166 + Block_map.empty blocks 154 167 in 155 168 let%lwt r1 = 156 169 time_it (Printf.sprintf "put_many (%d blocks)" batch_size) (fun () -> ··· 162 175 time_it (Printf.sprintf "get_blocks (%d blocks)" batch_size) (fun () -> 163 176 User_store.get_blocks db cids >|= fun _ -> () ) 164 177 in 165 - print_result r2 ; 166 - cleanup_temp_db path ; Lwt.return_unit ) 178 + print_result r2 ; cleanup_temp_db path ; Lwt.return_unit ) 167 179 batch_sizes 168 180 169 181 let bench_bulk_insert_ops () = ··· 175 187 let blocks = generate_blocks size in 176 188 let%lwt r1 = 177 189 time_it (Printf.sprintf "Bulk.put_blocks (%d blocks)" size) (fun () -> 178 - Util.Sqlite.use_pool db.db (fun conn -> User_store.Bulk.put_blocks blocks conn) 190 + Util.Sqlite.use_pool db.db (fun conn -> 191 + User_store.Bulk.put_blocks blocks conn ) 179 192 >|= fun _ -> () ) 180 193 in 181 194 print_result r1 ; ··· 184 197 let records = generate_record_data size in 185 198 let%lwt r2 = 186 199 time_it (Printf.sprintf "Bulk.put_records (%d records)" size) (fun () -> 187 - Util.Sqlite.use_pool db2.db (fun conn -> User_store.Bulk.put_records records conn) 200 + Util.Sqlite.use_pool db2.db (fun conn -> 201 + User_store.Bulk.put_records records conn ) 188 202 >|= fun _ -> () ) 189 203 in 190 - print_result r2 ; 191 - cleanup_temp_db path2 ; Lwt.return_unit ) 204 + print_result r2 ; cleanup_temp_db path2 ; Lwt.return_unit ) 192 205 sizes 193 206 194 207 let bench_db_mst_ops () = ··· 200 213 let records = generate_record_data size in 201 214 let kv_pairs = List.map (fun (path, cid, _, _) -> (path, cid)) records in 202 215 let%lwt () = 203 - Util.Sqlite.use_pool db.db (fun conn -> User_store.Bulk.put_records records conn) 216 + Util.Sqlite.use_pool db.db (fun conn -> 217 + User_store.Bulk.put_records records conn ) 204 218 >|= fun _ -> () 205 219 in 206 220 let%lwt r1 = 207 - time_it (Printf.sprintf "Mst.of_assoc (db-backed, %d records)" size) (fun () -> 208 - Mst.of_assoc db kv_pairs >|= fun _ -> () ) 221 + time_it (Printf.sprintf "Mst.of_assoc (db-backed, %d records)" size) 222 + (fun () -> Mst.of_assoc db kv_pairs >|= fun _ -> () ) 209 223 in 210 224 print_result r1 ; 211 225 let%lwt mst = Mst.of_assoc db kv_pairs in 212 226 let%lwt r2 = 213 - time_it (Printf.sprintf "Mst.build_map (db-backed, %d records)" size) (fun () -> 214 - Mst.build_map mst >|= fun _ -> () ) 227 + time_it (Printf.sprintf "Mst.build_map (db-backed, %d records)" size) 228 + (fun () -> Mst.build_map mst >|= fun _ -> () ) 215 229 in 216 230 print_result r2 ; 217 231 let%lwt r3 = 218 - time_it (Printf.sprintf "Mst.leaf_count (db-backed, %d records)" size) (fun () -> 219 - Mst.leaf_count mst >|= fun _ -> () ) 232 + time_it (Printf.sprintf "Mst.leaf_count (db-backed, %d records)" size) 233 + (fun () -> Mst.leaf_count mst >|= fun _ -> () ) 220 234 in 221 - print_result r3 ; 222 - cleanup_temp_db path ; Lwt.return_unit ) 235 + print_result r3 ; cleanup_temp_db path ; Lwt.return_unit ) 223 236 sizes 224 237 225 238 let bench_db_mst_incremental () = ··· 229 242 (fun (initial_size, add_count) -> 230 243 let%lwt db, path = setup_test_db () in 231 244 let initial_records = generate_record_data initial_size in 232 - let initial_kv = List.map (fun (path, cid, _, _) -> (path, cid)) initial_records in 245 + let initial_kv = 246 + List.map (fun (path, cid, _, _) -> (path, cid)) initial_records 247 + in 233 248 let%lwt () = 234 - Util.Sqlite.use_pool db.db (fun conn -> User_store.Bulk.put_records initial_records conn) 249 + Util.Sqlite.use_pool db.db (fun conn -> 250 + User_store.Bulk.put_records initial_records conn ) 235 251 >|= fun _ -> () 236 252 in 237 253 let%lwt mst = Mst.of_assoc db initial_kv in 238 254 let add_records = generate_record_data add_count in 239 - let add_kv = List.map (fun (path, cid, _, _) -> (path, cid)) add_records in 255 + let add_kv = 256 + List.map (fun (path, cid, _, _) -> (path, cid)) add_records 257 + in 240 258 let%lwt () = 241 - Util.Sqlite.use_pool db.db (fun conn -> User_store.Bulk.put_records add_records conn) 259 + Util.Sqlite.use_pool db.db (fun conn -> 260 + User_store.Bulk.put_records add_records conn ) 242 261 >|= fun _ -> () 243 262 in 244 263 let%lwt r1 = 245 264 time_it 246 - (Printf.sprintf "Mst.add incremental (%d to %d-record tree)" add_count initial_size) 247 - (fun () -> 248 - Lwt_list.fold_left_s (fun t (k, v) -> Mst.add t k v) mst add_kv >|= fun _ -> () ) 265 + (Printf.sprintf "Mst.add incremental (%d to %d-record tree)" add_count 266 + initial_size ) (fun () -> 267 + Lwt_list.fold_left_s (fun t (k, v) -> Mst.add t k v) mst add_kv 268 + >|= fun _ -> () ) 249 269 in 250 270 print_result r1 ; 251 - Printf.printf " (%.6f s per add avg)\n%!" (r1.total_s /. float_of_int add_count) ; 252 - cleanup_temp_db path ; Lwt.return_unit ) 271 + Printf.printf " (%.6f s per add avg)\n%!" 272 + (r1.total_s /. float_of_int add_count) ; 273 + cleanup_temp_db path ; 274 + Lwt.return_unit ) 253 275 configs 254 276 255 277 let bench_car_export () = ··· 262 284 let%lwt () = 263 285 Lwt_list.iter_s 264 286 (fun (_, cid, data, _) -> 265 - Mist.Storage.Memory_blockstore.put_block store cid data >|= fun _ -> () ) 287 + Mist.Storage.Memory_blockstore.put_block store cid data 288 + >|= fun _ -> () ) 266 289 records 267 290 in 268 291 let kv_pairs = List.map (fun (path, cid, _, _) -> (path, cid)) records in 269 292 let%lwt mst = Mem_mst.of_assoc store kv_pairs in 270 293 let%lwt r1 = 271 - time_it (Printf.sprintf "to_blocks_stream + consume (%d records)" size) (fun () -> 294 + time_it (Printf.sprintf "to_blocks_stream + consume (%d records)" size) 295 + (fun () -> 272 296 let stream = Mem_mst.to_blocks_stream mst in 273 - Lwt_seq.fold_left_s (fun count _ -> Lwt.return (count + 1)) 0 stream >|= fun _ -> () ) 297 + Lwt_seq.fold_left_s (fun count _ -> Lwt.return (count + 1)) 0 stream 298 + >|= fun _ -> () ) 274 299 in 275 300 print_result r1 ; 276 - let commit_map = Dag_cbor.String_map.(empty |> add "root" (`Link mst.root)) in 301 + let commit_map = 302 + Dag_cbor.String_map.(empty |> add "root" (`Link mst.root)) 303 + in 277 304 let commit_block = Dag_cbor.encode (`Map commit_map) in 278 305 let commit_cid = Cid.create Dcbor commit_block in 279 306 let%lwt r2 = 280 - time_it (Printf.sprintf "Car.blocks_to_stream (%d records)" size) (fun () -> 307 + time_it (Printf.sprintf "Car.blocks_to_stream (%d records)" size) 308 + (fun () -> 281 309 let blocks = Mem_mst.to_blocks_stream mst in 282 310 let all_blocks = Lwt_seq.cons (commit_cid, commit_block) blocks in 283 311 let car_stream = Car.blocks_to_stream commit_cid all_blocks in 284 - Lwt_seq.fold_left_s (fun acc chunk -> Lwt.return (acc + Bytes.length chunk)) 0 car_stream 312 + Lwt_seq.fold_left_s 313 + (fun acc chunk -> Lwt.return (acc + Bytes.length chunk)) 314 + 0 car_stream 285 315 >|= fun _ -> () ) 286 316 in 287 - print_result r2 ; 288 - Lwt.return_unit ) 317 + print_result r2 ; Lwt.return_unit ) 289 318 sizes 290 319 291 320 let bench_car_import () = ··· 298 327 let%lwt () = 299 328 Lwt_list.iter_s 300 329 (fun (_, cid, data, _) -> 301 - Mist.Storage.Memory_blockstore.put_block store cid data >|= fun _ -> () ) 330 + Mist.Storage.Memory_blockstore.put_block store cid data 331 + >|= fun _ -> () ) 302 332 records 303 333 in 304 334 let kv_pairs = List.map (fun (path, cid, _, _) -> (path, cid)) records in 305 335 let%lwt mst = Mem_mst.of_assoc store kv_pairs in 306 - let commit_map = Dag_cbor.String_map.(empty |> add "root" (`Link mst.root)) in 336 + let commit_map = 337 + Dag_cbor.String_map.(empty |> add "root" (`Link mst.root)) 338 + in 307 339 let commit_block = Dag_cbor.encode (`Map commit_map) in 308 340 let commit_cid = Cid.create Dcbor commit_block in 309 341 let blocks = Mem_mst.to_blocks_stream mst in 310 342 let all_blocks = Lwt_seq.cons (commit_cid, commit_block) blocks in 311 343 let car_stream = Car.blocks_to_stream commit_cid all_blocks in 312 344 let%lwt car_bytes = Car.collect_stream car_stream in 313 - Printf.printf " (car size for %d records: %d bytes)\n%!" size (Bytes.length car_bytes) ; 345 + Printf.printf " (car size for %d records: %d bytes)\n%!" size 346 + (Bytes.length car_bytes) ; 314 347 let%lwt r1 = 315 - time_it (Printf.sprintf "Car.read_car_stream parse (%d records)" size) (fun () -> 348 + time_it (Printf.sprintf "Car.read_car_stream parse (%d records)" size) 349 + (fun () -> 316 350 let stream = Lwt_seq.return car_bytes in 317 351 let%lwt roots, blocks_seq = Car.read_car_stream stream in 318 352 let%lwt _ = 319 - Lwt_seq.fold_left_s (fun acc (_, _) -> Lwt.return (acc + 1)) 0 blocks_seq 353 + Lwt_seq.fold_left_s 354 + (fun acc (_, _) -> Lwt.return (acc + 1)) 355 + 0 blocks_seq 320 356 in 321 357 Lwt.return roots ) 322 358 in 323 - print_result r1 ; 324 - Lwt.return_unit ) 359 + print_result r1 ; Lwt.return_unit ) 325 360 sizes 326 361 327 362 let bench_rebuild_mst () = ··· 332 367 let%lwt db, path = setup_test_db () in 333 368 let records = generate_record_data size in 334 369 let%lwt () = 335 - Util.Sqlite.use_pool db.db (fun conn -> User_store.Bulk.put_records records conn) 370 + Util.Sqlite.use_pool db.db (fun conn -> 371 + User_store.Bulk.put_records records conn ) 336 372 >|= fun _ -> () 337 373 in 338 374 let%lwt r1 = 339 - time_it (Printf.sprintf "get_all_record_cids + of_assoc (%d records)" size) (fun () -> 375 + time_it 376 + (Printf.sprintf "get_all_record_cids + of_assoc (%d records)" size) 377 + (fun () -> 340 378 let%lwt record_cids = User_store.get_all_record_cids db in 341 379 let%lwt _ = Mst.of_assoc db record_cids in 342 380 Lwt.return_unit ) 343 381 in 344 - print_result r1 ; 345 - cleanup_temp_db path ; Lwt.return_unit ) 382 + print_result r1 ; cleanup_temp_db path ; Lwt.return_unit ) 346 383 sizes 347 384 348 385 let bench_mixed_ops () = ··· 352 389 let num_ops = 500 in 353 390 let initial_records = generate_record_data initial_size in 354 391 let%lwt () = 355 - Util.Sqlite.use_pool db.db (fun conn -> User_store.Bulk.put_records initial_records conn) 392 + Util.Sqlite.use_pool db.db (fun conn -> 393 + User_store.Bulk.put_records initial_records conn ) 356 394 >|= fun _ -> () 357 395 in 358 - let initial_kv = List.map (fun (path, cid, _, _) -> (path, cid)) initial_records in 396 + let initial_kv = 397 + List.map (fun (path, cid, _, _) -> (path, cid)) initial_records 398 + in 359 399 let%lwt mst = Mst.of_assoc db initial_kv in 360 400 let extra_records = generate_record_data num_ops in 361 401 let%lwt () = 362 - Util.Sqlite.use_pool db.db (fun conn -> User_store.Bulk.put_records extra_records conn) 402 + Util.Sqlite.use_pool db.db (fun conn -> 403 + User_store.Bulk.put_records extra_records conn ) 363 404 >|= fun _ -> () 364 405 in 365 406 let existing = ref (shuffle initial_records) in 366 407 let pending_adds = ref (shuffle extra_records) in 367 408 let%lwt r1 = 368 - time_it 369 - (Printf.sprintf "mixed ops (%d ops)" num_ops) 370 - (fun () -> 409 + time_it (Printf.sprintf "mixed ops (%d ops)" num_ops) (fun () -> 371 410 let rec loop mst i = 372 411 if i >= num_ops then Lwt.return mst 373 412 else ··· 400 439 loop mst 0 >|= fun _ -> () ) 401 440 in 402 441 print_result r1 ; 403 - Printf.printf " (%.6f s per op avg)\n%!" (r1.total_s /. float_of_int num_ops) ; 404 - cleanup_temp_db path ; Lwt.return_unit 442 + Printf.printf " (%.6f s per op avg)\n%!" 443 + (r1.total_s /. float_of_int num_ops) ; 444 + cleanup_temp_db path ; 445 + Lwt.return_unit 405 446 406 447 let bench_db_io_patterns () = 407 448 print_header "database i/o" ; ··· 409 450 let size = 20000 in 410 451 let blocks = generate_blocks size in 411 452 let%lwt () = 412 - Util.Sqlite.use_pool db.db (fun conn -> User_store.Bulk.put_blocks blocks conn) >|= fun _ -> () 453 + Util.Sqlite.use_pool db.db (fun conn -> 454 + User_store.Bulk.put_blocks blocks conn ) 455 + >|= fun _ -> () 413 456 in 414 457 let cids = List.map fst blocks in 415 458 let shuffled_cids = shuffle cids in 416 459 let%lwt r1 = 417 460 time_it (Printf.sprintf "sequential read (%d blocks)" size) (fun () -> 418 - Lwt_list.iter_s (fun cid -> User_store.get_bytes db cid >|= fun _ -> ()) cids ) 461 + Lwt_list.iter_s 462 + (fun cid -> User_store.get_bytes db cid >|= fun _ -> ()) 463 + cids ) 419 464 in 420 465 print_result r1 ; 421 466 let%lwt r2 = 422 467 time_it (Printf.sprintf "random read (%d blocks)" size) (fun () -> 423 - Lwt_list.iter_s (fun cid -> User_store.get_bytes db cid >|= fun _ -> ()) shuffled_cids ) 468 + Lwt_list.iter_s 469 + (fun cid -> User_store.get_bytes db cid >|= fun _ -> ()) 470 + shuffled_cids ) 424 471 in 425 472 print_result r2 ; 426 473 let batch_size = 50 in 427 - let batches = List.init (size / batch_size) (fun i -> 428 - List.filteri (fun j _ -> j >= i * batch_size && j < (i + 1) * batch_size) cids ) 474 + let batches = 475 + List.init (size / batch_size) (fun i -> 476 + List.filteri 477 + (fun j _ -> j >= i * batch_size && j < (i + 1) * batch_size) 478 + cids ) 429 479 in 430 480 let%lwt r3 = 431 - time_it (Printf.sprintf "batched read (%d blocks, batch=%d)" size batch_size) (fun () -> 432 - Lwt_list.iter_s (fun batch -> User_store.get_blocks db batch >|= fun _ -> ()) batches ) 481 + time_it 482 + (Printf.sprintf "batched read (%d blocks, batch=%d)" size batch_size) 483 + (fun () -> 484 + Lwt_list.iter_s 485 + (fun batch -> User_store.get_blocks db batch >|= fun _ -> ()) 486 + batches ) 433 487 in 434 - print_result r3 ; 435 - cleanup_temp_db path ; Lwt.return_unit 488 + print_result r3 ; cleanup_temp_db path ; Lwt.return_unit 436 489 437 490 let run_all_benchmarks () = 438 491 Printf.printf "repository benchmarks\n" ;
+124 -31
pegasus/lexicons/app_bsky_actor_defs.ml
··· 1 1 (* re-exported from App_bsky_shared_1 *) 2 2 3 3 type profile_view_basic = App_bsky_shared_1.profile_view_basic 4 - let profile_view_basic_of_yojson = App_bsky_shared_1.profile_view_basic_of_yojson 5 - let profile_view_basic_to_yojson = App_bsky_shared_1.profile_view_basic_to_yojson 4 + 5 + let profile_view_basic_of_yojson = 6 + App_bsky_shared_1.profile_view_basic_of_yojson 7 + 8 + let profile_view_basic_to_yojson = 9 + App_bsky_shared_1.profile_view_basic_to_yojson 6 10 7 11 type profile_view = App_bsky_shared_1.profile_view 12 + 8 13 let profile_view_of_yojson = App_bsky_shared_1.profile_view_of_yojson 14 + 9 15 let profile_view_to_yojson = App_bsky_shared_1.profile_view_to_yojson 10 16 11 17 type profile_view_detailed = App_bsky_shared_1.profile_view_detailed 12 - let profile_view_detailed_of_yojson = App_bsky_shared_1.profile_view_detailed_of_yojson 13 - let profile_view_detailed_to_yojson = App_bsky_shared_1.profile_view_detailed_to_yojson 18 + 19 + let profile_view_detailed_of_yojson = 20 + App_bsky_shared_1.profile_view_detailed_of_yojson 21 + 22 + let profile_view_detailed_to_yojson = 23 + App_bsky_shared_1.profile_view_detailed_to_yojson 14 24 15 25 type profile_associated = App_bsky_shared_1.profile_associated 16 - let profile_associated_of_yojson = App_bsky_shared_1.profile_associated_of_yojson 17 - let profile_associated_to_yojson = App_bsky_shared_1.profile_associated_to_yojson 26 + 27 + let profile_associated_of_yojson = 28 + App_bsky_shared_1.profile_associated_of_yojson 29 + 30 + let profile_associated_to_yojson = 31 + App_bsky_shared_1.profile_associated_to_yojson 18 32 19 33 type profile_associated_chat = App_bsky_shared_1.profile_associated_chat 20 - let profile_associated_chat_of_yojson = App_bsky_shared_1.profile_associated_chat_of_yojson 21 - let profile_associated_chat_to_yojson = App_bsky_shared_1.profile_associated_chat_to_yojson 34 + 35 + let profile_associated_chat_of_yojson = 36 + App_bsky_shared_1.profile_associated_chat_of_yojson 37 + 38 + let profile_associated_chat_to_yojson = 39 + App_bsky_shared_1.profile_associated_chat_to_yojson 22 40 23 - type profile_associated_activity_subscription = App_bsky_shared_1.profile_associated_activity_subscription 24 - let profile_associated_activity_subscription_of_yojson = App_bsky_shared_1.profile_associated_activity_subscription_of_yojson 25 - let profile_associated_activity_subscription_to_yojson = App_bsky_shared_1.profile_associated_activity_subscription_to_yojson 41 + type profile_associated_activity_subscription = 42 + App_bsky_shared_1.profile_associated_activity_subscription 43 + 44 + let profile_associated_activity_subscription_of_yojson = 45 + App_bsky_shared_1.profile_associated_activity_subscription_of_yojson 46 + 47 + let profile_associated_activity_subscription_to_yojson = 48 + App_bsky_shared_1.profile_associated_activity_subscription_to_yojson 26 49 27 50 type viewer_state = App_bsky_shared_1.actor_viewer_state 51 + 28 52 let viewer_state_of_yojson = App_bsky_shared_1.actor_viewer_state_of_yojson 53 + 29 54 let viewer_state_to_yojson = App_bsky_shared_1.actor_viewer_state_to_yojson 30 55 31 56 type known_followers = App_bsky_shared_1.known_followers 57 + 32 58 let known_followers_of_yojson = App_bsky_shared_1.known_followers_of_yojson 59 + 33 60 let known_followers_to_yojson = App_bsky_shared_1.known_followers_to_yojson 34 61 35 62 type verification_state = App_bsky_shared_1.verification_state 36 - let verification_state_of_yojson = App_bsky_shared_1.verification_state_of_yojson 37 - let verification_state_to_yojson = App_bsky_shared_1.verification_state_to_yojson 63 + 64 + let verification_state_of_yojson = 65 + App_bsky_shared_1.verification_state_of_yojson 66 + 67 + let verification_state_to_yojson = 68 + App_bsky_shared_1.verification_state_to_yojson 38 69 39 70 type verification_view = App_bsky_shared_1.verification_view 71 + 40 72 let verification_view_of_yojson = App_bsky_shared_1.verification_view_of_yojson 73 + 41 74 let verification_view_to_yojson = App_bsky_shared_1.verification_view_to_yojson 42 75 43 76 type preferences = App_bsky_shared_1.preferences 77 + 44 78 let preferences_of_yojson = App_bsky_shared_1.preferences_of_yojson 79 + 45 80 let preferences_to_yojson = App_bsky_shared_1.preferences_to_yojson 46 81 47 82 type adult_content_pref = App_bsky_shared_1.adult_content_pref 48 - let adult_content_pref_of_yojson = App_bsky_shared_1.adult_content_pref_of_yojson 49 - let adult_content_pref_to_yojson = App_bsky_shared_1.adult_content_pref_to_yojson 83 + 84 + let adult_content_pref_of_yojson = 85 + App_bsky_shared_1.adult_content_pref_of_yojson 86 + 87 + let adult_content_pref_to_yojson = 88 + App_bsky_shared_1.adult_content_pref_to_yojson 50 89 51 90 type content_label_pref = App_bsky_shared_1.content_label_pref 52 - let content_label_pref_of_yojson = App_bsky_shared_1.content_label_pref_of_yojson 53 - let content_label_pref_to_yojson = App_bsky_shared_1.content_label_pref_to_yojson 91 + 92 + let content_label_pref_of_yojson = 93 + App_bsky_shared_1.content_label_pref_of_yojson 94 + 95 + let content_label_pref_to_yojson = 96 + App_bsky_shared_1.content_label_pref_to_yojson 54 97 55 98 type saved_feed = App_bsky_shared_1.saved_feed 99 + 56 100 let saved_feed_of_yojson = App_bsky_shared_1.saved_feed_of_yojson 101 + 57 102 let saved_feed_to_yojson = App_bsky_shared_1.saved_feed_to_yojson 58 103 59 104 type saved_feeds_pref_v2 = App_bsky_shared_1.saved_feeds_pref_v2 60 - let saved_feeds_pref_v2_of_yojson = App_bsky_shared_1.saved_feeds_pref_v2_of_yojson 61 - let saved_feeds_pref_v2_to_yojson = App_bsky_shared_1.saved_feeds_pref_v2_to_yojson 105 + 106 + let saved_feeds_pref_v2_of_yojson = 107 + App_bsky_shared_1.saved_feeds_pref_v2_of_yojson 108 + 109 + let saved_feeds_pref_v2_to_yojson = 110 + App_bsky_shared_1.saved_feeds_pref_v2_to_yojson 62 111 63 112 type saved_feeds_pref = App_bsky_shared_1.saved_feeds_pref 113 + 64 114 let saved_feeds_pref_of_yojson = App_bsky_shared_1.saved_feeds_pref_of_yojson 115 + 65 116 let saved_feeds_pref_to_yojson = App_bsky_shared_1.saved_feeds_pref_to_yojson 66 117 67 118 type personal_details_pref = App_bsky_shared_1.personal_details_pref 68 - let personal_details_pref_of_yojson = App_bsky_shared_1.personal_details_pref_of_yojson 69 - let personal_details_pref_to_yojson = App_bsky_shared_1.personal_details_pref_to_yojson 119 + 120 + let personal_details_pref_of_yojson = 121 + App_bsky_shared_1.personal_details_pref_of_yojson 122 + 123 + let personal_details_pref_to_yojson = 124 + App_bsky_shared_1.personal_details_pref_to_yojson 70 125 71 126 type feed_view_pref = App_bsky_shared_1.feed_view_pref 127 + 72 128 let feed_view_pref_of_yojson = App_bsky_shared_1.feed_view_pref_of_yojson 129 + 73 130 let feed_view_pref_to_yojson = App_bsky_shared_1.feed_view_pref_to_yojson 74 131 75 132 type thread_view_pref = App_bsky_shared_1.thread_view_pref 133 + 76 134 let thread_view_pref_of_yojson = App_bsky_shared_1.thread_view_pref_of_yojson 135 + 77 136 let thread_view_pref_to_yojson = App_bsky_shared_1.thread_view_pref_to_yojson 78 137 79 138 type interests_pref = App_bsky_shared_1.interests_pref 139 + 80 140 let interests_pref_of_yojson = App_bsky_shared_1.interests_pref_of_yojson 141 + 81 142 let interests_pref_to_yojson = App_bsky_shared_1.interests_pref_to_yojson 82 143 83 144 type muted_word_target = App_bsky_shared_1.muted_word_target 145 + 84 146 let muted_word_target_of_yojson = App_bsky_shared_1.muted_word_target_of_yojson 147 + 85 148 let muted_word_target_to_yojson = App_bsky_shared_1.muted_word_target_to_yojson 86 149 87 150 type muted_word = App_bsky_shared_1.muted_word 151 + 88 152 let muted_word_of_yojson = App_bsky_shared_1.muted_word_of_yojson 153 + 89 154 let muted_word_to_yojson = App_bsky_shared_1.muted_word_to_yojson 90 155 91 156 type muted_words_pref = App_bsky_shared_1.muted_words_pref 157 + 92 158 let muted_words_pref_of_yojson = App_bsky_shared_1.muted_words_pref_of_yojson 159 + 93 160 let muted_words_pref_to_yojson = App_bsky_shared_1.muted_words_pref_to_yojson 94 161 95 162 type hidden_posts_pref = App_bsky_shared_1.hidden_posts_pref 163 + 96 164 let hidden_posts_pref_of_yojson = App_bsky_shared_1.hidden_posts_pref_of_yojson 165 + 97 166 let hidden_posts_pref_to_yojson = App_bsky_shared_1.hidden_posts_pref_to_yojson 98 167 99 168 type labelers_pref = App_bsky_shared_1.labelers_pref 169 + 100 170 let labelers_pref_of_yojson = App_bsky_shared_1.labelers_pref_of_yojson 171 + 101 172 let labelers_pref_to_yojson = App_bsky_shared_1.labelers_pref_to_yojson 102 173 103 174 type labeler_pref_item = App_bsky_shared_1.labeler_pref_item 175 + 104 176 let labeler_pref_item_of_yojson = App_bsky_shared_1.labeler_pref_item_of_yojson 177 + 105 178 let labeler_pref_item_to_yojson = App_bsky_shared_1.labeler_pref_item_to_yojson 106 179 107 180 type bsky_app_state_pref = App_bsky_shared_1.bsky_app_state_pref 108 - let bsky_app_state_pref_of_yojson = App_bsky_shared_1.bsky_app_state_pref_of_yojson 109 - let bsky_app_state_pref_to_yojson = App_bsky_shared_1.bsky_app_state_pref_to_yojson 181 + 182 + let bsky_app_state_pref_of_yojson = 183 + App_bsky_shared_1.bsky_app_state_pref_of_yojson 184 + 185 + let bsky_app_state_pref_to_yojson = 186 + App_bsky_shared_1.bsky_app_state_pref_to_yojson 110 187 111 188 type bsky_app_progress_guide = App_bsky_shared_1.bsky_app_progress_guide 112 - let bsky_app_progress_guide_of_yojson = App_bsky_shared_1.bsky_app_progress_guide_of_yojson 113 - let bsky_app_progress_guide_to_yojson = App_bsky_shared_1.bsky_app_progress_guide_to_yojson 189 + 190 + let bsky_app_progress_guide_of_yojson = 191 + App_bsky_shared_1.bsky_app_progress_guide_of_yojson 192 + 193 + let bsky_app_progress_guide_to_yojson = 194 + App_bsky_shared_1.bsky_app_progress_guide_to_yojson 114 195 115 196 type nux = App_bsky_shared_1.nux 197 + 116 198 let nux_of_yojson = App_bsky_shared_1.nux_of_yojson 199 + 117 200 let nux_to_yojson = App_bsky_shared_1.nux_to_yojson 118 201 119 202 type verification_prefs = App_bsky_shared_1.verification_prefs 120 - let verification_prefs_of_yojson = App_bsky_shared_1.verification_prefs_of_yojson 121 - let verification_prefs_to_yojson = App_bsky_shared_1.verification_prefs_to_yojson 122 203 123 - type post_interaction_settings_pref = App_bsky_shared_1.post_interaction_settings_pref 124 - let post_interaction_settings_pref_of_yojson = App_bsky_shared_1.post_interaction_settings_pref_of_yojson 125 - let post_interaction_settings_pref_to_yojson = App_bsky_shared_1.post_interaction_settings_pref_to_yojson 204 + let verification_prefs_of_yojson = 205 + App_bsky_shared_1.verification_prefs_of_yojson 206 + 207 + let verification_prefs_to_yojson = 208 + App_bsky_shared_1.verification_prefs_to_yojson 209 + 210 + type post_interaction_settings_pref = 211 + App_bsky_shared_1.post_interaction_settings_pref 212 + 213 + let post_interaction_settings_pref_of_yojson = 214 + App_bsky_shared_1.post_interaction_settings_pref_of_yojson 215 + 216 + let post_interaction_settings_pref_to_yojson = 217 + App_bsky_shared_1.post_interaction_settings_pref_to_yojson 126 218 127 219 type status_view = App_bsky_shared_1.status_view 220 + 128 221 let status_view_of_yojson = App_bsky_shared_1.status_view_of_yojson 129 - let status_view_to_yojson = App_bsky_shared_1.status_view_to_yojson 130 222 223 + let status_view_to_yojson = App_bsky_shared_1.status_view_to_yojson
+4 -8
pegasus/lexicons/app_bsky_actor_getPreferences.ml
··· 5 5 let nsid = "app.bsky.actor.getPreferences" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type output = 11 - { 12 - preferences: App_bsky_actor_defs.preferences; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type output = {preferences: App_bsky_actor_defs.preferences} 12 + [@@deriving yojson {strict= false}] 15 13 16 - let call 17 - (client : Hermes.client) : output Lwt.t = 14 + let call (client : Hermes.client) : output Lwt.t = 18 15 Hermes.query client nsid (`Assoc []) output_of_yojson 19 16 end 20 -
+3 -10
pegasus/lexicons/app_bsky_actor_getProfile.ml
··· 4 4 module Main = struct 5 5 let nsid = "app.bsky.actor.getProfile" 6 6 7 - type params = 8 - { 9 - actor: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {actor: string} [@@deriving yojson {strict= false}] 12 8 13 9 type output = App_bsky_actor_defs.profile_view_detailed 14 - [@@deriving yojson {strict= false}] 10 + [@@deriving yojson {strict= false}] 15 11 16 - let call 17 - ~actor 18 - (client : Hermes.client) : output Lwt.t = 12 + let call ~actor (client : Hermes.client) : output Lwt.t = 19 13 let params : params = {actor} in 20 14 Hermes.query client nsid (params_to_yojson params) output_of_yojson 21 15 end 22 -
+7 -13
pegasus/lexicons/app_bsky_actor_getProfiles.ml
··· 5 5 let nsid = "app.bsky.actor.getProfiles" 6 6 7 7 type params = 8 - { 9 - actors: string list [@of_yojson Hermes_util.query_string_list_of_yojson] [@to_yojson Hermes_util.query_string_list_to_yojson]; 10 - } 11 - [@@deriving yojson {strict= false}] 8 + { actors: string list 9 + [@of_yojson Hermes_util.query_string_list_of_yojson] 10 + [@to_yojson Hermes_util.query_string_list_to_yojson] } 11 + [@@deriving yojson {strict= false}] 12 12 13 - type output = 14 - { 15 - profiles: App_bsky_actor_defs.profile_view_detailed list; 16 - } 17 - [@@deriving yojson {strict= false}] 13 + type output = {profiles: App_bsky_actor_defs.profile_view_detailed list} 14 + [@@deriving yojson {strict= false}] 18 15 19 - let call 20 - ~actors 21 - (client : Hermes.client) : output Lwt.t = 16 + let call ~actors (client : Hermes.client) : output Lwt.t = 22 17 let params : params = {actors} in 23 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 19 end 25 -
+7 -16
pegasus/lexicons/app_bsky_actor_getSuggestions.ml
··· 5 5 let nsid = "app.bsky.actor.getSuggestions" 6 6 7 7 type params = 8 - { 9 - limit: int option [@default None]; 10 - cursor: string option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {limit: int option [@default None]; cursor: string option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 11 type output = 15 - { 16 - cursor: string option [@default None]; 17 - actors: App_bsky_actor_defs.profile_view list; 18 - rec_id: int option [@key "recId"] [@default None]; 19 - } 20 - [@@deriving yojson {strict= false}] 12 + { cursor: string option [@default None] 13 + ; actors: App_bsky_actor_defs.profile_view list 14 + ; rec_id: int option [@key "recId"] [@default None] } 15 + [@@deriving yojson {strict= false}] 21 16 22 - let call 23 - ?limit 24 - ?cursor 25 - (client : Hermes.client) : output Lwt.t = 17 + let call ?limit ?cursor (client : Hermes.client) : output Lwt.t = 26 18 let params : params = {limit; cursor} in 27 19 Hermes.query client nsid (params_to_yojson params) output_of_yojson 28 20 end 29 -
+26 -21
pegasus/lexicons/app_bsky_actor_profile.ml
··· 8 8 let open Yojson.Safe.Util in 9 9 try 10 10 match json |> member "$type" |> to_string with 11 - | "com.atproto.label.defs#selfLabels" -> 12 - (match Com_atproto_label_defs.self_labels_of_yojson json with 13 - | Ok v -> Ok (SelfLabels v) 14 - | Error e -> Error e) 15 - | _ -> Ok (Unknown json) 11 + | "com.atproto.label.defs#selfLabels" -> ( 12 + match Com_atproto_label_defs.self_labels_of_yojson json with 13 + | Ok v -> 14 + Ok (SelfLabels v) 15 + | Error e -> 16 + Error e ) 17 + | _ -> 18 + Ok (Unknown json) 16 19 with _ -> Error "failed to parse union" 17 20 18 21 let labels_to_yojson = function 19 - | SelfLabels v -> 20 - (match Com_atproto_label_defs.self_labels_to_yojson v with 21 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.label.defs#selfLabels") :: fields) 22 - | other -> other) 23 - | Unknown j -> j 22 + | SelfLabels v -> ( 23 + match Com_atproto_label_defs.self_labels_to_yojson v with 24 + | `Assoc fields -> 25 + `Assoc (("$type", `String "com.atproto.label.defs#selfLabels") :: fields) 26 + | other -> 27 + other ) 28 + | Unknown j -> 29 + j 24 30 25 31 type main = 26 - { 27 - display_name: string option [@key "displayName"] [@default None]; 28 - description: string option [@default None]; 29 - avatar: Hermes.blob option [@default None]; 30 - banner: Hermes.blob option [@default None]; 31 - labels: labels option [@default None]; 32 - joined_via_starter_pack: Com_atproto_repo_strongRef.main option [@key "joinedViaStarterPack"] [@default None]; 33 - pinned_post: Com_atproto_repo_strongRef.main option [@key "pinnedPost"] [@default None]; 34 - created_at: string option [@key "createdAt"] [@default None]; 35 - } 32 + { display_name: string option [@key "displayName"] [@default None] 33 + ; description: string option [@default None] 34 + ; avatar: Hermes.blob option [@default None] 35 + ; banner: Hermes.blob option [@default None] 36 + ; labels: labels option [@default None] 37 + ; joined_via_starter_pack: Com_atproto_repo_strongRef.main option 38 + [@key "joinedViaStarterPack"] [@default None] 39 + ; pinned_post: Com_atproto_repo_strongRef.main option 40 + [@key "pinnedPost"] [@default None] 41 + ; created_at: string option [@key "createdAt"] [@default None] } 36 42 [@@deriving yojson {strict= false}] 37 -
+6 -9
pegasus/lexicons/app_bsky_actor_putPreferences.ml
··· 5 5 let nsid = "app.bsky.actor.putPreferences" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - preferences: App_bsky_actor_defs.preferences; 13 - } 11 + type input = {preferences: App_bsky_actor_defs.preferences} 14 12 [@@deriving yojson {strict= false}] 15 13 16 14 type output = unit 15 + 17 16 let output_of_yojson _ = Ok () 18 17 19 - let call 20 - ~preferences 21 - (client : Hermes.client) : output Lwt.t = 18 + let call ~preferences (client : Hermes.client) : output Lwt.t = 22 19 let params = () in 23 20 let input = Some ({preferences} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 25 23 end 26 -
+9 -19
pegasus/lexicons/app_bsky_actor_searchActors.ml
··· 5 5 let nsid = "app.bsky.actor.searchActors" 6 6 7 7 type params = 8 - { 9 - term: string option [@default None]; 10 - q: string option [@default None]; 11 - limit: int option [@default None]; 12 - cursor: string option [@default None]; 13 - } 14 - [@@deriving yojson {strict= false}] 8 + { term: string option [@default None] 9 + ; q: string option [@default None] 10 + ; limit: int option [@default None] 11 + ; cursor: string option [@default None] } 12 + [@@deriving yojson {strict= false}] 15 13 16 14 type output = 17 - { 18 - cursor: string option [@default None]; 19 - actors: App_bsky_actor_defs.profile_view list; 20 - } 21 - [@@deriving yojson {strict= false}] 15 + { cursor: string option [@default None] 16 + ; actors: App_bsky_actor_defs.profile_view list } 17 + [@@deriving yojson {strict= false}] 22 18 23 - let call 24 - ?term 25 - ?q 26 - ?limit 27 - ?cursor 28 - (client : Hermes.client) : output Lwt.t = 19 + let call ?term ?q ?limit ?cursor (client : Hermes.client) : output Lwt.t = 29 20 let params : params = {term; q; limit; cursor} in 30 21 Hermes.query client nsid (params_to_yojson params) output_of_yojson 31 22 end 32 -
+7 -17
pegasus/lexicons/app_bsky_actor_searchActorsTypeahead.ml
··· 5 5 let nsid = "app.bsky.actor.searchActorsTypeahead" 6 6 7 7 type params = 8 - { 9 - term: string option [@default None]; 10 - q: string option [@default None]; 11 - limit: int option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { term: string option [@default None] 9 + ; q: string option [@default None] 10 + ; limit: int option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 - type output = 16 - { 17 - actors: App_bsky_actor_defs.profile_view_basic list; 18 - } 19 - [@@deriving yojson {strict= false}] 13 + type output = {actors: App_bsky_actor_defs.profile_view_basic list} 14 + [@@deriving yojson {strict= false}] 20 15 21 - let call 22 - ?term 23 - ?q 24 - ?limit 25 - (client : Hermes.client) : output Lwt.t = 16 + let call ?term ?q ?limit (client : Hermes.client) : output Lwt.t = 26 17 let params : params = {term; q; limit} in 27 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 28 19 end 29 -
+20 -17
pegasus/lexicons/app_bsky_actor_status.ml
··· 8 8 let open Yojson.Safe.Util in 9 9 try 10 10 match json |> member "$type" |> to_string with 11 - | "app.bsky.embed.external" -> 12 - (match App_bsky_embed_external.main_of_yojson json with 13 - | Ok v -> Ok (External v) 14 - | Error e -> Error e) 15 - | _ -> Ok (Unknown json) 11 + | "app.bsky.embed.external" -> ( 12 + match App_bsky_embed_external.main_of_yojson json with 13 + | Ok v -> 14 + Ok (External v) 15 + | Error e -> 16 + Error e ) 17 + | _ -> 18 + Ok (Unknown json) 16 19 with _ -> Error "failed to parse union" 17 20 18 21 let embed_to_yojson = function 19 - | External v -> 20 - (match App_bsky_embed_external.main_to_yojson v with 21 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.external") :: fields) 22 - | other -> other) 23 - | Unknown j -> j 22 + | External v -> ( 23 + match App_bsky_embed_external.main_to_yojson v with 24 + | `Assoc fields -> 25 + `Assoc (("$type", `String "app.bsky.embed.external") :: fields) 26 + | other -> 27 + other ) 28 + | Unknown j -> 29 + j 24 30 25 31 type main = 26 - { 27 - status: string; 28 - embed: embed option [@default None]; 29 - duration_minutes: int option [@key "durationMinutes"] [@default None]; 30 - created_at: string [@key "createdAt"]; 31 - } 32 + { status: string 33 + ; embed: embed option [@default None] 34 + ; duration_minutes: int option [@key "durationMinutes"] [@default None] 35 + ; created_at: string [@key "createdAt"] } 32 36 [@@deriving yojson {strict= false}] 33 37 34 38 (** Advertises an account as currently offering live content. *) 35 39 let live = "app.bsky.actor.status#live" 36 -
+1 -6
pegasus/lexicons/app_bsky_embed_defs.ml
··· 1 1 (* generated from app.bsky.embed.defs *) 2 2 3 - type aspect_ratio = 4 - { 5 - width: int; 6 - height: int; 7 - } 3 + type aspect_ratio = {width: int; height: int} 8 4 [@@deriving yojson {strict= false}] 9 -
+10 -21
pegasus/lexicons/app_bsky_embed_external.ml
··· 1 1 (* generated from app.bsky.embed.external *) 2 2 3 3 type external_ = 4 - { 5 - uri: string; 6 - title: string; 7 - description: string; 8 - thumb: Hermes.blob option [@default None]; 9 - } 4 + { uri: string 5 + ; title: string 6 + ; description: string 7 + ; thumb: Hermes.blob option [@default None] } 10 8 [@@deriving yojson {strict= false}] 11 9 12 - type main = 13 - { 14 - external_: external_ [@key "external"]; 15 - } 10 + type main = {external_: external_ [@key "external"]} 16 11 [@@deriving yojson {strict= false}] 17 12 18 13 type view_external = 19 - { 20 - uri: string; 21 - title: string; 22 - description: string; 23 - thumb: string option [@default None]; 24 - } 14 + { uri: string 15 + ; title: string 16 + ; description: string 17 + ; thumb: string option [@default None] } 25 18 [@@deriving yojson {strict= false}] 26 19 27 - type view = 28 - { 29 - external_: view_external [@key "external"]; 30 - } 20 + type view = {external_: view_external [@key "external"]} 31 21 [@@deriving yojson {strict= false}] 32 -
+11 -22
pegasus/lexicons/app_bsky_embed_images.ml
··· 1 1 (* generated from app.bsky.embed.images *) 2 2 3 3 type image = 4 - { 5 - image: Hermes.blob; 6 - alt: string; 7 - aspect_ratio: App_bsky_embed_defs.aspect_ratio option [@key "aspectRatio"] [@default None]; 8 - } 4 + { image: Hermes.blob 5 + ; alt: string 6 + ; aspect_ratio: App_bsky_embed_defs.aspect_ratio option 7 + [@key "aspectRatio"] [@default None] } 9 8 [@@deriving yojson {strict= false}] 10 9 11 - type main = 12 - { 13 - images: image list; 14 - } 15 - [@@deriving yojson {strict= false}] 10 + type main = {images: image list} [@@deriving yojson {strict= false}] 16 11 17 12 type view_image = 18 - { 19 - thumb: string; 20 - fullsize: string; 21 - alt: string; 22 - aspect_ratio: App_bsky_embed_defs.aspect_ratio option [@key "aspectRatio"] [@default None]; 23 - } 24 - [@@deriving yojson {strict= false}] 25 - 26 - type view = 27 - { 28 - images: view_image list; 29 - } 13 + { thumb: string 14 + ; fullsize: string 15 + ; alt: string 16 + ; aspect_ratio: App_bsky_embed_defs.aspect_ratio option 17 + [@key "aspectRatio"] [@default None] } 30 18 [@@deriving yojson {strict= false}] 31 19 20 + type view = {images: view_image list} [@@deriving yojson {strict= false}]
+12 -1
pegasus/lexicons/app_bsky_embed_record.ml
··· 1 1 (* re-exported from App_bsky_shared_1 *) 2 2 3 3 type main = App_bsky_shared_1.record_main 4 + 4 5 let main_of_yojson = App_bsky_shared_1.record_main_of_yojson 6 + 5 7 let main_to_yojson = App_bsky_shared_1.record_main_to_yojson 6 8 7 9 type view = App_bsky_shared_1.record_view 10 + 8 11 let view_of_yojson = App_bsky_shared_1.record_view_of_yojson 12 + 9 13 let view_to_yojson = App_bsky_shared_1.record_view_to_yojson 10 14 11 15 type view_record = App_bsky_shared_1.view_record 16 + 12 17 let view_record_of_yojson = App_bsky_shared_1.view_record_of_yojson 18 + 13 19 let view_record_to_yojson = App_bsky_shared_1.view_record_to_yojson 14 20 15 21 type view_not_found = App_bsky_shared_1.view_not_found 22 + 16 23 let view_not_found_of_yojson = App_bsky_shared_1.view_not_found_of_yojson 24 + 17 25 let view_not_found_to_yojson = App_bsky_shared_1.view_not_found_to_yojson 18 26 19 27 type view_blocked = App_bsky_shared_1.view_blocked 28 + 20 29 let view_blocked_of_yojson = App_bsky_shared_1.view_blocked_of_yojson 30 + 21 31 let view_blocked_to_yojson = App_bsky_shared_1.view_blocked_to_yojson 22 32 23 33 type view_detached = App_bsky_shared_1.view_detached 34 + 24 35 let view_detached_of_yojson = App_bsky_shared_1.view_detached_of_yojson 36 + 25 37 let view_detached_to_yojson = App_bsky_shared_1.view_detached_to_yojson 26 -
+4 -1
pegasus/lexicons/app_bsky_embed_recordWithMedia.ml
··· 1 1 (* re-exported from App_bsky_shared_1 *) 2 2 3 3 type main = App_bsky_shared_1.record_with_media_main 4 + 4 5 let main_of_yojson = App_bsky_shared_1.record_with_media_main_of_yojson 6 + 5 7 let main_to_yojson = App_bsky_shared_1.record_with_media_main_to_yojson 6 8 7 9 type view = App_bsky_shared_1.record_with_media_view 10 + 8 11 let view_of_yojson = App_bsky_shared_1.record_with_media_view_of_yojson 9 - let view_to_yojson = App_bsky_shared_1.record_with_media_view_to_yojson 10 12 13 + let view_to_yojson = App_bsky_shared_1.record_with_media_view_to_yojson
+12 -19
pegasus/lexicons/app_bsky_embed_video.ml
··· 1 1 (* generated from app.bsky.embed.video *) 2 2 3 - type caption = 4 - { 5 - lang: string; 6 - file: Hermes.blob; 7 - } 3 + type caption = {lang: string; file: Hermes.blob} 8 4 [@@deriving yojson {strict= false}] 9 5 10 6 type main = 11 - { 12 - video: Hermes.blob; 13 - captions: caption list option [@default None]; 14 - alt: string option [@default None]; 15 - aspect_ratio: App_bsky_embed_defs.aspect_ratio option [@key "aspectRatio"] [@default None]; 16 - } 7 + { video: Hermes.blob 8 + ; captions: caption list option [@default None] 9 + ; alt: string option [@default None] 10 + ; aspect_ratio: App_bsky_embed_defs.aspect_ratio option 11 + [@key "aspectRatio"] [@default None] } 17 12 [@@deriving yojson {strict= false}] 18 13 19 14 type view = 20 - { 21 - cid: string; 22 - playlist: string; 23 - thumbnail: string option [@default None]; 24 - alt: string option [@default None]; 25 - aspect_ratio: App_bsky_embed_defs.aspect_ratio option [@key "aspectRatio"] [@default None]; 26 - } 15 + { cid: string 16 + ; playlist: string 17 + ; thumbnail: string option [@default None] 18 + ; alt: string option [@default None] 19 + ; aspect_ratio: App_bsky_embed_defs.aspect_ratio option 20 + [@key "aspectRatio"] [@default None] } 27 21 [@@deriving yojson {strict= false}] 28 -
+52 -9
pegasus/lexicons/app_bsky_feed_defs.ml
··· 1 1 (* re-exported from App_bsky_shared_1 *) 2 2 3 3 type post_view = App_bsky_shared_1.post_view 4 + 4 5 let post_view_of_yojson = App_bsky_shared_1.post_view_of_yojson 6 + 5 7 let post_view_to_yojson = App_bsky_shared_1.post_view_to_yojson 6 8 7 9 type viewer_state = App_bsky_shared_1.feed_viewer_state 10 + 8 11 let viewer_state_of_yojson = App_bsky_shared_1.feed_viewer_state_of_yojson 12 + 9 13 let viewer_state_to_yojson = App_bsky_shared_1.feed_viewer_state_to_yojson 10 14 11 15 type thread_context = App_bsky_shared_1.thread_context 16 + 12 17 let thread_context_of_yojson = App_bsky_shared_1.thread_context_of_yojson 18 + 13 19 let thread_context_to_yojson = App_bsky_shared_1.thread_context_to_yojson 14 20 15 21 type feed_view_post = App_bsky_shared_1.feed_view_post 22 + 16 23 let feed_view_post_of_yojson = App_bsky_shared_1.feed_view_post_of_yojson 24 + 17 25 let feed_view_post_to_yojson = App_bsky_shared_1.feed_view_post_to_yojson 18 26 19 27 type reply_ref = App_bsky_shared_1.reply_ref 28 + 20 29 let reply_ref_of_yojson = App_bsky_shared_1.reply_ref_of_yojson 30 + 21 31 let reply_ref_to_yojson = App_bsky_shared_1.reply_ref_to_yojson 22 32 23 33 type reason_repost = App_bsky_shared_1.reason_repost 34 + 24 35 let reason_repost_of_yojson = App_bsky_shared_1.reason_repost_of_yojson 36 + 25 37 let reason_repost_to_yojson = App_bsky_shared_1.reason_repost_to_yojson 26 38 27 39 type reason_pin = App_bsky_shared_1.reason_pin 40 + 28 41 let reason_pin_of_yojson = App_bsky_shared_1.reason_pin_of_yojson 42 + 29 43 let reason_pin_to_yojson = App_bsky_shared_1.reason_pin_to_yojson 30 44 31 45 type thread_view_post = App_bsky_shared_1.thread_view_post 46 + 32 47 let thread_view_post_of_yojson = App_bsky_shared_1.thread_view_post_of_yojson 48 + 33 49 let thread_view_post_to_yojson = App_bsky_shared_1.thread_view_post_to_yojson 34 50 35 51 type not_found_post = App_bsky_shared_1.not_found_post 52 + 36 53 let not_found_post_of_yojson = App_bsky_shared_1.not_found_post_of_yojson 54 + 37 55 let not_found_post_to_yojson = App_bsky_shared_1.not_found_post_to_yojson 38 56 39 57 type blocked_post = App_bsky_shared_1.blocked_post 58 + 40 59 let blocked_post_of_yojson = App_bsky_shared_1.blocked_post_of_yojson 60 + 41 61 let blocked_post_to_yojson = App_bsky_shared_1.blocked_post_to_yojson 42 62 43 63 type blocked_author = App_bsky_shared_1.blocked_author 64 + 44 65 let blocked_author_of_yojson = App_bsky_shared_1.blocked_author_of_yojson 66 + 45 67 let blocked_author_to_yojson = App_bsky_shared_1.blocked_author_to_yojson 46 68 47 69 type generator_view = App_bsky_shared_1.generator_view 70 + 48 71 let generator_view_of_yojson = App_bsky_shared_1.generator_view_of_yojson 72 + 49 73 let generator_view_to_yojson = App_bsky_shared_1.generator_view_to_yojson 50 74 51 75 type generator_viewer_state = App_bsky_shared_1.generator_viewer_state 52 - let generator_viewer_state_of_yojson = App_bsky_shared_1.generator_viewer_state_of_yojson 53 - let generator_viewer_state_to_yojson = App_bsky_shared_1.generator_viewer_state_to_yojson 76 + 77 + let generator_viewer_state_of_yojson = 78 + App_bsky_shared_1.generator_viewer_state_of_yojson 79 + 80 + let generator_viewer_state_to_yojson = 81 + App_bsky_shared_1.generator_viewer_state_to_yojson 54 82 55 83 type skeleton_feed_post = App_bsky_shared_1.skeleton_feed_post 56 - let skeleton_feed_post_of_yojson = App_bsky_shared_1.skeleton_feed_post_of_yojson 57 - let skeleton_feed_post_to_yojson = App_bsky_shared_1.skeleton_feed_post_to_yojson 84 + 85 + let skeleton_feed_post_of_yojson = 86 + App_bsky_shared_1.skeleton_feed_post_of_yojson 87 + 88 + let skeleton_feed_post_to_yojson = 89 + App_bsky_shared_1.skeleton_feed_post_to_yojson 58 90 59 91 type skeleton_reason_repost = App_bsky_shared_1.skeleton_reason_repost 60 - let skeleton_reason_repost_of_yojson = App_bsky_shared_1.skeleton_reason_repost_of_yojson 61 - let skeleton_reason_repost_to_yojson = App_bsky_shared_1.skeleton_reason_repost_to_yojson 92 + 93 + let skeleton_reason_repost_of_yojson = 94 + App_bsky_shared_1.skeleton_reason_repost_of_yojson 95 + 96 + let skeleton_reason_repost_to_yojson = 97 + App_bsky_shared_1.skeleton_reason_repost_to_yojson 62 98 63 99 type skeleton_reason_pin = App_bsky_shared_1.skeleton_reason_pin 64 - let skeleton_reason_pin_of_yojson = App_bsky_shared_1.skeleton_reason_pin_of_yojson 65 - let skeleton_reason_pin_to_yojson = App_bsky_shared_1.skeleton_reason_pin_to_yojson 100 + 101 + let skeleton_reason_pin_of_yojson = 102 + App_bsky_shared_1.skeleton_reason_pin_of_yojson 103 + 104 + let skeleton_reason_pin_to_yojson = 105 + App_bsky_shared_1.skeleton_reason_pin_to_yojson 66 106 67 107 type threadgate_view = App_bsky_shared_1.threadgate_view 108 + 68 109 let threadgate_view_of_yojson = App_bsky_shared_1.threadgate_view_of_yojson 110 + 69 111 let threadgate_view_to_yojson = App_bsky_shared_1.threadgate_view_to_yojson 70 112 71 113 type interaction = App_bsky_shared_1.interaction 114 + 72 115 let interaction_of_yojson = App_bsky_shared_1.interaction_of_yojson 116 + 73 117 let interaction_to_yojson = App_bsky_shared_1.interaction_to_yojson 74 118 75 119 let request_less = App_bsky_shared_1.request_less ··· 99 143 let interaction_quote = App_bsky_shared_1.interaction_quote 100 144 101 145 let interaction_share = App_bsky_shared_1.interaction_share 102 -
+7 -18
pegasus/lexicons/app_bsky_feed_describeFeedGenerator.ml
··· 1 1 (* generated from app.bsky.feed.describeFeedGenerator *) 2 2 3 3 type links = 4 - { 5 - privacy_policy: string option [@key "privacyPolicy"] [@default None]; 6 - terms_of_service: string option [@key "termsOfService"] [@default None]; 7 - } 4 + { privacy_policy: string option [@key "privacyPolicy"] [@default None] 5 + ; terms_of_service: string option [@key "termsOfService"] [@default None] } 8 6 [@@deriving yojson {strict= false}] 9 7 10 - type feed = 11 - { 12 - uri: string; 13 - } 14 - [@@deriving yojson {strict= false}] 8 + type feed = {uri: string} [@@deriving yojson {strict= false}] 15 9 16 10 (** Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View). *) 17 11 module Main = struct 18 12 let nsid = "app.bsky.feed.describeFeedGenerator" 19 13 20 14 type params = unit 15 + 21 16 let params_to_yojson () = `Assoc [] 22 17 23 18 type output = 24 - { 25 - did: string; 26 - feeds: feed list; 27 - links: links option [@default None]; 28 - } 29 - [@@deriving yojson {strict= false}] 19 + {did: string; feeds: feed list; links: links option [@default None]} 20 + [@@deriving yojson {strict= false}] 30 21 31 - let call 32 - (client : Hermes.client) : output Lwt.t = 22 + let call (client : Hermes.client) : output Lwt.t = 33 23 Hermes.query client nsid (`Assoc []) output_of_yojson 34 24 end 35 -
+27 -22
pegasus/lexicons/app_bsky_feed_generator.ml
··· 8 8 let open Yojson.Safe.Util in 9 9 try 10 10 match json |> member "$type" |> to_string with 11 - | "com.atproto.label.defs#selfLabels" -> 12 - (match Com_atproto_label_defs.self_labels_of_yojson json with 13 - | Ok v -> Ok (SelfLabels v) 14 - | Error e -> Error e) 15 - | _ -> Ok (Unknown json) 11 + | "com.atproto.label.defs#selfLabels" -> ( 12 + match Com_atproto_label_defs.self_labels_of_yojson json with 13 + | Ok v -> 14 + Ok (SelfLabels v) 15 + | Error e -> 16 + Error e ) 17 + | _ -> 18 + Ok (Unknown json) 16 19 with _ -> Error "failed to parse union" 17 20 18 21 let labels_to_yojson = function 19 - | SelfLabels v -> 20 - (match Com_atproto_label_defs.self_labels_to_yojson v with 21 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.label.defs#selfLabels") :: fields) 22 - | other -> other) 23 - | Unknown j -> j 22 + | SelfLabels v -> ( 23 + match Com_atproto_label_defs.self_labels_to_yojson v with 24 + | `Assoc fields -> 25 + `Assoc (("$type", `String "com.atproto.label.defs#selfLabels") :: fields) 26 + | other -> 27 + other ) 28 + | Unknown j -> 29 + j 24 30 25 31 type main = 26 - { 27 - did: string; 28 - display_name: string [@key "displayName"]; 29 - description: string option [@default None]; 30 - description_facets: App_bsky_richtext_facet.main list option [@key "descriptionFacets"] [@default None]; 31 - avatar: Hermes.blob option [@default None]; 32 - accepts_interactions: bool option [@key "acceptsInteractions"] [@default None]; 33 - labels: labels option [@default None]; 34 - content_mode: string option [@key "contentMode"] [@default None]; 35 - created_at: string [@key "createdAt"]; 36 - } 32 + { did: string 33 + ; display_name: string [@key "displayName"] 34 + ; description: string option [@default None] 35 + ; description_facets: App_bsky_richtext_facet.main list option 36 + [@key "descriptionFacets"] [@default None] 37 + ; avatar: Hermes.blob option [@default None] 38 + ; accepts_interactions: bool option 39 + [@key "acceptsInteractions"] [@default None] 40 + ; labels: labels option [@default None] 41 + ; content_mode: string option [@key "contentMode"] [@default None] 42 + ; created_at: string [@key "createdAt"] } 37 43 [@@deriving yojson {strict= false}] 38 -
+8 -17
pegasus/lexicons/app_bsky_feed_getActorFeeds.ml
··· 5 5 let nsid = "app.bsky.feed.getActorFeeds" 6 6 7 7 type params = 8 - { 9 - actor: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { actor: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - feeds: App_bsky_feed_defs.generator_view list; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; feeds: App_bsky_feed_defs.generator_view list } 16 + [@@deriving yojson {strict= false}] 21 17 22 - let call 23 - ~actor 24 - ?limit 25 - ?cursor 26 - (client : Hermes.client) : output Lwt.t = 18 + let call ~actor ?limit ?cursor (client : Hermes.client) : output Lwt.t = 27 19 let params : params = {actor; limit; cursor} in 28 20 Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 21 end 30 -
+8 -17
pegasus/lexicons/app_bsky_feed_getActorLikes.ml
··· 5 5 let nsid = "app.bsky.feed.getActorLikes" 6 6 7 7 type params = 8 - { 9 - actor: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { actor: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - feed: App_bsky_feed_defs.feed_view_post list; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; feed: App_bsky_feed_defs.feed_view_post list } 16 + [@@deriving yojson {strict= false}] 21 17 22 - let call 23 - ~actor 24 - ?limit 25 - ?cursor 26 - (client : Hermes.client) : output Lwt.t = 18 + let call ~actor ?limit ?cursor (client : Hermes.client) : output Lwt.t = 27 19 let params : params = {actor; limit; cursor} in 28 20 Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 21 end 30 -
+11 -21
pegasus/lexicons/app_bsky_feed_getAuthorFeed.ml
··· 5 5 let nsid = "app.bsky.feed.getAuthorFeed" 6 6 7 7 type params = 8 - { 9 - actor: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - filter: string option [@default None]; 13 - include_pins: bool option [@key "includePins"] [@default None]; 14 - } 15 - [@@deriving yojson {strict= false}] 8 + { actor: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] 11 + ; filter: string option [@default None] 12 + ; include_pins: bool option [@key "includePins"] [@default None] } 13 + [@@deriving yojson {strict= false}] 16 14 17 15 type output = 18 - { 19 - cursor: string option [@default None]; 20 - feed: App_bsky_feed_defs.feed_view_post list; 21 - } 22 - [@@deriving yojson {strict= false}] 16 + { cursor: string option [@default None] 17 + ; feed: App_bsky_feed_defs.feed_view_post list } 18 + [@@deriving yojson {strict= false}] 23 19 24 - let call 25 - ~actor 26 - ?limit 27 - ?cursor 28 - ?filter 29 - ?include_pins 30 - (client : Hermes.client) : output Lwt.t = 20 + let call ~actor ?limit ?cursor ?filter ?include_pins (client : Hermes.client) 21 + : output Lwt.t = 31 22 let params : params = {actor; limit; cursor; filter; include_pins} in 32 23 Hermes.query client nsid (params_to_yojson params) output_of_yojson 33 24 end 34 -
+8 -17
pegasus/lexicons/app_bsky_feed_getFeed.ml
··· 5 5 let nsid = "app.bsky.feed.getFeed" 6 6 7 7 type params = 8 - { 9 - feed: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { feed: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - feed: App_bsky_feed_defs.feed_view_post list; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; feed: App_bsky_feed_defs.feed_view_post list } 16 + [@@deriving yojson {strict= false}] 21 17 22 - let call 23 - ~feed 24 - ?limit 25 - ?cursor 26 - (client : Hermes.client) : output Lwt.t = 18 + let call ~feed ?limit ?cursor (client : Hermes.client) : output Lwt.t = 27 19 let params : params = {feed; limit; cursor} in 28 20 Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 21 end 30 -
+6 -15
pegasus/lexicons/app_bsky_feed_getFeedGenerator.ml
··· 4 4 module Main = struct 5 5 let nsid = "app.bsky.feed.getFeedGenerator" 6 6 7 - type params = 8 - { 9 - feed: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {feed: string} [@@deriving yojson {strict= false}] 12 8 13 9 type output = 14 - { 15 - view: App_bsky_feed_defs.generator_view; 16 - is_online: bool [@key "isOnline"]; 17 - is_valid: bool [@key "isValid"]; 18 - } 19 - [@@deriving yojson {strict= false}] 10 + { view: App_bsky_feed_defs.generator_view 11 + ; is_online: bool [@key "isOnline"] 12 + ; is_valid: bool [@key "isValid"] } 13 + [@@deriving yojson {strict= false}] 20 14 21 - let call 22 - ~feed 23 - (client : Hermes.client) : output Lwt.t = 15 + let call ~feed (client : Hermes.client) : output Lwt.t = 24 16 let params : params = {feed} in 25 17 Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 18 end 27 -
+7 -13
pegasus/lexicons/app_bsky_feed_getFeedGenerators.ml
··· 5 5 let nsid = "app.bsky.feed.getFeedGenerators" 6 6 7 7 type params = 8 - { 9 - feeds: string list [@of_yojson Hermes_util.query_string_list_of_yojson] [@to_yojson Hermes_util.query_string_list_to_yojson]; 10 - } 11 - [@@deriving yojson {strict= false}] 8 + { feeds: string list 9 + [@of_yojson Hermes_util.query_string_list_of_yojson] 10 + [@to_yojson Hermes_util.query_string_list_to_yojson] } 11 + [@@deriving yojson {strict= false}] 12 12 13 - type output = 14 - { 15 - feeds: App_bsky_feed_defs.generator_view list; 16 - } 17 - [@@deriving yojson {strict= false}] 13 + type output = {feeds: App_bsky_feed_defs.generator_view list} 14 + [@@deriving yojson {strict= false}] 18 15 19 - let call 20 - ~feeds 21 - (client : Hermes.client) : output Lwt.t = 16 + let call ~feeds (client : Hermes.client) : output Lwt.t = 22 17 let params : params = {feeds} in 23 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 19 end 25 -
+9 -18
pegasus/lexicons/app_bsky_feed_getFeedSkeleton.ml
··· 5 5 let nsid = "app.bsky.feed.getFeedSkeleton" 6 6 7 7 type params = 8 - { 9 - feed: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { feed: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - feed: App_bsky_feed_defs.skeleton_feed_post list; 19 - req_id: string option [@key "reqId"] [@default None]; 20 - } 21 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; feed: App_bsky_feed_defs.skeleton_feed_post list 16 + ; req_id: string option [@key "reqId"] [@default None] } 17 + [@@deriving yojson {strict= false}] 22 18 23 - let call 24 - ~feed 25 - ?limit 26 - ?cursor 27 - (client : Hermes.client) : output Lwt.t = 19 + let call ~feed ?limit ?cursor (client : Hermes.client) : output Lwt.t = 28 20 let params : params = {feed; limit; cursor} in 29 21 Hermes.query client nsid (params_to_yojson params) output_of_yojson 30 22 end 31 -
+14 -26
pegasus/lexicons/app_bsky_feed_getLikes.ml
··· 1 1 (* generated from app.bsky.feed.getLikes *) 2 2 3 3 type like = 4 - { 5 - indexed_at: string [@key "indexedAt"]; 6 - created_at: string [@key "createdAt"]; 7 - actor: App_bsky_actor_defs.profile_view; 8 - } 4 + { indexed_at: string [@key "indexedAt"] 5 + ; created_at: string [@key "createdAt"] 6 + ; actor: App_bsky_actor_defs.profile_view } 9 7 [@@deriving yojson {strict= false}] 10 8 11 9 (** Get like records which reference a subject (by AT-URI and CID). *) ··· 13 11 let nsid = "app.bsky.feed.getLikes" 14 12 15 13 type params = 16 - { 17 - uri: string; 18 - cid: string option [@default None]; 19 - limit: int option [@default None]; 20 - cursor: string option [@default None]; 21 - } 22 - [@@deriving yojson {strict= false}] 14 + { uri: string 15 + ; cid: string option [@default None] 16 + ; limit: int option [@default None] 17 + ; cursor: string option [@default None] } 18 + [@@deriving yojson {strict= false}] 23 19 24 20 type output = 25 - { 26 - uri: string; 27 - cid: string option [@default None]; 28 - cursor: string option [@default None]; 29 - likes: like list; 30 - } 31 - [@@deriving yojson {strict= false}] 21 + { uri: string 22 + ; cid: string option [@default None] 23 + ; cursor: string option [@default None] 24 + ; likes: like list } 25 + [@@deriving yojson {strict= false}] 32 26 33 - let call 34 - ~uri 35 - ?cid 36 - ?limit 37 - ?cursor 38 - (client : Hermes.client) : output Lwt.t = 27 + let call ~uri ?cid ?limit ?cursor (client : Hermes.client) : output Lwt.t = 39 28 let params : params = {uri; cid; limit; cursor} in 40 29 Hermes.query client nsid (params_to_yojson params) output_of_yojson 41 30 end 42 -
+8 -17
pegasus/lexicons/app_bsky_feed_getListFeed.ml
··· 5 5 let nsid = "app.bsky.feed.getListFeed" 6 6 7 7 type params = 8 - { 9 - list_: string [@key "list"]; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { list_: string [@key "list"] 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - feed: App_bsky_feed_defs.feed_view_post list; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; feed: App_bsky_feed_defs.feed_view_post list } 16 + [@@deriving yojson {strict= false}] 21 17 22 - let call 23 - ~list_ 24 - ?limit 25 - ?cursor 26 - (client : Hermes.client) : output Lwt.t = 18 + let call ~list_ ?limit ?cursor (client : Hermes.client) : output Lwt.t = 27 19 let params : params = {list_; limit; cursor} in 28 20 Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 21 end 30 -
+60 -54
pegasus/lexicons/app_bsky_feed_getPostThread.ml
··· 5 5 let nsid = "app.bsky.feed.getPostThread" 6 6 7 7 type params = 8 - { 9 - uri: string; 10 - depth: int option [@default None]; 11 - parent_height: int option [@key "parentHeight"] [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { uri: string 9 + ; depth: int option [@default None] 10 + ; parent_height: int option [@key "parentHeight"] [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type thread = 16 - | ThreadViewPost of App_bsky_feed_defs.thread_view_post 17 - | NotFoundPost of App_bsky_feed_defs.not_found_post 18 - | BlockedPost of App_bsky_feed_defs.blocked_post 19 - | Unknown of Yojson.Safe.t 14 + | ThreadViewPost of App_bsky_feed_defs.thread_view_post 15 + | NotFoundPost of App_bsky_feed_defs.not_found_post 16 + | BlockedPost of App_bsky_feed_defs.blocked_post 17 + | Unknown of Yojson.Safe.t 20 18 21 - let thread_of_yojson json = 22 - let open Yojson.Safe.Util in 23 - try 24 - match json |> member "$type" |> to_string with 25 - | "app.bsky.feed.defs#threadViewPost" -> 26 - (match App_bsky_feed_defs.thread_view_post_of_yojson json with 27 - | Ok v -> Ok (ThreadViewPost v) 28 - | Error e -> Error e) 29 - | "app.bsky.feed.defs#notFoundPost" -> 30 - (match App_bsky_feed_defs.not_found_post_of_yojson json with 31 - | Ok v -> Ok (NotFoundPost v) 32 - | Error e -> Error e) 33 - | "app.bsky.feed.defs#blockedPost" -> 34 - (match App_bsky_feed_defs.blocked_post_of_yojson json with 35 - | Ok v -> Ok (BlockedPost v) 36 - | Error e -> Error e) 37 - | _ -> Ok (Unknown json) 38 - with _ -> Error "failed to parse union" 19 + let thread_of_yojson json = 20 + let open Yojson.Safe.Util in 21 + try 22 + match json |> member "$type" |> to_string with 23 + | "app.bsky.feed.defs#threadViewPost" -> ( 24 + match App_bsky_feed_defs.thread_view_post_of_yojson json with 25 + | Ok v -> 26 + Ok (ThreadViewPost v) 27 + | Error e -> 28 + Error e ) 29 + | "app.bsky.feed.defs#notFoundPost" -> ( 30 + match App_bsky_feed_defs.not_found_post_of_yojson json with 31 + | Ok v -> 32 + Ok (NotFoundPost v) 33 + | Error e -> 34 + Error e ) 35 + | "app.bsky.feed.defs#blockedPost" -> ( 36 + match App_bsky_feed_defs.blocked_post_of_yojson json with 37 + | Ok v -> 38 + Ok (BlockedPost v) 39 + | Error e -> 40 + Error e ) 41 + | _ -> 42 + Ok (Unknown json) 43 + with _ -> Error "failed to parse union" 39 44 40 - let thread_to_yojson = function 41 - | ThreadViewPost v -> 42 - (match App_bsky_feed_defs.thread_view_post_to_yojson v with 43 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#threadViewPost") :: fields) 44 - | other -> other) 45 - | NotFoundPost v -> 46 - (match App_bsky_feed_defs.not_found_post_to_yojson v with 47 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 48 - | other -> other) 49 - | BlockedPost v -> 50 - (match App_bsky_feed_defs.blocked_post_to_yojson v with 51 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 52 - | other -> other) 53 - | Unknown j -> j 45 + let thread_to_yojson = function 46 + | ThreadViewPost v -> ( 47 + match App_bsky_feed_defs.thread_view_post_to_yojson v with 48 + | `Assoc fields -> 49 + `Assoc 50 + (("$type", `String "app.bsky.feed.defs#threadViewPost") :: fields) 51 + | other -> 52 + other ) 53 + | NotFoundPost v -> ( 54 + match App_bsky_feed_defs.not_found_post_to_yojson v with 55 + | `Assoc fields -> 56 + `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 57 + | other -> 58 + other ) 59 + | BlockedPost v -> ( 60 + match App_bsky_feed_defs.blocked_post_to_yojson v with 61 + | `Assoc fields -> 62 + `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 63 + | other -> 64 + other ) 65 + | Unknown j -> 66 + j 54 67 55 - type output = 56 - { 57 - thread: thread; 58 - threadgate: App_bsky_feed_defs.threadgate_view option [@default None]; 59 - } 60 - [@@deriving yojson {strict= false}] 68 + type output = 69 + { thread: thread 70 + ; threadgate: App_bsky_feed_defs.threadgate_view option [@default None] } 71 + [@@deriving yojson {strict= false}] 61 72 62 - let call 63 - ~uri 64 - ?depth 65 - ?parent_height 66 - (client : Hermes.client) : output Lwt.t = 73 + let call ~uri ?depth ?parent_height (client : Hermes.client) : output Lwt.t = 67 74 let params : params = {uri; depth; parent_height} in 68 75 Hermes.query client nsid (params_to_yojson params) output_of_yojson 69 76 end 70 -
+7 -13
pegasus/lexicons/app_bsky_feed_getPosts.ml
··· 5 5 let nsid = "app.bsky.feed.getPosts" 6 6 7 7 type params = 8 - { 9 - uris: string list [@of_yojson Hermes_util.query_string_list_of_yojson] [@to_yojson Hermes_util.query_string_list_to_yojson]; 10 - } 11 - [@@deriving yojson {strict= false}] 8 + { uris: string list 9 + [@of_yojson Hermes_util.query_string_list_of_yojson] 10 + [@to_yojson Hermes_util.query_string_list_to_yojson] } 11 + [@@deriving yojson {strict= false}] 12 12 13 - type output = 14 - { 15 - posts: App_bsky_feed_defs.post_view list; 16 - } 17 - [@@deriving yojson {strict= false}] 13 + type output = {posts: App_bsky_feed_defs.post_view list} 14 + [@@deriving yojson {strict= false}] 18 15 19 - let call 20 - ~uris 21 - (client : Hermes.client) : output Lwt.t = 16 + let call ~uris (client : Hermes.client) : output Lwt.t = 22 17 let params : params = {uris} in 23 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 19 end 25 -
+11 -21
pegasus/lexicons/app_bsky_feed_getQuotes.ml
··· 5 5 let nsid = "app.bsky.feed.getQuotes" 6 6 7 7 type params = 8 - { 9 - uri: string; 10 - cid: string option [@default None]; 11 - limit: int option [@default None]; 12 - cursor: string option [@default None]; 13 - } 14 - [@@deriving yojson {strict= false}] 8 + { uri: string 9 + ; cid: string option [@default None] 10 + ; limit: int option [@default None] 11 + ; cursor: string option [@default None] } 12 + [@@deriving yojson {strict= false}] 15 13 16 14 type output = 17 - { 18 - uri: string; 19 - cid: string option [@default None]; 20 - cursor: string option [@default None]; 21 - posts: App_bsky_feed_defs.post_view list; 22 - } 23 - [@@deriving yojson {strict= false}] 15 + { uri: string 16 + ; cid: string option [@default None] 17 + ; cursor: string option [@default None] 18 + ; posts: App_bsky_feed_defs.post_view list } 19 + [@@deriving yojson {strict= false}] 24 20 25 - let call 26 - ~uri 27 - ?cid 28 - ?limit 29 - ?cursor 30 - (client : Hermes.client) : output Lwt.t = 21 + let call ~uri ?cid ?limit ?cursor (client : Hermes.client) : output Lwt.t = 31 22 let params : params = {uri; cid; limit; cursor} in 32 23 Hermes.query client nsid (params_to_yojson params) output_of_yojson 33 24 end 34 -
+11 -21
pegasus/lexicons/app_bsky_feed_getRepostedBy.ml
··· 5 5 let nsid = "app.bsky.feed.getRepostedBy" 6 6 7 7 type params = 8 - { 9 - uri: string; 10 - cid: string option [@default None]; 11 - limit: int option [@default None]; 12 - cursor: string option [@default None]; 13 - } 14 - [@@deriving yojson {strict= false}] 8 + { uri: string 9 + ; cid: string option [@default None] 10 + ; limit: int option [@default None] 11 + ; cursor: string option [@default None] } 12 + [@@deriving yojson {strict= false}] 15 13 16 14 type output = 17 - { 18 - uri: string; 19 - cid: string option [@default None]; 20 - cursor: string option [@default None]; 21 - reposted_by: App_bsky_actor_defs.profile_view list [@key "repostedBy"]; 22 - } 23 - [@@deriving yojson {strict= false}] 15 + { uri: string 16 + ; cid: string option [@default None] 17 + ; cursor: string option [@default None] 18 + ; reposted_by: App_bsky_actor_defs.profile_view list [@key "repostedBy"] } 19 + [@@deriving yojson {strict= false}] 24 20 25 - let call 26 - ~uri 27 - ?cid 28 - ?limit 29 - ?cursor 30 - (client : Hermes.client) : output Lwt.t = 21 + let call ~uri ?cid ?limit ?cursor (client : Hermes.client) : output Lwt.t = 31 22 let params : params = {uri; cid; limit; cursor} in 32 23 Hermes.query client nsid (params_to_yojson params) output_of_yojson 33 24 end 34 -
+6 -15
pegasus/lexicons/app_bsky_feed_getSuggestedFeeds.ml
··· 5 5 let nsid = "app.bsky.feed.getSuggestedFeeds" 6 6 7 7 type params = 8 - { 9 - limit: int option [@default None]; 10 - cursor: string option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {limit: int option [@default None]; cursor: string option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 11 type output = 15 - { 16 - cursor: string option [@default None]; 17 - feeds: App_bsky_feed_defs.generator_view list; 18 - } 19 - [@@deriving yojson {strict= false}] 12 + { cursor: string option [@default None] 13 + ; feeds: App_bsky_feed_defs.generator_view list } 14 + [@@deriving yojson {strict= false}] 20 15 21 - let call 22 - ?limit 23 - ?cursor 24 - (client : Hermes.client) : output Lwt.t = 16 + let call ?limit ?cursor (client : Hermes.client) : output Lwt.t = 25 17 let params : params = {limit; cursor} in 26 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 19 end 28 -
+8 -17
pegasus/lexicons/app_bsky_feed_getTimeline.ml
··· 5 5 let nsid = "app.bsky.feed.getTimeline" 6 6 7 7 type params = 8 - { 9 - algorithm: string option [@default None]; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { algorithm: string option [@default None] 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - feed: App_bsky_feed_defs.feed_view_post list; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; feed: App_bsky_feed_defs.feed_view_post list } 16 + [@@deriving yojson {strict= false}] 21 17 22 - let call 23 - ?algorithm 24 - ?limit 25 - ?cursor 26 - (client : Hermes.client) : output Lwt.t = 18 + let call ?algorithm ?limit ?cursor (client : Hermes.client) : output Lwt.t = 27 19 let params : params = {algorithm; limit; cursor} in 28 20 Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 21 end 30 -
+3 -6
pegasus/lexicons/app_bsky_feed_like.ml
··· 1 1 (* generated from app.bsky.feed.like *) 2 2 3 3 type main = 4 - { 5 - subject: Com_atproto_repo_strongRef.main; 6 - created_at: string [@key "createdAt"]; 7 - via: Com_atproto_repo_strongRef.main option [@default None]; 8 - } 4 + { subject: Com_atproto_repo_strongRef.main 5 + ; created_at: string [@key "createdAt"] 6 + ; via: Com_atproto_repo_strongRef.main option [@default None] } 9 7 [@@deriving yojson {strict= false}] 10 -
+93 -79
pegasus/lexicons/app_bsky_feed_post.ml
··· 1 1 (* generated from app.bsky.feed.post *) 2 2 3 3 type reply_ref = 4 - { 5 - root: Com_atproto_repo_strongRef.main; 6 - parent: Com_atproto_repo_strongRef.main; 7 - } 4 + { root: Com_atproto_repo_strongRef.main 5 + ; parent: Com_atproto_repo_strongRef.main } 8 6 [@@deriving yojson {strict= false}] 9 7 10 - type text_slice = 11 - { 12 - start: int; 13 - end_: int [@key "end"]; 14 - } 8 + type text_slice = {start: int; end_: int [@key "end"]} 15 9 [@@deriving yojson {strict= false}] 16 10 17 - type entity = 18 - { 19 - index: text_slice; 20 - type_: string [@key "type"]; 21 - value: string; 22 - } 11 + type entity = {index: text_slice; type_: string [@key "type"]; value: string} 23 12 [@@deriving yojson {strict= false}] 24 13 25 14 type labels = ··· 30 19 let open Yojson.Safe.Util in 31 20 try 32 21 match json |> member "$type" |> to_string with 33 - | "com.atproto.label.defs#selfLabels" -> 34 - (match Com_atproto_label_defs.self_labels_of_yojson json with 35 - | Ok v -> Ok (SelfLabels v) 36 - | Error e -> Error e) 37 - | _ -> Ok (Unknown json) 22 + | "com.atproto.label.defs#selfLabels" -> ( 23 + match Com_atproto_label_defs.self_labels_of_yojson json with 24 + | Ok v -> 25 + Ok (SelfLabels v) 26 + | Error e -> 27 + Error e ) 28 + | _ -> 29 + Ok (Unknown json) 38 30 with _ -> Error "failed to parse union" 39 31 40 32 let labels_to_yojson = function 41 - | SelfLabels v -> 42 - (match Com_atproto_label_defs.self_labels_to_yojson v with 43 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.label.defs#selfLabels") :: fields) 44 - | other -> other) 45 - | Unknown j -> j 33 + | SelfLabels v -> ( 34 + match Com_atproto_label_defs.self_labels_to_yojson v with 35 + | `Assoc fields -> 36 + `Assoc (("$type", `String "com.atproto.label.defs#selfLabels") :: fields) 37 + | other -> 38 + other ) 39 + | Unknown j -> 40 + j 46 41 47 42 type embed = 48 43 | Images of App_bsky_embed_images.main ··· 56 51 let open Yojson.Safe.Util in 57 52 try 58 53 match json |> member "$type" |> to_string with 59 - | "app.bsky.embed.images" -> 60 - (match App_bsky_embed_images.main_of_yojson json with 61 - | Ok v -> Ok (Images v) 62 - | Error e -> Error e) 63 - | "app.bsky.embed.video" -> 64 - (match App_bsky_embed_video.main_of_yojson json with 65 - | Ok v -> Ok (Video v) 66 - | Error e -> Error e) 67 - | "app.bsky.embed.external" -> 68 - (match App_bsky_embed_external.main_of_yojson json with 69 - | Ok v -> Ok (External v) 70 - | Error e -> Error e) 71 - | "app.bsky.embed.record" -> 72 - (match App_bsky_embed_record.main_of_yojson json with 73 - | Ok v -> Ok (Record v) 74 - | Error e -> Error e) 75 - | "app.bsky.embed.recordWithMedia" -> 76 - (match App_bsky_embed_recordWithMedia.main_of_yojson json with 77 - | Ok v -> Ok (RecordWithMedia v) 78 - | Error e -> Error e) 79 - | _ -> Ok (Unknown json) 54 + | "app.bsky.embed.images" -> ( 55 + match App_bsky_embed_images.main_of_yojson json with 56 + | Ok v -> 57 + Ok (Images v) 58 + | Error e -> 59 + Error e ) 60 + | "app.bsky.embed.video" -> ( 61 + match App_bsky_embed_video.main_of_yojson json with 62 + | Ok v -> 63 + Ok (Video v) 64 + | Error e -> 65 + Error e ) 66 + | "app.bsky.embed.external" -> ( 67 + match App_bsky_embed_external.main_of_yojson json with 68 + | Ok v -> 69 + Ok (External v) 70 + | Error e -> 71 + Error e ) 72 + | "app.bsky.embed.record" -> ( 73 + match App_bsky_embed_record.main_of_yojson json with 74 + | Ok v -> 75 + Ok (Record v) 76 + | Error e -> 77 + Error e ) 78 + | "app.bsky.embed.recordWithMedia" -> ( 79 + match App_bsky_embed_recordWithMedia.main_of_yojson json with 80 + | Ok v -> 81 + Ok (RecordWithMedia v) 82 + | Error e -> 83 + Error e ) 84 + | _ -> 85 + Ok (Unknown json) 80 86 with _ -> Error "failed to parse union" 81 87 82 88 let embed_to_yojson = function 83 - | Images v -> 84 - (match App_bsky_embed_images.main_to_yojson v with 85 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.images") :: fields) 86 - | other -> other) 87 - | Video v -> 88 - (match App_bsky_embed_video.main_to_yojson v with 89 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.video") :: fields) 90 - | other -> other) 91 - | External v -> 92 - (match App_bsky_embed_external.main_to_yojson v with 93 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.external") :: fields) 94 - | other -> other) 95 - | Record v -> 96 - (match App_bsky_embed_record.main_to_yojson v with 97 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record") :: fields) 98 - | other -> other) 99 - | RecordWithMedia v -> 100 - (match App_bsky_embed_recordWithMedia.main_to_yojson v with 101 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.recordWithMedia") :: fields) 102 - | other -> other) 103 - | Unknown j -> j 89 + | Images v -> ( 90 + match App_bsky_embed_images.main_to_yojson v with 91 + | `Assoc fields -> 92 + `Assoc (("$type", `String "app.bsky.embed.images") :: fields) 93 + | other -> 94 + other ) 95 + | Video v -> ( 96 + match App_bsky_embed_video.main_to_yojson v with 97 + | `Assoc fields -> 98 + `Assoc (("$type", `String "app.bsky.embed.video") :: fields) 99 + | other -> 100 + other ) 101 + | External v -> ( 102 + match App_bsky_embed_external.main_to_yojson v with 103 + | `Assoc fields -> 104 + `Assoc (("$type", `String "app.bsky.embed.external") :: fields) 105 + | other -> 106 + other ) 107 + | Record v -> ( 108 + match App_bsky_embed_record.main_to_yojson v with 109 + | `Assoc fields -> 110 + `Assoc (("$type", `String "app.bsky.embed.record") :: fields) 111 + | other -> 112 + other ) 113 + | RecordWithMedia v -> ( 114 + match App_bsky_embed_recordWithMedia.main_to_yojson v with 115 + | `Assoc fields -> 116 + `Assoc (("$type", `String "app.bsky.embed.recordWithMedia") :: fields) 117 + | other -> 118 + other ) 119 + | Unknown j -> 120 + j 104 121 105 122 type main = 106 - { 107 - text: string; 108 - entities: entity list option [@default None]; 109 - facets: App_bsky_richtext_facet.main list option [@default None]; 110 - reply: reply_ref option [@default None]; 111 - embed: embed option [@default None]; 112 - langs: string list option [@default None]; 113 - labels: labels option [@default None]; 114 - tags: string list option [@default None]; 115 - created_at: string [@key "createdAt"]; 116 - } 123 + { text: string 124 + ; entities: entity list option [@default None] 125 + ; facets: App_bsky_richtext_facet.main list option [@default None] 126 + ; reply: reply_ref option [@default None] 127 + ; embed: embed option [@default None] 128 + ; langs: string list option [@default None] 129 + ; labels: labels option [@default None] 130 + ; tags: string list option [@default None] 131 + ; created_at: string [@key "createdAt"] } 117 132 [@@deriving yojson {strict= false}] 118 -
+25 -17
pegasus/lexicons/app_bsky_feed_postgate.ml
··· 1 1 (* generated from app.bsky.feed.postgate *) 2 2 3 3 type disable_rule = unit 4 + 4 5 let disable_rule_of_yojson _ = Ok () 6 + 5 7 let disable_rule_to_yojson () = `Assoc [] 6 8 7 9 type embedding_rules_item = ··· 12 14 let open Yojson.Safe.Util in 13 15 try 14 16 match json |> member "$type" |> to_string with 15 - | "app.bsky.feed.postgate#disableRule" -> 16 - (match disable_rule_of_yojson json with 17 - | Ok v -> Ok (DisableRule v) 18 - | Error e -> Error e) 19 - | _ -> Ok (Unknown json) 17 + | "app.bsky.feed.postgate#disableRule" -> ( 18 + match disable_rule_of_yojson json with 19 + | Ok v -> 20 + Ok (DisableRule v) 21 + | Error e -> 22 + Error e ) 23 + | _ -> 24 + Ok (Unknown json) 20 25 with _ -> Error "failed to parse union" 21 26 22 27 let embedding_rules_item_to_yojson = function 23 - | DisableRule v -> 24 - (match disable_rule_to_yojson v with 25 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.postgate#disableRule") :: fields) 26 - | other -> other) 27 - | Unknown j -> j 28 + | DisableRule v -> ( 29 + match disable_rule_to_yojson v with 30 + | `Assoc fields -> 31 + `Assoc 32 + (("$type", `String "app.bsky.feed.postgate#disableRule") :: fields) 33 + | other -> 34 + other ) 35 + | Unknown j -> 36 + j 28 37 29 38 type main = 30 - { 31 - created_at: string [@key "createdAt"]; 32 - post: string; 33 - detached_embedding_uris: string list option [@key "detachedEmbeddingUris"] [@default None]; 34 - embedding_rules: embedding_rules_item list option [@key "embeddingRules"] [@default None]; 35 - } 39 + { created_at: string [@key "createdAt"] 40 + ; post: string 41 + ; detached_embedding_uris: string list option 42 + [@key "detachedEmbeddingUris"] [@default None] 43 + ; embedding_rules: embedding_rules_item list option 44 + [@key "embeddingRules"] [@default None] } 36 45 [@@deriving yojson {strict= false}] 37 -
+3 -6
pegasus/lexicons/app_bsky_feed_repost.ml
··· 1 1 (* generated from app.bsky.feed.repost *) 2 2 3 3 type main = 4 - { 5 - subject: Com_atproto_repo_strongRef.main; 6 - created_at: string [@key "createdAt"]; 7 - via: Com_atproto_repo_strongRef.main option [@default None]; 8 - } 4 + { subject: Com_atproto_repo_strongRef.main 5 + ; created_at: string [@key "createdAt"] 6 + ; via: Com_atproto_repo_strongRef.main option [@default None] } 9 7 [@@deriving yojson {strict= false}] 10 -
+36 -37
pegasus/lexicons/app_bsky_feed_searchPosts.ml
··· 5 5 let nsid = "app.bsky.feed.searchPosts" 6 6 7 7 type params = 8 - { 9 - q: string; 10 - sort: string option [@default None]; 11 - since: string option [@default None]; 12 - until: string option [@default None]; 13 - mentions: string option [@default None]; 14 - author: string option [@default None]; 15 - lang: string option [@default None]; 16 - domain: string option [@default None]; 17 - url: string option [@default None]; 18 - tag: string list option [@default None] [@of_yojson Hermes_util.query_string_list_option_of_yojson] [@to_yojson Hermes_util.query_string_list_option_to_yojson]; 19 - limit: int option [@default None]; 20 - cursor: string option [@default None]; 21 - } 22 - [@@deriving yojson {strict= false}] 8 + { q: string 9 + ; sort: string option [@default None] 10 + ; since: string option [@default None] 11 + ; until: string option [@default None] 12 + ; mentions: string option [@default None] 13 + ; author: string option [@default None] 14 + ; lang: string option [@default None] 15 + ; domain: string option [@default None] 16 + ; url: string option [@default None] 17 + ; tag: string list option 18 + [@default None] 19 + [@of_yojson Hermes_util.query_string_list_option_of_yojson] 20 + [@to_yojson Hermes_util.query_string_list_option_to_yojson] 21 + ; limit: int option [@default None] 22 + ; cursor: string option [@default None] } 23 + [@@deriving yojson {strict= false}] 23 24 24 25 type output = 25 - { 26 - cursor: string option [@default None]; 27 - hits_total: int option [@key "hitsTotal"] [@default None]; 28 - posts: App_bsky_feed_defs.post_view list; 29 - } 30 - [@@deriving yojson {strict= false}] 26 + { cursor: string option [@default None] 27 + ; hits_total: int option [@key "hitsTotal"] [@default None] 28 + ; posts: App_bsky_feed_defs.post_view list } 29 + [@@deriving yojson {strict= false}] 31 30 32 - let call 33 - ~q 34 - ?sort 35 - ?since 36 - ?until 37 - ?mentions 38 - ?author 39 - ?lang 40 - ?domain 41 - ?url 42 - ?tag 43 - ?limit 44 - ?cursor 45 - (client : Hermes.client) : output Lwt.t = 46 - let params : params = {q; sort; since; until; mentions; author; lang; domain; url; tag; limit; cursor} in 31 + let call ~q ?sort ?since ?until ?mentions ?author ?lang ?domain ?url ?tag 32 + ?limit ?cursor (client : Hermes.client) : output Lwt.t = 33 + let params : params = 34 + { q 35 + ; sort 36 + ; since 37 + ; until 38 + ; mentions 39 + ; author 40 + ; lang 41 + ; domain 42 + ; url 43 + ; tag 44 + ; limit 45 + ; cursor } 46 + in 47 47 Hermes.query client nsid (params_to_yojson params) output_of_yojson 48 48 end 49 -
+9 -11
pegasus/lexicons/app_bsky_feed_sendInteractions.ml
··· 5 5 let nsid = "app.bsky.feed.sendInteractions" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - interactions: App_bsky_feed_defs.interaction list; 13 - } 11 + type input = {interactions: App_bsky_feed_defs.interaction list} 14 12 [@@deriving yojson {strict= false}] 15 13 16 14 type output = unit 17 - let output_of_yojson _ = Ok () 18 - let output_to_yojson () = `Assoc [] 19 15 20 - let call 21 - ~interactions 22 - (client : Hermes.client) : output Lwt.t = 16 + let output_of_yojson _ = Ok () 17 + 18 + let output_to_yojson () = `Assoc [] 19 + 20 + let call ~interactions (client : Hermes.client) : output Lwt.t = 23 21 let params = () in 24 22 let input = Some ({interactions} |> input_to_yojson) in 25 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 23 + Hermes.procedure client nsid (params_to_yojson params) input 24 + output_of_yojson 26 25 end 27 -
+66 -45
pegasus/lexicons/app_bsky_feed_threadgate.ml
··· 1 1 (* generated from app.bsky.feed.threadgate *) 2 2 3 - type list_rule = 4 - { 5 - list_: string [@key "list"]; 6 - } 3 + type list_rule = {list_: string [@key "list"]} 7 4 [@@deriving yojson {strict= false}] 8 5 9 6 type following_rule = unit 7 + 10 8 let following_rule_of_yojson _ = Ok () 9 + 11 10 let following_rule_to_yojson () = `Assoc [] 12 11 13 12 type follower_rule = unit 13 + 14 14 let follower_rule_of_yojson _ = Ok () 15 + 15 16 let follower_rule_to_yojson () = `Assoc [] 16 17 17 18 type mention_rule = unit 19 + 18 20 let mention_rule_of_yojson _ = Ok () 21 + 19 22 let mention_rule_to_yojson () = `Assoc [] 20 23 21 24 type allow_item = ··· 29 32 let open Yojson.Safe.Util in 30 33 try 31 34 match json |> member "$type" |> to_string with 32 - | "app.bsky.feed.threadgate#mentionRule" -> 33 - (match mention_rule_of_yojson json with 34 - | Ok v -> Ok (MentionRule v) 35 - | Error e -> Error e) 36 - | "app.bsky.feed.threadgate#followerRule" -> 37 - (match follower_rule_of_yojson json with 38 - | Ok v -> Ok (FollowerRule v) 39 - | Error e -> Error e) 40 - | "app.bsky.feed.threadgate#followingRule" -> 41 - (match following_rule_of_yojson json with 42 - | Ok v -> Ok (FollowingRule v) 43 - | Error e -> Error e) 44 - | "app.bsky.feed.threadgate#listRule" -> 45 - (match list_rule_of_yojson json with 46 - | Ok v -> Ok (ListRule v) 47 - | Error e -> Error e) 48 - | _ -> Ok (Unknown json) 35 + | "app.bsky.feed.threadgate#mentionRule" -> ( 36 + match mention_rule_of_yojson json with 37 + | Ok v -> 38 + Ok (MentionRule v) 39 + | Error e -> 40 + Error e ) 41 + | "app.bsky.feed.threadgate#followerRule" -> ( 42 + match follower_rule_of_yojson json with 43 + | Ok v -> 44 + Ok (FollowerRule v) 45 + | Error e -> 46 + Error e ) 47 + | "app.bsky.feed.threadgate#followingRule" -> ( 48 + match following_rule_of_yojson json with 49 + | Ok v -> 50 + Ok (FollowingRule v) 51 + | Error e -> 52 + Error e ) 53 + | "app.bsky.feed.threadgate#listRule" -> ( 54 + match list_rule_of_yojson json with 55 + | Ok v -> 56 + Ok (ListRule v) 57 + | Error e -> 58 + Error e ) 59 + | _ -> 60 + Ok (Unknown json) 49 61 with _ -> Error "failed to parse union" 50 62 51 63 let allow_item_to_yojson = function 52 - | MentionRule v -> 53 - (match mention_rule_to_yojson v with 54 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#mentionRule") :: fields) 55 - | other -> other) 56 - | FollowerRule v -> 57 - (match follower_rule_to_yojson v with 58 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#followerRule") :: fields) 59 - | other -> other) 60 - | FollowingRule v -> 61 - (match following_rule_to_yojson v with 62 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#followingRule") :: fields) 63 - | other -> other) 64 - | ListRule v -> 65 - (match list_rule_to_yojson v with 66 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#listRule") :: fields) 67 - | other -> other) 68 - | Unknown j -> j 64 + | MentionRule v -> ( 65 + match mention_rule_to_yojson v with 66 + | `Assoc fields -> 67 + `Assoc 68 + (("$type", `String "app.bsky.feed.threadgate#mentionRule") :: fields) 69 + | other -> 70 + other ) 71 + | FollowerRule v -> ( 72 + match follower_rule_to_yojson v with 73 + | `Assoc fields -> 74 + `Assoc 75 + (("$type", `String "app.bsky.feed.threadgate#followerRule") :: fields) 76 + | other -> 77 + other ) 78 + | FollowingRule v -> ( 79 + match following_rule_to_yojson v with 80 + | `Assoc fields -> 81 + `Assoc 82 + (("$type", `String "app.bsky.feed.threadgate#followingRule") :: fields) 83 + | other -> 84 + other ) 85 + | ListRule v -> ( 86 + match list_rule_to_yojson v with 87 + | `Assoc fields -> 88 + `Assoc (("$type", `String "app.bsky.feed.threadgate#listRule") :: fields) 89 + | other -> 90 + other ) 91 + | Unknown j -> 92 + j 69 93 70 94 type main = 71 - { 72 - post: string; 73 - allow: allow_item list option [@default None]; 74 - created_at: string [@key "createdAt"]; 75 - hidden_replies: string list option [@key "hiddenReplies"] [@default None]; 76 - } 95 + { post: string 96 + ; allow: allow_item list option [@default None] 97 + ; created_at: string [@key "createdAt"] 98 + ; hidden_replies: string list option [@key "hiddenReplies"] [@default None] } 77 99 [@@deriving yojson {strict= false}] 78 -
+1 -6
pegasus/lexicons/app_bsky_graph_block.ml
··· 1 1 (* generated from app.bsky.graph.block *) 2 2 3 - type main = 4 - { 5 - subject: string; 6 - created_at: string [@key "createdAt"]; 7 - } 3 + type main = {subject: string; created_at: string [@key "createdAt"]} 8 4 [@@deriving yojson {strict= false}] 9 -
+22 -3
pegasus/lexicons/app_bsky_graph_defs.ml
··· 1 1 (* re-exported from App_bsky_shared_1 *) 2 2 3 3 type list_view_basic = App_bsky_shared_1.list_view_basic 4 + 4 5 let list_view_basic_of_yojson = App_bsky_shared_1.list_view_basic_of_yojson 6 + 5 7 let list_view_basic_to_yojson = App_bsky_shared_1.list_view_basic_to_yojson 6 8 7 9 type list_view = App_bsky_shared_1.list_view 10 + 8 11 let list_view_of_yojson = App_bsky_shared_1.list_view_of_yojson 12 + 9 13 let list_view_to_yojson = App_bsky_shared_1.list_view_to_yojson 10 14 11 15 type list_item_view = App_bsky_shared_1.list_item_view 16 + 12 17 let list_item_view_of_yojson = App_bsky_shared_1.list_item_view_of_yojson 18 + 13 19 let list_item_view_to_yojson = App_bsky_shared_1.list_item_view_to_yojson 14 20 15 21 type starter_pack_view = App_bsky_shared_1.starter_pack_view 22 + 16 23 let starter_pack_view_of_yojson = App_bsky_shared_1.starter_pack_view_of_yojson 24 + 17 25 let starter_pack_view_to_yojson = App_bsky_shared_1.starter_pack_view_to_yojson 18 26 19 27 type starter_pack_view_basic = App_bsky_shared_1.starter_pack_view_basic 20 - let starter_pack_view_basic_of_yojson = App_bsky_shared_1.starter_pack_view_basic_of_yojson 21 - let starter_pack_view_basic_to_yojson = App_bsky_shared_1.starter_pack_view_basic_to_yojson 28 + 29 + let starter_pack_view_basic_of_yojson = 30 + App_bsky_shared_1.starter_pack_view_basic_of_yojson 31 + 32 + let starter_pack_view_basic_to_yojson = 33 + App_bsky_shared_1.starter_pack_view_basic_to_yojson 22 34 23 35 type list_purpose = App_bsky_shared_1.list_purpose 36 + 24 37 let list_purpose_of_yojson = App_bsky_shared_1.list_purpose_of_yojson 38 + 25 39 let list_purpose_to_yojson = App_bsky_shared_1.list_purpose_to_yojson 26 40 27 41 let modlist = App_bsky_shared_1.modlist ··· 31 45 let referencelist = App_bsky_shared_1.referencelist 32 46 33 47 type list_viewer_state = App_bsky_shared_1.list_viewer_state 48 + 34 49 let list_viewer_state_of_yojson = App_bsky_shared_1.list_viewer_state_of_yojson 50 + 35 51 let list_viewer_state_to_yojson = App_bsky_shared_1.list_viewer_state_to_yojson 36 52 37 53 type not_found_actor = App_bsky_shared_1.not_found_actor 54 + 38 55 let not_found_actor_of_yojson = App_bsky_shared_1.not_found_actor_of_yojson 56 + 39 57 let not_found_actor_to_yojson = App_bsky_shared_1.not_found_actor_to_yojson 40 58 41 59 type relationship = App_bsky_shared_1.relationship 60 + 42 61 let relationship_of_yojson = App_bsky_shared_1.relationship_of_yojson 62 + 43 63 let relationship_to_yojson = App_bsky_shared_1.relationship_to_yojson 44 -
+1 -6
pegasus/lexicons/app_bsky_graph_follow.ml
··· 1 1 (* generated from app.bsky.graph.follow *) 2 2 3 - type main = 4 - { 5 - subject: string; 6 - created_at: string [@key "createdAt"]; 7 - } 3 + type main = {subject: string; created_at: string [@key "createdAt"]} 8 4 [@@deriving yojson {strict= false}] 9 -
+9 -17
pegasus/lexicons/app_bsky_graph_getActorStarterPacks.ml
··· 5 5 let nsid = "app.bsky.graph.getActorStarterPacks" 6 6 7 7 type params = 8 - { 9 - actor: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { actor: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - starter_packs: App_bsky_graph_defs.starter_pack_view_basic list [@key "starterPacks"]; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; starter_packs: App_bsky_graph_defs.starter_pack_view_basic list 16 + [@key "starterPacks"] } 17 + [@@deriving yojson {strict= false}] 21 18 22 - let call 23 - ~actor 24 - ?limit 25 - ?cursor 26 - (client : Hermes.client) : output Lwt.t = 19 + let call ~actor ?limit ?cursor (client : Hermes.client) : output Lwt.t = 27 20 let params : params = {actor; limit; cursor} in 28 21 Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 22 end 30 -
+6 -15
pegasus/lexicons/app_bsky_graph_getBlocks.ml
··· 5 5 let nsid = "app.bsky.graph.getBlocks" 6 6 7 7 type params = 8 - { 9 - limit: int option [@default None]; 10 - cursor: string option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {limit: int option [@default None]; cursor: string option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 11 type output = 15 - { 16 - cursor: string option [@default None]; 17 - blocks: App_bsky_actor_defs.profile_view list; 18 - } 19 - [@@deriving yojson {strict= false}] 12 + { cursor: string option [@default None] 13 + ; blocks: App_bsky_actor_defs.profile_view list } 14 + [@@deriving yojson {strict= false}] 20 15 21 - let call 22 - ?limit 23 - ?cursor 24 - (client : Hermes.client) : output Lwt.t = 16 + let call ?limit ?cursor (client : Hermes.client) : output Lwt.t = 25 17 let params : params = {limit; cursor} in 26 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 19 end 28 -
+9 -18
pegasus/lexicons/app_bsky_graph_getFollowers.ml
··· 5 5 let nsid = "app.bsky.graph.getFollowers" 6 6 7 7 type params = 8 - { 9 - actor: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { actor: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - subject: App_bsky_actor_defs.profile_view; 18 - cursor: string option [@default None]; 19 - followers: App_bsky_actor_defs.profile_view list; 20 - } 21 - [@@deriving yojson {strict= false}] 14 + { subject: App_bsky_actor_defs.profile_view 15 + ; cursor: string option [@default None] 16 + ; followers: App_bsky_actor_defs.profile_view list } 17 + [@@deriving yojson {strict= false}] 22 18 23 - let call 24 - ~actor 25 - ?limit 26 - ?cursor 27 - (client : Hermes.client) : output Lwt.t = 19 + let call ~actor ?limit ?cursor (client : Hermes.client) : output Lwt.t = 28 20 let params : params = {actor; limit; cursor} in 29 21 Hermes.query client nsid (params_to_yojson params) output_of_yojson 30 22 end 31 -
+9 -18
pegasus/lexicons/app_bsky_graph_getFollows.ml
··· 5 5 let nsid = "app.bsky.graph.getFollows" 6 6 7 7 type params = 8 - { 9 - actor: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { actor: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - subject: App_bsky_actor_defs.profile_view; 18 - cursor: string option [@default None]; 19 - follows: App_bsky_actor_defs.profile_view list; 20 - } 21 - [@@deriving yojson {strict= false}] 14 + { subject: App_bsky_actor_defs.profile_view 15 + ; cursor: string option [@default None] 16 + ; follows: App_bsky_actor_defs.profile_view list } 17 + [@@deriving yojson {strict= false}] 22 18 23 - let call 24 - ~actor 25 - ?limit 26 - ?cursor 27 - (client : Hermes.client) : output Lwt.t = 19 + let call ~actor ?limit ?cursor (client : Hermes.client) : output Lwt.t = 28 20 let params : params = {actor; limit; cursor} in 29 21 Hermes.query client nsid (params_to_yojson params) output_of_yojson 30 22 end 31 -
+9 -18
pegasus/lexicons/app_bsky_graph_getKnownFollowers.ml
··· 5 5 let nsid = "app.bsky.graph.getKnownFollowers" 6 6 7 7 type params = 8 - { 9 - actor: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { actor: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - subject: App_bsky_actor_defs.profile_view; 18 - cursor: string option [@default None]; 19 - followers: App_bsky_actor_defs.profile_view list; 20 - } 21 - [@@deriving yojson {strict= false}] 14 + { subject: App_bsky_actor_defs.profile_view 15 + ; cursor: string option [@default None] 16 + ; followers: App_bsky_actor_defs.profile_view list } 17 + [@@deriving yojson {strict= false}] 22 18 23 - let call 24 - ~actor 25 - ?limit 26 - ?cursor 27 - (client : Hermes.client) : output Lwt.t = 19 + let call ~actor ?limit ?cursor (client : Hermes.client) : output Lwt.t = 28 20 let params : params = {actor; limit; cursor} in 29 21 Hermes.query client nsid (params_to_yojson params) output_of_yojson 30 22 end 31 -
+9 -18
pegasus/lexicons/app_bsky_graph_getList.ml
··· 5 5 let nsid = "app.bsky.graph.getList" 6 6 7 7 type params = 8 - { 9 - list_: string [@key "list"]; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { list_: string [@key "list"] 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - list_: App_bsky_graph_defs.list_view [@key "list"]; 19 - items: App_bsky_graph_defs.list_item_view list; 20 - } 21 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; list_: App_bsky_graph_defs.list_view [@key "list"] 16 + ; items: App_bsky_graph_defs.list_item_view list } 17 + [@@deriving yojson {strict= false}] 22 18 23 - let call 24 - ~list_ 25 - ?limit 26 - ?cursor 27 - (client : Hermes.client) : output Lwt.t = 19 + let call ~list_ ?limit ?cursor (client : Hermes.client) : output Lwt.t = 28 20 let params : params = {list_; limit; cursor} in 29 21 Hermes.query client nsid (params_to_yojson params) output_of_yojson 30 22 end 31 -
+6 -15
pegasus/lexicons/app_bsky_graph_getListBlocks.ml
··· 5 5 let nsid = "app.bsky.graph.getListBlocks" 6 6 7 7 type params = 8 - { 9 - limit: int option [@default None]; 10 - cursor: string option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {limit: int option [@default None]; cursor: string option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 11 type output = 15 - { 16 - cursor: string option [@default None]; 17 - lists: App_bsky_graph_defs.list_view list; 18 - } 19 - [@@deriving yojson {strict= false}] 12 + { cursor: string option [@default None] 13 + ; lists: App_bsky_graph_defs.list_view list } 14 + [@@deriving yojson {strict= false}] 20 15 21 - let call 22 - ?limit 23 - ?cursor 24 - (client : Hermes.client) : output Lwt.t = 16 + let call ?limit ?cursor (client : Hermes.client) : output Lwt.t = 25 17 let params : params = {limit; cursor} in 26 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 19 end 28 -
+6 -15
pegasus/lexicons/app_bsky_graph_getListMutes.ml
··· 5 5 let nsid = "app.bsky.graph.getListMutes" 6 6 7 7 type params = 8 - { 9 - limit: int option [@default None]; 10 - cursor: string option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {limit: int option [@default None]; cursor: string option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 11 type output = 15 - { 16 - cursor: string option [@default None]; 17 - lists: App_bsky_graph_defs.list_view list; 18 - } 19 - [@@deriving yojson {strict= false}] 12 + { cursor: string option [@default None] 13 + ; lists: App_bsky_graph_defs.list_view list } 14 + [@@deriving yojson {strict= false}] 20 15 21 - let call 22 - ?limit 23 - ?cursor 24 - (client : Hermes.client) : output Lwt.t = 16 + let call ?limit ?cursor (client : Hermes.client) : output Lwt.t = 25 17 let params : params = {limit; cursor} in 26 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 19 end 28 -
+13 -19
pegasus/lexicons/app_bsky_graph_getLists.ml
··· 5 5 let nsid = "app.bsky.graph.getLists" 6 6 7 7 type params = 8 - { 9 - actor: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - purposes: string list option [@default None] [@of_yojson Hermes_util.query_string_list_option_of_yojson] [@to_yojson Hermes_util.query_string_list_option_to_yojson]; 13 - } 14 - [@@deriving yojson {strict= false}] 8 + { actor: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] 11 + ; purposes: string list option 12 + [@default None] 13 + [@of_yojson Hermes_util.query_string_list_option_of_yojson] 14 + [@to_yojson Hermes_util.query_string_list_option_to_yojson] } 15 + [@@deriving yojson {strict= false}] 15 16 16 17 type output = 17 - { 18 - cursor: string option [@default None]; 19 - lists: App_bsky_graph_defs.list_view list; 20 - } 21 - [@@deriving yojson {strict= false}] 18 + { cursor: string option [@default None] 19 + ; lists: App_bsky_graph_defs.list_view list } 20 + [@@deriving yojson {strict= false}] 22 21 23 - let call 24 - ~actor 25 - ?limit 26 - ?cursor 27 - ?purposes 28 - (client : Hermes.client) : output Lwt.t = 22 + let call ~actor ?limit ?cursor ?purposes (client : Hermes.client) : 23 + output Lwt.t = 29 24 let params : params = {actor; limit; cursor; purposes} in 30 25 Hermes.query client nsid (params_to_yojson params) output_of_yojson 31 26 end 32 -
+17 -23
pegasus/lexicons/app_bsky_graph_getListsWithMembership.ml
··· 1 1 (* generated from app.bsky.graph.getListsWithMembership *) 2 2 3 3 type list_with_membership = 4 - { 5 - list_: App_bsky_graph_defs.list_view [@key "list"]; 6 - list_item: App_bsky_graph_defs.list_item_view option [@key "listItem"] [@default None]; 7 - } 4 + { list_: App_bsky_graph_defs.list_view [@key "list"] 5 + ; list_item: App_bsky_graph_defs.list_item_view option 6 + [@key "listItem"] [@default None] } 8 7 [@@deriving yojson {strict= false}] 9 8 10 9 (** Enumerates the lists created by the session user, and includes membership information about `actor` in those lists. Only supports curation and moderation lists (no reference lists, used in starter packs). Requires auth. *) ··· 12 11 let nsid = "app.bsky.graph.getListsWithMembership" 13 12 14 13 type params = 15 - { 16 - actor: string; 17 - limit: int option [@default None]; 18 - cursor: string option [@default None]; 19 - purposes: string list option [@default None] [@of_yojson Hermes_util.query_string_list_option_of_yojson] [@to_yojson Hermes_util.query_string_list_option_to_yojson]; 20 - } 21 - [@@deriving yojson {strict= false}] 14 + { actor: string 15 + ; limit: int option [@default None] 16 + ; cursor: string option [@default None] 17 + ; purposes: string list option 18 + [@default None] 19 + [@of_yojson Hermes_util.query_string_list_option_of_yojson] 20 + [@to_yojson Hermes_util.query_string_list_option_to_yojson] } 21 + [@@deriving yojson {strict= false}] 22 22 23 23 type output = 24 - { 25 - cursor: string option [@default None]; 26 - lists_with_membership: list_with_membership list [@key "listsWithMembership"]; 27 - } 28 - [@@deriving yojson {strict= false}] 24 + { cursor: string option [@default None] 25 + ; lists_with_membership: list_with_membership list 26 + [@key "listsWithMembership"] } 27 + [@@deriving yojson {strict= false}] 29 28 30 - let call 31 - ~actor 32 - ?limit 33 - ?cursor 34 - ?purposes 35 - (client : Hermes.client) : output Lwt.t = 29 + let call ~actor ?limit ?cursor ?purposes (client : Hermes.client) : 30 + output Lwt.t = 36 31 let params : params = {actor; limit; cursor; purposes} in 37 32 Hermes.query client nsid (params_to_yojson params) output_of_yojson 38 33 end 39 -
+6 -15
pegasus/lexicons/app_bsky_graph_getMutes.ml
··· 5 5 let nsid = "app.bsky.graph.getMutes" 6 6 7 7 type params = 8 - { 9 - limit: int option [@default None]; 10 - cursor: string option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {limit: int option [@default None]; cursor: string option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 11 type output = 15 - { 16 - cursor: string option [@default None]; 17 - mutes: App_bsky_actor_defs.profile_view list; 18 - } 19 - [@@deriving yojson {strict= false}] 12 + { cursor: string option [@default None] 13 + ; mutes: App_bsky_actor_defs.profile_view list } 14 + [@@deriving yojson {strict= false}] 20 15 21 - let call 22 - ?limit 23 - ?cursor 24 - (client : Hermes.client) : output Lwt.t = 16 + let call ?limit ?cursor (client : Hermes.client) : output Lwt.t = 25 17 let params : params = {limit; cursor} in 26 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 19 end 28 -
+50 -43
pegasus/lexicons/app_bsky_graph_getRelationships.ml
··· 5 5 let nsid = "app.bsky.graph.getRelationships" 6 6 7 7 type params = 8 - { 9 - actor: string; 10 - others: string list option [@default None] [@of_yojson Hermes_util.query_string_list_option_of_yojson] [@to_yojson Hermes_util.query_string_list_option_to_yojson]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + { actor: string 9 + ; others: string list option 10 + [@default None] 11 + [@of_yojson Hermes_util.query_string_list_option_of_yojson] 12 + [@to_yojson Hermes_util.query_string_list_option_to_yojson] } 13 + [@@deriving yojson {strict= false}] 13 14 14 15 type relationships_item = 15 - | Relationship of App_bsky_graph_defs.relationship 16 - | NotFoundActor of App_bsky_graph_defs.not_found_actor 17 - | Unknown of Yojson.Safe.t 16 + | Relationship of App_bsky_graph_defs.relationship 17 + | NotFoundActor of App_bsky_graph_defs.not_found_actor 18 + | Unknown of Yojson.Safe.t 18 19 19 - let relationships_item_of_yojson json = 20 - let open Yojson.Safe.Util in 21 - try 22 - match json |> member "$type" |> to_string with 23 - | "app.bsky.graph.defs#relationship" -> 24 - (match App_bsky_graph_defs.relationship_of_yojson json with 25 - | Ok v -> Ok (Relationship v) 26 - | Error e -> Error e) 27 - | "app.bsky.graph.defs#notFoundActor" -> 28 - (match App_bsky_graph_defs.not_found_actor_of_yojson json with 29 - | Ok v -> Ok (NotFoundActor v) 30 - | Error e -> Error e) 31 - | _ -> Ok (Unknown json) 32 - with _ -> Error "failed to parse union" 20 + let relationships_item_of_yojson json = 21 + let open Yojson.Safe.Util in 22 + try 23 + match json |> member "$type" |> to_string with 24 + | "app.bsky.graph.defs#relationship" -> ( 25 + match App_bsky_graph_defs.relationship_of_yojson json with 26 + | Ok v -> 27 + Ok (Relationship v) 28 + | Error e -> 29 + Error e ) 30 + | "app.bsky.graph.defs#notFoundActor" -> ( 31 + match App_bsky_graph_defs.not_found_actor_of_yojson json with 32 + | Ok v -> 33 + Ok (NotFoundActor v) 34 + | Error e -> 35 + Error e ) 36 + | _ -> 37 + Ok (Unknown json) 38 + with _ -> Error "failed to parse union" 33 39 34 - let relationships_item_to_yojson = function 35 - | Relationship v -> 36 - (match App_bsky_graph_defs.relationship_to_yojson v with 37 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.graph.defs#relationship") :: fields) 38 - | other -> other) 39 - | NotFoundActor v -> 40 - (match App_bsky_graph_defs.not_found_actor_to_yojson v with 41 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.graph.defs#notFoundActor") :: fields) 42 - | other -> other) 43 - | Unknown j -> j 40 + let relationships_item_to_yojson = function 41 + | Relationship v -> ( 42 + match App_bsky_graph_defs.relationship_to_yojson v with 43 + | `Assoc fields -> 44 + `Assoc 45 + (("$type", `String "app.bsky.graph.defs#relationship") :: fields) 46 + | other -> 47 + other ) 48 + | NotFoundActor v -> ( 49 + match App_bsky_graph_defs.not_found_actor_to_yojson v with 50 + | `Assoc fields -> 51 + `Assoc 52 + (("$type", `String "app.bsky.graph.defs#notFoundActor") :: fields) 53 + | other -> 54 + other ) 55 + | Unknown j -> 56 + j 44 57 45 - type output = 46 - { 47 - actor: string option [@default None]; 48 - relationships: relationships_item list; 49 - } 50 - [@@deriving yojson {strict= false}] 58 + type output = 59 + { actor: string option [@default None] 60 + ; relationships: relationships_item list } 61 + [@@deriving yojson {strict= false}] 51 62 52 - let call 53 - ~actor 54 - ?others 55 - (client : Hermes.client) : output Lwt.t = 63 + let call ~actor ?others (client : Hermes.client) : output Lwt.t = 56 64 let params : params = {actor; others} in 57 65 Hermes.query client nsid (params_to_yojson params) output_of_yojson 58 66 end 59 -
+5 -13
pegasus/lexicons/app_bsky_graph_getStarterPack.ml
··· 4 4 module Main = struct 5 5 let nsid = "app.bsky.graph.getStarterPack" 6 6 7 - type params = 8 - { 9 - starter_pack: string [@key "starterPack"]; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {starter_pack: string [@key "starterPack"]} 8 + [@@deriving yojson {strict= false}] 12 9 13 10 type output = 14 - { 15 - starter_pack: App_bsky_graph_defs.starter_pack_view [@key "starterPack"]; 16 - } 17 - [@@deriving yojson {strict= false}] 11 + {starter_pack: App_bsky_graph_defs.starter_pack_view [@key "starterPack"]} 12 + [@@deriving yojson {strict= false}] 18 13 19 - let call 20 - ~starter_pack 21 - (client : Hermes.client) : output Lwt.t = 14 + let call ~starter_pack (client : Hermes.client) : output Lwt.t = 22 15 let params : params = {starter_pack} in 23 16 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 17 end 25 -
+8 -12
pegasus/lexicons/app_bsky_graph_getStarterPacks.ml
··· 5 5 let nsid = "app.bsky.graph.getStarterPacks" 6 6 7 7 type params = 8 - { 9 - uris: string list [@of_yojson Hermes_util.query_string_list_of_yojson] [@to_yojson Hermes_util.query_string_list_to_yojson]; 10 - } 11 - [@@deriving yojson {strict= false}] 8 + { uris: string list 9 + [@of_yojson Hermes_util.query_string_list_of_yojson] 10 + [@to_yojson Hermes_util.query_string_list_to_yojson] } 11 + [@@deriving yojson {strict= false}] 12 12 13 13 type output = 14 - { 15 - starter_packs: App_bsky_graph_defs.starter_pack_view_basic list [@key "starterPacks"]; 16 - } 17 - [@@deriving yojson {strict= false}] 14 + { starter_packs: App_bsky_graph_defs.starter_pack_view_basic list 15 + [@key "starterPacks"] } 16 + [@@deriving yojson {strict= false}] 18 17 19 - let call 20 - ~uris 21 - (client : Hermes.client) : output Lwt.t = 18 + let call ~uris (client : Hermes.client) : output Lwt.t = 22 19 let params : params = {uris} in 23 20 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 21 end 25 -
+12 -21
pegasus/lexicons/app_bsky_graph_getStarterPacksWithMembership.ml
··· 1 1 (* generated from app.bsky.graph.getStarterPacksWithMembership *) 2 2 3 3 type starter_pack_with_membership = 4 - { 5 - starter_pack: App_bsky_graph_defs.starter_pack_view [@key "starterPack"]; 6 - list_item: App_bsky_graph_defs.list_item_view option [@key "listItem"] [@default None]; 7 - } 4 + { starter_pack: App_bsky_graph_defs.starter_pack_view [@key "starterPack"] 5 + ; list_item: App_bsky_graph_defs.list_item_view option 6 + [@key "listItem"] [@default None] } 8 7 [@@deriving yojson {strict= false}] 9 8 10 9 (** Enumerates the starter packs created by the session user, and includes membership information about `actor` in those starter packs. Requires auth. *) ··· 12 11 let nsid = "app.bsky.graph.getStarterPacksWithMembership" 13 12 14 13 type params = 15 - { 16 - actor: string; 17 - limit: int option [@default None]; 18 - cursor: string option [@default None]; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { actor: string 15 + ; limit: int option [@default None] 16 + ; cursor: string option [@default None] } 17 + [@@deriving yojson {strict= false}] 21 18 22 19 type output = 23 - { 24 - cursor: string option [@default None]; 25 - starter_packs_with_membership: starter_pack_with_membership list [@key "starterPacksWithMembership"]; 26 - } 27 - [@@deriving yojson {strict= false}] 20 + { cursor: string option [@default None] 21 + ; starter_packs_with_membership: starter_pack_with_membership list 22 + [@key "starterPacksWithMembership"] } 23 + [@@deriving yojson {strict= false}] 28 24 29 - let call 30 - ~actor 31 - ?limit 32 - ?cursor 33 - (client : Hermes.client) : output Lwt.t = 25 + let call ~actor ?limit ?cursor (client : Hermes.client) : output Lwt.t = 34 26 let params : params = {actor; limit; cursor} in 35 27 Hermes.query client nsid (params_to_yojson params) output_of_yojson 36 28 end 37 -
+6 -15
pegasus/lexicons/app_bsky_graph_getSuggestedFollowsByActor.ml
··· 4 4 module Main = struct 5 5 let nsid = "app.bsky.graph.getSuggestedFollowsByActor" 6 6 7 - type params = 8 - { 9 - actor: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {actor: string} [@@deriving yojson {strict= false}] 12 8 13 9 type output = 14 - { 15 - suggestions: App_bsky_actor_defs.profile_view list; 16 - is_fallback: bool option [@key "isFallback"] [@default None]; 17 - rec_id: int option [@key "recId"] [@default None]; 18 - } 19 - [@@deriving yojson {strict= false}] 10 + { suggestions: App_bsky_actor_defs.profile_view list 11 + ; is_fallback: bool option [@key "isFallback"] [@default None] 12 + ; rec_id: int option [@key "recId"] [@default None] } 13 + [@@deriving yojson {strict= false}] 20 14 21 - let call 22 - ~actor 23 - (client : Hermes.client) : output Lwt.t = 15 + let call ~actor (client : Hermes.client) : output Lwt.t = 24 16 let params : params = {actor} in 25 17 Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 18 end 27 -
+24 -20
pegasus/lexicons/app_bsky_graph_list.ml
··· 8 8 let open Yojson.Safe.Util in 9 9 try 10 10 match json |> member "$type" |> to_string with 11 - | "com.atproto.label.defs#selfLabels" -> 12 - (match Com_atproto_label_defs.self_labels_of_yojson json with 13 - | Ok v -> Ok (SelfLabels v) 14 - | Error e -> Error e) 15 - | _ -> Ok (Unknown json) 11 + | "com.atproto.label.defs#selfLabels" -> ( 12 + match Com_atproto_label_defs.self_labels_of_yojson json with 13 + | Ok v -> 14 + Ok (SelfLabels v) 15 + | Error e -> 16 + Error e ) 17 + | _ -> 18 + Ok (Unknown json) 16 19 with _ -> Error "failed to parse union" 17 20 18 21 let labels_to_yojson = function 19 - | SelfLabels v -> 20 - (match Com_atproto_label_defs.self_labels_to_yojson v with 21 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.label.defs#selfLabels") :: fields) 22 - | other -> other) 23 - | Unknown j -> j 22 + | SelfLabels v -> ( 23 + match Com_atproto_label_defs.self_labels_to_yojson v with 24 + | `Assoc fields -> 25 + `Assoc (("$type", `String "com.atproto.label.defs#selfLabels") :: fields) 26 + | other -> 27 + other ) 28 + | Unknown j -> 29 + j 24 30 25 31 type main = 26 - { 27 - purpose: App_bsky_graph_defs.list_purpose; 28 - name: string; 29 - description: string option [@default None]; 30 - description_facets: App_bsky_richtext_facet.main list option [@key "descriptionFacets"] [@default None]; 31 - avatar: Hermes.blob option [@default None]; 32 - labels: labels option [@default None]; 33 - created_at: string [@key "createdAt"]; 34 - } 32 + { purpose: App_bsky_graph_defs.list_purpose 33 + ; name: string 34 + ; description: string option [@default None] 35 + ; description_facets: App_bsky_richtext_facet.main list option 36 + [@key "descriptionFacets"] [@default None] 37 + ; avatar: Hermes.blob option [@default None] 38 + ; labels: labels option [@default None] 39 + ; created_at: string [@key "createdAt"] } 35 40 [@@deriving yojson {strict= false}] 36 -
+1 -6
pegasus/lexicons/app_bsky_graph_listblock.ml
··· 1 1 (* generated from app.bsky.graph.listblock *) 2 2 3 - type main = 4 - { 5 - subject: string; 6 - created_at: string [@key "createdAt"]; 7 - } 3 + type main = {subject: string; created_at: string [@key "createdAt"]} 8 4 [@@deriving yojson {strict= false}] 9 -
+3 -6
pegasus/lexicons/app_bsky_graph_listitem.ml
··· 1 1 (* generated from app.bsky.graph.listitem *) 2 2 3 3 type main = 4 - { 5 - subject: string; 6 - list_: string [@key "list"]; 7 - created_at: string [@key "createdAt"]; 8 - } 4 + { subject: string 5 + ; list_: string [@key "list"] 6 + ; created_at: string [@key "createdAt"] } 9 7 [@@deriving yojson {strict= false}] 10 -
+6 -10
pegasus/lexicons/app_bsky_graph_muteActor.ml
··· 5 5 let nsid = "app.bsky.graph.muteActor" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - actor: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {actor: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~actor 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~actor (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({actor} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+6 -10
pegasus/lexicons/app_bsky_graph_muteActorList.ml
··· 5 5 let nsid = "app.bsky.graph.muteActorList" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - list_: string [@key "list"]; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {list_: string [@key "list"]} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~list_ 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~list_ (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({list_} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+6 -10
pegasus/lexicons/app_bsky_graph_muteThread.ml
··· 5 5 let nsid = "app.bsky.graph.muteThread" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - root: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {root: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~root 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~root (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({root} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+9 -17
pegasus/lexicons/app_bsky_graph_searchStarterPacks.ml
··· 5 5 let nsid = "app.bsky.graph.searchStarterPacks" 6 6 7 7 type params = 8 - { 9 - q: string; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { q: string 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - starter_packs: App_bsky_graph_defs.starter_pack_view_basic list [@key "starterPacks"]; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; starter_packs: App_bsky_graph_defs.starter_pack_view_basic list 16 + [@key "starterPacks"] } 17 + [@@deriving yojson {strict= false}] 21 18 22 - let call 23 - ~q 24 - ?limit 25 - ?cursor 26 - (client : Hermes.client) : output Lwt.t = 19 + let call ~q ?limit ?cursor (client : Hermes.client) : output Lwt.t = 27 20 let params : params = {q; limit; cursor} in 28 21 Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 22 end 30 -
+8 -14
pegasus/lexicons/app_bsky_graph_starterpack.ml
··· 1 1 (* generated from app.bsky.graph.starterpack *) 2 2 3 - type feed_item = 4 - { 5 - uri: string; 6 - } 7 - [@@deriving yojson {strict= false}] 3 + type feed_item = {uri: string} [@@deriving yojson {strict= false}] 8 4 9 5 type main = 10 - { 11 - name: string; 12 - description: string option [@default None]; 13 - description_facets: App_bsky_richtext_facet.main list option [@key "descriptionFacets"] [@default None]; 14 - list_: string [@key "list"]; 15 - feeds: feed_item list option [@default None]; 16 - created_at: string [@key "createdAt"]; 17 - } 6 + { name: string 7 + ; description: string option [@default None] 8 + ; description_facets: App_bsky_richtext_facet.main list option 9 + [@key "descriptionFacets"] [@default None] 10 + ; list_: string [@key "list"] 11 + ; feeds: feed_item list option [@default None] 12 + ; created_at: string [@key "createdAt"] } 18 13 [@@deriving yojson {strict= false}] 19 -
+6 -10
pegasus/lexicons/app_bsky_graph_unmuteActor.ml
··· 5 5 let nsid = "app.bsky.graph.unmuteActor" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - actor: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {actor: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~actor 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~actor (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({actor} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+6 -10
pegasus/lexicons/app_bsky_graph_unmuteActorList.ml
··· 5 5 let nsid = "app.bsky.graph.unmuteActorList" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - list_: string [@key "list"]; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {list_: string [@key "list"]} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~list_ 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~list_ (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({list_} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+6 -10
pegasus/lexicons/app_bsky_graph_unmuteThread.ml
··· 5 5 let nsid = "app.bsky.graph.unmuteThread" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - root: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {root: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~root 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~root (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({root} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+4 -7
pegasus/lexicons/app_bsky_graph_verification.ml
··· 1 1 (* generated from app.bsky.graph.verification *) 2 2 3 3 type main = 4 - { 5 - subject: string; 6 - handle: string; 7 - display_name: string [@key "displayName"]; 8 - created_at: string [@key "createdAt"]; 9 - } 4 + { subject: string 5 + ; handle: string 6 + ; display_name: string [@key "displayName"] 7 + ; created_at: string [@key "createdAt"] } 10 8 [@@deriving yojson {strict= false}] 11 -
+16 -5
pegasus/lexicons/app_bsky_labeler_defs.ml
··· 1 1 (* re-exported from App_bsky_shared_1 *) 2 2 3 3 type labeler_view = App_bsky_shared_1.labeler_view 4 + 4 5 let labeler_view_of_yojson = App_bsky_shared_1.labeler_view_of_yojson 6 + 5 7 let labeler_view_to_yojson = App_bsky_shared_1.labeler_view_to_yojson 6 8 7 9 type labeler_view_detailed = App_bsky_shared_1.labeler_view_detailed 8 - let labeler_view_detailed_of_yojson = App_bsky_shared_1.labeler_view_detailed_of_yojson 9 - let labeler_view_detailed_to_yojson = App_bsky_shared_1.labeler_view_detailed_to_yojson 10 + 11 + let labeler_view_detailed_of_yojson = 12 + App_bsky_shared_1.labeler_view_detailed_of_yojson 13 + 14 + let labeler_view_detailed_to_yojson = 15 + App_bsky_shared_1.labeler_view_detailed_to_yojson 10 16 11 17 type labeler_viewer_state = App_bsky_shared_1.labeler_viewer_state 12 - let labeler_viewer_state_of_yojson = App_bsky_shared_1.labeler_viewer_state_of_yojson 13 - let labeler_viewer_state_to_yojson = App_bsky_shared_1.labeler_viewer_state_to_yojson 18 + 19 + let labeler_viewer_state_of_yojson = 20 + App_bsky_shared_1.labeler_viewer_state_of_yojson 21 + 22 + let labeler_viewer_state_to_yojson = 23 + App_bsky_shared_1.labeler_viewer_state_to_yojson 14 24 15 25 type labeler_policies = App_bsky_shared_1.labeler_policies 26 + 16 27 let labeler_policies_of_yojson = App_bsky_shared_1.labeler_policies_of_yojson 17 - let labeler_policies_to_yojson = App_bsky_shared_1.labeler_policies_to_yojson 18 28 29 + let labeler_policies_to_yojson = App_bsky_shared_1.labeler_policies_to_yojson
+47 -42
pegasus/lexicons/app_bsky_labeler_getServices.ml
··· 5 5 let nsid = "app.bsky.labeler.getServices" 6 6 7 7 type params = 8 - { 9 - dids: string list [@of_yojson Hermes_util.query_string_list_of_yojson] [@to_yojson Hermes_util.query_string_list_to_yojson]; 10 - detailed: bool option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + { dids: string list 9 + [@of_yojson Hermes_util.query_string_list_of_yojson] 10 + [@to_yojson Hermes_util.query_string_list_to_yojson] 11 + ; detailed: bool option [@default None] } 12 + [@@deriving yojson {strict= false}] 13 13 14 14 type views_item = 15 - | LabelerView of App_bsky_labeler_defs.labeler_view 16 - | LabelerViewDetailed of App_bsky_labeler_defs.labeler_view_detailed 17 - | Unknown of Yojson.Safe.t 15 + | LabelerView of App_bsky_labeler_defs.labeler_view 16 + | LabelerViewDetailed of App_bsky_labeler_defs.labeler_view_detailed 17 + | Unknown of Yojson.Safe.t 18 18 19 - let views_item_of_yojson json = 20 - let open Yojson.Safe.Util in 21 - try 22 - match json |> member "$type" |> to_string with 23 - | "app.bsky.labeler.defs#labelerView" -> 24 - (match App_bsky_labeler_defs.labeler_view_of_yojson json with 25 - | Ok v -> Ok (LabelerView v) 26 - | Error e -> Error e) 27 - | "app.bsky.labeler.defs#labelerViewDetailed" -> 28 - (match App_bsky_labeler_defs.labeler_view_detailed_of_yojson json with 29 - | Ok v -> Ok (LabelerViewDetailed v) 30 - | Error e -> Error e) 31 - | _ -> Ok (Unknown json) 32 - with _ -> Error "failed to parse union" 19 + let views_item_of_yojson json = 20 + let open Yojson.Safe.Util in 21 + try 22 + match json |> member "$type" |> to_string with 23 + | "app.bsky.labeler.defs#labelerView" -> ( 24 + match App_bsky_labeler_defs.labeler_view_of_yojson json with 25 + | Ok v -> 26 + Ok (LabelerView v) 27 + | Error e -> 28 + Error e ) 29 + | "app.bsky.labeler.defs#labelerViewDetailed" -> ( 30 + match App_bsky_labeler_defs.labeler_view_detailed_of_yojson json with 31 + | Ok v -> 32 + Ok (LabelerViewDetailed v) 33 + | Error e -> 34 + Error e ) 35 + | _ -> 36 + Ok (Unknown json) 37 + with _ -> Error "failed to parse union" 33 38 34 - let views_item_to_yojson = function 35 - | LabelerView v -> 36 - (match App_bsky_labeler_defs.labeler_view_to_yojson v with 37 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.labeler.defs#labelerView") :: fields) 38 - | other -> other) 39 - | LabelerViewDetailed v -> 40 - (match App_bsky_labeler_defs.labeler_view_detailed_to_yojson v with 41 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.labeler.defs#labelerViewDetailed") :: fields) 42 - | other -> other) 43 - | Unknown j -> j 39 + let views_item_to_yojson = function 40 + | LabelerView v -> ( 41 + match App_bsky_labeler_defs.labeler_view_to_yojson v with 42 + | `Assoc fields -> 43 + `Assoc 44 + (("$type", `String "app.bsky.labeler.defs#labelerView") :: fields) 45 + | other -> 46 + other ) 47 + | LabelerViewDetailed v -> ( 48 + match App_bsky_labeler_defs.labeler_view_detailed_to_yojson v with 49 + | `Assoc fields -> 50 + `Assoc 51 + ( ("$type", `String "app.bsky.labeler.defs#labelerViewDetailed") 52 + :: fields ) 53 + | other -> 54 + other ) 55 + | Unknown j -> 56 + j 44 57 45 - type output = 46 - { 47 - views: views_item list; 48 - } 49 - [@@deriving yojson {strict= false}] 58 + type output = {views: views_item list} [@@deriving yojson {strict= false}] 50 59 51 - let call 52 - ~dids 53 - ?detailed 54 - (client : Hermes.client) : output Lwt.t = 60 + let call ~dids ?detailed (client : Hermes.client) : output Lwt.t = 55 61 let params : params = {dids; detailed} in 56 62 Hermes.query client nsid (params_to_yojson params) output_of_yojson 57 63 end 58 -
+25 -19
pegasus/lexicons/app_bsky_labeler_service.ml
··· 8 8 let open Yojson.Safe.Util in 9 9 try 10 10 match json |> member "$type" |> to_string with 11 - | "com.atproto.label.defs#selfLabels" -> 12 - (match Com_atproto_label_defs.self_labels_of_yojson json with 13 - | Ok v -> Ok (SelfLabels v) 14 - | Error e -> Error e) 15 - | _ -> Ok (Unknown json) 11 + | "com.atproto.label.defs#selfLabels" -> ( 12 + match Com_atproto_label_defs.self_labels_of_yojson json with 13 + | Ok v -> 14 + Ok (SelfLabels v) 15 + | Error e -> 16 + Error e ) 17 + | _ -> 18 + Ok (Unknown json) 16 19 with _ -> Error "failed to parse union" 17 20 18 21 let labels_to_yojson = function 19 - | SelfLabels v -> 20 - (match Com_atproto_label_defs.self_labels_to_yojson v with 21 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.label.defs#selfLabels") :: fields) 22 - | other -> other) 23 - | Unknown j -> j 22 + | SelfLabels v -> ( 23 + match Com_atproto_label_defs.self_labels_to_yojson v with 24 + | `Assoc fields -> 25 + `Assoc (("$type", `String "com.atproto.label.defs#selfLabels") :: fields) 26 + | other -> 27 + other ) 28 + | Unknown j -> 29 + j 24 30 25 31 type main = 26 - { 27 - policies: App_bsky_labeler_defs.labeler_policies; 28 - labels: labels option [@default None]; 29 - created_at: string [@key "createdAt"]; 30 - reason_types: Com_atproto_moderation_defs.reason_type list option [@key "reasonTypes"] [@default None]; 31 - subject_types: Com_atproto_moderation_defs.subject_type list option [@key "subjectTypes"] [@default None]; 32 - subject_collections: string list option [@key "subjectCollections"] [@default None]; 33 - } 32 + { policies: App_bsky_labeler_defs.labeler_policies 33 + ; labels: labels option [@default None] 34 + ; created_at: string [@key "createdAt"] 35 + ; reason_types: Com_atproto_moderation_defs.reason_type list option 36 + [@key "reasonTypes"] [@default None] 37 + ; subject_types: Com_atproto_moderation_defs.subject_type list option 38 + [@key "subjectTypes"] [@default None] 39 + ; subject_collections: string list option 40 + [@key "subjectCollections"] [@default None] } 34 41 [@@deriving yojson {strict= false}] 35 -
+1 -5
pegasus/lexicons/app_bsky_notification_declaration.ml
··· 1 1 (* generated from app.bsky.notification.declaration *) 2 2 3 - type main = 4 - { 5 - allow_subscriptions: string [@key "allowSubscriptions"]; 6 - } 3 + type main = {allow_subscriptions: string [@key "allowSubscriptions"]} 7 4 [@@deriving yojson {strict= false}] 8 -
+21 -39
pegasus/lexicons/app_bsky_notification_defs.ml
··· 1 1 (* generated from app.bsky.notification.defs *) 2 2 3 3 type record_deleted = unit 4 + 4 5 let record_deleted_of_yojson _ = Ok () 6 + 5 7 let record_deleted_to_yojson () = `Assoc [] 6 8 7 - type chat_preference = 8 - { 9 - include_: string [@key "include"]; 10 - push: bool; 11 - } 9 + type chat_preference = {include_: string [@key "include"]; push: bool} 12 10 [@@deriving yojson {strict= false}] 13 11 14 12 type filterable_preference = 15 - { 16 - include_: string [@key "include"]; 17 - list_: bool [@key "list"]; 18 - push: bool; 19 - } 13 + {include_: string [@key "include"]; list_: bool [@key "list"]; push: bool} 20 14 [@@deriving yojson {strict= false}] 21 15 22 - type preference = 23 - { 24 - list_: bool [@key "list"]; 25 - push: bool; 26 - } 16 + type preference = {list_: bool [@key "list"]; push: bool} 27 17 [@@deriving yojson {strict= false}] 28 18 29 19 type preferences = 30 - { 31 - chat: chat_preference; 32 - follow: filterable_preference; 33 - like: filterable_preference; 34 - like_via_repost: filterable_preference [@key "likeViaRepost"]; 35 - mention: filterable_preference; 36 - quote: filterable_preference; 37 - reply: filterable_preference; 38 - repost: filterable_preference; 39 - repost_via_repost: filterable_preference [@key "repostViaRepost"]; 40 - starterpack_joined: preference [@key "starterpackJoined"]; 41 - subscribed_post: preference [@key "subscribedPost"]; 42 - unverified: preference; 43 - verified: preference; 44 - } 20 + { chat: chat_preference 21 + ; follow: filterable_preference 22 + ; like: filterable_preference 23 + ; like_via_repost: filterable_preference [@key "likeViaRepost"] 24 + ; mention: filterable_preference 25 + ; quote: filterable_preference 26 + ; reply: filterable_preference 27 + ; repost: filterable_preference 28 + ; repost_via_repost: filterable_preference [@key "repostViaRepost"] 29 + ; starterpack_joined: preference [@key "starterpackJoined"] 30 + ; subscribed_post: preference [@key "subscribedPost"] 31 + ; unverified: preference 32 + ; verified: preference } 45 33 [@@deriving yojson {strict= false}] 46 34 47 - type activity_subscription = 48 - { 49 - post: bool; 50 - reply: bool; 51 - } 35 + type activity_subscription = {post: bool; reply: bool} 52 36 [@@deriving yojson {strict= false}] 53 37 54 38 type subject_activity_subscription = 55 - { 56 - subject: string; 57 - activity_subscription: activity_subscription [@key "activitySubscription"]; 39 + { subject: string 40 + ; activity_subscription: activity_subscription [@key "activitySubscription"] 58 41 } 59 42 [@@deriving yojson {strict= false}] 60 -
+4 -8
pegasus/lexicons/app_bsky_notification_getPreferences.ml
··· 5 5 let nsid = "app.bsky.notification.getPreferences" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type output = 11 - { 12 - preferences: App_bsky_notification_defs.preferences; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type output = {preferences: App_bsky_notification_defs.preferences} 12 + [@@deriving yojson {strict= false}] 15 13 16 - let call 17 - (client : Hermes.client) : output Lwt.t = 14 + let call (client : Hermes.client) : output Lwt.t = 18 15 Hermes.query client nsid (`Assoc []) output_of_yojson 19 16 end 20 -
+5 -15
pegasus/lexicons/app_bsky_notification_getUnreadCount.ml
··· 5 5 let nsid = "app.bsky.notification.getUnreadCount" 6 6 7 7 type params = 8 - { 9 - priority: bool option [@default None]; 10 - seen_at: string option [@key "seenAt"] [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + { priority: bool option [@default None] 9 + ; seen_at: string option [@key "seenAt"] [@default None] } 10 + [@@deriving yojson {strict= false}] 13 11 14 - type output = 15 - { 16 - count: int; 17 - } 18 - [@@deriving yojson {strict= false}] 12 + type output = {count: int} [@@deriving yojson {strict= false}] 19 13 20 - let call 21 - ?priority 22 - ?seen_at 23 - (client : Hermes.client) : output Lwt.t = 14 + let call ?priority ?seen_at (client : Hermes.client) : output Lwt.t = 24 15 let params : params = {priority; seen_at} in 25 16 Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 17 end 27 -
+6 -15
pegasus/lexicons/app_bsky_notification_listActivitySubscriptions.ml
··· 5 5 let nsid = "app.bsky.notification.listActivitySubscriptions" 6 6 7 7 type params = 8 - { 9 - limit: int option [@default None]; 10 - cursor: string option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {limit: int option [@default None]; cursor: string option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 11 type output = 15 - { 16 - cursor: string option [@default None]; 17 - subscriptions: App_bsky_actor_defs.profile_view list; 18 - } 19 - [@@deriving yojson {strict= false}] 12 + { cursor: string option [@default None] 13 + ; subscriptions: App_bsky_actor_defs.profile_view list } 14 + [@@deriving yojson {strict= false}] 20 15 21 - let call 22 - ?limit 23 - ?cursor 24 - (client : Hermes.client) : output Lwt.t = 16 + let call ?limit ?cursor (client : Hermes.client) : output Lwt.t = 25 17 let params : params = {limit; cursor} in 26 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 19 end 28 -
+25 -34
pegasus/lexicons/app_bsky_notification_listNotifications.ml
··· 1 1 (* generated from app.bsky.notification.listNotifications *) 2 2 3 3 type notification = 4 - { 5 - uri: string; 6 - cid: string; 7 - author: App_bsky_actor_defs.profile_view; 8 - reason: string; 9 - reason_subject: string option [@key "reasonSubject"] [@default None]; 10 - record: Yojson.Safe.t; 11 - is_read: bool [@key "isRead"]; 12 - indexed_at: string [@key "indexedAt"]; 13 - labels: Com_atproto_label_defs.label list option [@default None]; 14 - } 4 + { uri: string 5 + ; cid: string 6 + ; author: App_bsky_actor_defs.profile_view 7 + ; reason: string 8 + ; reason_subject: string option [@key "reasonSubject"] [@default None] 9 + ; record: Yojson.Safe.t 10 + ; is_read: bool [@key "isRead"] 11 + ; indexed_at: string [@key "indexedAt"] 12 + ; labels: Com_atproto_label_defs.label list option [@default None] } 15 13 [@@deriving yojson {strict= false}] 16 14 17 15 (** Enumerate notifications for the requesting account. Requires auth. *) ··· 19 17 let nsid = "app.bsky.notification.listNotifications" 20 18 21 19 type params = 22 - { 23 - reasons: string list option [@default None] [@of_yojson Hermes_util.query_string_list_option_of_yojson] [@to_yojson Hermes_util.query_string_list_option_to_yojson]; 24 - limit: int option [@default None]; 25 - priority: bool option [@default None]; 26 - cursor: string option [@default None]; 27 - seen_at: string option [@key "seenAt"] [@default None]; 28 - } 29 - [@@deriving yojson {strict= false}] 20 + { reasons: string list option 21 + [@default None] 22 + [@of_yojson Hermes_util.query_string_list_option_of_yojson] 23 + [@to_yojson Hermes_util.query_string_list_option_to_yojson] 24 + ; limit: int option [@default None] 25 + ; priority: bool option [@default None] 26 + ; cursor: string option [@default None] 27 + ; seen_at: string option [@key "seenAt"] [@default None] } 28 + [@@deriving yojson {strict= false}] 30 29 31 30 type output = 32 - { 33 - cursor: string option [@default None]; 34 - notifications: notification list; 35 - priority: bool option [@default None]; 36 - seen_at: string option [@key "seenAt"] [@default None]; 37 - } 38 - [@@deriving yojson {strict= false}] 31 + { cursor: string option [@default None] 32 + ; notifications: notification list 33 + ; priority: bool option [@default None] 34 + ; seen_at: string option [@key "seenAt"] [@default None] } 35 + [@@deriving yojson {strict= false}] 39 36 40 - let call 41 - ?reasons 42 - ?limit 43 - ?priority 44 - ?cursor 45 - ?seen_at 46 - (client : Hermes.client) : output Lwt.t = 37 + let call ?reasons ?limit ?priority ?cursor ?seen_at (client : Hermes.client) : 38 + output Lwt.t = 47 39 let params : params = {reasons; limit; priority; cursor; seen_at} in 48 40 Hermes.query client nsid (params_to_yojson params) output_of_yojson 49 41 end 50 -
+13 -15
pegasus/lexicons/app_bsky_notification_putActivitySubscription.ml
··· 5 5 let nsid = "app.bsky.notification.putActivitySubscription" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - subject: string; 13 - activity_subscription: App_bsky_notification_defs.activity_subscription [@key "activitySubscription"]; 14 - } 12 + { subject: string 13 + ; activity_subscription: App_bsky_notification_defs.activity_subscription 14 + [@key "activitySubscription"] } 15 15 [@@deriving yojson {strict= false}] 16 16 17 17 type output = 18 - { 19 - subject: string; 20 - activity_subscription: App_bsky_notification_defs.activity_subscription option [@key "activitySubscription"] [@default None]; 21 - } 22 - [@@deriving yojson {strict= false}] 18 + { subject: string 19 + ; activity_subscription: 20 + App_bsky_notification_defs.activity_subscription option 21 + [@key "activitySubscription"] [@default None] } 22 + [@@deriving yojson {strict= false}] 23 23 24 - let call 25 - ~subject 26 - ~activity_subscription 27 - (client : Hermes.client) : output Lwt.t = 24 + let call ~subject ~activity_subscription (client : Hermes.client) : 25 + output Lwt.t = 28 26 let params = () in 29 27 let input = Some ({subject; activity_subscription} |> input_to_yojson) in 30 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 28 + Hermes.procedure client nsid (params_to_yojson params) input 29 + output_of_yojson 31 30 end 32 -
+6 -10
pegasus/lexicons/app_bsky_notification_putPreferences.ml
··· 5 5 let nsid = "app.bsky.notification.putPreferences" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - priority: bool; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {priority: bool} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~priority 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~priority (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({priority} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+48 -38
pegasus/lexicons/app_bsky_notification_putPreferencesV2.ml
··· 5 5 let nsid = "app.bsky.notification.putPreferencesV2" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - chat: App_bsky_notification_defs.chat_preference option [@default None]; 13 - follow: App_bsky_notification_defs.filterable_preference option [@default None]; 14 - like: App_bsky_notification_defs.filterable_preference option [@default None]; 15 - like_via_repost: App_bsky_notification_defs.filterable_preference option [@key "likeViaRepost"] [@default None]; 16 - mention: App_bsky_notification_defs.filterable_preference option [@default None]; 17 - quote: App_bsky_notification_defs.filterable_preference option [@default None]; 18 - reply: App_bsky_notification_defs.filterable_preference option [@default None]; 19 - repost: App_bsky_notification_defs.filterable_preference option [@default None]; 20 - repost_via_repost: App_bsky_notification_defs.filterable_preference option [@key "repostViaRepost"] [@default None]; 21 - starterpack_joined: App_bsky_notification_defs.preference option [@key "starterpackJoined"] [@default None]; 22 - subscribed_post: App_bsky_notification_defs.preference option [@key "subscribedPost"] [@default None]; 23 - unverified: App_bsky_notification_defs.preference option [@default None]; 24 - verified: App_bsky_notification_defs.preference option [@default None]; 25 - } 12 + { chat: App_bsky_notification_defs.chat_preference option [@default None] 13 + ; follow: App_bsky_notification_defs.filterable_preference option 14 + [@default None] 15 + ; like: App_bsky_notification_defs.filterable_preference option 16 + [@default None] 17 + ; like_via_repost: App_bsky_notification_defs.filterable_preference option 18 + [@key "likeViaRepost"] [@default None] 19 + ; mention: App_bsky_notification_defs.filterable_preference option 20 + [@default None] 21 + ; quote: App_bsky_notification_defs.filterable_preference option 22 + [@default None] 23 + ; reply: App_bsky_notification_defs.filterable_preference option 24 + [@default None] 25 + ; repost: App_bsky_notification_defs.filterable_preference option 26 + [@default None] 27 + ; repost_via_repost: App_bsky_notification_defs.filterable_preference option 28 + [@key "repostViaRepost"] [@default None] 29 + ; starterpack_joined: App_bsky_notification_defs.preference option 30 + [@key "starterpackJoined"] [@default None] 31 + ; subscribed_post: App_bsky_notification_defs.preference option 32 + [@key "subscribedPost"] [@default None] 33 + ; unverified: App_bsky_notification_defs.preference option [@default None] 34 + ; verified: App_bsky_notification_defs.preference option [@default None] } 26 35 [@@deriving yojson {strict= false}] 27 36 28 - type output = 29 - { 30 - preferences: App_bsky_notification_defs.preferences; 31 - } 32 - [@@deriving yojson {strict= false}] 37 + type output = {preferences: App_bsky_notification_defs.preferences} 38 + [@@deriving yojson {strict= false}] 33 39 34 - let call 35 - ?chat 36 - ?follow 37 - ?like 38 - ?like_via_repost 39 - ?mention 40 - ?quote 41 - ?reply 42 - ?repost 43 - ?repost_via_repost 44 - ?starterpack_joined 45 - ?subscribed_post 46 - ?unverified 47 - ?verified 48 - (client : Hermes.client) : output Lwt.t = 40 + let call ?chat ?follow ?like ?like_via_repost ?mention ?quote ?reply ?repost 41 + ?repost_via_repost ?starterpack_joined ?subscribed_post ?unverified 42 + ?verified (client : Hermes.client) : output Lwt.t = 49 43 let params = () in 50 - let input = Some ({chat; follow; like; like_via_repost; mention; quote; reply; repost; repost_via_repost; starterpack_joined; subscribed_post; unverified; verified} |> input_to_yojson) in 51 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 44 + let input = 45 + Some 46 + ( { chat 47 + ; follow 48 + ; like 49 + ; like_via_repost 50 + ; mention 51 + ; quote 52 + ; reply 53 + ; repost 54 + ; repost_via_repost 55 + ; starterpack_joined 56 + ; subscribed_post 57 + ; unverified 58 + ; verified } 59 + |> input_to_yojson ) 60 + in 61 + Hermes.procedure client nsid (params_to_yojson params) input 62 + output_of_yojson 52 63 end 53 -
+15 -16
pegasus/lexicons/app_bsky_notification_registerPush.ml
··· 5 5 let nsid = "app.bsky.notification.registerPush" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - service_did: string [@key "serviceDid"]; 13 - token: string; 14 - platform: string; 15 - app_id: string [@key "appId"]; 16 - age_restricted: bool option [@key "ageRestricted"] [@default None]; 17 - } 12 + { service_did: string [@key "serviceDid"] 13 + ; token: string 14 + ; platform: string 15 + ; app_id: string [@key "appId"] 16 + ; age_restricted: bool option [@key "ageRestricted"] [@default None] } 18 17 [@@deriving yojson {strict= false}] 19 18 20 19 type output = unit 20 + 21 21 let output_of_yojson _ = Ok () 22 22 23 - let call 24 - ~service_did 25 - ~token 26 - ~platform 27 - ~app_id 28 - ?age_restricted 23 + let call ~service_did ~token ~platform ~app_id ?age_restricted 29 24 (client : Hermes.client) : output Lwt.t = 30 25 let params = () in 31 - let input = Some ({service_did; token; platform; app_id; age_restricted} |> input_to_yojson) in 32 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 26 + let input = 27 + Some 28 + ( {service_did; token; platform; app_id; age_restricted} 29 + |> input_to_yojson ) 30 + in 31 + Hermes.procedure client nsid (params_to_yojson params) input 32 + output_of_yojson 33 33 end 34 -
+13 -15
pegasus/lexicons/app_bsky_notification_unregisterPush.ml
··· 5 5 let nsid = "app.bsky.notification.unregisterPush" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - service_did: string [@key "serviceDid"]; 13 - token: string; 14 - platform: string; 15 - app_id: string [@key "appId"]; 16 - } 12 + { service_did: string [@key "serviceDid"] 13 + ; token: string 14 + ; platform: string 15 + ; app_id: string [@key "appId"] } 17 16 [@@deriving yojson {strict= false}] 18 17 19 18 type output = unit 19 + 20 20 let output_of_yojson _ = Ok () 21 21 22 - let call 23 - ~service_did 24 - ~token 25 - ~platform 26 - ~app_id 27 - (client : Hermes.client) : output Lwt.t = 22 + let call ~service_did ~token ~platform ~app_id (client : Hermes.client) : 23 + output Lwt.t = 28 24 let params = () in 29 - let input = Some ({service_did; token; platform; app_id} |> input_to_yojson) in 30 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + let input = 26 + Some ({service_did; token; platform; app_id} |> input_to_yojson) 27 + in 28 + Hermes.procedure client nsid (params_to_yojson params) input 29 + output_of_yojson 31 30 end 32 -
+6 -9
pegasus/lexicons/app_bsky_notification_updateSeen.ml
··· 5 5 let nsid = "app.bsky.notification.updateSeen" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - seen_at: string [@key "seenAt"]; 13 - } 11 + type input = {seen_at: string [@key "seenAt"]} 14 12 [@@deriving yojson {strict= false}] 15 13 16 14 type output = unit 15 + 17 16 let output_of_yojson _ = Ok () 18 17 19 - let call 20 - ~seen_at 21 - (client : Hermes.client) : output Lwt.t = 18 + let call ~seen_at (client : Hermes.client) : output Lwt.t = 22 19 let params = () in 23 20 let input = Some ({seen_at} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 25 23 end 26 -
+37 -51
pegasus/lexicons/app_bsky_richtext_facet.ml
··· 1 1 (* generated from app.bsky.richtext.facet *) 2 2 3 - type tag = 4 - { 5 - tag: string; 6 - } 7 - [@@deriving yojson {strict= false}] 3 + type tag = {tag: string} [@@deriving yojson {strict= false}] 8 4 9 - type link = 10 - { 11 - uri: string; 12 - } 13 - [@@deriving yojson {strict= false}] 5 + type link = {uri: string} [@@deriving yojson {strict= false}] 14 6 15 - type mention = 16 - { 17 - did: string; 18 - } 19 - [@@deriving yojson {strict= false}] 7 + type mention = {did: string} [@@deriving yojson {strict= false}] 20 8 21 9 type byte_slice = 22 - { 23 - byte_start: int [@key "byteStart"]; 24 - byte_end: int [@key "byteEnd"]; 25 - } 10 + {byte_start: int [@key "byteStart"]; byte_end: int [@key "byteEnd"]} 26 11 [@@deriving yojson {strict= false}] 27 12 28 13 type features_item = ··· 35 20 let open Yojson.Safe.Util in 36 21 try 37 22 match json |> member "$type" |> to_string with 38 - | "app.bsky.richtext.facet#mention" -> 39 - (match mention_of_yojson json with 40 - | Ok v -> Ok (Mention v) 41 - | Error e -> Error e) 42 - | "app.bsky.richtext.facet#link" -> 43 - (match link_of_yojson json with 44 - | Ok v -> Ok (Link v) 45 - | Error e -> Error e) 46 - | "app.bsky.richtext.facet#tag" -> 47 - (match tag_of_yojson json with 48 - | Ok v -> Ok (Tag v) 49 - | Error e -> Error e) 50 - | _ -> Ok (Unknown json) 23 + | "app.bsky.richtext.facet#mention" -> ( 24 + match mention_of_yojson json with 25 + | Ok v -> 26 + Ok (Mention v) 27 + | Error e -> 28 + Error e ) 29 + | "app.bsky.richtext.facet#link" -> ( 30 + match link_of_yojson json with Ok v -> Ok (Link v) | Error e -> Error e ) 31 + | "app.bsky.richtext.facet#tag" -> ( 32 + match tag_of_yojson json with Ok v -> Ok (Tag v) | Error e -> Error e ) 33 + | _ -> 34 + Ok (Unknown json) 51 35 with _ -> Error "failed to parse union" 52 36 53 37 let features_item_to_yojson = function 54 - | Mention v -> 55 - (match mention_to_yojson v with 56 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.richtext.facet#mention") :: fields) 57 - | other -> other) 58 - | Link v -> 59 - (match link_to_yojson v with 60 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.richtext.facet#link") :: fields) 61 - | other -> other) 62 - | Tag v -> 63 - (match tag_to_yojson v with 64 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.richtext.facet#tag") :: fields) 65 - | other -> other) 66 - | Unknown j -> j 38 + | Mention v -> ( 39 + match mention_to_yojson v with 40 + | `Assoc fields -> 41 + `Assoc (("$type", `String "app.bsky.richtext.facet#mention") :: fields) 42 + | other -> 43 + other ) 44 + | Link v -> ( 45 + match link_to_yojson v with 46 + | `Assoc fields -> 47 + `Assoc (("$type", `String "app.bsky.richtext.facet#link") :: fields) 48 + | other -> 49 + other ) 50 + | Tag v -> ( 51 + match tag_to_yojson v with 52 + | `Assoc fields -> 53 + `Assoc (("$type", `String "app.bsky.richtext.facet#tag") :: fields) 54 + | other -> 55 + other ) 56 + | Unknown j -> 57 + j 67 58 68 - type main = 69 - { 70 - index: byte_slice; 71 - features: features_item list; 72 - } 59 + type main = {index: byte_slice; features: features_item list} 73 60 [@@deriving yojson {strict= false}] 74 -
+1323 -958
pegasus/lexicons/app_bsky_shared_1.ml
··· 8 8 let open Yojson.Safe.Util in 9 9 try 10 10 match json |> member "$type" |> to_string with 11 - | "app.bsky.embed.external#view" -> 12 - (match App_bsky_embed_external.view_of_yojson json with 13 - | Ok v -> Ok (ExternalView v) 14 - | Error e -> Error e) 15 - | _ -> Ok (Unknown json) 11 + | "app.bsky.embed.external#view" -> ( 12 + match App_bsky_embed_external.view_of_yojson json with 13 + | Ok v -> 14 + Ok (ExternalView v) 15 + | Error e -> 16 + Error e ) 17 + | _ -> 18 + Ok (Unknown json) 16 19 with _ -> Error "failed to parse union" 17 20 18 21 let actor_embed_to_yojson = function 19 - | ExternalView v -> 20 - (match App_bsky_embed_external.view_to_yojson v with 21 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.external#view") :: fields) 22 - | other -> other) 23 - | Unknown j -> j 22 + | ExternalView v -> ( 23 + match App_bsky_embed_external.view_to_yojson v with 24 + | `Assoc fields -> 25 + `Assoc (("$type", `String "app.bsky.embed.external#view") :: fields) 26 + | other -> 27 + other ) 28 + | Unknown j -> 29 + j 24 30 25 31 type status_view = 26 - { 27 - status: string; 28 - record: Yojson.Safe.t; 29 - embed: actor_embed option [@default None]; 30 - expires_at: string option [@key "expiresAt"] [@default None]; 31 - is_active: bool option [@key "isActive"] [@default None]; 32 - } 32 + { status: string 33 + ; record: Yojson.Safe.t 34 + ; embed: actor_embed option [@default None] 35 + ; expires_at: string option [@key "expiresAt"] [@default None] 36 + ; is_active: bool option [@key "isActive"] [@default None] } 33 37 [@@deriving yojson {strict= false}] 34 38 35 39 type verification_view = 36 - { 37 - issuer: string; 38 - uri: string; 39 - is_valid: bool [@key "isValid"]; 40 - created_at: string [@key "createdAt"]; 41 - } 40 + { issuer: string 41 + ; uri: string 42 + ; is_valid: bool [@key "isValid"] 43 + ; created_at: string [@key "createdAt"] } 42 44 [@@deriving yojson {strict= false}] 43 45 44 46 type verification_state = 45 - { 46 - verifications: verification_view list; 47 - verified_status: string [@key "verifiedStatus"]; 48 - trusted_verifier_status: string [@key "trustedVerifierStatus"]; 49 - } 47 + { verifications: verification_view list 48 + ; verified_status: string [@key "verifiedStatus"] 49 + ; trusted_verifier_status: string [@key "trustedVerifierStatus"] } 50 50 [@@deriving yojson {strict= false}] 51 51 52 52 type list_viewer_state = 53 - { 54 - muted: bool option [@default None]; 55 - blocked: string option [@default None]; 56 - } 53 + {muted: bool option [@default None]; blocked: string option [@default None]} 57 54 [@@deriving yojson {strict= false}] 58 55 59 56 (** string type with known values *) 60 57 type list_purpose = string 58 + 61 59 let list_purpose_of_yojson = function 62 - | `String s -> Ok s 63 - | _ -> Error "list_purpose: expected string" 60 + | `String s -> 61 + Ok s 62 + | _ -> 63 + Error "list_purpose: expected string" 64 + 64 65 let list_purpose_to_yojson s = `String s 65 66 66 67 type list_view_basic = 67 - { 68 - uri: string; 69 - cid: string; 70 - name: string; 71 - purpose: list_purpose; 72 - avatar: string option [@default None]; 73 - list_item_count: int option [@key "listItemCount"] [@default None]; 74 - labels: Com_atproto_label_defs.label list option [@default None]; 75 - viewer: list_viewer_state option [@default None]; 76 - indexed_at: string option [@key "indexedAt"] [@default None]; 77 - } 68 + { uri: string 69 + ; cid: string 70 + ; name: string 71 + ; purpose: list_purpose 72 + ; avatar: string option [@default None] 73 + ; list_item_count: int option [@key "listItemCount"] [@default None] 74 + ; labels: Com_atproto_label_defs.label list option [@default None] 75 + ; viewer: list_viewer_state option [@default None] 76 + ; indexed_at: string option [@key "indexedAt"] [@default None] } 78 77 [@@deriving yojson {strict= false}] 79 78 80 79 type profile_associated_activity_subscription = 81 - { 82 - allow_subscriptions: string [@key "allowSubscriptions"]; 83 - } 80 + {allow_subscriptions: string [@key "allowSubscriptions"]} 84 81 [@@deriving yojson {strict= false}] 85 82 86 - type profile_associated_chat = 87 - { 88 - allow_incoming: string [@key "allowIncoming"]; 89 - } 83 + type profile_associated_chat = {allow_incoming: string [@key "allowIncoming"]} 90 84 [@@deriving yojson {strict= false}] 91 85 92 86 type profile_associated = 93 - { 94 - lists: int option [@default None]; 95 - feedgens: int option [@default None]; 96 - starter_packs: int option [@key "starterPacks"] [@default None]; 97 - labeler: bool option [@default None]; 98 - chat: profile_associated_chat option [@default None]; 99 - activity_subscription: profile_associated_activity_subscription option [@key "activitySubscription"] [@default None]; 100 - } 87 + { lists: int option [@default None] 88 + ; feedgens: int option [@default None] 89 + ; starter_packs: int option [@key "starterPacks"] [@default None] 90 + ; labeler: bool option [@default None] 91 + ; chat: profile_associated_chat option [@default None] 92 + ; activity_subscription: profile_associated_activity_subscription option 93 + [@key "activitySubscription"] [@default None] } 101 94 [@@deriving yojson {strict= false}] 102 95 103 - type profile_view_basic = { 104 - did: string; 105 - handle: string; 106 - display_name: string option [@key "displayName"] [@default None]; 107 - avatar: string option [@default None]; 108 - associated: profile_associated option [@default None]; 109 - viewer: actor_viewer_state option [@default None]; 110 - labels: Com_atproto_label_defs.label list option [@default None]; 111 - created_at: string option [@key "createdAt"] [@default None]; 112 - verification: verification_state option [@default None]; 113 - status: status_view option [@default None]; 114 - } 115 - and actor_viewer_state = { 116 - muted: bool option [@default None]; 117 - muted_by_list: list_view_basic option [@key "mutedByList"] [@default None]; 118 - blocked_by: bool option [@key "blockedBy"] [@default None]; 119 - blocking: string option [@default None]; 120 - blocking_by_list: list_view_basic option [@key "blockingByList"] [@default None]; 121 - following: string option [@default None]; 122 - followed_by: string option [@key "followedBy"] [@default None]; 123 - known_followers: known_followers option [@key "knownFollowers"] [@default None]; 124 - activity_subscription: App_bsky_notification_defs.activity_subscription option [@key "activitySubscription"] [@default None]; 125 - } 126 - and known_followers = { 127 - count: int; 128 - followers: profile_view_basic list; 129 - } 96 + type profile_view_basic = 97 + { did: string 98 + ; handle: string 99 + ; display_name: string option [@key "displayName"] [@default None] 100 + ; avatar: string option [@default None] 101 + ; associated: profile_associated option [@default None] 102 + ; viewer: actor_viewer_state option [@default None] 103 + ; labels: Com_atproto_label_defs.label list option [@default None] 104 + ; created_at: string option [@key "createdAt"] [@default None] 105 + ; verification: verification_state option [@default None] 106 + ; status: status_view option [@default None] } 107 + 108 + and actor_viewer_state = 109 + { muted: bool option [@default None] 110 + ; muted_by_list: list_view_basic option [@key "mutedByList"] [@default None] 111 + ; blocked_by: bool option [@key "blockedBy"] [@default None] 112 + ; blocking: string option [@default None] 113 + ; blocking_by_list: list_view_basic option 114 + [@key "blockingByList"] [@default None] 115 + ; following: string option [@default None] 116 + ; followed_by: string option [@key "followedBy"] [@default None] 117 + ; known_followers: known_followers option 118 + [@key "knownFollowers"] [@default None] 119 + ; activity_subscription: 120 + App_bsky_notification_defs.activity_subscription option 121 + [@key "activitySubscription"] [@default None] } 122 + 123 + and known_followers = {count: int; followers: profile_view_basic list} 130 124 131 125 let rec profile_view_basic_of_yojson json = 132 126 let open Yojson.Safe.Util in ··· 135 129 let handle = json |> member "handle" |> to_string in 136 130 let display_name = json |> member "displayName" |> to_option to_string in 137 131 let avatar = json |> member "avatar" |> to_option to_string in 138 - let associated = json |> member "associated" |> to_option (fun x -> match profile_associated_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 139 - let viewer = json |> member "viewer" |> to_option (fun x -> match actor_viewer_state_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 140 - let labels = json |> member "labels" |> to_option (fun j -> to_list j |> List.filter_map (fun x -> match Com_atproto_label_defs.label_of_yojson x with Ok v -> Some v | _ -> None)) in 132 + let associated = 133 + json |> member "associated" 134 + |> to_option (fun x -> 135 + match profile_associated_of_yojson x with Ok v -> Some v | _ -> None ) 136 + |> Option.join 137 + in 138 + let viewer = 139 + json |> member "viewer" 140 + |> to_option (fun x -> 141 + match actor_viewer_state_of_yojson x with Ok v -> Some v | _ -> None ) 142 + |> Option.join 143 + in 144 + let labels = 145 + json |> member "labels" 146 + |> to_option (fun j -> 147 + to_list j 148 + |> List.filter_map (fun x -> 149 + match Com_atproto_label_defs.label_of_yojson x with 150 + | Ok v -> 151 + Some v 152 + | _ -> 153 + None ) ) 154 + in 141 155 let created_at = json |> member "createdAt" |> to_option to_string in 142 - let verification = json |> member "verification" |> to_option (fun x -> match verification_state_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 143 - let status = json |> member "status" |> to_option (fun x -> match status_view_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 144 - Ok { did; handle; display_name; avatar; associated; viewer; labels; created_at; verification; status } 156 + let verification = 157 + json |> member "verification" 158 + |> to_option (fun x -> 159 + match verification_state_of_yojson x with Ok v -> Some v | _ -> None ) 160 + |> Option.join 161 + in 162 + let status = 163 + json |> member "status" 164 + |> to_option (fun x -> 165 + match status_view_of_yojson x with Ok v -> Some v | _ -> None ) 166 + |> Option.join 167 + in 168 + Ok 169 + { did 170 + ; handle 171 + ; display_name 172 + ; avatar 173 + ; associated 174 + ; viewer 175 + ; labels 176 + ; created_at 177 + ; verification 178 + ; status } 145 179 with e -> Error (Printexc.to_string e) 146 180 147 181 and actor_viewer_state_of_yojson json = 148 182 let open Yojson.Safe.Util in 149 183 try 150 184 let muted = json |> member "muted" |> to_option to_bool in 151 - let muted_by_list = json |> member "mutedByList" |> to_option (fun x -> match list_view_basic_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 185 + let muted_by_list = 186 + json |> member "mutedByList" 187 + |> to_option (fun x -> 188 + match list_view_basic_of_yojson x with Ok v -> Some v | _ -> None ) 189 + |> Option.join 190 + in 152 191 let blocked_by = json |> member "blockedBy" |> to_option to_bool in 153 192 let blocking = json |> member "blocking" |> to_option to_string in 154 - let blocking_by_list = json |> member "blockingByList" |> to_option (fun x -> match list_view_basic_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 193 + let blocking_by_list = 194 + json |> member "blockingByList" 195 + |> to_option (fun x -> 196 + match list_view_basic_of_yojson x with Ok v -> Some v | _ -> None ) 197 + |> Option.join 198 + in 155 199 let following = json |> member "following" |> to_option to_string in 156 200 let followed_by = json |> member "followedBy" |> to_option to_string in 157 - let known_followers = json |> member "knownFollowers" |> to_option (fun x -> match known_followers_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 158 - let activity_subscription = json |> member "activitySubscription" |> to_option (fun x -> match App_bsky_notification_defs.activity_subscription_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 159 - Ok { muted; muted_by_list; blocked_by; blocking; blocking_by_list; following; followed_by; known_followers; activity_subscription } 201 + let known_followers = 202 + json |> member "knownFollowers" 203 + |> to_option (fun x -> 204 + match known_followers_of_yojson x with Ok v -> Some v | _ -> None ) 205 + |> Option.join 206 + in 207 + let activity_subscription = 208 + json 209 + |> member "activitySubscription" 210 + |> to_option (fun x -> 211 + match 212 + App_bsky_notification_defs.activity_subscription_of_yojson x 213 + with 214 + | Ok v -> 215 + Some v 216 + | _ -> 217 + None ) 218 + |> Option.join 219 + in 220 + Ok 221 + { muted 222 + ; muted_by_list 223 + ; blocked_by 224 + ; blocking 225 + ; blocking_by_list 226 + ; following 227 + ; followed_by 228 + ; known_followers 229 + ; activity_subscription } 160 230 with e -> Error (Printexc.to_string e) 161 231 162 232 and known_followers_of_yojson json = 163 233 let open Yojson.Safe.Util in 164 234 try 165 235 let count = json |> member "count" |> to_int in 166 - let followers = json |> member "followers" |> (fun j -> to_list j |> List.filter_map (fun x -> match profile_view_basic_of_yojson x with Ok v -> Some v | _ -> None)) in 167 - Ok { count; followers } 236 + let followers = 237 + json |> member "followers" 238 + |> fun j -> 239 + to_list j 240 + |> List.filter_map (fun x -> 241 + match profile_view_basic_of_yojson x with Ok v -> Some v | _ -> None ) 242 + in 243 + Ok {count; followers} 168 244 with e -> Error (Printexc.to_string e) 169 245 170 246 and profile_view_basic_to_yojson (r : profile_view_basic) = 171 - `Assoc [ 172 - ("did", (fun s -> `String s) r.did); 173 - ("handle", (fun s -> `String s) r.handle); 174 - ("displayName", match r.display_name with Some v -> (fun s -> `String s) v | None -> `Null); 175 - ("avatar", match r.avatar with Some v -> (fun s -> `String s) v | None -> `Null); 176 - ("associated", match r.associated with Some v -> profile_associated_to_yojson v | None -> `Null); 177 - ("viewer", match r.viewer with Some v -> actor_viewer_state_to_yojson v | None -> `Null); 178 - ("labels", match r.labels with Some v -> (fun l -> `List (List.map Com_atproto_label_defs.label_to_yojson l)) v | None -> `Null); 179 - ("createdAt", match r.created_at with Some v -> (fun s -> `String s) v | None -> `Null); 180 - ("verification", match r.verification with Some v -> verification_state_to_yojson v | None -> `Null); 181 - ("status", match r.status with Some v -> status_view_to_yojson v | None -> `Null) 182 - ] 247 + `Assoc 248 + [ ("did", (fun s -> `String s) r.did) 249 + ; ("handle", (fun s -> `String s) r.handle) 250 + ; ( "displayName" 251 + , match r.display_name with 252 + | Some v -> 253 + (fun s -> `String s) v 254 + | None -> 255 + `Null ) 256 + ; ( "avatar" 257 + , match r.avatar with Some v -> (fun s -> `String s) v | None -> `Null ) 258 + ; ( "associated" 259 + , match r.associated with 260 + | Some v -> 261 + profile_associated_to_yojson v 262 + | None -> 263 + `Null ) 264 + ; ( "viewer" 265 + , match r.viewer with 266 + | Some v -> 267 + actor_viewer_state_to_yojson v 268 + | None -> 269 + `Null ) 270 + ; ( "labels" 271 + , match r.labels with 272 + | Some v -> 273 + (fun l -> `List (List.map Com_atproto_label_defs.label_to_yojson l)) 274 + v 275 + | None -> 276 + `Null ) 277 + ; ( "createdAt" 278 + , match r.created_at with 279 + | Some v -> 280 + (fun s -> `String s) v 281 + | None -> 282 + `Null ) 283 + ; ( "verification" 284 + , match r.verification with 285 + | Some v -> 286 + verification_state_to_yojson v 287 + | None -> 288 + `Null ) 289 + ; ( "status" 290 + , match r.status with Some v -> status_view_to_yojson v | None -> `Null ) 291 + ] 183 292 184 293 and actor_viewer_state_to_yojson (r : actor_viewer_state) = 185 - `Assoc [ 186 - ("muted", match r.muted with Some v -> (fun b -> `Bool b) v | None -> `Null); 187 - ("mutedByList", match r.muted_by_list with Some v -> list_view_basic_to_yojson v | None -> `Null); 188 - ("blockedBy", match r.blocked_by with Some v -> (fun b -> `Bool b) v | None -> `Null); 189 - ("blocking", match r.blocking with Some v -> (fun s -> `String s) v | None -> `Null); 190 - ("blockingByList", match r.blocking_by_list with Some v -> list_view_basic_to_yojson v | None -> `Null); 191 - ("following", match r.following with Some v -> (fun s -> `String s) v | None -> `Null); 192 - ("followedBy", match r.followed_by with Some v -> (fun s -> `String s) v | None -> `Null); 193 - ("knownFollowers", match r.known_followers with Some v -> known_followers_to_yojson v | None -> `Null); 194 - ("activitySubscription", match r.activity_subscription with Some v -> App_bsky_notification_defs.activity_subscription_to_yojson v | None -> `Null) 195 - ] 294 + `Assoc 295 + [ ( "muted" 296 + , match r.muted with Some v -> (fun b -> `Bool b) v | None -> `Null ) 297 + ; ( "mutedByList" 298 + , match r.muted_by_list with 299 + | Some v -> 300 + list_view_basic_to_yojson v 301 + | None -> 302 + `Null ) 303 + ; ( "blockedBy" 304 + , match r.blocked_by with Some v -> (fun b -> `Bool b) v | None -> `Null 305 + ) 306 + ; ( "blocking" 307 + , match r.blocking with Some v -> (fun s -> `String s) v | None -> `Null 308 + ) 309 + ; ( "blockingByList" 310 + , match r.blocking_by_list with 311 + | Some v -> 312 + list_view_basic_to_yojson v 313 + | None -> 314 + `Null ) 315 + ; ( "following" 316 + , match r.following with 317 + | Some v -> 318 + (fun s -> `String s) v 319 + | None -> 320 + `Null ) 321 + ; ( "followedBy" 322 + , match r.followed_by with 323 + | Some v -> 324 + (fun s -> `String s) v 325 + | None -> 326 + `Null ) 327 + ; ( "knownFollowers" 328 + , match r.known_followers with 329 + | Some v -> 330 + known_followers_to_yojson v 331 + | None -> 332 + `Null ) 333 + ; ( "activitySubscription" 334 + , match r.activity_subscription with 335 + | Some v -> 336 + App_bsky_notification_defs.activity_subscription_to_yojson v 337 + | None -> 338 + `Null ) ] 196 339 197 340 and known_followers_to_yojson (r : known_followers) = 198 - `Assoc [ 199 - ("count", (fun i -> `Int i) r.count); 200 - ("followers", (fun l -> `List (List.map profile_view_basic_to_yojson l)) r.followers) 201 - ] 341 + `Assoc 342 + [ ("count", (fun i -> `Int i) r.count) 343 + ; ( "followers" 344 + , (fun l -> `List (List.map profile_view_basic_to_yojson l)) r.followers 345 + ) ] 202 346 203 347 type profile_view = 204 - { 205 - did: string; 206 - handle: string; 207 - display_name: string option [@key "displayName"] [@default None]; 208 - description: string option [@default None]; 209 - avatar: string option [@default None]; 210 - associated: profile_associated option [@default None]; 211 - indexed_at: string option [@key "indexedAt"] [@default None]; 212 - created_at: string option [@key "createdAt"] [@default None]; 213 - viewer: actor_viewer_state option [@default None]; 214 - labels: Com_atproto_label_defs.label list option [@default None]; 215 - verification: verification_state option [@default None]; 216 - status: status_view option [@default None]; 217 - } 348 + { did: string 349 + ; handle: string 350 + ; display_name: string option [@key "displayName"] [@default None] 351 + ; description: string option [@default None] 352 + ; avatar: string option [@default None] 353 + ; associated: profile_associated option [@default None] 354 + ; indexed_at: string option [@key "indexedAt"] [@default None] 355 + ; created_at: string option [@key "createdAt"] [@default None] 356 + ; viewer: actor_viewer_state option [@default None] 357 + ; labels: Com_atproto_label_defs.label list option [@default None] 358 + ; verification: verification_state option [@default None] 359 + ; status: status_view option [@default None] } 218 360 [@@deriving yojson {strict= false}] 219 361 220 362 type starter_pack_view_basic = 221 - { 222 - uri: string; 223 - cid: string; 224 - record: Yojson.Safe.t; 225 - creator: profile_view_basic; 226 - list_item_count: int option [@key "listItemCount"] [@default None]; 227 - joined_week_count: int option [@key "joinedWeekCount"] [@default None]; 228 - joined_all_time_count: int option [@key "joinedAllTimeCount"] [@default None]; 229 - labels: Com_atproto_label_defs.label list option [@default None]; 230 - indexed_at: string [@key "indexedAt"]; 231 - } 363 + { uri: string 364 + ; cid: string 365 + ; record: Yojson.Safe.t 366 + ; creator: profile_view_basic 367 + ; list_item_count: int option [@key "listItemCount"] [@default None] 368 + ; joined_week_count: int option [@key "joinedWeekCount"] [@default None] 369 + ; joined_all_time_count: int option 370 + [@key "joinedAllTimeCount"] [@default None] 371 + ; labels: Com_atproto_label_defs.label list option [@default None] 372 + ; indexed_at: string [@key "indexedAt"] } 232 373 [@@deriving yojson {strict= false}] 233 374 234 375 type profile_view_detailed = 235 - { 236 - did: string; 237 - handle: string; 238 - display_name: string option [@key "displayName"] [@default None]; 239 - description: string option [@default None]; 240 - avatar: string option [@default None]; 241 - banner: string option [@default None]; 242 - followers_count: int option [@key "followersCount"] [@default None]; 243 - follows_count: int option [@key "followsCount"] [@default None]; 244 - posts_count: int option [@key "postsCount"] [@default None]; 245 - associated: profile_associated option [@default None]; 246 - joined_via_starter_pack: starter_pack_view_basic option [@key "joinedViaStarterPack"] [@default None]; 247 - indexed_at: string option [@key "indexedAt"] [@default None]; 248 - created_at: string option [@key "createdAt"] [@default None]; 249 - viewer: actor_viewer_state option [@default None]; 250 - labels: Com_atproto_label_defs.label list option [@default None]; 251 - pinned_post: Com_atproto_repo_strongRef.main option [@key "pinnedPost"] [@default None]; 252 - verification: verification_state option [@default None]; 253 - status: status_view option [@default None]; 254 - } 376 + { did: string 377 + ; handle: string 378 + ; display_name: string option [@key "displayName"] [@default None] 379 + ; description: string option [@default None] 380 + ; avatar: string option [@default None] 381 + ; banner: string option [@default None] 382 + ; followers_count: int option [@key "followersCount"] [@default None] 383 + ; follows_count: int option [@key "followsCount"] [@default None] 384 + ; posts_count: int option [@key "postsCount"] [@default None] 385 + ; associated: profile_associated option [@default None] 386 + ; joined_via_starter_pack: starter_pack_view_basic option 387 + [@key "joinedViaStarterPack"] [@default None] 388 + ; indexed_at: string option [@key "indexedAt"] [@default None] 389 + ; created_at: string option [@key "createdAt"] [@default None] 390 + ; viewer: actor_viewer_state option [@default None] 391 + ; labels: Com_atproto_label_defs.label list option [@default None] 392 + ; pinned_post: Com_atproto_repo_strongRef.main option 393 + [@key "pinnedPost"] [@default None] 394 + ; verification: verification_state option [@default None] 395 + ; status: status_view option [@default None] } 255 396 [@@deriving yojson {strict= false}] 256 397 257 398 type verification_prefs = 258 - { 259 - hide_badges: bool option [@key "hideBadges"] [@default None]; 260 - } 399 + {hide_badges: bool option [@key "hideBadges"] [@default None]} 261 400 [@@deriving yojson {strict= false}] 262 401 263 402 type postgate_embedding_rules_item = ··· 268 407 let open Yojson.Safe.Util in 269 408 try 270 409 match json |> member "$type" |> to_string with 271 - | "app.bsky.feed.postgate#disableRule" -> 272 - (match App_bsky_feed_postgate.disable_rule_of_yojson json with 273 - | Ok v -> Ok (PostgateDisableRule v) 274 - | Error e -> Error e) 275 - | _ -> Ok (Unknown json) 410 + | "app.bsky.feed.postgate#disableRule" -> ( 411 + match App_bsky_feed_postgate.disable_rule_of_yojson json with 412 + | Ok v -> 413 + Ok (PostgateDisableRule v) 414 + | Error e -> 415 + Error e ) 416 + | _ -> 417 + Ok (Unknown json) 276 418 with _ -> Error "failed to parse union" 277 419 278 420 let postgate_embedding_rules_item_to_yojson = function 279 - | PostgateDisableRule v -> 280 - (match App_bsky_feed_postgate.disable_rule_to_yojson v with 281 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.postgate#disableRule") :: fields) 282 - | other -> other) 283 - | Unknown j -> j 421 + | PostgateDisableRule v -> ( 422 + match App_bsky_feed_postgate.disable_rule_to_yojson v with 423 + | `Assoc fields -> 424 + `Assoc 425 + (("$type", `String "app.bsky.feed.postgate#disableRule") :: fields) 426 + | other -> 427 + other ) 428 + | Unknown j -> 429 + j 284 430 285 431 type threadgate_allow_rules_item = 286 432 | ThreadgateMentionRule of App_bsky_feed_threadgate.mention_rule ··· 293 439 let open Yojson.Safe.Util in 294 440 try 295 441 match json |> member "$type" |> to_string with 296 - | "app.bsky.feed.threadgate#mentionRule" -> 297 - (match App_bsky_feed_threadgate.mention_rule_of_yojson json with 298 - | Ok v -> Ok (ThreadgateMentionRule v) 299 - | Error e -> Error e) 300 - | "app.bsky.feed.threadgate#followerRule" -> 301 - (match App_bsky_feed_threadgate.follower_rule_of_yojson json with 302 - | Ok v -> Ok (ThreadgateFollowerRule v) 303 - | Error e -> Error e) 304 - | "app.bsky.feed.threadgate#followingRule" -> 305 - (match App_bsky_feed_threadgate.following_rule_of_yojson json with 306 - | Ok v -> Ok (ThreadgateFollowingRule v) 307 - | Error e -> Error e) 308 - | "app.bsky.feed.threadgate#listRule" -> 309 - (match App_bsky_feed_threadgate.list_rule_of_yojson json with 310 - | Ok v -> Ok (ThreadgateListRule v) 311 - | Error e -> Error e) 312 - | _ -> Ok (Unknown json) 442 + | "app.bsky.feed.threadgate#mentionRule" -> ( 443 + match App_bsky_feed_threadgate.mention_rule_of_yojson json with 444 + | Ok v -> 445 + Ok (ThreadgateMentionRule v) 446 + | Error e -> 447 + Error e ) 448 + | "app.bsky.feed.threadgate#followerRule" -> ( 449 + match App_bsky_feed_threadgate.follower_rule_of_yojson json with 450 + | Ok v -> 451 + Ok (ThreadgateFollowerRule v) 452 + | Error e -> 453 + Error e ) 454 + | "app.bsky.feed.threadgate#followingRule" -> ( 455 + match App_bsky_feed_threadgate.following_rule_of_yojson json with 456 + | Ok v -> 457 + Ok (ThreadgateFollowingRule v) 458 + | Error e -> 459 + Error e ) 460 + | "app.bsky.feed.threadgate#listRule" -> ( 461 + match App_bsky_feed_threadgate.list_rule_of_yojson json with 462 + | Ok v -> 463 + Ok (ThreadgateListRule v) 464 + | Error e -> 465 + Error e ) 466 + | _ -> 467 + Ok (Unknown json) 313 468 with _ -> Error "failed to parse union" 314 469 315 470 let threadgate_allow_rules_item_to_yojson = function 316 - | ThreadgateMentionRule v -> 317 - (match App_bsky_feed_threadgate.mention_rule_to_yojson v with 318 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#mentionRule") :: fields) 319 - | other -> other) 320 - | ThreadgateFollowerRule v -> 321 - (match App_bsky_feed_threadgate.follower_rule_to_yojson v with 322 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#followerRule") :: fields) 323 - | other -> other) 324 - | ThreadgateFollowingRule v -> 325 - (match App_bsky_feed_threadgate.following_rule_to_yojson v with 326 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#followingRule") :: fields) 327 - | other -> other) 328 - | ThreadgateListRule v -> 329 - (match App_bsky_feed_threadgate.list_rule_to_yojson v with 330 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#listRule") :: fields) 331 - | other -> other) 332 - | Unknown j -> j 471 + | ThreadgateMentionRule v -> ( 472 + match App_bsky_feed_threadgate.mention_rule_to_yojson v with 473 + | `Assoc fields -> 474 + `Assoc 475 + (("$type", `String "app.bsky.feed.threadgate#mentionRule") :: fields) 476 + | other -> 477 + other ) 478 + | ThreadgateFollowerRule v -> ( 479 + match App_bsky_feed_threadgate.follower_rule_to_yojson v with 480 + | `Assoc fields -> 481 + `Assoc 482 + (("$type", `String "app.bsky.feed.threadgate#followerRule") :: fields) 483 + | other -> 484 + other ) 485 + | ThreadgateFollowingRule v -> ( 486 + match App_bsky_feed_threadgate.following_rule_to_yojson v with 487 + | `Assoc fields -> 488 + `Assoc 489 + (("$type", `String "app.bsky.feed.threadgate#followingRule") :: fields) 490 + | other -> 491 + other ) 492 + | ThreadgateListRule v -> ( 493 + match App_bsky_feed_threadgate.list_rule_to_yojson v with 494 + | `Assoc fields -> 495 + `Assoc (("$type", `String "app.bsky.feed.threadgate#listRule") :: fields) 496 + | other -> 497 + other ) 498 + | Unknown j -> 499 + j 333 500 334 501 type post_interaction_settings_pref = 335 - { 336 - threadgate_allow_rules: threadgate_allow_rules_item list option [@key "threadgateAllowRules"] [@default None]; 337 - postgate_embedding_rules: postgate_embedding_rules_item list option [@key "postgateEmbeddingRules"] [@default None]; 338 - } 502 + { threadgate_allow_rules: threadgate_allow_rules_item list option 503 + [@key "threadgateAllowRules"] [@default None] 504 + ; postgate_embedding_rules: postgate_embedding_rules_item list option 505 + [@key "postgateEmbeddingRules"] [@default None] } 339 506 [@@deriving yojson {strict= false}] 340 507 341 - type labeler_pref_item = 342 - { 343 - did: string; 344 - } 345 - [@@deriving yojson {strict= false}] 508 + type labeler_pref_item = {did: string} [@@deriving yojson {strict= false}] 346 509 347 - type labelers_pref = 348 - { 349 - labelers: labeler_pref_item list; 350 - } 510 + type labelers_pref = {labelers: labeler_pref_item list} 351 511 [@@deriving yojson {strict= false}] 352 512 353 513 type nux = 354 - { 355 - id: string; 356 - completed: bool; 357 - data: string option [@default None]; 358 - expires_at: string option [@key "expiresAt"] [@default None]; 359 - } 514 + { id: string 515 + ; completed: bool 516 + ; data: string option [@default None] 517 + ; expires_at: string option [@key "expiresAt"] [@default None] } 360 518 [@@deriving yojson {strict= false}] 361 519 362 - type bsky_app_progress_guide = 363 - { 364 - guide: string; 365 - } 520 + type bsky_app_progress_guide = {guide: string} 366 521 [@@deriving yojson {strict= false}] 367 522 368 523 type bsky_app_state_pref = 369 - { 370 - active_progress_guide: bsky_app_progress_guide option [@key "activeProgressGuide"] [@default None]; 371 - queued_nudges: string list option [@key "queuedNudges"] [@default None]; 372 - nuxs: nux list option [@default None]; 373 - } 524 + { active_progress_guide: bsky_app_progress_guide option 525 + [@key "activeProgressGuide"] [@default None] 526 + ; queued_nudges: string list option [@key "queuedNudges"] [@default None] 527 + ; nuxs: nux list option [@default None] } 374 528 [@@deriving yojson {strict= false}] 375 529 376 - type hidden_posts_pref = 377 - { 378 - items: string list; 379 - } 530 + type hidden_posts_pref = {items: string list} 380 531 [@@deriving yojson {strict= false}] 381 532 382 533 (** string type with known values *) 383 534 type muted_word_target = string 535 + 384 536 let muted_word_target_of_yojson = function 385 - | `String s -> Ok s 386 - | _ -> Error "muted_word_target: expected string" 537 + | `String s -> 538 + Ok s 539 + | _ -> 540 + Error "muted_word_target: expected string" 541 + 387 542 let muted_word_target_to_yojson s = `String s 388 543 389 544 type muted_word = 390 - { 391 - id: string option [@default None]; 392 - value: string; 393 - targets: muted_word_target list; 394 - actor_target: string option [@key "actorTarget"] [@default None]; 395 - expires_at: string option [@key "expiresAt"] [@default None]; 396 - } 545 + { id: string option [@default None] 546 + ; value: string 547 + ; targets: muted_word_target list 548 + ; actor_target: string option [@key "actorTarget"] [@default None] 549 + ; expires_at: string option [@key "expiresAt"] [@default None] } 397 550 [@@deriving yojson {strict= false}] 398 551 399 - type muted_words_pref = 400 - { 401 - items: muted_word list; 402 - } 552 + type muted_words_pref = {items: muted_word list} 403 553 [@@deriving yojson {strict= false}] 404 554 405 - type interests_pref = 406 - { 407 - tags: string list; 408 - } 409 - [@@deriving yojson {strict= false}] 555 + type interests_pref = {tags: string list} [@@deriving yojson {strict= false}] 410 556 411 557 type thread_view_pref = 412 - { 413 - sort: string option [@default None]; 414 - prioritize_followed_users: bool option [@key "prioritizeFollowedUsers"] [@default None]; 415 - } 558 + { sort: string option [@default None] 559 + ; prioritize_followed_users: bool option 560 + [@key "prioritizeFollowedUsers"] [@default None] } 416 561 [@@deriving yojson {strict= false}] 417 562 418 563 type feed_view_pref = 419 - { 420 - feed: string; 421 - hide_replies: bool option [@key "hideReplies"] [@default None]; 422 - hide_replies_by_unfollowed: bool option [@key "hideRepliesByUnfollowed"] [@default None]; 423 - hide_replies_by_like_count: int option [@key "hideRepliesByLikeCount"] [@default None]; 424 - hide_reposts: bool option [@key "hideReposts"] [@default None]; 425 - hide_quote_posts: bool option [@key "hideQuotePosts"] [@default None]; 426 - } 564 + { feed: string 565 + ; hide_replies: bool option [@key "hideReplies"] [@default None] 566 + ; hide_replies_by_unfollowed: bool option 567 + [@key "hideRepliesByUnfollowed"] [@default None] 568 + ; hide_replies_by_like_count: int option 569 + [@key "hideRepliesByLikeCount"] [@default None] 570 + ; hide_reposts: bool option [@key "hideReposts"] [@default None] 571 + ; hide_quote_posts: bool option [@key "hideQuotePosts"] [@default None] } 427 572 [@@deriving yojson {strict= false}] 428 573 429 574 type personal_details_pref = 430 - { 431 - birth_date: string option [@key "birthDate"] [@default None]; 432 - } 575 + {birth_date: string option [@key "birthDate"] [@default None]} 433 576 [@@deriving yojson {strict= false}] 434 577 435 578 type saved_feed = 436 - { 437 - id: string; 438 - type_: string [@key "type"]; 439 - value: string; 440 - pinned: bool; 441 - } 579 + {id: string; type_: string [@key "type"]; value: string; pinned: bool} 442 580 [@@deriving yojson {strict= false}] 443 581 444 - type saved_feeds_pref_v2 = 445 - { 446 - items: saved_feed list; 447 - } 582 + type saved_feeds_pref_v2 = {items: saved_feed list} 448 583 [@@deriving yojson {strict= false}] 449 584 450 585 type saved_feeds_pref = 451 - { 452 - pinned: string list; 453 - saved: string list; 454 - timeline_index: int option [@key "timelineIndex"] [@default None]; 455 - } 586 + { pinned: string list 587 + ; saved: string list 588 + ; timeline_index: int option [@key "timelineIndex"] [@default None] } 456 589 [@@deriving yojson {strict= false}] 457 590 458 591 type content_label_pref = 459 - { 460 - labeler_did: string option [@key "labelerDid"] [@default None]; 461 - label: string; 462 - visibility: string; 463 - } 592 + { labeler_did: string option [@key "labelerDid"] [@default None] 593 + ; label: string 594 + ; visibility: string } 464 595 [@@deriving yojson {strict= false}] 465 596 466 - type adult_content_pref = 467 - { 468 - enabled: bool; 469 - } 470 - [@@deriving yojson {strict= false}] 597 + type adult_content_pref = {enabled: bool} [@@deriving yojson {strict= false}] 471 598 472 599 type preferences_item = 473 600 | AdultContentPref of adult_content_pref ··· 490 617 let open Yojson.Safe.Util in 491 618 try 492 619 match json |> member "$type" |> to_string with 493 - | "app.bsky.actor.defs#adultContentPref" -> 494 - (match adult_content_pref_of_yojson json with 495 - | Ok v -> Ok (AdultContentPref v) 496 - | Error e -> Error e) 497 - | "app.bsky.actor.defs#contentLabelPref" -> 498 - (match content_label_pref_of_yojson json with 499 - | Ok v -> Ok (ContentLabelPref v) 500 - | Error e -> Error e) 501 - | "app.bsky.actor.defs#savedFeedsPref" -> 502 - (match saved_feeds_pref_of_yojson json with 503 - | Ok v -> Ok (SavedFeedsPref v) 504 - | Error e -> Error e) 505 - | "app.bsky.actor.defs#savedFeedsPrefV2" -> 506 - (match saved_feeds_pref_v2_of_yojson json with 507 - | Ok v -> Ok (SavedFeedsPrefV2 v) 508 - | Error e -> Error e) 509 - | "app.bsky.actor.defs#personalDetailsPref" -> 510 - (match personal_details_pref_of_yojson json with 511 - | Ok v -> Ok (PersonalDetailsPref v) 512 - | Error e -> Error e) 513 - | "app.bsky.actor.defs#feedViewPref" -> 514 - (match feed_view_pref_of_yojson json with 515 - | Ok v -> Ok (FeedViewPref v) 516 - | Error e -> Error e) 517 - | "app.bsky.actor.defs#threadViewPref" -> 518 - (match thread_view_pref_of_yojson json with 519 - | Ok v -> Ok (ThreadViewPref v) 520 - | Error e -> Error e) 521 - | "app.bsky.actor.defs#interestsPref" -> 522 - (match interests_pref_of_yojson json with 523 - | Ok v -> Ok (InterestsPref v) 524 - | Error e -> Error e) 525 - | "app.bsky.actor.defs#mutedWordsPref" -> 526 - (match muted_words_pref_of_yojson json with 527 - | Ok v -> Ok (MutedWordsPref v) 528 - | Error e -> Error e) 529 - | "app.bsky.actor.defs#hiddenPostsPref" -> 530 - (match hidden_posts_pref_of_yojson json with 531 - | Ok v -> Ok (HiddenPostsPref v) 532 - | Error e -> Error e) 533 - | "app.bsky.actor.defs#bskyAppStatePref" -> 534 - (match bsky_app_state_pref_of_yojson json with 535 - | Ok v -> Ok (BskyAppStatePref v) 536 - | Error e -> Error e) 537 - | "app.bsky.actor.defs#labelersPref" -> 538 - (match labelers_pref_of_yojson json with 539 - | Ok v -> Ok (LabelersPref v) 540 - | Error e -> Error e) 541 - | "app.bsky.actor.defs#postInteractionSettingsPref" -> 542 - (match post_interaction_settings_pref_of_yojson json with 543 - | Ok v -> Ok (PostInteractionSettingsPref v) 544 - | Error e -> Error e) 545 - | "app.bsky.actor.defs#verificationPrefs" -> 546 - (match verification_prefs_of_yojson json with 547 - | Ok v -> Ok (VerificationPrefs v) 548 - | Error e -> Error e) 549 - | _ -> Ok (Unknown json) 620 + | "app.bsky.actor.defs#adultContentPref" -> ( 621 + match adult_content_pref_of_yojson json with 622 + | Ok v -> 623 + Ok (AdultContentPref v) 624 + | Error e -> 625 + Error e ) 626 + | "app.bsky.actor.defs#contentLabelPref" -> ( 627 + match content_label_pref_of_yojson json with 628 + | Ok v -> 629 + Ok (ContentLabelPref v) 630 + | Error e -> 631 + Error e ) 632 + | "app.bsky.actor.defs#savedFeedsPref" -> ( 633 + match saved_feeds_pref_of_yojson json with 634 + | Ok v -> 635 + Ok (SavedFeedsPref v) 636 + | Error e -> 637 + Error e ) 638 + | "app.bsky.actor.defs#savedFeedsPrefV2" -> ( 639 + match saved_feeds_pref_v2_of_yojson json with 640 + | Ok v -> 641 + Ok (SavedFeedsPrefV2 v) 642 + | Error e -> 643 + Error e ) 644 + | "app.bsky.actor.defs#personalDetailsPref" -> ( 645 + match personal_details_pref_of_yojson json with 646 + | Ok v -> 647 + Ok (PersonalDetailsPref v) 648 + | Error e -> 649 + Error e ) 650 + | "app.bsky.actor.defs#feedViewPref" -> ( 651 + match feed_view_pref_of_yojson json with 652 + | Ok v -> 653 + Ok (FeedViewPref v) 654 + | Error e -> 655 + Error e ) 656 + | "app.bsky.actor.defs#threadViewPref" -> ( 657 + match thread_view_pref_of_yojson json with 658 + | Ok v -> 659 + Ok (ThreadViewPref v) 660 + | Error e -> 661 + Error e ) 662 + | "app.bsky.actor.defs#interestsPref" -> ( 663 + match interests_pref_of_yojson json with 664 + | Ok v -> 665 + Ok (InterestsPref v) 666 + | Error e -> 667 + Error e ) 668 + | "app.bsky.actor.defs#mutedWordsPref" -> ( 669 + match muted_words_pref_of_yojson json with 670 + | Ok v -> 671 + Ok (MutedWordsPref v) 672 + | Error e -> 673 + Error e ) 674 + | "app.bsky.actor.defs#hiddenPostsPref" -> ( 675 + match hidden_posts_pref_of_yojson json with 676 + | Ok v -> 677 + Ok (HiddenPostsPref v) 678 + | Error e -> 679 + Error e ) 680 + | "app.bsky.actor.defs#bskyAppStatePref" -> ( 681 + match bsky_app_state_pref_of_yojson json with 682 + | Ok v -> 683 + Ok (BskyAppStatePref v) 684 + | Error e -> 685 + Error e ) 686 + | "app.bsky.actor.defs#labelersPref" -> ( 687 + match labelers_pref_of_yojson json with 688 + | Ok v -> 689 + Ok (LabelersPref v) 690 + | Error e -> 691 + Error e ) 692 + | "app.bsky.actor.defs#postInteractionSettingsPref" -> ( 693 + match post_interaction_settings_pref_of_yojson json with 694 + | Ok v -> 695 + Ok (PostInteractionSettingsPref v) 696 + | Error e -> 697 + Error e ) 698 + | "app.bsky.actor.defs#verificationPrefs" -> ( 699 + match verification_prefs_of_yojson json with 700 + | Ok v -> 701 + Ok (VerificationPrefs v) 702 + | Error e -> 703 + Error e ) 704 + | _ -> 705 + Ok (Unknown json) 550 706 with _ -> Error "failed to parse union" 551 707 552 708 let preferences_item_to_yojson = function 553 - | AdultContentPref v -> 554 - (match adult_content_pref_to_yojson v with 555 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#adultContentPref") :: fields) 556 - | other -> other) 557 - | ContentLabelPref v -> 558 - (match content_label_pref_to_yojson v with 559 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#contentLabelPref") :: fields) 560 - | other -> other) 561 - | SavedFeedsPref v -> 562 - (match saved_feeds_pref_to_yojson v with 563 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#savedFeedsPref") :: fields) 564 - | other -> other) 565 - | SavedFeedsPrefV2 v -> 566 - (match saved_feeds_pref_v2_to_yojson v with 567 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#savedFeedsPrefV2") :: fields) 568 - | other -> other) 569 - | PersonalDetailsPref v -> 570 - (match personal_details_pref_to_yojson v with 571 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#personalDetailsPref") :: fields) 572 - | other -> other) 573 - | FeedViewPref v -> 574 - (match feed_view_pref_to_yojson v with 575 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#feedViewPref") :: fields) 576 - | other -> other) 577 - | ThreadViewPref v -> 578 - (match thread_view_pref_to_yojson v with 579 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#threadViewPref") :: fields) 580 - | other -> other) 581 - | InterestsPref v -> 582 - (match interests_pref_to_yojson v with 583 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#interestsPref") :: fields) 584 - | other -> other) 585 - | MutedWordsPref v -> 586 - (match muted_words_pref_to_yojson v with 587 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#mutedWordsPref") :: fields) 588 - | other -> other) 589 - | HiddenPostsPref v -> 590 - (match hidden_posts_pref_to_yojson v with 591 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#hiddenPostsPref") :: fields) 592 - | other -> other) 593 - | BskyAppStatePref v -> 594 - (match bsky_app_state_pref_to_yojson v with 595 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#bskyAppStatePref") :: fields) 596 - | other -> other) 597 - | LabelersPref v -> 598 - (match labelers_pref_to_yojson v with 599 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#labelersPref") :: fields) 600 - | other -> other) 601 - | PostInteractionSettingsPref v -> 602 - (match post_interaction_settings_pref_to_yojson v with 603 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#postInteractionSettingsPref") :: fields) 604 - | other -> other) 605 - | VerificationPrefs v -> 606 - (match verification_prefs_to_yojson v with 607 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#verificationPrefs") :: fields) 608 - | other -> other) 609 - | Unknown j -> j 709 + | AdultContentPref v -> ( 710 + match adult_content_pref_to_yojson v with 711 + | `Assoc fields -> 712 + `Assoc 713 + (("$type", `String "app.bsky.actor.defs#adultContentPref") :: fields) 714 + | other -> 715 + other ) 716 + | ContentLabelPref v -> ( 717 + match content_label_pref_to_yojson v with 718 + | `Assoc fields -> 719 + `Assoc 720 + (("$type", `String "app.bsky.actor.defs#contentLabelPref") :: fields) 721 + | other -> 722 + other ) 723 + | SavedFeedsPref v -> ( 724 + match saved_feeds_pref_to_yojson v with 725 + | `Assoc fields -> 726 + `Assoc 727 + (("$type", `String "app.bsky.actor.defs#savedFeedsPref") :: fields) 728 + | other -> 729 + other ) 730 + | SavedFeedsPrefV2 v -> ( 731 + match saved_feeds_pref_v2_to_yojson v with 732 + | `Assoc fields -> 733 + `Assoc 734 + (("$type", `String "app.bsky.actor.defs#savedFeedsPrefV2") :: fields) 735 + | other -> 736 + other ) 737 + | PersonalDetailsPref v -> ( 738 + match personal_details_pref_to_yojson v with 739 + | `Assoc fields -> 740 + `Assoc 741 + ( ("$type", `String "app.bsky.actor.defs#personalDetailsPref") 742 + :: fields ) 743 + | other -> 744 + other ) 745 + | FeedViewPref v -> ( 746 + match feed_view_pref_to_yojson v with 747 + | `Assoc fields -> 748 + `Assoc (("$type", `String "app.bsky.actor.defs#feedViewPref") :: fields) 749 + | other -> 750 + other ) 751 + | ThreadViewPref v -> ( 752 + match thread_view_pref_to_yojson v with 753 + | `Assoc fields -> 754 + `Assoc 755 + (("$type", `String "app.bsky.actor.defs#threadViewPref") :: fields) 756 + | other -> 757 + other ) 758 + | InterestsPref v -> ( 759 + match interests_pref_to_yojson v with 760 + | `Assoc fields -> 761 + `Assoc (("$type", `String "app.bsky.actor.defs#interestsPref") :: fields) 762 + | other -> 763 + other ) 764 + | MutedWordsPref v -> ( 765 + match muted_words_pref_to_yojson v with 766 + | `Assoc fields -> 767 + `Assoc 768 + (("$type", `String "app.bsky.actor.defs#mutedWordsPref") :: fields) 769 + | other -> 770 + other ) 771 + | HiddenPostsPref v -> ( 772 + match hidden_posts_pref_to_yojson v with 773 + | `Assoc fields -> 774 + `Assoc 775 + (("$type", `String "app.bsky.actor.defs#hiddenPostsPref") :: fields) 776 + | other -> 777 + other ) 778 + | BskyAppStatePref v -> ( 779 + match bsky_app_state_pref_to_yojson v with 780 + | `Assoc fields -> 781 + `Assoc 782 + (("$type", `String "app.bsky.actor.defs#bskyAppStatePref") :: fields) 783 + | other -> 784 + other ) 785 + | LabelersPref v -> ( 786 + match labelers_pref_to_yojson v with 787 + | `Assoc fields -> 788 + `Assoc (("$type", `String "app.bsky.actor.defs#labelersPref") :: fields) 789 + | other -> 790 + other ) 791 + | PostInteractionSettingsPref v -> ( 792 + match post_interaction_settings_pref_to_yojson v with 793 + | `Assoc fields -> 794 + `Assoc 795 + ( ("$type", `String "app.bsky.actor.defs#postInteractionSettingsPref") 796 + :: fields ) 797 + | other -> 798 + other ) 799 + | VerificationPrefs v -> ( 800 + match verification_prefs_to_yojson v with 801 + | `Assoc fields -> 802 + `Assoc 803 + (("$type", `String "app.bsky.actor.defs#verificationPrefs") :: fields) 804 + | other -> 805 + other ) 806 + | Unknown j -> 807 + j 610 808 611 809 type preferences = preferences_item list 810 + 612 811 let preferences_of_yojson json = 613 812 let open Yojson.Safe.Util in 614 - Ok (to_list json |> List.filter_map (fun x -> match preferences_item_of_yojson x with Ok v -> Some v | _ -> None)) 813 + Ok 814 + ( to_list json 815 + |> List.filter_map (fun x -> 816 + match preferences_item_of_yojson x with Ok v -> Some v | _ -> None ) ) 817 + 615 818 let preferences_to_yojson l = `List (List.map preferences_item_to_yojson l) 616 819 617 - type record_main = 618 - { 619 - record: Com_atproto_repo_strongRef.main; 620 - } 820 + type record_main = {record: Com_atproto_repo_strongRef.main} 621 821 [@@deriving yojson {strict= false}] 622 822 623 - type labeler_viewer_state = 624 - { 625 - like: string option [@default None]; 626 - } 823 + type labeler_viewer_state = {like: string option [@default None]} 627 824 [@@deriving yojson {strict= false}] 628 825 629 826 type labeler_view = 630 - { 631 - uri: string; 632 - cid: string; 633 - creator: profile_view; 634 - like_count: int option [@key "likeCount"] [@default None]; 635 - viewer: labeler_viewer_state option [@default None]; 636 - indexed_at: string [@key "indexedAt"]; 637 - labels: Com_atproto_label_defs.label list option [@default None]; 638 - } 827 + { uri: string 828 + ; cid: string 829 + ; creator: profile_view 830 + ; like_count: int option [@key "likeCount"] [@default None] 831 + ; viewer: labeler_viewer_state option [@default None] 832 + ; indexed_at: string [@key "indexedAt"] 833 + ; labels: Com_atproto_label_defs.label list option [@default None] } 639 834 [@@deriving yojson {strict= false}] 640 835 641 836 type list_view = 642 - { 643 - uri: string; 644 - cid: string; 645 - creator: profile_view; 646 - name: string; 647 - purpose: list_purpose; 648 - description: string option [@default None]; 649 - description_facets: App_bsky_richtext_facet.main list option [@key "descriptionFacets"] [@default None]; 650 - avatar: string option [@default None]; 651 - list_item_count: int option [@key "listItemCount"] [@default None]; 652 - labels: Com_atproto_label_defs.label list option [@default None]; 653 - viewer: list_viewer_state option [@default None]; 654 - indexed_at: string [@key "indexedAt"]; 655 - } 837 + { uri: string 838 + ; cid: string 839 + ; creator: profile_view 840 + ; name: string 841 + ; purpose: list_purpose 842 + ; description: string option [@default None] 843 + ; description_facets: App_bsky_richtext_facet.main list option 844 + [@key "descriptionFacets"] [@default None] 845 + ; avatar: string option [@default None] 846 + ; list_item_count: int option [@key "listItemCount"] [@default None] 847 + ; labels: Com_atproto_label_defs.label list option [@default None] 848 + ; viewer: list_viewer_state option [@default None] 849 + ; indexed_at: string [@key "indexedAt"] } 656 850 [@@deriving yojson {strict= false}] 657 851 658 - type generator_viewer_state = 659 - { 660 - like: string option [@default None]; 661 - } 852 + type generator_viewer_state = {like: string option [@default None]} 662 853 [@@deriving yojson {strict= false}] 663 854 664 855 type generator_view = 665 - { 666 - uri: string; 667 - cid: string; 668 - did: string; 669 - creator: profile_view; 670 - display_name: string [@key "displayName"]; 671 - description: string option [@default None]; 672 - description_facets: App_bsky_richtext_facet.main list option [@key "descriptionFacets"] [@default None]; 673 - avatar: string option [@default None]; 674 - like_count: int option [@key "likeCount"] [@default None]; 675 - accepts_interactions: bool option [@key "acceptsInteractions"] [@default None]; 676 - labels: Com_atproto_label_defs.label list option [@default None]; 677 - viewer: generator_viewer_state option [@default None]; 678 - content_mode: string option [@key "contentMode"] [@default None]; 679 - indexed_at: string [@key "indexedAt"]; 680 - } 856 + { uri: string 857 + ; cid: string 858 + ; did: string 859 + ; creator: profile_view 860 + ; display_name: string [@key "displayName"] 861 + ; description: string option [@default None] 862 + ; description_facets: App_bsky_richtext_facet.main list option 863 + [@key "descriptionFacets"] [@default None] 864 + ; avatar: string option [@default None] 865 + ; like_count: int option [@key "likeCount"] [@default None] 866 + ; accepts_interactions: bool option 867 + [@key "acceptsInteractions"] [@default None] 868 + ; labels: Com_atproto_label_defs.label list option [@default None] 869 + ; viewer: generator_viewer_state option [@default None] 870 + ; content_mode: string option [@key "contentMode"] [@default None] 871 + ; indexed_at: string [@key "indexedAt"] } 681 872 [@@deriving yojson {strict= false}] 682 873 683 - type view_detached = 684 - { 685 - uri: string; 686 - detached: bool; 687 - } 874 + type view_detached = {uri: string; detached: bool} 688 875 [@@deriving yojson {strict= false}] 689 876 690 877 type blocked_author = 691 - { 692 - did: string; 693 - viewer: actor_viewer_state option [@default None]; 694 - } 878 + {did: string; viewer: actor_viewer_state option [@default None]} 695 879 [@@deriving yojson {strict= false}] 696 880 697 - type view_blocked = 698 - { 699 - uri: string; 700 - blocked: bool; 701 - author: blocked_author; 702 - } 881 + type view_blocked = {uri: string; blocked: bool; author: blocked_author} 703 882 [@@deriving yojson {strict= false}] 704 883 705 - type view_not_found = 706 - { 707 - uri: string; 708 - not_found: bool [@key "notFound"]; 709 - } 884 + type view_not_found = {uri: string; not_found: bool [@key "notFound"]} 710 885 [@@deriving yojson {strict= false}] 711 886 712 887 type record_with_media_media = ··· 719 894 let open Yojson.Safe.Util in 720 895 try 721 896 match json |> member "$type" |> to_string with 722 - | "app.bsky.embed.images" -> 723 - (match App_bsky_embed_images.main_of_yojson json with 724 - | Ok v -> Ok (Images v) 725 - | Error e -> Error e) 726 - | "app.bsky.embed.video" -> 727 - (match App_bsky_embed_video.main_of_yojson json with 728 - | Ok v -> Ok (Video v) 729 - | Error e -> Error e) 730 - | "app.bsky.embed.external" -> 731 - (match App_bsky_embed_external.main_of_yojson json with 732 - | Ok v -> Ok (External v) 733 - | Error e -> Error e) 734 - | _ -> Ok (Unknown json) 897 + | "app.bsky.embed.images" -> ( 898 + match App_bsky_embed_images.main_of_yojson json with 899 + | Ok v -> 900 + Ok (Images v) 901 + | Error e -> 902 + Error e ) 903 + | "app.bsky.embed.video" -> ( 904 + match App_bsky_embed_video.main_of_yojson json with 905 + | Ok v -> 906 + Ok (Video v) 907 + | Error e -> 908 + Error e ) 909 + | "app.bsky.embed.external" -> ( 910 + match App_bsky_embed_external.main_of_yojson json with 911 + | Ok v -> 912 + Ok (External v) 913 + | Error e -> 914 + Error e ) 915 + | _ -> 916 + Ok (Unknown json) 735 917 with _ -> Error "failed to parse union" 736 918 737 919 let record_with_media_media_to_yojson = function 738 - | Images v -> 739 - (match App_bsky_embed_images.main_to_yojson v with 740 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.images") :: fields) 741 - | other -> other) 742 - | Video v -> 743 - (match App_bsky_embed_video.main_to_yojson v with 744 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.video") :: fields) 745 - | other -> other) 746 - | External v -> 747 - (match App_bsky_embed_external.main_to_yojson v with 748 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.external") :: fields) 749 - | other -> other) 750 - | Unknown j -> j 920 + | Images v -> ( 921 + match App_bsky_embed_images.main_to_yojson v with 922 + | `Assoc fields -> 923 + `Assoc (("$type", `String "app.bsky.embed.images") :: fields) 924 + | other -> 925 + other ) 926 + | Video v -> ( 927 + match App_bsky_embed_video.main_to_yojson v with 928 + | `Assoc fields -> 929 + `Assoc (("$type", `String "app.bsky.embed.video") :: fields) 930 + | other -> 931 + other ) 932 + | External v -> ( 933 + match App_bsky_embed_external.main_to_yojson v with 934 + | `Assoc fields -> 935 + `Assoc (("$type", `String "app.bsky.embed.external") :: fields) 936 + | other -> 937 + other ) 938 + | Unknown j -> 939 + j 751 940 752 941 type embeds_item = 753 942 | ImagesView of App_bsky_embed_images.view ··· 756 945 | RecordView of record_view 757 946 | RecordWithMediaView of record_with_media_view 758 947 | Unknown of Yojson.Safe.t 948 + 759 949 and record = 760 950 | ViewRecord of view_record 761 951 | ViewNotFound of view_not_found ··· 766 956 | DefsLabelerView of labeler_view 767 957 | DefsStarterPackViewBasic of starter_pack_view_basic 768 958 | Unknown of Yojson.Safe.t 769 - and record_view = { 770 - record: record; 771 - } 772 - and view_record = { 773 - uri: string; 774 - cid: string; 775 - author: profile_view_basic; 776 - value: Yojson.Safe.t; 777 - labels: Com_atproto_label_defs.label list option [@default None]; 778 - reply_count: int option [@key "replyCount"] [@default None]; 779 - repost_count: int option [@key "repostCount"] [@default None]; 780 - like_count: int option [@key "likeCount"] [@default None]; 781 - quote_count: int option [@key "quoteCount"] [@default None]; 782 - embeds: embeds_item list option [@default None]; 783 - indexed_at: string [@key "indexedAt"]; 784 - } 785 - and record_with_media_view = { 786 - record: record_view; 787 - media: record_with_media_media; 788 - } 959 + 960 + and record_view = {record: record} 961 + 962 + and view_record = 963 + { uri: string 964 + ; cid: string 965 + ; author: profile_view_basic 966 + ; value: Yojson.Safe.t 967 + ; labels: Com_atproto_label_defs.label list option [@default None] 968 + ; reply_count: int option [@key "replyCount"] [@default None] 969 + ; repost_count: int option [@key "repostCount"] [@default None] 970 + ; like_count: int option [@key "likeCount"] [@default None] 971 + ; quote_count: int option [@key "quoteCount"] [@default None] 972 + ; embeds: embeds_item list option [@default None] 973 + ; indexed_at: string [@key "indexedAt"] } 974 + 975 + and record_with_media_view = 976 + {record: record_view; media: record_with_media_media} 789 977 790 978 let rec embeds_item_of_yojson json = 791 979 let open Yojson.Safe.Util in 792 980 try 793 981 match json |> member "$type" |> to_string with 794 - | "app.bsky.embed.images#view" -> 795 - (match App_bsky_embed_images.view_of_yojson json with 796 - | Ok v -> Ok (ImagesView v) 797 - | Error e -> Error e) 798 - | "app.bsky.embed.video#view" -> 799 - (match App_bsky_embed_video.view_of_yojson json with 800 - | Ok v -> Ok (VideoView v) 801 - | Error e -> Error e) 802 - | "app.bsky.embed.external#view" -> 803 - (match App_bsky_embed_external.view_of_yojson json with 804 - | Ok v -> Ok (ExternalView v) 805 - | Error e -> Error e) 806 - | "app.bsky.embed.record#view" -> 807 - (match record_view_of_yojson json with 808 - | Ok v -> Ok (RecordView v) 809 - | Error e -> Error e) 810 - | "app.bsky.embed.recordWithMedia#view" -> 811 - (match record_with_media_view_of_yojson json with 812 - | Ok v -> Ok (RecordWithMediaView v) 813 - | Error e -> Error e) 814 - | _ -> Ok (Unknown json) 982 + | "app.bsky.embed.images#view" -> ( 983 + match App_bsky_embed_images.view_of_yojson json with 984 + | Ok v -> 985 + Ok (ImagesView v) 986 + | Error e -> 987 + Error e ) 988 + | "app.bsky.embed.video#view" -> ( 989 + match App_bsky_embed_video.view_of_yojson json with 990 + | Ok v -> 991 + Ok (VideoView v) 992 + | Error e -> 993 + Error e ) 994 + | "app.bsky.embed.external#view" -> ( 995 + match App_bsky_embed_external.view_of_yojson json with 996 + | Ok v -> 997 + Ok (ExternalView v) 998 + | Error e -> 999 + Error e ) 1000 + | "app.bsky.embed.record#view" -> ( 1001 + match record_view_of_yojson json with 1002 + | Ok v -> 1003 + Ok (RecordView v) 1004 + | Error e -> 1005 + Error e ) 1006 + | "app.bsky.embed.recordWithMedia#view" -> ( 1007 + match record_with_media_view_of_yojson json with 1008 + | Ok v -> 1009 + Ok (RecordWithMediaView v) 1010 + | Error e -> 1011 + Error e ) 1012 + | _ -> 1013 + Ok (Unknown json) 815 1014 with _ -> Error "failed to parse union" 816 1015 817 1016 and record_of_yojson json = 818 1017 let open Yojson.Safe.Util in 819 1018 try 820 1019 match json |> member "$type" |> to_string with 821 - | "app.bsky.embed.record#viewRecord" -> 822 - (match view_record_of_yojson json with 823 - | Ok v -> Ok (ViewRecord v) 824 - | Error e -> Error e) 825 - | "app.bsky.embed.record#viewNotFound" -> 826 - (match view_not_found_of_yojson json with 827 - | Ok v -> Ok (ViewNotFound v) 828 - | Error e -> Error e) 829 - | "app.bsky.embed.record#viewBlocked" -> 830 - (match view_blocked_of_yojson json with 831 - | Ok v -> Ok (ViewBlocked v) 832 - | Error e -> Error e) 833 - | "app.bsky.embed.record#viewDetached" -> 834 - (match view_detached_of_yojson json with 835 - | Ok v -> Ok (ViewDetached v) 836 - | Error e -> Error e) 837 - | "app.bsky.feed.defs#generatorView" -> 838 - (match generator_view_of_yojson json with 839 - | Ok v -> Ok (DefsGeneratorView v) 840 - | Error e -> Error e) 841 - | "app.bsky.graph.defs#listView" -> 842 - (match list_view_of_yojson json with 843 - | Ok v -> Ok (DefsListView v) 844 - | Error e -> Error e) 845 - | "app.bsky.labeler.defs#labelerView" -> 846 - (match labeler_view_of_yojson json with 847 - | Ok v -> Ok (DefsLabelerView v) 848 - | Error e -> Error e) 849 - | "app.bsky.graph.defs#starterPackViewBasic" -> 850 - (match starter_pack_view_basic_of_yojson json with 851 - | Ok v -> Ok (DefsStarterPackViewBasic v) 852 - | Error e -> Error e) 853 - | _ -> Ok (Unknown json) 1020 + | "app.bsky.embed.record#viewRecord" -> ( 1021 + match view_record_of_yojson json with 1022 + | Ok v -> 1023 + Ok (ViewRecord v) 1024 + | Error e -> 1025 + Error e ) 1026 + | "app.bsky.embed.record#viewNotFound" -> ( 1027 + match view_not_found_of_yojson json with 1028 + | Ok v -> 1029 + Ok (ViewNotFound v) 1030 + | Error e -> 1031 + Error e ) 1032 + | "app.bsky.embed.record#viewBlocked" -> ( 1033 + match view_blocked_of_yojson json with 1034 + | Ok v -> 1035 + Ok (ViewBlocked v) 1036 + | Error e -> 1037 + Error e ) 1038 + | "app.bsky.embed.record#viewDetached" -> ( 1039 + match view_detached_of_yojson json with 1040 + | Ok v -> 1041 + Ok (ViewDetached v) 1042 + | Error e -> 1043 + Error e ) 1044 + | "app.bsky.feed.defs#generatorView" -> ( 1045 + match generator_view_of_yojson json with 1046 + | Ok v -> 1047 + Ok (DefsGeneratorView v) 1048 + | Error e -> 1049 + Error e ) 1050 + | "app.bsky.graph.defs#listView" -> ( 1051 + match list_view_of_yojson json with 1052 + | Ok v -> 1053 + Ok (DefsListView v) 1054 + | Error e -> 1055 + Error e ) 1056 + | "app.bsky.labeler.defs#labelerView" -> ( 1057 + match labeler_view_of_yojson json with 1058 + | Ok v -> 1059 + Ok (DefsLabelerView v) 1060 + | Error e -> 1061 + Error e ) 1062 + | "app.bsky.graph.defs#starterPackViewBasic" -> ( 1063 + match starter_pack_view_basic_of_yojson json with 1064 + | Ok v -> 1065 + Ok (DefsStarterPackViewBasic v) 1066 + | Error e -> 1067 + Error e ) 1068 + | _ -> 1069 + Ok (Unknown json) 854 1070 with _ -> Error "failed to parse union" 855 1071 856 1072 and record_view_of_yojson json = 857 1073 let open Yojson.Safe.Util in 858 1074 try 859 1075 let record = json |> member "record" |> record_of_yojson |> Result.get_ok in 860 - Ok { record } 1076 + Ok {record} 861 1077 with e -> Error (Printexc.to_string e) 862 1078 863 1079 and view_record_of_yojson json = ··· 865 1081 try 866 1082 let uri = json |> member "uri" |> to_string in 867 1083 let cid = json |> member "cid" |> to_string in 868 - let author = json |> member "author" |> profile_view_basic_of_yojson |> Result.get_ok in 869 - let value = json |> member "value" |> (fun j -> j) in 870 - let labels = json |> member "labels" |> to_option (fun j -> to_list j |> List.filter_map (fun x -> match Com_atproto_label_defs.label_of_yojson x with Ok v -> Some v | _ -> None)) in 1084 + let author = 1085 + json |> member "author" |> profile_view_basic_of_yojson |> Result.get_ok 1086 + in 1087 + let value = json |> member "value" |> fun j -> j in 1088 + let labels = 1089 + json |> member "labels" 1090 + |> to_option (fun j -> 1091 + to_list j 1092 + |> List.filter_map (fun x -> 1093 + match Com_atproto_label_defs.label_of_yojson x with 1094 + | Ok v -> 1095 + Some v 1096 + | _ -> 1097 + None ) ) 1098 + in 871 1099 let reply_count = json |> member "replyCount" |> to_option to_int in 872 1100 let repost_count = json |> member "repostCount" |> to_option to_int in 873 1101 let like_count = json |> member "likeCount" |> to_option to_int in 874 1102 let quote_count = json |> member "quoteCount" |> to_option to_int in 875 - let embeds = json |> member "embeds" |> to_option (fun j -> to_list j |> List.filter_map (fun x -> match embeds_item_of_yojson x with Ok v -> Some v | _ -> None)) in 1103 + let embeds = 1104 + json |> member "embeds" 1105 + |> to_option (fun j -> 1106 + to_list j 1107 + |> List.filter_map (fun x -> 1108 + match embeds_item_of_yojson x with Ok v -> Some v | _ -> None ) ) 1109 + in 876 1110 let indexed_at = json |> member "indexedAt" |> to_string in 877 - Ok { uri; cid; author; value; labels; reply_count; repost_count; like_count; quote_count; embeds; indexed_at } 1111 + Ok 1112 + { uri 1113 + ; cid 1114 + ; author 1115 + ; value 1116 + ; labels 1117 + ; reply_count 1118 + ; repost_count 1119 + ; like_count 1120 + ; quote_count 1121 + ; embeds 1122 + ; indexed_at } 878 1123 with e -> Error (Printexc.to_string e) 879 1124 880 1125 and record_with_media_view_of_yojson json = 881 1126 let open Yojson.Safe.Util in 882 1127 try 883 - let record = json |> member "record" |> record_view_of_yojson |> Result.get_ok in 884 - let media = json |> member "media" |> record_with_media_media_of_yojson |> Result.get_ok in 885 - Ok { record; media } 1128 + let record = 1129 + json |> member "record" |> record_view_of_yojson |> Result.get_ok 1130 + in 1131 + let media = 1132 + json |> member "media" |> record_with_media_media_of_yojson 1133 + |> Result.get_ok 1134 + in 1135 + Ok {record; media} 886 1136 with e -> Error (Printexc.to_string e) 887 1137 888 1138 and embeds_item_to_yojson = function 889 - | ImagesView v -> 890 - (match App_bsky_embed_images.view_to_yojson v with 891 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.images#view") :: fields) 892 - | other -> other) 893 - | VideoView v -> 894 - (match App_bsky_embed_video.view_to_yojson v with 895 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.video#view") :: fields) 896 - | other -> other) 897 - | ExternalView v -> 898 - (match App_bsky_embed_external.view_to_yojson v with 899 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.external#view") :: fields) 900 - | other -> other) 901 - | RecordView v -> 902 - (match record_view_to_yojson v with 903 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#view") :: fields) 904 - | other -> other) 905 - | RecordWithMediaView v -> 906 - (match record_with_media_view_to_yojson v with 907 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.recordWithMedia#view") :: fields) 908 - | other -> other) 909 - | Unknown j -> j 1139 + | ImagesView v -> ( 1140 + match App_bsky_embed_images.view_to_yojson v with 1141 + | `Assoc fields -> 1142 + `Assoc (("$type", `String "app.bsky.embed.images#view") :: fields) 1143 + | other -> 1144 + other ) 1145 + | VideoView v -> ( 1146 + match App_bsky_embed_video.view_to_yojson v with 1147 + | `Assoc fields -> 1148 + `Assoc (("$type", `String "app.bsky.embed.video#view") :: fields) 1149 + | other -> 1150 + other ) 1151 + | ExternalView v -> ( 1152 + match App_bsky_embed_external.view_to_yojson v with 1153 + | `Assoc fields -> 1154 + `Assoc (("$type", `String "app.bsky.embed.external#view") :: fields) 1155 + | other -> 1156 + other ) 1157 + | RecordView v -> ( 1158 + match record_view_to_yojson v with 1159 + | `Assoc fields -> 1160 + `Assoc (("$type", `String "app.bsky.embed.record#view") :: fields) 1161 + | other -> 1162 + other ) 1163 + | RecordWithMediaView v -> ( 1164 + match record_with_media_view_to_yojson v with 1165 + | `Assoc fields -> 1166 + `Assoc 1167 + (("$type", `String "app.bsky.embed.recordWithMedia#view") :: fields) 1168 + | other -> 1169 + other ) 1170 + | Unknown j -> 1171 + j 910 1172 911 1173 and record_to_yojson = function 912 - | ViewRecord v -> 913 - (match view_record_to_yojson v with 914 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#viewRecord") :: fields) 915 - | other -> other) 916 - | ViewNotFound v -> 917 - (match view_not_found_to_yojson v with 918 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#viewNotFound") :: fields) 919 - | other -> other) 920 - | ViewBlocked v -> 921 - (match view_blocked_to_yojson v with 922 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#viewBlocked") :: fields) 923 - | other -> other) 924 - | ViewDetached v -> 925 - (match view_detached_to_yojson v with 926 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#viewDetached") :: fields) 927 - | other -> other) 928 - | DefsGeneratorView v -> 929 - (match generator_view_to_yojson v with 930 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#generatorView") :: fields) 931 - | other -> other) 932 - | DefsListView v -> 933 - (match list_view_to_yojson v with 934 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.graph.defs#listView") :: fields) 935 - | other -> other) 936 - | DefsLabelerView v -> 937 - (match labeler_view_to_yojson v with 938 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.labeler.defs#labelerView") :: fields) 939 - | other -> other) 940 - | DefsStarterPackViewBasic v -> 941 - (match starter_pack_view_basic_to_yojson v with 942 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.graph.defs#starterPackViewBasic") :: fields) 943 - | other -> other) 944 - | Unknown j -> j 1174 + | ViewRecord v -> ( 1175 + match view_record_to_yojson v with 1176 + | `Assoc fields -> 1177 + `Assoc (("$type", `String "app.bsky.embed.record#viewRecord") :: fields) 1178 + | other -> 1179 + other ) 1180 + | ViewNotFound v -> ( 1181 + match view_not_found_to_yojson v with 1182 + | `Assoc fields -> 1183 + `Assoc 1184 + (("$type", `String "app.bsky.embed.record#viewNotFound") :: fields) 1185 + | other -> 1186 + other ) 1187 + | ViewBlocked v -> ( 1188 + match view_blocked_to_yojson v with 1189 + | `Assoc fields -> 1190 + `Assoc (("$type", `String "app.bsky.embed.record#viewBlocked") :: fields) 1191 + | other -> 1192 + other ) 1193 + | ViewDetached v -> ( 1194 + match view_detached_to_yojson v with 1195 + | `Assoc fields -> 1196 + `Assoc 1197 + (("$type", `String "app.bsky.embed.record#viewDetached") :: fields) 1198 + | other -> 1199 + other ) 1200 + | DefsGeneratorView v -> ( 1201 + match generator_view_to_yojson v with 1202 + | `Assoc fields -> 1203 + `Assoc (("$type", `String "app.bsky.feed.defs#generatorView") :: fields) 1204 + | other -> 1205 + other ) 1206 + | DefsListView v -> ( 1207 + match list_view_to_yojson v with 1208 + | `Assoc fields -> 1209 + `Assoc (("$type", `String "app.bsky.graph.defs#listView") :: fields) 1210 + | other -> 1211 + other ) 1212 + | DefsLabelerView v -> ( 1213 + match labeler_view_to_yojson v with 1214 + | `Assoc fields -> 1215 + `Assoc (("$type", `String "app.bsky.labeler.defs#labelerView") :: fields) 1216 + | other -> 1217 + other ) 1218 + | DefsStarterPackViewBasic v -> ( 1219 + match starter_pack_view_basic_to_yojson v with 1220 + | `Assoc fields -> 1221 + `Assoc 1222 + ( ("$type", `String "app.bsky.graph.defs#starterPackViewBasic") 1223 + :: fields ) 1224 + | other -> 1225 + other ) 1226 + | Unknown j -> 1227 + j 945 1228 946 1229 and record_view_to_yojson (r : record_view) = 947 - `Assoc [ 948 - ("record", record_to_yojson r.record) 949 - ] 1230 + `Assoc [("record", record_to_yojson r.record)] 950 1231 951 1232 and view_record_to_yojson (r : view_record) = 952 - `Assoc [ 953 - ("uri", (fun s -> `String s) r.uri); 954 - ("cid", (fun s -> `String s) r.cid); 955 - ("author", profile_view_basic_to_yojson r.author); 956 - ("value", (fun j -> j) r.value); 957 - ("labels", match r.labels with Some v -> (fun l -> `List (List.map Com_atproto_label_defs.label_to_yojson l)) v | None -> `Null); 958 - ("replyCount", match r.reply_count with Some v -> (fun i -> `Int i) v | None -> `Null); 959 - ("repostCount", match r.repost_count with Some v -> (fun i -> `Int i) v | None -> `Null); 960 - ("likeCount", match r.like_count with Some v -> (fun i -> `Int i) v | None -> `Null); 961 - ("quoteCount", match r.quote_count with Some v -> (fun i -> `Int i) v | None -> `Null); 962 - ("embeds", match r.embeds with Some v -> (fun l -> `List (List.map embeds_item_to_yojson l)) v | None -> `Null); 963 - ("indexedAt", (fun s -> `String s) r.indexed_at) 964 - ] 1233 + `Assoc 1234 + [ ("uri", (fun s -> `String s) r.uri) 1235 + ; ("cid", (fun s -> `String s) r.cid) 1236 + ; ("author", profile_view_basic_to_yojson r.author) 1237 + ; ("value", (fun j -> j) r.value) 1238 + ; ( "labels" 1239 + , match r.labels with 1240 + | Some v -> 1241 + (fun l -> `List (List.map Com_atproto_label_defs.label_to_yojson l)) 1242 + v 1243 + | None -> 1244 + `Null ) 1245 + ; ( "replyCount" 1246 + , match r.reply_count with Some v -> (fun i -> `Int i) v | None -> `Null 1247 + ) 1248 + ; ( "repostCount" 1249 + , match r.repost_count with 1250 + | Some v -> 1251 + (fun i -> `Int i) v 1252 + | None -> 1253 + `Null ) 1254 + ; ( "likeCount" 1255 + , match r.like_count with Some v -> (fun i -> `Int i) v | None -> `Null ) 1256 + ; ( "quoteCount" 1257 + , match r.quote_count with Some v -> (fun i -> `Int i) v | None -> `Null 1258 + ) 1259 + ; ( "embeds" 1260 + , match r.embeds with 1261 + | Some v -> 1262 + (fun l -> `List (List.map embeds_item_to_yojson l)) v 1263 + | None -> 1264 + `Null ) 1265 + ; ("indexedAt", (fun s -> `String s) r.indexed_at) ] 965 1266 966 1267 and record_with_media_view_to_yojson (r : record_with_media_view) = 967 - `Assoc [ 968 - ("record", record_view_to_yojson r.record); 969 - ("media", record_with_media_media_to_yojson r.media) 970 - ] 1268 + `Assoc 1269 + [ ("record", record_view_to_yojson r.record) 1270 + ; ("media", record_with_media_media_to_yojson r.media) ] 971 1271 972 1272 type record_with_media_main = 973 - { 974 - record: record_main; 975 - media: record_with_media_media; 976 - } 1273 + {record: record_main; media: record_with_media_media} 977 1274 [@@deriving yojson {strict= false}] 978 1275 979 1276 type threadgate_view = 980 - { 981 - uri: string option [@default None]; 982 - cid: string option [@default None]; 983 - record: Yojson.Safe.t option [@default None]; 984 - lists: list_view_basic list option [@default None]; 985 - } 1277 + { uri: string option [@default None] 1278 + ; cid: string option [@default None] 1279 + ; record: Yojson.Safe.t option [@default None] 1280 + ; lists: list_view_basic list option [@default None] } 986 1281 [@@deriving yojson {strict= false}] 987 1282 988 1283 type feed_viewer_state = 989 - { 990 - repost: string option [@default None]; 991 - like: string option [@default None]; 992 - thread_muted: bool option [@key "threadMuted"] [@default None]; 993 - reply_disabled: bool option [@key "replyDisabled"] [@default None]; 994 - embedding_disabled: bool option [@key "embeddingDisabled"] [@default None]; 995 - pinned: bool option [@default None]; 996 - } 1284 + { repost: string option [@default None] 1285 + ; like: string option [@default None] 1286 + ; thread_muted: bool option [@key "threadMuted"] [@default None] 1287 + ; reply_disabled: bool option [@key "replyDisabled"] [@default None] 1288 + ; embedding_disabled: bool option [@key "embeddingDisabled"] [@default None] 1289 + ; pinned: bool option [@default None] } 997 1290 [@@deriving yojson {strict= false}] 998 1291 999 1292 type feed_embed = ··· 1008 1301 let open Yojson.Safe.Util in 1009 1302 try 1010 1303 match json |> member "$type" |> to_string with 1011 - | "app.bsky.embed.images#view" -> 1012 - (match App_bsky_embed_images.view_of_yojson json with 1013 - | Ok v -> Ok (ImagesView v) 1014 - | Error e -> Error e) 1015 - | "app.bsky.embed.video#view" -> 1016 - (match App_bsky_embed_video.view_of_yojson json with 1017 - | Ok v -> Ok (VideoView v) 1018 - | Error e -> Error e) 1019 - | "app.bsky.embed.external#view" -> 1020 - (match App_bsky_embed_external.view_of_yojson json with 1021 - | Ok v -> Ok (ExternalView v) 1022 - | Error e -> Error e) 1023 - | "app.bsky.embed.record#view" -> 1024 - (match record_view_of_yojson json with 1025 - | Ok v -> Ok (RecordView v) 1026 - | Error e -> Error e) 1027 - | "app.bsky.embed.recordWithMedia#view" -> 1028 - (match record_with_media_view_of_yojson json with 1029 - | Ok v -> Ok (RecordWithMediaView v) 1030 - | Error e -> Error e) 1031 - | _ -> Ok (Unknown json) 1304 + | "app.bsky.embed.images#view" -> ( 1305 + match App_bsky_embed_images.view_of_yojson json with 1306 + | Ok v -> 1307 + Ok (ImagesView v) 1308 + | Error e -> 1309 + Error e ) 1310 + | "app.bsky.embed.video#view" -> ( 1311 + match App_bsky_embed_video.view_of_yojson json with 1312 + | Ok v -> 1313 + Ok (VideoView v) 1314 + | Error e -> 1315 + Error e ) 1316 + | "app.bsky.embed.external#view" -> ( 1317 + match App_bsky_embed_external.view_of_yojson json with 1318 + | Ok v -> 1319 + Ok (ExternalView v) 1320 + | Error e -> 1321 + Error e ) 1322 + | "app.bsky.embed.record#view" -> ( 1323 + match record_view_of_yojson json with 1324 + | Ok v -> 1325 + Ok (RecordView v) 1326 + | Error e -> 1327 + Error e ) 1328 + | "app.bsky.embed.recordWithMedia#view" -> ( 1329 + match record_with_media_view_of_yojson json with 1330 + | Ok v -> 1331 + Ok (RecordWithMediaView v) 1332 + | Error e -> 1333 + Error e ) 1334 + | _ -> 1335 + Ok (Unknown json) 1032 1336 with _ -> Error "failed to parse union" 1033 1337 1034 1338 let feed_embed_to_yojson = function 1035 - | ImagesView v -> 1036 - (match App_bsky_embed_images.view_to_yojson v with 1037 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.images#view") :: fields) 1038 - | other -> other) 1039 - | VideoView v -> 1040 - (match App_bsky_embed_video.view_to_yojson v with 1041 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.video#view") :: fields) 1042 - | other -> other) 1043 - | ExternalView v -> 1044 - (match App_bsky_embed_external.view_to_yojson v with 1045 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.external#view") :: fields) 1046 - | other -> other) 1047 - | RecordView v -> 1048 - (match record_view_to_yojson v with 1049 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#view") :: fields) 1050 - | other -> other) 1051 - | RecordWithMediaView v -> 1052 - (match record_with_media_view_to_yojson v with 1053 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.recordWithMedia#view") :: fields) 1054 - | other -> other) 1055 - | Unknown j -> j 1339 + | ImagesView v -> ( 1340 + match App_bsky_embed_images.view_to_yojson v with 1341 + | `Assoc fields -> 1342 + `Assoc (("$type", `String "app.bsky.embed.images#view") :: fields) 1343 + | other -> 1344 + other ) 1345 + | VideoView v -> ( 1346 + match App_bsky_embed_video.view_to_yojson v with 1347 + | `Assoc fields -> 1348 + `Assoc (("$type", `String "app.bsky.embed.video#view") :: fields) 1349 + | other -> 1350 + other ) 1351 + | ExternalView v -> ( 1352 + match App_bsky_embed_external.view_to_yojson v with 1353 + | `Assoc fields -> 1354 + `Assoc (("$type", `String "app.bsky.embed.external#view") :: fields) 1355 + | other -> 1356 + other ) 1357 + | RecordView v -> ( 1358 + match record_view_to_yojson v with 1359 + | `Assoc fields -> 1360 + `Assoc (("$type", `String "app.bsky.embed.record#view") :: fields) 1361 + | other -> 1362 + other ) 1363 + | RecordWithMediaView v -> ( 1364 + match record_with_media_view_to_yojson v with 1365 + | `Assoc fields -> 1366 + `Assoc 1367 + (("$type", `String "app.bsky.embed.recordWithMedia#view") :: fields) 1368 + | other -> 1369 + other ) 1370 + | Unknown j -> 1371 + j 1056 1372 1057 1373 type post_view = 1058 - { 1059 - uri: string; 1060 - cid: string; 1061 - author: profile_view_basic; 1062 - record: Yojson.Safe.t; 1063 - embed: embeds_item option [@default None]; 1064 - reply_count: int option [@key "replyCount"] [@default None]; 1065 - repost_count: int option [@key "repostCount"] [@default None]; 1066 - like_count: int option [@key "likeCount"] [@default None]; 1067 - quote_count: int option [@key "quoteCount"] [@default None]; 1068 - indexed_at: string [@key "indexedAt"]; 1069 - viewer: feed_viewer_state option [@default None]; 1070 - labels: Com_atproto_label_defs.label list option [@default None]; 1071 - threadgate: threadgate_view option [@default None]; 1072 - } 1374 + { uri: string 1375 + ; cid: string 1376 + ; author: profile_view_basic 1377 + ; record: Yojson.Safe.t 1378 + ; embed: embeds_item option [@default None] 1379 + ; reply_count: int option [@key "replyCount"] [@default None] 1380 + ; repost_count: int option [@key "repostCount"] [@default None] 1381 + ; like_count: int option [@key "likeCount"] [@default None] 1382 + ; quote_count: int option [@key "quoteCount"] [@default None] 1383 + ; indexed_at: string [@key "indexedAt"] 1384 + ; viewer: feed_viewer_state option [@default None] 1385 + ; labels: Com_atproto_label_defs.label list option [@default None] 1386 + ; threadgate: threadgate_view option [@default None] } 1073 1387 [@@deriving yojson {strict= false}] 1074 1388 1075 1389 type thread_context = 1076 - { 1077 - root_author_like: string option [@key "rootAuthorLike"] [@default None]; 1078 - } 1390 + {root_author_like: string option [@key "rootAuthorLike"] [@default None]} 1079 1391 [@@deriving yojson {strict= false}] 1080 1392 1081 1393 type reason_pin = unit 1394 + 1082 1395 let reason_pin_of_yojson _ = Ok () 1396 + 1083 1397 let reason_pin_to_yojson () = `Assoc [] 1084 1398 1085 1399 type reason_repost = 1086 - { 1087 - by: profile_view_basic; 1088 - uri: string option [@default None]; 1089 - cid: string option [@default None]; 1090 - indexed_at: string [@key "indexedAt"]; 1091 - } 1400 + { by: profile_view_basic 1401 + ; uri: string option [@default None] 1402 + ; cid: string option [@default None] 1403 + ; indexed_at: string [@key "indexedAt"] } 1092 1404 [@@deriving yojson {strict= false}] 1093 1405 1094 - type blocked_post = 1095 - { 1096 - uri: string; 1097 - blocked: bool; 1098 - author: blocked_author; 1099 - } 1406 + type blocked_post = {uri: string; blocked: bool; author: blocked_author} 1100 1407 [@@deriving yojson {strict= false}] 1101 1408 1102 - type not_found_post = 1103 - { 1104 - uri: string; 1105 - not_found: bool [@key "notFound"]; 1106 - } 1409 + type not_found_post = {uri: string; not_found: bool [@key "notFound"]} 1107 1410 [@@deriving yojson {strict= false}] 1108 1411 1109 1412 type feed_parent = ··· 1116 1419 let open Yojson.Safe.Util in 1117 1420 try 1118 1421 match json |> member "$type" |> to_string with 1119 - | "app.bsky.feed.defs#postView" -> 1120 - (match post_view_of_yojson json with 1121 - | Ok v -> Ok (PostView v) 1122 - | Error e -> Error e) 1123 - | "app.bsky.feed.defs#notFoundPost" -> 1124 - (match not_found_post_of_yojson json with 1125 - | Ok v -> Ok (NotFoundPost v) 1126 - | Error e -> Error e) 1127 - | "app.bsky.feed.defs#blockedPost" -> 1128 - (match blocked_post_of_yojson json with 1129 - | Ok v -> Ok (BlockedPost v) 1130 - | Error e -> Error e) 1131 - | _ -> Ok (Unknown json) 1422 + | "app.bsky.feed.defs#postView" -> ( 1423 + match post_view_of_yojson json with 1424 + | Ok v -> 1425 + Ok (PostView v) 1426 + | Error e -> 1427 + Error e ) 1428 + | "app.bsky.feed.defs#notFoundPost" -> ( 1429 + match not_found_post_of_yojson json with 1430 + | Ok v -> 1431 + Ok (NotFoundPost v) 1432 + | Error e -> 1433 + Error e ) 1434 + | "app.bsky.feed.defs#blockedPost" -> ( 1435 + match blocked_post_of_yojson json with 1436 + | Ok v -> 1437 + Ok (BlockedPost v) 1438 + | Error e -> 1439 + Error e ) 1440 + | _ -> 1441 + Ok (Unknown json) 1132 1442 with _ -> Error "failed to parse union" 1133 1443 1134 1444 let feed_parent_to_yojson = function 1135 - | PostView v -> 1136 - (match post_view_to_yojson v with 1137 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#postView") :: fields) 1138 - | other -> other) 1139 - | NotFoundPost v -> 1140 - (match not_found_post_to_yojson v with 1141 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 1142 - | other -> other) 1143 - | BlockedPost v -> 1144 - (match blocked_post_to_yojson v with 1145 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 1146 - | other -> other) 1147 - | Unknown j -> j 1445 + | PostView v -> ( 1446 + match post_view_to_yojson v with 1447 + | `Assoc fields -> 1448 + `Assoc (("$type", `String "app.bsky.feed.defs#postView") :: fields) 1449 + | other -> 1450 + other ) 1451 + | NotFoundPost v -> ( 1452 + match not_found_post_to_yojson v with 1453 + | `Assoc fields -> 1454 + `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 1455 + | other -> 1456 + other ) 1457 + | BlockedPost v -> ( 1458 + match blocked_post_to_yojson v with 1459 + | `Assoc fields -> 1460 + `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 1461 + | other -> 1462 + other ) 1463 + | Unknown j -> 1464 + j 1148 1465 1149 1466 type root = 1150 1467 | PostView of post_view ··· 1156 1473 let open Yojson.Safe.Util in 1157 1474 try 1158 1475 match json |> member "$type" |> to_string with 1159 - | "app.bsky.feed.defs#postView" -> 1160 - (match post_view_of_yojson json with 1161 - | Ok v -> Ok (PostView v) 1162 - | Error e -> Error e) 1163 - | "app.bsky.feed.defs#notFoundPost" -> 1164 - (match not_found_post_of_yojson json with 1165 - | Ok v -> Ok (NotFoundPost v) 1166 - | Error e -> Error e) 1167 - | "app.bsky.feed.defs#blockedPost" -> 1168 - (match blocked_post_of_yojson json with 1169 - | Ok v -> Ok (BlockedPost v) 1170 - | Error e -> Error e) 1171 - | _ -> Ok (Unknown json) 1476 + | "app.bsky.feed.defs#postView" -> ( 1477 + match post_view_of_yojson json with 1478 + | Ok v -> 1479 + Ok (PostView v) 1480 + | Error e -> 1481 + Error e ) 1482 + | "app.bsky.feed.defs#notFoundPost" -> ( 1483 + match not_found_post_of_yojson json with 1484 + | Ok v -> 1485 + Ok (NotFoundPost v) 1486 + | Error e -> 1487 + Error e ) 1488 + | "app.bsky.feed.defs#blockedPost" -> ( 1489 + match blocked_post_of_yojson json with 1490 + | Ok v -> 1491 + Ok (BlockedPost v) 1492 + | Error e -> 1493 + Error e ) 1494 + | _ -> 1495 + Ok (Unknown json) 1172 1496 with _ -> Error "failed to parse union" 1173 1497 1174 1498 let root_to_yojson = function 1175 - | PostView v -> 1176 - (match post_view_to_yojson v with 1177 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#postView") :: fields) 1178 - | other -> other) 1179 - | NotFoundPost v -> 1180 - (match not_found_post_to_yojson v with 1181 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 1182 - | other -> other) 1183 - | BlockedPost v -> 1184 - (match blocked_post_to_yojson v with 1185 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 1186 - | other -> other) 1187 - | Unknown j -> j 1499 + | PostView v -> ( 1500 + match post_view_to_yojson v with 1501 + | `Assoc fields -> 1502 + `Assoc (("$type", `String "app.bsky.feed.defs#postView") :: fields) 1503 + | other -> 1504 + other ) 1505 + | NotFoundPost v -> ( 1506 + match not_found_post_to_yojson v with 1507 + | `Assoc fields -> 1508 + `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 1509 + | other -> 1510 + other ) 1511 + | BlockedPost v -> ( 1512 + match blocked_post_to_yojson v with 1513 + | `Assoc fields -> 1514 + `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 1515 + | other -> 1516 + other ) 1517 + | Unknown j -> 1518 + j 1188 1519 1189 1520 type reply_ref = 1190 - { 1191 - root: feed_parent; 1192 - parent: feed_parent; 1193 - grandparent_author: profile_view_basic option [@key "grandparentAuthor"] [@default None]; 1194 - } 1521 + { root: feed_parent 1522 + ; parent: feed_parent 1523 + ; grandparent_author: profile_view_basic option 1524 + [@key "grandparentAuthor"] [@default None] } 1195 1525 [@@deriving yojson {strict= false}] 1196 1526 1197 1527 type feed_reason = ··· 1203 1533 let open Yojson.Safe.Util in 1204 1534 try 1205 1535 match json |> member "$type" |> to_string with 1206 - | "app.bsky.feed.defs#reasonRepost" -> 1207 - (match reason_repost_of_yojson json with 1208 - | Ok v -> Ok (ReasonRepost v) 1209 - | Error e -> Error e) 1210 - | "app.bsky.feed.defs#reasonPin" -> 1211 - (match reason_pin_of_yojson json with 1212 - | Ok v -> Ok (ReasonPin v) 1213 - | Error e -> Error e) 1214 - | _ -> Ok (Unknown json) 1536 + | "app.bsky.feed.defs#reasonRepost" -> ( 1537 + match reason_repost_of_yojson json with 1538 + | Ok v -> 1539 + Ok (ReasonRepost v) 1540 + | Error e -> 1541 + Error e ) 1542 + | "app.bsky.feed.defs#reasonPin" -> ( 1543 + match reason_pin_of_yojson json with 1544 + | Ok v -> 1545 + Ok (ReasonPin v) 1546 + | Error e -> 1547 + Error e ) 1548 + | _ -> 1549 + Ok (Unknown json) 1215 1550 with _ -> Error "failed to parse union" 1216 1551 1217 1552 let feed_reason_to_yojson = function 1218 - | ReasonRepost v -> 1219 - (match reason_repost_to_yojson v with 1220 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#reasonRepost") :: fields) 1221 - | other -> other) 1222 - | ReasonPin v -> 1223 - (match reason_pin_to_yojson v with 1224 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#reasonPin") :: fields) 1225 - | other -> other) 1226 - | Unknown j -> j 1553 + | ReasonRepost v -> ( 1554 + match reason_repost_to_yojson v with 1555 + | `Assoc fields -> 1556 + `Assoc (("$type", `String "app.bsky.feed.defs#reasonRepost") :: fields) 1557 + | other -> 1558 + other ) 1559 + | ReasonPin v -> ( 1560 + match reason_pin_to_yojson v with 1561 + | `Assoc fields -> 1562 + `Assoc (("$type", `String "app.bsky.feed.defs#reasonPin") :: fields) 1563 + | other -> 1564 + other ) 1565 + | Unknown j -> 1566 + j 1227 1567 1228 1568 type feed_view_post = 1229 - { 1230 - post: post_view; 1231 - reply: reply_ref option [@default None]; 1232 - reason: feed_reason option [@default None]; 1233 - feed_context: string option [@key "feedContext"] [@default None]; 1234 - req_id: string option [@key "reqId"] [@default None]; 1235 - } 1569 + { post: post_view 1570 + ; reply: reply_ref option [@default None] 1571 + ; reason: feed_reason option [@default None] 1572 + ; feed_context: string option [@key "feedContext"] [@default None] 1573 + ; req_id: string option [@key "reqId"] [@default None] } 1236 1574 [@@deriving yojson {strict= false}] 1237 1575 1238 1576 type replies_item = ··· 1240 1578 | NotFoundPost of not_found_post 1241 1579 | BlockedPost of blocked_post 1242 1580 | Unknown of Yojson.Safe.t 1243 - and thread_view_post = { 1244 - post: post_view; 1245 - parent: replies_item option [@default None]; 1246 - replies: replies_item list option [@default None]; 1247 - thread_context: thread_context option [@key "threadContext"] [@default None]; 1248 - } 1581 + 1582 + and thread_view_post = 1583 + { post: post_view 1584 + ; parent: replies_item option [@default None] 1585 + ; replies: replies_item list option [@default None] 1586 + ; thread_context: thread_context option [@key "threadContext"] [@default None] 1587 + } 1249 1588 1250 1589 let rec replies_item_of_yojson json = 1251 1590 let open Yojson.Safe.Util in 1252 1591 try 1253 1592 match json |> member "$type" |> to_string with 1254 - | "app.bsky.feed.defs#threadViewPost" -> 1255 - (match thread_view_post_of_yojson json with 1256 - | Ok v -> Ok (ThreadViewPost v) 1257 - | Error e -> Error e) 1258 - | "app.bsky.feed.defs#notFoundPost" -> 1259 - (match not_found_post_of_yojson json with 1260 - | Ok v -> Ok (NotFoundPost v) 1261 - | Error e -> Error e) 1262 - | "app.bsky.feed.defs#blockedPost" -> 1263 - (match blocked_post_of_yojson json with 1264 - | Ok v -> Ok (BlockedPost v) 1265 - | Error e -> Error e) 1266 - | _ -> Ok (Unknown json) 1593 + | "app.bsky.feed.defs#threadViewPost" -> ( 1594 + match thread_view_post_of_yojson json with 1595 + | Ok v -> 1596 + Ok (ThreadViewPost v) 1597 + | Error e -> 1598 + Error e ) 1599 + | "app.bsky.feed.defs#notFoundPost" -> ( 1600 + match not_found_post_of_yojson json with 1601 + | Ok v -> 1602 + Ok (NotFoundPost v) 1603 + | Error e -> 1604 + Error e ) 1605 + | "app.bsky.feed.defs#blockedPost" -> ( 1606 + match blocked_post_of_yojson json with 1607 + | Ok v -> 1608 + Ok (BlockedPost v) 1609 + | Error e -> 1610 + Error e ) 1611 + | _ -> 1612 + Ok (Unknown json) 1267 1613 with _ -> Error "failed to parse union" 1268 1614 1269 1615 and thread_view_post_of_yojson json = 1270 1616 let open Yojson.Safe.Util in 1271 1617 try 1272 1618 let post = json |> member "post" |> post_view_of_yojson |> Result.get_ok in 1273 - let parent = json |> member "parent" |> to_option (fun x -> match replies_item_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 1274 - let replies = json |> member "replies" |> to_option (fun j -> to_list j |> List.filter_map (fun x -> match replies_item_of_yojson x with Ok v -> Some v | _ -> None)) in 1275 - let thread_context = json |> member "threadContext" |> to_option (fun x -> match thread_context_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 1276 - Ok { post; parent; replies; thread_context } 1619 + let parent = 1620 + json |> member "parent" 1621 + |> to_option (fun x -> 1622 + match replies_item_of_yojson x with Ok v -> Some v | _ -> None ) 1623 + |> Option.join 1624 + in 1625 + let replies = 1626 + json |> member "replies" 1627 + |> to_option (fun j -> 1628 + to_list j 1629 + |> List.filter_map (fun x -> 1630 + match replies_item_of_yojson x with Ok v -> Some v | _ -> None ) ) 1631 + in 1632 + let thread_context = 1633 + json |> member "threadContext" 1634 + |> to_option (fun x -> 1635 + match thread_context_of_yojson x with Ok v -> Some v | _ -> None ) 1636 + |> Option.join 1637 + in 1638 + Ok {post; parent; replies; thread_context} 1277 1639 with e -> Error (Printexc.to_string e) 1278 1640 1279 1641 and replies_item_to_yojson = function 1280 - | ThreadViewPost v -> 1281 - (match thread_view_post_to_yojson v with 1282 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#threadViewPost") :: fields) 1283 - | other -> other) 1284 - | NotFoundPost v -> 1285 - (match not_found_post_to_yojson v with 1286 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 1287 - | other -> other) 1288 - | BlockedPost v -> 1289 - (match blocked_post_to_yojson v with 1290 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 1291 - | other -> other) 1292 - | Unknown j -> j 1642 + | ThreadViewPost v -> ( 1643 + match thread_view_post_to_yojson v with 1644 + | `Assoc fields -> 1645 + `Assoc (("$type", `String "app.bsky.feed.defs#threadViewPost") :: fields) 1646 + | other -> 1647 + other ) 1648 + | NotFoundPost v -> ( 1649 + match not_found_post_to_yojson v with 1650 + | `Assoc fields -> 1651 + `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 1652 + | other -> 1653 + other ) 1654 + | BlockedPost v -> ( 1655 + match blocked_post_to_yojson v with 1656 + | `Assoc fields -> 1657 + `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 1658 + | other -> 1659 + other ) 1660 + | Unknown j -> 1661 + j 1293 1662 1294 1663 and thread_view_post_to_yojson (r : thread_view_post) = 1295 - `Assoc [ 1296 - ("post", post_view_to_yojson r.post); 1297 - ("parent", match r.parent with Some v -> replies_item_to_yojson v | None -> `Null); 1298 - ("replies", match r.replies with Some v -> (fun l -> `List (List.map replies_item_to_yojson l)) v | None -> `Null); 1299 - ("threadContext", match r.thread_context with Some v -> thread_context_to_yojson v | None -> `Null) 1300 - ] 1664 + `Assoc 1665 + [ ("post", post_view_to_yojson r.post) 1666 + ; ( "parent" 1667 + , match r.parent with Some v -> replies_item_to_yojson v | None -> `Null 1668 + ) 1669 + ; ( "replies" 1670 + , match r.replies with 1671 + | Some v -> 1672 + (fun l -> `List (List.map replies_item_to_yojson l)) v 1673 + | None -> 1674 + `Null ) 1675 + ; ( "threadContext" 1676 + , match r.thread_context with 1677 + | Some v -> 1678 + thread_context_to_yojson v 1679 + | None -> 1680 + `Null ) ] 1301 1681 1302 1682 type skeleton_reason_pin = unit 1683 + 1303 1684 let skeleton_reason_pin_of_yojson _ = Ok () 1685 + 1304 1686 let skeleton_reason_pin_to_yojson () = `Assoc [] 1305 1687 1306 - type skeleton_reason_repost = 1307 - { 1308 - repost: string; 1309 - } 1688 + type skeleton_reason_repost = {repost: string} 1310 1689 [@@deriving yojson {strict= false}] 1311 1690 1312 1691 type skeleton_feed_post = 1313 - { 1314 - post: string; 1315 - reason: feed_reason option [@default None]; 1316 - feed_context: string option [@key "feedContext"] [@default None]; 1317 - } 1692 + { post: string 1693 + ; reason: feed_reason option [@default None] 1694 + ; feed_context: string option [@key "feedContext"] [@default None] } 1318 1695 [@@deriving yojson {strict= false}] 1319 1696 1320 1697 type interaction = 1321 - { 1322 - item: string option [@default None]; 1323 - event: string option [@default None]; 1324 - feed_context: string option [@key "feedContext"] [@default None]; 1325 - req_id: string option [@key "reqId"] [@default None]; 1326 - } 1698 + { item: string option [@default None] 1699 + ; event: string option [@default None] 1700 + ; feed_context: string option [@key "feedContext"] [@default None] 1701 + ; req_id: string option [@key "reqId"] [@default None] } 1327 1702 [@@deriving yojson {strict= false}] 1328 1703 1329 1704 (** Request that less content like the given feed item be shown in the feed *) ··· 1368 1743 (** User shared the feed item *) 1369 1744 let interaction_share = "app.bsky.feed.defs#interactionShare" 1370 1745 1371 - type list_item_view = 1372 - { 1373 - uri: string; 1374 - subject: profile_view; 1375 - } 1746 + type list_item_view = {uri: string; subject: profile_view} 1376 1747 [@@deriving yojson {strict= false}] 1377 1748 1378 1749 type starter_pack_view = 1379 - { 1380 - uri: string; 1381 - cid: string; 1382 - record: Yojson.Safe.t; 1383 - creator: profile_view_basic; 1384 - list_: list_view_basic option [@key "list"] [@default None]; 1385 - list_items_sample: list_item_view list option [@key "listItemsSample"] [@default None]; 1386 - feeds: generator_view list option [@default None]; 1387 - joined_week_count: int option [@key "joinedWeekCount"] [@default None]; 1388 - joined_all_time_count: int option [@key "joinedAllTimeCount"] [@default None]; 1389 - labels: Com_atproto_label_defs.label list option [@default None]; 1390 - indexed_at: string [@key "indexedAt"]; 1391 - } 1750 + { uri: string 1751 + ; cid: string 1752 + ; record: Yojson.Safe.t 1753 + ; creator: profile_view_basic 1754 + ; list_: list_view_basic option [@key "list"] [@default None] 1755 + ; list_items_sample: list_item_view list option 1756 + [@key "listItemsSample"] [@default None] 1757 + ; feeds: generator_view list option [@default None] 1758 + ; joined_week_count: int option [@key "joinedWeekCount"] [@default None] 1759 + ; joined_all_time_count: int option 1760 + [@key "joinedAllTimeCount"] [@default None] 1761 + ; labels: Com_atproto_label_defs.label list option [@default None] 1762 + ; indexed_at: string [@key "indexedAt"] } 1392 1763 [@@deriving yojson {strict= false}] 1393 1764 1394 1765 (** A list of actors to apply an aggregate moderation action (mute/block) on. *) ··· 1400 1771 (** A list of actors used for only for reference purposes such as within a starter pack. *) 1401 1772 let referencelist = "app.bsky.graph.defs#referencelist" 1402 1773 1403 - type not_found_actor = 1404 - { 1405 - actor: string; 1406 - not_found: bool [@key "notFound"]; 1407 - } 1774 + type not_found_actor = {actor: string; not_found: bool [@key "notFound"]} 1408 1775 [@@deriving yojson {strict= false}] 1409 1776 1410 1777 type relationship = 1411 - { 1412 - did: string; 1413 - following: string option [@default None]; 1414 - followed_by: string option [@key "followedBy"] [@default None]; 1415 - } 1778 + { did: string 1779 + ; following: string option [@default None] 1780 + ; followed_by: string option [@key "followedBy"] [@default None] } 1416 1781 [@@deriving yojson {strict= false}] 1417 1782 1418 1783 type labeler_policies = 1419 - { 1420 - label_values: Com_atproto_label_defs.label_value list [@key "labelValues"]; 1421 - label_value_definitions: Com_atproto_label_defs.label_value_definition list option [@key "labelValueDefinitions"] [@default None]; 1422 - } 1784 + { label_values: Com_atproto_label_defs.label_value list [@key "labelValues"] 1785 + ; label_value_definitions: 1786 + Com_atproto_label_defs.label_value_definition list option 1787 + [@key "labelValueDefinitions"] [@default None] } 1423 1788 [@@deriving yojson {strict= false}] 1424 1789 1425 1790 type labeler_view_detailed = 1426 - { 1427 - uri: string; 1428 - cid: string; 1429 - creator: profile_view; 1430 - policies: labeler_policies; 1431 - like_count: int option [@key "likeCount"] [@default None]; 1432 - viewer: labeler_viewer_state option [@default None]; 1433 - indexed_at: string [@key "indexedAt"]; 1434 - labels: Com_atproto_label_defs.label list option [@default None]; 1435 - reason_types: Com_atproto_moderation_defs.reason_type list option [@key "reasonTypes"] [@default None]; 1436 - subject_types: Com_atproto_moderation_defs.subject_type list option [@key "subjectTypes"] [@default None]; 1437 - subject_collections: string list option [@key "subjectCollections"] [@default None]; 1438 - } 1791 + { uri: string 1792 + ; cid: string 1793 + ; creator: profile_view 1794 + ; policies: labeler_policies 1795 + ; like_count: int option [@key "likeCount"] [@default None] 1796 + ; viewer: labeler_viewer_state option [@default None] 1797 + ; indexed_at: string [@key "indexedAt"] 1798 + ; labels: Com_atproto_label_defs.label list option [@default None] 1799 + ; reason_types: Com_atproto_moderation_defs.reason_type list option 1800 + [@key "reasonTypes"] [@default None] 1801 + ; subject_types: Com_atproto_moderation_defs.subject_type list option 1802 + [@key "subjectTypes"] [@default None] 1803 + ; subject_collections: string list option 1804 + [@key "subjectCollections"] [@default None] } 1439 1805 [@@deriving yojson {strict= false}] 1440 -
+44 -67
pegasus/lexicons/app_bsky_unspecced_defs.ml
··· 1 1 (* generated from app.bsky.unspecced.defs *) 2 2 3 - type skeleton_search_post = 4 - { 5 - uri: string; 6 - } 7 - [@@deriving yojson {strict= false}] 3 + type skeleton_search_post = {uri: string} [@@deriving yojson {strict= false}] 8 4 9 - type skeleton_search_actor = 10 - { 11 - did: string; 12 - } 13 - [@@deriving yojson {strict= false}] 5 + type skeleton_search_actor = {did: string} [@@deriving yojson {strict= false}] 14 6 15 - type skeleton_search_starter_pack = 16 - { 17 - uri: string; 18 - } 7 + type skeleton_search_starter_pack = {uri: string} 19 8 [@@deriving yojson {strict= false}] 20 9 21 10 type trending_topic = 22 - { 23 - topic: string; 24 - display_name: string option [@key "displayName"] [@default None]; 25 - description: string option [@default None]; 26 - link: string; 27 - } 11 + { topic: string 12 + ; display_name: string option [@key "displayName"] [@default None] 13 + ; description: string option [@default None] 14 + ; link: string } 28 15 [@@deriving yojson {strict= false}] 29 16 30 17 type skeleton_trend = 31 - { 32 - topic: string; 33 - display_name: string [@key "displayName"]; 34 - link: string; 35 - started_at: string [@key "startedAt"]; 36 - post_count: int [@key "postCount"]; 37 - status: string option [@default None]; 38 - category: string option [@default None]; 39 - dids: string list; 40 - } 18 + { topic: string 19 + ; display_name: string [@key "displayName"] 20 + ; link: string 21 + ; started_at: string [@key "startedAt"] 22 + ; post_count: int [@key "postCount"] 23 + ; status: string option [@default None] 24 + ; category: string option [@default None] 25 + ; dids: string list } 41 26 [@@deriving yojson {strict= false}] 42 27 43 28 type trend_view = 44 - { 45 - topic: string; 46 - display_name: string [@key "displayName"]; 47 - link: string; 48 - started_at: string [@key "startedAt"]; 49 - post_count: int [@key "postCount"]; 50 - status: string option [@default None]; 51 - category: string option [@default None]; 52 - actors: App_bsky_actor_defs.profile_view_basic list; 53 - } 29 + { topic: string 30 + ; display_name: string [@key "displayName"] 31 + ; link: string 32 + ; started_at: string [@key "startedAt"] 33 + ; post_count: int [@key "postCount"] 34 + ; status: string option [@default None] 35 + ; category: string option [@default None] 36 + ; actors: App_bsky_actor_defs.profile_view_basic list } 54 37 [@@deriving yojson {strict= false}] 55 38 56 39 type thread_item_post = 57 - { 58 - post: App_bsky_feed_defs.post_view; 59 - more_parents: bool [@key "moreParents"]; 60 - more_replies: int [@key "moreReplies"]; 61 - op_thread: bool [@key "opThread"]; 62 - hidden_by_threadgate: bool [@key "hiddenByThreadgate"]; 63 - muted_by_viewer: bool [@key "mutedByViewer"]; 64 - } 40 + { post: App_bsky_feed_defs.post_view 41 + ; more_parents: bool [@key "moreParents"] 42 + ; more_replies: int [@key "moreReplies"] 43 + ; op_thread: bool [@key "opThread"] 44 + ; hidden_by_threadgate: bool [@key "hiddenByThreadgate"] 45 + ; muted_by_viewer: bool [@key "mutedByViewer"] } 65 46 [@@deriving yojson {strict= false}] 66 47 67 48 type thread_item_no_unauthenticated = unit 49 + 68 50 let thread_item_no_unauthenticated_of_yojson _ = Ok () 51 + 69 52 let thread_item_no_unauthenticated_to_yojson () = `Assoc [] 70 53 71 54 type thread_item_not_found = unit 55 + 72 56 let thread_item_not_found_of_yojson _ = Ok () 57 + 73 58 let thread_item_not_found_to_yojson () = `Assoc [] 74 59 75 - type thread_item_blocked = 76 - { 77 - author: App_bsky_feed_defs.blocked_author; 78 - } 60 + type thread_item_blocked = {author: App_bsky_feed_defs.blocked_author} 79 61 [@@deriving yojson {strict= false}] 80 62 81 63 type age_assurance_state = 82 - { 83 - last_initiated_at: string option [@key "lastInitiatedAt"] [@default None]; 84 - status: string; 85 - } 64 + { last_initiated_at: string option [@key "lastInitiatedAt"] [@default None] 65 + ; status: string } 86 66 [@@deriving yojson {strict= false}] 87 67 88 68 type age_assurance_event = 89 - { 90 - created_at: string [@key "createdAt"]; 91 - status: string; 92 - attempt_id: string [@key "attemptId"]; 93 - email: string option [@default None]; 94 - init_ip: string option [@key "initIp"] [@default None]; 95 - init_ua: string option [@key "initUa"] [@default None]; 96 - complete_ip: string option [@key "completeIp"] [@default None]; 97 - complete_ua: string option [@key "completeUa"] [@default None]; 98 - } 69 + { created_at: string [@key "createdAt"] 70 + ; status: string 71 + ; attempt_id: string [@key "attemptId"] 72 + ; email: string option [@default None] 73 + ; init_ip: string option [@key "initIp"] [@default None] 74 + ; init_ua: string option [@key "initUa"] [@default None] 75 + ; complete_ip: string option [@key "completeIp"] [@default None] 76 + ; complete_ua: string option [@key "completeUa"] [@default None] } 99 77 [@@deriving yojson {strict= false}] 100 -
+3 -4
pegasus/lexicons/app_bsky_unspecced_getAgeAssuranceState.ml
··· 5 5 let nsid = "app.bsky.unspecced.getAgeAssuranceState" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = App_bsky_unspecced_defs.age_assurance_state 11 - [@@deriving yojson {strict= false}] 12 + [@@deriving yojson {strict= false}] 12 13 13 - let call 14 - (client : Hermes.client) : output Lwt.t = 14 + let call (client : Hermes.client) : output Lwt.t = 15 15 Hermes.query client nsid (`Assoc []) output_of_yojson 16 16 end 17 -
+7 -13
pegasus/lexicons/app_bsky_unspecced_getConfig.ml
··· 1 1 (* generated from app.bsky.unspecced.getConfig *) 2 2 3 - type live_now_config = 4 - { 5 - did: string; 6 - domains: string list; 7 - } 3 + type live_now_config = {did: string; domains: string list} 8 4 [@@deriving yojson {strict= false}] 9 5 10 6 (** Get miscellaneous runtime configuration. *) ··· 12 8 let nsid = "app.bsky.unspecced.getConfig" 13 9 14 10 type params = unit 11 + 15 12 let params_to_yojson () = `Assoc [] 16 13 17 14 type output = 18 - { 19 - check_email_confirmed: bool option [@key "checkEmailConfirmed"] [@default None]; 20 - live_now: live_now_config list option [@key "liveNow"] [@default None]; 21 - } 22 - [@@deriving yojson {strict= false}] 15 + { check_email_confirmed: bool option 16 + [@key "checkEmailConfirmed"] [@default None] 17 + ; live_now: live_now_config list option [@key "liveNow"] [@default None] } 18 + [@@deriving yojson {strict= false}] 23 19 24 - let call 25 - (client : Hermes.client) : output Lwt.t = 20 + let call (client : Hermes.client) : output Lwt.t = 26 21 Hermes.query client nsid (`Assoc []) output_of_yojson 27 22 end 28 -
+8 -17
pegasus/lexicons/app_bsky_unspecced_getPopularFeedGenerators.ml
··· 5 5 let nsid = "app.bsky.unspecced.getPopularFeedGenerators" 6 6 7 7 type params = 8 - { 9 - limit: int option [@default None]; 10 - cursor: string option [@default None]; 11 - query: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { limit: int option [@default None] 9 + ; cursor: string option [@default None] 10 + ; query: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - feeds: App_bsky_feed_defs.generator_view list; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; feeds: App_bsky_feed_defs.generator_view list } 16 + [@@deriving yojson {strict= false}] 21 17 22 - let call 23 - ?limit 24 - ?cursor 25 - ?query 26 - (client : Hermes.client) : output Lwt.t = 18 + let call ?limit ?cursor ?query (client : Hermes.client) : output Lwt.t = 27 19 let params : params = {limit; cursor; query} in 28 20 Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 21 end 30 -
+25 -31
pegasus/lexicons/app_bsky_unspecced_getPostThreadOtherV2.ml
··· 8 8 let open Yojson.Safe.Util in 9 9 try 10 10 match json |> member "$type" |> to_string with 11 - | "app.bsky.unspecced.defs#threadItemPost" -> 12 - (match App_bsky_unspecced_defs.thread_item_post_of_yojson json with 13 - | Ok v -> Ok (ThreadItemPost v) 14 - | Error e -> Error e) 15 - | _ -> Ok (Unknown json) 11 + | "app.bsky.unspecced.defs#threadItemPost" -> ( 12 + match App_bsky_unspecced_defs.thread_item_post_of_yojson json with 13 + | Ok v -> 14 + Ok (ThreadItemPost v) 15 + | Error e -> 16 + Error e ) 17 + | _ -> 18 + Ok (Unknown json) 16 19 with _ -> Error "failed to parse union" 17 20 18 21 let value_to_yojson = function 19 - | ThreadItemPost v -> 20 - (match App_bsky_unspecced_defs.thread_item_post_to_yojson v with 21 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.unspecced.defs#threadItemPost") :: fields) 22 - | other -> other) 23 - | Unknown j -> j 22 + | ThreadItemPost v -> ( 23 + match App_bsky_unspecced_defs.thread_item_post_to_yojson v with 24 + | `Assoc fields -> 25 + `Assoc 26 + (("$type", `String "app.bsky.unspecced.defs#threadItemPost") :: fields) 27 + | other -> 28 + other ) 29 + | Unknown j -> 30 + j 24 31 25 - type thread_item = 26 - { 27 - uri: string; 28 - depth: int; 29 - value: value; 30 - } 32 + type thread_item = {uri: string; depth: int; value: value} 31 33 [@@deriving yojson {strict= false}] 32 34 33 35 (** (NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get additional posts under a thread e.g. replies hidden by threadgate. Based on an anchor post at any depth of the tree, returns top-level replies below that anchor. It does not include ancestors nor the anchor itself. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests. *) ··· 35 37 let nsid = "app.bsky.unspecced.getPostThreadOtherV2" 36 38 37 39 type params = 38 - { 39 - anchor: string; 40 - prioritize_followed_users: bool option [@key "prioritizeFollowedUsers"] [@default None]; 41 - } 42 - [@@deriving yojson {strict= false}] 40 + { anchor: string 41 + ; prioritize_followed_users: bool option 42 + [@key "prioritizeFollowedUsers"] [@default None] } 43 + [@@deriving yojson {strict= false}] 43 44 44 - type output = 45 - { 46 - thread: thread_item list; 47 - } 48 - [@@deriving yojson {strict= false}] 45 + type output = {thread: thread_item list} [@@deriving yojson {strict= false}] 49 46 50 - let call 51 - ~anchor 52 - ?prioritize_followed_users 53 - (client : Hermes.client) : output Lwt.t = 47 + let call ~anchor ?prioritize_followed_users (client : Hermes.client) : 48 + output Lwt.t = 54 49 let params : params = {anchor; prioritize_followed_users} in 55 50 Hermes.query client nsid (params_to_yojson params) output_of_yojson 56 51 end 57 -
+84 -66
pegasus/lexicons/app_bsky_unspecced_getPostThreadV2.ml
··· 2 2 3 3 type value = 4 4 | ThreadItemPost of App_bsky_unspecced_defs.thread_item_post 5 - | ThreadItemNoUnauthenticated of App_bsky_unspecced_defs.thread_item_no_unauthenticated 5 + | ThreadItemNoUnauthenticated of 6 + App_bsky_unspecced_defs.thread_item_no_unauthenticated 6 7 | ThreadItemNotFound of App_bsky_unspecced_defs.thread_item_not_found 7 8 | ThreadItemBlocked of App_bsky_unspecced_defs.thread_item_blocked 8 9 | Unknown of Yojson.Safe.t ··· 11 12 let open Yojson.Safe.Util in 12 13 try 13 14 match json |> member "$type" |> to_string with 14 - | "app.bsky.unspecced.defs#threadItemPost" -> 15 - (match App_bsky_unspecced_defs.thread_item_post_of_yojson json with 16 - | Ok v -> Ok (ThreadItemPost v) 17 - | Error e -> Error e) 18 - | "app.bsky.unspecced.defs#threadItemNoUnauthenticated" -> 19 - (match App_bsky_unspecced_defs.thread_item_no_unauthenticated_of_yojson json with 20 - | Ok v -> Ok (ThreadItemNoUnauthenticated v) 21 - | Error e -> Error e) 22 - | "app.bsky.unspecced.defs#threadItemNotFound" -> 23 - (match App_bsky_unspecced_defs.thread_item_not_found_of_yojson json with 24 - | Ok v -> Ok (ThreadItemNotFound v) 25 - | Error e -> Error e) 26 - | "app.bsky.unspecced.defs#threadItemBlocked" -> 27 - (match App_bsky_unspecced_defs.thread_item_blocked_of_yojson json with 28 - | Ok v -> Ok (ThreadItemBlocked v) 29 - | Error e -> Error e) 30 - | _ -> Ok (Unknown json) 15 + | "app.bsky.unspecced.defs#threadItemPost" -> ( 16 + match App_bsky_unspecced_defs.thread_item_post_of_yojson json with 17 + | Ok v -> 18 + Ok (ThreadItemPost v) 19 + | Error e -> 20 + Error e ) 21 + | "app.bsky.unspecced.defs#threadItemNoUnauthenticated" -> ( 22 + match 23 + App_bsky_unspecced_defs.thread_item_no_unauthenticated_of_yojson json 24 + with 25 + | Ok v -> 26 + Ok (ThreadItemNoUnauthenticated v) 27 + | Error e -> 28 + Error e ) 29 + | "app.bsky.unspecced.defs#threadItemNotFound" -> ( 30 + match App_bsky_unspecced_defs.thread_item_not_found_of_yojson json with 31 + | Ok v -> 32 + Ok (ThreadItemNotFound v) 33 + | Error e -> 34 + Error e ) 35 + | "app.bsky.unspecced.defs#threadItemBlocked" -> ( 36 + match App_bsky_unspecced_defs.thread_item_blocked_of_yojson json with 37 + | Ok v -> 38 + Ok (ThreadItemBlocked v) 39 + | Error e -> 40 + Error e ) 41 + | _ -> 42 + Ok (Unknown json) 31 43 with _ -> Error "failed to parse union" 32 44 33 45 let value_to_yojson = function 34 - | ThreadItemPost v -> 35 - (match App_bsky_unspecced_defs.thread_item_post_to_yojson v with 36 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.unspecced.defs#threadItemPost") :: fields) 37 - | other -> other) 38 - | ThreadItemNoUnauthenticated v -> 39 - (match App_bsky_unspecced_defs.thread_item_no_unauthenticated_to_yojson v with 40 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.unspecced.defs#threadItemNoUnauthenticated") :: fields) 41 - | other -> other) 42 - | ThreadItemNotFound v -> 43 - (match App_bsky_unspecced_defs.thread_item_not_found_to_yojson v with 44 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.unspecced.defs#threadItemNotFound") :: fields) 45 - | other -> other) 46 - | ThreadItemBlocked v -> 47 - (match App_bsky_unspecced_defs.thread_item_blocked_to_yojson v with 48 - | `Assoc fields -> `Assoc (("$type", `String "app.bsky.unspecced.defs#threadItemBlocked") :: fields) 49 - | other -> other) 50 - | Unknown j -> j 46 + | ThreadItemPost v -> ( 47 + match App_bsky_unspecced_defs.thread_item_post_to_yojson v with 48 + | `Assoc fields -> 49 + `Assoc 50 + (("$type", `String "app.bsky.unspecced.defs#threadItemPost") :: fields) 51 + | other -> 52 + other ) 53 + | ThreadItemNoUnauthenticated v -> ( 54 + match 55 + App_bsky_unspecced_defs.thread_item_no_unauthenticated_to_yojson v 56 + with 57 + | `Assoc fields -> 58 + `Assoc 59 + ( ( "$type" 60 + , `String "app.bsky.unspecced.defs#threadItemNoUnauthenticated" ) 61 + :: fields ) 62 + | other -> 63 + other ) 64 + | ThreadItemNotFound v -> ( 65 + match App_bsky_unspecced_defs.thread_item_not_found_to_yojson v with 66 + | `Assoc fields -> 67 + `Assoc 68 + ( ("$type", `String "app.bsky.unspecced.defs#threadItemNotFound") 69 + :: fields ) 70 + | other -> 71 + other ) 72 + | ThreadItemBlocked v -> ( 73 + match App_bsky_unspecced_defs.thread_item_blocked_to_yojson v with 74 + | `Assoc fields -> 75 + `Assoc 76 + ( ("$type", `String "app.bsky.unspecced.defs#threadItemBlocked") 77 + :: fields ) 78 + | other -> 79 + other ) 80 + | Unknown j -> 81 + j 51 82 52 - type thread_item = 53 - { 54 - uri: string; 55 - depth: int; 56 - value: value; 57 - } 83 + type thread_item = {uri: string; depth: int; value: value} 58 84 [@@deriving yojson {strict= false}] 59 85 60 86 (** (NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get posts in a thread. It is based in an anchor post at any depth of the tree, and returns posts above it (recursively resolving the parent, without further branching to their replies) and below it (recursive replies, with branching to their replies). Does not require auth, but additional metadata and filtering will be applied for authed requests. *) ··· 62 88 let nsid = "app.bsky.unspecced.getPostThreadV2" 63 89 64 90 type params = 65 - { 66 - anchor: string; 67 - above: bool option [@default None]; 68 - below: int option [@default None]; 69 - branching_factor: int option [@key "branchingFactor"] [@default None]; 70 - prioritize_followed_users: bool option [@key "prioritizeFollowedUsers"] [@default None]; 71 - sort: string option [@default None]; 72 - } 73 - [@@deriving yojson {strict= false}] 91 + { anchor: string 92 + ; above: bool option [@default None] 93 + ; below: int option [@default None] 94 + ; branching_factor: int option [@key "branchingFactor"] [@default None] 95 + ; prioritize_followed_users: bool option 96 + [@key "prioritizeFollowedUsers"] [@default None] 97 + ; sort: string option [@default None] } 98 + [@@deriving yojson {strict= false}] 74 99 75 100 type output = 76 - { 77 - thread: thread_item list; 78 - threadgate: App_bsky_feed_defs.threadgate_view option [@default None]; 79 - has_other_replies: bool [@key "hasOtherReplies"]; 80 - } 81 - [@@deriving yojson {strict= false}] 101 + { thread: thread_item list 102 + ; threadgate: App_bsky_feed_defs.threadgate_view option [@default None] 103 + ; has_other_replies: bool [@key "hasOtherReplies"] } 104 + [@@deriving yojson {strict= false}] 82 105 83 - let call 84 - ~anchor 85 - ?above 86 - ?below 87 - ?branching_factor 88 - ?prioritize_followed_users 89 - ?sort 90 - (client : Hermes.client) : output Lwt.t = 91 - let params : params = {anchor; above; below; branching_factor; prioritize_followed_users; sort} in 106 + let call ~anchor ?above ?below ?branching_factor ?prioritize_followed_users 107 + ?sort (client : Hermes.client) : output Lwt.t = 108 + let params : params = 109 + {anchor; above; below; branching_factor; prioritize_followed_users; sort} 110 + in 92 111 Hermes.query client nsid (params_to_yojson params) output_of_yojson 93 112 end 94 -
+5 -14
pegasus/lexicons/app_bsky_unspecced_getSuggestedFeeds.ml
··· 4 4 module Main = struct 5 5 let nsid = "app.bsky.unspecced.getSuggestedFeeds" 6 6 7 - type params = 8 - { 9 - limit: int option [@default None]; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {limit: int option [@default None]} 8 + [@@deriving yojson {strict= false}] 12 9 13 - type output = 14 - { 15 - feeds: App_bsky_feed_defs.generator_view list; 16 - } 17 - [@@deriving yojson {strict= false}] 10 + type output = {feeds: App_bsky_feed_defs.generator_view list} 11 + [@@deriving yojson {strict= false}] 18 12 19 - let call 20 - ?limit 21 - (client : Hermes.client) : output Lwt.t = 13 + let call ?limit (client : Hermes.client) : output Lwt.t = 22 14 let params : params = {limit} in 23 15 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 16 end 25 -
+4 -15
pegasus/lexicons/app_bsky_unspecced_getSuggestedFeedsSkeleton.ml
··· 5 5 let nsid = "app.bsky.unspecced.getSuggestedFeedsSkeleton" 6 6 7 7 type params = 8 - { 9 - viewer: string option [@default None]; 10 - limit: int option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {viewer: string option [@default None]; limit: int option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 - type output = 15 - { 16 - feeds: string list; 17 - } 18 - [@@deriving yojson {strict= false}] 11 + type output = {feeds: string list} [@@deriving yojson {strict= false}] 19 12 20 - let call 21 - ?viewer 22 - ?limit 23 - (client : Hermes.client) : output Lwt.t = 13 + let call ?viewer ?limit (client : Hermes.client) : output Lwt.t = 24 14 let params : params = {viewer; limit} in 25 15 Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 16 end 27 -
+6 -13
pegasus/lexicons/app_bsky_unspecced_getSuggestedStarterPacks.ml
··· 4 4 module Main = struct 5 5 let nsid = "app.bsky.unspecced.getSuggestedStarterPacks" 6 6 7 - type params = 8 - { 9 - limit: int option [@default None]; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {limit: int option [@default None]} 8 + [@@deriving yojson {strict= false}] 12 9 13 10 type output = 14 - { 15 - starter_packs: App_bsky_graph_defs.starter_pack_view list [@key "starterPacks"]; 16 - } 17 - [@@deriving yojson {strict= false}] 11 + { starter_packs: App_bsky_graph_defs.starter_pack_view list 12 + [@key "starterPacks"] } 13 + [@@deriving yojson {strict= false}] 18 14 19 - let call 20 - ?limit 21 - (client : Hermes.client) : output Lwt.t = 15 + let call ?limit (client : Hermes.client) : output Lwt.t = 22 16 let params : params = {limit} in 23 17 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 18 end 25 -
+5 -15
pegasus/lexicons/app_bsky_unspecced_getSuggestedStarterPacksSkeleton.ml
··· 5 5 let nsid = "app.bsky.unspecced.getSuggestedStarterPacksSkeleton" 6 6 7 7 type params = 8 - { 9 - viewer: string option [@default None]; 10 - limit: int option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {viewer: string option [@default None]; limit: int option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 - type output = 15 - { 16 - starter_packs: string list [@key "starterPacks"]; 17 - } 18 - [@@deriving yojson {strict= false}] 11 + type output = {starter_packs: string list [@key "starterPacks"]} 12 + [@@deriving yojson {strict= false}] 19 13 20 - let call 21 - ?viewer 22 - ?limit 23 - (client : Hermes.client) : output Lwt.t = 14 + let call ?viewer ?limit (client : Hermes.client) : output Lwt.t = 24 15 let params : params = {viewer; limit} in 25 16 Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 17 end 27 -
+5 -15
pegasus/lexicons/app_bsky_unspecced_getSuggestedUsers.ml
··· 5 5 let nsid = "app.bsky.unspecced.getSuggestedUsers" 6 6 7 7 type params = 8 - { 9 - category: string option [@default None]; 10 - limit: int option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {category: string option [@default None]; limit: int option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 - type output = 15 - { 16 - actors: App_bsky_actor_defs.profile_view list; 17 - } 18 - [@@deriving yojson {strict= false}] 11 + type output = {actors: App_bsky_actor_defs.profile_view list} 12 + [@@deriving yojson {strict= false}] 19 13 20 - let call 21 - ?category 22 - ?limit 23 - (client : Hermes.client) : output Lwt.t = 14 + let call ?category ?limit (client : Hermes.client) : output Lwt.t = 24 15 let params : params = {category; limit} in 25 16 Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 17 end 27 -
+6 -17
pegasus/lexicons/app_bsky_unspecced_getSuggestedUsersSkeleton.ml
··· 5 5 let nsid = "app.bsky.unspecced.getSuggestedUsersSkeleton" 6 6 7 7 type params = 8 - { 9 - viewer: string option [@default None]; 10 - category: string option [@default None]; 11 - limit: int option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { viewer: string option [@default None] 9 + ; category: string option [@default None] 10 + ; limit: int option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 - type output = 16 - { 17 - dids: string list; 18 - } 19 - [@@deriving yojson {strict= false}] 13 + type output = {dids: string list} [@@deriving yojson {strict= false}] 20 14 21 - let call 22 - ?viewer 23 - ?category 24 - ?limit 25 - (client : Hermes.client) : output Lwt.t = 15 + let call ?viewer ?category ?limit (client : Hermes.client) : output Lwt.t = 26 16 let params : params = {viewer; category; limit} in 27 17 Hermes.query client nsid (params_to_yojson params) output_of_yojson 28 18 end 29 -
+12 -21
pegasus/lexicons/app_bsky_unspecced_getSuggestionsSkeleton.ml
··· 5 5 let nsid = "app.bsky.unspecced.getSuggestionsSkeleton" 6 6 7 7 type params = 8 - { 9 - viewer: string option [@default None]; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - relative_to_did: string option [@key "relativeToDid"] [@default None]; 13 - } 14 - [@@deriving yojson {strict= false}] 8 + { viewer: string option [@default None] 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] 11 + ; relative_to_did: string option [@key "relativeToDid"] [@default None] } 12 + [@@deriving yojson {strict= false}] 15 13 16 14 type output = 17 - { 18 - cursor: string option [@default None]; 19 - actors: App_bsky_unspecced_defs.skeleton_search_actor list; 20 - relative_to_did: string option [@key "relativeToDid"] [@default None]; 21 - rec_id: int option [@key "recId"] [@default None]; 22 - } 23 - [@@deriving yojson {strict= false}] 15 + { cursor: string option [@default None] 16 + ; actors: App_bsky_unspecced_defs.skeleton_search_actor list 17 + ; relative_to_did: string option [@key "relativeToDid"] [@default None] 18 + ; rec_id: int option [@key "recId"] [@default None] } 19 + [@@deriving yojson {strict= false}] 24 20 25 - let call 26 - ?viewer 27 - ?limit 28 - ?cursor 29 - ?relative_to_did 30 - (client : Hermes.client) : output Lwt.t = 21 + let call ?viewer ?limit ?cursor ?relative_to_did (client : Hermes.client) : 22 + output Lwt.t = 31 23 let params : params = {viewer; limit; cursor; relative_to_did} in 32 24 Hermes.query client nsid (params_to_yojson params) output_of_yojson 33 25 end 34 -
+5 -13
pegasus/lexicons/app_bsky_unspecced_getTaggedSuggestions.ml
··· 1 1 (* generated from app.bsky.unspecced.getTaggedSuggestions *) 2 2 3 3 type suggestion = 4 - { 5 - tag: string; 6 - subject_type: string [@key "subjectType"]; 7 - subject: string; 8 - } 4 + {tag: string; subject_type: string [@key "subjectType"]; subject: string} 9 5 [@@deriving yojson {strict= false}] 10 6 11 7 (** Get a list of suggestions (feeds and users) tagged with categories *) ··· 13 9 let nsid = "app.bsky.unspecced.getTaggedSuggestions" 14 10 15 11 type params = unit 12 + 16 13 let params_to_yojson () = `Assoc [] 17 14 18 - type output = 19 - { 20 - suggestions: suggestion list; 21 - } 22 - [@@deriving yojson {strict= false}] 15 + type output = {suggestions: suggestion list} 16 + [@@deriving yojson {strict= false}] 23 17 24 - let call 25 - (client : Hermes.client) : output Lwt.t = 18 + let call (client : Hermes.client) : output Lwt.t = 26 19 Hermes.query client nsid (`Assoc []) output_of_yojson 27 20 end 28 -
+6 -15
pegasus/lexicons/app_bsky_unspecced_getTrendingTopics.ml
··· 5 5 let nsid = "app.bsky.unspecced.getTrendingTopics" 6 6 7 7 type params = 8 - { 9 - viewer: string option [@default None]; 10 - limit: int option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {viewer: string option [@default None]; limit: int option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 11 type output = 15 - { 16 - topics: App_bsky_unspecced_defs.trending_topic list; 17 - suggested: App_bsky_unspecced_defs.trending_topic list; 18 - } 19 - [@@deriving yojson {strict= false}] 12 + { topics: App_bsky_unspecced_defs.trending_topic list 13 + ; suggested: App_bsky_unspecced_defs.trending_topic list } 14 + [@@deriving yojson {strict= false}] 20 15 21 - let call 22 - ?viewer 23 - ?limit 24 - (client : Hermes.client) : output Lwt.t = 16 + let call ?viewer ?limit (client : Hermes.client) : output Lwt.t = 25 17 let params : params = {viewer; limit} in 26 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 19 end 28 -
+5 -14
pegasus/lexicons/app_bsky_unspecced_getTrends.ml
··· 4 4 module Main = struct 5 5 let nsid = "app.bsky.unspecced.getTrends" 6 6 7 - type params = 8 - { 9 - limit: int option [@default None]; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {limit: int option [@default None]} 8 + [@@deriving yojson {strict= false}] 12 9 13 - type output = 14 - { 15 - trends: App_bsky_unspecced_defs.trend_view list; 16 - } 17 - [@@deriving yojson {strict= false}] 10 + type output = {trends: App_bsky_unspecced_defs.trend_view list} 11 + [@@deriving yojson {strict= false}] 18 12 19 - let call 20 - ?limit 21 - (client : Hermes.client) : output Lwt.t = 13 + let call ?limit (client : Hermes.client) : output Lwt.t = 22 14 let params : params = {limit} in 23 15 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 16 end 25 -
+5 -15
pegasus/lexicons/app_bsky_unspecced_getTrendsSkeleton.ml
··· 5 5 let nsid = "app.bsky.unspecced.getTrendsSkeleton" 6 6 7 7 type params = 8 - { 9 - viewer: string option [@default None]; 10 - limit: int option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {viewer: string option [@default None]; limit: int option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 - type output = 15 - { 16 - trends: App_bsky_unspecced_defs.skeleton_trend list; 17 - } 18 - [@@deriving yojson {strict= false}] 11 + type output = {trends: App_bsky_unspecced_defs.skeleton_trend list} 12 + [@@deriving yojson {strict= false}] 19 13 20 - let call 21 - ?viewer 22 - ?limit 23 - (client : Hermes.client) : output Lwt.t = 14 + let call ?viewer ?limit (client : Hermes.client) : output Lwt.t = 24 15 let params : params = {viewer; limit} in 25 16 Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 17 end 27 -
+7 -13
pegasus/lexicons/app_bsky_unspecced_initAgeAssurance.ml
··· 5 5 let nsid = "app.bsky.unspecced.initAgeAssurance" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - email: string; 13 - language: string; 14 - country_code: string [@key "countryCode"]; 15 - } 12 + {email: string; language: string; country_code: string [@key "countryCode"]} 16 13 [@@deriving yojson {strict= false}] 17 14 18 15 type output = App_bsky_unspecced_defs.age_assurance_state 19 - [@@deriving yojson {strict= false}] 16 + [@@deriving yojson {strict= false}] 20 17 21 - let call 22 - ~email 23 - ~language 24 - ~country_code 25 - (client : Hermes.client) : output Lwt.t = 18 + let call ~email ~language ~country_code (client : Hermes.client) : 19 + output Lwt.t = 26 20 let params = () in 27 21 let input = Some ({email; language; country_code} |> input_to_yojson) in 28 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 22 + Hermes.procedure client nsid (params_to_yojson params) input 23 + output_of_yojson 29 24 end 30 -
+12 -22
pegasus/lexicons/app_bsky_unspecced_searchActorsSkeleton.ml
··· 5 5 let nsid = "app.bsky.unspecced.searchActorsSkeleton" 6 6 7 7 type params = 8 - { 9 - q: string; 10 - viewer: string option [@default None]; 11 - typeahead: bool option [@default None]; 12 - limit: int option [@default None]; 13 - cursor: string option [@default None]; 14 - } 15 - [@@deriving yojson {strict= false}] 8 + { q: string 9 + ; viewer: string option [@default None] 10 + ; typeahead: bool option [@default None] 11 + ; limit: int option [@default None] 12 + ; cursor: string option [@default None] } 13 + [@@deriving yojson {strict= false}] 16 14 17 15 type output = 18 - { 19 - cursor: string option [@default None]; 20 - hits_total: int option [@key "hitsTotal"] [@default None]; 21 - actors: App_bsky_unspecced_defs.skeleton_search_actor list; 22 - } 23 - [@@deriving yojson {strict= false}] 16 + { cursor: string option [@default None] 17 + ; hits_total: int option [@key "hitsTotal"] [@default None] 18 + ; actors: App_bsky_unspecced_defs.skeleton_search_actor list } 19 + [@@deriving yojson {strict= false}] 24 20 25 - let call 26 - ~q 27 - ?viewer 28 - ?typeahead 29 - ?limit 30 - ?cursor 31 - (client : Hermes.client) : output Lwt.t = 21 + let call ~q ?viewer ?typeahead ?limit ?cursor (client : Hermes.client) : 22 + output Lwt.t = 32 23 let params : params = {q; viewer; typeahead; limit; cursor} in 33 24 Hermes.query client nsid (params_to_yojson params) output_of_yojson 34 25 end 35 -
+38 -39
pegasus/lexicons/app_bsky_unspecced_searchPostsSkeleton.ml
··· 5 5 let nsid = "app.bsky.unspecced.searchPostsSkeleton" 6 6 7 7 type params = 8 - { 9 - q: string; 10 - sort: string option [@default None]; 11 - since: string option [@default None]; 12 - until: string option [@default None]; 13 - mentions: string option [@default None]; 14 - author: string option [@default None]; 15 - lang: string option [@default None]; 16 - domain: string option [@default None]; 17 - url: string option [@default None]; 18 - tag: string list option [@default None] [@of_yojson Hermes_util.query_string_list_option_of_yojson] [@to_yojson Hermes_util.query_string_list_option_to_yojson]; 19 - viewer: string option [@default None]; 20 - limit: int option [@default None]; 21 - cursor: string option [@default None]; 22 - } 23 - [@@deriving yojson {strict= false}] 8 + { q: string 9 + ; sort: string option [@default None] 10 + ; since: string option [@default None] 11 + ; until: string option [@default None] 12 + ; mentions: string option [@default None] 13 + ; author: string option [@default None] 14 + ; lang: string option [@default None] 15 + ; domain: string option [@default None] 16 + ; url: string option [@default None] 17 + ; tag: string list option 18 + [@default None] 19 + [@of_yojson Hermes_util.query_string_list_option_of_yojson] 20 + [@to_yojson Hermes_util.query_string_list_option_to_yojson] 21 + ; viewer: string option [@default None] 22 + ; limit: int option [@default None] 23 + ; cursor: string option [@default None] } 24 + [@@deriving yojson {strict= false}] 24 25 25 26 type output = 26 - { 27 - cursor: string option [@default None]; 28 - hits_total: int option [@key "hitsTotal"] [@default None]; 29 - posts: App_bsky_unspecced_defs.skeleton_search_post list; 30 - } 31 - [@@deriving yojson {strict= false}] 27 + { cursor: string option [@default None] 28 + ; hits_total: int option [@key "hitsTotal"] [@default None] 29 + ; posts: App_bsky_unspecced_defs.skeleton_search_post list } 30 + [@@deriving yojson {strict= false}] 32 31 33 - let call 34 - ~q 35 - ?sort 36 - ?since 37 - ?until 38 - ?mentions 39 - ?author 40 - ?lang 41 - ?domain 42 - ?url 43 - ?tag 44 - ?viewer 45 - ?limit 46 - ?cursor 47 - (client : Hermes.client) : output Lwt.t = 48 - let params : params = {q; sort; since; until; mentions; author; lang; domain; url; tag; viewer; limit; cursor} in 32 + let call ~q ?sort ?since ?until ?mentions ?author ?lang ?domain ?url ?tag 33 + ?viewer ?limit ?cursor (client : Hermes.client) : output Lwt.t = 34 + let params : params = 35 + { q 36 + ; sort 37 + ; since 38 + ; until 39 + ; mentions 40 + ; author 41 + ; lang 42 + ; domain 43 + ; url 44 + ; tag 45 + ; viewer 46 + ; limit 47 + ; cursor } 48 + in 49 49 Hermes.query client nsid (params_to_yojson params) output_of_yojson 50 50 end 51 -
+11 -20
pegasus/lexicons/app_bsky_unspecced_searchStarterPacksSkeleton.ml
··· 5 5 let nsid = "app.bsky.unspecced.searchStarterPacksSkeleton" 6 6 7 7 type params = 8 - { 9 - q: string; 10 - viewer: string option [@default None]; 11 - limit: int option [@default None]; 12 - cursor: string option [@default None]; 13 - } 14 - [@@deriving yojson {strict= false}] 8 + { q: string 9 + ; viewer: string option [@default None] 10 + ; limit: int option [@default None] 11 + ; cursor: string option [@default None] } 12 + [@@deriving yojson {strict= false}] 15 13 16 14 type output = 17 - { 18 - cursor: string option [@default None]; 19 - hits_total: int option [@key "hitsTotal"] [@default None]; 20 - starter_packs: App_bsky_unspecced_defs.skeleton_search_starter_pack list [@key "starterPacks"]; 21 - } 22 - [@@deriving yojson {strict= false}] 15 + { cursor: string option [@default None] 16 + ; hits_total: int option [@key "hitsTotal"] [@default None] 17 + ; starter_packs: App_bsky_unspecced_defs.skeleton_search_starter_pack list 18 + [@key "starterPacks"] } 19 + [@@deriving yojson {strict= false}] 23 20 24 - let call 25 - ~q 26 - ?viewer 27 - ?limit 28 - ?cursor 29 - (client : Hermes.client) : output Lwt.t = 21 + let call ~q ?viewer ?limit ?cursor (client : Hermes.client) : output Lwt.t = 30 22 let params : params = {q; viewer; limit; cursor} in 31 23 Hermes.query client nsid (params_to_yojson params) output_of_yojson 32 24 end 33 -
+7 -10
pegasus/lexicons/app_bsky_video_defs.ml
··· 1 1 (* generated from app.bsky.video.defs *) 2 2 3 3 type job_status = 4 - { 5 - job_id: string [@key "jobId"]; 6 - did: string; 7 - state: string; 8 - progress: int option [@default None]; 9 - blob: Hermes.blob option [@default None]; 10 - error: string option [@default None]; 11 - message: string option [@default None]; 12 - } 4 + { job_id: string [@key "jobId"] 5 + ; did: string 6 + ; state: string 7 + ; progress: int option [@default None] 8 + ; blob: Hermes.blob option [@default None] 9 + ; error: string option [@default None] 10 + ; message: string option [@default None] } 13 11 [@@deriving yojson {strict= false}] 14 -
+5 -14
pegasus/lexicons/app_bsky_video_getJobStatus.ml
··· 4 4 module Main = struct 5 5 let nsid = "app.bsky.video.getJobStatus" 6 6 7 - type params = 8 - { 9 - job_id: string [@key "jobId"]; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {job_id: string [@key "jobId"]} 8 + [@@deriving yojson {strict= false}] 12 9 13 - type output = 14 - { 15 - job_status: App_bsky_video_defs.job_status [@key "jobStatus"]; 16 - } 17 - [@@deriving yojson {strict= false}] 10 + type output = {job_status: App_bsky_video_defs.job_status [@key "jobStatus"]} 11 + [@@deriving yojson {strict= false}] 18 12 19 - let call 20 - ~job_id 21 - (client : Hermes.client) : output Lwt.t = 13 + let call ~job_id (client : Hermes.client) : output Lwt.t = 22 14 let params : params = {job_id} in 23 15 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 16 end 25 -
+10 -11
pegasus/lexicons/app_bsky_video_getUploadLimits.ml
··· 5 5 let nsid = "app.bsky.video.getUploadLimits" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = 11 - { 12 - can_upload: bool [@key "canUpload"]; 13 - remaining_daily_videos: int option [@key "remainingDailyVideos"] [@default None]; 14 - remaining_daily_bytes: int option [@key "remainingDailyBytes"] [@default None]; 15 - message: string option [@default None]; 16 - error: string option [@default None]; 17 - } 18 - [@@deriving yojson {strict= false}] 12 + { can_upload: bool [@key "canUpload"] 13 + ; remaining_daily_videos: int option 14 + [@key "remainingDailyVideos"] [@default None] 15 + ; remaining_daily_bytes: int option 16 + [@key "remainingDailyBytes"] [@default None] 17 + ; message: string option [@default None] 18 + ; error: string option [@default None] } 19 + [@@deriving yojson {strict= false}] 19 20 20 - let call 21 - (client : Hermes.client) : output Lwt.t = 21 + let call (client : Hermes.client) : output Lwt.t = 22 22 Hermes.query client nsid (`Assoc []) output_of_yojson 23 23 end 24 -
+7 -10
pegasus/lexicons/app_bsky_video_uploadVideo.ml
··· 5 5 let nsid = "app.bsky.video.uploadVideo" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type output = 11 - { 12 - job_status: App_bsky_video_defs.job_status [@key "jobStatus"]; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type output = {job_status: App_bsky_video_defs.job_status [@key "jobStatus"]} 12 + [@@deriving yojson {strict= false}] 15 13 16 - let call 17 - ?input 18 - (client : Hermes.client) : output Lwt.t = 14 + let call ?input (client : Hermes.client) : output Lwt.t = 19 15 let params = () in 20 - Hermes.procedure_blob client nsid (params_to_yojson params) (Bytes.of_string (Option.value input ~default:"")) ~content_type:"video/mp4" output_of_yojson 16 + Hermes.procedure_blob client nsid (params_to_yojson params) 17 + (Bytes.of_string (Option.value input ~default:"")) 18 + ~content_type:"video/mp4" output_of_yojson 21 19 end 22 -
+21 -34
pegasus/lexicons/com_atproto_admin_defs.ml
··· 1 1 (* generated from com.atproto.admin.defs *) 2 2 3 3 type status_attr = 4 - { 5 - applied: bool; 6 - ref_: string option [@key "ref"] [@default None]; 7 - } 4 + {applied: bool; ref_: string option [@key "ref"] [@default None]} 8 5 [@@deriving yojson {strict= false}] 9 6 10 - type threat_signature = 11 - { 12 - property: string; 13 - value: string; 14 - } 7 + type threat_signature = {property: string; value: string} 15 8 [@@deriving yojson {strict= false}] 16 9 17 10 type account_view = 18 - { 19 - did: string; 20 - handle: string; 21 - email: string option [@default None]; 22 - related_records: Yojson.Safe.t list option [@key "relatedRecords"] [@default None]; 23 - indexed_at: string [@key "indexedAt"]; 24 - invited_by: Com_atproto_server_defs.invite_code option [@key "invitedBy"] [@default None]; 25 - invites: Com_atproto_server_defs.invite_code list option [@default None]; 26 - invites_disabled: bool option [@key "invitesDisabled"] [@default None]; 27 - email_confirmed_at: string option [@key "emailConfirmedAt"] [@default None]; 28 - invite_note: string option [@key "inviteNote"] [@default None]; 29 - deactivated_at: string option [@key "deactivatedAt"] [@default None]; 30 - threat_signatures: threat_signature list option [@key "threatSignatures"] [@default None]; 31 - } 11 + { did: string 12 + ; handle: string 13 + ; email: string option [@default None] 14 + ; related_records: Yojson.Safe.t list option 15 + [@key "relatedRecords"] [@default None] 16 + ; indexed_at: string [@key "indexedAt"] 17 + ; invited_by: Com_atproto_server_defs.invite_code option 18 + [@key "invitedBy"] [@default None] 19 + ; invites: Com_atproto_server_defs.invite_code list option [@default None] 20 + ; invites_disabled: bool option [@key "invitesDisabled"] [@default None] 21 + ; email_confirmed_at: string option [@key "emailConfirmedAt"] [@default None] 22 + ; invite_note: string option [@key "inviteNote"] [@default None] 23 + ; deactivated_at: string option [@key "deactivatedAt"] [@default None] 24 + ; threat_signatures: threat_signature list option 25 + [@key "threatSignatures"] [@default None] } 32 26 [@@deriving yojson {strict= false}] 33 27 34 - type repo_ref = 35 - { 36 - did: string; 37 - } 38 - [@@deriving yojson {strict= false}] 28 + type repo_ref = {did: string} [@@deriving yojson {strict= false}] 39 29 40 30 type repo_blob_ref = 41 - { 42 - did: string; 43 - cid: string; 44 - record_uri: string option [@key "recordUri"] [@default None]; 45 - } 31 + { did: string 32 + ; cid: string 33 + ; record_uri: string option [@key "recordUri"] [@default None] } 46 34 [@@deriving yojson {strict= false}] 47 -
+6 -10
pegasus/lexicons/com_atproto_admin_deleteAccount.ml
··· 5 5 let nsid = "com.atproto.admin.deleteAccount" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - did: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {did: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~did 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~did (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({did} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+6 -11
pegasus/lexicons/com_atproto_admin_disableAccountInvites.ml
··· 5 5 let nsid = "com.atproto.admin.disableAccountInvites" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - account: string; 13 - note: string option [@default None]; 14 - } 11 + type input = {account: string; note: string option [@default None]} 15 12 [@@deriving yojson {strict= false}] 16 13 17 14 type output = unit 15 + 18 16 let output_of_yojson _ = Ok () 19 17 20 - let call 21 - ~account 22 - ?note 23 - (client : Hermes.client) : output Lwt.t = 18 + let call ~account ?note (client : Hermes.client) : output Lwt.t = 24 19 let params = () in 25 20 let input = Some ({account; note} |> input_to_yojson) in 26 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 27 23 end 28 -
+7 -10
pegasus/lexicons/com_atproto_admin_disableInviteCodes.ml
··· 5 5 let nsid = "com.atproto.admin.disableInviteCodes" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - codes: string list option [@default None]; 13 - accounts: string list option [@default None]; 14 - } 12 + { codes: string list option [@default None] 13 + ; accounts: string list option [@default None] } 15 14 [@@deriving yojson {strict= false}] 16 15 17 16 type output = unit 17 + 18 18 let output_of_yojson _ = Ok () 19 19 20 - let call 21 - ?codes 22 - ?accounts 23 - (client : Hermes.client) : output Lwt.t = 20 + let call ?codes ?accounts (client : Hermes.client) : output Lwt.t = 24 21 let params = () in 25 22 let input = Some ({codes; accounts} |> input_to_yojson) in 26 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 23 + Hermes.procedure client nsid (params_to_yojson params) input 24 + output_of_yojson 27 25 end 28 -
+6 -11
pegasus/lexicons/com_atproto_admin_enableAccountInvites.ml
··· 5 5 let nsid = "com.atproto.admin.enableAccountInvites" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - account: string; 13 - note: string option [@default None]; 14 - } 11 + type input = {account: string; note: string option [@default None]} 15 12 [@@deriving yojson {strict= false}] 16 13 17 14 type output = unit 15 + 18 16 let output_of_yojson _ = Ok () 19 17 20 - let call 21 - ~account 22 - ?note 23 - (client : Hermes.client) : output Lwt.t = 18 + let call ~account ?note (client : Hermes.client) : output Lwt.t = 24 19 let params = () in 25 20 let input = Some ({account; note} |> input_to_yojson) in 26 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 27 23 end 28 -
+3 -10
pegasus/lexicons/com_atproto_admin_getAccountInfo.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.admin.getAccountInfo" 6 6 7 - type params = 8 - { 9 - did: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {did: string} [@@deriving yojson {strict= false}] 12 8 13 9 type output = Com_atproto_admin_defs.account_view 14 - [@@deriving yojson {strict= false}] 10 + [@@deriving yojson {strict= false}] 15 11 16 - let call 17 - ~did 18 - (client : Hermes.client) : output Lwt.t = 12 + let call ~did (client : Hermes.client) : output Lwt.t = 19 13 let params : params = {did} in 20 14 Hermes.query client nsid (params_to_yojson params) output_of_yojson 21 15 end 22 -
+7 -13
pegasus/lexicons/com_atproto_admin_getAccountInfos.ml
··· 5 5 let nsid = "com.atproto.admin.getAccountInfos" 6 6 7 7 type params = 8 - { 9 - dids: string list [@of_yojson Hermes_util.query_string_list_of_yojson] [@to_yojson Hermes_util.query_string_list_to_yojson]; 10 - } 11 - [@@deriving yojson {strict= false}] 8 + { dids: string list 9 + [@of_yojson Hermes_util.query_string_list_of_yojson] 10 + [@to_yojson Hermes_util.query_string_list_to_yojson] } 11 + [@@deriving yojson {strict= false}] 12 12 13 - type output = 14 - { 15 - infos: Com_atproto_admin_defs.account_view list; 16 - } 17 - [@@deriving yojson {strict= false}] 13 + type output = {infos: Com_atproto_admin_defs.account_view list} 14 + [@@deriving yojson {strict= false}] 18 15 19 - let call 20 - ~dids 21 - (client : Hermes.client) : output Lwt.t = 16 + let call ~dids (client : Hermes.client) : output Lwt.t = 22 17 let params : params = {dids} in 23 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 19 end 25 -
+8 -17
pegasus/lexicons/com_atproto_admin_getInviteCodes.ml
··· 5 5 let nsid = "com.atproto.admin.getInviteCodes" 6 6 7 7 type params = 8 - { 9 - sort: string option [@default None]; 10 - limit: int option [@default None]; 11 - cursor: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { sort: string option [@default None] 9 + ; limit: int option [@default None] 10 + ; cursor: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - codes: Com_atproto_server_defs.invite_code list; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; codes: Com_atproto_server_defs.invite_code list } 16 + [@@deriving yojson {strict= false}] 21 17 22 - let call 23 - ?sort 24 - ?limit 25 - ?cursor 26 - (client : Hermes.client) : output Lwt.t = 18 + let call ?sort ?limit ?cursor (client : Hermes.client) : output Lwt.t = 27 19 let params : params = {sort; limit; cursor} in 28 20 Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 21 end 30 -
+61 -55
pegasus/lexicons/com_atproto_admin_getSubjectStatus.ml
··· 5 5 let nsid = "com.atproto.admin.getSubjectStatus" 6 6 7 7 type params = 8 - { 9 - did: string option [@default None]; 10 - uri: string option [@default None]; 11 - blob: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { did: string option [@default None] 9 + ; uri: string option [@default None] 10 + ; blob: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type subject = 16 - | RepoRef of Com_atproto_admin_defs.repo_ref 17 - | StrongRef of Com_atproto_repo_strongRef.main 18 - | RepoBlobRef of Com_atproto_admin_defs.repo_blob_ref 19 - | Unknown of Yojson.Safe.t 14 + | RepoRef of Com_atproto_admin_defs.repo_ref 15 + | StrongRef of Com_atproto_repo_strongRef.main 16 + | RepoBlobRef of Com_atproto_admin_defs.repo_blob_ref 17 + | Unknown of Yojson.Safe.t 20 18 21 - let subject_of_yojson json = 22 - let open Yojson.Safe.Util in 23 - try 24 - match json |> member "$type" |> to_string with 25 - | "com.atproto.admin.defs#repoRef" -> 26 - (match Com_atproto_admin_defs.repo_ref_of_yojson json with 27 - | Ok v -> Ok (RepoRef v) 28 - | Error e -> Error e) 29 - | "com.atproto.repo.strongRef" -> 30 - (match Com_atproto_repo_strongRef.main_of_yojson json with 31 - | Ok v -> Ok (StrongRef v) 32 - | Error e -> Error e) 33 - | "com.atproto.admin.defs#repoBlobRef" -> 34 - (match Com_atproto_admin_defs.repo_blob_ref_of_yojson json with 35 - | Ok v -> Ok (RepoBlobRef v) 36 - | Error e -> Error e) 37 - | _ -> Ok (Unknown json) 38 - with _ -> Error "failed to parse union" 19 + let subject_of_yojson json = 20 + let open Yojson.Safe.Util in 21 + try 22 + match json |> member "$type" |> to_string with 23 + | "com.atproto.admin.defs#repoRef" -> ( 24 + match Com_atproto_admin_defs.repo_ref_of_yojson json with 25 + | Ok v -> 26 + Ok (RepoRef v) 27 + | Error e -> 28 + Error e ) 29 + | "com.atproto.repo.strongRef" -> ( 30 + match Com_atproto_repo_strongRef.main_of_yojson json with 31 + | Ok v -> 32 + Ok (StrongRef v) 33 + | Error e -> 34 + Error e ) 35 + | "com.atproto.admin.defs#repoBlobRef" -> ( 36 + match Com_atproto_admin_defs.repo_blob_ref_of_yojson json with 37 + | Ok v -> 38 + Ok (RepoBlobRef v) 39 + | Error e -> 40 + Error e ) 41 + | _ -> 42 + Ok (Unknown json) 43 + with _ -> Error "failed to parse union" 39 44 40 - let subject_to_yojson = function 41 - | RepoRef v -> 42 - (match Com_atproto_admin_defs.repo_ref_to_yojson v with 43 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.admin.defs#repoRef") :: fields) 44 - | other -> other) 45 - | StrongRef v -> 46 - (match Com_atproto_repo_strongRef.main_to_yojson v with 47 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.repo.strongRef") :: fields) 48 - | other -> other) 49 - | RepoBlobRef v -> 50 - (match Com_atproto_admin_defs.repo_blob_ref_to_yojson v with 51 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.admin.defs#repoBlobRef") :: fields) 52 - | other -> other) 53 - | Unknown j -> j 45 + let subject_to_yojson = function 46 + | RepoRef v -> ( 47 + match Com_atproto_admin_defs.repo_ref_to_yojson v with 48 + | `Assoc fields -> 49 + `Assoc (("$type", `String "com.atproto.admin.defs#repoRef") :: fields) 50 + | other -> 51 + other ) 52 + | StrongRef v -> ( 53 + match Com_atproto_repo_strongRef.main_to_yojson v with 54 + | `Assoc fields -> 55 + `Assoc (("$type", `String "com.atproto.repo.strongRef") :: fields) 56 + | other -> 57 + other ) 58 + | RepoBlobRef v -> ( 59 + match Com_atproto_admin_defs.repo_blob_ref_to_yojson v with 60 + | `Assoc fields -> 61 + `Assoc 62 + (("$type", `String "com.atproto.admin.defs#repoBlobRef") :: fields) 63 + | other -> 64 + other ) 65 + | Unknown j -> 66 + j 54 67 55 - type output = 56 - { 57 - subject: subject; 58 - takedown: Com_atproto_admin_defs.status_attr option [@default None]; 59 - deactivated: Com_atproto_admin_defs.status_attr option [@default None]; 60 - } 61 - [@@deriving yojson {strict= false}] 68 + type output = 69 + { subject: subject 70 + ; takedown: Com_atproto_admin_defs.status_attr option [@default None] 71 + ; deactivated: Com_atproto_admin_defs.status_attr option [@default None] } 72 + [@@deriving yojson {strict= false}] 62 73 63 - let call 64 - ?did 65 - ?uri 66 - ?blob 67 - (client : Hermes.client) : output Lwt.t = 74 + let call ?did ?uri ?blob (client : Hermes.client) : output Lwt.t = 68 75 let params : params = {did; uri; blob} in 69 76 Hermes.query client nsid (params_to_yojson params) output_of_yojson 70 77 end 71 -
+8 -17
pegasus/lexicons/com_atproto_admin_searchAccounts.ml
··· 5 5 let nsid = "com.atproto.admin.searchAccounts" 6 6 7 7 type params = 8 - { 9 - email: string option [@default None]; 10 - cursor: string option [@default None]; 11 - limit: int option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { email: string option [@default None] 9 + ; cursor: string option [@default None] 10 + ; limit: int option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 13 type output = 16 - { 17 - cursor: string option [@default None]; 18 - accounts: Com_atproto_admin_defs.account_view list; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + { cursor: string option [@default None] 15 + ; accounts: Com_atproto_admin_defs.account_view list } 16 + [@@deriving yojson {strict= false}] 21 17 22 - let call 23 - ?email 24 - ?cursor 25 - ?limit 26 - (client : Hermes.client) : output Lwt.t = 18 + let call ?email ?cursor ?limit (client : Hermes.client) : output Lwt.t = 27 19 let params : params = {email; cursor; limit} in 28 20 Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 21 end 30 -
+15 -21
pegasus/lexicons/com_atproto_admin_sendEmail.ml
··· 5 5 let nsid = "com.atproto.admin.sendEmail" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - recipient_did: string [@key "recipientDid"]; 13 - content: string; 14 - subject: string option [@default None]; 15 - sender_did: string [@key "senderDid"]; 16 - comment: string option [@default None]; 17 - } 12 + { recipient_did: string [@key "recipientDid"] 13 + ; content: string 14 + ; subject: string option [@default None] 15 + ; sender_did: string [@key "senderDid"] 16 + ; comment: string option [@default None] } 18 17 [@@deriving yojson {strict= false}] 19 18 20 - type output = 21 - { 22 - sent: bool; 23 - } 24 - [@@deriving yojson {strict= false}] 19 + type output = {sent: bool} [@@deriving yojson {strict= false}] 25 20 26 - let call 27 - ~recipient_did 28 - ~content 29 - ?subject 30 - ~sender_did 31 - ?comment 21 + let call ~recipient_did ~content ?subject ~sender_did ?comment 32 22 (client : Hermes.client) : output Lwt.t = 33 23 let params = () in 34 - let input = Some ({recipient_did; content; subject; sender_did; comment} |> input_to_yojson) in 35 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 24 + let input = 25 + Some 26 + ( {recipient_did; content; subject; sender_did; comment} 27 + |> input_to_yojson ) 28 + in 29 + Hermes.procedure client nsid (params_to_yojson params) input 30 + output_of_yojson 36 31 end 37 -
+6 -11
pegasus/lexicons/com_atproto_admin_updateAccountEmail.ml
··· 5 5 let nsid = "com.atproto.admin.updateAccountEmail" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - account: string; 13 - email: string; 14 - } 11 + type input = {account: string; email: string} 15 12 [@@deriving yojson {strict= false}] 16 13 17 14 type output = unit 15 + 18 16 let output_of_yojson _ = Ok () 19 17 20 - let call 21 - ~account 22 - ~email 23 - (client : Hermes.client) : output Lwt.t = 18 + let call ~account ~email (client : Hermes.client) : output Lwt.t = 24 19 let params = () in 25 20 let input = Some ({account; email} |> input_to_yojson) in 26 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 27 23 end 28 -
+6 -12
pegasus/lexicons/com_atproto_admin_updateAccountHandle.ml
··· 5 5 let nsid = "com.atproto.admin.updateAccountHandle" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - did: string; 13 - handle: string; 14 - } 15 - [@@deriving yojson {strict= false}] 11 + type input = {did: string; handle: string} [@@deriving yojson {strict= false}] 16 12 17 13 type output = unit 14 + 18 15 let output_of_yojson _ = Ok () 19 16 20 - let call 21 - ~did 22 - ~handle 23 - (client : Hermes.client) : output Lwt.t = 17 + let call ~did ~handle (client : Hermes.client) : output Lwt.t = 24 18 let params = () in 25 19 let input = Some ({did; handle} |> input_to_yojson) in 26 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 27 22 end 28 -
+6 -11
pegasus/lexicons/com_atproto_admin_updateAccountPassword.ml
··· 5 5 let nsid = "com.atproto.admin.updateAccountPassword" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - did: string; 13 - password: string; 14 - } 11 + type input = {did: string; password: string} 15 12 [@@deriving yojson {strict= false}] 16 13 17 14 type output = unit 15 + 18 16 let output_of_yojson _ = Ok () 19 17 20 - let call 21 - ~did 22 - ~password 23 - (client : Hermes.client) : output Lwt.t = 18 + let call ~did ~password (client : Hermes.client) : output Lwt.t = 24 19 let params = () in 25 20 let input = Some ({did; password} |> input_to_yojson) in 26 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 27 23 end 28 -
+6 -11
pegasus/lexicons/com_atproto_admin_updateAccountSigningKey.ml
··· 5 5 let nsid = "com.atproto.admin.updateAccountSigningKey" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - did: string; 13 - signing_key: string [@key "signingKey"]; 14 - } 11 + type input = {did: string; signing_key: string [@key "signingKey"]} 15 12 [@@deriving yojson {strict= false}] 16 13 17 14 type output = unit 15 + 18 16 let output_of_yojson _ = Ok () 19 17 20 - let call 21 - ~did 22 - ~signing_key 23 - (client : Hermes.client) : output Lwt.t = 18 + let call ~did ~signing_key (client : Hermes.client) : output Lwt.t = 24 19 let params = () in 25 20 let input = Some ({did; signing_key} |> input_to_yojson) in 26 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 27 23 end 28 -
+63 -54
pegasus/lexicons/com_atproto_admin_updateSubjectStatus.ml
··· 5 5 let nsid = "com.atproto.admin.updateSubjectStatus" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type subject = 11 - | RepoRef of Com_atproto_admin_defs.repo_ref 12 - | StrongRef of Com_atproto_repo_strongRef.main 13 - | RepoBlobRef of Com_atproto_admin_defs.repo_blob_ref 14 - | Unknown of Yojson.Safe.t 12 + | RepoRef of Com_atproto_admin_defs.repo_ref 13 + | StrongRef of Com_atproto_repo_strongRef.main 14 + | RepoBlobRef of Com_atproto_admin_defs.repo_blob_ref 15 + | Unknown of Yojson.Safe.t 15 16 16 - let subject_of_yojson json = 17 - let open Yojson.Safe.Util in 18 - try 19 - match json |> member "$type" |> to_string with 20 - | "com.atproto.admin.defs#repoRef" -> 21 - (match Com_atproto_admin_defs.repo_ref_of_yojson json with 22 - | Ok v -> Ok (RepoRef v) 23 - | Error e -> Error e) 24 - | "com.atproto.repo.strongRef" -> 25 - (match Com_atproto_repo_strongRef.main_of_yojson json with 26 - | Ok v -> Ok (StrongRef v) 27 - | Error e -> Error e) 28 - | "com.atproto.admin.defs#repoBlobRef" -> 29 - (match Com_atproto_admin_defs.repo_blob_ref_of_yojson json with 30 - | Ok v -> Ok (RepoBlobRef v) 31 - | Error e -> Error e) 32 - | _ -> Ok (Unknown json) 33 - with _ -> Error "failed to parse union" 17 + let subject_of_yojson json = 18 + let open Yojson.Safe.Util in 19 + try 20 + match json |> member "$type" |> to_string with 21 + | "com.atproto.admin.defs#repoRef" -> ( 22 + match Com_atproto_admin_defs.repo_ref_of_yojson json with 23 + | Ok v -> 24 + Ok (RepoRef v) 25 + | Error e -> 26 + Error e ) 27 + | "com.atproto.repo.strongRef" -> ( 28 + match Com_atproto_repo_strongRef.main_of_yojson json with 29 + | Ok v -> 30 + Ok (StrongRef v) 31 + | Error e -> 32 + Error e ) 33 + | "com.atproto.admin.defs#repoBlobRef" -> ( 34 + match Com_atproto_admin_defs.repo_blob_ref_of_yojson json with 35 + | Ok v -> 36 + Ok (RepoBlobRef v) 37 + | Error e -> 38 + Error e ) 39 + | _ -> 40 + Ok (Unknown json) 41 + with _ -> Error "failed to parse union" 34 42 35 - let subject_to_yojson = function 36 - | RepoRef v -> 37 - (match Com_atproto_admin_defs.repo_ref_to_yojson v with 38 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.admin.defs#repoRef") :: fields) 39 - | other -> other) 40 - | StrongRef v -> 41 - (match Com_atproto_repo_strongRef.main_to_yojson v with 42 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.repo.strongRef") :: fields) 43 - | other -> other) 44 - | RepoBlobRef v -> 45 - (match Com_atproto_admin_defs.repo_blob_ref_to_yojson v with 46 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.admin.defs#repoBlobRef") :: fields) 47 - | other -> other) 48 - | Unknown j -> j 43 + let subject_to_yojson = function 44 + | RepoRef v -> ( 45 + match Com_atproto_admin_defs.repo_ref_to_yojson v with 46 + | `Assoc fields -> 47 + `Assoc (("$type", `String "com.atproto.admin.defs#repoRef") :: fields) 48 + | other -> 49 + other ) 50 + | StrongRef v -> ( 51 + match Com_atproto_repo_strongRef.main_to_yojson v with 52 + | `Assoc fields -> 53 + `Assoc (("$type", `String "com.atproto.repo.strongRef") :: fields) 54 + | other -> 55 + other ) 56 + | RepoBlobRef v -> ( 57 + match Com_atproto_admin_defs.repo_blob_ref_to_yojson v with 58 + | `Assoc fields -> 59 + `Assoc 60 + (("$type", `String "com.atproto.admin.defs#repoBlobRef") :: fields) 61 + | other -> 62 + other ) 63 + | Unknown j -> 64 + j 49 65 50 - type input = 51 - { 52 - subject: subject; 53 - takedown: Com_atproto_admin_defs.status_attr option [@default None]; 54 - deactivated: Com_atproto_admin_defs.status_attr option [@default None]; 55 - } 66 + type input = 67 + { subject: subject 68 + ; takedown: Com_atproto_admin_defs.status_attr option [@default None] 69 + ; deactivated: Com_atproto_admin_defs.status_attr option [@default None] } 56 70 [@@deriving yojson {strict= false}] 57 71 58 72 type output = 59 - { 60 - subject: subject; 61 - takedown: Com_atproto_admin_defs.status_attr option [@default None]; 62 - } 63 - [@@deriving yojson {strict= false}] 73 + { subject: subject 74 + ; takedown: Com_atproto_admin_defs.status_attr option [@default None] } 75 + [@@deriving yojson {strict= false}] 64 76 65 - let call 66 - ~subject 67 - ?takedown 68 - ?deactivated 69 - (client : Hermes.client) : output Lwt.t = 77 + let call ~subject ?takedown ?deactivated (client : Hermes.client) : 78 + output Lwt.t = 70 79 let params = () in 71 80 let input = Some ({subject; takedown; deactivated} |> input_to_yojson) in 72 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 81 + Hermes.procedure client nsid (params_to_yojson params) input 82 + output_of_yojson 73 83 end 74 -
+1 -6
pegasus/lexicons/com_atproto_identity_defs.ml
··· 1 1 (* generated from com.atproto.identity.defs *) 2 2 3 3 type identity_info = 4 - { 5 - did: string; 6 - handle: string; 7 - did_doc: Yojson.Safe.t [@key "didDoc"]; 8 - } 4 + {did: string; handle: string; did_doc: Yojson.Safe.t [@key "didDoc"]} 9 5 [@@deriving yojson {strict= false}] 10 -
+8 -10
pegasus/lexicons/com_atproto_identity_getRecommendedDidCredentials.ml
··· 5 5 let nsid = "com.atproto.identity.getRecommendedDidCredentials" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = 11 - { 12 - rotation_keys: string list option [@key "rotationKeys"] [@default None]; 13 - also_known_as: string list option [@key "alsoKnownAs"] [@default None]; 14 - verification_methods: Yojson.Safe.t option [@key "verificationMethods"] [@default None]; 15 - services: Yojson.Safe.t option [@default None]; 16 - } 17 - [@@deriving yojson {strict= false}] 12 + { rotation_keys: string list option [@key "rotationKeys"] [@default None] 13 + ; also_known_as: string list option [@key "alsoKnownAs"] [@default None] 14 + ; verification_methods: Yojson.Safe.t option 15 + [@key "verificationMethods"] [@default None] 16 + ; services: Yojson.Safe.t option [@default None] } 17 + [@@deriving yojson {strict= false}] 18 18 19 - let call 20 - (client : Hermes.client) : output Lwt.t = 19 + let call (client : Hermes.client) : output Lwt.t = 21 20 Hermes.query client nsid (`Assoc []) output_of_yojson 22 21 end 23 -
+6 -11
pegasus/lexicons/com_atproto_identity_refreshIdentity.ml
··· 5 5 let nsid = "com.atproto.identity.refreshIdentity" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - identifier: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {identifier: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = Com_atproto_identity_defs.identity_info 17 - [@@deriving yojson {strict= false}] 14 + [@@deriving yojson {strict= false}] 18 15 19 - let call 20 - ~identifier 21 - (client : Hermes.client) : output Lwt.t = 16 + let call ~identifier (client : Hermes.client) : output Lwt.t = 22 17 let params = () in 23 18 let input = Some ({identifier} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 19 + Hermes.procedure client nsid (params_to_yojson params) input 20 + output_of_yojson 25 21 end 26 -
+5 -4
pegasus/lexicons/com_atproto_identity_requestPlcOperationSignature.ml
··· 5 5 let nsid = "com.atproto.identity.requestPlcOperationSignature" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = unit 12 + 11 13 let output_of_yojson _ = Ok () 12 14 13 - let call 14 - (client : Hermes.client) : output Lwt.t = 15 + let call (client : Hermes.client) : output Lwt.t = 15 16 let params = () in 16 17 let input = None in 17 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 18 + Hermes.procedure client nsid (params_to_yojson params) input 19 + output_of_yojson 18 20 end 19 -
+4 -14
pegasus/lexicons/com_atproto_identity_resolveDid.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.identity.resolveDid" 6 6 7 - type params = 8 - { 9 - did: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {did: string} [@@deriving yojson {strict= false}] 12 8 13 - type output = 14 - { 15 - did_doc: Yojson.Safe.t [@key "didDoc"]; 16 - } 17 - [@@deriving yojson {strict= false}] 9 + type output = {did_doc: Yojson.Safe.t [@key "didDoc"]} 10 + [@@deriving yojson {strict= false}] 18 11 19 - let call 20 - ~did 21 - (client : Hermes.client) : output Lwt.t = 12 + let call ~did (client : Hermes.client) : output Lwt.t = 22 13 let params : params = {did} in 23 14 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 15 end 25 -
+3 -14
pegasus/lexicons/com_atproto_identity_resolveHandle.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.identity.resolveHandle" 6 6 7 - type params = 8 - { 9 - handle: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {handle: string} [@@deriving yojson {strict= false}] 12 8 13 - type output = 14 - { 15 - did: string; 16 - } 17 - [@@deriving yojson {strict= false}] 9 + type output = {did: string} [@@deriving yojson {strict= false}] 18 10 19 - let call 20 - ~handle 21 - (client : Hermes.client) : output Lwt.t = 11 + let call ~handle (client : Hermes.client) : output Lwt.t = 22 12 let params : params = {handle} in 23 13 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 14 end 25 -
+3 -10
pegasus/lexicons/com_atproto_identity_resolveIdentity.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.identity.resolveIdentity" 6 6 7 - type params = 8 - { 9 - identifier: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {identifier: string} [@@deriving yojson {strict= false}] 12 8 13 9 type output = Com_atproto_identity_defs.identity_info 14 - [@@deriving yojson {strict= false}] 10 + [@@deriving yojson {strict= false}] 15 11 16 - let call 17 - ~identifier 18 - (client : Hermes.client) : output Lwt.t = 12 + let call ~identifier (client : Hermes.client) : output Lwt.t = 19 13 let params : params = {identifier} in 20 14 Hermes.query client nsid (params_to_yojson params) output_of_yojson 21 15 end 22 -
+16 -21
pegasus/lexicons/com_atproto_identity_signPlcOperation.ml
··· 5 5 let nsid = "com.atproto.identity.signPlcOperation" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - token: string option [@default None]; 13 - rotation_keys: string list option [@key "rotationKeys"] [@default None]; 14 - also_known_as: string list option [@key "alsoKnownAs"] [@default None]; 15 - verification_methods: Yojson.Safe.t option [@key "verificationMethods"] [@default None]; 16 - services: Yojson.Safe.t option [@default None]; 17 - } 12 + { token: string option [@default None] 13 + ; rotation_keys: string list option [@key "rotationKeys"] [@default None] 14 + ; also_known_as: string list option [@key "alsoKnownAs"] [@default None] 15 + ; verification_methods: Yojson.Safe.t option 16 + [@key "verificationMethods"] [@default None] 17 + ; services: Yojson.Safe.t option [@default None] } 18 18 [@@deriving yojson {strict= false}] 19 19 20 - type output = 21 - { 22 - operation: Yojson.Safe.t; 23 - } 24 - [@@deriving yojson {strict= false}] 20 + type output = {operation: Yojson.Safe.t} [@@deriving yojson {strict= false}] 25 21 26 - let call 27 - ?token 28 - ?rotation_keys 29 - ?also_known_as 30 - ?verification_methods 31 - ?services 22 + let call ?token ?rotation_keys ?also_known_as ?verification_methods ?services 32 23 (client : Hermes.client) : output Lwt.t = 33 24 let params = () in 34 - let input = Some ({token; rotation_keys; also_known_as; verification_methods; services} |> input_to_yojson) in 35 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + let input = 26 + Some 27 + ( {token; rotation_keys; also_known_as; verification_methods; services} 28 + |> input_to_yojson ) 29 + in 30 + Hermes.procedure client nsid (params_to_yojson params) input 31 + output_of_yojson 36 32 end 37 -
+6 -10
pegasus/lexicons/com_atproto_identity_submitPlcOperation.ml
··· 5 5 let nsid = "com.atproto.identity.submitPlcOperation" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - operation: Yojson.Safe.t; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {operation: Yojson.Safe.t} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~operation 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~operation (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({operation} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+6 -10
pegasus/lexicons/com_atproto_identity_updateHandle.ml
··· 5 5 let nsid = "com.atproto.identity.updateHandle" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - handle: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {handle: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~handle 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~handle (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({handle} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+24 -36
pegasus/lexicons/com_atproto_label_defs.ml
··· 1 1 (* generated from com.atproto.label.defs *) 2 2 3 3 type label = 4 - { 5 - ver: int option [@default None]; 6 - src: string; 7 - uri: string; 8 - cid: string option [@default None]; 9 - val_: string [@key "val"]; 10 - neg: bool option [@default None]; 11 - cts: string; 12 - exp: string option [@default None]; 13 - sig_: bytes option [@key "sig"] [@default None]; 14 - } 4 + { ver: int option [@default None] 5 + ; src: string 6 + ; uri: string 7 + ; cid: string option [@default None] 8 + ; val_: string [@key "val"] 9 + ; neg: bool option [@default None] 10 + ; cts: string 11 + ; exp: string option [@default None] 12 + ; sig_: bytes option [@key "sig"] [@default None] } 15 13 [@@deriving yojson {strict= false}] 16 14 17 - type self_label = 18 - { 19 - val_: string [@key "val"]; 20 - } 15 + type self_label = {val_: string [@key "val"]} 21 16 [@@deriving yojson {strict= false}] 22 17 23 - type self_labels = 24 - { 25 - values: self_label list; 26 - } 27 - [@@deriving yojson {strict= false}] 18 + type self_labels = {values: self_label list} [@@deriving yojson {strict= false}] 28 19 29 20 type label_value_definition_strings = 30 - { 31 - lang: string; 32 - name: string; 33 - description: string; 34 - } 21 + {lang: string; name: string; description: string} 35 22 [@@deriving yojson {strict= false}] 36 23 37 24 type label_value_definition = 38 - { 39 - identifier: string; 40 - severity: string; 41 - blurs: string; 42 - default_setting: string option [@key "defaultSetting"] [@default None]; 43 - adult_only: bool option [@key "adultOnly"] [@default None]; 44 - locales: label_value_definition_strings list; 45 - } 25 + { identifier: string 26 + ; severity: string 27 + ; blurs: string 28 + ; default_setting: string option [@key "defaultSetting"] [@default None] 29 + ; adult_only: bool option [@key "adultOnly"] [@default None] 30 + ; locales: label_value_definition_strings list } 46 31 [@@deriving yojson {strict= false}] 47 32 48 33 (** string type with known values *) 49 34 type label_value = string 35 + 50 36 let label_value_of_yojson = function 51 - | `String s -> Ok s 52 - | _ -> Error "label_value: expected string" 37 + | `String s -> 38 + Ok s 39 + | _ -> 40 + Error "label_value: expected string" 41 + 53 42 let label_value_to_yojson s = `String s 54 -
+16 -19
pegasus/lexicons/com_atproto_label_queryLabels.ml
··· 5 5 let nsid = "com.atproto.label.queryLabels" 6 6 7 7 type params = 8 - { 9 - uri_patterns: string list [@key "uriPatterns"] [@of_yojson Hermes_util.query_string_list_of_yojson] [@to_yojson Hermes_util.query_string_list_to_yojson]; 10 - sources: string list option [@default None] [@of_yojson Hermes_util.query_string_list_option_of_yojson] [@to_yojson Hermes_util.query_string_list_option_to_yojson]; 11 - limit: int option [@default None]; 12 - cursor: string option [@default None]; 13 - } 14 - [@@deriving yojson {strict= false}] 8 + { uri_patterns: string list 9 + [@key "uriPatterns"] 10 + [@of_yojson Hermes_util.query_string_list_of_yojson] 11 + [@to_yojson Hermes_util.query_string_list_to_yojson] 12 + ; sources: string list option 13 + [@default None] 14 + [@of_yojson Hermes_util.query_string_list_option_of_yojson] 15 + [@to_yojson Hermes_util.query_string_list_option_to_yojson] 16 + ; limit: int option [@default None] 17 + ; cursor: string option [@default None] } 18 + [@@deriving yojson {strict= false}] 15 19 16 20 type output = 17 - { 18 - cursor: string option [@default None]; 19 - labels: Com_atproto_label_defs.label list; 20 - } 21 - [@@deriving yojson {strict= false}] 21 + { cursor: string option [@default None] 22 + ; labels: Com_atproto_label_defs.label list } 23 + [@@deriving yojson {strict= false}] 22 24 23 - let call 24 - ~uri_patterns 25 - ?sources 26 - ?limit 27 - ?cursor 28 - (client : Hermes.client) : output Lwt.t = 25 + let call ~uri_patterns ?sources ?limit ?cursor (client : Hermes.client) : 26 + output Lwt.t = 29 27 let params : params = {uri_patterns; sources; limit; cursor} in 30 28 Hermes.query client nsid (params_to_yojson params) output_of_yojson 31 29 end 32 -
+1 -6
pegasus/lexicons/com_atproto_lexicon_schema.ml
··· 1 1 (* generated from com.atproto.lexicon.schema *) 2 2 3 - type main = 4 - { 5 - lexicon: int; 6 - } 7 - [@@deriving yojson {strict= false}] 8 - 3 + type main = {lexicon: int} [@@deriving yojson {strict= false}]
+58 -57
pegasus/lexicons/com_atproto_moderation_createReport.ml
··· 1 1 (* generated from com.atproto.moderation.createReport *) 2 2 3 - type mod_tool = 4 - { 5 - name: string; 6 - meta: Yojson.Safe.t option [@default None]; 7 - } 3 + type mod_tool = {name: string; meta: Yojson.Safe.t option [@default None]} 8 4 [@@deriving yojson {strict= false}] 9 5 10 6 (** Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth. *) ··· 12 8 let nsid = "com.atproto.moderation.createReport" 13 9 14 10 type params = unit 11 + 15 12 let params_to_yojson () = `Assoc [] 16 13 17 14 type subject = 18 - | RepoRef of Com_atproto_admin_defs.repo_ref 19 - | StrongRef of Com_atproto_repo_strongRef.main 20 - | Unknown of Yojson.Safe.t 15 + | RepoRef of Com_atproto_admin_defs.repo_ref 16 + | StrongRef of Com_atproto_repo_strongRef.main 17 + | Unknown of Yojson.Safe.t 21 18 22 - let subject_of_yojson json = 23 - let open Yojson.Safe.Util in 24 - try 25 - match json |> member "$type" |> to_string with 26 - | "com.atproto.admin.defs#repoRef" -> 27 - (match Com_atproto_admin_defs.repo_ref_of_yojson json with 28 - | Ok v -> Ok (RepoRef v) 29 - | Error e -> Error e) 30 - | "com.atproto.repo.strongRef" -> 31 - (match Com_atproto_repo_strongRef.main_of_yojson json with 32 - | Ok v -> Ok (StrongRef v) 33 - | Error e -> Error e) 34 - | _ -> Ok (Unknown json) 35 - with _ -> Error "failed to parse union" 19 + let subject_of_yojson json = 20 + let open Yojson.Safe.Util in 21 + try 22 + match json |> member "$type" |> to_string with 23 + | "com.atproto.admin.defs#repoRef" -> ( 24 + match Com_atproto_admin_defs.repo_ref_of_yojson json with 25 + | Ok v -> 26 + Ok (RepoRef v) 27 + | Error e -> 28 + Error e ) 29 + | "com.atproto.repo.strongRef" -> ( 30 + match Com_atproto_repo_strongRef.main_of_yojson json with 31 + | Ok v -> 32 + Ok (StrongRef v) 33 + | Error e -> 34 + Error e ) 35 + | _ -> 36 + Ok (Unknown json) 37 + with _ -> Error "failed to parse union" 36 38 37 - let subject_to_yojson = function 38 - | RepoRef v -> 39 - (match Com_atproto_admin_defs.repo_ref_to_yojson v with 40 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.admin.defs#repoRef") :: fields) 41 - | other -> other) 42 - | StrongRef v -> 43 - (match Com_atproto_repo_strongRef.main_to_yojson v with 44 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.repo.strongRef") :: fields) 45 - | other -> other) 46 - | Unknown j -> j 39 + let subject_to_yojson = function 40 + | RepoRef v -> ( 41 + match Com_atproto_admin_defs.repo_ref_to_yojson v with 42 + | `Assoc fields -> 43 + `Assoc (("$type", `String "com.atproto.admin.defs#repoRef") :: fields) 44 + | other -> 45 + other ) 46 + | StrongRef v -> ( 47 + match Com_atproto_repo_strongRef.main_to_yojson v with 48 + | `Assoc fields -> 49 + `Assoc (("$type", `String "com.atproto.repo.strongRef") :: fields) 50 + | other -> 51 + other ) 52 + | Unknown j -> 53 + j 47 54 48 - type input = 49 - { 50 - reason_type: Com_atproto_moderation_defs.reason_type [@key "reasonType"]; 51 - reason: string option [@default None]; 52 - subject: subject; 53 - mod_tool: mod_tool option [@key "modTool"] [@default None]; 54 - } 55 + type input = 56 + { reason_type: Com_atproto_moderation_defs.reason_type [@key "reasonType"] 57 + ; reason: string option [@default None] 58 + ; subject: subject 59 + ; mod_tool: mod_tool option [@key "modTool"] [@default None] } 55 60 [@@deriving yojson {strict= false}] 56 61 57 62 type output = 58 - { 59 - id: int; 60 - reason_type: Com_atproto_moderation_defs.reason_type [@key "reasonType"]; 61 - reason: string option [@default None]; 62 - subject: subject; 63 - reported_by: string [@key "reportedBy"]; 64 - created_at: string [@key "createdAt"]; 65 - } 66 - [@@deriving yojson {strict= false}] 63 + { id: int 64 + ; reason_type: Com_atproto_moderation_defs.reason_type [@key "reasonType"] 65 + ; reason: string option [@default None] 66 + ; subject: subject 67 + ; reported_by: string [@key "reportedBy"] 68 + ; created_at: string [@key "createdAt"] } 69 + [@@deriving yojson {strict= false}] 67 70 68 - let call 69 - ~reason_type 70 - ?reason 71 - ~subject 72 - ?mod_tool 73 - (client : Hermes.client) : output Lwt.t = 71 + let call ~reason_type ?reason ~subject ?mod_tool (client : Hermes.client) : 72 + output Lwt.t = 74 73 let params = () in 75 - let input = Some ({reason_type; reason; subject; mod_tool} |> input_to_yojson) in 76 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 74 + let input = 75 + Some ({reason_type; reason; subject; mod_tool} |> input_to_yojson) 76 + in 77 + Hermes.procedure client nsid (params_to_yojson params) input 78 + output_of_yojson 77 79 end 78 -
+12 -5
pegasus/lexicons/com_atproto_moderation_defs.ml
··· 2 2 3 3 (** string type with known values *) 4 4 type reason_type = string 5 + 5 6 let reason_type_of_yojson = function 6 - | `String s -> Ok s 7 - | _ -> Error "reason_type: expected string" 7 + | `String s -> 8 + Ok s 9 + | _ -> 10 + Error "reason_type: expected string" 11 + 8 12 let reason_type_to_yojson s = `String s 9 13 10 14 (** Spam: frequent unwanted promotion, replies, mentions *) ··· 30 34 31 35 (** string type with known values: Tag describing a type of subject that might be reported. *) 32 36 type subject_type = string 37 + 33 38 let subject_type_of_yojson = function 34 - | `String s -> Ok s 35 - | _ -> Error "subject_type: expected string" 36 - let subject_type_to_yojson s = `String s 39 + | `String s -> 40 + Ok s 41 + | _ -> 42 + Error "subject_type: expected string" 37 43 44 + let subject_type_to_yojson s = `String s
+129 -115
pegasus/lexicons/com_atproto_repo_applyWrites.ml
··· 1 1 (* generated from com.atproto.repo.applyWrites *) 2 2 3 3 type delete_result = unit 4 + 4 5 let delete_result_of_yojson _ = Ok () 6 + 5 7 let delete_result_to_yojson () = `Assoc [] 6 8 7 9 type update_result = 8 - { 9 - uri: string; 10 - cid: string; 11 - validation_status: string option [@key "validationStatus"] [@default None]; 10 + { uri: string 11 + ; cid: string 12 + ; validation_status: string option [@key "validationStatus"] [@default None] 12 13 } 13 14 [@@deriving yojson {strict= false}] 14 15 15 16 type create_result = 16 - { 17 - uri: string; 18 - cid: string; 19 - validation_status: string option [@key "validationStatus"] [@default None]; 17 + { uri: string 18 + ; cid: string 19 + ; validation_status: string option [@key "validationStatus"] [@default None] 20 20 } 21 21 [@@deriving yojson {strict= false}] 22 22 23 - type delete = 24 - { 25 - collection: string; 26 - rkey: string; 27 - } 23 + type delete = {collection: string; rkey: string} 28 24 [@@deriving yojson {strict= false}] 29 25 30 - type update = 31 - { 32 - collection: string; 33 - rkey: string; 34 - value: Yojson.Safe.t; 35 - } 26 + type update = {collection: string; rkey: string; value: Yojson.Safe.t} 36 27 [@@deriving yojson {strict= false}] 37 28 38 29 type create = 39 - { 40 - collection: string; 41 - rkey: string option [@default None]; 42 - value: Yojson.Safe.t; 43 - } 30 + {collection: string; rkey: string option [@default None]; value: Yojson.Safe.t} 44 31 [@@deriving yojson {strict= false}] 45 32 46 33 (** Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS. *) ··· 48 35 let nsid = "com.atproto.repo.applyWrites" 49 36 50 37 type params = unit 38 + 51 39 let params_to_yojson () = `Assoc [] 52 40 53 - type writes_item = 54 - | Create of create 55 - | Update of update 56 - | Delete of delete 41 + type writes_item = Create of create | Update of update | Delete of delete 57 42 58 - let writes_item_of_yojson json = 59 - let open Yojson.Safe.Util in 60 - try 61 - match json |> member "$type" |> to_string with 62 - | "com.atproto.repo.applyWrites#create" -> 63 - (match create_of_yojson json with 64 - | Ok v -> Ok (Create v) 65 - | Error e -> Error e) 66 - | "com.atproto.repo.applyWrites#update" -> 67 - (match update_of_yojson json with 68 - | Ok v -> Ok (Update v) 69 - | Error e -> Error e) 70 - | "com.atproto.repo.applyWrites#delete" -> 71 - (match delete_of_yojson json with 72 - | Ok v -> Ok (Delete v) 73 - | Error e -> Error e) 74 - | t -> Error ("unknown union type: " ^ t) 75 - with _ -> Error "failed to parse union" 43 + let writes_item_of_yojson json = 44 + let open Yojson.Safe.Util in 45 + try 46 + match json |> member "$type" |> to_string with 47 + | "com.atproto.repo.applyWrites#create" -> ( 48 + match create_of_yojson json with 49 + | Ok v -> 50 + Ok (Create v) 51 + | Error e -> 52 + Error e ) 53 + | "com.atproto.repo.applyWrites#update" -> ( 54 + match update_of_yojson json with 55 + | Ok v -> 56 + Ok (Update v) 57 + | Error e -> 58 + Error e ) 59 + | "com.atproto.repo.applyWrites#delete" -> ( 60 + match delete_of_yojson json with 61 + | Ok v -> 62 + Ok (Delete v) 63 + | Error e -> 64 + Error e ) 65 + | t -> 66 + Error ("unknown union type: " ^ t) 67 + with _ -> Error "failed to parse union" 76 68 77 - let writes_item_to_yojson = function 78 - | Create v -> 79 - (match create_to_yojson v with 80 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.repo.applyWrites#create") :: fields) 81 - | other -> other) 82 - | Update v -> 83 - (match update_to_yojson v with 84 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.repo.applyWrites#update") :: fields) 85 - | other -> other) 86 - | Delete v -> 87 - (match delete_to_yojson v with 88 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.repo.applyWrites#delete") :: fields) 89 - | other -> other) 69 + let writes_item_to_yojson = function 70 + | Create v -> ( 71 + match create_to_yojson v with 72 + | `Assoc fields -> 73 + `Assoc 74 + (("$type", `String "com.atproto.repo.applyWrites#create") :: fields) 75 + | other -> 76 + other ) 77 + | Update v -> ( 78 + match update_to_yojson v with 79 + | `Assoc fields -> 80 + `Assoc 81 + (("$type", `String "com.atproto.repo.applyWrites#update") :: fields) 82 + | other -> 83 + other ) 84 + | Delete v -> ( 85 + match delete_to_yojson v with 86 + | `Assoc fields -> 87 + `Assoc 88 + (("$type", `String "com.atproto.repo.applyWrites#delete") :: fields) 89 + | other -> 90 + other ) 90 91 91 - type input = 92 - { 93 - repo: string; 94 - validate: bool option [@default None]; 95 - writes: writes_item list; 96 - swap_commit: string option [@key "swapCommit"] [@default None]; 97 - } 92 + type input = 93 + { repo: string 94 + ; validate: bool option [@default None] 95 + ; writes: writes_item list 96 + ; swap_commit: string option [@key "swapCommit"] [@default None] } 98 97 [@@deriving yojson {strict= false}] 99 98 100 99 type results_item = 101 - | CreateResult of create_result 102 - | UpdateResult of update_result 103 - | DeleteResult of delete_result 100 + | CreateResult of create_result 101 + | UpdateResult of update_result 102 + | DeleteResult of delete_result 104 103 105 - let results_item_of_yojson json = 106 - let open Yojson.Safe.Util in 107 - try 108 - match json |> member "$type" |> to_string with 109 - | "com.atproto.repo.applyWrites#createResult" -> 110 - (match create_result_of_yojson json with 111 - | Ok v -> Ok (CreateResult v) 112 - | Error e -> Error e) 113 - | "com.atproto.repo.applyWrites#updateResult" -> 114 - (match update_result_of_yojson json with 115 - | Ok v -> Ok (UpdateResult v) 116 - | Error e -> Error e) 117 - | "com.atproto.repo.applyWrites#deleteResult" -> 118 - (match delete_result_of_yojson json with 119 - | Ok v -> Ok (DeleteResult v) 120 - | Error e -> Error e) 121 - | t -> Error ("unknown union type: " ^ t) 122 - with _ -> Error "failed to parse union" 104 + let results_item_of_yojson json = 105 + let open Yojson.Safe.Util in 106 + try 107 + match json |> member "$type" |> to_string with 108 + | "com.atproto.repo.applyWrites#createResult" -> ( 109 + match create_result_of_yojson json with 110 + | Ok v -> 111 + Ok (CreateResult v) 112 + | Error e -> 113 + Error e ) 114 + | "com.atproto.repo.applyWrites#updateResult" -> ( 115 + match update_result_of_yojson json with 116 + | Ok v -> 117 + Ok (UpdateResult v) 118 + | Error e -> 119 + Error e ) 120 + | "com.atproto.repo.applyWrites#deleteResult" -> ( 121 + match delete_result_of_yojson json with 122 + | Ok v -> 123 + Ok (DeleteResult v) 124 + | Error e -> 125 + Error e ) 126 + | t -> 127 + Error ("unknown union type: " ^ t) 128 + with _ -> Error "failed to parse union" 123 129 124 - let results_item_to_yojson = function 125 - | CreateResult v -> 126 - (match create_result_to_yojson v with 127 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.repo.applyWrites#createResult") :: fields) 128 - | other -> other) 129 - | UpdateResult v -> 130 - (match update_result_to_yojson v with 131 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.repo.applyWrites#updateResult") :: fields) 132 - | other -> other) 133 - | DeleteResult v -> 134 - (match delete_result_to_yojson v with 135 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.repo.applyWrites#deleteResult") :: fields) 136 - | other -> other) 130 + let results_item_to_yojson = function 131 + | CreateResult v -> ( 132 + match create_result_to_yojson v with 133 + | `Assoc fields -> 134 + `Assoc 135 + ( ("$type", `String "com.atproto.repo.applyWrites#createResult") 136 + :: fields ) 137 + | other -> 138 + other ) 139 + | UpdateResult v -> ( 140 + match update_result_to_yojson v with 141 + | `Assoc fields -> 142 + `Assoc 143 + ( ("$type", `String "com.atproto.repo.applyWrites#updateResult") 144 + :: fields ) 145 + | other -> 146 + other ) 147 + | DeleteResult v -> ( 148 + match delete_result_to_yojson v with 149 + | `Assoc fields -> 150 + `Assoc 151 + ( ("$type", `String "com.atproto.repo.applyWrites#deleteResult") 152 + :: fields ) 153 + | other -> 154 + other ) 137 155 138 - type output = 139 - { 140 - commit: Com_atproto_repo_defs.commit_meta option [@default None]; 141 - results: results_item list option [@default None]; 142 - } 143 - [@@deriving yojson {strict= false}] 156 + type output = 157 + { commit: Com_atproto_repo_defs.commit_meta option [@default None] 158 + ; results: results_item list option [@default None] } 159 + [@@deriving yojson {strict= false}] 144 160 145 - let call 146 - ~repo 147 - ?validate 148 - ~writes 149 - ?swap_commit 150 - (client : Hermes.client) : output Lwt.t = 161 + let call ~repo ?validate ~writes ?swap_commit (client : Hermes.client) : 162 + output Lwt.t = 151 163 let params = () in 152 - let input = Some ({repo; validate; writes; swap_commit} |> input_to_yojson) in 153 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 164 + let input = 165 + Some ({repo; validate; writes; swap_commit} |> input_to_yojson) 166 + in 167 + Hermes.procedure client nsid (params_to_yojson params) input 168 + output_of_yojson 154 169 end 155 -
+21 -25
pegasus/lexicons/com_atproto_repo_createRecord.ml
··· 5 5 let nsid = "com.atproto.repo.createRecord" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - repo: string; 13 - collection: string; 14 - rkey: string option [@default None]; 15 - validate: bool option [@default None]; 16 - record: Yojson.Safe.t; 17 - swap_commit: string option [@key "swapCommit"] [@default None]; 18 - } 12 + { repo: string 13 + ; collection: string 14 + ; rkey: string option [@default None] 15 + ; validate: bool option [@default None] 16 + ; record: Yojson.Safe.t 17 + ; swap_commit: string option [@key "swapCommit"] [@default None] } 19 18 [@@deriving yojson {strict= false}] 20 19 21 20 type output = 22 - { 23 - uri: string; 24 - cid: string; 25 - commit: Com_atproto_repo_defs.commit_meta option [@default None]; 26 - validation_status: string option [@key "validationStatus"] [@default None]; 27 - } 28 - [@@deriving yojson {strict= false}] 21 + { uri: string 22 + ; cid: string 23 + ; commit: Com_atproto_repo_defs.commit_meta option [@default None] 24 + ; validation_status: string option [@key "validationStatus"] [@default None] 25 + } 26 + [@@deriving yojson {strict= false}] 29 27 30 - let call 31 - ~repo 32 - ~collection 33 - ?rkey 34 - ?validate 35 - ~record 36 - ?swap_commit 28 + let call ~repo ~collection ?rkey ?validate ~record ?swap_commit 37 29 (client : Hermes.client) : output Lwt.t = 38 30 let params = () in 39 - let input = Some ({repo; collection; rkey; validate; record; swap_commit} |> input_to_yojson) in 40 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 31 + let input = 32 + Some 33 + ( {repo; collection; rkey; validate; record; swap_commit} 34 + |> input_to_yojson ) 35 + in 36 + Hermes.procedure client nsid (params_to_yojson params) input 37 + output_of_yojson 41 38 end 42 -
+1 -6
pegasus/lexicons/com_atproto_repo_defs.ml
··· 1 1 (* generated from com.atproto.repo.defs *) 2 2 3 - type commit_meta = 4 - { 5 - cid: string; 6 - rev: string; 7 - } 3 + type commit_meta = {cid: string; rev: string} 8 4 [@@deriving yojson {strict= false}] 9 -
+15 -20
pegasus/lexicons/com_atproto_repo_deleteRecord.ml
··· 5 5 let nsid = "com.atproto.repo.deleteRecord" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - repo: string; 13 - collection: string; 14 - rkey: string; 15 - swap_record: string option [@key "swapRecord"] [@default None]; 16 - swap_commit: string option [@key "swapCommit"] [@default None]; 17 - } 12 + { repo: string 13 + ; collection: string 14 + ; rkey: string 15 + ; swap_record: string option [@key "swapRecord"] [@default None] 16 + ; swap_commit: string option [@key "swapCommit"] [@default None] } 18 17 [@@deriving yojson {strict= false}] 19 18 20 19 type output = 21 - { 22 - commit: Com_atproto_repo_defs.commit_meta option [@default None]; 23 - } 24 - [@@deriving yojson {strict= false}] 20 + {commit: Com_atproto_repo_defs.commit_meta option [@default None]} 21 + [@@deriving yojson {strict= false}] 25 22 26 - let call 27 - ~repo 28 - ~collection 29 - ~rkey 30 - ?swap_record 31 - ?swap_commit 23 + let call ~repo ~collection ~rkey ?swap_record ?swap_commit 32 24 (client : Hermes.client) : output Lwt.t = 33 25 let params = () in 34 - let input = Some ({repo; collection; rkey; swap_record; swap_commit} |> input_to_yojson) in 35 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 26 + let input = 27 + Some 28 + ({repo; collection; rkey; swap_record; swap_commit} |> input_to_yojson) 29 + in 30 + Hermes.procedure client nsid (params_to_yojson params) input 31 + output_of_yojson 36 32 end 37 -
+8 -17
pegasus/lexicons/com_atproto_repo_describeRepo.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.repo.describeRepo" 6 6 7 - type params = 8 - { 9 - repo: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {repo: string} [@@deriving yojson {strict= false}] 12 8 13 9 type output = 14 - { 15 - handle: string; 16 - did: string; 17 - did_doc: Yojson.Safe.t [@key "didDoc"]; 18 - collections: string list; 19 - handle_is_correct: bool [@key "handleIsCorrect"]; 20 - } 21 - [@@deriving yojson {strict= false}] 10 + { handle: string 11 + ; did: string 12 + ; did_doc: Yojson.Safe.t [@key "didDoc"] 13 + ; collections: string list 14 + ; handle_is_correct: bool [@key "handleIsCorrect"] } 15 + [@@deriving yojson {strict= false}] 22 16 23 - let call 24 - ~repo 25 - (client : Hermes.client) : output Lwt.t = 17 + let call ~repo (client : Hermes.client) : output Lwt.t = 26 18 let params : params = {repo} in 27 19 Hermes.query client nsid (params_to_yojson params) output_of_yojson 28 20 end 29 -
+9 -20
pegasus/lexicons/com_atproto_repo_getRecord.ml
··· 5 5 let nsid = "com.atproto.repo.getRecord" 6 6 7 7 type params = 8 - { 9 - repo: string; 10 - collection: string; 11 - rkey: string; 12 - cid: string option [@default None]; 13 - } 14 - [@@deriving yojson {strict= false}] 8 + { repo: string 9 + ; collection: string 10 + ; rkey: string 11 + ; cid: string option [@default None] } 12 + [@@deriving yojson {strict= false}] 15 13 16 14 type output = 17 - { 18 - uri: string; 19 - cid: string option [@default None]; 20 - value: Yojson.Safe.t; 21 - } 22 - [@@deriving yojson {strict= false}] 15 + {uri: string; cid: string option [@default None]; value: Yojson.Safe.t} 16 + [@@deriving yojson {strict= false}] 23 17 24 - let call 25 - ~repo 26 - ~collection 27 - ~rkey 28 - ?cid 29 - (client : Hermes.client) : output Lwt.t = 18 + let call ~repo ~collection ~rkey ?cid (client : Hermes.client) : output Lwt.t 19 + = 30 20 let params : params = {repo; collection; rkey; cid} in 31 21 Hermes.query client nsid (params_to_yojson params) output_of_yojson 32 22 end 33 -
+7 -5
pegasus/lexicons/com_atproto_repo_importRepo.ml
··· 5 5 let nsid = "com.atproto.repo.importRepo" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = unit 12 + 11 13 let output_of_yojson _ = Ok () 12 14 13 - let call 14 - ?input 15 - (client : Hermes.client) : output Lwt.t = 15 + let call ?input (client : Hermes.client) : output Lwt.t = 16 16 let params = () in 17 17 let open Lwt.Syntax in 18 - let* _ = Hermes.procedure_bytes client nsid (params_to_yojson params) input ~content_type:"application/vnd.ipld.car" in 18 + let* _ = 19 + Hermes.procedure_bytes client nsid (params_to_yojson params) input 20 + ~content_type:"application/vnd.ipld.car" 21 + in 19 22 Lwt.return () 20 23 end 21 -
+6 -21
pegasus/lexicons/com_atproto_repo_listMissingBlobs.ml
··· 1 1 (* generated from com.atproto.repo.listMissingBlobs *) 2 2 3 - type record_blob = 4 - { 5 - cid: string; 6 - record_uri: string [@key "recordUri"]; 7 - } 3 + type record_blob = {cid: string; record_uri: string [@key "recordUri"]} 8 4 [@@deriving yojson {strict= false}] 9 5 10 6 (** Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow. *) ··· 12 8 let nsid = "com.atproto.repo.listMissingBlobs" 13 9 14 10 type params = 15 - { 16 - limit: int option [@default None]; 17 - cursor: string option [@default None]; 18 - } 19 - [@@deriving yojson {strict= false}] 11 + {limit: int option [@default None]; cursor: string option [@default None]} 12 + [@@deriving yojson {strict= false}] 20 13 21 - type output = 22 - { 23 - cursor: string option [@default None]; 24 - blobs: record_blob list; 25 - } 26 - [@@deriving yojson {strict= false}] 14 + type output = {cursor: string option [@default None]; blobs: record_blob list} 15 + [@@deriving yojson {strict= false}] 27 16 28 - let call 29 - ?limit 30 - ?cursor 31 - (client : Hermes.client) : output Lwt.t = 17 + let call ?limit ?cursor (client : Hermes.client) : output Lwt.t = 32 18 let params : params = {limit; cursor} in 33 19 Hermes.query client nsid (params_to_yojson params) output_of_yojson 34 20 end 35 -
+11 -28
pegasus/lexicons/com_atproto_repo_listRecords.ml
··· 1 1 (* generated from com.atproto.repo.listRecords *) 2 2 3 - type record = 4 - { 5 - uri: string; 6 - cid: string; 7 - value: Yojson.Safe.t; 8 - } 3 + type record = {uri: string; cid: string; value: Yojson.Safe.t} 9 4 [@@deriving yojson {strict= false}] 10 5 11 6 (** List a range of records in a repository, matching a specific collection. Does not require auth. *) ··· 13 8 let nsid = "com.atproto.repo.listRecords" 14 9 15 10 type params = 16 - { 17 - repo: string; 18 - collection: string; 19 - limit: int option [@default None]; 20 - cursor: string option [@default None]; 21 - reverse: bool option [@default None]; 22 - } 23 - [@@deriving yojson {strict= false}] 11 + { repo: string 12 + ; collection: string 13 + ; limit: int option [@default None] 14 + ; cursor: string option [@default None] 15 + ; reverse: bool option [@default None] } 16 + [@@deriving yojson {strict= false}] 24 17 25 - type output = 26 - { 27 - cursor: string option [@default None]; 28 - records: record list; 29 - } 30 - [@@deriving yojson {strict= false}] 18 + type output = {cursor: string option [@default None]; records: record list} 19 + [@@deriving yojson {strict= false}] 31 20 32 - let call 33 - ~repo 34 - ~collection 35 - ?limit 36 - ?cursor 37 - ?reverse 38 - (client : Hermes.client) : output Lwt.t = 21 + let call ~repo ~collection ?limit ?cursor ?reverse (client : Hermes.client) : 22 + output Lwt.t = 39 23 let params : params = {repo; collection; limit; cursor; reverse} in 40 24 Hermes.query client nsid (params_to_yojson params) output_of_yojson 41 25 end 42 -
+22 -27
pegasus/lexicons/com_atproto_repo_putRecord.ml
··· 5 5 let nsid = "com.atproto.repo.putRecord" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - repo: string; 13 - collection: string; 14 - rkey: string; 15 - validate: bool option [@default None]; 16 - record: Yojson.Safe.t; 17 - swap_record: string option [@key "swapRecord"] [@default None]; 18 - swap_commit: string option [@key "swapCommit"] [@default None]; 19 - } 12 + { repo: string 13 + ; collection: string 14 + ; rkey: string 15 + ; validate: bool option [@default None] 16 + ; record: Yojson.Safe.t 17 + ; swap_record: string option [@key "swapRecord"] [@default None] 18 + ; swap_commit: string option [@key "swapCommit"] [@default None] } 20 19 [@@deriving yojson {strict= false}] 21 20 22 21 type output = 23 - { 24 - uri: string; 25 - cid: string; 26 - commit: Com_atproto_repo_defs.commit_meta option [@default None]; 27 - validation_status: string option [@key "validationStatus"] [@default None]; 28 - } 29 - [@@deriving yojson {strict= false}] 22 + { uri: string 23 + ; cid: string 24 + ; commit: Com_atproto_repo_defs.commit_meta option [@default None] 25 + ; validation_status: string option [@key "validationStatus"] [@default None] 26 + } 27 + [@@deriving yojson {strict= false}] 30 28 31 - let call 32 - ~repo 33 - ~collection 34 - ~rkey 35 - ?validate 36 - ~record 37 - ?swap_record 38 - ?swap_commit 29 + let call ~repo ~collection ~rkey ?validate ~record ?swap_record ?swap_commit 39 30 (client : Hermes.client) : output Lwt.t = 40 31 let params = () in 41 - let input = Some ({repo; collection; rkey; validate; record; swap_record; swap_commit} |> input_to_yojson) in 42 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 32 + let input = 33 + Some 34 + ( {repo; collection; rkey; validate; record; swap_record; swap_commit} 35 + |> input_to_yojson ) 36 + in 37 + Hermes.procedure client nsid (params_to_yojson params) input 38 + output_of_yojson 43 39 end 44 -
+1 -7
pegasus/lexicons/com_atproto_repo_strongRef.ml
··· 1 1 (* generated from com.atproto.repo.strongRef *) 2 2 3 - type main = 4 - { 5 - uri: string; 6 - cid: string; 7 - } 8 - [@@deriving yojson {strict= false}] 9 - 3 + type main = {uri: string; cid: string} [@@deriving yojson {strict= false}]
+6 -10
pegasus/lexicons/com_atproto_repo_uploadBlob.ml
··· 5 5 let nsid = "com.atproto.repo.uploadBlob" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type output = 11 - { 12 - blob: Hermes.blob; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type output = {blob: Hermes.blob} [@@deriving yojson {strict= false}] 15 12 16 - let call 17 - ?input 18 - (client : Hermes.client) : output Lwt.t = 13 + let call ?input (client : Hermes.client) : output Lwt.t = 19 14 let params = () in 20 - Hermes.procedure_blob client nsid (params_to_yojson params) (Bytes.of_string (Option.value input ~default:"")) ~content_type:"*/*" output_of_yojson 15 + Hermes.procedure_blob client nsid (params_to_yojson params) 16 + (Bytes.of_string (Option.value input ~default:"")) 17 + ~content_type:"*/*" output_of_yojson 21 18 end 22 -
+5 -4
pegasus/lexicons/com_atproto_server_activateAccount.ml
··· 5 5 let nsid = "com.atproto.server.activateAccount" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = unit 12 + 11 13 let output_of_yojson _ = Ok () 12 14 13 - let call 14 - (client : Hermes.client) : output Lwt.t = 15 + let call (client : Hermes.client) : output Lwt.t = 15 16 let params = () in 16 17 let input = None in 17 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 18 + Hermes.procedure client nsid (params_to_yojson params) input 19 + output_of_yojson 18 20 end 19 -
+12 -15
pegasus/lexicons/com_atproto_server_checkAccountStatus.ml
··· 5 5 let nsid = "com.atproto.server.checkAccountStatus" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = 11 - { 12 - activated: bool; 13 - valid_did: bool [@key "validDid"]; 14 - repo_commit: string [@key "repoCommit"]; 15 - repo_rev: string [@key "repoRev"]; 16 - repo_blocks: int [@key "repoBlocks"]; 17 - indexed_records: int [@key "indexedRecords"]; 18 - private_state_values: int [@key "privateStateValues"]; 19 - expected_blobs: int [@key "expectedBlobs"]; 20 - imported_blobs: int [@key "importedBlobs"]; 21 - } 22 - [@@deriving yojson {strict= false}] 12 + { activated: bool 13 + ; valid_did: bool [@key "validDid"] 14 + ; repo_commit: string [@key "repoCommit"] 15 + ; repo_rev: string [@key "repoRev"] 16 + ; repo_blocks: int [@key "repoBlocks"] 17 + ; indexed_records: int [@key "indexedRecords"] 18 + ; private_state_values: int [@key "privateStateValues"] 19 + ; expected_blobs: int [@key "expectedBlobs"] 20 + ; imported_blobs: int [@key "importedBlobs"] } 21 + [@@deriving yojson {strict= false}] 23 22 24 - let call 25 - (client : Hermes.client) : output Lwt.t = 23 + let call (client : Hermes.client) : output Lwt.t = 26 24 Hermes.query client nsid (`Assoc []) output_of_yojson 27 25 end 28 -
+6 -11
pegasus/lexicons/com_atproto_server_confirmEmail.ml
··· 5 5 let nsid = "com.atproto.server.confirmEmail" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - email: string; 13 - token: string; 14 - } 11 + type input = {email: string; token: string} 15 12 [@@deriving yojson {strict= false}] 16 13 17 14 type output = unit 15 + 18 16 let output_of_yojson _ = Ok () 19 17 20 - let call 21 - ~email 22 - ~token 23 - (client : Hermes.client) : output Lwt.t = 18 + let call ~email ~token (client : Hermes.client) : output Lwt.t = 24 19 let params = () in 25 20 let input = Some ({email; token} |> input_to_yojson) in 26 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 27 23 end 28 -
+34 -32
pegasus/lexicons/com_atproto_server_createAccount.ml
··· 5 5 let nsid = "com.atproto.server.createAccount" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - email: string option [@default None]; 13 - handle: string; 14 - did: string option [@default None]; 15 - invite_code: string option [@key "inviteCode"] [@default None]; 16 - verification_code: string option [@key "verificationCode"] [@default None]; 17 - verification_phone: string option [@key "verificationPhone"] [@default None]; 18 - password: string option [@default None]; 19 - recovery_key: string option [@key "recoveryKey"] [@default None]; 20 - plc_op: Yojson.Safe.t option [@key "plcOp"] [@default None]; 21 - } 12 + { email: string option [@default None] 13 + ; handle: string 14 + ; did: string option [@default None] 15 + ; invite_code: string option [@key "inviteCode"] [@default None] 16 + ; verification_code: string option [@key "verificationCode"] [@default None] 17 + ; verification_phone: string option 18 + [@key "verificationPhone"] [@default None] 19 + ; password: string option [@default None] 20 + ; recovery_key: string option [@key "recoveryKey"] [@default None] 21 + ; plc_op: Yojson.Safe.t option [@key "plcOp"] [@default None] } 22 22 [@@deriving yojson {strict= false}] 23 23 24 24 type output = 25 - { 26 - access_jwt: string [@key "accessJwt"]; 27 - refresh_jwt: string [@key "refreshJwt"]; 28 - handle: string; 29 - did: string; 30 - did_doc: Yojson.Safe.t option [@key "didDoc"] [@default None]; 31 - } 32 - [@@deriving yojson {strict= false}] 25 + { access_jwt: string [@key "accessJwt"] 26 + ; refresh_jwt: string [@key "refreshJwt"] 27 + ; handle: string 28 + ; did: string 29 + ; did_doc: Yojson.Safe.t option [@key "didDoc"] [@default None] } 30 + [@@deriving yojson {strict= false}] 33 31 34 - let call 35 - ?email 36 - ~handle 37 - ?did 38 - ?invite_code 39 - ?verification_code 40 - ?verification_phone 41 - ?password 42 - ?recovery_key 43 - ?plc_op 32 + let call ?email ~handle ?did ?invite_code ?verification_code 33 + ?verification_phone ?password ?recovery_key ?plc_op 44 34 (client : Hermes.client) : output Lwt.t = 45 35 let params = () in 46 - let input = Some ({email; handle; did; invite_code; verification_code; verification_phone; password; recovery_key; plc_op} |> input_to_yojson) in 47 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 36 + let input = 37 + Some 38 + ( { email 39 + ; handle 40 + ; did 41 + ; invite_code 42 + ; verification_code 43 + ; verification_phone 44 + ; password 45 + ; recovery_key 46 + ; plc_op } 47 + |> input_to_yojson ) 48 + in 49 + Hermes.procedure client nsid (params_to_yojson params) input 50 + output_of_yojson 48 51 end 49 -
+10 -19
pegasus/lexicons/com_atproto_server_createAppPassword.ml
··· 1 1 (* generated from com.atproto.server.createAppPassword *) 2 2 3 3 type app_password = 4 - { 5 - name: string; 6 - password: string; 7 - created_at: string [@key "createdAt"]; 8 - privileged: bool option [@default None]; 9 - } 4 + { name: string 5 + ; password: string 6 + ; created_at: string [@key "createdAt"] 7 + ; privileged: bool option [@default None] } 10 8 [@@deriving yojson {strict= false}] 11 9 12 10 (** Create an App Password. *) ··· 14 12 let nsid = "com.atproto.server.createAppPassword" 15 13 16 14 type params = unit 15 + 17 16 let params_to_yojson () = `Assoc [] 18 17 19 - type input = 20 - { 21 - name: string; 22 - privileged: bool option [@default None]; 23 - } 18 + type input = {name: string; privileged: bool option [@default None]} 24 19 [@@deriving yojson {strict= false}] 25 20 26 - type output = app_password 27 - [@@deriving yojson {strict= false}] 21 + type output = app_password [@@deriving yojson {strict= false}] 28 22 29 - let call 30 - ~name 31 - ?privileged 32 - (client : Hermes.client) : output Lwt.t = 23 + let call ~name ?privileged (client : Hermes.client) : output Lwt.t = 33 24 let params = () in 34 25 let input = Some ({name; privileged} |> input_to_yojson) in 35 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 26 + Hermes.procedure client nsid (params_to_yojson params) input 27 + output_of_yojson 36 28 end 37 -
+7 -15
pegasus/lexicons/com_atproto_server_createInviteCode.ml
··· 5 5 let nsid = "com.atproto.server.createInviteCode" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - use_count: int [@key "useCount"]; 13 - for_account: string option [@key "forAccount"] [@default None]; 14 - } 12 + { use_count: int [@key "useCount"] 13 + ; for_account: string option [@key "forAccount"] [@default None] } 15 14 [@@deriving yojson {strict= false}] 16 15 17 - type output = 18 - { 19 - code: string; 20 - } 21 - [@@deriving yojson {strict= false}] 16 + type output = {code: string} [@@deriving yojson {strict= false}] 22 17 23 - let call 24 - ~use_count 25 - ?for_account 26 - (client : Hermes.client) : output Lwt.t = 18 + let call ~use_count ?for_account (client : Hermes.client) : output Lwt.t = 27 19 let params = () in 28 20 let input = Some ({use_count; for_account} |> input_to_yojson) in 29 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 30 23 end 31 -
+13 -23
pegasus/lexicons/com_atproto_server_createInviteCodes.ml
··· 1 1 (* generated from com.atproto.server.createInviteCodes *) 2 2 3 - type account_codes = 4 - { 5 - account: string; 6 - codes: string list; 7 - } 3 + type account_codes = {account: string; codes: string list} 8 4 [@@deriving yojson {strict= false}] 9 5 10 6 (** Create invite codes. *) ··· 12 8 let nsid = "com.atproto.server.createInviteCodes" 13 9 14 10 type params = unit 11 + 15 12 let params_to_yojson () = `Assoc [] 16 13 17 14 type input = 18 - { 19 - code_count: int [@key "codeCount"]; 20 - use_count: int [@key "useCount"]; 21 - for_accounts: string list option [@key "forAccounts"] [@default None]; 22 - } 15 + { code_count: int [@key "codeCount"] 16 + ; use_count: int [@key "useCount"] 17 + ; for_accounts: string list option [@key "forAccounts"] [@default None] } 23 18 [@@deriving yojson {strict= false}] 24 19 25 - type output = 26 - { 27 - codes: account_codes list; 28 - } 29 - [@@deriving yojson {strict= false}] 20 + type output = {codes: account_codes list} [@@deriving yojson {strict= false}] 30 21 31 - let call 32 - ~code_count 33 - ~use_count 34 - ?for_accounts 35 - (client : Hermes.client) : output Lwt.t = 22 + let call ~code_count ~use_count ?for_accounts (client : Hermes.client) : 23 + output Lwt.t = 36 24 let params = () in 37 - let input = Some ({code_count; use_count; for_accounts} |> input_to_yojson) in 38 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + let input = 26 + Some ({code_count; use_count; for_accounts} |> input_to_yojson) 27 + in 28 + Hermes.procedure client nsid (params_to_yojson params) input 29 + output_of_yojson 39 30 end 40 -
+24 -27
pegasus/lexicons/com_atproto_server_createSession.ml
··· 5 5 let nsid = "com.atproto.server.createSession" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - identifier: string; 13 - password: string; 14 - auth_factor_token: string option [@key "authFactorToken"] [@default None]; 15 - allow_takendown: bool option [@key "allowTakendown"] [@default None]; 16 - } 12 + { identifier: string 13 + ; password: string 14 + ; auth_factor_token: string option [@key "authFactorToken"] [@default None] 15 + ; allow_takendown: bool option [@key "allowTakendown"] [@default None] } 17 16 [@@deriving yojson {strict= false}] 18 17 19 18 type output = 20 - { 21 - access_jwt: string [@key "accessJwt"]; 22 - refresh_jwt: string [@key "refreshJwt"]; 23 - handle: string; 24 - did: string; 25 - did_doc: Yojson.Safe.t option [@key "didDoc"] [@default None]; 26 - email: string option [@default None]; 27 - email_confirmed: bool option [@key "emailConfirmed"] [@default None]; 28 - email_auth_factor: bool option [@key "emailAuthFactor"] [@default None]; 29 - active: bool option [@default None]; 30 - status: string option [@default None]; 31 - } 32 - [@@deriving yojson {strict= false}] 19 + { access_jwt: string [@key "accessJwt"] 20 + ; refresh_jwt: string [@key "refreshJwt"] 21 + ; handle: string 22 + ; did: string 23 + ; did_doc: Yojson.Safe.t option [@key "didDoc"] [@default None] 24 + ; email: string option [@default None] 25 + ; email_confirmed: bool option [@key "emailConfirmed"] [@default None] 26 + ; email_auth_factor: bool option [@key "emailAuthFactor"] [@default None] 27 + ; active: bool option [@default None] 28 + ; status: string option [@default None] } 29 + [@@deriving yojson {strict= false}] 33 30 34 - let call 35 - ~identifier 36 - ~password 37 - ?auth_factor_token 38 - ?allow_takendown 31 + let call ~identifier ~password ?auth_factor_token ?allow_takendown 39 32 (client : Hermes.client) : output Lwt.t = 40 33 let params = () in 41 - let input = Some ({identifier; password; auth_factor_token; allow_takendown} |> input_to_yojson) in 42 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 34 + let input = 35 + Some 36 + ( {identifier; password; auth_factor_token; allow_takendown} 37 + |> input_to_yojson ) 38 + in 39 + Hermes.procedure client nsid (params_to_yojson params) input 40 + output_of_yojson 43 41 end 44 -
+6 -9
pegasus/lexicons/com_atproto_server_deactivateAccount.ml
··· 5 5 let nsid = "com.atproto.server.deactivateAccount" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - delete_after: string option [@key "deleteAfter"] [@default None]; 13 - } 11 + type input = {delete_after: string option [@key "deleteAfter"] [@default None]} 14 12 [@@deriving yojson {strict= false}] 15 13 16 14 type output = unit 15 + 17 16 let output_of_yojson _ = Ok () 18 17 19 - let call 20 - ?delete_after 21 - (client : Hermes.client) : output Lwt.t = 18 + let call ?delete_after (client : Hermes.client) : output Lwt.t = 22 19 let params = () in 23 20 let input = Some ({delete_after} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 25 23 end 26 -
+8 -14
pegasus/lexicons/com_atproto_server_defs.ml
··· 1 1 (* generated from com.atproto.server.defs *) 2 2 3 3 type invite_code_use = 4 - { 5 - used_by: string [@key "usedBy"]; 6 - used_at: string [@key "usedAt"]; 7 - } 4 + {used_by: string [@key "usedBy"]; used_at: string [@key "usedAt"]} 8 5 [@@deriving yojson {strict= false}] 9 6 10 7 type invite_code = 11 - { 12 - code: string; 13 - available: int; 14 - disabled: bool; 15 - for_account: string [@key "forAccount"]; 16 - created_by: string [@key "createdBy"]; 17 - created_at: string [@key "createdAt"]; 18 - uses: invite_code_use list; 19 - } 8 + { code: string 9 + ; available: int 10 + ; disabled: bool 11 + ; for_account: string [@key "forAccount"] 12 + ; created_by: string [@key "createdBy"] 13 + ; created_at: string [@key "createdAt"] 14 + ; uses: invite_code_use list } 20 15 [@@deriving yojson {strict= false}] 21 -
+6 -13
pegasus/lexicons/com_atproto_server_deleteAccount.ml
··· 5 5 let nsid = "com.atproto.server.deleteAccount" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - did: string; 13 - password: string; 14 - token: string; 15 - } 11 + type input = {did: string; password: string; token: string} 16 12 [@@deriving yojson {strict= false}] 17 13 18 14 type output = unit 15 + 19 16 let output_of_yojson _ = Ok () 20 17 21 - let call 22 - ~did 23 - ~password 24 - ~token 25 - (client : Hermes.client) : output Lwt.t = 18 + let call ~did ~password ~token (client : Hermes.client) : output Lwt.t = 26 19 let params = () in 27 20 let input = Some ({did; password; token} |> input_to_yojson) in 28 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 29 23 end 30 -
+5 -4
pegasus/lexicons/com_atproto_server_deleteSession.ml
··· 5 5 let nsid = "com.atproto.server.deleteSession" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = unit 12 + 11 13 let output_of_yojson _ = Ok () 12 14 13 - let call 14 - (client : Hermes.client) : output Lwt.t = 15 + let call (client : Hermes.client) : output Lwt.t = 15 16 let params = () in 16 17 let input = None in 17 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 18 + Hermes.procedure client nsid (params_to_yojson params) input 19 + output_of_yojson 18 20 end 19 -
+14 -20
pegasus/lexicons/com_atproto_server_describeServer.ml
··· 1 1 (* generated from com.atproto.server.describeServer *) 2 2 3 - type contact = 4 - { 5 - email: string option [@default None]; 6 - } 3 + type contact = {email: string option [@default None]} 7 4 [@@deriving yojson {strict= false}] 8 5 9 6 type links = 10 - { 11 - privacy_policy: string option [@key "privacyPolicy"] [@default None]; 12 - terms_of_service: string option [@key "termsOfService"] [@default None]; 13 - } 7 + { privacy_policy: string option [@key "privacyPolicy"] [@default None] 8 + ; terms_of_service: string option [@key "termsOfService"] [@default None] } 14 9 [@@deriving yojson {strict= false}] 15 10 16 11 (** Describes the server's account creation requirements and capabilities. Implemented by PDS. *) ··· 18 13 let nsid = "com.atproto.server.describeServer" 19 14 20 15 type params = unit 16 + 21 17 let params_to_yojson () = `Assoc [] 22 18 23 19 type output = 24 - { 25 - invite_code_required: bool option [@key "inviteCodeRequired"] [@default None]; 26 - phone_verification_required: bool option [@key "phoneVerificationRequired"] [@default None]; 27 - available_user_domains: string list [@key "availableUserDomains"]; 28 - links: links option [@default None]; 29 - contact: contact option [@default None]; 30 - did: string; 31 - } 32 - [@@deriving yojson {strict= false}] 20 + { invite_code_required: bool option 21 + [@key "inviteCodeRequired"] [@default None] 22 + ; phone_verification_required: bool option 23 + [@key "phoneVerificationRequired"] [@default None] 24 + ; available_user_domains: string list [@key "availableUserDomains"] 25 + ; links: links option [@default None] 26 + ; contact: contact option [@default None] 27 + ; did: string } 28 + [@@deriving yojson {strict= false}] 33 29 34 - let call 35 - (client : Hermes.client) : output Lwt.t = 30 + let call (client : Hermes.client) : output Lwt.t = 36 31 Hermes.query client nsid (`Assoc []) output_of_yojson 37 32 end 38 -
+7 -15
pegasus/lexicons/com_atproto_server_getAccountInviteCodes.ml
··· 5 5 let nsid = "com.atproto.server.getAccountInviteCodes" 6 6 7 7 type params = 8 - { 9 - include_used: bool option [@key "includeUsed"] [@default None]; 10 - create_available: bool option [@key "createAvailable"] [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + { include_used: bool option [@key "includeUsed"] [@default None] 9 + ; create_available: bool option [@key "createAvailable"] [@default None] } 10 + [@@deriving yojson {strict= false}] 13 11 14 - type output = 15 - { 16 - codes: Com_atproto_server_defs.invite_code list; 17 - } 18 - [@@deriving yojson {strict= false}] 12 + type output = {codes: Com_atproto_server_defs.invite_code list} 13 + [@@deriving yojson {strict= false}] 19 14 20 - let call 21 - ?include_used 22 - ?create_available 23 - (client : Hermes.client) : output Lwt.t = 15 + let call ?include_used ?create_available (client : Hermes.client) : 16 + output Lwt.t = 24 17 let params : params = {include_used; create_available} in 25 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 19 end 27 -
+6 -17
pegasus/lexicons/com_atproto_server_getServiceAuth.ml
··· 5 5 let nsid = "com.atproto.server.getServiceAuth" 6 6 7 7 type params = 8 - { 9 - aud: string; 10 - exp: int option [@default None]; 11 - lxm: string option [@default None]; 12 - } 13 - [@@deriving yojson {strict= false}] 8 + { aud: string 9 + ; exp: int option [@default None] 10 + ; lxm: string option [@default None] } 11 + [@@deriving yojson {strict= false}] 14 12 15 - type output = 16 - { 17 - token: string; 18 - } 19 - [@@deriving yojson {strict= false}] 13 + type output = {token: string} [@@deriving yojson {strict= false}] 20 14 21 - let call 22 - ~aud 23 - ?exp 24 - ?lxm 25 - (client : Hermes.client) : output Lwt.t = 15 + let call ~aud ?exp ?lxm (client : Hermes.client) : output Lwt.t = 26 16 let params : params = {aud; exp; lxm} in 27 17 Hermes.query client nsid (params_to_yojson params) output_of_yojson 28 18 end 29 -
+11 -14
pegasus/lexicons/com_atproto_server_getSession.ml
··· 5 5 let nsid = "com.atproto.server.getSession" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = 11 - { 12 - handle: string; 13 - did: string; 14 - email: string option [@default None]; 15 - email_confirmed: bool option [@key "emailConfirmed"] [@default None]; 16 - email_auth_factor: bool option [@key "emailAuthFactor"] [@default None]; 17 - did_doc: Yojson.Safe.t option [@key "didDoc"] [@default None]; 18 - active: bool option [@default None]; 19 - status: string option [@default None]; 20 - } 21 - [@@deriving yojson {strict= false}] 12 + { handle: string 13 + ; did: string 14 + ; email: string option [@default None] 15 + ; email_confirmed: bool option [@key "emailConfirmed"] [@default None] 16 + ; email_auth_factor: bool option [@key "emailAuthFactor"] [@default None] 17 + ; did_doc: Yojson.Safe.t option [@key "didDoc"] [@default None] 18 + ; active: bool option [@default None] 19 + ; status: string option [@default None] } 20 + [@@deriving yojson {strict= false}] 22 21 23 - let call 24 - (client : Hermes.client) : output Lwt.t = 22 + let call (client : Hermes.client) : output Lwt.t = 25 23 Hermes.query client nsid (`Assoc []) output_of_yojson 26 24 end 27 -
+7 -13
pegasus/lexicons/com_atproto_server_listAppPasswords.ml
··· 1 1 (* generated from com.atproto.server.listAppPasswords *) 2 2 3 3 type app_password = 4 - { 5 - name: string; 6 - created_at: string [@key "createdAt"]; 7 - privileged: bool option [@default None]; 8 - } 4 + { name: string 5 + ; created_at: string [@key "createdAt"] 6 + ; privileged: bool option [@default None] } 9 7 [@@deriving yojson {strict= false}] 10 8 11 9 (** List all App Passwords. *) ··· 13 11 let nsid = "com.atproto.server.listAppPasswords" 14 12 15 13 type params = unit 14 + 16 15 let params_to_yojson () = `Assoc [] 17 16 18 - type output = 19 - { 20 - passwords: app_password list; 21 - } 22 - [@@deriving yojson {strict= false}] 17 + type output = {passwords: app_password list} 18 + [@@deriving yojson {strict= false}] 23 19 24 - let call 25 - (client : Hermes.client) : output Lwt.t = 20 + let call (client : Hermes.client) : output Lwt.t = 26 21 Hermes.query client nsid (`Assoc []) output_of_yojson 27 22 end 28 -
+12 -14
pegasus/lexicons/com_atproto_server_refreshSession.ml
··· 5 5 let nsid = "com.atproto.server.refreshSession" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = 11 - { 12 - access_jwt: string [@key "accessJwt"]; 13 - refresh_jwt: string [@key "refreshJwt"]; 14 - handle: string; 15 - did: string; 16 - did_doc: Yojson.Safe.t option [@key "didDoc"] [@default None]; 17 - active: bool option [@default None]; 18 - status: string option [@default None]; 19 - } 20 - [@@deriving yojson {strict= false}] 12 + { access_jwt: string [@key "accessJwt"] 13 + ; refresh_jwt: string [@key "refreshJwt"] 14 + ; handle: string 15 + ; did: string 16 + ; did_doc: Yojson.Safe.t option [@key "didDoc"] [@default None] 17 + ; active: bool option [@default None] 18 + ; status: string option [@default None] } 19 + [@@deriving yojson {strict= false}] 21 20 22 - let call 23 - (client : Hermes.client) : output Lwt.t = 21 + let call (client : Hermes.client) : output Lwt.t = 24 22 let params = () in 25 23 let input = None in 26 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 24 + Hermes.procedure client nsid (params_to_yojson params) input 25 + output_of_yojson 27 26 end 28 -
+5 -4
pegasus/lexicons/com_atproto_server_requestAccountDelete.ml
··· 5 5 let nsid = "com.atproto.server.requestAccountDelete" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = unit 12 + 11 13 let output_of_yojson _ = Ok () 12 14 13 - let call 14 - (client : Hermes.client) : output Lwt.t = 15 + let call (client : Hermes.client) : output Lwt.t = 15 16 let params = () in 16 17 let input = None in 17 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 18 + Hermes.procedure client nsid (params_to_yojson params) input 19 + output_of_yojson 18 20 end 19 -
+5 -4
pegasus/lexicons/com_atproto_server_requestEmailConfirmation.ml
··· 5 5 let nsid = "com.atproto.server.requestEmailConfirmation" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = unit 12 + 11 13 let output_of_yojson _ = Ok () 12 14 13 - let call 14 - (client : Hermes.client) : output Lwt.t = 15 + let call (client : Hermes.client) : output Lwt.t = 15 16 let params = () in 16 17 let input = None in 17 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 18 + Hermes.procedure client nsid (params_to_yojson params) input 19 + output_of_yojson 18 20 end 19 -
+6 -9
pegasus/lexicons/com_atproto_server_requestEmailUpdate.ml
··· 5 5 let nsid = "com.atproto.server.requestEmailUpdate" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type output = 11 - { 12 - token_required: bool [@key "tokenRequired"]; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type output = {token_required: bool [@key "tokenRequired"]} 12 + [@@deriving yojson {strict= false}] 15 13 16 - let call 17 - (client : Hermes.client) : output Lwt.t = 14 + let call (client : Hermes.client) : output Lwt.t = 18 15 let params = () in 19 16 let input = None in 20 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 17 + Hermes.procedure client nsid (params_to_yojson params) input 18 + output_of_yojson 21 19 end 22 -
+6 -10
pegasus/lexicons/com_atproto_server_requestPasswordReset.ml
··· 5 5 let nsid = "com.atproto.server.requestPasswordReset" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - email: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {email: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~email 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~email (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({email} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+7 -14
pegasus/lexicons/com_atproto_server_reserveSigningKey.ml
··· 5 5 let nsid = "com.atproto.server.reserveSigningKey" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - did: string option [@default None]; 13 - } 11 + type input = {did: string option [@default None]} 14 12 [@@deriving yojson {strict= false}] 15 13 16 - type output = 17 - { 18 - signing_key: string [@key "signingKey"]; 19 - } 20 - [@@deriving yojson {strict= false}] 14 + type output = {signing_key: string [@key "signingKey"]} 15 + [@@deriving yojson {strict= false}] 21 16 22 - let call 23 - ?did 24 - (client : Hermes.client) : output Lwt.t = 17 + let call ?did (client : Hermes.client) : output Lwt.t = 25 18 let params = () in 26 19 let input = Some ({did} |> input_to_yojson) in 27 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 28 22 end 29 -
+6 -11
pegasus/lexicons/com_atproto_server_resetPassword.ml
··· 5 5 let nsid = "com.atproto.server.resetPassword" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - token: string; 13 - password: string; 14 - } 11 + type input = {token: string; password: string} 15 12 [@@deriving yojson {strict= false}] 16 13 17 14 type output = unit 15 + 18 16 let output_of_yojson _ = Ok () 19 17 20 - let call 21 - ~token 22 - ~password 23 - (client : Hermes.client) : output Lwt.t = 18 + let call ~token ~password (client : Hermes.client) : output Lwt.t = 24 19 let params = () in 25 20 let input = Some ({token; password} |> input_to_yojson) in 26 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 27 23 end 28 -
+6 -10
pegasus/lexicons/com_atproto_server_revokeAppPassword.ml
··· 5 5 let nsid = "com.atproto.server.revokeAppPassword" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - name: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {name: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~name 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~name (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({name} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+9 -12
pegasus/lexicons/com_atproto_server_updateEmail.ml
··· 5 5 let nsid = "com.atproto.server.updateEmail" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type input = 11 - { 12 - email: string; 13 - email_auth_factor: bool option [@key "emailAuthFactor"] [@default None]; 14 - token: string option [@default None]; 15 - } 12 + { email: string 13 + ; email_auth_factor: bool option [@key "emailAuthFactor"] [@default None] 14 + ; token: string option [@default None] } 16 15 [@@deriving yojson {strict= false}] 17 16 18 17 type output = unit 18 + 19 19 let output_of_yojson _ = Ok () 20 20 21 - let call 22 - ~email 23 - ?email_auth_factor 24 - ?token 25 - (client : Hermes.client) : output Lwt.t = 21 + let call ~email ?email_auth_factor ?token (client : Hermes.client) : 22 + output Lwt.t = 26 23 let params = () in 27 24 let input = Some ({email; email_auth_factor; token} |> input_to_yojson) in 28 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + Hermes.procedure client nsid (params_to_yojson params) input 26 + output_of_yojson 29 27 end 30 -
+6 -3
pegasus/lexicons/com_atproto_sync_defs.ml
··· 2 2 3 3 (** string type with known values *) 4 4 type host_status = string 5 + 5 6 let host_status_of_yojson = function 6 - | `String s -> Ok s 7 - | _ -> Error "host_status: expected string" 8 - let host_status_to_yojson s = `String s 7 + | `String s -> 8 + Ok s 9 + | _ -> 10 + Error "host_status: expected string" 9 11 12 + let host_status_to_yojson s = `String s
+2 -11
pegasus/lexicons/com_atproto_sync_getBlob.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.sync.getBlob" 6 6 7 - type params = 8 - { 9 - did: string; 10 - cid: string; 11 - } 12 - [@@deriving yojson {strict= false}] 7 + type params = {did: string; cid: string} [@@deriving yojson {strict= false}] 13 8 14 9 (** raw bytes output with content type *) 15 10 type output = bytes * string 16 11 17 - let call 18 - ~did 19 - ~cid 20 - (client : Hermes.client) : output Lwt.t = 12 + let call ~did ~cid (client : Hermes.client) : output Lwt.t = 21 13 let params : params = {did; cid} in 22 14 Hermes.query_bytes client nsid (params_to_yojson params) 23 15 end 24 -
+6 -10
pegasus/lexicons/com_atproto_sync_getBlocks.ml
··· 5 5 let nsid = "com.atproto.sync.getBlocks" 6 6 7 7 type params = 8 - { 9 - did: string; 10 - cids: string list [@of_yojson Hermes_util.query_string_list_of_yojson] [@to_yojson Hermes_util.query_string_list_to_yojson]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + { did: string 9 + ; cids: string list 10 + [@of_yojson Hermes_util.query_string_list_of_yojson] 11 + [@to_yojson Hermes_util.query_string_list_to_yojson] } 12 + [@@deriving yojson {strict= false}] 13 13 14 14 (** raw bytes output with content type *) 15 15 type output = bytes * string 16 16 17 - let call 18 - ~did 19 - ~cids 20 - (client : Hermes.client) : output Lwt.t = 17 + let call ~did ~cids (client : Hermes.client) : output Lwt.t = 21 18 let params : params = {did; cids} in 22 19 Hermes.query_bytes client nsid (params_to_yojson params) 23 20 end 24 -
+2 -9
pegasus/lexicons/com_atproto_sync_getCheckout.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.sync.getCheckout" 6 6 7 - type params = 8 - { 9 - did: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {did: string} [@@deriving yojson {strict= false}] 12 8 13 9 (** raw bytes output with content type *) 14 10 type output = bytes * string 15 11 16 - let call 17 - ~did 18 - (client : Hermes.client) : output Lwt.t = 12 + let call ~did (client : Hermes.client) : output Lwt.t = 19 13 let params : params = {did} in 20 14 Hermes.query_bytes client nsid (params_to_yojson params) 21 15 end 22 -
+3 -14
pegasus/lexicons/com_atproto_sync_getHead.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.sync.getHead" 6 6 7 - type params = 8 - { 9 - did: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {did: string} [@@deriving yojson {strict= false}] 12 8 13 - type output = 14 - { 15 - root: string; 16 - } 17 - [@@deriving yojson {strict= false}] 9 + type output = {root: string} [@@deriving yojson {strict= false}] 18 10 19 - let call 20 - ~did 21 - (client : Hermes.client) : output Lwt.t = 11 + let call ~did (client : Hermes.client) : output Lwt.t = 22 12 let params : params = {did} in 23 13 Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 14 end 25 -
+7 -16
pegasus/lexicons/com_atproto_sync_getHostStatus.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.sync.getHostStatus" 6 6 7 - type params = 8 - { 9 - hostname: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {hostname: string} [@@deriving yojson {strict= false}] 12 8 13 9 type output = 14 - { 15 - hostname: string; 16 - seq: int option [@default None]; 17 - account_count: int option [@key "accountCount"] [@default None]; 18 - status: Com_atproto_sync_defs.host_status option [@default None]; 19 - } 20 - [@@deriving yojson {strict= false}] 10 + { hostname: string 11 + ; seq: int option [@default None] 12 + ; account_count: int option [@key "accountCount"] [@default None] 13 + ; status: Com_atproto_sync_defs.host_status option [@default None] } 14 + [@@deriving yojson {strict= false}] 21 15 22 - let call 23 - ~hostname 24 - (client : Hermes.client) : output Lwt.t = 16 + let call ~hostname (client : Hermes.client) : output Lwt.t = 25 17 let params : params = {hostname} in 26 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 19 end 28 -
+3 -15
pegasus/lexicons/com_atproto_sync_getLatestCommit.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.sync.getLatestCommit" 6 6 7 - type params = 8 - { 9 - did: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {did: string} [@@deriving yojson {strict= false}] 12 8 13 - type output = 14 - { 15 - cid: string; 16 - rev: string; 17 - } 18 - [@@deriving yojson {strict= false}] 9 + type output = {cid: string; rev: string} [@@deriving yojson {strict= false}] 19 10 20 - let call 21 - ~did 22 - (client : Hermes.client) : output Lwt.t = 11 + let call ~did (client : Hermes.client) : output Lwt.t = 23 12 let params : params = {did} in 24 13 Hermes.query client nsid (params_to_yojson params) output_of_yojson 25 14 end 26 -
+3 -13
pegasus/lexicons/com_atproto_sync_getRecord.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.sync.getRecord" 6 6 7 - type params = 8 - { 9 - did: string; 10 - collection: string; 11 - rkey: string; 12 - } 13 - [@@deriving yojson {strict= false}] 7 + type params = {did: string; collection: string; rkey: string} 8 + [@@deriving yojson {strict= false}] 14 9 15 10 (** raw bytes output with content type *) 16 11 type output = bytes * string 17 12 18 - let call 19 - ~did 20 - ~collection 21 - ~rkey 22 - (client : Hermes.client) : output Lwt.t = 13 + let call ~did ~collection ~rkey (client : Hermes.client) : output Lwt.t = 23 14 let params : params = {did; collection; rkey} in 24 15 Hermes.query_bytes client nsid (params_to_yojson params) 25 16 end 26 -
+3 -11
pegasus/lexicons/com_atproto_sync_getRepo.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.sync.getRepo" 6 6 7 - type params = 8 - { 9 - did: string; 10 - since: string option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 7 + type params = {did: string; since: string option [@default None]} 8 + [@@deriving yojson {strict= false}] 13 9 14 10 (** raw bytes output with content type *) 15 11 type output = bytes * string 16 12 17 - let call 18 - ~did 19 - ?since 20 - (client : Hermes.client) : output Lwt.t = 13 + let call ~did ?since (client : Hermes.client) : output Lwt.t = 21 14 let params : params = {did; since} in 22 15 Hermes.query_bytes client nsid (params_to_yojson params) 23 16 end 24 -
+7 -16
pegasus/lexicons/com_atproto_sync_getRepoStatus.ml
··· 4 4 module Main = struct 5 5 let nsid = "com.atproto.sync.getRepoStatus" 6 6 7 - type params = 8 - { 9 - did: string; 10 - } 11 - [@@deriving yojson {strict= false}] 7 + type params = {did: string} [@@deriving yojson {strict= false}] 12 8 13 9 type output = 14 - { 15 - did: string; 16 - active: bool; 17 - status: string option [@default None]; 18 - rev: string option [@default None]; 19 - } 20 - [@@deriving yojson {strict= false}] 10 + { did: string 11 + ; active: bool 12 + ; status: string option [@default None] 13 + ; rev: string option [@default None] } 14 + [@@deriving yojson {strict= false}] 21 15 22 - let call 23 - ~did 24 - (client : Hermes.client) : output Lwt.t = 16 + let call ~did (client : Hermes.client) : output Lwt.t = 25 17 let params : params = {did} in 26 18 Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 19 end 28 -
+8 -20
pegasus/lexicons/com_atproto_sync_listBlobs.ml
··· 5 5 let nsid = "com.atproto.sync.listBlobs" 6 6 7 7 type params = 8 - { 9 - did: string; 10 - since: string option [@default None]; 11 - limit: int option [@default None]; 12 - cursor: string option [@default None]; 13 - } 14 - [@@deriving yojson {strict= false}] 8 + { did: string 9 + ; since: string option [@default None] 10 + ; limit: int option [@default None] 11 + ; cursor: string option [@default None] } 12 + [@@deriving yojson {strict= false}] 15 13 16 - type output = 17 - { 18 - cursor: string option [@default None]; 19 - cids: string list; 20 - } 21 - [@@deriving yojson {strict= false}] 14 + type output = {cursor: string option [@default None]; cids: string list} 15 + [@@deriving yojson {strict= false}] 22 16 23 - let call 24 - ~did 25 - ?since 26 - ?limit 27 - ?cursor 28 - (client : Hermes.client) : output Lwt.t = 17 + let call ~did ?since ?limit ?cursor (client : Hermes.client) : output Lwt.t = 29 18 let params : params = {did; since; limit; cursor} in 30 19 Hermes.query client nsid (params_to_yojson params) output_of_yojson 31 20 end 32 -
+9 -22
pegasus/lexicons/com_atproto_sync_listHosts.ml
··· 1 1 (* generated from com.atproto.sync.listHosts *) 2 2 3 3 type host = 4 - { 5 - hostname: string; 6 - seq: int option [@default None]; 7 - account_count: int option [@key "accountCount"] [@default None]; 8 - status: Com_atproto_sync_defs.host_status option [@default None]; 9 - } 4 + { hostname: string 5 + ; seq: int option [@default None] 6 + ; account_count: int option [@key "accountCount"] [@default None] 7 + ; status: Com_atproto_sync_defs.host_status option [@default None] } 10 8 [@@deriving yojson {strict= false}] 11 9 12 10 (** Enumerates upstream hosts (eg, PDS or relay instances) that this service consumes from. Implemented by relays. *) ··· 14 12 let nsid = "com.atproto.sync.listHosts" 15 13 16 14 type params = 17 - { 18 - limit: int option [@default None]; 19 - cursor: string option [@default None]; 20 - } 21 - [@@deriving yojson {strict= false}] 15 + {limit: int option [@default None]; cursor: string option [@default None]} 16 + [@@deriving yojson {strict= false}] 22 17 23 - type output = 24 - { 25 - cursor: string option [@default None]; 26 - hosts: host list; 27 - } 28 - [@@deriving yojson {strict= false}] 18 + type output = {cursor: string option [@default None]; hosts: host list} 19 + [@@deriving yojson {strict= false}] 29 20 30 - let call 31 - ?limit 32 - ?cursor 33 - (client : Hermes.client) : output Lwt.t = 21 + let call ?limit ?cursor (client : Hermes.client) : output Lwt.t = 34 22 let params : params = {limit; cursor} in 35 23 Hermes.query client nsid (params_to_yojson params) output_of_yojson 36 24 end 37 -
+10 -23
pegasus/lexicons/com_atproto_sync_listRepos.ml
··· 1 1 (* generated from com.atproto.sync.listRepos *) 2 2 3 3 type repo = 4 - { 5 - did: string; 6 - head: string; 7 - rev: string; 8 - active: bool option [@default None]; 9 - status: string option [@default None]; 10 - } 4 + { did: string 5 + ; head: string 6 + ; rev: string 7 + ; active: bool option [@default None] 8 + ; status: string option [@default None] } 11 9 [@@deriving yojson {strict= false}] 12 10 13 11 (** Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay. *) ··· 15 13 let nsid = "com.atproto.sync.listRepos" 16 14 17 15 type params = 18 - { 19 - limit: int option [@default None]; 20 - cursor: string option [@default None]; 21 - } 22 - [@@deriving yojson {strict= false}] 16 + {limit: int option [@default None]; cursor: string option [@default None]} 17 + [@@deriving yojson {strict= false}] 23 18 24 - type output = 25 - { 26 - cursor: string option [@default None]; 27 - repos: repo list; 28 - } 29 - [@@deriving yojson {strict= false}] 19 + type output = {cursor: string option [@default None]; repos: repo list} 20 + [@@deriving yojson {strict= false}] 30 21 31 - let call 32 - ?limit 33 - ?cursor 34 - (client : Hermes.client) : output Lwt.t = 22 + let call ?limit ?cursor (client : Hermes.client) : output Lwt.t = 35 23 let params : params = {limit; cursor} in 36 24 Hermes.query client nsid (params_to_yojson params) output_of_yojson 37 25 end 38 -
+8 -23
pegasus/lexicons/com_atproto_sync_listReposByCollection.ml
··· 1 1 (* generated from com.atproto.sync.listReposByCollection *) 2 2 3 - type repo = 4 - { 5 - did: string; 6 - } 7 - [@@deriving yojson {strict= false}] 3 + type repo = {did: string} [@@deriving yojson {strict= false}] 8 4 9 5 (** Enumerates all the DIDs which have records with the given collection NSID. *) 10 6 module Main = struct 11 7 let nsid = "com.atproto.sync.listReposByCollection" 12 8 13 9 type params = 14 - { 15 - collection: string; 16 - limit: int option [@default None]; 17 - cursor: string option [@default None]; 18 - } 19 - [@@deriving yojson {strict= false}] 10 + { collection: string 11 + ; limit: int option [@default None] 12 + ; cursor: string option [@default None] } 13 + [@@deriving yojson {strict= false}] 20 14 21 - type output = 22 - { 23 - cursor: string option [@default None]; 24 - repos: repo list; 25 - } 26 - [@@deriving yojson {strict= false}] 15 + type output = {cursor: string option [@default None]; repos: repo list} 16 + [@@deriving yojson {strict= false}] 27 17 28 - let call 29 - ~collection 30 - ?limit 31 - ?cursor 32 - (client : Hermes.client) : output Lwt.t = 18 + let call ~collection ?limit ?cursor (client : Hermes.client) : output Lwt.t = 33 19 let params : params = {collection; limit; cursor} in 34 20 Hermes.query client nsid (params_to_yojson params) output_of_yojson 35 21 end 36 -
+6 -10
pegasus/lexicons/com_atproto_sync_notifyOfUpdate.ml
··· 5 5 let nsid = "com.atproto.sync.notifyOfUpdate" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - hostname: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {hostname: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~hostname 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~hostname (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({hostname} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+6 -10
pegasus/lexicons/com_atproto_sync_requestCrawl.ml
··· 5 5 let nsid = "com.atproto.sync.requestCrawl" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - hostname: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {hostname: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~hostname 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~hostname (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({hostname} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+9 -12
pegasus/lexicons/com_atproto_temp_addReservedHandle.ml
··· 5 5 let nsid = "com.atproto.temp.addReservedHandle" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - handle: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {handle: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 17 - let output_of_yojson _ = Ok () 18 - let output_to_yojson () = `Assoc [] 14 + 15 + let output_of_yojson _ = Ok () 16 + 17 + let output_to_yojson () = `Assoc [] 19 18 20 - let call 21 - ~handle 22 - (client : Hermes.client) : output Lwt.t = 19 + let call ~handle (client : Hermes.client) : output Lwt.t = 23 20 let params = () in 24 21 let input = Some ({handle} |> input_to_yojson) in 25 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 22 + Hermes.procedure client nsid (params_to_yojson params) input 23 + output_of_yojson 26 24 end 27 -
+57 -54
pegasus/lexicons/com_atproto_temp_checkHandleAvailability.ml
··· 1 1 (* generated from com.atproto.temp.checkHandleAvailability *) 2 2 3 - type suggestion = 4 - { 5 - handle: string; 6 - method_: string [@key "method"]; 7 - } 3 + type suggestion = {handle: string; method_: string [@key "method"]} 8 4 [@@deriving yojson {strict= false}] 9 5 10 - type result_unavailable = 11 - { 12 - suggestions: suggestion list; 13 - } 6 + type result_unavailable = {suggestions: suggestion list} 14 7 [@@deriving yojson {strict= false}] 15 8 16 9 type result_available = unit 10 + 17 11 let result_available_of_yojson _ = Ok () 12 + 18 13 let result_available_to_yojson () = `Assoc [] 19 14 20 15 (** Checks whether the provided handle is available. If the handle is not available, available suggestions will be returned. Optional inputs will be used to generate suggestions. *) ··· 22 17 let nsid = "com.atproto.temp.checkHandleAvailability" 23 18 24 19 type params = 25 - { 26 - handle: string; 27 - email: string option [@default None]; 28 - birth_date: string option [@key "birthDate"] [@default None]; 29 - } 30 - [@@deriving yojson {strict= false}] 20 + { handle: string 21 + ; email: string option [@default None] 22 + ; birth_date: string option [@key "birthDate"] [@default None] } 23 + [@@deriving yojson {strict= false}] 31 24 32 25 type result_ = 33 - | ResultAvailable of result_available 34 - | ResultUnavailable of result_unavailable 35 - | Unknown of Yojson.Safe.t 26 + | ResultAvailable of result_available 27 + | ResultUnavailable of result_unavailable 28 + | Unknown of Yojson.Safe.t 36 29 37 - let result__of_yojson json = 38 - let open Yojson.Safe.Util in 39 - try 40 - match json |> member "$type" |> to_string with 41 - | "com.atproto.temp.checkHandleAvailability#resultAvailable" -> 42 - (match result_available_of_yojson json with 43 - | Ok v -> Ok (ResultAvailable v) 44 - | Error e -> Error e) 45 - | "com.atproto.temp.checkHandleAvailability#resultUnavailable" -> 46 - (match result_unavailable_of_yojson json with 47 - | Ok v -> Ok (ResultUnavailable v) 48 - | Error e -> Error e) 49 - | _ -> Ok (Unknown json) 50 - with _ -> Error "failed to parse union" 30 + let result__of_yojson json = 31 + let open Yojson.Safe.Util in 32 + try 33 + match json |> member "$type" |> to_string with 34 + | "com.atproto.temp.checkHandleAvailability#resultAvailable" -> ( 35 + match result_available_of_yojson json with 36 + | Ok v -> 37 + Ok (ResultAvailable v) 38 + | Error e -> 39 + Error e ) 40 + | "com.atproto.temp.checkHandleAvailability#resultUnavailable" -> ( 41 + match result_unavailable_of_yojson json with 42 + | Ok v -> 43 + Ok (ResultUnavailable v) 44 + | Error e -> 45 + Error e ) 46 + | _ -> 47 + Ok (Unknown json) 48 + with _ -> Error "failed to parse union" 51 49 52 - let result__to_yojson = function 53 - | ResultAvailable v -> 54 - (match result_available_to_yojson v with 55 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.temp.checkHandleAvailability#resultAvailable") :: fields) 56 - | other -> other) 57 - | ResultUnavailable v -> 58 - (match result_unavailable_to_yojson v with 59 - | `Assoc fields -> `Assoc (("$type", `String "com.atproto.temp.checkHandleAvailability#resultUnavailable") :: fields) 60 - | other -> other) 61 - | Unknown j -> j 50 + let result__to_yojson = function 51 + | ResultAvailable v -> ( 52 + match result_available_to_yojson v with 53 + | `Assoc fields -> 54 + `Assoc 55 + ( ( "$type" 56 + , `String 57 + "com.atproto.temp.checkHandleAvailability#resultAvailable" ) 58 + :: fields ) 59 + | other -> 60 + other ) 61 + | ResultUnavailable v -> ( 62 + match result_unavailable_to_yojson v with 63 + | `Assoc fields -> 64 + `Assoc 65 + ( ( "$type" 66 + , `String 67 + "com.atproto.temp.checkHandleAvailability#resultUnavailable" 68 + ) 69 + :: fields ) 70 + | other -> 71 + other ) 72 + | Unknown j -> 73 + j 62 74 63 - type output = 64 - { 65 - handle: string; 66 - result_: result_ [@key "result"]; 67 - } 68 - [@@deriving yojson {strict= false}] 75 + type output = {handle: string; result_: result_ [@key "result"]} 76 + [@@deriving yojson {strict= false}] 69 77 70 - let call 71 - ~handle 72 - ?email 73 - ?birth_date 74 - (client : Hermes.client) : output Lwt.t = 78 + let call ~handle ?email ?birth_date (client : Hermes.client) : output Lwt.t = 75 79 let params : params = {handle; email; birth_date} in 76 80 Hermes.query client nsid (params_to_yojson params) output_of_yojson 77 81 end 78 -
+6 -9
pegasus/lexicons/com_atproto_temp_checkSignupQueue.ml
··· 5 5 let nsid = "com.atproto.temp.checkSignupQueue" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 11 type output = 11 - { 12 - activated: bool; 13 - place_in_queue: int option [@key "placeInQueue"] [@default None]; 14 - estimated_time_ms: int option [@key "estimatedTimeMs"] [@default None]; 15 - } 16 - [@@deriving yojson {strict= false}] 12 + { activated: bool 13 + ; place_in_queue: int option [@key "placeInQueue"] [@default None] 14 + ; estimated_time_ms: int option [@key "estimatedTimeMs"] [@default None] } 15 + [@@deriving yojson {strict= false}] 17 16 18 - let call 19 - (client : Hermes.client) : output Lwt.t = 17 + let call (client : Hermes.client) : output Lwt.t = 20 18 Hermes.query client nsid (`Assoc []) output_of_yojson 21 19 end 22 -
+5 -15
pegasus/lexicons/com_atproto_temp_fetchLabels.ml
··· 5 5 let nsid = "com.atproto.temp.fetchLabels" 6 6 7 7 type params = 8 - { 9 - since: int option [@default None]; 10 - limit: int option [@default None]; 11 - } 12 - [@@deriving yojson {strict= false}] 8 + {since: int option [@default None]; limit: int option [@default None]} 9 + [@@deriving yojson {strict= false}] 13 10 14 - type output = 15 - { 16 - labels: Com_atproto_label_defs.label list; 17 - } 18 - [@@deriving yojson {strict= false}] 11 + type output = {labels: Com_atproto_label_defs.label list} 12 + [@@deriving yojson {strict= false}] 19 13 20 - let call 21 - ?since 22 - ?limit 23 - (client : Hermes.client) : output Lwt.t = 14 + let call ?since ?limit (client : Hermes.client) : output Lwt.t = 24 15 let params : params = {since; limit} in 25 16 Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 17 end 27 -
+6 -9
pegasus/lexicons/com_atproto_temp_requestPhoneVerification.ml
··· 5 5 let nsid = "com.atproto.temp.requestPhoneVerification" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - phone_number: string [@key "phoneNumber"]; 13 - } 11 + type input = {phone_number: string [@key "phoneNumber"]} 14 12 [@@deriving yojson {strict= false}] 15 13 16 14 type output = unit 15 + 17 16 let output_of_yojson _ = Ok () 18 17 19 - let call 20 - ~phone_number 21 - (client : Hermes.client) : output Lwt.t = 18 + let call ~phone_number (client : Hermes.client) : output Lwt.t = 22 19 let params = () in 23 20 let input = Some ({phone_number} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + Hermes.procedure client nsid (params_to_yojson params) input 22 + output_of_yojson 25 23 end 26 -
+6 -10
pegasus/lexicons/com_atproto_temp_revokeAccountCredentials.ml
··· 5 5 let nsid = "com.atproto.temp.revokeAccountCredentials" 6 6 7 7 type params = unit 8 + 8 9 let params_to_yojson () = `Assoc [] 9 10 10 - type input = 11 - { 12 - account: string; 13 - } 14 - [@@deriving yojson {strict= false}] 11 + type input = {account: string} [@@deriving yojson {strict= false}] 15 12 16 13 type output = unit 14 + 17 15 let output_of_yojson _ = Ok () 18 16 19 - let call 20 - ~account 21 - (client : Hermes.client) : output Lwt.t = 17 + let call ~account (client : Hermes.client) : output Lwt.t = 22 18 let params = () in 23 19 let input = Some ({account} |> input_to_yojson) in 24 - Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 20 + Hermes.procedure client nsid (params_to_yojson params) input 21 + output_of_yojson 25 22 end 26 -
+2 -1
pegasus/lexicons/dune
··· 1 1 (library 2 2 (name lexicons) 3 3 (libraries hermes yojson lwt) 4 - (preprocess (pps ppx_deriving_yojson))) 4 + (preprocess 5 + (pps ppx_deriving_yojson)))
+1 -1
pegasus/lexicons/hermes_util.ml
··· 54 54 | Some l -> 55 55 `List (List.map (fun i -> `Int i) l) 56 56 | None -> 57 - `Null 57 + `Null
+47 -15
pegasus/lexicons/lexicons.ml
··· 8 8 module GetJobStatus = App_bsky_video_getJobStatus 9 9 module GetUploadLimits = App_bsky_video_getUploadLimits 10 10 end 11 + 11 12 module Embed = struct 12 13 module Defs = App_bsky_embed_defs 13 14 module Record = App_bsky_embed_record ··· 16 17 module Video = App_bsky_embed_video 17 18 module External = App_bsky_embed_external 18 19 end 20 + 19 21 module Notification = struct 20 22 module Defs = App_bsky_notification_defs 21 23 module RegisterPush = App_bsky_notification_registerPush 22 24 module PutPreferences = App_bsky_notification_putPreferences 23 - module PutActivitySubscription = App_bsky_notification_putActivitySubscription 25 + module PutActivitySubscription = 26 + App_bsky_notification_putActivitySubscription 24 27 module Declaration = App_bsky_notification_declaration 25 28 module PutPreferencesV2 = App_bsky_notification_putPreferencesV2 26 29 module UpdateSeen = App_bsky_notification_updateSeen 27 - module ListActivitySubscriptions = App_bsky_notification_listActivitySubscriptions 30 + module ListActivitySubscriptions = 31 + App_bsky_notification_listActivitySubscriptions 28 32 module UnregisterPush = App_bsky_notification_unregisterPush 29 33 module GetPreferences = App_bsky_notification_getPreferences 30 34 module ListNotifications = App_bsky_notification_listNotifications 31 35 module GetUnreadCount = App_bsky_notification_getUnreadCount 32 36 end 37 + 33 38 module Unspecced = struct 34 - module GetSuggestedFeedsSkeleton = App_bsky_unspecced_getSuggestedFeedsSkeleton 35 - module SearchStarterPacksSkeleton = App_bsky_unspecced_searchStarterPacksSkeleton 39 + module GetSuggestedFeedsSkeleton = 40 + App_bsky_unspecced_getSuggestedFeedsSkeleton 41 + module SearchStarterPacksSkeleton = 42 + App_bsky_unspecced_searchStarterPacksSkeleton 36 43 module Defs = App_bsky_unspecced_defs 37 44 module GetSuggestedUsers = App_bsky_unspecced_getSuggestedUsers 38 45 module GetPostThreadOtherV2 = App_bsky_unspecced_getPostThreadOtherV2 39 - module GetSuggestedStarterPacks = App_bsky_unspecced_getSuggestedStarterPacks 40 - module GetSuggestedStarterPacksSkeleton = App_bsky_unspecced_getSuggestedStarterPacksSkeleton 41 - module GetSuggestedUsersSkeleton = App_bsky_unspecced_getSuggestedUsersSkeleton 46 + module GetSuggestedStarterPacks = 47 + App_bsky_unspecced_getSuggestedStarterPacks 48 + module GetSuggestedStarterPacksSkeleton = 49 + App_bsky_unspecced_getSuggestedStarterPacksSkeleton 50 + module GetSuggestedUsersSkeleton = 51 + App_bsky_unspecced_getSuggestedUsersSkeleton 42 52 module GetPostThreadV2 = App_bsky_unspecced_getPostThreadV2 43 53 module GetTrends = App_bsky_unspecced_getTrends 44 54 module SearchActorsSkeleton = App_bsky_unspecced_searchActorsSkeleton 45 55 module GetSuggestionsSkeleton = App_bsky_unspecced_getSuggestionsSkeleton 46 56 module SearchPostsSkeleton = App_bsky_unspecced_searchPostsSkeleton 47 57 module GetAgeAssuranceState = App_bsky_unspecced_getAgeAssuranceState 48 - module GetPopularFeedGenerators = App_bsky_unspecced_getPopularFeedGenerators 58 + module GetPopularFeedGenerators = 59 + App_bsky_unspecced_getPopularFeedGenerators 49 60 module InitAgeAssurance = App_bsky_unspecced_initAgeAssurance 50 61 module GetTrendingTopics = App_bsky_unspecced_getTrendingTopics 51 62 module GetTaggedSuggestions = App_bsky_unspecced_getTaggedSuggestions ··· 53 64 module GetTrendsSkeleton = App_bsky_unspecced_getTrendsSkeleton 54 65 module GetConfig = App_bsky_unspecced_getConfig 55 66 end 67 + 56 68 module Graph = struct 57 69 module GetStarterPacks = App_bsky_graph_getStarterPacks 58 - module GetSuggestedFollowsByActor = App_bsky_graph_getSuggestedFollowsByActor 70 + module GetSuggestedFollowsByActor = 71 + App_bsky_graph_getSuggestedFollowsByActor 59 72 module Block = App_bsky_graph_block 60 - module GetStarterPacksWithMembership = App_bsky_graph_getStarterPacksWithMembership 73 + module GetStarterPacksWithMembership = 74 + App_bsky_graph_getStarterPacksWithMembership 61 75 module Follow = App_bsky_graph_follow 62 76 module Defs = App_bsky_graph_defs 63 77 module GetListsWithMembership = App_bsky_graph_getListsWithMembership ··· 86 100 module UnmuteActor = App_bsky_graph_unmuteActor 87 101 module GetList = App_bsky_graph_getList 88 102 end 103 + 89 104 module Feed = struct 90 105 module Generator = App_bsky_feed_generator 91 106 module SendInteractions = App_bsky_feed_sendInteractions ··· 113 128 module GetActorFeeds = App_bsky_feed_getActorFeeds 114 129 module Post = App_bsky_feed_post 115 130 end 131 + 116 132 module Richtext = struct 117 133 module Facet = App_bsky_richtext_facet 118 134 end 135 + 119 136 module Actor = struct 120 137 module SearchActorsTypeahead = App_bsky_actor_searchActorsTypeahead 121 138 module Defs = App_bsky_actor_defs ··· 128 145 module GetPreferences = App_bsky_actor_getPreferences 129 146 module Profile = App_bsky_actor_profile 130 147 end 148 + 131 149 module Labeler = struct 132 150 module Defs = App_bsky_labeler_defs 133 151 module Service = App_bsky_labeler_service ··· 135 153 end 136 154 end 137 155 end 156 + 138 157 module Com = struct 139 158 module Atproto = struct 140 159 module Temp = struct 141 160 module AddReservedHandle = Com_atproto_temp_addReservedHandle 142 161 module CheckSignupQueue = Com_atproto_temp_checkSignupQueue 143 162 module CheckHandleAvailability = Com_atproto_temp_checkHandleAvailability 144 - module RequestPhoneVerification = Com_atproto_temp_requestPhoneVerification 145 - module RevokeAccountCredentials = Com_atproto_temp_revokeAccountCredentials 163 + module RequestPhoneVerification = 164 + Com_atproto_temp_requestPhoneVerification 165 + module RevokeAccountCredentials = 166 + Com_atproto_temp_revokeAccountCredentials 146 167 module FetchLabels = Com_atproto_temp_fetchLabels 147 168 end 169 + 148 170 module Identity = struct 149 171 module UpdateHandle = Com_atproto_identity_updateHandle 150 172 module Defs = Com_atproto_identity_defs ··· 153 175 module ResolveIdentity = Com_atproto_identity_resolveIdentity 154 176 module RefreshIdentity = Com_atproto_identity_refreshIdentity 155 177 module ResolveHandle = Com_atproto_identity_resolveHandle 156 - module RequestPlcOperationSignature = Com_atproto_identity_requestPlcOperationSignature 157 - module GetRecommendedDidCredentials = Com_atproto_identity_getRecommendedDidCredentials 178 + module RequestPlcOperationSignature = 179 + Com_atproto_identity_requestPlcOperationSignature 180 + module GetRecommendedDidCredentials = 181 + Com_atproto_identity_getRecommendedDidCredentials 158 182 module ResolveDid = Com_atproto_identity_resolveDid 159 183 end 184 + 160 185 module Admin = struct 161 186 module UpdateAccountEmail = Com_atproto_admin_updateAccountEmail 162 187 module GetAccountInfo = Com_atproto_admin_getAccountInfo ··· 175 200 module GetAccountInfos = Com_atproto_admin_getAccountInfos 176 201 module DeleteAccount = Com_atproto_admin_deleteAccount 177 202 end 203 + 178 204 module Label = struct 179 205 module Defs = Com_atproto_label_defs 180 206 module QueryLabels = Com_atproto_label_queryLabels 181 207 end 208 + 182 209 module Server = struct 183 - module RequestEmailConfirmation = Com_atproto_server_requestEmailConfirmation 210 + module RequestEmailConfirmation = 211 + Com_atproto_server_requestEmailConfirmation 184 212 module ReserveSigningKey = Com_atproto_server_reserveSigningKey 185 213 module Defs = Com_atproto_server_defs 186 214 module GetServiceAuth = Com_atproto_server_getServiceAuth ··· 207 235 module DeleteAccount = Com_atproto_server_deleteAccount 208 236 module CreateInviteCode = Com_atproto_server_createInviteCode 209 237 end 238 + 210 239 module Lexicon = struct 211 240 module Schema = Com_atproto_lexicon_schema 212 241 end 242 + 213 243 module Sync = struct 214 244 module GetHead = Com_atproto_sync_getHead 215 245 module GetBlob = Com_atproto_sync_getBlob ··· 228 258 module ListReposByCollection = Com_atproto_sync_listReposByCollection 229 259 module GetCheckout = Com_atproto_sync_getCheckout 230 260 end 261 + 231 262 module Repo = struct 232 263 module StrongRef = Com_atproto_repo_strongRef 233 264 module Defs = Com_atproto_repo_defs ··· 242 273 module ApplyWrites = Com_atproto_repo_applyWrites 243 274 module ListRecords = Com_atproto_repo_listRecords 244 275 end 276 + 245 277 module Moderation = struct 246 278 module Defs = Com_atproto_moderation_defs 247 279 module CreateReport = Com_atproto_moderation_createReport
+4 -3
pegasus/lib/api/account_/index.ml
··· 133 133 (* update handle if changed *) 134 134 let%lwt handle_result = 135 135 if new_handle <> actor.handle then 136 - Identity_util.update_handle ~did 137 - ~handle:new_handle ctx.db 136 + Identity_util.update_handle ~did ~handle:new_handle 137 + ctx.db 138 138 else Lwt.return_ok () 139 139 in 140 140 match handle_result with ··· 222 222 match%lwt 223 223 match (actor.auth_code, actor.auth_code_expires_at) with 224 224 | Some code, Some expiry 225 - when Some code = token && expiry > Util.Time.now_ms () -> 225 + when Some code = token && expiry > Util.Time.now_ms () 226 + -> 226 227 Server.UpdateEmail.update_email ~token actor ctx.db 227 228 | _ -> 228 229 Lwt.return_error Server.UpdateEmail.InvalidToken
+3 -1
pegasus/lib/api/account_/login.ml
··· 2 2 Xrpc.handler (fun ctx -> 3 3 let redirect_url = 4 4 if List.length @@ Dream.all_queries ctx.req > 0 then 5 - Uri.make ~path:"/oauth/authorize" ~query:(Util.Http.copy_query ctx.req) () 5 + Uri.make ~path:"/oauth/authorize" 6 + ~query:(Util.Http.copy_query ctx.req) 7 + () 6 8 |> Uri.to_string 7 9 else "/account" 8 10 in
+2 -1
pegasus/lib/api/account_/migrate/migrate.ml
··· 123 123 else 124 124 match session with 125 125 | None -> 126 - Util.Html.render_page ~status:`Internal_Server_Error ~title:"Migrate Account" 126 + Util.Html.render_page ~status:`Internal_Server_Error 127 + ~title:"Migrate Account" 127 128 (module Frontend.MigratePage) 128 129 ~props: 129 130 (make_props ~csrf_token ~invite_required ~hostname ~step:"error"
+9 -6
pegasus/lib/api/account_/password_reset.ml
··· 25 25 List.assoc_opt "password" fields |> Option.value ~default:"" 26 26 in 27 27 if String.length token = 0 then 28 - Util.Html.render_page ~status:`Bad_Request ~title:"Reset Password" 28 + Util.Html.render_page ~status:`Bad_Request 29 + ~title:"Reset Password" 29 30 (module Frontend.PasswordResetPage) 30 31 ~props: 31 32 { csrf_token ··· 33 34 ; email_sent_to= None 34 35 ; error= Some "Please enter the reset code." } 35 36 else if String.length password < 8 then 36 - Util.Html.render_page ~status:`Bad_Request ~title:"Reset Password" 37 + Util.Html.render_page ~status:`Bad_Request 38 + ~title:"Reset Password" 37 39 (module Frontend.PasswordResetPage) 38 40 ~props: 39 41 { csrf_token ··· 54 56 ; error= None } 55 57 | Error Server.ResetPassword.InvalidToken 56 58 | Error Server.ResetPassword.ExpiredToken -> 57 - Util.Html.render_page ~status:`Bad_Request ~title:"Reset Password" 59 + Util.Html.render_page ~status:`Bad_Request 60 + ~title:"Reset Password" 58 61 (module Frontend.PasswordResetPage) 59 62 ~props: 60 63 { csrf_token ··· 67 70 | _ -> 68 71 let email = 69 72 List.assoc_opt "email" fields 70 - |> Option.value ~default:"" 71 - |> String.lowercase_ascii 73 + |> Option.value ~default:"" |> String.lowercase_ascii 72 74 in 73 75 if String.length email = 0 then 74 - Util.Html.render_page ~status:`Bad_Request ~title:"Reset Password" 76 + Util.Html.render_page ~status:`Bad_Request 77 + ~title:"Reset Password" 75 78 (module Frontend.PasswordResetPage) 76 79 ~props: 77 80 { csrf_token
+4 -2
pegasus/lib/api/account_/signup.ml
··· 117 117 { props with 118 118 error= Some "An account with that DID already exists." } 119 119 | Error (Server.CreateAccount.PlcError _) -> 120 - Util.Html.render_page ~status:`Internal_Server_Error ~title:"Sign Up" 120 + Util.Html.render_page ~status:`Internal_Server_Error 121 + ~title:"Sign Up" 121 122 (module Frontend.SignupPage) 122 123 ~props: 123 124 { props with ··· 126 127 "Failed to create your identity. Please try again \ 127 128 later." } 128 129 | Error Server.CreateAccount.InviteUseFailure -> 129 - Util.Html.render_page ~status:`Internal_Server_Error ~title:"Sign Up" 130 + Util.Html.render_page ~status:`Internal_Server_Error 131 + ~title:"Sign Up" 130 132 (module Frontend.SignupPage) 131 133 ~props: 132 134 { props with
+2 -1
pegasus/lib/api/admin/getAccountInfo.ml
··· 4 4 { did= actor.did 5 5 ; handle= actor.handle 6 6 ; email= Some actor.email 7 - ; email_confirmed_at= Option.map Util.Time.ms_to_iso8601 actor.email_confirmed_at 7 + ; email_confirmed_at= 8 + Option.map Util.Time.ms_to_iso8601 actor.email_confirmed_at 8 9 ; indexed_at= Util.Time.ms_to_iso8601 actor.created_at 9 10 ; deactivated_at= Option.map Util.Time.ms_to_iso8601 actor.deactivated_at 10 11 ; related_records= None
+1 -3
pegasus/lib/api/admin_/users.ml
··· 203 203 let handle = 204 204 List.assoc_opt "handle" fields |> Option.value ~default:"" 205 205 in 206 - match%lwt 207 - Identity_util.update_handle ~did ~handle ctx.db 208 - with 206 + match%lwt Identity_util.update_handle ~did ~handle ctx.db with 209 207 | Ok () -> 210 208 render_page ~success:"Handle updated." () 211 209 | Error (InvalidFormat e)
+3 -3
pegasus/lib/api/identity/signPlcOperation.ml
··· 13 13 | Some actor -> ( 14 14 match (actor.auth_code, actor.auth_code_expires_at) with 15 15 | auth_code, Some auth_expires_at 16 - when input.token = auth_code && Util.Time.now_ms () < auth_expires_at -> ( 16 + when input.token = auth_code && Util.Time.now_ms () < auth_expires_at 17 + -> ( 17 18 match%lwt Plc.get_audit_log did with 18 19 | Ok log -> 19 20 let latest = Mist.Util.last log |> Option.get in 20 21 let input_vm = 21 22 Option.map 22 23 (fun v -> 23 - try 24 - Util.Types.string_map_of_yojson v |> Result.get_ok 24 + try Util.Types.string_map_of_yojson v |> Result.get_ok 25 25 with _ -> Errors.invalid_request "invalid request body" ) 26 26 input.verification_methods 27 27 in
+6 -5
pegasus/lib/api/oauth_/authorize.ml
··· 64 64 ^ Uuidm.to_string 65 65 (Uuidm.v4_gen (Random.State.make_self_init ()) ()) 66 66 in 67 - let expires_at = Util.Time.now_ms () + Constants.code_expiry_ms in 67 + let expires_at = 68 + Util.Time.now_ms () + Constants.code_expiry_ms 69 + in 68 70 let%lwt () = 69 71 Queries.insert_auth_code ctx.db 70 72 { code ··· 210 212 Errors.invalid_request "code already authorized" 211 213 else if code_rec.used then 212 214 Errors.invalid_request "code already used" 213 - else if Util.Time.now_ms () > code_rec.expires_at then 214 - Errors.invalid_request "code expired" 215 + else if Util.Time.now_ms () > code_rec.expires_at 216 + then Errors.invalid_request "code expired" 215 217 else if code_rec.request_id <> request_id then 216 218 Errors.invalid_request "code not for this request" 217 219 else ··· 236 238 () 237 239 |> Uri.to_string |> Dream.redirect ctx.req 238 240 else 239 - oauth_redirect ctx.req req.redirect_uri 240 - req.response_mode 241 + oauth_redirect ctx.req req.redirect_uri req.response_mode 241 242 [ ("error", "access_denied") 242 243 ; ("error_description", "Unable to authorize user.") 243 244 ; ("state", req.state)
+3 -1
pegasus/lib/api/root.ml
··· 1 1 let handler = 2 2 Xrpc.handler (fun _ -> 3 - Util.Html.render_page ~title:"Pegasus" (module Frontend.RootPage) ~props:() ) 3 + Util.Html.render_page ~title:"Pegasus" 4 + (module Frontend.RootPage) 5 + ~props:() )
+5 -2
pegasus/lib/api/server/createSession.ml
··· 39 39 in 40 40 let _ = 41 41 Xrpc.consume_route_rate_limit ~name:"repo-write-day" 42 - ~duration_ms:(5 * Util.Time.minute) ~max_points:30 ~key ~consume_points 42 + ~duration_ms:(5 * Util.Time.minute) ~max_points:30 ~key 43 + ~consume_points 43 44 in 44 45 match%lwt 45 46 Lwt_result.catch @@ fun () -> Data_store.try_login ~id ~password db ··· 52 53 else 53 54 match auth_factor_token with 54 55 | Some token when token <> "" -> ( 55 - match%lwt Two_factor.verify_code ~did:actor.did ~code:token db with 56 + match%lwt 57 + Two_factor.verify_code ~did:actor.did ~code:token db 58 + with 56 59 | Ok () -> 57 60 complete_login actor 58 61 | Error msg ->
+8 -3
pegasus/lib/api/server/requestPasswordReset.ml
··· 13 13 Xrpc.handler 14 14 ~rate_limits: 15 15 [ Route 16 - {duration_ms= Util.Time.day; points= 50; calc_key= None; calc_points= None} 16 + { duration_ms= Util.Time.day 17 + ; points= 50 18 + ; calc_key= None 19 + ; calc_points= None } 17 20 ; Route 18 - {duration_ms= Util.Time.hour; points= 15; calc_key= None; calc_points= None} 19 - ] 21 + { duration_ms= Util.Time.hour 22 + ; points= 15 23 + ; calc_key= None 24 + ; calc_points= None } ] 20 25 (fun {req; auth; db; _} -> 21 26 let%lwt actor_opt = 22 27 match auth with
+15 -7
pegasus/lib/data_store.ml
··· 366 366 let get_actor_by_identifier id conn = 367 367 Util.Sqlite.use_pool conn @@ Queries.get_actor_by_identifier ~id 368 368 369 - let activate_actor did conn = Util.Sqlite.use_pool conn @@ Queries.activate_actor ~did 369 + let activate_actor did conn = 370 + Util.Sqlite.use_pool conn @@ Queries.activate_actor ~did 370 371 371 372 let deactivate_actor did conn = 372 373 let deactivated_at = Util.Time.now_ms () in 373 374 Util.Sqlite.use_pool conn @@ Queries.deactivate_actor ~did ~deactivated_at 374 375 375 - let delete_actor did conn = Util.Sqlite.use_pool conn @@ Queries.delete_actor ~did 376 + let delete_actor did conn = 377 + Util.Sqlite.use_pool conn @@ Queries.delete_actor ~did 376 378 377 379 let update_actor_handle ~did ~handle conn = 378 380 Util.Sqlite.use_pool conn @@ Queries.update_actor_handle ~did ~handle ··· 399 401 let create_invite ~code ~did ~remaining conn = 400 402 Util.Sqlite.use_pool conn @@ Queries.create_invite ~code ~did ~remaining 401 403 402 - let get_invite ~code conn = Util.Sqlite.use_pool conn @@ Queries.get_invite ~code 404 + let get_invite ~code conn = 405 + Util.Sqlite.use_pool conn @@ Queries.get_invite ~code 403 406 404 - let use_invite ~code conn = Util.Sqlite.use_pool conn @@ Queries.use_invite ~code 407 + let use_invite ~code conn = 408 + Util.Sqlite.use_pool conn @@ Queries.use_invite ~code 405 409 406 410 let list_invites ?(limit = 100) conn = 407 411 Util.Sqlite.use_pool conn @@ Queries.list_invites ~limit 408 412 409 - let delete_invite ~code conn = Util.Sqlite.use_pool conn @@ Queries.delete_invite ~code 413 + let delete_invite ~code conn = 414 + Util.Sqlite.use_pool conn @@ Queries.delete_invite ~code 410 415 411 416 let update_invite ~code ~did ~remaining conn = 412 417 Util.Sqlite.use_pool conn @@ Queries.update_invite ~code ~did ~remaining ··· 414 419 let list_actors_filtered ?(cursor = "") ?(limit = 100) ~filter conn = 415 420 if String.length filter = 0 then 416 421 Util.Sqlite.use_pool conn @@ Queries.list_all_actors ~cursor ~limit 417 - else Util.Sqlite.use_pool conn @@ Queries.list_actors_filtered ~filter ~cursor ~limit 422 + else 423 + Util.Sqlite.use_pool conn 424 + @@ Queries.list_actors_filtered ~filter ~cursor ~limit 418 425 419 426 (* reserved keys *) 420 427 let create_reserved_key ~key_did ~did ~private_key conn = ··· 484 491 Util.Sqlite.use_pool conn @@ Queries.get_revoked_token ~did ~jti 485 492 486 493 let revoke_token conn ~did ~jti = 487 - Util.Sqlite.use_pool conn @@ Queries.revoke_token ~did ~jti ~now:(Util.Time.now_ms ()) 494 + Util.Sqlite.use_pool conn 495 + @@ Queries.revoke_token ~did ~jti ~now:(Util.Time.now_ms ())
+3 -1
pegasus/lib/passkey.ml
··· 183 183 Lwt.return_true 184 184 185 185 let rename_credential ~id ~did ~name db = 186 - let%lwt () = Util.Sqlite.use_pool db @@ Queries.rename_passkey ~id ~did ~name in 186 + let%lwt () = 187 + Util.Sqlite.use_pool db @@ Queries.rename_passkey ~id ~did ~name 188 + in 187 189 Lwt.return_true 188 190 189 191 let generate_registration_options ~did ~email ~existing_credentials db =
+9 -3
pegasus/lib/security_key.ml
··· 196 196 Lwt.return (id, secret_b32, uri) 197 197 198 198 let verify_setup ~id ~did ~code db = 199 - match%lwt Util.Sqlite.use_pool db @@ Queries.get_security_key_by_id id did with 199 + match%lwt 200 + Util.Sqlite.use_pool db @@ Queries.get_security_key_by_id id did 201 + with 200 202 | None -> 201 203 Lwt.return_error "Security key not found" 202 204 | Some sk -> ( ··· 240 242 try_keys keys 241 243 242 244 let resync_key ~id ~did ~code1 ~code2 db = 243 - match%lwt Util.Sqlite.use_pool db @@ Queries.get_security_key_by_id id did with 245 + match%lwt 246 + Util.Sqlite.use_pool db @@ Queries.get_security_key_by_id id did 247 + with 244 248 | None -> 245 249 Lwt.return_error "Security key not found" 246 250 | Some sk -> ( ··· 263 267 Util.Sqlite.use_pool db @@ Queries.get_security_keys_by_did ~did 264 268 265 269 let delete_key ~id ~did db = 266 - let%lwt () = Util.Sqlite.use_pool db @@ Queries.delete_security_key ~id ~did in 270 + let%lwt () = 271 + Util.Sqlite.use_pool db @@ Queries.delete_security_key ~id ~did 272 + in 267 273 Lwt.return_true 268 274 269 275 let has_security_keys ~did db =
+5 -2
pegasus/lib/totp.ml
··· 106 106 codes 107 107 108 108 let regenerate ~did db = 109 - let%lwt () = Util.Sqlite.use_pool db @@ Queries.delete_backup_codes_by_did ~did in 109 + let%lwt () = 110 + Util.Sqlite.use_pool db @@ Queries.delete_backup_codes_by_did ~did 111 + in 110 112 let codes = generate_codes () in 111 113 let%lwt () = store_codes ~did ~codes db in 112 114 Lwt.return (List.map format_code codes) ··· 263 265 if verify_code ~secret ~code then 264 266 let now = Util.Time.now_ms () in 265 267 let%lwt () = 266 - Util.Sqlite.use_pool db @@ Queries.verify_totp_secret ~did ~verified_at:now 268 + Util.Sqlite.use_pool db 269 + @@ Queries.verify_totp_secret ~did ~verified_at:now 267 270 in 268 271 Lwt.return_ok () 269 272 else Lwt.return_error "Invalid verification code"
+13 -15
pegasus/lib/util/constants.ml
··· 1 - let data_dir = 2 - Core.Filename.to_absolute_exn Env.data_dir 3 - ~relative_to:(Core_unix.getcwd ()) 1 + let data_dir = 2 + Core.Filename.to_absolute_exn Env.data_dir ~relative_to:(Core_unix.getcwd ()) 4 3 5 - let pegasus_db_filepath = Filename.concat data_dir "pegasus.db" 4 + let pegasus_db_filepath = Filename.concat data_dir "pegasus.db" 6 5 7 - let pegasus_db_location = "sqlite3://" ^ pegasus_db_filepath |> Uri.of_string 6 + let pegasus_db_location = "sqlite3://" ^ pegasus_db_filepath |> Uri.of_string 8 7 9 - let user_db_filepath did = 10 - let dirname = Filename.concat data_dir "store" in 11 - let filename = Str.global_replace (Str.regexp ":") "_" did in 12 - Filename.concat dirname filename ^ ".db" 8 + let user_db_filepath did = 9 + let dirname = Filename.concat data_dir "store" in 10 + let filename = Str.global_replace (Str.regexp ":") "_" did in 11 + Filename.concat dirname filename ^ ".db" 13 12 14 - let user_db_location did = 15 - "sqlite3://" ^ user_db_filepath did |> Uri.of_string 13 + let user_db_location did = "sqlite3://" ^ user_db_filepath did |> Uri.of_string 16 14 17 - let user_blobs_location did = 18 - did 19 - |> Str.global_replace (Str.regexp ":") "_" 20 - |> (Filename.concat data_dir "blobs" |> Filename.concat) 15 + let user_blobs_location did = 16 + did 17 + |> Str.global_replace (Str.regexp ":") "_" 18 + |> (Filename.concat data_dir "blobs" |> Filename.concat)
+32 -32
pegasus/lib/util/rapper_.ml
··· 1 - module CID : Rapper.CUSTOM with type t = Cid.t = struct 2 - type t = Cid.t 1 + module CID : Rapper.CUSTOM with type t = Cid.t = struct 2 + type t = Cid.t 3 3 4 - let t = 5 - let encode cid = 6 - try Ok (Cid.to_string cid) with e -> Error (Printexc.to_string e) 7 - in 8 - Caqti_type.(custom ~encode ~decode:Cid.of_string string) 9 - end 4 + let t = 5 + let encode cid = 6 + try Ok (Cid.to_string cid) with e -> Error (Printexc.to_string e) 7 + in 8 + Caqti_type.(custom ~encode ~decode:Cid.of_string string) 9 + end 10 10 11 - module Blob : Rapper.CUSTOM with type t = bytes = struct 12 - type t = bytes 11 + module Blob : Rapper.CUSTOM with type t = bytes = struct 12 + type t = bytes 13 13 14 - let t = 15 - let encode blob = 16 - try Ok (Bytes.to_string blob) with e -> Error (Printexc.to_string e) 17 - in 18 - let decode blob = 19 - try Ok (Bytes.of_string blob) with e -> Error (Printexc.to_string e) 20 - in 21 - Caqti_type.(custom ~encode ~decode string) 22 - end 14 + let t = 15 + let encode blob = 16 + try Ok (Bytes.to_string blob) with e -> Error (Printexc.to_string e) 17 + in 18 + let decode blob = 19 + try Ok (Bytes.of_string blob) with e -> Error (Printexc.to_string e) 20 + in 21 + Caqti_type.(custom ~encode ~decode string) 22 + end 23 23 24 - module Json : Rapper.CUSTOM with type t = Yojson.Safe.t = struct 25 - type t = Yojson.Safe.t 24 + module Json : Rapper.CUSTOM with type t = Yojson.Safe.t = struct 25 + type t = Yojson.Safe.t 26 26 27 - let t = 28 - let encode json = 29 - try Ok (Yojson.Safe.to_string json ~std:true) 30 - with e -> Error (Printexc.to_string e) 31 - in 32 - let decode json = 33 - try Ok (Yojson.Safe.from_string json) 34 - with e -> Error (Printexc.to_string e) 35 - in 36 - Caqti_type.(custom ~encode ~decode string) 37 - end 27 + let t = 28 + let encode json = 29 + try Ok (Yojson.Safe.to_string json ~std:true) 30 + with e -> Error (Printexc.to_string e) 31 + in 32 + let decode json = 33 + try Ok (Yojson.Safe.from_string json) 34 + with e -> Error (Printexc.to_string e) 35 + in 36 + Caqti_type.(custom ~encode ~decode string) 37 + end
+39 -43
pegasus/lib/util/syntax.ml
··· 1 - let unwrap m = 2 - match%lwt m with 3 - | Ok x -> 4 - Lwt.return x 5 - | Error e -> 6 - raise (Caqti_error.Exn e) 1 + let unwrap m = 2 + match%lwt m with Ok x -> Lwt.return x | Error e -> raise (Caqti_error.Exn e) 7 3 8 - (* unwraps an Lwt result, raising an exception if there's an error *) 9 - let ( let$! ) m f = 10 - match%lwt m with Ok x -> f x | Error e -> raise (Caqti_error.Exn e) 4 + (* unwraps an Lwt result, raising an exception if there's an error *) 5 + let ( let$! ) m f = 6 + match%lwt m with Ok x -> f x | Error e -> raise (Caqti_error.Exn e) 11 7 12 - (* unwraps an Lwt result, raising an exception if there's an error *) 13 - let ( >$! ) m f = 14 - match%lwt m with 15 - | Ok x -> 16 - Lwt.return (f x) 17 - | Error e -> 18 - raise (Caqti_error.Exn e) 8 + (* unwraps an Lwt result, raising an exception if there's an error *) 9 + let ( >$! ) m f = 10 + match%lwt m with 11 + | Ok x -> 12 + Lwt.return (f x) 13 + | Error e -> 14 + raise (Caqti_error.Exn e) 19 15 20 - let at_uri_regexp = 21 - Re.Pcre.re 22 - {|^at:\/\/([a-zA-Z0-9._:%-]+)(?:\/([a-zA-Z0-9-.]+)(?:\/([a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(?:#(\/[a-zA-Z0-9._~:@!$&%')(*+,;=\-[\]\/\\]*))?$|} 23 - |> Re.compile 16 + let at_uri_regexp = 17 + Re.Pcre.re 18 + {|^at:\/\/([a-zA-Z0-9._:%-]+)(?:\/([a-zA-Z0-9-.]+)(?:\/([a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(?:#(\/[a-zA-Z0-9._~:@!$&%')(*+,;=\-[\]\/\\]*))?$|} 19 + |> Re.compile 24 20 25 - type at_uri = 26 - {repo: string; collection: string; rkey: string; fragment: string option} 21 + type at_uri = 22 + {repo: string; collection: string; rkey: string; fragment: string option} 27 23 28 - let parse_at_uri uri = 29 - match Re.exec_opt at_uri_regexp uri with 30 - | None -> 31 - None 32 - | Some m -> ( 33 - try 34 - Some 35 - { repo= Re.Group.get m 1 36 - ; collection= Re.Group.get m 2 37 - ; rkey= Re.Group.get m 3 38 - ; fragment= Re.Group.get_opt m 4 } 39 - with _ -> None ) 24 + let parse_at_uri uri = 25 + match Re.exec_opt at_uri_regexp uri with 26 + | None -> 27 + None 28 + | Some m -> ( 29 + try 30 + Some 31 + { repo= Re.Group.get m 1 32 + ; collection= Re.Group.get m 2 33 + ; rkey= Re.Group.get m 3 34 + ; fragment= Re.Group.get_opt m 4 } 35 + with _ -> None ) 40 36 41 - let make_at_uri ~repo ~collection ~rkey ~fragment = 42 - Printf.sprintf "at://%s/%s/%s%s" repo collection rkey 43 - (Option.value ~default:"" fragment) 37 + let make_at_uri ~repo ~collection ~rkey ~fragment = 38 + Printf.sprintf "at://%s/%s/%s%s" repo collection rkey 39 + (Option.value ~default:"" fragment) 44 40 45 - let nsid_authority nsid = 46 - match String.rindex_opt nsid '.' with 47 - | None -> 48 - nsid 49 - | Some idx -> 50 - String.sub nsid 0 idx 41 + let nsid_authority nsid = 42 + match String.rindex_opt nsid '.' with 43 + | None -> 44 + nsid 45 + | Some idx -> 46 + String.sub nsid 0 idx
+75 -75
pegasus/lib/util/types.ml
··· 1 - type string_or_null = string option 1 + type string_or_null = string option 2 2 3 - let string_or_null_to_yojson = function Some s -> `String s | None -> `Null 3 + let string_or_null_to_yojson = function Some s -> `String s | None -> `Null 4 4 5 - let string_or_null_of_yojson = function 6 - | `String s -> 7 - Ok (Some s) 8 - | `Null -> 9 - Ok None 10 - | _ -> 11 - Error "invalid field value" 5 + let string_or_null_of_yojson = function 6 + | `String s -> 7 + Ok (Some s) 8 + | `Null -> 9 + Ok None 10 + | _ -> 11 + Error "invalid field value" 12 12 13 - type string_or_strings = [`String of string | `Strings of string list] 13 + type string_or_strings = [`String of string | `Strings of string list] 14 14 15 - let string_or_strings_to_yojson = function 16 - | `String c -> 17 - `String c 18 - | `Strings cs -> 19 - `List (List.map (fun c -> `String c) cs) 15 + let string_or_strings_to_yojson = function 16 + | `String c -> 17 + `String c 18 + | `Strings cs -> 19 + `List (List.map (fun c -> `String c) cs) 20 20 21 - let string_or_strings_of_yojson = function 22 - | `String c -> 23 - Ok (`Strings [c]) 24 - | `List cs -> 25 - Ok (`Strings (Yojson.Safe.Util.filter_string cs)) 26 - | _ -> 27 - Error "invalid field value" 21 + let string_or_strings_of_yojson = function 22 + | `String c -> 23 + Ok (`Strings [c]) 24 + | `List cs -> 25 + Ok (`Strings (Yojson.Safe.Util.filter_string cs)) 26 + | _ -> 27 + Error "invalid field value" 28 28 29 - type string_map = (string * string) list 29 + type string_map = (string * string) list 30 30 31 - let string_map_to_yojson = function 32 - | [] -> 33 - `Assoc [] 34 - | m -> 35 - `Assoc (List.map (fun (k, v) -> (k, `String v)) m) 31 + let string_map_to_yojson = function 32 + | [] -> 33 + `Assoc [] 34 + | m -> 35 + `Assoc (List.map (fun (k, v) -> (k, `String v)) m) 36 36 37 - let string_map_of_yojson = function 38 - | `Null -> 39 - Ok [] 40 - | `Assoc m -> 41 - Ok 42 - (List.filter_map 43 - (fun (k, v) -> 44 - match (k, v) with _, `String s -> Some (k, s) | _, _ -> None ) 45 - m ) 46 - | _ -> 47 - Error "invalid field value" 37 + let string_map_of_yojson = function 38 + | `Null -> 39 + Ok [] 40 + | `Assoc m -> 41 + Ok 42 + (List.filter_map 43 + (fun (k, v) -> 44 + match (k, v) with _, `String s -> Some (k, s) | _, _ -> None ) 45 + m ) 46 + | _ -> 47 + Error "invalid field value" 48 48 49 - type string_or_string_map = [`String of string | `String_map of string_map] 49 + type string_or_string_map = [`String of string | `String_map of string_map] 50 50 51 - let string_or_string_map_to_yojson = function 52 - | `String c -> 53 - `String c 54 - | `String_map m -> 55 - `Assoc (List.map (fun (k, v) -> (k, `String v)) m) 51 + let string_or_string_map_to_yojson = function 52 + | `String c -> 53 + `String c 54 + | `String_map m -> 55 + `Assoc (List.map (fun (k, v) -> (k, `String v)) m) 56 56 57 - let string_or_string_map_of_yojson = function 58 - | `String c -> 59 - Ok (`String c) 60 - | `Assoc m -> 61 - string_map_of_yojson (`Assoc m) |> Result.map (fun m -> `String_map m) 62 - | _ -> 63 - Error "invalid field value" 57 + let string_or_string_map_of_yojson = function 58 + | `String c -> 59 + Ok (`String c) 60 + | `Assoc m -> 61 + string_map_of_yojson (`Assoc m) |> Result.map (fun m -> `String_map m) 62 + | _ -> 63 + Error "invalid field value" 64 64 65 - type string_or_string_map_or_either_list = 66 - [ `String of string 67 - | `String_map of string_map 68 - | `List of string_or_string_map list ] 65 + type string_or_string_map_or_either_list = 66 + [ `String of string 67 + | `String_map of string_map 68 + | `List of string_or_string_map list ] 69 69 70 - let string_or_string_map_or_either_list_to_yojson = function 71 - | `String c -> 72 - `String c 73 - | `String_map m -> 74 - `Assoc (List.map (fun (k, v) -> (k, `String v)) m) 75 - | `List l -> 76 - `List (List.map string_or_string_map_to_yojson l) 70 + let string_or_string_map_or_either_list_to_yojson = function 71 + | `String c -> 72 + `String c 73 + | `String_map m -> 74 + `Assoc (List.map (fun (k, v) -> (k, `String v)) m) 75 + | `List l -> 76 + `List (List.map string_or_string_map_to_yojson l) 77 77 78 - let string_or_string_map_or_either_list_of_yojson = function 79 - | `String c -> 80 - Ok (`String c) 81 - | `Assoc m -> 82 - string_map_of_yojson (`Assoc m) |> Result.map (fun m -> `String_map m) 83 - | `List l -> 84 - Ok 85 - (`List 86 - ( List.map string_or_string_map_of_yojson l 87 - |> List.filter_map (function Ok x -> Some x | Error _ -> None) ) ) 88 - | _ -> 89 - Error "invalid field value" 78 + let string_or_string_map_or_either_list_of_yojson = function 79 + | `String c -> 80 + Ok (`String c) 81 + | `Assoc m -> 82 + string_map_of_yojson (`Assoc m) |> Result.map (fun m -> `String_map m) 83 + | `List l -> 84 + Ok 85 + (`List 86 + ( List.map string_or_string_map_of_yojson l 87 + |> List.filter_map (function Ok x -> Some x | Error _ -> None) ) ) 88 + | _ -> 89 + Error "invalid field value"
-7
pegasus/lib/util/util.ml
··· 1 1 module Constants = Constants 2 - 3 2 module Syntax = Syntax 4 - 5 3 module Rapper = Rapper_ 6 - 7 4 module Types = Types 8 - 9 5 module Sqlite = Sqlite_ 10 - 11 6 module Time = Time 12 - 13 7 module Http = Http_ 14 - 15 8 module Html = Html 16 9 17 10 (* returns all blob refs in a record *)