objective categorical abstract machine language personal data server

Update pegasus to use codegen lexicon types

futur.blue 5fc980ac f6661baf

verified
Changed files
+9643 -412
hermes-cli
pegasus
lib
api
lexicons
+1
.ocamlformat-ignore
··· 1 + pegasus/lib/lexicons/*
+42
hermes-cli/lib/emitter.ml
··· 1 + type t = 2 + { mutable imports: string list 3 + ; mutable generated_unions: string list 4 + ; mutable union_names: (string list * string) list (* refs -> context name *) 5 + ; buf: Buffer.t } 6 + 7 + let make () = 8 + {imports= []; generated_unions= []; union_names= []; buf= Buffer.create 4096} 9 + 10 + (** add an import if not already present *) 11 + let add_import t module_name = 12 + if not (List.mem module_name t.imports) then 13 + t.imports <- module_name :: t.imports 14 + 15 + let get_imports t = t.imports 16 + 17 + (** mark a union type as generated to avoid duplicates *) 18 + let mark_union_generated t union_name = 19 + if not (List.mem union_name t.generated_unions) then 20 + t.generated_unions <- union_name :: t.generated_unions 21 + 22 + let is_union_generated t union_name = List.mem union_name t.generated_unions 23 + 24 + (** register a context-based name for a union based on its refs, 25 + allowing inline unions to be reused when the same refs appear elsewhere *) 26 + let register_union_name t refs context_name = 27 + let sorted_refs = List.sort String.compare refs in 28 + if not (List.exists (fun (r, _) -> r = sorted_refs) t.union_names) then 29 + t.union_names <- (sorted_refs, context_name) :: t.union_names 30 + 31 + (** look up a union's registered context-based name *) 32 + let lookup_union_name t refs = 33 + let sorted_refs = List.sort String.compare refs in 34 + List.assoc_opt sorted_refs t.union_names 35 + 36 + let emit t s = Buffer.add_string t.buf s 37 + 38 + let emitln t s = Buffer.add_string t.buf s ; Buffer.add_char t.buf '\n' 39 + 40 + let emit_newline t = Buffer.add_char t.buf '\n' 41 + 42 + let contents t = Buffer.contents t.buf
+226
hermes-cli/lib/scc.ml
··· 1 + open Lexicon_types 2 + 3 + (** returns SCCs in reverse topological order (dependencies first) 4 + each SCC is a list of nodes *) 5 + let find_sccs (type node) (nodes : node list) ~(get_id : node -> string) 6 + ~(get_deps : node -> string list) : node list list = 7 + (* build node map: id -> node *) 8 + let node_map = 9 + List.fold_left (fun m node -> (get_id node, node) :: m) [] nodes 10 + in 11 + let node_ids = List.map get_id nodes in 12 + (* build dependency map *) 13 + let deps = List.map (fun node -> (get_id node, get_deps node)) nodes in 14 + (* Tarjan's algorithm state *) 15 + let index_counter = ref 0 in 16 + let indices = Hashtbl.create 64 in 17 + let lowlinks = Hashtbl.create 64 in 18 + let on_stack = Hashtbl.create 64 in 19 + let stack = ref [] in 20 + let sccs = ref [] in 21 + let rec strongconnect id = 22 + let index = !index_counter in 23 + incr index_counter ; 24 + Hashtbl.add indices id index ; 25 + Hashtbl.add lowlinks id index ; 26 + Hashtbl.add on_stack id true ; 27 + stack := id :: !stack ; 28 + (* visit successors *) 29 + let successors = 30 + try List.assoc id deps |> List.filter (fun s -> List.mem s node_ids) 31 + with Not_found -> [] 32 + in 33 + List.iter 34 + (fun succ -> 35 + if not (Hashtbl.mem indices succ) then begin 36 + (* successor not yet visited *) 37 + strongconnect succ ; 38 + Hashtbl.replace lowlinks id 39 + (min (Hashtbl.find lowlinks id) (Hashtbl.find lowlinks succ)) 40 + end 41 + else if Hashtbl.find_opt on_stack succ = Some true then 42 + (* successor is on stack, part of current SCC *) 43 + Hashtbl.replace lowlinks id 44 + (min (Hashtbl.find lowlinks id) (Hashtbl.find indices succ)) ) 45 + successors ; 46 + (* if this is a root node, pop the SCC *) 47 + if Hashtbl.find lowlinks id = Hashtbl.find indices id then begin 48 + let rec pop_scc acc = 49 + match !stack with 50 + | [] -> 51 + acc 52 + | top :: rest -> 53 + stack := rest ; 54 + Hashtbl.replace on_stack top false ; 55 + if top = id then top :: acc else pop_scc (top :: acc) 56 + in 57 + let scc_ids = pop_scc [] in 58 + (* convert IDs to nodes, preserving original order *) 59 + let scc_nodes = 60 + List.filter_map 61 + (fun n -> List.assoc_opt n node_map) 62 + (List.filter (fun n -> List.mem n scc_ids) node_ids) 63 + in 64 + if scc_nodes <> [] then sccs := scc_nodes :: !sccs 65 + end 66 + in 67 + (* run on all nodes *) 68 + List.iter 69 + (fun id -> if not (Hashtbl.mem indices id) then strongconnect id) 70 + node_ids ; 71 + (* SCCs are prepended, so reverse to get topological order *) 72 + List.rev !sccs 73 + 74 + (** returns list of definition names that this type depends on within the same nsid *) 75 + let rec collect_local_refs nsid acc = function 76 + | Array {items; _} -> 77 + collect_local_refs nsid acc items 78 + | Ref {ref_; _} -> 79 + if String.length ref_ > 0 && ref_.[0] = '#' then 80 + (* local ref: #foo *) 81 + let def_name = String.sub ref_ 1 (String.length ref_ - 1) in 82 + def_name :: acc 83 + else begin 84 + (* check if it's a self-reference: nsid#foo *) 85 + match String.split_on_char '#' ref_ with 86 + | [ext_nsid; def_name] when ext_nsid = nsid -> 87 + def_name :: acc 88 + | _ -> 89 + acc 90 + end 91 + | Union {refs; _} -> 92 + List.fold_left 93 + (fun a r -> 94 + if String.length r > 0 && r.[0] = '#' then 95 + let def_name = String.sub r 1 (String.length r - 1) in 96 + def_name :: a 97 + else 98 + match String.split_on_char '#' r with 99 + | [ext_nsid; def_name] when ext_nsid = nsid -> 100 + def_name :: a 101 + | _ -> 102 + a ) 103 + acc refs 104 + | Object {properties; _} -> 105 + List.fold_left 106 + (fun a (_, (prop : property)) -> collect_local_refs nsid a prop.type_def) 107 + acc properties 108 + | Record {record; _} -> 109 + List.fold_left 110 + (fun a (_, (prop : property)) -> collect_local_refs nsid a prop.type_def) 111 + acc record.properties 112 + | Query {parameters; output; _} -> ( 113 + let acc = 114 + match parameters with 115 + | Some params -> 116 + List.fold_left 117 + (fun a (_, (prop : property)) -> 118 + collect_local_refs nsid a prop.type_def ) 119 + acc params.properties 120 + | None -> 121 + acc 122 + in 123 + match output with 124 + | Some body -> 125 + Option.fold ~none:acc ~some:(collect_local_refs nsid acc) body.schema 126 + | None -> 127 + acc ) 128 + | Procedure {parameters; input; output; _} -> ( 129 + let acc = 130 + match parameters with 131 + | Some params -> 132 + List.fold_left 133 + (fun a (_, (prop : property)) -> 134 + collect_local_refs nsid a prop.type_def ) 135 + acc params.properties 136 + | None -> 137 + acc 138 + in 139 + let acc = 140 + match input with 141 + | Some body -> 142 + Option.fold ~none:acc 143 + ~some:(collect_local_refs nsid acc) 144 + body.schema 145 + | None -> 146 + acc 147 + in 148 + match output with 149 + | Some body -> 150 + Option.fold ~none:acc ~some:(collect_local_refs nsid acc) body.schema 151 + | None -> 152 + acc ) 153 + | _ -> 154 + acc 155 + 156 + (** find SCCs among definitions within a single lexicon 157 + returns SCCs in reverse topological order *) 158 + let find_def_sccs nsid (defs : def_entry list) : def_entry list list = 159 + find_sccs defs 160 + ~get_id:(fun def -> def.name) 161 + ~get_deps:(fun def -> collect_local_refs nsid [] def.type_def) 162 + 163 + (** get external nsid dependencies for a lexicon *) 164 + let get_external_nsids (doc : lexicon_doc) : string list = 165 + let nsids = ref [] in 166 + let add_nsid s = if not (List.mem s !nsids) then nsids := s :: !nsids in 167 + let rec collect_from_type = function 168 + | Array {items; _} -> 169 + collect_from_type items 170 + | Ref {ref_; _} -> 171 + if String.length ref_ > 0 && ref_.[0] <> '#' then begin 172 + match String.split_on_char '#' ref_ with 173 + | ext_nsid :: _ -> 174 + add_nsid ext_nsid 175 + | [] -> 176 + () 177 + end 178 + | Union {refs; _} -> 179 + List.iter 180 + (fun r -> 181 + if String.length r > 0 && r.[0] <> '#' then 182 + match String.split_on_char '#' r with 183 + | ext_nsid :: _ -> 184 + add_nsid ext_nsid 185 + | [] -> 186 + () ) 187 + refs 188 + | Object {properties; _} -> 189 + List.iter 190 + (fun (_, (prop : property)) -> collect_from_type prop.type_def) 191 + properties 192 + | Query {parameters; output; _} -> 193 + Option.iter 194 + (fun p -> 195 + List.iter 196 + (fun (_, (prop : property)) -> collect_from_type prop.type_def) 197 + p.properties ) 198 + parameters ; 199 + Option.iter (fun o -> Option.iter collect_from_type o.schema) output 200 + | Procedure {parameters; input; output; _} -> 201 + Option.iter 202 + (fun p -> 203 + List.iter 204 + (fun (_, (prop : property)) -> collect_from_type prop.type_def) 205 + p.properties ) 206 + parameters ; 207 + Option.iter (fun i -> Option.iter collect_from_type i.schema) input ; 208 + Option.iter (fun o -> Option.iter collect_from_type o.schema) output 209 + | Record {record; _} -> 210 + List.iter 211 + (fun (_, (prop : property)) -> collect_from_type prop.type_def) 212 + record.properties 213 + | _ -> 214 + () 215 + in 216 + List.iter (fun def -> collect_from_type def.type_def) doc.defs ; 217 + !nsids 218 + 219 + (** find SCCs between lexicon files, in reverse topological order *) 220 + let find_file_sccs (lexicons : lexicon_doc list) : lexicon_doc list list = 221 + let nsids = List.map (fun doc -> doc.id) lexicons in 222 + find_sccs lexicons 223 + ~get_id:(fun doc -> doc.id) 224 + ~get_deps:(fun doc -> 225 + (* filter to only include nsids we have *) 226 + get_external_nsids doc |> List.filter (fun n -> List.mem n nsids) )
+2 -2
pegasus/lib/api/admin/deleteAccount.ml
··· 1 - type request = {did: string} [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_admin_deleteAccount.Main 2 2 3 3 let handler = 4 4 Xrpc.handler ~auth:Admin (fun {req; db; _} -> 5 - let%lwt {did} = Xrpc.parse_body req request_of_yojson in 5 + let%lwt {did} = Xrpc.parse_body req input_of_yojson in 6 6 match%lwt Data_store.get_actor_by_identifier did db with 7 7 | None -> 8 8 Errors.invalid_request "account not found"
+11 -14
pegasus/lib/api/admin/getAccountInfo.ml
··· 1 - type account_view = 2 - { did: string 3 - ; handle: string 4 - ; email: string 5 - ; email_confirmed_at: string option [@key "emailConfirmedAt"] 6 - ; indexed_at: string [@key "indexedAt"] 7 - ; deactivated_at: string option [@key "deactivatedAt"] } 8 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_admin_getAccountInfo.Main 9 2 10 - type response = account_view [@@deriving yojson {strict= false}] 11 - 12 - let actor_to_account_view (actor : Data_store.Types.actor) : account_view = 3 + let actor_to_account_view (actor : Data_store.Types.actor) : output = 13 4 { did= actor.did 14 5 ; handle= actor.handle 15 - ; email= actor.email 6 + ; email= Some actor.email 16 7 ; email_confirmed_at= Option.map Util.ms_to_iso8601 actor.email_confirmed_at 17 8 ; indexed_at= Util.ms_to_iso8601 actor.created_at 18 - ; deactivated_at= Option.map Util.ms_to_iso8601 actor.deactivated_at } 9 + ; deactivated_at= Option.map Util.ms_to_iso8601 actor.deactivated_at 10 + ; related_records= None 11 + ; invited_by= None 12 + ; invites= None 13 + ; invites_disabled= None 14 + ; invite_note= None 15 + ; threat_signatures= None } 19 16 20 17 let handler = 21 18 Xrpc.handler ~auth:Admin (fun {req; db; _} -> ··· 25 22 Errors.invalid_request "account not found" 26 23 | Some actor -> 27 24 let response = actor_to_account_view actor in 28 - Dream.json @@ Yojson.Safe.to_string @@ response_to_yojson response ) 25 + Dream.json @@ Yojson.Safe.to_string @@ output_to_yojson response )
+2 -3
pegasus/lib/api/admin/getAccountInfos.ml
··· 1 - type response = {infos: GetAccountInfo.account_view list} 2 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_admin_getAccountInfos.Main 3 2 4 3 let handler = 5 4 Xrpc.handler ~auth:Admin (fun {req; db; _} -> ··· 18 17 Lwt.return_some (GetAccountInfo.actor_to_account_view actor) ) 19 18 dids 20 19 in 21 - Dream.json @@ Yojson.Safe.to_string @@ response_to_yojson {infos} ) 20 + Dream.json @@ Yojson.Safe.to_string @@ output_to_yojson {infos} )
+4 -16
pegasus/lib/api/admin/getInviteCodes.ml
··· 1 - type invite_code_use = 2 - {used_by: string [@key "usedBy"]; used_at: string [@key "usedAt"]} 3 - [@@deriving yojson {strict= false}] 4 - 5 - type invite_code = 6 - { code: string 7 - ; available: int 8 - ; disabled: bool 9 - ; for_account: string [@key "forAccount"] 10 - ; created_by: string [@key "createdBy"] 11 - ; created_at: string [@key "createdAt"] 12 - ; uses: invite_code_use list } 13 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_admin_getInviteCodes.Main 14 2 15 - type response = {codes: invite_code list; cursor: string option [@default None]} 3 + type invite_code = Lexicons.Com_atproto_server_defs.invite_code 16 4 [@@deriving yojson {strict= false}] 17 5 18 6 let handler = ··· 26 14 let%lwt db_codes = Data_store.list_invites ~limit db in 27 15 let codes = 28 16 List.map 29 - (fun (ic : Data_store.Types.invite_code) -> 17 + (fun (ic : Data_store.Types.invite_code) : invite_code -> 30 18 { code= ic.code 31 19 ; available= ic.remaining 32 20 ; disabled= ic.remaining = 0 ··· 37 25 db_codes 38 26 in 39 27 Dream.json @@ Yojson.Safe.to_string 40 - @@ response_to_yojson {codes; cursor= None} ) 28 + @@ output_to_yojson {codes; cursor= None} )
+4 -12
pegasus/lib/api/admin/sendEmail.ml
··· 1 - type request = 2 - { recipient_did: string [@key "recipientDid"] 3 - ; content: string 4 - ; subject: string option [@default None] 5 - ; sender_did: string [@key "senderDid"] 6 - ; comment: string option [@default None] } 7 - [@@deriving yojson {strict= false}] 8 - 9 - type response = {sent: bool} [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_admin_sendEmail.Main 10 2 11 3 let handler = 12 4 Xrpc.handler ~auth:Admin (fun {req; db; _} -> 13 5 let%lwt {recipient_did; content; subject; sender_did; comment= _} = 14 - Xrpc.parse_body req request_of_yojson 6 + Xrpc.parse_body req input_of_yojson 15 7 in 16 8 match%lwt Data_store.get_actor_by_identifier recipient_did db with 17 9 | None -> ··· 31 23 Util.send_email_or_log ~recipients:[To recipient.email] ~subject 32 24 ~body:(Plain content) 33 25 in 34 - Dream.json @@ Yojson.Safe.to_string 35 - @@ response_to_yojson {sent= true} ) ) 26 + Dream.json @@ Yojson.Safe.to_string @@ output_to_yojson {sent= true} 27 + ) )
+2 -3
pegasus/lib/api/admin/updateAccountEmail.ml
··· 1 - type request = {account: string; email: string} 2 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_admin_updateAccountEmail.Main 3 2 4 3 let handler = 5 4 Xrpc.handler ~auth:Admin (fun {req; db; _} -> 6 - let%lwt {account; email} = Xrpc.parse_body req request_of_yojson in 5 + let%lwt {account; email} = Xrpc.parse_body req input_of_yojson in 7 6 match%lwt Data_store.get_actor_by_identifier account db with 8 7 | None -> 9 8 Errors.invalid_request "account not found"
+2 -2
pegasus/lib/api/admin/updateAccountHandle.ml
··· 1 - type request = {did: string; handle: string} [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_admin_updateAccountHandle.Main 2 2 3 3 let handler = 4 4 Xrpc.handler ~auth:Admin (fun {req; db; _} -> 5 - let%lwt {did; handle} = Xrpc.parse_body req request_of_yojson in 5 + let%lwt {did; handle} = Xrpc.parse_body req input_of_yojson in 6 6 match%lwt Data_store.get_actor_by_identifier did db with 7 7 | None -> 8 8 Errors.invalid_request "account not found"
+2 -3
pegasus/lib/api/identity/getRecommendedDidCredentials.ml
··· 1 - type response = Plc.credentials [@@deriving yojson {strict= false}] 2 - 3 1 let get_credentials did ?(extra_rotation_keys = []) db = 4 2 match%lwt Data_store.get_actor_by_identifier did db with 5 3 | None -> ··· 19 17 | Error msg -> 20 18 Errors.internal_error ~msg () 21 19 | Ok credentials -> 22 - response_to_yojson credentials |> Yojson.Safe.to_string |> Dream.json ) 20 + credentials |> Plc.credentials_to_yojson |> Yojson.Safe.to_string 21 + |> Dream.json )
+5 -3
pegasus/lib/api/identity/resolveHandle.ml
··· 1 - type query = {handle: string} [@@deriving yojson {strict= false}] 1 + type query = Lexicons.Com_atproto_identity_resolveHandle.Main.params 2 + [@@deriving yojson {strict= false}] 2 3 3 - type response = {did: string} [@@deriving yojson {strict= false}] 4 + type response = Lexicons.Com_atproto_identity_resolveHandle.Main.output 5 + [@@deriving yojson {strict= false}] 4 6 5 7 let handler = 6 8 Xrpc.handler (fun ctx -> 7 - let {handle} = Xrpc.parse_query ctx.req query_of_yojson in 9 + let {handle} : query = Xrpc.parse_query ctx.req query_of_yojson in 8 10 match%lwt Data_store.get_actor_by_identifier handle ctx.db with 9 11 | Some actor -> 10 12 Dream.json @@ Yojson.Safe.to_string
+26 -20
pegasus/lib/api/identity/signPlcOperation.ml
··· 1 - type request = 2 - { token: string 3 - ; rotation_keys: string list option [@default None] [@key "rotationKeys"] 4 - ; verification_methods: Util.Did_doc_types.string_map option 5 - [@default None] [@key "verificationMethods"] 6 - ; also_known_as: string list option [@default None] [@key "alsoKnownAs"] 7 - ; services: Plc.service_map option [@default None] } 8 - [@@deriving yojson {strict= false}] 9 - 10 - type response = {operation: Plc.signed_operation} 11 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_identity_signPlcOperation.Main 12 2 13 3 let handler = 14 4 Xrpc.handler ~auth:Authorization (fun {req; auth; db; _} -> ··· 16 6 Auth.assert_identity_scope auth ~attr:Oauth.Scopes.Any ; 17 7 if not (String.starts_with ~prefix:"did:plc:" did) then 18 8 Errors.invalid_request "this method is only for did:plc identities" ; 19 - let%lwt input = Xrpc.parse_body req request_of_yojson in 9 + let%lwt input = Xrpc.parse_body req input_of_yojson in 20 10 match%lwt Data_store.get_actor_by_identifier did db with 21 11 | None -> 22 12 Errors.internal_error ~msg:"actor not found" () 23 13 | Some actor -> ( 24 14 match (actor.auth_code, actor.auth_code_expires_at) with 25 - | Some auth_code, Some auth_expires_at 15 + | auth_code, Some auth_expires_at 26 16 when input.token = auth_code && Util.now_ms () < auth_expires_at -> ( 27 17 match%lwt Plc.get_audit_log did with 28 18 | Ok log -> 29 19 let latest = Mist.Util.last log |> Option.get in 20 + let input_vm = 21 + Option.map 22 + (fun v -> 23 + try 24 + Util.Did_doc_types.string_map_of_yojson v |> Result.get_ok 25 + with _ -> Errors.invalid_request "invalid request body" ) 26 + input.verification_methods 27 + in 28 + let input_svcs = 29 + Option.map 30 + (fun v -> 31 + try Plc.service_map_of_yojson v |> Result.get_ok 32 + with _ -> Errors.invalid_request "invalid request body" ) 33 + input.services 34 + in 30 35 let unsigned_op : Plc.unsigned_operation = 31 36 Operation 32 37 { type'= "plc_operation" ··· 34 39 Option.value input.rotation_keys 35 40 ~default:latest.operation.rotation_keys 36 41 ; verification_methods= 37 - Option.value input.verification_methods 42 + Option.value input_vm 38 43 ~default:latest.operation.verification_methods 39 44 ; also_known_as= 40 45 Option.value input.also_known_as 41 46 ~default:latest.operation.also_known_as 42 47 ; services= 43 - Option.value input.services 44 - ~default:latest.operation.services 48 + Option.value input_svcs ~default:latest.operation.services 45 49 ; prev= Some latest.cid } 46 50 in 47 - let signed_op = Plc.sign_operation Env.rotation_key unsigned_op in 51 + let signed_op = 52 + Plc.sign_operation Env.rotation_key unsigned_op 53 + |> Plc.signed_operation_to_yojson 54 + in 48 55 let%lwt () = Data_store.clear_auth_code ~did db in 49 - let res = {operation= signed_op} in 50 - res |> response_to_yojson |> Yojson.Safe.to_string 51 - |> Dream.json ~status:`OK 56 + output_to_yojson {operation= signed_op} 57 + |> Yojson.Safe.to_string |> Dream.json ~status:`OK 52 58 | Error err -> 53 59 Errors.internal_error ~msg:("failed to get audit log: " ^ err) () 54 60 )
+6 -3
pegasus/lib/api/identity/submitPlcOperation.ml
··· 1 - type request = {operation: Plc.signed_operation_op} 2 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_identity_submitPlcOperation.Main 3 2 4 3 let handler = 5 4 Xrpc.handler ~auth:Authorization (fun {req; auth; db; _} -> ··· 7 6 Auth.assert_identity_scope auth ~attr:Oauth.Scopes.Any ; 8 7 if not (String.starts_with ~prefix:"did:plc:" did) then 9 8 Errors.invalid_request "this method is only for did:plc identities" ; 10 - let%lwt {operation= op} = Xrpc.parse_body req request_of_yojson in 9 + let%lwt {operation= op} = Xrpc.parse_body req input_of_yojson in 10 + let op = 11 + try Result.get_ok @@ Plc.signed_operation_op_of_yojson op 12 + with _ -> Errors.invalid_request "invalid request body" 13 + in 11 14 match%lwt Data_store.get_actor_by_identifier did db with 12 15 | None -> 13 16 Errors.internal_error ~msg:"actor not found" ()
+2 -2
pegasus/lib/api/identity/updateHandle.ml
··· 1 - type request = {handle: string} [@@deriving yojson] 1 + open Lexicons.Com_atproto_identity_updateHandle.Main 2 2 3 3 type update_handle_error = 4 4 | InvalidFormat of string ··· 99 99 (fun {req; auth; db; _} -> 100 100 Auth.assert_identity_scope auth ~attr:Oauth.Scopes.Handle ; 101 101 let did = Auth.get_authed_did_exn auth in 102 - let%lwt {handle} = Xrpc.parse_body req request_of_yojson in 102 + let%lwt {handle} = Xrpc.parse_body req input_of_yojson in 103 103 match%lwt update_handle ~did ~handle db with 104 104 | Ok () -> 105 105 Dream.empty `OK
+5 -2
pegasus/lib/api/proxy/appBskyActorGetPreferences.ml
··· 1 - type response = {preferences: Yojson.Safe.t} [@@deriving yojson {strict= false}] 1 + open Lexicons.App_bsky_actor_getPreferences.Main 2 2 3 3 let handler = 4 4 Xrpc.handler ~auth:Authorization (fun {db; auth; _} -> ··· 10 10 | None -> 11 11 Errors.internal_error () 12 12 in 13 - {preferences} |> response_to_yojson |> Yojson.Safe.to_string |> Dream.json ) 13 + preferences |> Lexicons.App_bsky_actor_defs.preferences_of_yojson 14 + |> Result.get_ok 15 + |> (fun p -> {preferences= p}) 16 + |> output_to_yojson |> Yojson.Safe.to_string |> Dream.json )
+23 -20
pegasus/lib/api/repo/applyWrites.ml
··· 1 - type request = 2 - { repo: string 3 - ; validate: bool option [@default None] 4 - ; writes: Repository.repo_write list 5 - ; swap_commit: string option [@key "swapCommit"] [@default None] } 6 - [@@deriving yojson {strict= false}] 7 - 8 - type response = 9 - { commit: res_commit option [@default None] 10 - ; results: Repository.apply_writes_result list } 11 - [@@deriving yojson {strict= false}] 12 - 13 - and res_commit = {cid: string; rev: string} [@@deriving yojson] 1 + open Lexicons.Com_atproto_repo_applyWrites.Main 14 2 15 - let calc_write_points (writes : Repository.repo_write list) = 3 + let calc_write_points writes = 16 4 List.fold_left 17 - (fun acc (write : Repository.repo_write) -> 5 + (fun acc write -> 18 6 acc + match write with Create _ -> 3 | Update _ -> 2 | Delete _ -> 1 ) 19 7 0 writes 20 8 21 9 let handler = 22 10 Xrpc.handler ~auth:Authorization (fun ctx -> 23 - let%lwt input = Xrpc.parse_body ctx.req request_of_yojson in 11 + let%lwt input = Xrpc.parse_body ctx.req input_of_yojson in 24 12 let%lwt did = Xrpc.resolve_repo_did_authed ctx input.repo in 25 13 (* apply rate limits after parsing body so we can count points accurately *) 26 14 let points = calc_write_points input.writes in ··· 32 20 in 33 21 (* check oauth scopes for each write operation *) 34 22 List.iter 35 - (fun (write : Repository.repo_write) -> 23 + (fun write -> 36 24 match write with 37 25 | Create {collection; _} -> 38 26 Auth.assert_repo_scope ctx.auth ~collection ··· 45 33 ~action:Oauth.Scopes.Delete ) 46 34 input.writes ; 47 35 let%lwt repo = Repository.load did in 48 - let%lwt {commit= commit_cid, {rev; _}; results} = 49 - Repository.apply_writes repo input.writes 36 + let repo_writes = 37 + List.map 38 + (fun w -> 39 + w |> writes_item_to_yojson |> Repository.repo_write_of_yojson 40 + |> Result.get_ok ) 41 + input.writes 42 + in 43 + let%lwt {commit= commit_cid, {rev; _}; results= aw_results} = 44 + Repository.apply_writes repo repo_writes 50 45 (Option.map Cid.as_cid input.swap_commit) 51 46 in 47 + let results = 48 + Option.some 49 + @@ List.map 50 + (fun r -> 51 + r |> Repository.apply_writes_result_to_yojson 52 + |> results_item_of_yojson |> Result.get_ok ) 53 + aw_results 54 + in 52 55 Dream.json @@ Yojson.Safe.to_string 53 - @@ response_to_yojson 56 + @@ output_to_yojson 54 57 {commit= Some {cid= Cid.to_string commit_cid; rev}; results} )
+10 -39
pegasus/lib/api/repo/createRecord.ml
··· 1 - type request = 2 - { repo: string 3 - ; collection: string 4 - ; rkey: string option [@default None] 5 - ; validate: bool option [@default None] 6 - ; record: Mist.Lex.repo_record 7 - ; swap_record: string option [@key "swapRecord"] [@default None] 8 - ; swap_commit: string option [@key "swapCommit"] [@default None] } 9 - [@@deriving yojson {strict= false}] 10 - 11 - type response = 12 - { uri: string 13 - ; cid: string 14 - ; commit: res_commit option [@default None] 15 - ; validation_status: string option [@key "validationStatus"] [@default None] 16 - } 17 - [@@deriving yojson {strict= false}] 18 - 19 - and res_commit = {cid: string; rev: string} [@@deriving yojson] 1 + open Lexicons.Com_atproto_repo_createRecord.Main 20 2 21 3 let calc_key_did ctx = Some (Auth.get_authed_did_exn ctx.Xrpc.auth) 22 4 ··· 34 16 ; calc_key= Some calc_key_did 35 17 ; calc_points= Some calc_points_create } ] 36 18 (fun ctx -> 37 - let%lwt input = Xrpc.parse_body ctx.req request_of_yojson in 19 + let%lwt input = Xrpc.parse_body ctx.req input_of_yojson in 38 20 let%lwt did = Xrpc.resolve_repo_did_authed ctx input.repo in 39 21 Auth.assert_repo_scope ctx.auth ~collection:input.collection 40 22 ~action:Oauth.Scopes.Create ; 41 23 let%lwt repo = Repository.load did in 42 24 let write : Repository.repo_write = 43 - match input.swap_record with 44 - | Some swap_record -> ( 45 - match input.rkey with 46 - | Some rkey -> 47 - Update 48 - { type'= Repository.Write_op.update 49 - ; collection= input.collection 50 - ; rkey 51 - ; value= input.record 52 - ; swap_record= Some (Cid.as_cid swap_record) } 53 - | None -> 54 - Errors.invalid_request "rkey is required for swap_record" ) 55 - | None -> 56 - Create 57 - { type'= Repository.Write_op.create 58 - ; collection= input.collection 59 - ; rkey= input.rkey 60 - ; value= input.record } 25 + Create 26 + { type'= Repository.Write_op.create 27 + ; collection= input.collection 28 + ; rkey= input.rkey 29 + ; value= 30 + Result.get_ok @@ Repository.Lex.repo_record_of_yojson input.record 31 + } 61 32 in 62 33 let%lwt {commit= commit_cid, {rev; _}; results} = 63 34 Repository.apply_writes repo [write] ··· 66 37 match List.hd results with 67 38 | Create {uri; cid; _} | Update {uri; cid; _} -> 68 39 Dream.json @@ Yojson.Safe.to_string 69 - @@ response_to_yojson 40 + @@ output_to_yojson 70 41 { uri 71 42 ; cid= Cid.to_string cid 72 43 ; commit= Some {cid= Cid.to_string commit_cid; rev}
+3 -14
pegasus/lib/api/repo/deleteRecord.ml
··· 1 - type request = 2 - { repo: string 3 - ; collection: string 4 - ; rkey: string 5 - ; swap_record: string option [@key "swapRecord"] [@default None] 6 - ; swap_commit: string option [@key "swapCommit"] [@default None] } 7 - [@@deriving yojson {strict= false}] 8 - 9 - type response = {commit: res_commit option [@default None]} 10 - [@@deriving yojson {strict= false}] 11 - 12 - and res_commit = {cid: string; rev: string} [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_repo_deleteRecord.Main 13 2 14 3 let calc_key_did ctx = Some (Auth.get_authed_did_exn ctx.Xrpc.auth) 15 4 ··· 27 16 ; calc_key= Some calc_key_did 28 17 ; calc_points= Some calc_points_delete } ] 29 18 (fun ctx -> 30 - let%lwt input = Xrpc.parse_body ctx.req request_of_yojson in 19 + let%lwt input = Xrpc.parse_body ctx.req input_of_yojson in 31 20 Auth.assert_repo_scope ctx.auth ~collection:input.collection 32 21 ~action:Oauth.Scopes.Delete ; 33 22 let%lwt did = Xrpc.resolve_repo_did_authed ctx input.repo in ··· 46 35 match List.hd results with 47 36 | Delete _ -> 48 37 Dream.json @@ Yojson.Safe.to_string 49 - @@ response_to_yojson 38 + @@ output_to_yojson 50 39 {commit= Some {cid= Cid.to_string commit_cid; rev}} 51 40 | _ -> 52 41 Errors.invalid_request "unexpected create or update result" )
+4 -12
pegasus/lib/api/repo/describeRepo.ml
··· 1 - type query = {repo: string} [@@deriving yojson {strict= false}] 2 - 3 - type response = 4 - { handle: string 5 - ; did: string 6 - ; did_doc: Id_resolver.Did.Document.t [@key "didDoc"] 7 - ; collections: string list 8 - ; handle_is_correct: bool [@key "handleIsCorrect"] } 9 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_repo_describeRepo.Main 10 2 11 3 let handler = 12 4 Xrpc.handler (fun ctx -> 13 - let input = Xrpc.parse_query ctx.req query_of_yojson in 5 + let input = Xrpc.parse_query ctx.req params_of_yojson in 14 6 let%lwt did = Xrpc.resolve_repo_did ctx input.repo in 15 7 let%lwt did_doc = 16 8 match%lwt Id_resolver.Did.resolve did with ··· 28 20 let%lwt repo = Repository.load did in 29 21 let%lwt collections = Repository.list_collections repo in 30 22 Dream.json @@ Yojson.Safe.to_string 31 - @@ response_to_yojson 23 + @@ output_to_yojson 32 24 { handle 33 25 ; did 34 - ; did_doc 26 + ; did_doc= Id_resolver.Did.Document.to_yojson did_doc 35 27 ; collections 36 28 ; handle_is_correct= true (* what am I, a cop? *) } )
+6 -11
pegasus/lib/api/repo/getRecord.ml
··· 1 - type query = 2 - { repo: string 3 - ; collection: string 4 - ; rkey: string 5 - ; cid: string option [@default None] } 6 - [@@deriving yojson {strict= false}] 7 - 8 - type response = {uri: string; cid: string; value: Mist.Lex.repo_record} 9 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_repo_getRecord.Main 10 2 11 3 let handler = 12 4 Xrpc.handler (fun ctx -> 13 - let input = Xrpc.parse_query ctx.req query_of_yojson in 5 + let input = Xrpc.parse_query ctx.req params_of_yojson in 14 6 let%lwt input_did = 15 7 Lwt_result.catch @@ fun () -> Xrpc.resolve_repo_did ctx input.repo 16 8 in ··· 26 18 | Some {cid; value; _} 27 19 when input.cid = None || input.cid = Some (Cid.to_string cid) -> 28 20 Dream.json @@ Yojson.Safe.to_string 29 - @@ response_to_yojson {uri; cid= Cid.to_string cid; value} 21 + @@ output_to_yojson 22 + { uri 23 + ; cid= Some (Cid.to_string cid) 24 + ; value= Repository.Lex.repo_record_to_yojson value } 30 25 | _ -> 31 26 Errors.internal_error ~name:"RecordNotFound" 32 27 ~msg:("could not find record " ^ uri)
-2
pegasus/lib/api/repo/importRepo.ml
··· 1 - type query = {did: string} [@@deriving yojson {strict= false}] 2 - 3 1 let rec stream_to_seq stream () = 4 2 let%lwt chunk = Dream.read stream in 5 3 match chunk with
+4 -12
pegasus/lib/api/repo/listMissingBlobs.ml
··· 1 - type query = 2 - {limit: int option [@default None]; cursor: string option [@default None]} 3 - [@@deriving yojson {strict= false}] 4 - 5 - type response = 6 - {cursor: string option [@default None]; blobs: response_blob list} 7 - [@@deriving yojson {strict= false}] 8 - 9 - and response_blob = {cid: string; record_uri: string [@key "recordUri"]} 10 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_repo_listMissingBlobs 2 + open Main 11 3 12 4 let handler = 13 5 Xrpc.handler (fun ctx -> 14 - let {limit; cursor} = Xrpc.parse_query ctx.req query_of_yojson in 6 + let {limit; cursor} = Xrpc.parse_query ctx.req params_of_yojson in 15 7 let limit = 16 8 match limit with 17 9 | Some limit when limit > 0 && limit <= 1000 -> ··· 32 24 blobs 33 25 in 34 26 {cursor= !next_cursor; blobs} 35 - |> response_to_yojson |> Yojson.Safe.to_string |> Dream.json ) 27 + |> output_to_yojson |> Yojson.Safe.to_string |> Dream.json )
+7 -17
pegasus/lib/api/repo/listRecords.ml
··· 1 - type query = 2 - { repo: string 3 - ; collection: string 4 - ; limit: int option [@default None] 5 - ; cursor: string option [@default None] 6 - ; reverse: bool option [@default None] } 7 - [@@deriving yojson {strict= false}] 8 - 9 - type response = 10 - {cursor: string option [@default None]; records: response_record list} 11 - [@@deriving yojson {strict= false}] 12 - 13 - and response_record = {uri: string; cid: string; value: Mist.Lex.repo_record} 14 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_repo_listRecords 2 + open Main 15 3 16 4 let handler = 17 5 Xrpc.handler (fun ctx -> 18 - let input = Xrpc.parse_query ctx.req query_of_yojson in 6 + let input = Xrpc.parse_query ctx.req params_of_yojson in 19 7 let limit = 20 8 match input.limit with 21 9 | Some limit when limit > 0 && limit <= 100 -> ··· 34 22 (fun (_cursor, results_rev) (record : User_store.Types.record) -> 35 23 let uri = "at://" ^ input_did ^ "/" ^ record.path in 36 24 ( record.since 37 - , {uri; cid= Cid.to_string record.cid; value= record.value} 25 + , { uri 26 + ; cid= Cid.to_string record.cid 27 + ; value= Repository.Lex.repo_record_to_yojson record.value } 38 28 :: results_rev ) ) 39 29 ("", []) results 40 30 in 41 31 let cursor = if List.length results = limit then Some cursor else None in 42 32 Dream.json @@ Yojson.Safe.to_string 43 - @@ response_to_yojson {cursor; records= List.rev results_rev} ) 33 + @@ output_to_yojson {cursor; records= List.rev results_rev} )
+9 -23
pegasus/lib/api/repo/putRecord.ml
··· 1 - type request = 2 - { repo: string 3 - ; collection: string 4 - ; rkey: string 5 - ; validate: bool option [@default None] 6 - ; record: Mist.Lex.repo_record 7 - ; swap_record: string option [@key "swapRecord"] [@default None] 8 - ; swap_commit: string option [@key "swapCommit"] [@default None] } 9 - [@@deriving yojson {strict= false}] 10 - 11 - type response = 12 - { uri: string 13 - ; cid: string 14 - ; commit: res_commit option [@default None] 15 - ; validation_status: string option [@key "validationStatus"] [@default None] 16 - } 17 - [@@deriving yojson {strict= false}] 18 - 19 - and res_commit = {cid: string; rev: string} [@@deriving yojson] 1 + open Lexicons.Com_atproto_repo_putRecord.Main 20 2 21 3 let calc_key_did ctx = Some (Auth.get_authed_did_exn ctx.Xrpc.auth) 22 4 ··· 34 16 ; calc_key= Some calc_key_did 35 17 ; calc_points= Some calc_points_put } ] 36 18 (fun ctx -> 37 - let%lwt input = Xrpc.parse_body ctx.req request_of_yojson in 19 + let%lwt input = Xrpc.parse_body ctx.req input_of_yojson in 38 20 (* assert create and update because we don't know which will end up happening *) 39 21 Auth.assert_repo_scope ctx.auth ~collection:input.collection 40 22 ~action:Oauth.Scopes.Create ; ··· 49 31 { type'= Repository.Write_op.update 50 32 ; collection= input.collection 51 33 ; rkey= input.rkey 52 - ; value= input.record 34 + ; value= 35 + Result.get_ok 36 + @@ Repository.Lex.repo_record_of_yojson input.record 53 37 ; swap_record= Some (Cid.as_cid swap_record) } 54 38 | None -> 55 39 Create 56 40 { type'= Repository.Write_op.create 57 41 ; collection= input.collection 58 42 ; rkey= Some input.rkey 59 - ; value= input.record } 43 + ; value= 44 + Result.get_ok 45 + @@ Repository.Lex.repo_record_of_yojson input.record } 60 46 in 61 47 let%lwt {commit= commit_cid, {rev; _}; results} = 62 48 Repository.apply_writes repo [write] ··· 65 51 match List.hd results with 66 52 | Create {uri; cid; _} | Update {uri; cid; _} -> 67 53 Dream.json @@ Yojson.Safe.to_string 68 - @@ response_to_yojson 54 + @@ output_to_yojson 69 55 { uri 70 56 ; cid= Cid.to_string cid 71 57 ; commit= Some {cid= Cid.to_string commit_cid; rev}
+6 -3
pegasus/lib/api/repo/uploadBlob.ml
··· 1 - type response = {blob: Mist.Blob_ref.typed_json_ref} 2 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_repo_uploadBlob.Main 3 2 4 3 let handler = 5 4 Xrpc.handler ~auth:Authorization (fun ctx -> ··· 15 14 let%lwt user_db = User_store.connect did in 16 15 let%lwt _ = User_store.put_blob user_db cid mime_type data in 17 16 Dream.json @@ Yojson.Safe.to_string 18 - @@ response_to_yojson {blob= {type'= "blob"; ref= cid; mime_type; size}} ) 17 + @@ output_to_yojson 18 + { blob= 19 + {type'= "blob"; ref= cid; mime_type; size} 20 + |> Mist.Blob_ref.typed_json_ref_to_yojson 21 + |> Hermes.blob_of_yojson |> Result.get_ok } )
+2 -12
pegasus/lib/api/server/checkAccountStatus.ml
··· 1 - type response = 2 - { activated: bool 3 - ; valid_did: bool [@key "validDid"] 4 - ; repo_commit: string [@key "repoCommit"] 5 - ; repo_rev: string [@key "repoRev"] 6 - ; repo_blocks: int [@key "repoBlocks"] 7 - ; indexed_records: int [@key "indexedRecords"] 8 - ; private_state_values: int [@key "privateStateValues"] 9 - ; expected_blobs: int [@key "expectedBlobs"] 10 - ; imported_blobs: int [@key "importedBlobs"] } 11 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_checkAccountStatus.Main 12 2 13 3 let get_account_status did = 14 4 let%lwt {db= us; commit; actor; _} = Repository.load did in ··· 48 38 let did = Auth.get_authed_did_exn auth in 49 39 match%lwt get_account_status did with 50 40 | Ok status -> 51 - status |> response_to_yojson |> Yojson.Safe.to_string |> Dream.json 41 + status |> output_to_yojson |> Yojson.Safe.to_string |> Dream.json 52 42 | Error msg -> 53 43 Errors.internal_error ~msg () )
+2 -3
pegasus/lib/api/server/confirmEmail.ml
··· 1 - type request = {email: string; token: string} 2 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_confirmEmail.Main 3 2 4 3 type confirm_error = InvalidToken | ExpiredToken | EmailMismatch 5 4 ··· 23 22 Auth.assert_account_scope auth ~attr:Oauth.Scopes.Email 24 23 ~action:Oauth.Scopes.Manage ; 25 24 let did = Auth.get_authed_did_exn auth in 26 - let%lwt {email; token} = Xrpc.parse_body req request_of_yojson in 25 + let%lwt {email; token} = Xrpc.parse_body req input_of_yojson in 27 26 match%lwt Data_store.get_actor_by_identifier did db with 28 27 | None -> 29 28 Errors.invalid_request ~name:"AccountNotFound" "account not found"
+8 -22
pegasus/lib/api/server/createAccount.ml
··· 1 - type request = 2 - { email: string 3 - ; handle: string 4 - ; did: string option [@default None] 5 - ; password: string 6 - ; invite_code: string option [@key "inviteCode"] [@default None] 7 - ; recovery_key: string option [@key "recoveryKey"] [@default None] } 8 - [@@deriving yojson {strict= false}] 9 - 10 - type response = 11 - { access_jwt: string [@key "accessJwt"] 12 - ; refresh_jwt: string [@key "refreshJwt"] 13 - ; handle: string 14 - ; did: string } 15 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_createAccount.Main 16 2 17 3 type create_account_error = 18 4 | InviteCodeRequired ··· 119 105 (Util.Constants.user_db_filepath did) 120 106 ~perm:0o644 121 107 in 122 - let%lwt repo = 123 - Repository.load ~create:true did 124 - in 108 + let%lwt repo = Repository.load ~create:true did in 125 109 let%lwt _ = Repository.put_initial_commit repo in 126 110 let%lwt _ = Sequencer.sequence_identity db ~did ~handle () in 127 111 let%lwt _ = ··· 148 132 149 133 let handler = 150 134 Xrpc.handler (fun ctx -> 151 - let%lwt input = Xrpc.parse_body ctx.req request_of_yojson in 135 + let%lwt input = Xrpc.parse_body ctx.req input_of_yojson in 152 136 match%lwt 153 - create_account ~email:input.email ~handle:input.handle 154 - ~password:input.password ?invite_code:input.invite_code ?did:input.did 137 + create_account ~email:(Option.get input.email) ~handle:input.handle 138 + ~password:(Option.get input.password) 139 + ?invite_code:input.invite_code ?did:input.did 155 140 ?recovery_key:input.recovery_key ctx.db 156 141 with 157 142 | Error InviteCodeRequired -> ··· 174 159 | Ok {did; handle} -> 175 160 let access_jwt, refresh_jwt = Jwt.generate_jwt did in 176 161 Dream.json @@ Yojson.Safe.to_string 177 - @@ response_to_yojson {access_jwt; refresh_jwt; did; handle} ) 162 + @@ output_to_yojson 163 + {access_jwt; refresh_jwt; did; handle; did_doc= None} )
+3 -8
pegasus/lib/api/server/createInviteCode.ml
··· 1 - type request = 2 - { use_count: int [@key "useCount"] 3 - ; for_account: string option [@key "forAccount"] [@default None] } 4 - [@@deriving yojson] 5 - 6 - type response = {code: string} [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_createInviteCode.Main 7 2 8 3 let generate_code did = 9 4 String.sub ··· 19 14 let handler = 20 15 Xrpc.handler ~auth:Admin (fun {req; db; _} -> 21 16 let%lwt {use_count; for_account} = 22 - Xrpc.parse_body req request_of_yojson 17 + Xrpc.parse_body req input_of_yojson 23 18 in 24 19 let%lwt code = 25 20 create_invite_code ~db 26 21 ~did:(Option.value for_account ~default:"admin") 27 22 ~use_count 28 23 in 29 - Dream.json @@ Yojson.Safe.to_string @@ response_to_yojson {code} ) 24 + Dream.json @@ Yojson.Safe.to_string @@ output_to_yojson {code} )
+4 -11
pegasus/lib/api/server/createInviteCodes.ml
··· 1 - type request = 2 - { code_count: int [@key "codeCount"] [@default 1] 3 - ; use_count: int [@key "useCount"] 4 - ; for_accounts: string list option [@key "forAccounts"] [@default None] } 5 - [@@deriving yojson {strict= false}] 6 - 7 - type account_codes = {account: string; codes: string list} [@@deriving yojson] 8 - 9 - type response = {codes: account_codes list} [@@deriving yojson] 1 + open Lexicons.Com_atproto_server_createInviteCodes 2 + open Main 10 3 11 4 let handler = 12 5 Xrpc.handler ~auth:Admin (fun {req; db; _} -> 13 6 let%lwt {code_count; use_count; for_accounts} = 14 - Xrpc.parse_body req request_of_yojson 7 + Xrpc.parse_body req input_of_yojson 15 8 in 16 9 let code_count = Int.max 1 (Int.min code_count 100) in 17 10 let use_count = Int.max 1 (Int.min use_count 100) in ··· 33 26 Lwt.return {account; codes= account_codes} ) 34 27 accounts 35 28 in 36 - Dream.json @@ Yojson.Safe.to_string @@ response_to_yojson {codes} ) 29 + Dream.json @@ Yojson.Safe.to_string @@ output_to_yojson {codes} )
+8 -25
pegasus/lib/api/server/createSession.ml
··· 1 - type request = 2 - { identifier: string 3 - ; password: string 4 - ; auth_factor_token: string option [@key "authFactorToken"] [@default None] } 5 - [@@deriving yojson {strict= false}] 6 - 7 - type response = 8 - { access_jwt: string [@key "accessJwt"] 9 - ; refresh_jwt: string [@key "refreshJwt"] 10 - ; handle: string 11 - ; did: string 12 - ; email: string 13 - ; email_confirmed: bool [@key "emailConfirmed"] 14 - ; email_auth_factor: bool [@key "emailAuthFactor"] 15 - ; active: bool option [@default None] 16 - ; status: string option [@default None] } 17 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_createSession.Main 18 2 19 3 let consume_points = 1 20 4 21 5 let handler = 22 6 Xrpc.handler (fun {req; db; _} -> 23 - let%lwt {identifier; password; _} = 24 - Xrpc.parse_body req request_of_yojson 25 - in 7 + let%lwt {identifier; password; _} = Xrpc.parse_body req input_of_yojson in 26 8 let id = String.lowercase_ascii identifier in 27 9 (* apply rate limits after parsing body so we can create key from identifier *) 28 10 let key = id ^ "-" ^ Util.request_ip req in ··· 47 29 (Some false, Some "deactivated") 48 30 in 49 31 Dream.json @@ Yojson.Safe.to_string 50 - @@ response_to_yojson 32 + @@ output_to_yojson 51 33 { access_jwt 52 34 ; refresh_jwt 53 35 ; handle= actor.handle 54 36 ; did= actor.did 55 - ; email= actor.email 56 - ; email_confirmed= true 57 - ; email_auth_factor= true 37 + ; email= Some actor.email 38 + ; email_confirmed= Some true 39 + ; email_auth_factor= Some true 58 40 ; active 59 - ; status } 41 + ; status 42 + ; did_doc= None } 60 43 | Ok _ -> 61 44 Errors.invalid_request "invalid credentials" 62 45 | Error e ->
+2 -3
pegasus/lib/api/server/deactivateAccount.ml
··· 1 - type request = {delete_after: string option [@key "deleteAfter"] [@default None]} 2 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_deactivateAccount.Main 3 2 4 3 let deactivate_account ~did db = 5 4 let%lwt () = Data_store.deactivate_actor did db in ··· 9 8 Xrpc.handler ~auth:Authorization (fun {req; auth; db; _} -> 10 9 let did = Auth.get_authed_did_exn auth in 11 10 (* TODO: handle delete_after *) 12 - let%lwt _req = Xrpc.parse_body req request_of_yojson in 11 + let%lwt _req = Xrpc.parse_body req input_of_yojson in 13 12 let%lwt _ = deactivate_account ~did db in 14 13 Dream.empty `OK )
+2 -3
pegasus/lib/api/server/deleteAccount.ml
··· 1 - type request = {did: string; password: string; token: string} 2 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_deleteAccount.Main 3 2 4 3 let rec rm_rf path = 5 4 if Sys.is_directory path then ( ··· 34 33 35 34 let handler = 36 35 Xrpc.handler (fun {req; db; _} -> 37 - let%lwt {did; password; token} = Xrpc.parse_body req request_of_yojson in 36 + let%lwt {did; password; token} = Xrpc.parse_body req input_of_yojson in 38 37 match%lwt Data_store.get_actor_by_identifier did db with 39 38 | None -> 40 39 Errors.invalid_request "account not found"
+2 -2
pegasus/lib/api/server/getServiceAuth.ml
··· 1 - type response = {token: string} [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_getServiceAuth.Main 2 2 3 3 let handler = 4 4 Xrpc.handler ~auth:Authorization (fun {req; auth; db; _} -> ··· 22 22 in 23 23 let signing_key = Kleidos.parse_multikey_str signing_multikey in 24 24 let token = Jwt.generate_service_jwt ~did ~aud ~lxm ~signing_key in 25 - Dream.json @@ Yojson.Safe.to_string @@ response_to_yojson {token} ) 25 + Dream.json @@ Yojson.Safe.to_string @@ output_to_yojson {token} )
+5 -2
pegasus/lib/api/server/getSession.ml
··· 1 - type response = Auth.session_info [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_getSession.Main 2 2 3 3 let handler = 4 4 Xrpc.handler ~auth:Authorization (fun {db; auth; _} -> ··· 13 13 ; email_confirmed= Some false 14 14 ; email_auth_factor= Some false } 15 15 in 16 - Dream.json @@ Yojson.Safe.to_string @@ Auth.session_info_to_yojson session ) 16 + Dream.json @@ Yojson.Safe.to_string 17 + @@ output_to_yojson 18 + (session |> Auth.session_info_to_yojson |> output_of_yojson 19 + |> Result.get_ok ) )
+23 -11
pegasus/lib/api/server/refreshSession.ml
··· 1 - type response = 2 - { access_jwt: string [@key "accessJwt"] 3 - ; refresh_jwt: string [@key "refreshJwt"] 4 - ; handle: string 5 - ; did: string 6 - ; active: bool option [@default None] 7 - ; status: string option [@default None] } 8 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_refreshSession.Main 9 2 10 3 let handler = 11 4 Xrpc.handler ~auth:Refresh (fun {db; auth; _} -> ··· 17 10 failwith "non-refresh auth" 18 11 in 19 12 let%lwt () = Data_store.revoke_token ~did ~jti db in 20 - let%lwt {handle; did; active; status; _} = Auth.get_session_info did db in 13 + let%lwt 14 + { handle 15 + ; did 16 + ; email 17 + ; email_auth_factor 18 + ; email_confirmed 19 + ; active 20 + ; status 21 + ; _ } = 22 + Auth.get_session_info did db 23 + in 21 24 let access_jwt, refresh_jwt = Jwt.generate_jwt did in 22 25 Dream.json @@ Yojson.Safe.to_string 23 - @@ response_to_yojson 24 - {access_jwt; refresh_jwt; handle; did; active; status} ) 26 + @@ output_to_yojson 27 + { access_jwt 28 + ; refresh_jwt 29 + ; handle 30 + ; did 31 + ; email 32 + ; email_auth_factor 33 + ; email_confirmed 34 + ; active 35 + ; status 36 + ; did_doc= None } )
+2 -3
pegasus/lib/api/server/requestEmailUpdate.ml
··· 1 - type response = {token_required: bool [@key "tokenRequired"]} 2 - [@@deriving yojson] 1 + open Lexicons.Com_atproto_server_requestEmailUpdate.Main 3 2 4 3 let request_email_update ?pending_email (actor : Data_store.Types.actor) db = 5 4 let token_required = ··· 65 64 | Some actor -> 66 65 let%lwt token_required = request_email_update actor db in 67 66 Dream.json @@ Yojson.Safe.to_string 68 - @@ response_to_yojson {token_required} ) 67 + @@ output_to_yojson {token_required} )
+2 -2
pegasus/lib/api/server/requestPasswordReset.ml
··· 1 - type request = {email: string} [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_requestPasswordReset.Main 2 2 3 3 let request_password_reset (actor : Data_store.Types.actor) db = 4 4 let did = actor.did in ··· 36 36 | None -> 37 37 Errors.internal_error ~msg:"actor not found" () ) 38 38 | _ -> ( 39 - let%lwt {email} = Xrpc.parse_body req request_of_yojson in 39 + let%lwt {email} = Xrpc.parse_body req input_of_yojson in 40 40 let email = String.lowercase_ascii email in 41 41 match%lwt Data_store.get_actor_by_identifier email db with 42 42 | Some actor ->
+4 -7
pegasus/lib/api/server/reserveSigningKey.ml
··· 1 - type request = {did: string option [@default None]} 2 - [@@deriving yojson {strict= false}] 3 - 4 - type response = {signing_key: string [@key "signingKey"]} [@@deriving yojson] 1 + open Lexicons.Com_atproto_server_reserveSigningKey.Main 5 2 6 3 let handler = 7 4 Xrpc.handler (fun {req; db; _} -> 8 - let%lwt {did} = Xrpc.parse_body req request_of_yojson in 5 + let%lwt {did} = Xrpc.parse_body req input_of_yojson in 9 6 let%lwt existing = 10 7 match did with 11 8 | Some did when did <> "" -> ··· 16 13 match existing with 17 14 | Some key -> 18 15 Dream.json @@ Yojson.Safe.to_string 19 - @@ response_to_yojson {signing_key= key.key_did} 16 + @@ output_to_yojson {signing_key= key.key_did} 20 17 | None -> 21 18 let privkey, pubkey = Kleidos.K256.generate_keypair () in 22 19 let key_did = Kleidos.K256.pubkey_to_did_key pubkey in ··· 25 22 Data_store.create_reserved_key ~key_did ~did ~private_key db 26 23 in 27 24 Dream.json @@ Yojson.Safe.to_string 28 - @@ response_to_yojson {signing_key= key_did} ) 25 + @@ output_to_yojson {signing_key= key_did} )
+2 -3
pegasus/lib/api/server/resetPassword.ml
··· 1 - type request = {token: string; password: string} 2 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_resetPassword.Main 3 2 4 3 type reset_password_error = InvalidToken | ExpiredToken 5 4 ··· 27 26 ; calc_key= None 28 27 ; calc_points= None } ] 29 28 (fun {req; db; _} -> 30 - let%lwt {token; password} = Xrpc.parse_body req request_of_yojson in 29 + let%lwt {token; password} = Xrpc.parse_body req input_of_yojson in 31 30 match%lwt reset_password ~token ~password db with 32 31 | Ok did -> 33 32 Dream.log "password reset completed for %s" did ;
+2 -6
pegasus/lib/api/server/updateEmail.ml
··· 1 - type request = 2 - { email: string 3 - ; email_auth_factor: bool option [@key "emailAuthFactor"] [@default None] 4 - ; token: string option [@default None] } 5 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_server_updateEmail.Main 6 2 7 3 type update_email_error = 8 4 | TokenRequired ··· 46 42 Auth.assert_account_scope auth ~attr:Oauth.Scopes.Email 47 43 ~action:Oauth.Scopes.Manage ; 48 44 let did = Auth.get_authed_did_exn auth in 49 - let%lwt {email; token; _} = Xrpc.parse_body req request_of_yojson in 45 + let%lwt {email; token; _} = Xrpc.parse_body req input_of_yojson in 50 46 let email = String.lowercase_ascii email in 51 47 match%lwt Data_store.get_actor_by_identifier did db with 52 48 | None ->
+2 -2
pegasus/lib/api/sync/getBlob.ml
··· 1 - type query = {did: string; cid: string} [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_sync_getBlob.Main 2 2 3 3 let handler = 4 4 Xrpc.handler (fun ctx -> 5 - let {did; cid} = Xrpc.parse_query ctx.req query_of_yojson in 5 + let {did; cid} = Xrpc.parse_query ctx.req params_of_yojson in 6 6 let cid_parsed = Cid.as_cid cid in 7 7 let%lwt {db; _} = Repository.load did ~ensure_active:true in 8 8 let%lwt blob_meta = User_store.get_blob_metadata db cid_parsed in
+2 -3
pegasus/lib/api/sync/getBlocks.ml
··· 1 - type query = {did: string; cids: string list} 2 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_sync_getBlocks.Main 3 2 4 3 let handler = 5 4 Xrpc.handler (fun ctx -> 6 - let {did; cids} : query = Xrpc.parse_query ctx.req query_of_yojson in 5 + let {did; cids} = Xrpc.parse_query ctx.req params_of_yojson in 7 6 let%lwt {db; commit; _} = Repository.load did ~ensure_active:true in 8 7 let commit_cid, commit_signed = Option.get commit in 9 8 let commit_block =
+3 -5
pegasus/lib/api/sync/getLatestCommit.ml
··· 1 - type query = {did: string} [@@deriving yojson {strict= false}] 2 - 3 - type response = {cid: string; rev: string} [@@deriving yojson] 1 + open Lexicons.Com_atproto_sync_getLatestCommit.Main 4 2 5 3 let handler = 6 4 Xrpc.handler (fun ctx -> 7 - let {did} : query = Xrpc.parse_query ctx.req query_of_yojson in 5 + let {did} = Xrpc.parse_query ctx.req params_of_yojson in 8 6 match%lwt Repository.load did ~ensure_active:true with 9 7 | {commit= Some (cid, {rev; _}); _} -> 10 8 let cid = Cid.to_string cid in 11 - Dream.json @@ Yojson.Safe.to_string @@ response_to_yojson {cid; rev} 9 + Dream.json @@ Yojson.Safe.to_string @@ output_to_yojson {cid; rev} 12 10 | _ -> 13 11 failwith ("couldn't resolve commit for " ^ did) )
+3 -4
pegasus/lib/api/sync/getRecord.ml
··· 1 1 module Mst = Mist.Mst.Make (User_store) 2 2 3 - type query = {did: string; collection: string; rkey: string} 4 - [@@deriving yojson {strict= false}] 3 + open Lexicons.Com_atproto_sync_getRecord.Main 5 4 6 5 let handler = 7 6 Xrpc.handler (fun ctx -> 8 - let {did; collection; rkey} : query = 9 - Xrpc.parse_query ctx.req query_of_yojson 7 + let {did; collection; rkey} = 8 + Xrpc.parse_query ctx.req params_of_yojson 10 9 in 11 10 let path = collection ^ "/" ^ rkey in 12 11 let%lwt repo = Repository.load did ~ensure_active:true in
+2 -2
pegasus/lib/api/sync/getRepo.ml
··· 1 - type query = {did: string} [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_sync_getRepo.Main 2 2 3 3 let handler = 4 4 Xrpc.handler (fun ctx -> 5 - let {did} : query = Xrpc.parse_query ctx.req query_of_yojson in 5 + let {did; _} = Xrpc.parse_query ctx.req params_of_yojson in 6 6 let%lwt repo = Repository.load did ~ensure_active:true in 7 7 let%lwt car_stream = Repository.export_car repo in 8 8 Dream.stream
+3 -7
pegasus/lib/api/sync/getRepoStatus.ml
··· 1 - type query = {did: string} [@@deriving yojson {strict= false}] 2 - 3 - type response = 4 - {did: string; active: bool; status: string option; rev: string option} 5 - [@@deriving yojson] 1 + open Lexicons.Com_atproto_sync_getRepoStatus.Main 6 2 7 3 let handler = 8 4 Xrpc.handler (fun ctx -> 9 - let {did} : query = Xrpc.parse_query ctx.req query_of_yojson in 5 + let {did} : params = Xrpc.parse_query ctx.req params_of_yojson in 10 6 let%lwt actor = 11 7 match%lwt Data_store.get_actor_by_identifier did ctx.db with 12 8 | Some actor -> ··· 31 27 (true, None, Some commit.rev) 32 28 in 33 29 Dream.json @@ Yojson.Safe.to_string 34 - @@ response_to_yojson {did; active; status; rev} ) 30 + @@ output_to_yojson {did; active; status; rev} )
+3 -11
pegasus/lib/api/sync/listBlobs.ml
··· 1 - type query = 2 - { did: string 3 - ; since: string option [@default None] 4 - ; limit: int option [@default None] 5 - ; cursor: string option [@default None] } 6 - [@@deriving yojson {strict= false}] 7 - 8 - type response = {cursor: string option [@default None]; cids: string list} 9 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_sync_listBlobs.Main 10 2 11 3 let handler = 12 4 Xrpc.handler (fun ctx -> 13 5 let {did; since; limit; cursor} = 14 - Xrpc.parse_query ctx.req query_of_yojson 6 + Xrpc.parse_query ctx.req params_of_yojson 15 7 in 16 8 let cursor = Option.value ~default:"" cursor in 17 9 let limit = ··· 27 19 let cursor = 28 20 if List.length cids = limit then Mist.Util.last cids else None 29 21 in 30 - Dream.json @@ Yojson.Safe.to_string @@ response_to_yojson {cursor; cids} ) 22 + Dream.json @@ Yojson.Safe.to_string @@ output_to_yojson {cursor; cids} )
+4 -16
pegasus/lib/api/sync/listRepos.ml
··· 1 - type query = 2 - {cursor: string option [@default None]; limit: int option [@default None]} 3 - [@@deriving yojson {strict= false}] 4 - 5 - type response = {cursor: string option [@default None]; repos: res_repo list} 6 - [@@deriving yojson {strict= false}] 7 - 8 - and res_repo = 9 - { did: string 10 - ; head: string 11 - ; rev: string 12 - ; active: bool option [@default None] 13 - ; status: string option [@default None] } 14 - [@@deriving yojson {strict= false}] 1 + open Lexicons.Com_atproto_sync_listRepos 2 + open Main 15 3 16 4 let handler = 17 5 Xrpc.handler (fun ctx -> 18 - let {cursor; limit} = Xrpc.parse_query ctx.req query_of_yojson in 6 + let {cursor; limit} = Xrpc.parse_query ctx.req params_of_yojson in 19 7 let limit = 20 8 match limit with 21 9 | Some limit when limit > 0 && limit <= 1000 -> ··· 52 40 Option.map (fun r -> r.did) @@ Mist.Util.last repos 53 41 else None 54 42 in 55 - Dream.json @@ Yojson.Safe.to_string @@ response_to_yojson {cursor; repos} ) 43 + Dream.json @@ Yojson.Safe.to_string @@ output_to_yojson {cursor; repos} )
+3 -1
pegasus/lib/dune
··· 13 13 dream 14 14 emile 15 15 frontend 16 + hermes 16 17 ipld 17 18 kleidos 18 19 letters ··· 26 27 uri 27 28 uuidm 28 29 yojson 30 + hermes_ppx 29 31 lwt_ppx 30 32 ppx_deriving_yojson.runtime 31 33 ppx_rapper_lwt) 32 34 (preprocess 33 - (pps lwt_ppx ppx_deriving_yojson ppx_rapper))) 35 + (pps hermes_ppx lwt_ppx ppx_deriving_yojson ppx_rapper))) 34 36 35 37 (include_subdirs qualified)
+134
pegasus/lib/lexicons/app_bsky_actor_defs.ml
··· 1 + (* re-exported from App_bsky_shared_1 *) 2 + 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 6 + 7 + type profile_view = App_bsky_shared_1.profile_view 8 + let profile_view_of_yojson = App_bsky_shared_1.profile_view_of_yojson 9 + let profile_view_to_yojson = App_bsky_shared_1.profile_view_to_yojson 10 + 11 + 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 14 + 15 + 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 18 + 19 + 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 22 + 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 26 + 27 + type viewer_state = App_bsky_shared_1.actor_viewer_state 28 + let viewer_state_of_yojson = App_bsky_shared_1.actor_viewer_state_of_yojson 29 + let viewer_state_to_yojson = App_bsky_shared_1.actor_viewer_state_to_yojson 30 + 31 + type known_followers = App_bsky_shared_1.known_followers 32 + let known_followers_of_yojson = App_bsky_shared_1.known_followers_of_yojson 33 + let known_followers_to_yojson = App_bsky_shared_1.known_followers_to_yojson 34 + 35 + 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 38 + 39 + type verification_view = App_bsky_shared_1.verification_view 40 + let verification_view_of_yojson = App_bsky_shared_1.verification_view_of_yojson 41 + let verification_view_to_yojson = App_bsky_shared_1.verification_view_to_yojson 42 + 43 + type preferences = App_bsky_shared_1.preferences 44 + let preferences_of_yojson = App_bsky_shared_1.preferences_of_yojson 45 + let preferences_to_yojson = App_bsky_shared_1.preferences_to_yojson 46 + 47 + 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 50 + 51 + 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 54 + 55 + type saved_feed = App_bsky_shared_1.saved_feed 56 + let saved_feed_of_yojson = App_bsky_shared_1.saved_feed_of_yojson 57 + let saved_feed_to_yojson = App_bsky_shared_1.saved_feed_to_yojson 58 + 59 + 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 62 + 63 + type saved_feeds_pref = App_bsky_shared_1.saved_feeds_pref 64 + let saved_feeds_pref_of_yojson = App_bsky_shared_1.saved_feeds_pref_of_yojson 65 + let saved_feeds_pref_to_yojson = App_bsky_shared_1.saved_feeds_pref_to_yojson 66 + 67 + 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 70 + 71 + type declared_age_pref = App_bsky_shared_1.declared_age_pref 72 + let declared_age_pref_of_yojson = App_bsky_shared_1.declared_age_pref_of_yojson 73 + let declared_age_pref_to_yojson = App_bsky_shared_1.declared_age_pref_to_yojson 74 + 75 + type feed_view_pref = App_bsky_shared_1.feed_view_pref 76 + let feed_view_pref_of_yojson = App_bsky_shared_1.feed_view_pref_of_yojson 77 + let feed_view_pref_to_yojson = App_bsky_shared_1.feed_view_pref_to_yojson 78 + 79 + type thread_view_pref = App_bsky_shared_1.thread_view_pref 80 + let thread_view_pref_of_yojson = App_bsky_shared_1.thread_view_pref_of_yojson 81 + let thread_view_pref_to_yojson = App_bsky_shared_1.thread_view_pref_to_yojson 82 + 83 + type interests_pref = App_bsky_shared_1.interests_pref 84 + let interests_pref_of_yojson = App_bsky_shared_1.interests_pref_of_yojson 85 + let interests_pref_to_yojson = App_bsky_shared_1.interests_pref_to_yojson 86 + 87 + type muted_word_target = App_bsky_shared_1.muted_word_target 88 + let muted_word_target_of_yojson = App_bsky_shared_1.muted_word_target_of_yojson 89 + let muted_word_target_to_yojson = App_bsky_shared_1.muted_word_target_to_yojson 90 + 91 + type muted_word = App_bsky_shared_1.muted_word 92 + let muted_word_of_yojson = App_bsky_shared_1.muted_word_of_yojson 93 + let muted_word_to_yojson = App_bsky_shared_1.muted_word_to_yojson 94 + 95 + type muted_words_pref = App_bsky_shared_1.muted_words_pref 96 + let muted_words_pref_of_yojson = App_bsky_shared_1.muted_words_pref_of_yojson 97 + let muted_words_pref_to_yojson = App_bsky_shared_1.muted_words_pref_to_yojson 98 + 99 + type hidden_posts_pref = App_bsky_shared_1.hidden_posts_pref 100 + let hidden_posts_pref_of_yojson = App_bsky_shared_1.hidden_posts_pref_of_yojson 101 + let hidden_posts_pref_to_yojson = App_bsky_shared_1.hidden_posts_pref_to_yojson 102 + 103 + type labelers_pref = App_bsky_shared_1.labelers_pref 104 + let labelers_pref_of_yojson = App_bsky_shared_1.labelers_pref_of_yojson 105 + let labelers_pref_to_yojson = App_bsky_shared_1.labelers_pref_to_yojson 106 + 107 + type labeler_pref_item = App_bsky_shared_1.labeler_pref_item 108 + let labeler_pref_item_of_yojson = App_bsky_shared_1.labeler_pref_item_of_yojson 109 + let labeler_pref_item_to_yojson = App_bsky_shared_1.labeler_pref_item_to_yojson 110 + 111 + type bsky_app_state_pref = App_bsky_shared_1.bsky_app_state_pref 112 + let bsky_app_state_pref_of_yojson = App_bsky_shared_1.bsky_app_state_pref_of_yojson 113 + let bsky_app_state_pref_to_yojson = App_bsky_shared_1.bsky_app_state_pref_to_yojson 114 + 115 + type bsky_app_progress_guide = App_bsky_shared_1.bsky_app_progress_guide 116 + let bsky_app_progress_guide_of_yojson = App_bsky_shared_1.bsky_app_progress_guide_of_yojson 117 + let bsky_app_progress_guide_to_yojson = App_bsky_shared_1.bsky_app_progress_guide_to_yojson 118 + 119 + type nux = App_bsky_shared_1.nux 120 + let nux_of_yojson = App_bsky_shared_1.nux_of_yojson 121 + let nux_to_yojson = App_bsky_shared_1.nux_to_yojson 122 + 123 + type verification_prefs = App_bsky_shared_1.verification_prefs 124 + let verification_prefs_of_yojson = App_bsky_shared_1.verification_prefs_of_yojson 125 + let verification_prefs_to_yojson = App_bsky_shared_1.verification_prefs_to_yojson 126 + 127 + type post_interaction_settings_pref = App_bsky_shared_1.post_interaction_settings_pref 128 + let post_interaction_settings_pref_of_yojson = App_bsky_shared_1.post_interaction_settings_pref_of_yojson 129 + let post_interaction_settings_pref_to_yojson = App_bsky_shared_1.post_interaction_settings_pref_to_yojson 130 + 131 + type status_view = App_bsky_shared_1.status_view 132 + let status_view_of_yojson = App_bsky_shared_1.status_view_of_yojson 133 + let status_view_to_yojson = App_bsky_shared_1.status_view_to_yojson 134 +
+20
pegasus/lib/lexicons/app_bsky_actor_getPreferences.ml
··· 1 + (* generated from app.bsky.actor.getPreferences *) 2 + 3 + (** Get private preferences attached to the current account. Expected use is synchronization between multiple devices, and import/export during account migration. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.actor.getPreferences" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = 11 + { 12 + preferences: App_bsky_actor_defs.preferences; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + let call 17 + (client : Hermes.client) : output Lwt.t = 18 + Hermes.query client nsid (`Assoc []) output_of_yojson 19 + end 20 +
+22
pegasus/lib/lexicons/app_bsky_actor_getProfile.ml
··· 1 + (* generated from app.bsky.actor.getProfile *) 2 + 3 + (** Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.actor.getProfile" 6 + 7 + type params = 8 + { 9 + actor: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = App_bsky_actor_defs.profile_view_detailed 14 + [@@deriving yojson {strict= false}] 15 + 16 + let call 17 + ~actor 18 + (client : Hermes.client) : output Lwt.t = 19 + let params : params = {actor} in 20 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 21 + end 22 +
+25
pegasus/lib/lexicons/app_bsky_actor_getProfiles.ml
··· 1 + (* generated from app.bsky.actor.getProfiles *) 2 + 3 + (** Get detailed profile views of multiple actors. *) 4 + module Main = struct 5 + let nsid = "app.bsky.actor.getProfiles" 6 + 7 + type params = 8 + { 9 + actors: string list; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + profiles: App_bsky_actor_defs.profile_view_detailed list; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~actors 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {actors} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+29
pegasus/lib/lexicons/app_bsky_actor_getSuggestions.ml
··· 1 + (* generated from app.bsky.actor.getSuggestions *) 2 + 3 + (** Get a list of suggested actors. Expected use is discovery of accounts to follow during new account onboarding. *) 4 + module Main = struct 5 + let nsid = "app.bsky.actor.getSuggestions" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + cursor: string option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + 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}] 21 + 22 + let call 23 + ?limit 24 + ?cursor 25 + (client : Hermes.client) : output Lwt.t = 26 + let params : params = {limit; cursor} in 27 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 28 + end 29 +
+39
pegasus/lib/lexicons/app_bsky_actor_profile.ml
··· 1 + (* generated from app.bsky.actor.profile *) 2 + 3 + type labels = 4 + | SelfLabels of Com_atproto_label_defs.self_labels 5 + | Unknown of Yojson.Safe.t 6 + 7 + let labels_of_yojson json = 8 + let open Yojson.Safe.Util in 9 + try 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) 16 + with _ -> Error "failed to parse union" 17 + 18 + 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 24 + 25 + type main = 26 + { 27 + display_name: string option [@key "displayName"] [@default None]; 28 + description: string option [@default None]; 29 + pronouns: string option [@default None]; 30 + website: string option [@default None]; 31 + avatar: Hermes.blob option [@default None]; 32 + banner: Hermes.blob option [@default None]; 33 + labels: labels option [@default None]; 34 + joined_via_starter_pack: Com_atproto_repo_strongRef.main option [@key "joinedViaStarterPack"] [@default None]; 35 + pinned_post: Com_atproto_repo_strongRef.main option [@key "pinnedPost"] [@default None]; 36 + created_at: string option [@key "createdAt"] [@default None]; 37 + } 38 + [@@deriving yojson {strict= false}] 39 +
+26
pegasus/lib/lexicons/app_bsky_actor_putPreferences.ml
··· 1 + (* generated from app.bsky.actor.putPreferences *) 2 + 3 + (** Set the private preferences attached to the account. *) 4 + module Main = struct 5 + let nsid = "app.bsky.actor.putPreferences" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + preferences: App_bsky_actor_defs.preferences; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~preferences 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({preferences} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+32
pegasus/lib/lexicons/app_bsky_actor_searchActors.ml
··· 1 + (* generated from app.bsky.actor.searchActors *) 2 + 3 + (** Find actors (profiles) matching search criteria. Does not require auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.actor.searchActors" 6 + 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}] 15 + 16 + type output = 17 + { 18 + cursor: string option [@default None]; 19 + actors: App_bsky_actor_defs.profile_view list; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + let call 24 + ?term 25 + ?q 26 + ?limit 27 + ?cursor 28 + (client : Hermes.client) : output Lwt.t = 29 + let params : params = {term; q; limit; cursor} in 30 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 31 + end 32 +
+29
pegasus/lib/lexicons/app_bsky_actor_searchActorsTypeahead.ml
··· 1 + (* generated from app.bsky.actor.searchActorsTypeahead *) 2 + 3 + (** Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. Does not require auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.actor.searchActorsTypeahead" 6 + 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}] 14 + 15 + type output = 16 + { 17 + actors: App_bsky_actor_defs.profile_view_basic list; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ?term 23 + ?q 24 + ?limit 25 + (client : Hermes.client) : output Lwt.t = 26 + let params : params = {term; q; limit} in 27 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 28 + end 29 +
+36
pegasus/lib/lexicons/app_bsky_actor_status.ml
··· 1 + (* generated from app.bsky.actor.status *) 2 + 3 + type embed = 4 + | External of App_bsky_embed_external.main 5 + | Unknown of Yojson.Safe.t 6 + 7 + let embed_of_yojson json = 8 + let open Yojson.Safe.Util in 9 + try 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) 16 + with _ -> Error "failed to parse union" 17 + 18 + 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 24 + 25 + 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 + [@@deriving yojson {strict= false}] 33 + 34 + (** Advertises an account as currently offering live content. *) 35 + let live = "app.bsky.actor.status#live" 36 +
+32
pegasus/lib/lexicons/app_bsky_ageassurance_begin.ml
··· 1 + (* generated from app.bsky.ageassurance.begin *) 2 + 3 + (** Initiate Age Assurance for an account. *) 4 + module Main = struct 5 + let nsid = "app.bsky.ageassurance.begin" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + email: string; 13 + language: string; 14 + country_code: string [@key "countryCode"]; 15 + region_code: string option [@key "regionCode"] [@default None]; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + type output = App_bsky_ageassurance_defs.state 20 + [@@deriving yojson {strict= false}] 21 + 22 + let call 23 + ~email 24 + ~language 25 + ~country_code 26 + ?region_code 27 + (client : Hermes.client) : output Lwt.t = 28 + let params = () in 29 + let input = Some ({email; language; country_code; region_code} |> input_to_yojson) in 30 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 31 + end 32 +
+184
pegasus/lib/lexicons/app_bsky_ageassurance_defs.ml
··· 1 + (* generated from app.bsky.ageassurance.defs *) 2 + 3 + (** String type with known values: The access level granted based on Age Assurance data we've processed. *) 4 + type access = string 5 + let access_of_yojson = function 6 + | `String s -> Ok s 7 + | _ -> Error "access: expected string" 8 + let access_to_yojson s = `String s 9 + 10 + (** String type with known values: The status of the Age Assurance process. *) 11 + type status = string 12 + let status_of_yojson = function 13 + | `String s -> Ok s 14 + | _ -> Error "status: expected string" 15 + let status_to_yojson s = `String s 16 + 17 + type state = 18 + { 19 + last_initiated_at: string option [@key "lastInitiatedAt"] [@default None]; 20 + status: status; 21 + access: access; 22 + } 23 + [@@deriving yojson {strict= false}] 24 + 25 + type state_metadata = 26 + { 27 + account_created_at: string option [@key "accountCreatedAt"] [@default None]; 28 + } 29 + [@@deriving yojson {strict= false}] 30 + 31 + type config_region_rule_if_account_older_than = 32 + { 33 + date: string; 34 + access: access; 35 + } 36 + [@@deriving yojson {strict= false}] 37 + 38 + type config_region_rule_if_account_newer_than = 39 + { 40 + date: string; 41 + access: access; 42 + } 43 + [@@deriving yojson {strict= false}] 44 + 45 + type config_region_rule_if_assured_under_age = 46 + { 47 + age: int; 48 + access: access; 49 + } 50 + [@@deriving yojson {strict= false}] 51 + 52 + type config_region_rule_if_assured_over_age = 53 + { 54 + age: int; 55 + access: access; 56 + } 57 + [@@deriving yojson {strict= false}] 58 + 59 + type config_region_rule_if_declared_under_age = 60 + { 61 + age: int; 62 + access: access; 63 + } 64 + [@@deriving yojson {strict= false}] 65 + 66 + type config_region_rule_if_declared_over_age = 67 + { 68 + age: int; 69 + access: access; 70 + } 71 + [@@deriving yojson {strict= false}] 72 + 73 + type config_region_rule_default = 74 + { 75 + access: access; 76 + } 77 + [@@deriving yojson {strict= false}] 78 + 79 + type rules_item = 80 + | ConfigRegionRuleDefault of config_region_rule_default 81 + | ConfigRegionRuleIfDeclaredOverAge of config_region_rule_if_declared_over_age 82 + | ConfigRegionRuleIfDeclaredUnderAge of config_region_rule_if_declared_under_age 83 + | ConfigRegionRuleIfAssuredOverAge of config_region_rule_if_assured_over_age 84 + | ConfigRegionRuleIfAssuredUnderAge of config_region_rule_if_assured_under_age 85 + | ConfigRegionRuleIfAccountNewerThan of config_region_rule_if_account_newer_than 86 + | ConfigRegionRuleIfAccountOlderThan of config_region_rule_if_account_older_than 87 + | Unknown of Yojson.Safe.t 88 + 89 + let rules_item_of_yojson json = 90 + let open Yojson.Safe.Util in 91 + try 92 + match json |> member "$type" |> to_string with 93 + | "app.bsky.ageassurance.defs#configRegionRuleDefault" -> 94 + (match config_region_rule_default_of_yojson json with 95 + | Ok v -> Ok (ConfigRegionRuleDefault v) 96 + | Error e -> Error e) 97 + | "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredOverAge" -> 98 + (match config_region_rule_if_declared_over_age_of_yojson json with 99 + | Ok v -> Ok (ConfigRegionRuleIfDeclaredOverAge v) 100 + | Error e -> Error e) 101 + | "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredUnderAge" -> 102 + (match config_region_rule_if_declared_under_age_of_yojson json with 103 + | Ok v -> Ok (ConfigRegionRuleIfDeclaredUnderAge v) 104 + | Error e -> Error e) 105 + | "app.bsky.ageassurance.defs#configRegionRuleIfAssuredOverAge" -> 106 + (match config_region_rule_if_assured_over_age_of_yojson json with 107 + | Ok v -> Ok (ConfigRegionRuleIfAssuredOverAge v) 108 + | Error e -> Error e) 109 + | "app.bsky.ageassurance.defs#configRegionRuleIfAssuredUnderAge" -> 110 + (match config_region_rule_if_assured_under_age_of_yojson json with 111 + | Ok v -> Ok (ConfigRegionRuleIfAssuredUnderAge v) 112 + | Error e -> Error e) 113 + | "app.bsky.ageassurance.defs#configRegionRuleIfAccountNewerThan" -> 114 + (match config_region_rule_if_account_newer_than_of_yojson json with 115 + | Ok v -> Ok (ConfigRegionRuleIfAccountNewerThan v) 116 + | Error e -> Error e) 117 + | "app.bsky.ageassurance.defs#configRegionRuleIfAccountOlderThan" -> 118 + (match config_region_rule_if_account_older_than_of_yojson json with 119 + | Ok v -> Ok (ConfigRegionRuleIfAccountOlderThan v) 120 + | Error e -> Error e) 121 + | _ -> Ok (Unknown json) 122 + with _ -> Error "failed to parse union" 123 + 124 + let rules_item_to_yojson = function 125 + | ConfigRegionRuleDefault v -> 126 + (match config_region_rule_default_to_yojson v with 127 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.ageassurance.defs#configRegionRuleDefault") :: fields) 128 + | other -> other) 129 + | ConfigRegionRuleIfDeclaredOverAge v -> 130 + (match config_region_rule_if_declared_over_age_to_yojson v with 131 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredOverAge") :: fields) 132 + | other -> other) 133 + | ConfigRegionRuleIfDeclaredUnderAge v -> 134 + (match config_region_rule_if_declared_under_age_to_yojson v with 135 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredUnderAge") :: fields) 136 + | other -> other) 137 + | ConfigRegionRuleIfAssuredOverAge v -> 138 + (match config_region_rule_if_assured_over_age_to_yojson v with 139 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.ageassurance.defs#configRegionRuleIfAssuredOverAge") :: fields) 140 + | other -> other) 141 + | ConfigRegionRuleIfAssuredUnderAge v -> 142 + (match config_region_rule_if_assured_under_age_to_yojson v with 143 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.ageassurance.defs#configRegionRuleIfAssuredUnderAge") :: fields) 144 + | other -> other) 145 + | ConfigRegionRuleIfAccountNewerThan v -> 146 + (match config_region_rule_if_account_newer_than_to_yojson v with 147 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.ageassurance.defs#configRegionRuleIfAccountNewerThan") :: fields) 148 + | other -> other) 149 + | ConfigRegionRuleIfAccountOlderThan v -> 150 + (match config_region_rule_if_account_older_than_to_yojson v with 151 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.ageassurance.defs#configRegionRuleIfAccountOlderThan") :: fields) 152 + | other -> other) 153 + | Unknown j -> j 154 + 155 + type config_region = 156 + { 157 + country_code: string [@key "countryCode"]; 158 + region_code: string option [@key "regionCode"] [@default None]; 159 + rules: rules_item list; 160 + } 161 + [@@deriving yojson {strict= false}] 162 + 163 + type config = 164 + { 165 + regions: config_region list; 166 + } 167 + [@@deriving yojson {strict= false}] 168 + 169 + type event = 170 + { 171 + created_at: string [@key "createdAt"]; 172 + attempt_id: string [@key "attemptId"]; 173 + status: string; 174 + access: string; 175 + country_code: string [@key "countryCode"]; 176 + region_code: string option [@key "regionCode"] [@default None]; 177 + email: string option [@default None]; 178 + init_ip: string option [@key "initIp"] [@default None]; 179 + init_ua: string option [@key "initUa"] [@default None]; 180 + complete_ip: string option [@key "completeIp"] [@default None]; 181 + complete_ua: string option [@key "completeUa"] [@default None]; 182 + } 183 + [@@deriving yojson {strict= false}] 184 +
+17
pegasus/lib/lexicons/app_bsky_ageassurance_getConfig.ml
··· 1 + (* generated from app.bsky.ageassurance.getConfig *) 2 + 3 + (** Returns Age Assurance configuration for use on the client. *) 4 + module Main = struct 5 + let nsid = "app.bsky.ageassurance.getConfig" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = App_bsky_ageassurance_defs.config 11 + [@@deriving yojson {strict= false}] 12 + 13 + let call 14 + (client : Hermes.client) : output Lwt.t = 15 + Hermes.query client nsid (`Assoc []) output_of_yojson 16 + end 17 +
+28
pegasus/lib/lexicons/app_bsky_ageassurance_getState.ml
··· 1 + (* generated from app.bsky.ageassurance.getState *) 2 + 3 + (** Returns server-computed Age Assurance state, if available, and any additional metadata needed to compute Age Assurance state client-side. *) 4 + module Main = struct 5 + let nsid = "app.bsky.ageassurance.getState" 6 + 7 + type params = 8 + { 9 + country_code: string [@key "countryCode"]; 10 + region_code: string option [@key "regionCode"] [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + state: App_bsky_ageassurance_defs.state; 17 + metadata: App_bsky_ageassurance_defs.state_metadata; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ~country_code 23 + ?region_code 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {country_code; region_code} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+28
pegasus/lib/lexicons/app_bsky_bookmark_createBookmark.ml
··· 1 + (* generated from app.bsky.bookmark.createBookmark *) 2 + 3 + (** Creates a private bookmark for the specified record. Currently, only `app.bsky.feed.post` records are supported. Requires authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.bookmark.createBookmark" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + uri: string; 13 + cid: string; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + 20 + let call 21 + ~uri 22 + ~cid 23 + (client : Hermes.client) : output Lwt.t = 24 + let params = () in 25 + let input = Some ({uri; cid} |> input_to_yojson) in 26 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 27 + end 28 +
+56
pegasus/lib/lexicons/app_bsky_bookmark_defs.ml
··· 1 + (* generated from app.bsky.bookmark.defs *) 2 + 3 + type bookmark = 4 + { 5 + subject: Com_atproto_repo_strongRef.main; 6 + } 7 + [@@deriving yojson {strict= false}] 8 + 9 + type item = 10 + | BlockedPost of App_bsky_feed_defs.blocked_post 11 + | NotFoundPost of App_bsky_feed_defs.not_found_post 12 + | PostView of App_bsky_feed_defs.post_view 13 + | Unknown of Yojson.Safe.t 14 + 15 + let item_of_yojson json = 16 + let open Yojson.Safe.Util in 17 + try 18 + match json |> member "$type" |> to_string with 19 + | "app.bsky.feed.defs#blockedPost" -> 20 + (match App_bsky_feed_defs.blocked_post_of_yojson json with 21 + | Ok v -> Ok (BlockedPost v) 22 + | Error e -> Error e) 23 + | "app.bsky.feed.defs#notFoundPost" -> 24 + (match App_bsky_feed_defs.not_found_post_of_yojson json with 25 + | Ok v -> Ok (NotFoundPost v) 26 + | Error e -> Error e) 27 + | "app.bsky.feed.defs#postView" -> 28 + (match App_bsky_feed_defs.post_view_of_yojson json with 29 + | Ok v -> Ok (PostView v) 30 + | Error e -> Error e) 31 + | _ -> Ok (Unknown json) 32 + with _ -> Error "failed to parse union" 33 + 34 + let item_to_yojson = function 35 + | BlockedPost v -> 36 + (match App_bsky_feed_defs.blocked_post_to_yojson v with 37 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 38 + | other -> other) 39 + | NotFoundPost v -> 40 + (match App_bsky_feed_defs.not_found_post_to_yojson v with 41 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 42 + | other -> other) 43 + | PostView v -> 44 + (match App_bsky_feed_defs.post_view_to_yojson v with 45 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#postView") :: fields) 46 + | other -> other) 47 + | Unknown j -> j 48 + 49 + type bookmark_view = 50 + { 51 + subject: Com_atproto_repo_strongRef.main; 52 + created_at: string option [@key "createdAt"] [@default None]; 53 + item: item; 54 + } 55 + [@@deriving yojson {strict= false}] 56 +
+26
pegasus/lib/lexicons/app_bsky_bookmark_deleteBookmark.ml
··· 1 + (* generated from app.bsky.bookmark.deleteBookmark *) 2 + 3 + (** Deletes a private bookmark for the specified record. Currently, only `app.bsky.feed.post` records are supported. Requires authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.bookmark.deleteBookmark" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + uri: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~uri 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({uri} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+28
pegasus/lib/lexicons/app_bsky_bookmark_getBookmarks.ml
··· 1 + (* generated from app.bsky.bookmark.getBookmarks *) 2 + 3 + (** Gets views of records bookmarked by the authenticated user. Requires authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.bookmark.getBookmarks" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + cursor: string option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + cursor: string option [@default None]; 17 + bookmarks: App_bsky_bookmark_defs.bookmark_view list; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ?limit 23 + ?cursor 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {limit; cursor} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+23
pegasus/lib/lexicons/app_bsky_contact_defs.ml
··· 1 + (* generated from app.bsky.contact.defs *) 2 + 3 + type match_and_contact_index = 4 + { 5 + match_: App_bsky_actor_defs.profile_view [@key "match"]; 6 + contact_index: int [@key "contactIndex"]; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + type sync_status = 11 + { 12 + synced_at: string [@key "syncedAt"]; 13 + matches_count: int [@key "matchesCount"]; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type notification = 18 + { 19 + from: string; 20 + to_: string [@key "to"]; 21 + } 22 + [@@deriving yojson {strict= false}] 23 +
+27
pegasus/lib/lexicons/app_bsky_contact_dismissMatch.ml
··· 1 + (* generated from app.bsky.contact.dismissMatch *) 2 + 3 + (** Removes a match that was found via contact import. It shouldn't appear again if the same contact is re-imported. Requires authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.contact.dismissMatch" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + subject: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + let output_to_yojson () = `Assoc [] 19 + 20 + let call 21 + ~subject 22 + (client : Hermes.client) : output Lwt.t = 23 + let params = () in 24 + let input = Some ({subject} |> input_to_yojson) in 25 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 26 + end 27 +
+28
pegasus/lib/lexicons/app_bsky_contact_getMatches.ml
··· 1 + (* generated from app.bsky.contact.getMatches *) 2 + 3 + (** Returns the matched contacts (contacts that were mutually imported). Excludes dismissed matches. Requires authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.contact.getMatches" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + cursor: string option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + cursor: string option [@default None]; 17 + matches: App_bsky_actor_defs.profile_view list; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ?limit 23 + ?cursor 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {limit; cursor} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+20
pegasus/lib/lexicons/app_bsky_contact_getSyncStatus.ml
··· 1 + (* generated from app.bsky.contact.getSyncStatus *) 2 + 3 + (** Gets the user's current contact import status. Requires authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.contact.getSyncStatus" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = 11 + { 12 + sync_status: App_bsky_contact_defs.sync_status option [@key "syncStatus"] [@default None]; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + let call 17 + (client : Hermes.client) : output Lwt.t = 18 + Hermes.query client nsid (`Assoc []) output_of_yojson 19 + end 20 +
+31
pegasus/lib/lexicons/app_bsky_contact_importContacts.ml
··· 1 + (* generated from app.bsky.contact.importContacts *) 2 + 3 + (** Import contacts for securely matching with other users. This follows the protocol explained in https://docs.bsky.app/blog/contact-import-rfc. Requires authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.contact.importContacts" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + token: string; 13 + contacts: string list; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = 18 + { 19 + matches_and_contact_indexes: App_bsky_contact_defs.match_and_contact_index list [@key "matchesAndContactIndexes"]; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + let call 24 + ~token 25 + ~contacts 26 + (client : Hermes.client) : output Lwt.t = 27 + let params = () in 28 + let input = Some ({token; contacts} |> input_to_yojson) in 29 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 30 + end 31 +
+24
pegasus/lib/lexicons/app_bsky_contact_removeData.ml
··· 1 + (* generated from app.bsky.contact.removeData *) 2 + 3 + (** Removes all stored hashes used for contact matching, existing matches, and sync status. Requires authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.contact.removeData" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = unit 11 + let input_of_yojson _ = Ok () 12 + let input_to_yojson () = `Assoc [] 13 + 14 + type output = unit 15 + let output_of_yojson _ = Ok () 16 + let output_to_yojson () = `Assoc [] 17 + 18 + let call 19 + (client : Hermes.client) : output Lwt.t = 20 + let params = () in 21 + let input = Some (input_to_yojson ()) in 22 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 23 + end 24 +
+29
pegasus/lib/lexicons/app_bsky_contact_sendNotification.ml
··· 1 + (* generated from app.bsky.contact.sendNotification *) 2 + 3 + (** System endpoint to send notifications related to contact imports. Requires role authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.contact.sendNotification" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + from: string; 13 + to_: string [@key "to"]; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + let output_to_yojson () = `Assoc [] 20 + 21 + let call 22 + ~from 23 + ~to_ 24 + (client : Hermes.client) : output Lwt.t = 25 + let params = () in 26 + let input = Some ({from; to_} |> input_to_yojson) in 27 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 28 + end 29 +
+27
pegasus/lib/lexicons/app_bsky_contact_startPhoneVerification.ml
··· 1 + (* generated from app.bsky.contact.startPhoneVerification *) 2 + 3 + (** Starts a phone verification flow. The phone passed will receive a code via SMS that should be passed to `app.bsky.contact.verifyPhone`. Requires authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.contact.startPhoneVerification" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + phone: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + let output_to_yojson () = `Assoc [] 19 + 20 + let call 21 + ~phone 22 + (client : Hermes.client) : output Lwt.t = 23 + let params = () in 24 + let input = Some ({phone} |> input_to_yojson) in 25 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 26 + end 27 +
+31
pegasus/lib/lexicons/app_bsky_contact_verifyPhone.ml
··· 1 + (* generated from app.bsky.contact.verifyPhone *) 2 + 3 + (** Verifies control over a phone number with a code received via SMS and starts a contact import session. Requires authentication. *) 4 + module Main = struct 5 + let nsid = "app.bsky.contact.verifyPhone" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + phone: string; 13 + code: string; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = 18 + { 19 + token: string; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + let call 24 + ~phone 25 + ~code 26 + (client : Hermes.client) : output Lwt.t = 27 + let params = () in 28 + let input = Some ({phone; code} |> input_to_yojson) in 29 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 30 + end 31 +
+9
pegasus/lib/lexicons/app_bsky_embed_defs.ml
··· 1 + (* generated from app.bsky.embed.defs *) 2 + 3 + type aspect_ratio = 4 + { 5 + width: int; 6 + height: int; 7 + } 8 + [@@deriving yojson {strict= false}] 9 +
+32
pegasus/lib/lexicons/app_bsky_embed_external.ml
··· 1 + (* generated from app.bsky.embed.external *) 2 + 3 + type external_ = 4 + { 5 + uri: string; 6 + title: string; 7 + description: string; 8 + thumb: Hermes.blob option [@default None]; 9 + } 10 + [@@deriving yojson {strict= false}] 11 + 12 + type main = 13 + { 14 + external_: external_ [@key "external"]; 15 + } 16 + [@@deriving yojson {strict= false}] 17 + 18 + type view_external = 19 + { 20 + uri: string; 21 + title: string; 22 + description: string; 23 + thumb: string option [@default None]; 24 + } 25 + [@@deriving yojson {strict= false}] 26 + 27 + type view = 28 + { 29 + external_: view_external [@key "external"]; 30 + } 31 + [@@deriving yojson {strict= false}] 32 +
+31
pegasus/lib/lexicons/app_bsky_embed_images.ml
··· 1 + (* generated from app.bsky.embed.images *) 2 + 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 + } 9 + [@@deriving yojson {strict= false}] 10 + 11 + type main = 12 + { 13 + images: image list; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + 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 + } 30 + [@@deriving yojson {strict= false}] 31 +
+26
pegasus/lib/lexicons/app_bsky_embed_record.ml
··· 1 + (* re-exported from App_bsky_shared_1 *) 2 + 3 + type main = App_bsky_shared_1.record_main 4 + let main_of_yojson = App_bsky_shared_1.record_main_of_yojson 5 + let main_to_yojson = App_bsky_shared_1.record_main_to_yojson 6 + 7 + type view = App_bsky_shared_1.record_view 8 + let view_of_yojson = App_bsky_shared_1.record_view_of_yojson 9 + let view_to_yojson = App_bsky_shared_1.record_view_to_yojson 10 + 11 + type view_record = App_bsky_shared_1.view_record 12 + let view_record_of_yojson = App_bsky_shared_1.view_record_of_yojson 13 + let view_record_to_yojson = App_bsky_shared_1.view_record_to_yojson 14 + 15 + type view_not_found = App_bsky_shared_1.view_not_found 16 + let view_not_found_of_yojson = App_bsky_shared_1.view_not_found_of_yojson 17 + let view_not_found_to_yojson = App_bsky_shared_1.view_not_found_to_yojson 18 + 19 + type view_blocked = App_bsky_shared_1.view_blocked 20 + let view_blocked_of_yojson = App_bsky_shared_1.view_blocked_of_yojson 21 + let view_blocked_to_yojson = App_bsky_shared_1.view_blocked_to_yojson 22 + 23 + type view_detached = App_bsky_shared_1.view_detached 24 + let view_detached_of_yojson = App_bsky_shared_1.view_detached_of_yojson 25 + let view_detached_to_yojson = App_bsky_shared_1.view_detached_to_yojson 26 +
+10
pegasus/lib/lexicons/app_bsky_embed_recordWithMedia.ml
··· 1 + (* re-exported from App_bsky_shared_1 *) 2 + 3 + type main = App_bsky_shared_1.record_with_media_main 4 + let main_of_yojson = App_bsky_shared_1.record_with_media_main_of_yojson 5 + let main_to_yojson = App_bsky_shared_1.record_with_media_main_to_yojson 6 + 7 + type view = App_bsky_shared_1.record_with_media_view 8 + 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 +
+28
pegasus/lib/lexicons/app_bsky_embed_video.ml
··· 1 + (* generated from app.bsky.embed.video *) 2 + 3 + type caption = 4 + { 5 + lang: string; 6 + file: Hermes.blob; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + 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 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + 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 + } 27 + [@@deriving yojson {strict= false}] 28 +
+102
pegasus/lib/lexicons/app_bsky_feed_defs.ml
··· 1 + (* re-exported from App_bsky_shared_1 *) 2 + 3 + type post_view = App_bsky_shared_1.post_view 4 + let post_view_of_yojson = App_bsky_shared_1.post_view_of_yojson 5 + let post_view_to_yojson = App_bsky_shared_1.post_view_to_yojson 6 + 7 + type viewer_state = App_bsky_shared_1.feed_viewer_state 8 + let viewer_state_of_yojson = App_bsky_shared_1.feed_viewer_state_of_yojson 9 + let viewer_state_to_yojson = App_bsky_shared_1.feed_viewer_state_to_yojson 10 + 11 + type thread_context = App_bsky_shared_1.thread_context 12 + let thread_context_of_yojson = App_bsky_shared_1.thread_context_of_yojson 13 + let thread_context_to_yojson = App_bsky_shared_1.thread_context_to_yojson 14 + 15 + type feed_view_post = App_bsky_shared_1.feed_view_post 16 + let feed_view_post_of_yojson = App_bsky_shared_1.feed_view_post_of_yojson 17 + let feed_view_post_to_yojson = App_bsky_shared_1.feed_view_post_to_yojson 18 + 19 + type reply_ref = App_bsky_shared_1.reply_ref 20 + let reply_ref_of_yojson = App_bsky_shared_1.reply_ref_of_yojson 21 + let reply_ref_to_yojson = App_bsky_shared_1.reply_ref_to_yojson 22 + 23 + type reason_repost = App_bsky_shared_1.reason_repost 24 + let reason_repost_of_yojson = App_bsky_shared_1.reason_repost_of_yojson 25 + let reason_repost_to_yojson = App_bsky_shared_1.reason_repost_to_yojson 26 + 27 + type reason_pin = App_bsky_shared_1.reason_pin 28 + let reason_pin_of_yojson = App_bsky_shared_1.reason_pin_of_yojson 29 + let reason_pin_to_yojson = App_bsky_shared_1.reason_pin_to_yojson 30 + 31 + type thread_view_post = App_bsky_shared_1.thread_view_post 32 + let thread_view_post_of_yojson = App_bsky_shared_1.thread_view_post_of_yojson 33 + let thread_view_post_to_yojson = App_bsky_shared_1.thread_view_post_to_yojson 34 + 35 + type not_found_post = App_bsky_shared_1.not_found_post 36 + let not_found_post_of_yojson = App_bsky_shared_1.not_found_post_of_yojson 37 + let not_found_post_to_yojson = App_bsky_shared_1.not_found_post_to_yojson 38 + 39 + type blocked_post = App_bsky_shared_1.blocked_post 40 + let blocked_post_of_yojson = App_bsky_shared_1.blocked_post_of_yojson 41 + let blocked_post_to_yojson = App_bsky_shared_1.blocked_post_to_yojson 42 + 43 + type blocked_author = App_bsky_shared_1.blocked_author 44 + let blocked_author_of_yojson = App_bsky_shared_1.blocked_author_of_yojson 45 + let blocked_author_to_yojson = App_bsky_shared_1.blocked_author_to_yojson 46 + 47 + type generator_view = App_bsky_shared_1.generator_view 48 + let generator_view_of_yojson = App_bsky_shared_1.generator_view_of_yojson 49 + let generator_view_to_yojson = App_bsky_shared_1.generator_view_to_yojson 50 + 51 + 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 54 + 55 + 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 58 + 59 + 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 62 + 63 + 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 66 + 67 + type threadgate_view = App_bsky_shared_1.threadgate_view 68 + let threadgate_view_of_yojson = App_bsky_shared_1.threadgate_view_of_yojson 69 + let threadgate_view_to_yojson = App_bsky_shared_1.threadgate_view_to_yojson 70 + 71 + type interaction = App_bsky_shared_1.interaction 72 + let interaction_of_yojson = App_bsky_shared_1.interaction_of_yojson 73 + let interaction_to_yojson = App_bsky_shared_1.interaction_to_yojson 74 + 75 + let request_less = App_bsky_shared_1.request_less 76 + 77 + let request_more = App_bsky_shared_1.request_more 78 + 79 + let clickthrough_item = App_bsky_shared_1.clickthrough_item 80 + 81 + let clickthrough_author = App_bsky_shared_1.clickthrough_author 82 + 83 + let clickthrough_reposter = App_bsky_shared_1.clickthrough_reposter 84 + 85 + let clickthrough_embed = App_bsky_shared_1.clickthrough_embed 86 + 87 + let content_mode_unspecified = App_bsky_shared_1.content_mode_unspecified 88 + 89 + let content_mode_video = App_bsky_shared_1.content_mode_video 90 + 91 + let interaction_seen = App_bsky_shared_1.interaction_seen 92 + 93 + let interaction_like = App_bsky_shared_1.interaction_like 94 + 95 + let interaction_repost = App_bsky_shared_1.interaction_repost 96 + 97 + let interaction_reply = App_bsky_shared_1.interaction_reply 98 + 99 + let interaction_quote = App_bsky_shared_1.interaction_quote 100 + 101 + let interaction_share = App_bsky_shared_1.interaction_share 102 +
+35
pegasus/lib/lexicons/app_bsky_feed_describeFeedGenerator.ml
··· 1 + (* generated from app.bsky.feed.describeFeedGenerator *) 2 + 3 + type links = 4 + { 5 + privacy_policy: string option [@key "privacyPolicy"] [@default None]; 6 + terms_of_service: string option [@key "termsOfService"] [@default None]; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + type feed = 11 + { 12 + uri: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + (** 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 + module Main = struct 18 + let nsid = "app.bsky.feed.describeFeedGenerator" 19 + 20 + type params = unit 21 + let params_to_yojson () = `Assoc [] 22 + 23 + type output = 24 + { 25 + did: string; 26 + feeds: feed list; 27 + links: links option [@default None]; 28 + } 29 + [@@deriving yojson {strict= false}] 30 + 31 + let call 32 + (client : Hermes.client) : output Lwt.t = 33 + Hermes.query client nsid (`Assoc []) output_of_yojson 34 + end 35 +
+38
pegasus/lib/lexicons/app_bsky_feed_generator.ml
··· 1 + (* generated from app.bsky.feed.generator *) 2 + 3 + type labels = 4 + | SelfLabels of Com_atproto_label_defs.self_labels 5 + | Unknown of Yojson.Safe.t 6 + 7 + let labels_of_yojson json = 8 + let open Yojson.Safe.Util in 9 + try 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) 16 + with _ -> Error "failed to parse union" 17 + 18 + 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 24 + 25 + 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 + } 37 + [@@deriving yojson {strict= false}] 38 +
+30
pegasus/lib/lexicons/app_bsky_feed_getActorFeeds.ml
··· 1 + (* generated from app.bsky.feed.getActorFeeds *) 2 + 3 + (** Get a list of feeds (feed generator records) created by the actor (in the actor's repo). *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getActorFeeds" 6 + 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}] 14 + 15 + type output = 16 + { 17 + cursor: string option [@default None]; 18 + feeds: App_bsky_feed_defs.generator_view list; 19 + } 20 + [@@deriving yojson {strict= false}] 21 + 22 + let call 23 + ~actor 24 + ?limit 25 + ?cursor 26 + (client : Hermes.client) : output Lwt.t = 27 + let params : params = {actor; limit; cursor} in 28 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 + end 30 +
+30
pegasus/lib/lexicons/app_bsky_feed_getActorLikes.ml
··· 1 + (* generated from app.bsky.feed.getActorLikes *) 2 + 3 + (** Get a list of posts liked by an actor. Requires auth, actor must be the requesting account. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getActorLikes" 6 + 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}] 14 + 15 + 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}] 21 + 22 + let call 23 + ~actor 24 + ?limit 25 + ?cursor 26 + (client : Hermes.client) : output Lwt.t = 27 + let params : params = {actor; limit; cursor} in 28 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 + end 30 +
+34
pegasus/lib/lexicons/app_bsky_feed_getAuthorFeed.ml
··· 1 + (* generated from app.bsky.feed.getAuthorFeed *) 2 + 3 + (** Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getAuthorFeed" 6 + 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}] 16 + 17 + 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}] 23 + 24 + let call 25 + ~actor 26 + ?limit 27 + ?cursor 28 + ?filter 29 + ?include_pins 30 + (client : Hermes.client) : output Lwt.t = 31 + let params : params = {actor; limit; cursor; filter; include_pins} in 32 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 33 + end 34 +
+30
pegasus/lib/lexicons/app_bsky_feed_getFeed.ml
··· 1 + (* generated from app.bsky.feed.getFeed *) 2 + 3 + (** Get a hydrated feed from an actor's selected feed generator. Implemented by App View. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getFeed" 6 + 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}] 14 + 15 + 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}] 21 + 22 + let call 23 + ~feed 24 + ?limit 25 + ?cursor 26 + (client : Hermes.client) : output Lwt.t = 27 + let params : params = {feed; limit; cursor} in 28 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 + end 30 +
+27
pegasus/lib/lexicons/app_bsky_feed_getFeedGenerator.ml
··· 1 + (* generated from app.bsky.feed.getFeedGenerator *) 2 + 3 + (** Get information about a feed generator. Implemented by AppView. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getFeedGenerator" 6 + 7 + type params = 8 + { 9 + feed: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + 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}] 20 + 21 + let call 22 + ~feed 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {feed} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+25
pegasus/lib/lexicons/app_bsky_feed_getFeedGenerators.ml
··· 1 + (* generated from app.bsky.feed.getFeedGenerators *) 2 + 3 + (** Get information about a list of feed generators. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getFeedGenerators" 6 + 7 + type params = 8 + { 9 + feeds: string list; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + feeds: App_bsky_feed_defs.generator_view list; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~feeds 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {feeds} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+31
pegasus/lib/lexicons/app_bsky_feed_getFeedSkeleton.ml
··· 1 + (* generated from app.bsky.feed.getFeedSkeleton *) 2 + 3 + (** Get a skeleton of a feed provided by a feed generator. Auth is optional, depending on provider requirements, and provides the DID of the requester. Implemented by Feed Generator Service. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getFeedSkeleton" 6 + 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}] 14 + 15 + 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}] 22 + 23 + let call 24 + ~feed 25 + ?limit 26 + ?cursor 27 + (client : Hermes.client) : output Lwt.t = 28 + let params : params = {feed; limit; cursor} in 29 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 30 + end 31 +
+42
pegasus/lib/lexicons/app_bsky_feed_getLikes.ml
··· 1 + (* generated from app.bsky.feed.getLikes *) 2 + 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 + } 9 + [@@deriving yojson {strict= false}] 10 + 11 + (** Get like records which reference a subject (by AT-URI and CID). *) 12 + module Main = struct 13 + let nsid = "app.bsky.feed.getLikes" 14 + 15 + 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}] 23 + 24 + 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}] 32 + 33 + let call 34 + ~uri 35 + ?cid 36 + ?limit 37 + ?cursor 38 + (client : Hermes.client) : output Lwt.t = 39 + let params : params = {uri; cid; limit; cursor} in 40 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 41 + end 42 +
+30
pegasus/lib/lexicons/app_bsky_feed_getListFeed.ml
··· 1 + (* generated from app.bsky.feed.getListFeed *) 2 + 3 + (** Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getListFeed" 6 + 7 + type params = 8 + { 9 + list: string; 10 + limit: int option [@default None]; 11 + cursor: string option [@default None]; 12 + } 13 + [@@deriving yojson {strict= false}] 14 + 15 + 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}] 21 + 22 + let call 23 + ~list 24 + ?limit 25 + ?cursor 26 + (client : Hermes.client) : output Lwt.t = 27 + let params : params = {list; limit; cursor} in 28 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 + end 30 +
+70
pegasus/lib/lexicons/app_bsky_feed_getPostThread.ml
··· 1 + (* generated from app.bsky.feed.getPostThread *) 2 + 3 + (** Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getPostThread" 6 + 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}] 14 + 15 + 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 20 + 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" 39 + 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 54 + 55 + type output = 56 + { 57 + thread: thread; 58 + threadgate: App_bsky_feed_defs.threadgate_view option [@default None]; 59 + } 60 + [@@deriving yojson {strict= false}] 61 + 62 + let call 63 + ~uri 64 + ?depth 65 + ?parent_height 66 + (client : Hermes.client) : output Lwt.t = 67 + let params : params = {uri; depth; parent_height} in 68 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 69 + end 70 +
+25
pegasus/lib/lexicons/app_bsky_feed_getPosts.ml
··· 1 + (* generated from app.bsky.feed.getPosts *) 2 + 3 + (** Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getPosts" 6 + 7 + type params = 8 + { 9 + uris: string list; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + posts: App_bsky_feed_defs.post_view list; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~uris 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {uris} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+34
pegasus/lib/lexicons/app_bsky_feed_getQuotes.ml
··· 1 + (* generated from app.bsky.feed.getQuotes *) 2 + 3 + (** Get a list of quotes for a given post. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getQuotes" 6 + 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}] 15 + 16 + 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}] 24 + 25 + let call 26 + ~uri 27 + ?cid 28 + ?limit 29 + ?cursor 30 + (client : Hermes.client) : output Lwt.t = 31 + let params : params = {uri; cid; limit; cursor} in 32 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 33 + end 34 +
+34
pegasus/lib/lexicons/app_bsky_feed_getRepostedBy.ml
··· 1 + (* generated from app.bsky.feed.getRepostedBy *) 2 + 3 + (** Get a list of reposts for a given post. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getRepostedBy" 6 + 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}] 15 + 16 + 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}] 24 + 25 + let call 26 + ~uri 27 + ?cid 28 + ?limit 29 + ?cursor 30 + (client : Hermes.client) : output Lwt.t = 31 + let params : params = {uri; cid; limit; cursor} in 32 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 33 + end 34 +
+28
pegasus/lib/lexicons/app_bsky_feed_getSuggestedFeeds.ml
··· 1 + (* generated from app.bsky.feed.getSuggestedFeeds *) 2 + 3 + (** Get a list of suggested feeds (feed generators) for the requesting account. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getSuggestedFeeds" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + cursor: string option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + cursor: string option [@default None]; 17 + feeds: App_bsky_feed_defs.generator_view list; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ?limit 23 + ?cursor 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {limit; cursor} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+30
pegasus/lib/lexicons/app_bsky_feed_getTimeline.ml
··· 1 + (* generated from app.bsky.feed.getTimeline *) 2 + 3 + (** Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.getTimeline" 6 + 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}] 14 + 15 + 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}] 21 + 22 + let call 23 + ?algorithm 24 + ?limit 25 + ?cursor 26 + (client : Hermes.client) : output Lwt.t = 27 + let params : params = {algorithm; limit; cursor} in 28 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 + end 30 +
+10
pegasus/lib/lexicons/app_bsky_feed_like.ml
··· 1 + (* generated from app.bsky.feed.like *) 2 + 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 + } 9 + [@@deriving yojson {strict= false}] 10 +
+118
pegasus/lib/lexicons/app_bsky_feed_post.ml
··· 1 + (* generated from app.bsky.feed.post *) 2 + 3 + type reply_ref = 4 + { 5 + root: Com_atproto_repo_strongRef.main; 6 + parent: Com_atproto_repo_strongRef.main; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + type text_slice = 11 + { 12 + start: int; 13 + end_: int [@key "end"]; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type entity = 18 + { 19 + index: text_slice; 20 + type_: string [@key "type"]; 21 + value: string; 22 + } 23 + [@@deriving yojson {strict= false}] 24 + 25 + type labels = 26 + | SelfLabels of Com_atproto_label_defs.self_labels 27 + | Unknown of Yojson.Safe.t 28 + 29 + let labels_of_yojson json = 30 + let open Yojson.Safe.Util in 31 + try 32 + 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) 38 + with _ -> Error "failed to parse union" 39 + 40 + 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 46 + 47 + type embed = 48 + | Images of App_bsky_embed_images.main 49 + | Video of App_bsky_embed_video.main 50 + | External of App_bsky_embed_external.main 51 + | Record of App_bsky_embed_record.main 52 + | RecordWithMedia of App_bsky_embed_recordWithMedia.main 53 + | Unknown of Yojson.Safe.t 54 + 55 + let embed_of_yojson json = 56 + let open Yojson.Safe.Util in 57 + try 58 + 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) 80 + with _ -> Error "failed to parse union" 81 + 82 + 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 104 + 105 + 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 + } 117 + [@@deriving yojson {strict= false}] 118 +
+37
pegasus/lib/lexicons/app_bsky_feed_postgate.ml
··· 1 + (* generated from app.bsky.feed.postgate *) 2 + 3 + type disable_rule = unit 4 + let disable_rule_of_yojson _ = Ok () 5 + let disable_rule_to_yojson () = `Assoc [] 6 + 7 + type embedding_rules_item = 8 + | DisableRule of disable_rule 9 + | Unknown of Yojson.Safe.t 10 + 11 + let embedding_rules_item_of_yojson json = 12 + let open Yojson.Safe.Util in 13 + try 14 + 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) 20 + with _ -> Error "failed to parse union" 21 + 22 + 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 + 29 + 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 + } 36 + [@@deriving yojson {strict= false}] 37 +
+10
pegasus/lib/lexicons/app_bsky_feed_repost.ml
··· 1 + (* generated from app.bsky.feed.repost *) 2 + 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 + } 9 + [@@deriving yojson {strict= false}] 10 +
+49
pegasus/lib/lexicons/app_bsky_feed_searchPosts.ml
··· 1 + (* generated from app.bsky.feed.searchPosts *) 2 + 3 + (** Find posts matching search criteria, returning views of those posts. Note that this API endpoint may require authentication (eg, not public) for some service providers and implementations. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.searchPosts" 6 + 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]; 19 + limit: int option [@default None]; 20 + cursor: string option [@default None]; 21 + } 22 + [@@deriving yojson {strict= false}] 23 + 24 + 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}] 31 + 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 47 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 48 + end 49 +
+27
pegasus/lib/lexicons/app_bsky_feed_sendInteractions.ml
··· 1 + (* generated from app.bsky.feed.sendInteractions *) 2 + 3 + (** Send information about interactions with feed items back to the feed generator that served them. *) 4 + module Main = struct 5 + let nsid = "app.bsky.feed.sendInteractions" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + interactions: App_bsky_feed_defs.interaction list; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + let output_to_yojson () = `Assoc [] 19 + 20 + let call 21 + ~interactions 22 + (client : Hermes.client) : output Lwt.t = 23 + let params = () in 24 + let input = Some ({interactions} |> input_to_yojson) in 25 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 26 + end 27 +
+78
pegasus/lib/lexicons/app_bsky_feed_threadgate.ml
··· 1 + (* generated from app.bsky.feed.threadgate *) 2 + 3 + type list_rule = 4 + { 5 + list: string; 6 + } 7 + [@@deriving yojson {strict= false}] 8 + 9 + type following_rule = unit 10 + let following_rule_of_yojson _ = Ok () 11 + let following_rule_to_yojson () = `Assoc [] 12 + 13 + type follower_rule = unit 14 + let follower_rule_of_yojson _ = Ok () 15 + let follower_rule_to_yojson () = `Assoc [] 16 + 17 + type mention_rule = unit 18 + let mention_rule_of_yojson _ = Ok () 19 + let mention_rule_to_yojson () = `Assoc [] 20 + 21 + type allow_item = 22 + | MentionRule of mention_rule 23 + | FollowerRule of follower_rule 24 + | FollowingRule of following_rule 25 + | ListRule of list_rule 26 + | Unknown of Yojson.Safe.t 27 + 28 + let allow_item_of_yojson json = 29 + let open Yojson.Safe.Util in 30 + try 31 + 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) 49 + with _ -> Error "failed to parse union" 50 + 51 + 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 69 + 70 + 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 + } 77 + [@@deriving yojson {strict= false}] 78 +
+9
pegasus/lib/lexicons/app_bsky_graph_block.ml
··· 1 + (* generated from app.bsky.graph.block *) 2 + 3 + type main = 4 + { 5 + subject: string; 6 + created_at: string [@key "createdAt"]; 7 + } 8 + [@@deriving yojson {strict= false}] 9 +
+44
pegasus/lib/lexicons/app_bsky_graph_defs.ml
··· 1 + (* re-exported from App_bsky_shared_1 *) 2 + 3 + type list_view_basic = App_bsky_shared_1.list_view_basic 4 + let list_view_basic_of_yojson = App_bsky_shared_1.list_view_basic_of_yojson 5 + let list_view_basic_to_yojson = App_bsky_shared_1.list_view_basic_to_yojson 6 + 7 + type list_view = App_bsky_shared_1.list_view 8 + let list_view_of_yojson = App_bsky_shared_1.list_view_of_yojson 9 + let list_view_to_yojson = App_bsky_shared_1.list_view_to_yojson 10 + 11 + type list_item_view = App_bsky_shared_1.list_item_view 12 + let list_item_view_of_yojson = App_bsky_shared_1.list_item_view_of_yojson 13 + let list_item_view_to_yojson = App_bsky_shared_1.list_item_view_to_yojson 14 + 15 + type starter_pack_view = App_bsky_shared_1.starter_pack_view 16 + let starter_pack_view_of_yojson = App_bsky_shared_1.starter_pack_view_of_yojson 17 + let starter_pack_view_to_yojson = App_bsky_shared_1.starter_pack_view_to_yojson 18 + 19 + 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 22 + 23 + type list_purpose = App_bsky_shared_1.list_purpose 24 + let list_purpose_of_yojson = App_bsky_shared_1.list_purpose_of_yojson 25 + let list_purpose_to_yojson = App_bsky_shared_1.list_purpose_to_yojson 26 + 27 + let modlist = App_bsky_shared_1.modlist 28 + 29 + let curatelist = App_bsky_shared_1.curatelist 30 + 31 + let referencelist = App_bsky_shared_1.referencelist 32 + 33 + type list_viewer_state = App_bsky_shared_1.list_viewer_state 34 + let list_viewer_state_of_yojson = App_bsky_shared_1.list_viewer_state_of_yojson 35 + let list_viewer_state_to_yojson = App_bsky_shared_1.list_viewer_state_to_yojson 36 + 37 + type not_found_actor = App_bsky_shared_1.not_found_actor 38 + let not_found_actor_of_yojson = App_bsky_shared_1.not_found_actor_of_yojson 39 + let not_found_actor_to_yojson = App_bsky_shared_1.not_found_actor_to_yojson 40 + 41 + type relationship = App_bsky_shared_1.relationship 42 + let relationship_of_yojson = App_bsky_shared_1.relationship_of_yojson 43 + let relationship_to_yojson = App_bsky_shared_1.relationship_to_yojson 44 +
+10
pegasus/lib/lexicons/app_bsky_graph_follow.ml
··· 1 + (* generated from app.bsky.graph.follow *) 2 + 3 + type main = 4 + { 5 + subject: string; 6 + created_at: string [@key "createdAt"]; 7 + via: Com_atproto_repo_strongRef.main option [@default None]; 8 + } 9 + [@@deriving yojson {strict= false}] 10 +
+30
pegasus/lib/lexicons/app_bsky_graph_getActorStarterPacks.ml
··· 1 + (* generated from app.bsky.graph.getActorStarterPacks *) 2 + 3 + (** Get a list of starter packs created by the actor. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getActorStarterPacks" 6 + 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}] 14 + 15 + 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}] 21 + 22 + let call 23 + ~actor 24 + ?limit 25 + ?cursor 26 + (client : Hermes.client) : output Lwt.t = 27 + let params : params = {actor; limit; cursor} in 28 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 + end 30 +
+28
pegasus/lib/lexicons/app_bsky_graph_getBlocks.ml
··· 1 + (* generated from app.bsky.graph.getBlocks *) 2 + 3 + (** Enumerates which accounts the requesting account is currently blocking. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getBlocks" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + cursor: string option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + cursor: string option [@default None]; 17 + blocks: App_bsky_actor_defs.profile_view list; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ?limit 23 + ?cursor 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {limit; cursor} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+31
pegasus/lib/lexicons/app_bsky_graph_getFollowers.ml
··· 1 + (* generated from app.bsky.graph.getFollowers *) 2 + 3 + (** Enumerates accounts which follow a specified account (actor). *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getFollowers" 6 + 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}] 14 + 15 + 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}] 22 + 23 + let call 24 + ~actor 25 + ?limit 26 + ?cursor 27 + (client : Hermes.client) : output Lwt.t = 28 + let params : params = {actor; limit; cursor} in 29 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 30 + end 31 +
+31
pegasus/lib/lexicons/app_bsky_graph_getFollows.ml
··· 1 + (* generated from app.bsky.graph.getFollows *) 2 + 3 + (** Enumerates accounts which a specified account (actor) follows. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getFollows" 6 + 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}] 14 + 15 + 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}] 22 + 23 + let call 24 + ~actor 25 + ?limit 26 + ?cursor 27 + (client : Hermes.client) : output Lwt.t = 28 + let params : params = {actor; limit; cursor} in 29 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 30 + end 31 +
+31
pegasus/lib/lexicons/app_bsky_graph_getKnownFollowers.ml
··· 1 + (* generated from app.bsky.graph.getKnownFollowers *) 2 + 3 + (** Enumerates accounts which follow a specified account (actor) and are followed by the viewer. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getKnownFollowers" 6 + 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}] 14 + 15 + 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}] 22 + 23 + let call 24 + ~actor 25 + ?limit 26 + ?cursor 27 + (client : Hermes.client) : output Lwt.t = 28 + let params : params = {actor; limit; cursor} in 29 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 30 + end 31 +
+31
pegasus/lib/lexicons/app_bsky_graph_getList.ml
··· 1 + (* generated from app.bsky.graph.getList *) 2 + 3 + (** Gets a 'view' (with additional context) of a specified list. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getList" 6 + 7 + type params = 8 + { 9 + list: string; 10 + limit: int option [@default None]; 11 + cursor: string option [@default None]; 12 + } 13 + [@@deriving yojson {strict= false}] 14 + 15 + type output = 16 + { 17 + cursor: string option [@default None]; 18 + list: App_bsky_graph_defs.list_view; 19 + items: App_bsky_graph_defs.list_item_view list; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + let call 24 + ~list 25 + ?limit 26 + ?cursor 27 + (client : Hermes.client) : output Lwt.t = 28 + let params : params = {list; limit; cursor} in 29 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 30 + end 31 +
+28
pegasus/lib/lexicons/app_bsky_graph_getListBlocks.ml
··· 1 + (* generated from app.bsky.graph.getListBlocks *) 2 + 3 + (** Get mod lists that the requesting account (actor) is blocking. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getListBlocks" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + cursor: string option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + cursor: string option [@default None]; 17 + lists: App_bsky_graph_defs.list_view list; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ?limit 23 + ?cursor 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {limit; cursor} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+28
pegasus/lib/lexicons/app_bsky_graph_getListMutes.ml
··· 1 + (* generated from app.bsky.graph.getListMutes *) 2 + 3 + (** Enumerates mod lists that the requesting account (actor) currently has muted. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getListMutes" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + cursor: string option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + cursor: string option [@default None]; 17 + lists: App_bsky_graph_defs.list_view list; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ?limit 23 + ?cursor 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {limit; cursor} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+32
pegasus/lib/lexicons/app_bsky_graph_getLists.ml
··· 1 + (* generated from app.bsky.graph.getLists *) 2 + 3 + (** Enumerates the lists created by a specified account (actor). *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getLists" 6 + 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]; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = 17 + { 18 + cursor: string option [@default None]; 19 + lists: App_bsky_graph_defs.list_view list; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + let call 24 + ~actor 25 + ?limit 26 + ?cursor 27 + ?purposes 28 + (client : Hermes.client) : output Lwt.t = 29 + let params : params = {actor; limit; cursor; purposes} in 30 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 31 + end 32 +
+39
pegasus/lib/lexicons/app_bsky_graph_getListsWithMembership.ml
··· 1 + (* generated from app.bsky.graph.getListsWithMembership *) 2 + 3 + type list_with_membership = 4 + { 5 + list: App_bsky_graph_defs.list_view; 6 + list_item: App_bsky_graph_defs.list_item_view option [@key "listItem"] [@default None]; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + (** 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. *) 11 + module Main = struct 12 + let nsid = "app.bsky.graph.getListsWithMembership" 13 + 14 + 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]; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 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}] 29 + 30 + let call 31 + ~actor 32 + ?limit 33 + ?cursor 34 + ?purposes 35 + (client : Hermes.client) : output Lwt.t = 36 + let params : params = {actor; limit; cursor; purposes} in 37 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 38 + end 39 +
+28
pegasus/lib/lexicons/app_bsky_graph_getMutes.ml
··· 1 + (* generated from app.bsky.graph.getMutes *) 2 + 3 + (** Enumerates accounts that the requesting account (actor) currently has muted. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getMutes" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + cursor: string option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + cursor: string option [@default None]; 17 + mutes: App_bsky_actor_defs.profile_view list; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ?limit 23 + ?cursor 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {limit; cursor} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+59
pegasus/lib/lexicons/app_bsky_graph_getRelationships.ml
··· 1 + (* generated from app.bsky.graph.getRelationships *) 2 + 3 + (** Enumerates public relationships between one account, and a list of other accounts. Does not require auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getRelationships" 6 + 7 + type params = 8 + { 9 + actor: string; 10 + others: string list option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + 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 18 + 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" 33 + 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 44 + 45 + type output = 46 + { 47 + actor: string option [@default None]; 48 + relationships: relationships_item list; 49 + } 50 + [@@deriving yojson {strict= false}] 51 + 52 + let call 53 + ~actor 54 + ?others 55 + (client : Hermes.client) : output Lwt.t = 56 + let params : params = {actor; others} in 57 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 58 + end 59 +
+25
pegasus/lib/lexicons/app_bsky_graph_getStarterPack.ml
··· 1 + (* generated from app.bsky.graph.getStarterPack *) 2 + 3 + (** Gets a view of a starter pack. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getStarterPack" 6 + 7 + type params = 8 + { 9 + starter_pack: string [@key "starterPack"]; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + starter_pack: App_bsky_graph_defs.starter_pack_view [@key "starterPack"]; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~starter_pack 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {starter_pack} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+25
pegasus/lib/lexicons/app_bsky_graph_getStarterPacks.ml
··· 1 + (* generated from app.bsky.graph.getStarterPacks *) 2 + 3 + (** Get views for a list of starter packs. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getStarterPacks" 6 + 7 + type params = 8 + { 9 + uris: string list; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + starter_packs: App_bsky_graph_defs.starter_pack_view_basic list [@key "starterPacks"]; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~uris 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {uris} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+37
pegasus/lib/lexicons/app_bsky_graph_getStarterPacksWithMembership.ml
··· 1 + (* generated from app.bsky.graph.getStarterPacksWithMembership *) 2 + 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 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + (** Enumerates the starter packs created by the session user, and includes membership information about `actor` in those starter packs. Requires auth. *) 11 + module Main = struct 12 + let nsid = "app.bsky.graph.getStarterPacksWithMembership" 13 + 14 + type params = 15 + { 16 + actor: string; 17 + limit: int option [@default None]; 18 + cursor: string option [@default None]; 19 + } 20 + [@@deriving yojson {strict= false}] 21 + 22 + 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}] 28 + 29 + let call 30 + ~actor 31 + ?limit 32 + ?cursor 33 + (client : Hermes.client) : output Lwt.t = 34 + let params : params = {actor; limit; cursor} in 35 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 36 + end 37 +
+27
pegasus/lib/lexicons/app_bsky_graph_getSuggestedFollowsByActor.ml
··· 1 + (* generated from app.bsky.graph.getSuggestedFollowsByActor *) 2 + 3 + (** Enumerates follows similar to a given account (actor). Expected use is to recommend additional accounts immediately after following one account. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.getSuggestedFollowsByActor" 6 + 7 + type params = 8 + { 9 + actor: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + 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}] 20 + 21 + let call 22 + ~actor 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {actor} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+36
pegasus/lib/lexicons/app_bsky_graph_list.ml
··· 1 + (* generated from app.bsky.graph.list *) 2 + 3 + type labels = 4 + | SelfLabels of Com_atproto_label_defs.self_labels 5 + | Unknown of Yojson.Safe.t 6 + 7 + let labels_of_yojson json = 8 + let open Yojson.Safe.Util in 9 + try 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) 16 + with _ -> Error "failed to parse union" 17 + 18 + 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 24 + 25 + 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 + } 35 + [@@deriving yojson {strict= false}] 36 +
+9
pegasus/lib/lexicons/app_bsky_graph_listblock.ml
··· 1 + (* generated from app.bsky.graph.listblock *) 2 + 3 + type main = 4 + { 5 + subject: string; 6 + created_at: string [@key "createdAt"]; 7 + } 8 + [@@deriving yojson {strict= false}] 9 +
+10
pegasus/lib/lexicons/app_bsky_graph_listitem.ml
··· 1 + (* generated from app.bsky.graph.listitem *) 2 + 3 + type main = 4 + { 5 + subject: string; 6 + list: string; 7 + created_at: string [@key "createdAt"]; 8 + } 9 + [@@deriving yojson {strict= false}] 10 +
+26
pegasus/lib/lexicons/app_bsky_graph_muteActor.ml
··· 1 + (* generated from app.bsky.graph.muteActor *) 2 + 3 + (** Creates a mute relationship for the specified account. Mutes are private in Bluesky. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.muteActor" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + actor: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~actor 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({actor} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+26
pegasus/lib/lexicons/app_bsky_graph_muteActorList.ml
··· 1 + (* generated from app.bsky.graph.muteActorList *) 2 + 3 + (** Creates a mute relationship for the specified list of accounts. Mutes are private in Bluesky. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.muteActorList" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + list: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~list 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({list} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+26
pegasus/lib/lexicons/app_bsky_graph_muteThread.ml
··· 1 + (* generated from app.bsky.graph.muteThread *) 2 + 3 + (** Mutes a thread preventing notifications from the thread and any of its children. Mutes are private in Bluesky. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.muteThread" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + root: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~root 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({root} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+30
pegasus/lib/lexicons/app_bsky_graph_searchStarterPacks.ml
··· 1 + (* generated from app.bsky.graph.searchStarterPacks *) 2 + 3 + (** Find starter packs matching search criteria. Does not require auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.searchStarterPacks" 6 + 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}] 14 + 15 + 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}] 21 + 22 + let call 23 + ~q 24 + ?limit 25 + ?cursor 26 + (client : Hermes.client) : output Lwt.t = 27 + let params : params = {q; limit; cursor} in 28 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 + end 30 +
+19
pegasus/lib/lexicons/app_bsky_graph_starterpack.ml
··· 1 + (* generated from app.bsky.graph.starterpack *) 2 + 3 + type feed_item = 4 + { 5 + uri: string; 6 + } 7 + [@@deriving yojson {strict= false}] 8 + 9 + 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; 15 + feeds: feed_item list option [@default None]; 16 + created_at: string [@key "createdAt"]; 17 + } 18 + [@@deriving yojson {strict= false}] 19 +
+26
pegasus/lib/lexicons/app_bsky_graph_unmuteActor.ml
··· 1 + (* generated from app.bsky.graph.unmuteActor *) 2 + 3 + (** Unmutes the specified account. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.unmuteActor" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + actor: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~actor 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({actor} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+26
pegasus/lib/lexicons/app_bsky_graph_unmuteActorList.ml
··· 1 + (* generated from app.bsky.graph.unmuteActorList *) 2 + 3 + (** Unmutes the specified list of accounts. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.unmuteActorList" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + list: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~list 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({list} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+26
pegasus/lib/lexicons/app_bsky_graph_unmuteThread.ml
··· 1 + (* generated from app.bsky.graph.unmuteThread *) 2 + 3 + (** Unmutes the specified thread. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.graph.unmuteThread" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + root: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~root 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({root} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+11
pegasus/lib/lexicons/app_bsky_graph_verification.ml
··· 1 + (* generated from app.bsky.graph.verification *) 2 + 3 + type main = 4 + { 5 + subject: string; 6 + handle: string; 7 + display_name: string [@key "displayName"]; 8 + created_at: string [@key "createdAt"]; 9 + } 10 + [@@deriving yojson {strict= false}] 11 +
+18
pegasus/lib/lexicons/app_bsky_labeler_defs.ml
··· 1 + (* re-exported from App_bsky_shared_1 *) 2 + 3 + type labeler_view = App_bsky_shared_1.labeler_view 4 + let labeler_view_of_yojson = App_bsky_shared_1.labeler_view_of_yojson 5 + let labeler_view_to_yojson = App_bsky_shared_1.labeler_view_to_yojson 6 + 7 + 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 + 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 14 + 15 + type labeler_policies = App_bsky_shared_1.labeler_policies 16 + 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 +
+58
pegasus/lib/lexicons/app_bsky_labeler_getServices.ml
··· 1 + (* generated from app.bsky.labeler.getServices *) 2 + 3 + (** Get information about a list of labeler services. *) 4 + module Main = struct 5 + let nsid = "app.bsky.labeler.getServices" 6 + 7 + type params = 8 + { 9 + dids: string list; 10 + detailed: bool option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 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 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" 33 + 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 44 + 45 + type output = 46 + { 47 + views: views_item list; 48 + } 49 + [@@deriving yojson {strict= false}] 50 + 51 + let call 52 + ~dids 53 + ?detailed 54 + (client : Hermes.client) : output Lwt.t = 55 + let params : params = {dids; detailed} in 56 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 57 + end 58 +
+35
pegasus/lib/lexicons/app_bsky_labeler_service.ml
··· 1 + (* generated from app.bsky.labeler.service *) 2 + 3 + type labels = 4 + | SelfLabels of Com_atproto_label_defs.self_labels 5 + | Unknown of Yojson.Safe.t 6 + 7 + let labels_of_yojson json = 8 + let open Yojson.Safe.Util in 9 + try 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) 16 + with _ -> Error "failed to parse union" 17 + 18 + 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 24 + 25 + 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 + } 34 + [@@deriving yojson {strict= false}] 35 +
+8
pegasus/lib/lexicons/app_bsky_notification_declaration.ml
··· 1 + (* generated from app.bsky.notification.declaration *) 2 + 3 + type main = 4 + { 5 + allow_subscriptions: string [@key "allowSubscriptions"]; 6 + } 7 + [@@deriving yojson {strict= false}] 8 +
+60
pegasus/lib/lexicons/app_bsky_notification_defs.ml
··· 1 + (* generated from app.bsky.notification.defs *) 2 + 3 + type record_deleted = unit 4 + let record_deleted_of_yojson _ = Ok () 5 + let record_deleted_to_yojson () = `Assoc [] 6 + 7 + type chat_preference = 8 + { 9 + include_: string [@key "include"]; 10 + push: bool; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type filterable_preference = 15 + { 16 + include_: string [@key "include"]; 17 + list: bool; 18 + push: bool; 19 + } 20 + [@@deriving yojson {strict= false}] 21 + 22 + type preference = 23 + { 24 + list: bool; 25 + push: bool; 26 + } 27 + [@@deriving yojson {strict= false}] 28 + 29 + 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 + } 45 + [@@deriving yojson {strict= false}] 46 + 47 + type activity_subscription = 48 + { 49 + post: bool; 50 + reply: bool; 51 + } 52 + [@@deriving yojson {strict= false}] 53 + 54 + type subject_activity_subscription = 55 + { 56 + subject: string; 57 + activity_subscription: activity_subscription [@key "activitySubscription"]; 58 + } 59 + [@@deriving yojson {strict= false}] 60 +
+20
pegasus/lib/lexicons/app_bsky_notification_getPreferences.ml
··· 1 + (* generated from app.bsky.notification.getPreferences *) 2 + 3 + (** Get notification-related preferences for an account. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.notification.getPreferences" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = 11 + { 12 + preferences: App_bsky_notification_defs.preferences; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + let call 17 + (client : Hermes.client) : output Lwt.t = 18 + Hermes.query client nsid (`Assoc []) output_of_yojson 19 + end 20 +
+27
pegasus/lib/lexicons/app_bsky_notification_getUnreadCount.ml
··· 1 + (* generated from app.bsky.notification.getUnreadCount *) 2 + 3 + (** Count the number of unread notifications for the requesting account. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.notification.getUnreadCount" 6 + 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}] 13 + 14 + type output = 15 + { 16 + count: int; 17 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + let call 21 + ?priority 22 + ?seen_at 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {priority; seen_at} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+28
pegasus/lib/lexicons/app_bsky_notification_listActivitySubscriptions.ml
··· 1 + (* generated from app.bsky.notification.listActivitySubscriptions *) 2 + 3 + (** Enumerate all accounts to which the requesting account is subscribed to receive notifications for. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.notification.listActivitySubscriptions" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + cursor: string option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + cursor: string option [@default None]; 17 + subscriptions: App_bsky_actor_defs.profile_view list; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ?limit 23 + ?cursor 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {limit; cursor} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+50
pegasus/lib/lexicons/app_bsky_notification_listNotifications.ml
··· 1 + (* generated from app.bsky.notification.listNotifications *) 2 + 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 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + (** Enumerate notifications for the requesting account. Requires auth. *) 18 + module Main = struct 19 + let nsid = "app.bsky.notification.listNotifications" 20 + 21 + type params = 22 + { 23 + reasons: string list option [@default None]; 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}] 30 + 31 + 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}] 39 + 40 + let call 41 + ?reasons 42 + ?limit 43 + ?priority 44 + ?cursor 45 + ?seen_at 46 + (client : Hermes.client) : output Lwt.t = 47 + let params : params = {reasons; limit; priority; cursor; seen_at} in 48 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 49 + end 50 +
+32
pegasus/lib/lexicons/app_bsky_notification_putActivitySubscription.ml
··· 1 + (* generated from app.bsky.notification.putActivitySubscription *) 2 + 3 + (** Puts an activity subscription entry. The key should be omitted for creation and provided for updates. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.notification.putActivitySubscription" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + subject: string; 13 + activity_subscription: App_bsky_notification_defs.activity_subscription [@key "activitySubscription"]; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 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}] 23 + 24 + let call 25 + ~subject 26 + ~activity_subscription 27 + (client : Hermes.client) : output Lwt.t = 28 + let params = () in 29 + let input = Some ({subject; activity_subscription} |> input_to_yojson) in 30 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 31 + end 32 +
+26
pegasus/lib/lexicons/app_bsky_notification_putPreferences.ml
··· 1 + (* generated from app.bsky.notification.putPreferences *) 2 + 3 + (** Set notification-related preferences for an account. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.notification.putPreferences" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + priority: bool; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~priority 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({priority} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+53
pegasus/lib/lexicons/app_bsky_notification_putPreferencesV2.ml
··· 1 + (* generated from app.bsky.notification.putPreferencesV2 *) 2 + 3 + (** Set notification-related preferences for an account. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.notification.putPreferencesV2" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 + } 26 + [@@deriving yojson {strict= false}] 27 + 28 + type output = 29 + { 30 + preferences: App_bsky_notification_defs.preferences; 31 + } 32 + [@@deriving yojson {strict= false}] 33 + 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 = 49 + 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 52 + end 53 +
+34
pegasus/lib/lexicons/app_bsky_notification_registerPush.ml
··· 1 + (* generated from app.bsky.notification.registerPush *) 2 + 3 + (** Register to receive push notifications, via a specified service, for the requesting account. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.notification.registerPush" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + type output = unit 21 + let output_of_yojson _ = Ok () 22 + 23 + let call 24 + ~service_did 25 + ~token 26 + ~platform 27 + ~app_id 28 + ?age_restricted 29 + (client : Hermes.client) : output Lwt.t = 30 + 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 33 + end 34 +
+32
pegasus/lib/lexicons/app_bsky_notification_unregisterPush.ml
··· 1 + (* generated from app.bsky.notification.unregisterPush *) 2 + 3 + (** The inverse of registerPush - inform a specified service that push notifications should no longer be sent to the given token for the requesting account. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.notification.unregisterPush" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + service_did: string [@key "serviceDid"]; 13 + token: string; 14 + platform: string; 15 + app_id: string [@key "appId"]; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + type output = unit 20 + let output_of_yojson _ = Ok () 21 + 22 + let call 23 + ~service_did 24 + ~token 25 + ~platform 26 + ~app_id 27 + (client : Hermes.client) : output Lwt.t = 28 + 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 31 + end 32 +
+26
pegasus/lib/lexicons/app_bsky_notification_updateSeen.ml
··· 1 + (* generated from app.bsky.notification.updateSeen *) 2 + 3 + (** Notify server that the requesting account has seen notifications. Requires auth. *) 4 + module Main = struct 5 + let nsid = "app.bsky.notification.updateSeen" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + seen_at: string [@key "seenAt"]; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~seen_at 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({seen_at} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+74
pegasus/lib/lexicons/app_bsky_richtext_facet.ml
··· 1 + (* generated from app.bsky.richtext.facet *) 2 + 3 + type tag = 4 + { 5 + tag: string; 6 + } 7 + [@@deriving yojson {strict= false}] 8 + 9 + type link = 10 + { 11 + uri: string; 12 + } 13 + [@@deriving yojson {strict= false}] 14 + 15 + type mention = 16 + { 17 + did: string; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + type byte_slice = 22 + { 23 + byte_start: int [@key "byteStart"]; 24 + byte_end: int [@key "byteEnd"]; 25 + } 26 + [@@deriving yojson {strict= false}] 27 + 28 + type features_item = 29 + | Mention of mention 30 + | Link of link 31 + | Tag of tag 32 + | Unknown of Yojson.Safe.t 33 + 34 + let features_item_of_yojson json = 35 + let open Yojson.Safe.Util in 36 + try 37 + 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) 51 + with _ -> Error "failed to parse union" 52 + 53 + 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 67 + 68 + type main = 69 + { 70 + index: byte_slice; 71 + features: features_item list; 72 + } 73 + [@@deriving yojson {strict= false}] 74 +
+1474
pegasus/lib/lexicons/app_bsky_shared_1.ml
··· 1 + (* shared module for lexicons: app.bsky.actor.defs, app.bsky.embed.record, app.bsky.embed.recordWithMedia, app.bsky.feed.defs, app.bsky.graph.defs, app.bsky.labeler.defs *) 2 + 3 + type actor_embed = 4 + | ExternalView of App_bsky_embed_external.view 5 + | Unknown of Yojson.Safe.t 6 + 7 + let actor_embed_of_yojson json = 8 + let open Yojson.Safe.Util in 9 + try 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) 16 + with _ -> Error "failed to parse union" 17 + 18 + 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 24 + 25 + 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 + } 33 + [@@deriving yojson {strict= false}] 34 + 35 + type verification_view = 36 + { 37 + issuer: string; 38 + uri: string; 39 + is_valid: bool [@key "isValid"]; 40 + created_at: string [@key "createdAt"]; 41 + } 42 + [@@deriving yojson {strict= false}] 43 + 44 + type verification_state = 45 + { 46 + verifications: verification_view list; 47 + verified_status: string [@key "verifiedStatus"]; 48 + trusted_verifier_status: string [@key "trustedVerifierStatus"]; 49 + } 50 + [@@deriving yojson {strict= false}] 51 + 52 + type list_viewer_state = 53 + { 54 + muted: bool option [@default None]; 55 + blocked: string option [@default None]; 56 + } 57 + [@@deriving yojson {strict= false}] 58 + 59 + (** String type with known values *) 60 + type list_purpose = string 61 + let list_purpose_of_yojson = function 62 + | `String s -> Ok s 63 + | _ -> Error "list_purpose: expected string" 64 + let list_purpose_to_yojson s = `String s 65 + 66 + 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 + } 78 + [@@deriving yojson {strict= false}] 79 + 80 + type profile_associated_activity_subscription = 81 + { 82 + allow_subscriptions: string [@key "allowSubscriptions"]; 83 + } 84 + [@@deriving yojson {strict= false}] 85 + 86 + type profile_associated_chat = 87 + { 88 + allow_incoming: string [@key "allowIncoming"]; 89 + } 90 + [@@deriving yojson {strict= false}] 91 + 92 + 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 + } 101 + [@@deriving yojson {strict= false}] 102 + 103 + type profile_view_basic = { 104 + did: string; 105 + handle: string; 106 + display_name: string option [@key "displayName"] [@default None]; 107 + pronouns: string option [@default None]; 108 + avatar: string option [@default None]; 109 + associated: profile_associated option [@default None]; 110 + viewer: actor_viewer_state option [@default None]; 111 + labels: Com_atproto_label_defs.label list option [@default None]; 112 + created_at: string option [@key "createdAt"] [@default None]; 113 + verification: verification_state option [@default None]; 114 + status: status_view option [@default None]; 115 + debug: Yojson.Safe.t option [@default None]; 116 + } 117 + and actor_viewer_state = { 118 + muted: bool option [@default None]; 119 + muted_by_list: list_view_basic option [@key "mutedByList"] [@default None]; 120 + blocked_by: bool option [@key "blockedBy"] [@default None]; 121 + blocking: string option [@default None]; 122 + blocking_by_list: list_view_basic option [@key "blockingByList"] [@default None]; 123 + following: string option [@default None]; 124 + followed_by: string option [@key "followedBy"] [@default None]; 125 + known_followers: known_followers option [@key "knownFollowers"] [@default None]; 126 + activity_subscription: App_bsky_notification_defs.activity_subscription option [@key "activitySubscription"] [@default None]; 127 + } 128 + and known_followers = { 129 + count: int; 130 + followers: profile_view_basic list; 131 + } 132 + 133 + let rec profile_view_basic_of_yojson json = 134 + let open Yojson.Safe.Util in 135 + try 136 + let did = json |> member "did" |> to_string in 137 + let handle = json |> member "handle" |> to_string in 138 + let display_name = json |> member "displayName" |> to_option to_string in 139 + let pronouns = json |> member "pronouns" |> to_option to_string in 140 + let avatar = json |> member "avatar" |> to_option to_string in 141 + let associated = json |> member "associated" |> to_option (fun x -> match profile_associated_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 142 + 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 143 + 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 144 + let created_at = json |> member "createdAt" |> to_option to_string in 145 + let verification = json |> member "verification" |> to_option (fun x -> match verification_state_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 146 + let status = json |> member "status" |> to_option (fun x -> match status_view_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 147 + let debug = json |> member "debug" |> to_option (fun j -> j) in 148 + Ok { did; handle; display_name; pronouns; avatar; associated; viewer; labels; created_at; verification; status; debug } 149 + with e -> Error (Printexc.to_string e) 150 + 151 + and actor_viewer_state_of_yojson json = 152 + let open Yojson.Safe.Util in 153 + try 154 + let muted = json |> member "muted" |> to_option to_bool in 155 + 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 156 + let blocked_by = json |> member "blockedBy" |> to_option to_bool in 157 + let blocking = json |> member "blocking" |> to_option to_string in 158 + 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 159 + let following = json |> member "following" |> to_option to_string in 160 + let followed_by = json |> member "followedBy" |> to_option to_string in 161 + 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 162 + 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 163 + Ok { muted; muted_by_list; blocked_by; blocking; blocking_by_list; following; followed_by; known_followers; activity_subscription } 164 + with e -> Error (Printexc.to_string e) 165 + 166 + and known_followers_of_yojson json = 167 + let open Yojson.Safe.Util in 168 + try 169 + let count = json |> member "count" |> to_int in 170 + 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 171 + Ok { count; followers } 172 + with e -> Error (Printexc.to_string e) 173 + 174 + and profile_view_basic_to_yojson (r : profile_view_basic) = 175 + `Assoc [ 176 + ("did", (fun s -> `String s) r.did); 177 + ("handle", (fun s -> `String s) r.handle); 178 + ("displayName", match r.display_name with Some v -> (fun s -> `String s) v | None -> `Null); 179 + ("pronouns", match r.pronouns with Some v -> (fun s -> `String s) v | None -> `Null); 180 + ("avatar", match r.avatar with Some v -> (fun s -> `String s) v | None -> `Null); 181 + ("associated", match r.associated with Some v -> profile_associated_to_yojson v | None -> `Null); 182 + ("viewer", match r.viewer with Some v -> actor_viewer_state_to_yojson v | None -> `Null); 183 + ("labels", match r.labels with Some v -> (fun l -> `List (List.map Com_atproto_label_defs.label_to_yojson l)) v | None -> `Null); 184 + ("createdAt", match r.created_at with Some v -> (fun s -> `String s) v | None -> `Null); 185 + ("verification", match r.verification with Some v -> verification_state_to_yojson v | None -> `Null); 186 + ("status", match r.status with Some v -> status_view_to_yojson v | None -> `Null); 187 + ("debug", match r.debug with Some v -> (fun j -> j) v | None -> `Null) 188 + ] 189 + 190 + and actor_viewer_state_to_yojson (r : actor_viewer_state) = 191 + `Assoc [ 192 + ("muted", match r.muted with Some v -> (fun b -> `Bool b) v | None -> `Null); 193 + ("mutedByList", match r.muted_by_list with Some v -> list_view_basic_to_yojson v | None -> `Null); 194 + ("blockedBy", match r.blocked_by with Some v -> (fun b -> `Bool b) v | None -> `Null); 195 + ("blocking", match r.blocking with Some v -> (fun s -> `String s) v | None -> `Null); 196 + ("blockingByList", match r.blocking_by_list with Some v -> list_view_basic_to_yojson v | None -> `Null); 197 + ("following", match r.following with Some v -> (fun s -> `String s) v | None -> `Null); 198 + ("followedBy", match r.followed_by with Some v -> (fun s -> `String s) v | None -> `Null); 199 + ("knownFollowers", match r.known_followers with Some v -> known_followers_to_yojson v | None -> `Null); 200 + ("activitySubscription", match r.activity_subscription with Some v -> App_bsky_notification_defs.activity_subscription_to_yojson v | None -> `Null) 201 + ] 202 + 203 + and known_followers_to_yojson (r : known_followers) = 204 + `Assoc [ 205 + ("count", (fun i -> `Int i) r.count); 206 + ("followers", (fun l -> `List (List.map profile_view_basic_to_yojson l)) r.followers) 207 + ] 208 + 209 + type profile_view = 210 + { 211 + did: string; 212 + handle: string; 213 + display_name: string option [@key "displayName"] [@default None]; 214 + pronouns: string option [@default None]; 215 + description: string option [@default None]; 216 + avatar: string option [@default None]; 217 + associated: profile_associated option [@default None]; 218 + indexed_at: string option [@key "indexedAt"] [@default None]; 219 + created_at: string option [@key "createdAt"] [@default None]; 220 + viewer: actor_viewer_state option [@default None]; 221 + labels: Com_atproto_label_defs.label list option [@default None]; 222 + verification: verification_state option [@default None]; 223 + status: status_view option [@default None]; 224 + debug: Yojson.Safe.t option [@default None]; 225 + } 226 + [@@deriving yojson {strict= false}] 227 + 228 + type starter_pack_view_basic = 229 + { 230 + uri: string; 231 + cid: string; 232 + record: Yojson.Safe.t; 233 + creator: profile_view_basic; 234 + list_item_count: int option [@key "listItemCount"] [@default None]; 235 + joined_week_count: int option [@key "joinedWeekCount"] [@default None]; 236 + joined_all_time_count: int option [@key "joinedAllTimeCount"] [@default None]; 237 + labels: Com_atproto_label_defs.label list option [@default None]; 238 + indexed_at: string [@key "indexedAt"]; 239 + } 240 + [@@deriving yojson {strict= false}] 241 + 242 + type profile_view_detailed = 243 + { 244 + did: string; 245 + handle: string; 246 + display_name: string option [@key "displayName"] [@default None]; 247 + description: string option [@default None]; 248 + pronouns: string option [@default None]; 249 + website: string option [@default None]; 250 + avatar: string option [@default None]; 251 + banner: string option [@default None]; 252 + followers_count: int option [@key "followersCount"] [@default None]; 253 + follows_count: int option [@key "followsCount"] [@default None]; 254 + posts_count: int option [@key "postsCount"] [@default None]; 255 + associated: profile_associated option [@default None]; 256 + joined_via_starter_pack: starter_pack_view_basic option [@key "joinedViaStarterPack"] [@default None]; 257 + indexed_at: string option [@key "indexedAt"] [@default None]; 258 + created_at: string option [@key "createdAt"] [@default None]; 259 + viewer: actor_viewer_state option [@default None]; 260 + labels: Com_atproto_label_defs.label list option [@default None]; 261 + pinned_post: Com_atproto_repo_strongRef.main option [@key "pinnedPost"] [@default None]; 262 + verification: verification_state option [@default None]; 263 + status: status_view option [@default None]; 264 + debug: Yojson.Safe.t option [@default None]; 265 + } 266 + [@@deriving yojson {strict= false}] 267 + 268 + type verification_prefs = 269 + { 270 + hide_badges: bool option [@key "hideBadges"] [@default None]; 271 + } 272 + [@@deriving yojson {strict= false}] 273 + 274 + type postgate_embedding_rules_item = 275 + | PostgateDisableRule of App_bsky_feed_postgate.disable_rule 276 + | Unknown of Yojson.Safe.t 277 + 278 + let postgate_embedding_rules_item_of_yojson json = 279 + let open Yojson.Safe.Util in 280 + try 281 + match json |> member "$type" |> to_string with 282 + | "app.bsky.feed.postgate#disableRule" -> 283 + (match App_bsky_feed_postgate.disable_rule_of_yojson json with 284 + | Ok v -> Ok (PostgateDisableRule v) 285 + | Error e -> Error e) 286 + | _ -> Ok (Unknown json) 287 + with _ -> Error "failed to parse union" 288 + 289 + let postgate_embedding_rules_item_to_yojson = function 290 + | PostgateDisableRule v -> 291 + (match App_bsky_feed_postgate.disable_rule_to_yojson v with 292 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.postgate#disableRule") :: fields) 293 + | other -> other) 294 + | Unknown j -> j 295 + 296 + type threadgate_allow_rules_item = 297 + | ThreadgateMentionRule of App_bsky_feed_threadgate.mention_rule 298 + | ThreadgateFollowerRule of App_bsky_feed_threadgate.follower_rule 299 + | ThreadgateFollowingRule of App_bsky_feed_threadgate.following_rule 300 + | ThreadgateListRule of App_bsky_feed_threadgate.list_rule 301 + | Unknown of Yojson.Safe.t 302 + 303 + let threadgate_allow_rules_item_of_yojson json = 304 + let open Yojson.Safe.Util in 305 + try 306 + match json |> member "$type" |> to_string with 307 + | "app.bsky.feed.threadgate#mentionRule" -> 308 + (match App_bsky_feed_threadgate.mention_rule_of_yojson json with 309 + | Ok v -> Ok (ThreadgateMentionRule v) 310 + | Error e -> Error e) 311 + | "app.bsky.feed.threadgate#followerRule" -> 312 + (match App_bsky_feed_threadgate.follower_rule_of_yojson json with 313 + | Ok v -> Ok (ThreadgateFollowerRule v) 314 + | Error e -> Error e) 315 + | "app.bsky.feed.threadgate#followingRule" -> 316 + (match App_bsky_feed_threadgate.following_rule_of_yojson json with 317 + | Ok v -> Ok (ThreadgateFollowingRule v) 318 + | Error e -> Error e) 319 + | "app.bsky.feed.threadgate#listRule" -> 320 + (match App_bsky_feed_threadgate.list_rule_of_yojson json with 321 + | Ok v -> Ok (ThreadgateListRule v) 322 + | Error e -> Error e) 323 + | _ -> Ok (Unknown json) 324 + with _ -> Error "failed to parse union" 325 + 326 + let threadgate_allow_rules_item_to_yojson = function 327 + | ThreadgateMentionRule v -> 328 + (match App_bsky_feed_threadgate.mention_rule_to_yojson v with 329 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#mentionRule") :: fields) 330 + | other -> other) 331 + | ThreadgateFollowerRule v -> 332 + (match App_bsky_feed_threadgate.follower_rule_to_yojson v with 333 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#followerRule") :: fields) 334 + | other -> other) 335 + | ThreadgateFollowingRule v -> 336 + (match App_bsky_feed_threadgate.following_rule_to_yojson v with 337 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#followingRule") :: fields) 338 + | other -> other) 339 + | ThreadgateListRule v -> 340 + (match App_bsky_feed_threadgate.list_rule_to_yojson v with 341 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.threadgate#listRule") :: fields) 342 + | other -> other) 343 + | Unknown j -> j 344 + 345 + type post_interaction_settings_pref = 346 + { 347 + threadgate_allow_rules: threadgate_allow_rules_item list option [@key "threadgateAllowRules"] [@default None]; 348 + postgate_embedding_rules: postgate_embedding_rules_item list option [@key "postgateEmbeddingRules"] [@default None]; 349 + } 350 + [@@deriving yojson {strict= false}] 351 + 352 + type labeler_pref_item = 353 + { 354 + did: string; 355 + } 356 + [@@deriving yojson {strict= false}] 357 + 358 + type labelers_pref = 359 + { 360 + labelers: labeler_pref_item list; 361 + } 362 + [@@deriving yojson {strict= false}] 363 + 364 + type nux = 365 + { 366 + id: string; 367 + completed: bool; 368 + data: string option [@default None]; 369 + expires_at: string option [@key "expiresAt"] [@default None]; 370 + } 371 + [@@deriving yojson {strict= false}] 372 + 373 + type bsky_app_progress_guide = 374 + { 375 + guide: string; 376 + } 377 + [@@deriving yojson {strict= false}] 378 + 379 + type bsky_app_state_pref = 380 + { 381 + active_progress_guide: bsky_app_progress_guide option [@key "activeProgressGuide"] [@default None]; 382 + queued_nudges: string list option [@key "queuedNudges"] [@default None]; 383 + nuxs: nux list option [@default None]; 384 + } 385 + [@@deriving yojson {strict= false}] 386 + 387 + type hidden_posts_pref = 388 + { 389 + items: string list; 390 + } 391 + [@@deriving yojson {strict= false}] 392 + 393 + (** String type with known values *) 394 + type muted_word_target = string 395 + let muted_word_target_of_yojson = function 396 + | `String s -> Ok s 397 + | _ -> Error "muted_word_target: expected string" 398 + let muted_word_target_to_yojson s = `String s 399 + 400 + type muted_word = 401 + { 402 + id: string option [@default None]; 403 + value: string; 404 + targets: muted_word_target list; 405 + actor_target: string option [@key "actorTarget"] [@default None]; 406 + expires_at: string option [@key "expiresAt"] [@default None]; 407 + } 408 + [@@deriving yojson {strict= false}] 409 + 410 + type muted_words_pref = 411 + { 412 + items: muted_word list; 413 + } 414 + [@@deriving yojson {strict= false}] 415 + 416 + type interests_pref = 417 + { 418 + tags: string list; 419 + } 420 + [@@deriving yojson {strict= false}] 421 + 422 + type thread_view_pref = 423 + { 424 + sort: string option [@default None]; 425 + } 426 + [@@deriving yojson {strict= false}] 427 + 428 + type feed_view_pref = 429 + { 430 + feed: string; 431 + hide_replies: bool option [@key "hideReplies"] [@default None]; 432 + hide_replies_by_unfollowed: bool option [@key "hideRepliesByUnfollowed"] [@default None]; 433 + hide_replies_by_like_count: int option [@key "hideRepliesByLikeCount"] [@default None]; 434 + hide_reposts: bool option [@key "hideReposts"] [@default None]; 435 + hide_quote_posts: bool option [@key "hideQuotePosts"] [@default None]; 436 + } 437 + [@@deriving yojson {strict= false}] 438 + 439 + type declared_age_pref = 440 + { 441 + is_over_age13: bool option [@key "isOverAge13"] [@default None]; 442 + is_over_age16: bool option [@key "isOverAge16"] [@default None]; 443 + is_over_age18: bool option [@key "isOverAge18"] [@default None]; 444 + } 445 + [@@deriving yojson {strict= false}] 446 + 447 + type personal_details_pref = 448 + { 449 + birth_date: string option [@key "birthDate"] [@default None]; 450 + } 451 + [@@deriving yojson {strict= false}] 452 + 453 + type saved_feed = 454 + { 455 + id: string; 456 + type_: string [@key "type"]; 457 + value: string; 458 + pinned: bool; 459 + } 460 + [@@deriving yojson {strict= false}] 461 + 462 + type saved_feeds_pref_v2 = 463 + { 464 + items: saved_feed list; 465 + } 466 + [@@deriving yojson {strict= false}] 467 + 468 + type saved_feeds_pref = 469 + { 470 + pinned: string list; 471 + saved: string list; 472 + timeline_index: int option [@key "timelineIndex"] [@default None]; 473 + } 474 + [@@deriving yojson {strict= false}] 475 + 476 + type content_label_pref = 477 + { 478 + labeler_did: string option [@key "labelerDid"] [@default None]; 479 + label: string; 480 + visibility: string; 481 + } 482 + [@@deriving yojson {strict= false}] 483 + 484 + type adult_content_pref = 485 + { 486 + enabled: bool; 487 + } 488 + [@@deriving yojson {strict= false}] 489 + 490 + type preferences_item = 491 + | AdultContentPref of adult_content_pref 492 + | ContentLabelPref of content_label_pref 493 + | SavedFeedsPref of saved_feeds_pref 494 + | SavedFeedsPrefV2 of saved_feeds_pref_v2 495 + | PersonalDetailsPref of personal_details_pref 496 + | DeclaredAgePref of declared_age_pref 497 + | FeedViewPref of feed_view_pref 498 + | ThreadViewPref of thread_view_pref 499 + | InterestsPref of interests_pref 500 + | MutedWordsPref of muted_words_pref 501 + | HiddenPostsPref of hidden_posts_pref 502 + | BskyAppStatePref of bsky_app_state_pref 503 + | LabelersPref of labelers_pref 504 + | PostInteractionSettingsPref of post_interaction_settings_pref 505 + | VerificationPrefs of verification_prefs 506 + | Unknown of Yojson.Safe.t 507 + 508 + let preferences_item_of_yojson json = 509 + let open Yojson.Safe.Util in 510 + try 511 + match json |> member "$type" |> to_string with 512 + | "app.bsky.actor.defs#adultContentPref" -> 513 + (match adult_content_pref_of_yojson json with 514 + | Ok v -> Ok (AdultContentPref v) 515 + | Error e -> Error e) 516 + | "app.bsky.actor.defs#contentLabelPref" -> 517 + (match content_label_pref_of_yojson json with 518 + | Ok v -> Ok (ContentLabelPref v) 519 + | Error e -> Error e) 520 + | "app.bsky.actor.defs#savedFeedsPref" -> 521 + (match saved_feeds_pref_of_yojson json with 522 + | Ok v -> Ok (SavedFeedsPref v) 523 + | Error e -> Error e) 524 + | "app.bsky.actor.defs#savedFeedsPrefV2" -> 525 + (match saved_feeds_pref_v2_of_yojson json with 526 + | Ok v -> Ok (SavedFeedsPrefV2 v) 527 + | Error e -> Error e) 528 + | "app.bsky.actor.defs#personalDetailsPref" -> 529 + (match personal_details_pref_of_yojson json with 530 + | Ok v -> Ok (PersonalDetailsPref v) 531 + | Error e -> Error e) 532 + | "app.bsky.actor.defs#declaredAgePref" -> 533 + (match declared_age_pref_of_yojson json with 534 + | Ok v -> Ok (DeclaredAgePref v) 535 + | Error e -> Error e) 536 + | "app.bsky.actor.defs#feedViewPref" -> 537 + (match feed_view_pref_of_yojson json with 538 + | Ok v -> Ok (FeedViewPref v) 539 + | Error e -> Error e) 540 + | "app.bsky.actor.defs#threadViewPref" -> 541 + (match thread_view_pref_of_yojson json with 542 + | Ok v -> Ok (ThreadViewPref v) 543 + | Error e -> Error e) 544 + | "app.bsky.actor.defs#interestsPref" -> 545 + (match interests_pref_of_yojson json with 546 + | Ok v -> Ok (InterestsPref v) 547 + | Error e -> Error e) 548 + | "app.bsky.actor.defs#mutedWordsPref" -> 549 + (match muted_words_pref_of_yojson json with 550 + | Ok v -> Ok (MutedWordsPref v) 551 + | Error e -> Error e) 552 + | "app.bsky.actor.defs#hiddenPostsPref" -> 553 + (match hidden_posts_pref_of_yojson json with 554 + | Ok v -> Ok (HiddenPostsPref v) 555 + | Error e -> Error e) 556 + | "app.bsky.actor.defs#bskyAppStatePref" -> 557 + (match bsky_app_state_pref_of_yojson json with 558 + | Ok v -> Ok (BskyAppStatePref v) 559 + | Error e -> Error e) 560 + | "app.bsky.actor.defs#labelersPref" -> 561 + (match labelers_pref_of_yojson json with 562 + | Ok v -> Ok (LabelersPref v) 563 + | Error e -> Error e) 564 + | "app.bsky.actor.defs#postInteractionSettingsPref" -> 565 + (match post_interaction_settings_pref_of_yojson json with 566 + | Ok v -> Ok (PostInteractionSettingsPref v) 567 + | Error e -> Error e) 568 + | "app.bsky.actor.defs#verificationPrefs" -> 569 + (match verification_prefs_of_yojson json with 570 + | Ok v -> Ok (VerificationPrefs v) 571 + | Error e -> Error e) 572 + | _ -> Ok (Unknown json) 573 + with _ -> Error "failed to parse union" 574 + 575 + let preferences_item_to_yojson = function 576 + | AdultContentPref v -> 577 + (match adult_content_pref_to_yojson v with 578 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#adultContentPref") :: fields) 579 + | other -> other) 580 + | ContentLabelPref v -> 581 + (match content_label_pref_to_yojson v with 582 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#contentLabelPref") :: fields) 583 + | other -> other) 584 + | SavedFeedsPref v -> 585 + (match saved_feeds_pref_to_yojson v with 586 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#savedFeedsPref") :: fields) 587 + | other -> other) 588 + | SavedFeedsPrefV2 v -> 589 + (match saved_feeds_pref_v2_to_yojson v with 590 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#savedFeedsPrefV2") :: fields) 591 + | other -> other) 592 + | PersonalDetailsPref v -> 593 + (match personal_details_pref_to_yojson v with 594 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#personalDetailsPref") :: fields) 595 + | other -> other) 596 + | DeclaredAgePref v -> 597 + (match declared_age_pref_to_yojson v with 598 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#declaredAgePref") :: fields) 599 + | other -> other) 600 + | FeedViewPref v -> 601 + (match feed_view_pref_to_yojson v with 602 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#feedViewPref") :: fields) 603 + | other -> other) 604 + | ThreadViewPref v -> 605 + (match thread_view_pref_to_yojson v with 606 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#threadViewPref") :: fields) 607 + | other -> other) 608 + | InterestsPref v -> 609 + (match interests_pref_to_yojson v with 610 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#interestsPref") :: fields) 611 + | other -> other) 612 + | MutedWordsPref v -> 613 + (match muted_words_pref_to_yojson v with 614 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#mutedWordsPref") :: fields) 615 + | other -> other) 616 + | HiddenPostsPref v -> 617 + (match hidden_posts_pref_to_yojson v with 618 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#hiddenPostsPref") :: fields) 619 + | other -> other) 620 + | BskyAppStatePref v -> 621 + (match bsky_app_state_pref_to_yojson v with 622 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#bskyAppStatePref") :: fields) 623 + | other -> other) 624 + | LabelersPref v -> 625 + (match labelers_pref_to_yojson v with 626 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#labelersPref") :: fields) 627 + | other -> other) 628 + | PostInteractionSettingsPref v -> 629 + (match post_interaction_settings_pref_to_yojson v with 630 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#postInteractionSettingsPref") :: fields) 631 + | other -> other) 632 + | VerificationPrefs v -> 633 + (match verification_prefs_to_yojson v with 634 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.actor.defs#verificationPrefs") :: fields) 635 + | other -> other) 636 + | Unknown j -> j 637 + 638 + type preferences = preferences_item list 639 + let preferences_of_yojson json = 640 + let open Yojson.Safe.Util in 641 + Ok (to_list json |> List.filter_map (fun x -> match preferences_item_of_yojson x with Ok v -> Some v | _ -> None)) 642 + let preferences_to_yojson l = `List (List.map preferences_item_to_yojson l) 643 + 644 + type record_main = 645 + { 646 + record: Com_atproto_repo_strongRef.main; 647 + } 648 + [@@deriving yojson {strict= false}] 649 + 650 + type labeler_viewer_state = 651 + { 652 + like: string option [@default None]; 653 + } 654 + [@@deriving yojson {strict= false}] 655 + 656 + type labeler_view = 657 + { 658 + uri: string; 659 + cid: string; 660 + creator: profile_view; 661 + like_count: int option [@key "likeCount"] [@default None]; 662 + viewer: labeler_viewer_state option [@default None]; 663 + indexed_at: string [@key "indexedAt"]; 664 + labels: Com_atproto_label_defs.label list option [@default None]; 665 + } 666 + [@@deriving yojson {strict= false}] 667 + 668 + type list_view = 669 + { 670 + uri: string; 671 + cid: string; 672 + creator: profile_view; 673 + name: string; 674 + purpose: list_purpose; 675 + description: string option [@default None]; 676 + description_facets: App_bsky_richtext_facet.main list option [@key "descriptionFacets"] [@default None]; 677 + avatar: string option [@default None]; 678 + list_item_count: int option [@key "listItemCount"] [@default None]; 679 + labels: Com_atproto_label_defs.label list option [@default None]; 680 + viewer: list_viewer_state option [@default None]; 681 + indexed_at: string [@key "indexedAt"]; 682 + } 683 + [@@deriving yojson {strict= false}] 684 + 685 + type generator_viewer_state = 686 + { 687 + like: string option [@default None]; 688 + } 689 + [@@deriving yojson {strict= false}] 690 + 691 + type generator_view = 692 + { 693 + uri: string; 694 + cid: string; 695 + did: string; 696 + creator: profile_view; 697 + display_name: string [@key "displayName"]; 698 + description: string option [@default None]; 699 + description_facets: App_bsky_richtext_facet.main list option [@key "descriptionFacets"] [@default None]; 700 + avatar: string option [@default None]; 701 + like_count: int option [@key "likeCount"] [@default None]; 702 + accepts_interactions: bool option [@key "acceptsInteractions"] [@default None]; 703 + labels: Com_atproto_label_defs.label list option [@default None]; 704 + viewer: generator_viewer_state option [@default None]; 705 + content_mode: string option [@key "contentMode"] [@default None]; 706 + indexed_at: string [@key "indexedAt"]; 707 + } 708 + [@@deriving yojson {strict= false}] 709 + 710 + type view_detached = 711 + { 712 + uri: string; 713 + detached: bool; 714 + } 715 + [@@deriving yojson {strict= false}] 716 + 717 + type blocked_author = 718 + { 719 + did: string; 720 + viewer: actor_viewer_state option [@default None]; 721 + } 722 + [@@deriving yojson {strict= false}] 723 + 724 + type view_blocked = 725 + { 726 + uri: string; 727 + blocked: bool; 728 + author: blocked_author; 729 + } 730 + [@@deriving yojson {strict= false}] 731 + 732 + type view_not_found = 733 + { 734 + uri: string; 735 + not_found: bool [@key "notFound"]; 736 + } 737 + [@@deriving yojson {strict= false}] 738 + 739 + type record_with_media_media = 740 + | Images of App_bsky_embed_images.main 741 + | Video of App_bsky_embed_video.main 742 + | External of App_bsky_embed_external.main 743 + | Unknown of Yojson.Safe.t 744 + 745 + let record_with_media_media_of_yojson json = 746 + let open Yojson.Safe.Util in 747 + try 748 + match json |> member "$type" |> to_string with 749 + | "app.bsky.embed.images" -> 750 + (match App_bsky_embed_images.main_of_yojson json with 751 + | Ok v -> Ok (Images v) 752 + | Error e -> Error e) 753 + | "app.bsky.embed.video" -> 754 + (match App_bsky_embed_video.main_of_yojson json with 755 + | Ok v -> Ok (Video v) 756 + | Error e -> Error e) 757 + | "app.bsky.embed.external" -> 758 + (match App_bsky_embed_external.main_of_yojson json with 759 + | Ok v -> Ok (External v) 760 + | Error e -> Error e) 761 + | _ -> Ok (Unknown json) 762 + with _ -> Error "failed to parse union" 763 + 764 + let record_with_media_media_to_yojson = function 765 + | Images v -> 766 + (match App_bsky_embed_images.main_to_yojson v with 767 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.images") :: fields) 768 + | other -> other) 769 + | Video v -> 770 + (match App_bsky_embed_video.main_to_yojson v with 771 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.video") :: fields) 772 + | other -> other) 773 + | External v -> 774 + (match App_bsky_embed_external.main_to_yojson v with 775 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.external") :: fields) 776 + | other -> other) 777 + | Unknown j -> j 778 + 779 + type embeds_item = 780 + | ImagesView of App_bsky_embed_images.view 781 + | VideoView of App_bsky_embed_video.view 782 + | ExternalView of App_bsky_embed_external.view 783 + | RecordView of record_view 784 + | RecordWithMediaView of record_with_media_view 785 + | Unknown of Yojson.Safe.t 786 + and record = 787 + | ViewRecord of view_record 788 + | ViewNotFound of view_not_found 789 + | ViewBlocked of view_blocked 790 + | ViewDetached of view_detached 791 + | DefsGeneratorView of generator_view 792 + | DefsListView of list_view 793 + | DefsLabelerView of labeler_view 794 + | DefsStarterPackViewBasic of starter_pack_view_basic 795 + | Unknown of Yojson.Safe.t 796 + and record_view = { 797 + record: record; 798 + } 799 + and view_record = { 800 + uri: string; 801 + cid: string; 802 + author: profile_view_basic; 803 + value: Yojson.Safe.t; 804 + labels: Com_atproto_label_defs.label list option [@default None]; 805 + reply_count: int option [@key "replyCount"] [@default None]; 806 + repost_count: int option [@key "repostCount"] [@default None]; 807 + like_count: int option [@key "likeCount"] [@default None]; 808 + quote_count: int option [@key "quoteCount"] [@default None]; 809 + embeds: embeds_item list option [@default None]; 810 + indexed_at: string [@key "indexedAt"]; 811 + } 812 + and record_with_media_view = { 813 + record: record_view; 814 + media: record_with_media_media; 815 + } 816 + 817 + let rec embeds_item_of_yojson json = 818 + let open Yojson.Safe.Util in 819 + try 820 + match json |> member "$type" |> to_string with 821 + | "app.bsky.embed.images#view" -> 822 + (match App_bsky_embed_images.view_of_yojson json with 823 + | Ok v -> Ok (ImagesView v) 824 + | Error e -> Error e) 825 + | "app.bsky.embed.video#view" -> 826 + (match App_bsky_embed_video.view_of_yojson json with 827 + | Ok v -> Ok (VideoView v) 828 + | Error e -> Error e) 829 + | "app.bsky.embed.external#view" -> 830 + (match App_bsky_embed_external.view_of_yojson json with 831 + | Ok v -> Ok (ExternalView v) 832 + | Error e -> Error e) 833 + | "app.bsky.embed.record#view" -> 834 + (match record_view_of_yojson json with 835 + | Ok v -> Ok (RecordView v) 836 + | Error e -> Error e) 837 + | "app.bsky.embed.recordWithMedia#view" -> 838 + (match record_with_media_view_of_yojson json with 839 + | Ok v -> Ok (RecordWithMediaView v) 840 + | Error e -> Error e) 841 + | _ -> Ok (Unknown json) 842 + with _ -> Error "failed to parse union" 843 + 844 + and record_of_yojson json = 845 + let open Yojson.Safe.Util in 846 + try 847 + match json |> member "$type" |> to_string with 848 + | "app.bsky.embed.record#viewRecord" -> 849 + (match view_record_of_yojson json with 850 + | Ok v -> Ok (ViewRecord v) 851 + | Error e -> Error e) 852 + | "app.bsky.embed.record#viewNotFound" -> 853 + (match view_not_found_of_yojson json with 854 + | Ok v -> Ok (ViewNotFound v) 855 + | Error e -> Error e) 856 + | "app.bsky.embed.record#viewBlocked" -> 857 + (match view_blocked_of_yojson json with 858 + | Ok v -> Ok (ViewBlocked v) 859 + | Error e -> Error e) 860 + | "app.bsky.embed.record#viewDetached" -> 861 + (match view_detached_of_yojson json with 862 + | Ok v -> Ok (ViewDetached v) 863 + | Error e -> Error e) 864 + | "app.bsky.feed.defs#generatorView" -> 865 + (match generator_view_of_yojson json with 866 + | Ok v -> Ok (DefsGeneratorView v) 867 + | Error e -> Error e) 868 + | "app.bsky.graph.defs#listView" -> 869 + (match list_view_of_yojson json with 870 + | Ok v -> Ok (DefsListView v) 871 + | Error e -> Error e) 872 + | "app.bsky.labeler.defs#labelerView" -> 873 + (match labeler_view_of_yojson json with 874 + | Ok v -> Ok (DefsLabelerView v) 875 + | Error e -> Error e) 876 + | "app.bsky.graph.defs#starterPackViewBasic" -> 877 + (match starter_pack_view_basic_of_yojson json with 878 + | Ok v -> Ok (DefsStarterPackViewBasic v) 879 + | Error e -> Error e) 880 + | _ -> Ok (Unknown json) 881 + with _ -> Error "failed to parse union" 882 + 883 + and record_view_of_yojson json = 884 + let open Yojson.Safe.Util in 885 + try 886 + let record = json |> member "record" |> record_of_yojson |> Result.get_ok in 887 + Ok { record } 888 + with e -> Error (Printexc.to_string e) 889 + 890 + and view_record_of_yojson json = 891 + let open Yojson.Safe.Util in 892 + try 893 + let uri = json |> member "uri" |> to_string in 894 + let cid = json |> member "cid" |> to_string in 895 + let author = json |> member "author" |> profile_view_basic_of_yojson |> Result.get_ok in 896 + let value = json |> member "value" |> (fun j -> j) in 897 + 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 898 + let reply_count = json |> member "replyCount" |> to_option to_int in 899 + let repost_count = json |> member "repostCount" |> to_option to_int in 900 + let like_count = json |> member "likeCount" |> to_option to_int in 901 + let quote_count = json |> member "quoteCount" |> to_option to_int in 902 + 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 903 + let indexed_at = json |> member "indexedAt" |> to_string in 904 + Ok { uri; cid; author; value; labels; reply_count; repost_count; like_count; quote_count; embeds; indexed_at } 905 + with e -> Error (Printexc.to_string e) 906 + 907 + and record_with_media_view_of_yojson json = 908 + let open Yojson.Safe.Util in 909 + try 910 + let record = json |> member "record" |> record_view_of_yojson |> Result.get_ok in 911 + let media = json |> member "media" |> record_with_media_media_of_yojson |> Result.get_ok in 912 + Ok { record; media } 913 + with e -> Error (Printexc.to_string e) 914 + 915 + and embeds_item_to_yojson = function 916 + | ImagesView v -> 917 + (match App_bsky_embed_images.view_to_yojson v with 918 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.images#view") :: fields) 919 + | other -> other) 920 + | VideoView v -> 921 + (match App_bsky_embed_video.view_to_yojson v with 922 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.video#view") :: fields) 923 + | other -> other) 924 + | ExternalView v -> 925 + (match App_bsky_embed_external.view_to_yojson v with 926 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.external#view") :: fields) 927 + | other -> other) 928 + | RecordView v -> 929 + (match record_view_to_yojson v with 930 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#view") :: fields) 931 + | other -> other) 932 + | RecordWithMediaView v -> 933 + (match record_with_media_view_to_yojson v with 934 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.recordWithMedia#view") :: fields) 935 + | other -> other) 936 + | Unknown j -> j 937 + 938 + and record_to_yojson = function 939 + | ViewRecord v -> 940 + (match view_record_to_yojson v with 941 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#viewRecord") :: fields) 942 + | other -> other) 943 + | ViewNotFound v -> 944 + (match view_not_found_to_yojson v with 945 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#viewNotFound") :: fields) 946 + | other -> other) 947 + | ViewBlocked v -> 948 + (match view_blocked_to_yojson v with 949 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#viewBlocked") :: fields) 950 + | other -> other) 951 + | ViewDetached v -> 952 + (match view_detached_to_yojson v with 953 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#viewDetached") :: fields) 954 + | other -> other) 955 + | DefsGeneratorView v -> 956 + (match generator_view_to_yojson v with 957 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#generatorView") :: fields) 958 + | other -> other) 959 + | DefsListView v -> 960 + (match list_view_to_yojson v with 961 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.graph.defs#listView") :: fields) 962 + | other -> other) 963 + | DefsLabelerView v -> 964 + (match labeler_view_to_yojson v with 965 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.labeler.defs#labelerView") :: fields) 966 + | other -> other) 967 + | DefsStarterPackViewBasic v -> 968 + (match starter_pack_view_basic_to_yojson v with 969 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.graph.defs#starterPackViewBasic") :: fields) 970 + | other -> other) 971 + | Unknown j -> j 972 + 973 + and record_view_to_yojson (r : record_view) = 974 + `Assoc [ 975 + ("record", record_to_yojson r.record) 976 + ] 977 + 978 + and view_record_to_yojson (r : view_record) = 979 + `Assoc [ 980 + ("uri", (fun s -> `String s) r.uri); 981 + ("cid", (fun s -> `String s) r.cid); 982 + ("author", profile_view_basic_to_yojson r.author); 983 + ("value", (fun j -> j) r.value); 984 + ("labels", match r.labels with Some v -> (fun l -> `List (List.map Com_atproto_label_defs.label_to_yojson l)) v | None -> `Null); 985 + ("replyCount", match r.reply_count with Some v -> (fun i -> `Int i) v | None -> `Null); 986 + ("repostCount", match r.repost_count with Some v -> (fun i -> `Int i) v | None -> `Null); 987 + ("likeCount", match r.like_count with Some v -> (fun i -> `Int i) v | None -> `Null); 988 + ("quoteCount", match r.quote_count with Some v -> (fun i -> `Int i) v | None -> `Null); 989 + ("embeds", match r.embeds with Some v -> (fun l -> `List (List.map embeds_item_to_yojson l)) v | None -> `Null); 990 + ("indexedAt", (fun s -> `String s) r.indexed_at) 991 + ] 992 + 993 + and record_with_media_view_to_yojson (r : record_with_media_view) = 994 + `Assoc [ 995 + ("record", record_view_to_yojson r.record); 996 + ("media", record_with_media_media_to_yojson r.media) 997 + ] 998 + 999 + type record_with_media_main = 1000 + { 1001 + record: record_main; 1002 + media: record_with_media_media; 1003 + } 1004 + [@@deriving yojson {strict= false}] 1005 + 1006 + type threadgate_view = 1007 + { 1008 + uri: string option [@default None]; 1009 + cid: string option [@default None]; 1010 + record: Yojson.Safe.t option [@default None]; 1011 + lists: list_view_basic list option [@default None]; 1012 + } 1013 + [@@deriving yojson {strict= false}] 1014 + 1015 + type feed_viewer_state = 1016 + { 1017 + repost: string option [@default None]; 1018 + like: string option [@default None]; 1019 + bookmarked: bool option [@default None]; 1020 + thread_muted: bool option [@key "threadMuted"] [@default None]; 1021 + reply_disabled: bool option [@key "replyDisabled"] [@default None]; 1022 + embedding_disabled: bool option [@key "embeddingDisabled"] [@default None]; 1023 + pinned: bool option [@default None]; 1024 + } 1025 + [@@deriving yojson {strict= false}] 1026 + 1027 + type feed_embed = 1028 + | ImagesView of App_bsky_embed_images.view 1029 + | VideoView of App_bsky_embed_video.view 1030 + | ExternalView of App_bsky_embed_external.view 1031 + | RecordView of record_view 1032 + | RecordWithMediaView of record_with_media_view 1033 + | Unknown of Yojson.Safe.t 1034 + 1035 + let feed_embed_of_yojson json = 1036 + let open Yojson.Safe.Util in 1037 + try 1038 + match json |> member "$type" |> to_string with 1039 + | "app.bsky.embed.images#view" -> 1040 + (match App_bsky_embed_images.view_of_yojson json with 1041 + | Ok v -> Ok (ImagesView v) 1042 + | Error e -> Error e) 1043 + | "app.bsky.embed.video#view" -> 1044 + (match App_bsky_embed_video.view_of_yojson json with 1045 + | Ok v -> Ok (VideoView v) 1046 + | Error e -> Error e) 1047 + | "app.bsky.embed.external#view" -> 1048 + (match App_bsky_embed_external.view_of_yojson json with 1049 + | Ok v -> Ok (ExternalView v) 1050 + | Error e -> Error e) 1051 + | "app.bsky.embed.record#view" -> 1052 + (match record_view_of_yojson json with 1053 + | Ok v -> Ok (RecordView v) 1054 + | Error e -> Error e) 1055 + | "app.bsky.embed.recordWithMedia#view" -> 1056 + (match record_with_media_view_of_yojson json with 1057 + | Ok v -> Ok (RecordWithMediaView v) 1058 + | Error e -> Error e) 1059 + | _ -> Ok (Unknown json) 1060 + with _ -> Error "failed to parse union" 1061 + 1062 + let feed_embed_to_yojson = function 1063 + | ImagesView v -> 1064 + (match App_bsky_embed_images.view_to_yojson v with 1065 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.images#view") :: fields) 1066 + | other -> other) 1067 + | VideoView v -> 1068 + (match App_bsky_embed_video.view_to_yojson v with 1069 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.video#view") :: fields) 1070 + | other -> other) 1071 + | ExternalView v -> 1072 + (match App_bsky_embed_external.view_to_yojson v with 1073 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.external#view") :: fields) 1074 + | other -> other) 1075 + | RecordView v -> 1076 + (match record_view_to_yojson v with 1077 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.record#view") :: fields) 1078 + | other -> other) 1079 + | RecordWithMediaView v -> 1080 + (match record_with_media_view_to_yojson v with 1081 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.embed.recordWithMedia#view") :: fields) 1082 + | other -> other) 1083 + | Unknown j -> j 1084 + 1085 + type post_view = 1086 + { 1087 + uri: string; 1088 + cid: string; 1089 + author: profile_view_basic; 1090 + record: Yojson.Safe.t; 1091 + embed: embeds_item option [@default None]; 1092 + bookmark_count: int option [@key "bookmarkCount"] [@default None]; 1093 + reply_count: int option [@key "replyCount"] [@default None]; 1094 + repost_count: int option [@key "repostCount"] [@default None]; 1095 + like_count: int option [@key "likeCount"] [@default None]; 1096 + quote_count: int option [@key "quoteCount"] [@default None]; 1097 + indexed_at: string [@key "indexedAt"]; 1098 + viewer: feed_viewer_state option [@default None]; 1099 + labels: Com_atproto_label_defs.label list option [@default None]; 1100 + threadgate: threadgate_view option [@default None]; 1101 + debug: Yojson.Safe.t option [@default None]; 1102 + } 1103 + [@@deriving yojson {strict= false}] 1104 + 1105 + type thread_context = 1106 + { 1107 + root_author_like: string option [@key "rootAuthorLike"] [@default None]; 1108 + } 1109 + [@@deriving yojson {strict= false}] 1110 + 1111 + type reason_pin = unit 1112 + let reason_pin_of_yojson _ = Ok () 1113 + let reason_pin_to_yojson () = `Assoc [] 1114 + 1115 + type reason_repost = 1116 + { 1117 + by: profile_view_basic; 1118 + uri: string option [@default None]; 1119 + cid: string option [@default None]; 1120 + indexed_at: string [@key "indexedAt"]; 1121 + } 1122 + [@@deriving yojson {strict= false}] 1123 + 1124 + type blocked_post = 1125 + { 1126 + uri: string; 1127 + blocked: bool; 1128 + author: blocked_author; 1129 + } 1130 + [@@deriving yojson {strict= false}] 1131 + 1132 + type not_found_post = 1133 + { 1134 + uri: string; 1135 + not_found: bool [@key "notFound"]; 1136 + } 1137 + [@@deriving yojson {strict= false}] 1138 + 1139 + type feed_parent = 1140 + | PostView of post_view 1141 + | NotFoundPost of not_found_post 1142 + | BlockedPost of blocked_post 1143 + | Unknown of Yojson.Safe.t 1144 + 1145 + let feed_parent_of_yojson json = 1146 + let open Yojson.Safe.Util in 1147 + try 1148 + match json |> member "$type" |> to_string with 1149 + | "app.bsky.feed.defs#postView" -> 1150 + (match post_view_of_yojson json with 1151 + | Ok v -> Ok (PostView v) 1152 + | Error e -> Error e) 1153 + | "app.bsky.feed.defs#notFoundPost" -> 1154 + (match not_found_post_of_yojson json with 1155 + | Ok v -> Ok (NotFoundPost v) 1156 + | Error e -> Error e) 1157 + | "app.bsky.feed.defs#blockedPost" -> 1158 + (match blocked_post_of_yojson json with 1159 + | Ok v -> Ok (BlockedPost v) 1160 + | Error e -> Error e) 1161 + | _ -> Ok (Unknown json) 1162 + with _ -> Error "failed to parse union" 1163 + 1164 + let feed_parent_to_yojson = function 1165 + | PostView v -> 1166 + (match post_view_to_yojson v with 1167 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#postView") :: fields) 1168 + | other -> other) 1169 + | NotFoundPost v -> 1170 + (match not_found_post_to_yojson v with 1171 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 1172 + | other -> other) 1173 + | BlockedPost v -> 1174 + (match blocked_post_to_yojson v with 1175 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 1176 + | other -> other) 1177 + | Unknown j -> j 1178 + 1179 + type root = 1180 + | PostView of post_view 1181 + | NotFoundPost of not_found_post 1182 + | BlockedPost of blocked_post 1183 + | Unknown of Yojson.Safe.t 1184 + 1185 + let root_of_yojson json = 1186 + let open Yojson.Safe.Util in 1187 + try 1188 + match json |> member "$type" |> to_string with 1189 + | "app.bsky.feed.defs#postView" -> 1190 + (match post_view_of_yojson json with 1191 + | Ok v -> Ok (PostView v) 1192 + | Error e -> Error e) 1193 + | "app.bsky.feed.defs#notFoundPost" -> 1194 + (match not_found_post_of_yojson json with 1195 + | Ok v -> Ok (NotFoundPost v) 1196 + | Error e -> Error e) 1197 + | "app.bsky.feed.defs#blockedPost" -> 1198 + (match blocked_post_of_yojson json with 1199 + | Ok v -> Ok (BlockedPost v) 1200 + | Error e -> Error e) 1201 + | _ -> Ok (Unknown json) 1202 + with _ -> Error "failed to parse union" 1203 + 1204 + let root_to_yojson = function 1205 + | PostView v -> 1206 + (match post_view_to_yojson v with 1207 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#postView") :: fields) 1208 + | other -> other) 1209 + | NotFoundPost v -> 1210 + (match not_found_post_to_yojson v with 1211 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 1212 + | other -> other) 1213 + | BlockedPost v -> 1214 + (match blocked_post_to_yojson v with 1215 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 1216 + | other -> other) 1217 + | Unknown j -> j 1218 + 1219 + type reply_ref = 1220 + { 1221 + root: feed_parent; 1222 + parent: feed_parent; 1223 + grandparent_author: profile_view_basic option [@key "grandparentAuthor"] [@default None]; 1224 + } 1225 + [@@deriving yojson {strict= false}] 1226 + 1227 + type feed_reason = 1228 + | ReasonRepost of reason_repost 1229 + | ReasonPin of reason_pin 1230 + | Unknown of Yojson.Safe.t 1231 + 1232 + let feed_reason_of_yojson json = 1233 + let open Yojson.Safe.Util in 1234 + try 1235 + match json |> member "$type" |> to_string with 1236 + | "app.bsky.feed.defs#reasonRepost" -> 1237 + (match reason_repost_of_yojson json with 1238 + | Ok v -> Ok (ReasonRepost v) 1239 + | Error e -> Error e) 1240 + | "app.bsky.feed.defs#reasonPin" -> 1241 + (match reason_pin_of_yojson json with 1242 + | Ok v -> Ok (ReasonPin v) 1243 + | Error e -> Error e) 1244 + | _ -> Ok (Unknown json) 1245 + with _ -> Error "failed to parse union" 1246 + 1247 + let feed_reason_to_yojson = function 1248 + | ReasonRepost v -> 1249 + (match reason_repost_to_yojson v with 1250 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#reasonRepost") :: fields) 1251 + | other -> other) 1252 + | ReasonPin v -> 1253 + (match reason_pin_to_yojson v with 1254 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#reasonPin") :: fields) 1255 + | other -> other) 1256 + | Unknown j -> j 1257 + 1258 + type feed_view_post = 1259 + { 1260 + post: post_view; 1261 + reply: reply_ref option [@default None]; 1262 + reason: feed_reason option [@default None]; 1263 + feed_context: string option [@key "feedContext"] [@default None]; 1264 + req_id: string option [@key "reqId"] [@default None]; 1265 + } 1266 + [@@deriving yojson {strict= false}] 1267 + 1268 + type replies_item = 1269 + | ThreadViewPost of thread_view_post 1270 + | NotFoundPost of not_found_post 1271 + | BlockedPost of blocked_post 1272 + | Unknown of Yojson.Safe.t 1273 + and thread_view_post = { 1274 + post: post_view; 1275 + parent: replies_item option [@default None]; 1276 + replies: replies_item list option [@default None]; 1277 + thread_context: thread_context option [@key "threadContext"] [@default None]; 1278 + } 1279 + 1280 + let rec replies_item_of_yojson json = 1281 + let open Yojson.Safe.Util in 1282 + try 1283 + match json |> member "$type" |> to_string with 1284 + | "app.bsky.feed.defs#threadViewPost" -> 1285 + (match thread_view_post_of_yojson json with 1286 + | Ok v -> Ok (ThreadViewPost v) 1287 + | Error e -> Error e) 1288 + | "app.bsky.feed.defs#notFoundPost" -> 1289 + (match not_found_post_of_yojson json with 1290 + | Ok v -> Ok (NotFoundPost v) 1291 + | Error e -> Error e) 1292 + | "app.bsky.feed.defs#blockedPost" -> 1293 + (match blocked_post_of_yojson json with 1294 + | Ok v -> Ok (BlockedPost v) 1295 + | Error e -> Error e) 1296 + | _ -> Ok (Unknown json) 1297 + with _ -> Error "failed to parse union" 1298 + 1299 + and thread_view_post_of_yojson json = 1300 + let open Yojson.Safe.Util in 1301 + try 1302 + let post = json |> member "post" |> post_view_of_yojson |> Result.get_ok in 1303 + let parent = json |> member "parent" |> to_option (fun x -> match replies_item_of_yojson x with Ok v -> Some v | _ -> None) |> Option.join in 1304 + 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 1305 + 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 1306 + Ok { post; parent; replies; thread_context } 1307 + with e -> Error (Printexc.to_string e) 1308 + 1309 + and replies_item_to_yojson = function 1310 + | ThreadViewPost v -> 1311 + (match thread_view_post_to_yojson v with 1312 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#threadViewPost") :: fields) 1313 + | other -> other) 1314 + | NotFoundPost v -> 1315 + (match not_found_post_to_yojson v with 1316 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#notFoundPost") :: fields) 1317 + | other -> other) 1318 + | BlockedPost v -> 1319 + (match blocked_post_to_yojson v with 1320 + | `Assoc fields -> `Assoc (("$type", `String "app.bsky.feed.defs#blockedPost") :: fields) 1321 + | other -> other) 1322 + | Unknown j -> j 1323 + 1324 + and thread_view_post_to_yojson (r : thread_view_post) = 1325 + `Assoc [ 1326 + ("post", post_view_to_yojson r.post); 1327 + ("parent", match r.parent with Some v -> replies_item_to_yojson v | None -> `Null); 1328 + ("replies", match r.replies with Some v -> (fun l -> `List (List.map replies_item_to_yojson l)) v | None -> `Null); 1329 + ("threadContext", match r.thread_context with Some v -> thread_context_to_yojson v | None -> `Null) 1330 + ] 1331 + 1332 + type skeleton_reason_pin = unit 1333 + let skeleton_reason_pin_of_yojson _ = Ok () 1334 + let skeleton_reason_pin_to_yojson () = `Assoc [] 1335 + 1336 + type skeleton_reason_repost = 1337 + { 1338 + repost: string; 1339 + } 1340 + [@@deriving yojson {strict= false}] 1341 + 1342 + type skeleton_feed_post = 1343 + { 1344 + post: string; 1345 + reason: feed_reason option [@default None]; 1346 + feed_context: string option [@key "feedContext"] [@default None]; 1347 + } 1348 + [@@deriving yojson {strict= false}] 1349 + 1350 + type interaction = 1351 + { 1352 + item: string option [@default None]; 1353 + event: string option [@default None]; 1354 + feed_context: string option [@key "feedContext"] [@default None]; 1355 + req_id: string option [@key "reqId"] [@default None]; 1356 + } 1357 + [@@deriving yojson {strict= false}] 1358 + 1359 + (** Request that less content like the given feed item be shown in the feed *) 1360 + let request_less = "app.bsky.feed.defs#requestLess" 1361 + 1362 + (** Request that more content like the given feed item be shown in the feed *) 1363 + let request_more = "app.bsky.feed.defs#requestMore" 1364 + 1365 + (** User clicked through to the feed item *) 1366 + let clickthrough_item = "app.bsky.feed.defs#clickthroughItem" 1367 + 1368 + (** User clicked through to the author of the feed item *) 1369 + let clickthrough_author = "app.bsky.feed.defs#clickthroughAuthor" 1370 + 1371 + (** User clicked through to the reposter of the feed item *) 1372 + let clickthrough_reposter = "app.bsky.feed.defs#clickthroughReposter" 1373 + 1374 + (** User clicked through to the embedded content of the feed item *) 1375 + let clickthrough_embed = "app.bsky.feed.defs#clickthroughEmbed" 1376 + 1377 + (** Declares the feed generator returns any types of posts. *) 1378 + let content_mode_unspecified = "app.bsky.feed.defs#contentModeUnspecified" 1379 + 1380 + (** Declares the feed generator returns posts containing app.bsky.embed.video embeds. *) 1381 + let content_mode_video = "app.bsky.feed.defs#contentModeVideo" 1382 + 1383 + (** Feed item was seen by user *) 1384 + let interaction_seen = "app.bsky.feed.defs#interactionSeen" 1385 + 1386 + (** User liked the feed item *) 1387 + let interaction_like = "app.bsky.feed.defs#interactionLike" 1388 + 1389 + (** User reposted the feed item *) 1390 + let interaction_repost = "app.bsky.feed.defs#interactionRepost" 1391 + 1392 + (** User replied to the feed item *) 1393 + let interaction_reply = "app.bsky.feed.defs#interactionReply" 1394 + 1395 + (** User quoted the feed item *) 1396 + let interaction_quote = "app.bsky.feed.defs#interactionQuote" 1397 + 1398 + (** User shared the feed item *) 1399 + let interaction_share = "app.bsky.feed.defs#interactionShare" 1400 + 1401 + type list_item_view = 1402 + { 1403 + uri: string; 1404 + subject: profile_view; 1405 + } 1406 + [@@deriving yojson {strict= false}] 1407 + 1408 + type starter_pack_view = 1409 + { 1410 + uri: string; 1411 + cid: string; 1412 + record: Yojson.Safe.t; 1413 + creator: profile_view_basic; 1414 + list: list_view_basic option [@default None]; 1415 + list_items_sample: list_item_view list option [@key "listItemsSample"] [@default None]; 1416 + feeds: generator_view list option [@default None]; 1417 + joined_week_count: int option [@key "joinedWeekCount"] [@default None]; 1418 + joined_all_time_count: int option [@key "joinedAllTimeCount"] [@default None]; 1419 + labels: Com_atproto_label_defs.label list option [@default None]; 1420 + indexed_at: string [@key "indexedAt"]; 1421 + } 1422 + [@@deriving yojson {strict= false}] 1423 + 1424 + (** A list of actors to apply an aggregate moderation action (mute/block) on. *) 1425 + let modlist = "app.bsky.graph.defs#modlist" 1426 + 1427 + (** A list of actors used for curation purposes such as list feeds or interaction gating. *) 1428 + let curatelist = "app.bsky.graph.defs#curatelist" 1429 + 1430 + (** A list of actors used for only for reference purposes such as within a starter pack. *) 1431 + let referencelist = "app.bsky.graph.defs#referencelist" 1432 + 1433 + type not_found_actor = 1434 + { 1435 + actor: string; 1436 + not_found: bool [@key "notFound"]; 1437 + } 1438 + [@@deriving yojson {strict= false}] 1439 + 1440 + type relationship = 1441 + { 1442 + did: string; 1443 + following: string option [@default None]; 1444 + followed_by: string option [@key "followedBy"] [@default None]; 1445 + blocking: string option [@default None]; 1446 + blocked_by: string option [@key "blockedBy"] [@default None]; 1447 + blocking_by_list: string option [@key "blockingByList"] [@default None]; 1448 + blocked_by_list: string option [@key "blockedByList"] [@default None]; 1449 + } 1450 + [@@deriving yojson {strict= false}] 1451 + 1452 + type labeler_policies = 1453 + { 1454 + label_values: Com_atproto_label_defs.label_value list [@key "labelValues"]; 1455 + label_value_definitions: Com_atproto_label_defs.label_value_definition list option [@key "labelValueDefinitions"] [@default None]; 1456 + } 1457 + [@@deriving yojson {strict= false}] 1458 + 1459 + type labeler_view_detailed = 1460 + { 1461 + uri: string; 1462 + cid: string; 1463 + creator: profile_view; 1464 + policies: labeler_policies; 1465 + like_count: int option [@key "likeCount"] [@default None]; 1466 + viewer: labeler_viewer_state option [@default None]; 1467 + indexed_at: string [@key "indexedAt"]; 1468 + labels: Com_atproto_label_defs.label list option [@default None]; 1469 + reason_types: Com_atproto_moderation_defs.reason_type list option [@key "reasonTypes"] [@default None]; 1470 + subject_types: Com_atproto_moderation_defs.subject_type list option [@key "subjectTypes"] [@default None]; 1471 + subject_collections: string list option [@key "subjectCollections"] [@default None]; 1472 + } 1473 + [@@deriving yojson {strict= false}] 1474 +
+100
pegasus/lib/lexicons/app_bsky_unspecced_defs.ml
··· 1 + (* generated from app.bsky.unspecced.defs *) 2 + 3 + type skeleton_search_post = 4 + { 5 + uri: string; 6 + } 7 + [@@deriving yojson {strict= false}] 8 + 9 + type skeleton_search_actor = 10 + { 11 + did: string; 12 + } 13 + [@@deriving yojson {strict= false}] 14 + 15 + type skeleton_search_starter_pack = 16 + { 17 + uri: string; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + 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 + } 28 + [@@deriving yojson {strict= false}] 29 + 30 + 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 + } 41 + [@@deriving yojson {strict= false}] 42 + 43 + 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 + } 54 + [@@deriving yojson {strict= false}] 55 + 56 + 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 + } 65 + [@@deriving yojson {strict= false}] 66 + 67 + type thread_item_no_unauthenticated = unit 68 + let thread_item_no_unauthenticated_of_yojson _ = Ok () 69 + let thread_item_no_unauthenticated_to_yojson () = `Assoc [] 70 + 71 + type thread_item_not_found = unit 72 + let thread_item_not_found_of_yojson _ = Ok () 73 + let thread_item_not_found_to_yojson () = `Assoc [] 74 + 75 + type thread_item_blocked = 76 + { 77 + author: App_bsky_feed_defs.blocked_author; 78 + } 79 + [@@deriving yojson {strict= false}] 80 + 81 + type age_assurance_state = 82 + { 83 + last_initiated_at: string option [@key "lastInitiatedAt"] [@default None]; 84 + status: string; 85 + } 86 + [@@deriving yojson {strict= false}] 87 + 88 + 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 + } 99 + [@@deriving yojson {strict= false}] 100 +
+17
pegasus/lib/lexicons/app_bsky_unspecced_getAgeAssuranceState.ml
··· 1 + (* generated from app.bsky.unspecced.getAgeAssuranceState *) 2 + 3 + (** Returns the current state of the age assurance process for an account. This is used to check if the user has completed age assurance or if further action is required. *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getAgeAssuranceState" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = App_bsky_unspecced_defs.age_assurance_state 11 + [@@deriving yojson {strict= false}] 12 + 13 + let call 14 + (client : Hermes.client) : output Lwt.t = 15 + Hermes.query client nsid (`Assoc []) output_of_yojson 16 + end 17 +
+28
pegasus/lib/lexicons/app_bsky_unspecced_getConfig.ml
··· 1 + (* generated from app.bsky.unspecced.getConfig *) 2 + 3 + type live_now_config = 4 + { 5 + did: string; 6 + domains: string list; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + (** Get miscellaneous runtime configuration. *) 11 + module Main = struct 12 + let nsid = "app.bsky.unspecced.getConfig" 13 + 14 + type params = unit 15 + let params_to_yojson () = `Assoc [] 16 + 17 + 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}] 23 + 24 + let call 25 + (client : Hermes.client) : output Lwt.t = 26 + Hermes.query client nsid (`Assoc []) output_of_yojson 27 + end 28 +
+25
pegasus/lib/lexicons/app_bsky_unspecced_getOnboardingSuggestedStarterPacks.ml
··· 1 + (* generated from app.bsky.unspecced.getOnboardingSuggestedStarterPacks *) 2 + 3 + (** Get a list of suggested starterpacks for onboarding *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getOnboardingSuggestedStarterPacks" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + starter_packs: App_bsky_graph_defs.starter_pack_view list [@key "starterPacks"]; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ?limit 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {limit} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+27
pegasus/lib/lexicons/app_bsky_unspecced_getOnboardingSuggestedStarterPacksSkeleton.ml
··· 1 + (* generated from app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton *) 2 + 3 + (** Get a skeleton of suggested starterpacks for onboarding. Intended to be called and hydrated by app.bsky.unspecced.getOnboardingSuggestedStarterPacks *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton" 6 + 7 + type params = 8 + { 9 + viewer: string option [@default None]; 10 + limit: int option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + starter_packs: string list [@key "starterPacks"]; 17 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + let call 21 + ?viewer 22 + ?limit 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {viewer; limit} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+30
pegasus/lib/lexicons/app_bsky_unspecced_getPopularFeedGenerators.ml
··· 1 + (* generated from app.bsky.unspecced.getPopularFeedGenerators *) 2 + 3 + (** An unspecced view of globally popular feed generators. *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getPopularFeedGenerators" 6 + 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}] 14 + 15 + type output = 16 + { 17 + cursor: string option [@default None]; 18 + feeds: App_bsky_feed_defs.generator_view list; 19 + } 20 + [@@deriving yojson {strict= false}] 21 + 22 + let call 23 + ?limit 24 + ?cursor 25 + ?query 26 + (client : Hermes.client) : output Lwt.t = 27 + let params : params = {limit; cursor; query} in 28 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 + end 30 +
+55
pegasus/lib/lexicons/app_bsky_unspecced_getPostThreadOtherV2.ml
··· 1 + (* generated from app.bsky.unspecced.getPostThreadOtherV2 *) 2 + 3 + type value = 4 + | ThreadItemPost of App_bsky_unspecced_defs.thread_item_post 5 + | Unknown of Yojson.Safe.t 6 + 7 + let value_of_yojson json = 8 + let open Yojson.Safe.Util in 9 + try 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) 16 + with _ -> Error "failed to parse union" 17 + 18 + 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 24 + 25 + type thread_item = 26 + { 27 + uri: string; 28 + depth: int; 29 + value: value; 30 + } 31 + [@@deriving yojson {strict= false}] 32 + 33 + (** (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. *) 34 + module Main = struct 35 + let nsid = "app.bsky.unspecced.getPostThreadOtherV2" 36 + 37 + type params = 38 + { 39 + anchor: string; 40 + } 41 + [@@deriving yojson {strict= false}] 42 + 43 + type output = 44 + { 45 + thread: thread_item list; 46 + } 47 + [@@deriving yojson {strict= false}] 48 + 49 + let call 50 + ~anchor 51 + (client : Hermes.client) : output Lwt.t = 52 + let params : params = {anchor} in 53 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 54 + end 55 +
+92
pegasus/lib/lexicons/app_bsky_unspecced_getPostThreadV2.ml
··· 1 + (* generated from app.bsky.unspecced.getPostThreadV2 *) 2 + 3 + type value = 4 + | ThreadItemPost of App_bsky_unspecced_defs.thread_item_post 5 + | ThreadItemNoUnauthenticated of App_bsky_unspecced_defs.thread_item_no_unauthenticated 6 + | ThreadItemNotFound of App_bsky_unspecced_defs.thread_item_not_found 7 + | ThreadItemBlocked of App_bsky_unspecced_defs.thread_item_blocked 8 + | Unknown of Yojson.Safe.t 9 + 10 + let value_of_yojson json = 11 + let open Yojson.Safe.Util in 12 + try 13 + 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) 31 + with _ -> Error "failed to parse union" 32 + 33 + 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 51 + 52 + type thread_item = 53 + { 54 + uri: string; 55 + depth: int; 56 + value: value; 57 + } 58 + [@@deriving yojson {strict= false}] 59 + 60 + (** (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. *) 61 + module Main = struct 62 + let nsid = "app.bsky.unspecced.getPostThreadV2" 63 + 64 + 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 + sort: string option [@default None]; 71 + } 72 + [@@deriving yojson {strict= false}] 73 + 74 + type output = 75 + { 76 + thread: thread_item list; 77 + threadgate: App_bsky_feed_defs.threadgate_view option [@default None]; 78 + has_other_replies: bool [@key "hasOtherReplies"]; 79 + } 80 + [@@deriving yojson {strict= false}] 81 + 82 + let call 83 + ~anchor 84 + ?above 85 + ?below 86 + ?branching_factor 87 + ?sort 88 + (client : Hermes.client) : output Lwt.t = 89 + let params : params = {anchor; above; below; branching_factor; sort} in 90 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 91 + end 92 +
+25
pegasus/lib/lexicons/app_bsky_unspecced_getSuggestedFeeds.ml
··· 1 + (* generated from app.bsky.unspecced.getSuggestedFeeds *) 2 + 3 + (** Get a list of suggested feeds *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getSuggestedFeeds" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + feeds: App_bsky_feed_defs.generator_view list; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ?limit 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {limit} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+27
pegasus/lib/lexicons/app_bsky_unspecced_getSuggestedFeedsSkeleton.ml
··· 1 + (* generated from app.bsky.unspecced.getSuggestedFeedsSkeleton *) 2 + 3 + (** Get a skeleton of suggested feeds. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedFeeds *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getSuggestedFeedsSkeleton" 6 + 7 + type params = 8 + { 9 + viewer: string option [@default None]; 10 + limit: int option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + feeds: string list; 17 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + let call 21 + ?viewer 22 + ?limit 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {viewer; limit} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+25
pegasus/lib/lexicons/app_bsky_unspecced_getSuggestedStarterPacks.ml
··· 1 + (* generated from app.bsky.unspecced.getSuggestedStarterPacks *) 2 + 3 + (** Get a list of suggested starterpacks *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getSuggestedStarterPacks" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + starter_packs: App_bsky_graph_defs.starter_pack_view list [@key "starterPacks"]; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ?limit 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {limit} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+27
pegasus/lib/lexicons/app_bsky_unspecced_getSuggestedStarterPacksSkeleton.ml
··· 1 + (* generated from app.bsky.unspecced.getSuggestedStarterPacksSkeleton *) 2 + 3 + (** Get a skeleton of suggested starterpacks. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedStarterpacks *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getSuggestedStarterPacksSkeleton" 6 + 7 + type params = 8 + { 9 + viewer: string option [@default None]; 10 + limit: int option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + starter_packs: string list [@key "starterPacks"]; 17 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + let call 21 + ?viewer 22 + ?limit 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {viewer; limit} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+27
pegasus/lib/lexicons/app_bsky_unspecced_getSuggestedUsers.ml
··· 1 + (* generated from app.bsky.unspecced.getSuggestedUsers *) 2 + 3 + (** Get a list of suggested users *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getSuggestedUsers" 6 + 7 + type params = 8 + { 9 + category: string option [@default None]; 10 + limit: int option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + actors: App_bsky_actor_defs.profile_view list; 17 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + let call 21 + ?category 22 + ?limit 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {category; limit} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+29
pegasus/lib/lexicons/app_bsky_unspecced_getSuggestedUsersSkeleton.ml
··· 1 + (* generated from app.bsky.unspecced.getSuggestedUsersSkeleton *) 2 + 3 + (** Get a skeleton of suggested users. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsers *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getSuggestedUsersSkeleton" 6 + 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}] 14 + 15 + type output = 16 + { 17 + dids: string list; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ?viewer 23 + ?category 24 + ?limit 25 + (client : Hermes.client) : output Lwt.t = 26 + let params : params = {viewer; category; limit} in 27 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 28 + end 29 +
+34
pegasus/lib/lexicons/app_bsky_unspecced_getSuggestionsSkeleton.ml
··· 1 + (* generated from app.bsky.unspecced.getSuggestionsSkeleton *) 2 + 3 + (** Get a skeleton of suggested actors. Intended to be called and then hydrated through app.bsky.actor.getSuggestions *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getSuggestionsSkeleton" 6 + 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}] 15 + 16 + 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}] 24 + 25 + let call 26 + ?viewer 27 + ?limit 28 + ?cursor 29 + ?relative_to_did 30 + (client : Hermes.client) : output Lwt.t = 31 + let params : params = {viewer; limit; cursor; relative_to_did} in 32 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 33 + end 34 +
+28
pegasus/lib/lexicons/app_bsky_unspecced_getTaggedSuggestions.ml
··· 1 + (* generated from app.bsky.unspecced.getTaggedSuggestions *) 2 + 3 + type suggestion = 4 + { 5 + tag: string; 6 + subject_type: string [@key "subjectType"]; 7 + subject: string; 8 + } 9 + [@@deriving yojson {strict= false}] 10 + 11 + (** Get a list of suggestions (feeds and users) tagged with categories *) 12 + module Main = struct 13 + let nsid = "app.bsky.unspecced.getTaggedSuggestions" 14 + 15 + type params = unit 16 + let params_to_yojson () = `Assoc [] 17 + 18 + type output = 19 + { 20 + suggestions: suggestion list; 21 + } 22 + [@@deriving yojson {strict= false}] 23 + 24 + let call 25 + (client : Hermes.client) : output Lwt.t = 26 + Hermes.query client nsid (`Assoc []) output_of_yojson 27 + end 28 +
+28
pegasus/lib/lexicons/app_bsky_unspecced_getTrendingTopics.ml
··· 1 + (* generated from app.bsky.unspecced.getTrendingTopics *) 2 + 3 + (** Get a list of trending topics *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getTrendingTopics" 6 + 7 + type params = 8 + { 9 + viewer: string option [@default None]; 10 + limit: int option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + 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}] 20 + 21 + let call 22 + ?viewer 23 + ?limit 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {viewer; limit} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+25
pegasus/lib/lexicons/app_bsky_unspecced_getTrends.ml
··· 1 + (* generated from app.bsky.unspecced.getTrends *) 2 + 3 + (** Get the current trends on the network *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getTrends" 6 + 7 + type params = 8 + { 9 + limit: int option [@default None]; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + trends: App_bsky_unspecced_defs.trend_view list; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ?limit 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {limit} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+27
pegasus/lib/lexicons/app_bsky_unspecced_getTrendsSkeleton.ml
··· 1 + (* generated from app.bsky.unspecced.getTrendsSkeleton *) 2 + 3 + (** Get the skeleton of trends on the network. Intended to be called and then hydrated through app.bsky.unspecced.getTrends *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.getTrendsSkeleton" 6 + 7 + type params = 8 + { 9 + viewer: string option [@default None]; 10 + limit: int option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + trends: App_bsky_unspecced_defs.skeleton_trend list; 17 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + let call 21 + ?viewer 22 + ?limit 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {viewer; limit} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+30
pegasus/lib/lexicons/app_bsky_unspecced_initAgeAssurance.ml
··· 1 + (* generated from app.bsky.unspecced.initAgeAssurance *) 2 + 3 + (** Initiate age assurance for an account. This is a one-time action that will start the process of verifying the user's age. *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.initAgeAssurance" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + email: string; 13 + language: string; 14 + country_code: string [@key "countryCode"]; 15 + } 16 + [@@deriving yojson {strict= false}] 17 + 18 + type output = App_bsky_unspecced_defs.age_assurance_state 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ~email 23 + ~language 24 + ~country_code 25 + (client : Hermes.client) : output Lwt.t = 26 + let params = () in 27 + let input = Some ({email; language; country_code} |> input_to_yojson) in 28 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 29 + end 30 +
+35
pegasus/lib/lexicons/app_bsky_unspecced_searchActorsSkeleton.ml
··· 1 + (* generated from app.bsky.unspecced.searchActorsSkeleton *) 2 + 3 + (** Backend Actors (profile) search, returns only skeleton. *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.searchActorsSkeleton" 6 + 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}] 16 + 17 + 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}] 24 + 25 + let call 26 + ~q 27 + ?viewer 28 + ?typeahead 29 + ?limit 30 + ?cursor 31 + (client : Hermes.client) : output Lwt.t = 32 + let params : params = {q; viewer; typeahead; limit; cursor} in 33 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 34 + end 35 +
+51
pegasus/lib/lexicons/app_bsky_unspecced_searchPostsSkeleton.ml
··· 1 + (* generated from app.bsky.unspecced.searchPostsSkeleton *) 2 + 3 + (** Backend Posts search, returns only skeleton *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.searchPostsSkeleton" 6 + 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]; 19 + viewer: string option [@default None]; 20 + limit: int option [@default None]; 21 + cursor: string option [@default None]; 22 + } 23 + [@@deriving yojson {strict= false}] 24 + 25 + 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}] 32 + 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 49 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 50 + end 51 +
+33
pegasus/lib/lexicons/app_bsky_unspecced_searchStarterPacksSkeleton.ml
··· 1 + (* generated from app.bsky.unspecced.searchStarterPacksSkeleton *) 2 + 3 + (** Backend Starter Pack search, returns only skeleton. *) 4 + module Main = struct 5 + let nsid = "app.bsky.unspecced.searchStarterPacksSkeleton" 6 + 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}] 15 + 16 + 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}] 23 + 24 + let call 25 + ~q 26 + ?viewer 27 + ?limit 28 + ?cursor 29 + (client : Hermes.client) : output Lwt.t = 30 + let params : params = {q; viewer; limit; cursor} in 31 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 32 + end 33 +
+14
pegasus/lib/lexicons/app_bsky_video_defs.ml
··· 1 + (* generated from app.bsky.video.defs *) 2 + 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 + } 13 + [@@deriving yojson {strict= false}] 14 +
+25
pegasus/lib/lexicons/app_bsky_video_getJobStatus.ml
··· 1 + (* generated from app.bsky.video.getJobStatus *) 2 + 3 + (** Get status details for a video processing job. *) 4 + module Main = struct 5 + let nsid = "app.bsky.video.getJobStatus" 6 + 7 + type params = 8 + { 9 + job_id: string [@key "jobId"]; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + job_status: App_bsky_video_defs.job_status [@key "jobStatus"]; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~job_id 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {job_id} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+24
pegasus/lib/lexicons/app_bsky_video_getUploadLimits.ml
··· 1 + (* generated from app.bsky.video.getUploadLimits *) 2 + 3 + (** Get video upload limits for the authenticated user. *) 4 + module Main = struct 5 + let nsid = "app.bsky.video.getUploadLimits" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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}] 19 + 20 + let call 21 + (client : Hermes.client) : output Lwt.t = 22 + Hermes.query client nsid (`Assoc []) output_of_yojson 23 + end 24 +
+22
pegasus/lib/lexicons/app_bsky_video_uploadVideo.ml
··· 1 + (* generated from app.bsky.video.uploadVideo *) 2 + 3 + (** Upload a video to be processed then stored on the PDS. *) 4 + module Main = struct 5 + let nsid = "app.bsky.video.uploadVideo" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = 11 + { 12 + job_status: App_bsky_video_defs.job_status [@key "jobStatus"]; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + let call 17 + ?input 18 + (client : Hermes.client) : output Lwt.t = 19 + 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 21 + end 22 +
+47
pegasus/lib/lexicons/com_atproto_admin_defs.ml
··· 1 + (* generated from com.atproto.admin.defs *) 2 + 3 + type status_attr = 4 + { 5 + applied: bool; 6 + ref: string option [@default None]; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + type threat_signature = 11 + { 12 + property: string; 13 + value: string; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + 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 + } 32 + [@@deriving yojson {strict= false}] 33 + 34 + type repo_ref = 35 + { 36 + did: string; 37 + } 38 + [@@deriving yojson {strict= false}] 39 + 40 + type repo_blob_ref = 41 + { 42 + did: string; 43 + cid: string; 44 + record_uri: string option [@key "recordUri"] [@default None]; 45 + } 46 + [@@deriving yojson {strict= false}] 47 +
+26
pegasus/lib/lexicons/com_atproto_admin_deleteAccount.ml
··· 1 + (* generated from com.atproto.admin.deleteAccount *) 2 + 3 + (** Delete a user account as an administrator. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.deleteAccount" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + did: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~did 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({did} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+28
pegasus/lib/lexicons/com_atproto_admin_disableAccountInvites.ml
··· 1 + (* generated from com.atproto.admin.disableAccountInvites *) 2 + 3 + (** Disable an account from receiving new invite codes, but does not invalidate existing codes. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.disableAccountInvites" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + account: string; 13 + note: string option [@default None]; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + 20 + let call 21 + ~account 22 + ?note 23 + (client : Hermes.client) : output Lwt.t = 24 + let params = () in 25 + let input = Some ({account; note} |> input_to_yojson) in 26 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 27 + end 28 +
+28
pegasus/lib/lexicons/com_atproto_admin_disableInviteCodes.ml
··· 1 + (* generated from com.atproto.admin.disableInviteCodes *) 2 + 3 + (** Disable some set of codes and/or all codes associated with a set of users. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.disableInviteCodes" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + codes: string list option [@default None]; 13 + accounts: string list option [@default None]; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + 20 + let call 21 + ?codes 22 + ?accounts 23 + (client : Hermes.client) : output Lwt.t = 24 + let params = () in 25 + let input = Some ({codes; accounts} |> input_to_yojson) in 26 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 27 + end 28 +
+28
pegasus/lib/lexicons/com_atproto_admin_enableAccountInvites.ml
··· 1 + (* generated from com.atproto.admin.enableAccountInvites *) 2 + 3 + (** Re-enable an account's ability to receive invite codes. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.enableAccountInvites" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + account: string; 13 + note: string option [@default None]; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + 20 + let call 21 + ~account 22 + ?note 23 + (client : Hermes.client) : output Lwt.t = 24 + let params = () in 25 + let input = Some ({account; note} |> input_to_yojson) in 26 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 27 + end 28 +
+22
pegasus/lib/lexicons/com_atproto_admin_getAccountInfo.ml
··· 1 + (* generated from com.atproto.admin.getAccountInfo *) 2 + 3 + (** Get details about an account. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.getAccountInfo" 6 + 7 + type params = 8 + { 9 + did: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = Com_atproto_admin_defs.account_view 14 + [@@deriving yojson {strict= false}] 15 + 16 + let call 17 + ~did 18 + (client : Hermes.client) : output Lwt.t = 19 + let params : params = {did} in 20 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 21 + end 22 +
+25
pegasus/lib/lexicons/com_atproto_admin_getAccountInfos.ml
··· 1 + (* generated from com.atproto.admin.getAccountInfos *) 2 + 3 + (** Get details about some accounts. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.getAccountInfos" 6 + 7 + type params = 8 + { 9 + dids: string list; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + infos: Com_atproto_admin_defs.account_view list; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~dids 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {dids} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+30
pegasus/lib/lexicons/com_atproto_admin_getInviteCodes.ml
··· 1 + (* generated from com.atproto.admin.getInviteCodes *) 2 + 3 + (** Get an admin view of invite codes. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.getInviteCodes" 6 + 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}] 14 + 15 + type output = 16 + { 17 + cursor: string option [@default None]; 18 + codes: Com_atproto_server_defs.invite_code list; 19 + } 20 + [@@deriving yojson {strict= false}] 21 + 22 + let call 23 + ?sort 24 + ?limit 25 + ?cursor 26 + (client : Hermes.client) : output Lwt.t = 27 + let params : params = {sort; limit; cursor} in 28 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 + end 30 +
+71
pegasus/lib/lexicons/com_atproto_admin_getSubjectStatus.ml
··· 1 + (* generated from com.atproto.admin.getSubjectStatus *) 2 + 3 + (** Get the service-specific admin status of a subject (account, record, or blob). *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.getSubjectStatus" 6 + 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}] 14 + 15 + 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 20 + 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" 39 + 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 54 + 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}] 62 + 63 + let call 64 + ?did 65 + ?uri 66 + ?blob 67 + (client : Hermes.client) : output Lwt.t = 68 + let params : params = {did; uri; blob} in 69 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 70 + end 71 +
+30
pegasus/lib/lexicons/com_atproto_admin_searchAccounts.ml
··· 1 + (* generated from com.atproto.admin.searchAccounts *) 2 + 3 + (** Get list of accounts that matches your search query. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.searchAccounts" 6 + 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}] 14 + 15 + type output = 16 + { 17 + cursor: string option [@default None]; 18 + accounts: Com_atproto_admin_defs.account_view list; 19 + } 20 + [@@deriving yojson {strict= false}] 21 + 22 + let call 23 + ?email 24 + ?cursor 25 + ?limit 26 + (client : Hermes.client) : output Lwt.t = 27 + let params : params = {email; cursor; limit} in 28 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 29 + end 30 +
+37
pegasus/lib/lexicons/com_atproto_admin_sendEmail.ml
··· 1 + (* generated from com.atproto.admin.sendEmail *) 2 + 3 + (** Send email to a user's account email address. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.sendEmail" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + type output = 21 + { 22 + sent: bool; 23 + } 24 + [@@deriving yojson {strict= false}] 25 + 26 + let call 27 + ~recipient_did 28 + ~content 29 + ?subject 30 + ~sender_did 31 + ?comment 32 + (client : Hermes.client) : output Lwt.t = 33 + 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 36 + end 37 +
+28
pegasus/lib/lexicons/com_atproto_admin_updateAccountEmail.ml
··· 1 + (* generated from com.atproto.admin.updateAccountEmail *) 2 + 3 + (** Administrative action to update an account's email. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.updateAccountEmail" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + account: string; 13 + email: string; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + 20 + let call 21 + ~account 22 + ~email 23 + (client : Hermes.client) : output Lwt.t = 24 + let params = () in 25 + let input = Some ({account; email} |> input_to_yojson) in 26 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 27 + end 28 +
+28
pegasus/lib/lexicons/com_atproto_admin_updateAccountHandle.ml
··· 1 + (* generated from com.atproto.admin.updateAccountHandle *) 2 + 3 + (** Administrative action to update an account's handle. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.updateAccountHandle" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + did: string; 13 + handle: string; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + 20 + let call 21 + ~did 22 + ~handle 23 + (client : Hermes.client) : output Lwt.t = 24 + let params = () in 25 + let input = Some ({did; handle} |> input_to_yojson) in 26 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 27 + end 28 +
+28
pegasus/lib/lexicons/com_atproto_admin_updateAccountPassword.ml
··· 1 + (* generated from com.atproto.admin.updateAccountPassword *) 2 + 3 + (** Update the password for a user account as an administrator. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.updateAccountPassword" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + did: string; 13 + password: string; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + 20 + let call 21 + ~did 22 + ~password 23 + (client : Hermes.client) : output Lwt.t = 24 + let params = () in 25 + let input = Some ({did; password} |> input_to_yojson) in 26 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 27 + end 28 +
+28
pegasus/lib/lexicons/com_atproto_admin_updateAccountSigningKey.ml
··· 1 + (* generated from com.atproto.admin.updateAccountSigningKey *) 2 + 3 + (** Administrative action to update an account's signing key in their Did document. *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.updateAccountSigningKey" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + did: string; 13 + signing_key: string [@key "signingKey"]; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + 20 + let call 21 + ~did 22 + ~signing_key 23 + (client : Hermes.client) : output Lwt.t = 24 + let params = () in 25 + let input = Some ({did; signing_key} |> input_to_yojson) in 26 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 27 + end 28 +
+74
pegasus/lib/lexicons/com_atproto_admin_updateSubjectStatus.ml
··· 1 + (* generated from com.atproto.admin.updateSubjectStatus *) 2 + 3 + (** Update the service-specific admin status of a subject (account, record, or blob). *) 4 + module Main = struct 5 + let nsid = "com.atproto.admin.updateSubjectStatus" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 15 + 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" 34 + 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 49 + 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 + } 56 + [@@deriving yojson {strict= false}] 57 + 58 + type output = 59 + { 60 + subject: subject; 61 + takedown: Com_atproto_admin_defs.status_attr option [@default None]; 62 + } 63 + [@@deriving yojson {strict= false}] 64 + 65 + let call 66 + ~subject 67 + ?takedown 68 + ?deactivated 69 + (client : Hermes.client) : output Lwt.t = 70 + let params = () in 71 + let input = Some ({subject; takedown; deactivated} |> input_to_yojson) in 72 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 73 + end 74 +
+10
pegasus/lib/lexicons/com_atproto_identity_defs.ml
··· 1 + (* generated from com.atproto.identity.defs *) 2 + 3 + type identity_info = 4 + { 5 + did: string; 6 + handle: string; 7 + did_doc: Yojson.Safe.t [@key "didDoc"]; 8 + } 9 + [@@deriving yojson {strict= false}] 10 +
+23
pegasus/lib/lexicons/com_atproto_identity_getRecommendedDidCredentials.ml
··· 1 + (* generated from com.atproto.identity.getRecommendedDidCredentials *) 2 + 3 + (** Describe the credentials that should be included in the DID doc of an account that is migrating to this service. *) 4 + module Main = struct 5 + let nsid = "com.atproto.identity.getRecommendedDidCredentials" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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}] 18 + 19 + let call 20 + (client : Hermes.client) : output Lwt.t = 21 + Hermes.query client nsid (`Assoc []) output_of_yojson 22 + end 23 +
+26
pegasus/lib/lexicons/com_atproto_identity_refreshIdentity.ml
··· 1 + (* generated from com.atproto.identity.refreshIdentity *) 2 + 3 + (** Request that the server re-resolve an identity (DID and handle). The server may ignore this request, or require authentication, depending on the role, implementation, and policy of the server. *) 4 + module Main = struct 5 + let nsid = "com.atproto.identity.refreshIdentity" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + identifier: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = Com_atproto_identity_defs.identity_info 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~identifier 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({identifier} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+19
pegasus/lib/lexicons/com_atproto_identity_requestPlcOperationSignature.ml
··· 1 + (* generated from com.atproto.identity.requestPlcOperationSignature *) 2 + 3 + (** Request an email with a code to in order to request a signed PLC operation. Requires Auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.identity.requestPlcOperationSignature" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = unit 11 + let output_of_yojson _ = Ok () 12 + 13 + let call 14 + (client : Hermes.client) : output Lwt.t = 15 + let params = () in 16 + let input = None in 17 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 18 + end 19 +
+25
pegasus/lib/lexicons/com_atproto_identity_resolveDid.ml
··· 1 + (* generated from com.atproto.identity.resolveDid *) 2 + 3 + (** Resolves DID to DID document. Does not bi-directionally verify handle. *) 4 + module Main = struct 5 + let nsid = "com.atproto.identity.resolveDid" 6 + 7 + type params = 8 + { 9 + did: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + did_doc: Yojson.Safe.t [@key "didDoc"]; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~did 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {did} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+25
pegasus/lib/lexicons/com_atproto_identity_resolveHandle.ml
··· 1 + (* generated from com.atproto.identity.resolveHandle *) 2 + 3 + (** Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the the DID document. *) 4 + module Main = struct 5 + let nsid = "com.atproto.identity.resolveHandle" 6 + 7 + type params = 8 + { 9 + handle: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + did: string; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~handle 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {handle} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+22
pegasus/lib/lexicons/com_atproto_identity_resolveIdentity.ml
··· 1 + (* generated from com.atproto.identity.resolveIdentity *) 2 + 3 + (** Resolves an identity (DID or Handle) to a full identity (DID document and verified handle). *) 4 + module Main = struct 5 + let nsid = "com.atproto.identity.resolveIdentity" 6 + 7 + type params = 8 + { 9 + identifier: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = Com_atproto_identity_defs.identity_info 14 + [@@deriving yojson {strict= false}] 15 + 16 + let call 17 + ~identifier 18 + (client : Hermes.client) : output Lwt.t = 19 + let params : params = {identifier} in 20 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 21 + end 22 +
+37
pegasus/lib/lexicons/com_atproto_identity_signPlcOperation.ml
··· 1 + (* generated from com.atproto.identity.signPlcOperation *) 2 + 3 + (** Signs a PLC operation to update some value(s) in the requesting DID's document. *) 4 + module Main = struct 5 + let nsid = "com.atproto.identity.signPlcOperation" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + type output = 21 + { 22 + operation: Yojson.Safe.t; 23 + } 24 + [@@deriving yojson {strict= false}] 25 + 26 + let call 27 + ?token 28 + ?rotation_keys 29 + ?also_known_as 30 + ?verification_methods 31 + ?services 32 + (client : Hermes.client) : output Lwt.t = 33 + 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 36 + end 37 +
+26
pegasus/lib/lexicons/com_atproto_identity_submitPlcOperation.ml
··· 1 + (* generated from com.atproto.identity.submitPlcOperation *) 2 + 3 + (** Validates a PLC operation to ensure that it doesn't violate a service's constraints or get the identity into a bad state, then submits it to the PLC registry *) 4 + module Main = struct 5 + let nsid = "com.atproto.identity.submitPlcOperation" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + operation: Yojson.Safe.t; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~operation 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({operation} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+26
pegasus/lib/lexicons/com_atproto_identity_updateHandle.ml
··· 1 + (* generated from com.atproto.identity.updateHandle *) 2 + 3 + (** Updates the current account's handle. Verifies handle validity, and updates did:plc document if necessary. Implemented by PDS, and requires auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.identity.updateHandle" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + handle: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~handle 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({handle} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+54
pegasus/lib/lexicons/com_atproto_label_defs.ml
··· 1 + (* generated from com.atproto.label.defs *) 2 + 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 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type self_label = 18 + { 19 + val_: string [@key "val"]; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + type self_labels = 24 + { 25 + values: self_label list; 26 + } 27 + [@@deriving yojson {strict= false}] 28 + 29 + type label_value_definition_strings = 30 + { 31 + lang: string; 32 + name: string; 33 + description: string; 34 + } 35 + [@@deriving yojson {strict= false}] 36 + 37 + 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 + } 46 + [@@deriving yojson {strict= false}] 47 + 48 + (** String type with known values *) 49 + type label_value = string 50 + let label_value_of_yojson = function 51 + | `String s -> Ok s 52 + | _ -> Error "label_value: expected string" 53 + let label_value_to_yojson s = `String s 54 +
+32
pegasus/lib/lexicons/com_atproto_label_queryLabels.ml
··· 1 + (* generated from com.atproto.label.queryLabels *) 2 + 3 + (** Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.label.queryLabels" 6 + 7 + type params = 8 + { 9 + uri_patterns: string list [@key "uriPatterns"]; 10 + sources: string list option [@default None]; 11 + limit: int option [@default None]; 12 + cursor: string option [@default None]; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = 17 + { 18 + cursor: string option [@default None]; 19 + labels: Com_atproto_label_defs.label list; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + let call 24 + ~uri_patterns 25 + ?sources 26 + ?limit 27 + ?cursor 28 + (client : Hermes.client) : output Lwt.t = 29 + let params : params = {uri_patterns; sources; limit; cursor} in 30 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 31 + end 32 +
+27
pegasus/lib/lexicons/com_atproto_lexicon_resolveLexicon.ml
··· 1 + (* generated from com.atproto.lexicon.resolveLexicon *) 2 + 3 + (** Resolves an atproto lexicon (NSID) to a schema. *) 4 + module Main = struct 5 + let nsid = "com.atproto.lexicon.resolveLexicon" 6 + 7 + type params = 8 + { 9 + nsid: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + cid: string; 16 + schema: Com_atproto_lexicon_schema.main; 17 + uri: string; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ~nsid 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {nsid} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+8
pegasus/lib/lexicons/com_atproto_lexicon_schema.ml
··· 1 + (* generated from com.atproto.lexicon.schema *) 2 + 3 + type main = 4 + { 5 + lexicon: int; 6 + } 7 + [@@deriving yojson {strict= false}] 8 +
+78
pegasus/lib/lexicons/com_atproto_moderation_createReport.ml
··· 1 + (* generated from com.atproto.moderation.createReport *) 2 + 3 + type mod_tool = 4 + { 5 + name: string; 6 + meta: Yojson.Safe.t option [@default None]; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + (** Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth. *) 11 + module Main = struct 12 + let nsid = "com.atproto.moderation.createReport" 13 + 14 + type params = unit 15 + let params_to_yojson () = `Assoc [] 16 + 17 + 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 21 + 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" 36 + 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 47 + 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 + [@@deriving yojson {strict= false}] 56 + 57 + 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}] 67 + 68 + let call 69 + ~reason_type 70 + ?reason 71 + ~subject 72 + ?mod_tool 73 + (client : Hermes.client) : output Lwt.t = 74 + 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 77 + end 78 +
+37
pegasus/lib/lexicons/com_atproto_moderation_defs.ml
··· 1 + (* generated from com.atproto.moderation.defs *) 2 + 3 + (** String type with known values *) 4 + type reason_type = string 5 + let reason_type_of_yojson = function 6 + | `String s -> Ok s 7 + | _ -> Error "reason_type: expected string" 8 + let reason_type_to_yojson s = `String s 9 + 10 + (** Spam: frequent unwanted promotion, replies, mentions. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingSpam`. *) 11 + let reason_spam = "com.atproto.moderation.defs#reasonSpam" 12 + 13 + (** Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`. *) 14 + let reason_violation = "com.atproto.moderation.defs#reasonViolation" 15 + 16 + (** Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`. *) 17 + let reason_misleading = "com.atproto.moderation.defs#reasonMisleading" 18 + 19 + (** Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`. *) 20 + let reason_sexual = "com.atproto.moderation.defs#reasonSexual" 21 + 22 + (** Rude, harassing, explicit, or otherwise unwelcoming behavior. Prefer new lexicon definition `tools.ozone.report.defs#reasonHarassmentOther`. *) 23 + let reason_rude = "com.atproto.moderation.defs#reasonRude" 24 + 25 + (** Reports not falling under another report category. Prefer new lexicon definition `tools.ozone.report.defs#reasonOther`. *) 26 + let reason_other = "com.atproto.moderation.defs#reasonOther" 27 + 28 + (** Appeal a previously taken moderation action *) 29 + let reason_appeal = "com.atproto.moderation.defs#reasonAppeal" 30 + 31 + (** String type with known values: Tag describing a type of subject that might be reported. *) 32 + type subject_type = string 33 + 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 37 +
+155
pegasus/lib/lexicons/com_atproto_repo_applyWrites.ml
··· 1 + (* generated from com.atproto.repo.applyWrites *) 2 + 3 + type delete_result = unit 4 + let delete_result_of_yojson _ = Ok () 5 + let delete_result_to_yojson () = `Assoc [] 6 + 7 + type update_result = 8 + { 9 + uri: string; 10 + cid: string; 11 + validation_status: string option [@key "validationStatus"] [@default None]; 12 + } 13 + [@@deriving yojson {strict= false}] 14 + 15 + type create_result = 16 + { 17 + uri: string; 18 + cid: string; 19 + validation_status: string option [@key "validationStatus"] [@default None]; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + type delete = 24 + { 25 + collection: string; 26 + rkey: string; 27 + } 28 + [@@deriving yojson {strict= false}] 29 + 30 + type update = 31 + { 32 + collection: string; 33 + rkey: string; 34 + value: Yojson.Safe.t; 35 + } 36 + [@@deriving yojson {strict= false}] 37 + 38 + type create = 39 + { 40 + collection: string; 41 + rkey: string option [@default None]; 42 + value: Yojson.Safe.t; 43 + } 44 + [@@deriving yojson {strict= false}] 45 + 46 + (** Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS. *) 47 + module Main = struct 48 + let nsid = "com.atproto.repo.applyWrites" 49 + 50 + type params = unit 51 + let params_to_yojson () = `Assoc [] 52 + 53 + type writes_item = 54 + | Create of create 55 + | Update of update 56 + | Delete of delete 57 + 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" 76 + 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) 90 + 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 + } 98 + [@@deriving yojson {strict= false}] 99 + 100 + type results_item = 101 + | CreateResult of create_result 102 + | UpdateResult of update_result 103 + | DeleteResult of delete_result 104 + 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" 123 + 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) 137 + 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}] 144 + 145 + let call 146 + ~repo 147 + ?validate 148 + ~writes 149 + ?swap_commit 150 + (client : Hermes.client) : output Lwt.t = 151 + 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 154 + end 155 +
+42
pegasus/lib/lexicons/com_atproto_repo_createRecord.ml
··· 1 + (* generated from com.atproto.repo.createRecord *) 2 + 3 + (** Create a single new repository record. Requires auth, implemented by PDS. *) 4 + module Main = struct 5 + let nsid = "com.atproto.repo.createRecord" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + 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}] 29 + 30 + let call 31 + ~repo 32 + ~collection 33 + ?rkey 34 + ?validate 35 + ~record 36 + ?swap_commit 37 + (client : Hermes.client) : output Lwt.t = 38 + 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 41 + end 42 +
+9
pegasus/lib/lexicons/com_atproto_repo_defs.ml
··· 1 + (* generated from com.atproto.repo.defs *) 2 + 3 + type commit_meta = 4 + { 5 + cid: string; 6 + rev: string; 7 + } 8 + [@@deriving yojson {strict= false}] 9 +
+37
pegasus/lib/lexicons/com_atproto_repo_deleteRecord.ml
··· 1 + (* generated from com.atproto.repo.deleteRecord *) 2 + 3 + (** Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS. *) 4 + module Main = struct 5 + let nsid = "com.atproto.repo.deleteRecord" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + type output = 21 + { 22 + commit: Com_atproto_repo_defs.commit_meta option [@default None]; 23 + } 24 + [@@deriving yojson {strict= false}] 25 + 26 + let call 27 + ~repo 28 + ~collection 29 + ~rkey 30 + ?swap_record 31 + ?swap_commit 32 + (client : Hermes.client) : output Lwt.t = 33 + 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 36 + end 37 +
+29
pegasus/lib/lexicons/com_atproto_repo_describeRepo.ml
··· 1 + (* generated from com.atproto.repo.describeRepo *) 2 + 3 + (** Get information about an account and repository, including the list of collections. Does not require auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.repo.describeRepo" 6 + 7 + type params = 8 + { 9 + repo: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + 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}] 22 + 23 + let call 24 + ~repo 25 + (client : Hermes.client) : output Lwt.t = 26 + let params : params = {repo} in 27 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 28 + end 29 +
+33
pegasus/lib/lexicons/com_atproto_repo_getRecord.ml
··· 1 + (* generated from com.atproto.repo.getRecord *) 2 + 3 + (** Get a single record from a repository. Does not require auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.repo.getRecord" 6 + 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}] 15 + 16 + type output = 17 + { 18 + uri: string; 19 + cid: string option [@default None]; 20 + value: Yojson.Safe.t; 21 + } 22 + [@@deriving yojson {strict= false}] 23 + 24 + let call 25 + ~repo 26 + ~collection 27 + ~rkey 28 + ?cid 29 + (client : Hermes.client) : output Lwt.t = 30 + let params : params = {repo; collection; rkey; cid} in 31 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 32 + end 33 +
+21
pegasus/lib/lexicons/com_atproto_repo_importRepo.ml
··· 1 + (* generated from com.atproto.repo.importRepo *) 2 + 3 + (** Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set. *) 4 + module Main = struct 5 + let nsid = "com.atproto.repo.importRepo" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = unit 11 + let output_of_yojson _ = Ok () 12 + 13 + let call 14 + ?input 15 + (client : Hermes.client) : output Lwt.t = 16 + let params = () in 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 19 + Lwt.return () 20 + end 21 +
+35
pegasus/lib/lexicons/com_atproto_repo_listMissingBlobs.ml
··· 1 + (* generated from com.atproto.repo.listMissingBlobs *) 2 + 3 + type record_blob = 4 + { 5 + cid: string; 6 + record_uri: string [@key "recordUri"]; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + (** Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow. *) 11 + module Main = struct 12 + let nsid = "com.atproto.repo.listMissingBlobs" 13 + 14 + type params = 15 + { 16 + limit: int option [@default None]; 17 + cursor: string option [@default None]; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + type output = 22 + { 23 + cursor: string option [@default None]; 24 + blobs: record_blob list; 25 + } 26 + [@@deriving yojson {strict= false}] 27 + 28 + let call 29 + ?limit 30 + ?cursor 31 + (client : Hermes.client) : output Lwt.t = 32 + let params : params = {limit; cursor} in 33 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 34 + end 35 +
+42
pegasus/lib/lexicons/com_atproto_repo_listRecords.ml
··· 1 + (* generated from com.atproto.repo.listRecords *) 2 + 3 + type record = 4 + { 5 + uri: string; 6 + cid: string; 7 + value: Yojson.Safe.t; 8 + } 9 + [@@deriving yojson {strict= false}] 10 + 11 + (** List a range of records in a repository, matching a specific collection. Does not require auth. *) 12 + module Main = struct 13 + let nsid = "com.atproto.repo.listRecords" 14 + 15 + 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}] 24 + 25 + type output = 26 + { 27 + cursor: string option [@default None]; 28 + records: record list; 29 + } 30 + [@@deriving yojson {strict= false}] 31 + 32 + let call 33 + ~repo 34 + ~collection 35 + ?limit 36 + ?cursor 37 + ?reverse 38 + (client : Hermes.client) : output Lwt.t = 39 + let params : params = {repo; collection; limit; cursor; reverse} in 40 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 41 + end 42 +
+44
pegasus/lib/lexicons/com_atproto_repo_putRecord.ml
··· 1 + (* generated from com.atproto.repo.putRecord *) 2 + 3 + (** Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS. *) 4 + module Main = struct 5 + let nsid = "com.atproto.repo.putRecord" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 + } 20 + [@@deriving yojson {strict= false}] 21 + 22 + 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}] 30 + 31 + let call 32 + ~repo 33 + ~collection 34 + ~rkey 35 + ?validate 36 + ~record 37 + ?swap_record 38 + ?swap_commit 39 + (client : Hermes.client) : output Lwt.t = 40 + 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 43 + end 44 +
+9
pegasus/lib/lexicons/com_atproto_repo_strongRef.ml
··· 1 + (* generated from com.atproto.repo.strongRef *) 2 + 3 + type main = 4 + { 5 + uri: string; 6 + cid: string; 7 + } 8 + [@@deriving yojson {strict= false}] 9 +
+22
pegasus/lib/lexicons/com_atproto_repo_uploadBlob.ml
··· 1 + (* generated from com.atproto.repo.uploadBlob *) 2 + 3 + (** Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS. *) 4 + module Main = struct 5 + let nsid = "com.atproto.repo.uploadBlob" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = 11 + { 12 + blob: Hermes.blob; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + let call 17 + ?input 18 + (client : Hermes.client) : output Lwt.t = 19 + 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 21 + end 22 +
+19
pegasus/lib/lexicons/com_atproto_server_activateAccount.ml
··· 1 + (* generated from com.atproto.server.activateAccount *) 2 + 3 + (** Activates a currently deactivated account. Used to finalize account migration after the account's repo is imported and identity is setup. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.activateAccount" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = unit 11 + let output_of_yojson _ = Ok () 12 + 13 + let call 14 + (client : Hermes.client) : output Lwt.t = 15 + let params = () in 16 + let input = None in 17 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 18 + end 19 +
+28
pegasus/lib/lexicons/com_atproto_server_checkAccountStatus.ml
··· 1 + (* generated from com.atproto.server.checkAccountStatus *) 2 + 3 + (** Returns the status of an account, especially as pertaining to import or recovery. Can be called many times over the course of an account migration. Requires auth and can only be called pertaining to oneself. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.checkAccountStatus" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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}] 23 + 24 + let call 25 + (client : Hermes.client) : output Lwt.t = 26 + Hermes.query client nsid (`Assoc []) output_of_yojson 27 + end 28 +
+28
pegasus/lib/lexicons/com_atproto_server_confirmEmail.ml
··· 1 + (* generated from com.atproto.server.confirmEmail *) 2 + 3 + (** Confirm an email using a token from com.atproto.server.requestEmailConfirmation. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.confirmEmail" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + email: string; 13 + token: string; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + 20 + let call 21 + ~email 22 + ~token 23 + (client : Hermes.client) : output Lwt.t = 24 + let params = () in 25 + let input = Some ({email; token} |> input_to_yojson) in 26 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 27 + end 28 +
+49
pegasus/lib/lexicons/com_atproto_server_createAccount.ml
··· 1 + (* generated from com.atproto.server.createAccount *) 2 + 3 + (** Create an account. Implemented by PDS. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.createAccount" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 + } 22 + [@@deriving yojson {strict= false}] 23 + 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}] 33 + 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 44 + (client : Hermes.client) : output Lwt.t = 45 + 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 48 + end 49 +
+37
pegasus/lib/lexicons/com_atproto_server_createAppPassword.ml
··· 1 + (* generated from com.atproto.server.createAppPassword *) 2 + 3 + type app_password = 4 + { 5 + name: string; 6 + password: string; 7 + created_at: string [@key "createdAt"]; 8 + privileged: bool option [@default None]; 9 + } 10 + [@@deriving yojson {strict= false}] 11 + 12 + (** Create an App Password. *) 13 + module Main = struct 14 + let nsid = "com.atproto.server.createAppPassword" 15 + 16 + type params = unit 17 + let params_to_yojson () = `Assoc [] 18 + 19 + type input = 20 + { 21 + name: string; 22 + privileged: bool option [@default None]; 23 + } 24 + [@@deriving yojson {strict= false}] 25 + 26 + type output = app_password 27 + [@@deriving yojson {strict= false}] 28 + 29 + let call 30 + ~name 31 + ?privileged 32 + (client : Hermes.client) : output Lwt.t = 33 + let params = () in 34 + let input = Some ({name; privileged} |> input_to_yojson) in 35 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 36 + end 37 +
+31
pegasus/lib/lexicons/com_atproto_server_createInviteCode.ml
··· 1 + (* generated from com.atproto.server.createInviteCode *) 2 + 3 + (** Create an invite code. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.createInviteCode" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + use_count: int [@key "useCount"]; 13 + for_account: string option [@key "forAccount"] [@default None]; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = 18 + { 19 + code: string; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + let call 24 + ~use_count 25 + ?for_account 26 + (client : Hermes.client) : output Lwt.t = 27 + let params = () in 28 + let input = Some ({use_count; for_account} |> input_to_yojson) in 29 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 30 + end 31 +
+40
pegasus/lib/lexicons/com_atproto_server_createInviteCodes.ml
··· 1 + (* generated from com.atproto.server.createInviteCodes *) 2 + 3 + type account_codes = 4 + { 5 + account: string; 6 + codes: string list; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + (** Create invite codes. *) 11 + module Main = struct 12 + let nsid = "com.atproto.server.createInviteCodes" 13 + 14 + type params = unit 15 + let params_to_yojson () = `Assoc [] 16 + 17 + 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 + } 23 + [@@deriving yojson {strict= false}] 24 + 25 + type output = 26 + { 27 + codes: account_codes list; 28 + } 29 + [@@deriving yojson {strict= false}] 30 + 31 + let call 32 + ~code_count 33 + ~use_count 34 + ?for_accounts 35 + (client : Hermes.client) : output Lwt.t = 36 + 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 39 + end 40 +
+44
pegasus/lib/lexicons/com_atproto_server_createSession.ml
··· 1 + (* generated from com.atproto.server.createSession *) 2 + 3 + (** Create an authentication session. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.createSession" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + 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}] 33 + 34 + let call 35 + ~identifier 36 + ~password 37 + ?auth_factor_token 38 + ?allow_takendown 39 + (client : Hermes.client) : output Lwt.t = 40 + 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 43 + end 44 +
+26
pegasus/lib/lexicons/com_atproto_server_deactivateAccount.ml
··· 1 + (* generated from com.atproto.server.deactivateAccount *) 2 + 3 + (** Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.deactivateAccount" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + delete_after: string option [@key "deleteAfter"] [@default None]; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ?delete_after 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({delete_after} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+21
pegasus/lib/lexicons/com_atproto_server_defs.ml
··· 1 + (* generated from com.atproto.server.defs *) 2 + 3 + type invite_code_use = 4 + { 5 + used_by: string [@key "usedBy"]; 6 + used_at: string [@key "usedAt"]; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + 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 + } 20 + [@@deriving yojson {strict= false}] 21 +
+30
pegasus/lib/lexicons/com_atproto_server_deleteAccount.ml
··· 1 + (* generated from com.atproto.server.deleteAccount *) 2 + 3 + (** Delete an actor's account with a token and password. Can only be called after requesting a deletion token. Requires auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.deleteAccount" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + did: string; 13 + password: string; 14 + token: string; 15 + } 16 + [@@deriving yojson {strict= false}] 17 + 18 + type output = unit 19 + let output_of_yojson _ = Ok () 20 + 21 + let call 22 + ~did 23 + ~password 24 + ~token 25 + (client : Hermes.client) : output Lwt.t = 26 + let params = () in 27 + let input = Some ({did; password; token} |> input_to_yojson) in 28 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 29 + end 30 +
+19
pegasus/lib/lexicons/com_atproto_server_deleteSession.ml
··· 1 + (* generated from com.atproto.server.deleteSession *) 2 + 3 + (** Delete the current session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.deleteSession" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = unit 11 + let output_of_yojson _ = Ok () 12 + 13 + let call 14 + (client : Hermes.client) : output Lwt.t = 15 + let params = () in 16 + let input = None in 17 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 18 + end 19 +
+38
pegasus/lib/lexicons/com_atproto_server_describeServer.ml
··· 1 + (* generated from com.atproto.server.describeServer *) 2 + 3 + type contact = 4 + { 5 + email: string option [@default None]; 6 + } 7 + [@@deriving yojson {strict= false}] 8 + 9 + type links = 10 + { 11 + privacy_policy: string option [@key "privacyPolicy"] [@default None]; 12 + terms_of_service: string option [@key "termsOfService"] [@default None]; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + (** Describes the server's account creation requirements and capabilities. Implemented by PDS. *) 17 + module Main = struct 18 + let nsid = "com.atproto.server.describeServer" 19 + 20 + type params = unit 21 + let params_to_yojson () = `Assoc [] 22 + 23 + 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}] 33 + 34 + let call 35 + (client : Hermes.client) : output Lwt.t = 36 + Hermes.query client nsid (`Assoc []) output_of_yojson 37 + end 38 +
+27
pegasus/lib/lexicons/com_atproto_server_getAccountInviteCodes.ml
··· 1 + (* generated from com.atproto.server.getAccountInviteCodes *) 2 + 3 + (** Get all invite codes for the current account. Requires auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.getAccountInviteCodes" 6 + 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}] 13 + 14 + type output = 15 + { 16 + codes: Com_atproto_server_defs.invite_code list; 17 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + let call 21 + ?include_used 22 + ?create_available 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {include_used; create_available} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+29
pegasus/lib/lexicons/com_atproto_server_getServiceAuth.ml
··· 1 + (* generated from com.atproto.server.getServiceAuth *) 2 + 3 + (** Get a signed token on behalf of the requesting DID for the requested service. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.getServiceAuth" 6 + 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}] 14 + 15 + type output = 16 + { 17 + token: string; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + let call 22 + ~aud 23 + ?exp 24 + ?lxm 25 + (client : Hermes.client) : output Lwt.t = 26 + let params : params = {aud; exp; lxm} in 27 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 28 + end 29 +
+27
pegasus/lib/lexicons/com_atproto_server_getSession.ml
··· 1 + (* generated from com.atproto.server.getSession *) 2 + 3 + (** Get information about the current auth session. Requires auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.getSession" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = 11 + { 12 + handle: string; 13 + did: string; 14 + did_doc: Yojson.Safe.t option [@key "didDoc"] [@default None]; 15 + email: string option [@default None]; 16 + email_confirmed: bool option [@key "emailConfirmed"] [@default None]; 17 + email_auth_factor: bool option [@key "emailAuthFactor"] [@default None]; 18 + active: bool option [@default None]; 19 + status: string option [@default None]; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + let call 24 + (client : Hermes.client) : output Lwt.t = 25 + Hermes.query client nsid (`Assoc []) output_of_yojson 26 + end 27 +
+28
pegasus/lib/lexicons/com_atproto_server_listAppPasswords.ml
··· 1 + (* generated from com.atproto.server.listAppPasswords *) 2 + 3 + type app_password = 4 + { 5 + name: string; 6 + created_at: string [@key "createdAt"]; 7 + privileged: bool option [@default None]; 8 + } 9 + [@@deriving yojson {strict= false}] 10 + 11 + (** List all App Passwords. *) 12 + module Main = struct 13 + let nsid = "com.atproto.server.listAppPasswords" 14 + 15 + type params = unit 16 + let params_to_yojson () = `Assoc [] 17 + 18 + type output = 19 + { 20 + passwords: app_password list; 21 + } 22 + [@@deriving yojson {strict= false}] 23 + 24 + let call 25 + (client : Hermes.client) : output Lwt.t = 26 + Hermes.query client nsid (`Assoc []) output_of_yojson 27 + end 28 +
+31
pegasus/lib/lexicons/com_atproto_server_refreshSession.ml
··· 1 + (* generated from com.atproto.server.refreshSession *) 2 + 3 + (** Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.refreshSession" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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 + email: string option [@default None]; 18 + email_confirmed: bool option [@key "emailConfirmed"] [@default None]; 19 + email_auth_factor: bool option [@key "emailAuthFactor"] [@default None]; 20 + active: bool option [@default None]; 21 + status: string option [@default None]; 22 + } 23 + [@@deriving yojson {strict= false}] 24 + 25 + let call 26 + (client : Hermes.client) : output Lwt.t = 27 + let params = () in 28 + let input = None in 29 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 30 + end 31 +
+19
pegasus/lib/lexicons/com_atproto_server_requestAccountDelete.ml
··· 1 + (* generated from com.atproto.server.requestAccountDelete *) 2 + 3 + (** Initiate a user account deletion via email. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.requestAccountDelete" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = unit 11 + let output_of_yojson _ = Ok () 12 + 13 + let call 14 + (client : Hermes.client) : output Lwt.t = 15 + let params = () in 16 + let input = None in 17 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 18 + end 19 +
+19
pegasus/lib/lexicons/com_atproto_server_requestEmailConfirmation.ml
··· 1 + (* generated from com.atproto.server.requestEmailConfirmation *) 2 + 3 + (** Request an email with a code to confirm ownership of email. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.requestEmailConfirmation" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = unit 11 + let output_of_yojson _ = Ok () 12 + 13 + let call 14 + (client : Hermes.client) : output Lwt.t = 15 + let params = () in 16 + let input = None in 17 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 18 + end 19 +
+22
pegasus/lib/lexicons/com_atproto_server_requestEmailUpdate.ml
··· 1 + (* generated from com.atproto.server.requestEmailUpdate *) 2 + 3 + (** Request a token in order to update email. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.requestEmailUpdate" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type output = 11 + { 12 + token_required: bool [@key "tokenRequired"]; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + let call 17 + (client : Hermes.client) : output Lwt.t = 18 + let params = () in 19 + let input = None in 20 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 21 + end 22 +
+26
pegasus/lib/lexicons/com_atproto_server_requestPasswordReset.ml
··· 1 + (* generated from com.atproto.server.requestPasswordReset *) 2 + 3 + (** Initiate a user account password reset via email. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.requestPasswordReset" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + email: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~email 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({email} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+29
pegasus/lib/lexicons/com_atproto_server_reserveSigningKey.ml
··· 1 + (* generated from com.atproto.server.reserveSigningKey *) 2 + 3 + (** Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.reserveSigningKey" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + did: string option [@default None]; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = 17 + { 18 + signing_key: string [@key "signingKey"]; 19 + } 20 + [@@deriving yojson {strict= false}] 21 + 22 + let call 23 + ?did 24 + (client : Hermes.client) : output Lwt.t = 25 + let params = () in 26 + let input = Some ({did} |> input_to_yojson) in 27 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 28 + end 29 +
+28
pegasus/lib/lexicons/com_atproto_server_resetPassword.ml
··· 1 + (* generated from com.atproto.server.resetPassword *) 2 + 3 + (** Reset a user account password using a token. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.resetPassword" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + token: string; 13 + password: string; 14 + } 15 + [@@deriving yojson {strict= false}] 16 + 17 + type output = unit 18 + let output_of_yojson _ = Ok () 19 + 20 + let call 21 + ~token 22 + ~password 23 + (client : Hermes.client) : output Lwt.t = 24 + let params = () in 25 + let input = Some ({token; password} |> input_to_yojson) in 26 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 27 + end 28 +
+26
pegasus/lib/lexicons/com_atproto_server_revokeAppPassword.ml
··· 1 + (* generated from com.atproto.server.revokeAppPassword *) 2 + 3 + (** Revoke an App Password by name. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.revokeAppPassword" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + name: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~name 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({name} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+30
pegasus/lib/lexicons/com_atproto_server_updateEmail.ml
··· 1 + (* generated from com.atproto.server.updateEmail *) 2 + 3 + (** Update an account's email. *) 4 + module Main = struct 5 + let nsid = "com.atproto.server.updateEmail" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + email: string; 13 + email_auth_factor: bool option [@key "emailAuthFactor"] [@default None]; 14 + token: string option [@default None]; 15 + } 16 + [@@deriving yojson {strict= false}] 17 + 18 + type output = unit 19 + let output_of_yojson _ = Ok () 20 + 21 + let call 22 + ~email 23 + ?email_auth_factor 24 + ?token 25 + (client : Hermes.client) : output Lwt.t = 26 + let params = () in 27 + 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 29 + end 30 +
+9
pegasus/lib/lexicons/com_atproto_sync_defs.ml
··· 1 + (* generated from com.atproto.sync.defs *) 2 + 3 + (** String type with known values *) 4 + type host_status = string 5 + 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 9 +
+24
pegasus/lib/lexicons/com_atproto_sync_getBlob.ml
··· 1 + (* generated from com.atproto.sync.getBlob *) 2 + 3 + (** Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS. *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.getBlob" 6 + 7 + type params = 8 + { 9 + did: string; 10 + cid: string; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + (** Raw bytes output with content type *) 15 + type output = string * string 16 + 17 + let call 18 + ~did 19 + ~cid 20 + (client : Hermes.client) : output Lwt.t = 21 + let params : params = {did; cid} in 22 + Hermes.query_bytes client nsid (params_to_yojson params) 23 + end 24 +
+24
pegasus/lib/lexicons/com_atproto_sync_getBlocks.ml
··· 1 + (* generated from com.atproto.sync.getBlocks *) 2 + 3 + (** Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS. *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.getBlocks" 6 + 7 + type params = 8 + { 9 + did: string; 10 + cids: string list; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + (** Raw bytes output with content type *) 15 + type output = string * string 16 + 17 + let call 18 + ~did 19 + ~cids 20 + (client : Hermes.client) : output Lwt.t = 21 + let params : params = {did; cids} in 22 + Hermes.query_bytes client nsid (params_to_yojson params) 23 + end 24 +
+22
pegasus/lib/lexicons/com_atproto_sync_getCheckout.ml
··· 1 + (* generated from com.atproto.sync.getCheckout *) 2 + 3 + (** DEPRECATED - please use com.atproto.sync.getRepo instead *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.getCheckout" 6 + 7 + type params = 8 + { 9 + did: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + (** Raw bytes output with content type *) 14 + type output = string * string 15 + 16 + let call 17 + ~did 18 + (client : Hermes.client) : output Lwt.t = 19 + let params : params = {did} in 20 + Hermes.query_bytes client nsid (params_to_yojson params) 21 + end 22 +
+25
pegasus/lib/lexicons/com_atproto_sync_getHead.ml
··· 1 + (* generated from com.atproto.sync.getHead *) 2 + 3 + (** DEPRECATED - please use com.atproto.sync.getLatestCommit instead *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.getHead" 6 + 7 + type params = 8 + { 9 + did: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + root: string; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~did 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {did} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+28
pegasus/lib/lexicons/com_atproto_sync_getHostStatus.ml
··· 1 + (* generated from com.atproto.sync.getHostStatus *) 2 + 3 + (** Returns information about a specified upstream host, as consumed by the server. Implemented by relays. *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.getHostStatus" 6 + 7 + type params = 8 + { 9 + hostname: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + 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}] 21 + 22 + let call 23 + ~hostname 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {hostname} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+26
pegasus/lib/lexicons/com_atproto_sync_getLatestCommit.ml
··· 1 + (* generated from com.atproto.sync.getLatestCommit *) 2 + 3 + (** Get the current commit CID & revision of the specified repo. Does not require auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.getLatestCommit" 6 + 7 + type params = 8 + { 9 + did: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + cid: string; 16 + rev: string; 17 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + let call 21 + ~did 22 + (client : Hermes.client) : output Lwt.t = 23 + let params : params = {did} in 24 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 25 + end 26 +
+26
pegasus/lib/lexicons/com_atproto_sync_getRecord.ml
··· 1 + (* generated from com.atproto.sync.getRecord *) 2 + 3 + (** Get data blocks needed to prove the existence or non-existence of record in the current version of repo. Does not require auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.getRecord" 6 + 7 + type params = 8 + { 9 + did: string; 10 + collection: string; 11 + rkey: string; 12 + } 13 + [@@deriving yojson {strict= false}] 14 + 15 + (** Raw bytes output with content type *) 16 + type output = string * string 17 + 18 + let call 19 + ~did 20 + ~collection 21 + ~rkey 22 + (client : Hermes.client) : output Lwt.t = 23 + let params : params = {did; collection; rkey} in 24 + Hermes.query_bytes client nsid (params_to_yojson params) 25 + end 26 +
+24
pegasus/lib/lexicons/com_atproto_sync_getRepo.ml
··· 1 + (* generated from com.atproto.sync.getRepo *) 2 + 3 + (** Download a repository export as CAR file. Optionally only a 'diff' since a previous revision. Does not require auth; implemented by PDS. *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.getRepo" 6 + 7 + type params = 8 + { 9 + did: string; 10 + since: string option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + (** Raw bytes output with content type *) 15 + type output = string * string 16 + 17 + let call 18 + ~did 19 + ?since 20 + (client : Hermes.client) : output Lwt.t = 21 + let params : params = {did; since} in 22 + Hermes.query_bytes client nsid (params_to_yojson params) 23 + end 24 +
+28
pegasus/lib/lexicons/com_atproto_sync_getRepoStatus.ml
··· 1 + (* generated from com.atproto.sync.getRepoStatus *) 2 + 3 + (** Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay. *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.getRepoStatus" 6 + 7 + type params = 8 + { 9 + did: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + 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}] 21 + 22 + let call 23 + ~did 24 + (client : Hermes.client) : output Lwt.t = 25 + let params : params = {did} in 26 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 27 + end 28 +
+32
pegasus/lib/lexicons/com_atproto_sync_listBlobs.ml
··· 1 + (* generated from com.atproto.sync.listBlobs *) 2 + 3 + (** List blob CIDs for an account, since some repo revision. Does not require auth; implemented by PDS. *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.listBlobs" 6 + 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}] 15 + 16 + type output = 17 + { 18 + cursor: string option [@default None]; 19 + cids: string list; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + let call 24 + ~did 25 + ?since 26 + ?limit 27 + ?cursor 28 + (client : Hermes.client) : output Lwt.t = 29 + let params : params = {did; since; limit; cursor} in 30 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 31 + end 32 +
+37
pegasus/lib/lexicons/com_atproto_sync_listHosts.ml
··· 1 + (* generated from com.atproto.sync.listHosts *) 2 + 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 + } 10 + [@@deriving yojson {strict= false}] 11 + 12 + (** Enumerates upstream hosts (eg, PDS or relay instances) that this service consumes from. Implemented by relays. *) 13 + module Main = struct 14 + let nsid = "com.atproto.sync.listHosts" 15 + 16 + type params = 17 + { 18 + limit: int option [@default None]; 19 + cursor: string option [@default None]; 20 + } 21 + [@@deriving yojson {strict= false}] 22 + 23 + type output = 24 + { 25 + cursor: string option [@default None]; 26 + hosts: host list; 27 + } 28 + [@@deriving yojson {strict= false}] 29 + 30 + let call 31 + ?limit 32 + ?cursor 33 + (client : Hermes.client) : output Lwt.t = 34 + let params : params = {limit; cursor} in 35 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 36 + end 37 +
+38
pegasus/lib/lexicons/com_atproto_sync_listRepos.ml
··· 1 + (* generated from com.atproto.sync.listRepos *) 2 + 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 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + (** Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay. *) 14 + module Main = struct 15 + let nsid = "com.atproto.sync.listRepos" 16 + 17 + type params = 18 + { 19 + limit: int option [@default None]; 20 + cursor: string option [@default None]; 21 + } 22 + [@@deriving yojson {strict= false}] 23 + 24 + type output = 25 + { 26 + cursor: string option [@default None]; 27 + repos: repo list; 28 + } 29 + [@@deriving yojson {strict= false}] 30 + 31 + let call 32 + ?limit 33 + ?cursor 34 + (client : Hermes.client) : output Lwt.t = 35 + let params : params = {limit; cursor} in 36 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 37 + end 38 +
+36
pegasus/lib/lexicons/com_atproto_sync_listReposByCollection.ml
··· 1 + (* generated from com.atproto.sync.listReposByCollection *) 2 + 3 + type repo = 4 + { 5 + did: string; 6 + } 7 + [@@deriving yojson {strict= false}] 8 + 9 + (** Enumerates all the DIDs which have records with the given collection NSID. *) 10 + module Main = struct 11 + let nsid = "com.atproto.sync.listReposByCollection" 12 + 13 + type params = 14 + { 15 + collection: string; 16 + limit: int option [@default None]; 17 + cursor: string option [@default None]; 18 + } 19 + [@@deriving yojson {strict= false}] 20 + 21 + type output = 22 + { 23 + cursor: string option [@default None]; 24 + repos: repo list; 25 + } 26 + [@@deriving yojson {strict= false}] 27 + 28 + let call 29 + ~collection 30 + ?limit 31 + ?cursor 32 + (client : Hermes.client) : output Lwt.t = 33 + let params : params = {collection; limit; cursor} in 34 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 35 + end 36 +
+26
pegasus/lib/lexicons/com_atproto_sync_notifyOfUpdate.ml
··· 1 + (* generated from com.atproto.sync.notifyOfUpdate *) 2 + 3 + (** Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay. DEPRECATED: just use com.atproto.sync.requestCrawl *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.notifyOfUpdate" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + hostname: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~hostname 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({hostname} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+26
pegasus/lib/lexicons/com_atproto_sync_requestCrawl.ml
··· 1 + (* generated from com.atproto.sync.requestCrawl *) 2 + 3 + (** Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth. *) 4 + module Main = struct 5 + let nsid = "com.atproto.sync.requestCrawl" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + hostname: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~hostname 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({hostname} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+27
pegasus/lib/lexicons/com_atproto_temp_addReservedHandle.ml
··· 1 + (* generated from com.atproto.temp.addReservedHandle *) 2 + 3 + (** Add a handle to the set of reserved handles. *) 4 + module Main = struct 5 + let nsid = "com.atproto.temp.addReservedHandle" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + handle: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + let output_to_yojson () = `Assoc [] 19 + 20 + let call 21 + ~handle 22 + (client : Hermes.client) : output Lwt.t = 23 + let params = () in 24 + let input = Some ({handle} |> input_to_yojson) in 25 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 26 + end 27 +
+78
pegasus/lib/lexicons/com_atproto_temp_checkHandleAvailability.ml
··· 1 + (* generated from com.atproto.temp.checkHandleAvailability *) 2 + 3 + type suggestion = 4 + { 5 + handle: string; 6 + method_: string [@key "method"]; 7 + } 8 + [@@deriving yojson {strict= false}] 9 + 10 + type result_unavailable = 11 + { 12 + suggestions: suggestion list; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type result_available = unit 17 + let result_available_of_yojson _ = Ok () 18 + let result_available_to_yojson () = `Assoc [] 19 + 20 + (** 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. *) 21 + module Main = struct 22 + let nsid = "com.atproto.temp.checkHandleAvailability" 23 + 24 + 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}] 31 + 32 + type result = 33 + | ResultAvailable of result_available 34 + | ResultUnavailable of result_unavailable 35 + | Unknown of Yojson.Safe.t 36 + 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" 51 + 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 62 + 63 + type output = 64 + { 65 + handle: string; 66 + result: result; 67 + } 68 + [@@deriving yojson {strict= false}] 69 + 70 + let call 71 + ~handle 72 + ?email 73 + ?birth_date 74 + (client : Hermes.client) : output Lwt.t = 75 + let params : params = {handle; email; birth_date} in 76 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 77 + end 78 +
+22
pegasus/lib/lexicons/com_atproto_temp_checkSignupQueue.ml
··· 1 + (* generated from com.atproto.temp.checkSignupQueue *) 2 + 3 + (** Check accounts location in signup queue. *) 4 + module Main = struct 5 + let nsid = "com.atproto.temp.checkSignupQueue" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + 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}] 17 + 18 + let call 19 + (client : Hermes.client) : output Lwt.t = 20 + Hermes.query client nsid (`Assoc []) output_of_yojson 21 + end 22 +
+25
pegasus/lib/lexicons/com_atproto_temp_dereferenceScope.ml
··· 1 + (* generated from com.atproto.temp.dereferenceScope *) 2 + 3 + (** Allows finding the oauth permission scope from a reference *) 4 + module Main = struct 5 + let nsid = "com.atproto.temp.dereferenceScope" 6 + 7 + type params = 8 + { 9 + scope: string; 10 + } 11 + [@@deriving yojson {strict= false}] 12 + 13 + type output = 14 + { 15 + scope: string; 16 + } 17 + [@@deriving yojson {strict= false}] 18 + 19 + let call 20 + ~scope 21 + (client : Hermes.client) : output Lwt.t = 22 + let params : params = {scope} in 23 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 24 + end 25 +
+27
pegasus/lib/lexicons/com_atproto_temp_fetchLabels.ml
··· 1 + (* generated from com.atproto.temp.fetchLabels *) 2 + 3 + (** DEPRECATED: use queryLabels or subscribeLabels instead -- Fetch all labels from a labeler created after a certain date. *) 4 + module Main = struct 5 + let nsid = "com.atproto.temp.fetchLabels" 6 + 7 + type params = 8 + { 9 + since: int option [@default None]; 10 + limit: int option [@default None]; 11 + } 12 + [@@deriving yojson {strict= false}] 13 + 14 + type output = 15 + { 16 + labels: Com_atproto_label_defs.label list; 17 + } 18 + [@@deriving yojson {strict= false}] 19 + 20 + let call 21 + ?since 22 + ?limit 23 + (client : Hermes.client) : output Lwt.t = 24 + let params : params = {since; limit} in 25 + Hermes.query client nsid (params_to_yojson params) output_of_yojson 26 + end 27 +
+26
pegasus/lib/lexicons/com_atproto_temp_requestPhoneVerification.ml
··· 1 + (* generated from com.atproto.temp.requestPhoneVerification *) 2 + 3 + (** Request a verification code to be sent to the supplied phone number *) 4 + module Main = struct 5 + let nsid = "com.atproto.temp.requestPhoneVerification" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + phone_number: string [@key "phoneNumber"]; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~phone_number 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({phone_number} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+26
pegasus/lib/lexicons/com_atproto_temp_revokeAccountCredentials.ml
··· 1 + (* generated from com.atproto.temp.revokeAccountCredentials *) 2 + 3 + (** Revoke sessions, password, and app passwords associated with account. May be resolved by a password reset. *) 4 + module Main = struct 5 + let nsid = "com.atproto.temp.revokeAccountCredentials" 6 + 7 + type params = unit 8 + let params_to_yojson () = `Assoc [] 9 + 10 + type input = 11 + { 12 + account: string; 13 + } 14 + [@@deriving yojson {strict= false}] 15 + 16 + type output = unit 17 + let output_of_yojson _ = Ok () 18 + 19 + let call 20 + ~account 21 + (client : Hermes.client) : output Lwt.t = 22 + let params = () in 23 + let input = Some ({account} |> input_to_yojson) in 24 + Hermes.procedure client nsid (params_to_yojson params) input output_of_yojson 25 + end 26 +
+227
pegasus/lib/lexicons/lexicons.ml
··· 1 + (* Lexicons - generated from atproto lexicons *) 2 + 3 + module Com_atproto_moderation_createReport = Com_atproto_moderation_createReport 4 + module Com_atproto_moderation_defs = Com_atproto_moderation_defs 5 + module Com_atproto_repo_listRecords = Com_atproto_repo_listRecords 6 + module Com_atproto_repo_applyWrites = Com_atproto_repo_applyWrites 7 + module Com_atproto_repo_getRecord = Com_atproto_repo_getRecord 8 + module Com_atproto_repo_describeRepo = Com_atproto_repo_describeRepo 9 + module Com_atproto_repo_importRepo = Com_atproto_repo_importRepo 10 + module Com_atproto_repo_uploadBlob = Com_atproto_repo_uploadBlob 11 + module Com_atproto_repo_putRecord = Com_atproto_repo_putRecord 12 + module Com_atproto_repo_deleteRecord = Com_atproto_repo_deleteRecord 13 + module Com_atproto_repo_createRecord = Com_atproto_repo_createRecord 14 + module Com_atproto_repo_listMissingBlobs = Com_atproto_repo_listMissingBlobs 15 + module Com_atproto_repo_defs = Com_atproto_repo_defs 16 + module Com_atproto_repo_strongRef = Com_atproto_repo_strongRef 17 + module Com_atproto_sync_getCheckout = Com_atproto_sync_getCheckout 18 + module Com_atproto_sync_listReposByCollection = Com_atproto_sync_listReposByCollection 19 + module Com_atproto_sync_getBlocks = Com_atproto_sync_getBlocks 20 + module Com_atproto_sync_getHostStatus = Com_atproto_sync_getHostStatus 21 + module Com_atproto_sync_listRepos = Com_atproto_sync_listRepos 22 + module Com_atproto_sync_listHosts = Com_atproto_sync_listHosts 23 + module Com_atproto_sync_getRecord = Com_atproto_sync_getRecord 24 + module Com_atproto_sync_getRepoStatus = Com_atproto_sync_getRepoStatus 25 + module Com_atproto_sync_getLatestCommit = Com_atproto_sync_getLatestCommit 26 + module Com_atproto_sync_listBlobs = Com_atproto_sync_listBlobs 27 + module Com_atproto_sync_requestCrawl = Com_atproto_sync_requestCrawl 28 + module Com_atproto_sync_defs = Com_atproto_sync_defs 29 + module Com_atproto_sync_notifyOfUpdate = Com_atproto_sync_notifyOfUpdate 30 + module Com_atproto_sync_getRepo = Com_atproto_sync_getRepo 31 + module Com_atproto_sync_getBlob = Com_atproto_sync_getBlob 32 + module Com_atproto_sync_getHead = Com_atproto_sync_getHead 33 + module Com_atproto_lexicon_schema = Com_atproto_lexicon_schema 34 + module Com_atproto_lexicon_resolveLexicon = Com_atproto_lexicon_resolveLexicon 35 + module Com_atproto_server_createInviteCode = Com_atproto_server_createInviteCode 36 + module Com_atproto_server_deleteAccount = Com_atproto_server_deleteAccount 37 + module Com_atproto_server_createAccount = Com_atproto_server_createAccount 38 + module Com_atproto_server_requestAccountDelete = Com_atproto_server_requestAccountDelete 39 + module Com_atproto_server_requestPasswordReset = Com_atproto_server_requestPasswordReset 40 + module Com_atproto_server_requestEmailUpdate = Com_atproto_server_requestEmailUpdate 41 + module Com_atproto_server_checkAccountStatus = Com_atproto_server_checkAccountStatus 42 + module Com_atproto_server_resetPassword = Com_atproto_server_resetPassword 43 + module Com_atproto_server_updateEmail = Com_atproto_server_updateEmail 44 + module Com_atproto_server_deactivateAccount = Com_atproto_server_deactivateAccount 45 + module Com_atproto_server_refreshSession = Com_atproto_server_refreshSession 46 + module Com_atproto_server_getSession = Com_atproto_server_getSession 47 + module Com_atproto_server_confirmEmail = Com_atproto_server_confirmEmail 48 + module Com_atproto_server_describeServer = Com_atproto_server_describeServer 49 + module Com_atproto_server_activateAccount = Com_atproto_server_activateAccount 50 + module Com_atproto_server_createAppPassword = Com_atproto_server_createAppPassword 51 + module Com_atproto_server_revokeAppPassword = Com_atproto_server_revokeAppPassword 52 + module Com_atproto_server_deleteSession = Com_atproto_server_deleteSession 53 + module Com_atproto_server_createInviteCodes = Com_atproto_server_createInviteCodes 54 + module Com_atproto_server_listAppPasswords = Com_atproto_server_listAppPasswords 55 + module Com_atproto_server_createSession = Com_atproto_server_createSession 56 + module Com_atproto_server_getAccountInviteCodes = Com_atproto_server_getAccountInviteCodes 57 + module Com_atproto_server_getServiceAuth = Com_atproto_server_getServiceAuth 58 + module Com_atproto_server_defs = Com_atproto_server_defs 59 + module Com_atproto_server_reserveSigningKey = Com_atproto_server_reserveSigningKey 60 + module Com_atproto_server_requestEmailConfirmation = Com_atproto_server_requestEmailConfirmation 61 + module Com_atproto_label_queryLabels = Com_atproto_label_queryLabels 62 + module Com_atproto_label_defs = Com_atproto_label_defs 63 + module Com_atproto_admin_deleteAccount = Com_atproto_admin_deleteAccount 64 + module Com_atproto_admin_getAccountInfos = Com_atproto_admin_getAccountInfos 65 + module Com_atproto_admin_sendEmail = Com_atproto_admin_sendEmail 66 + module Com_atproto_admin_updateSubjectStatus = Com_atproto_admin_updateSubjectStatus 67 + module Com_atproto_admin_disableInviteCodes = Com_atproto_admin_disableInviteCodes 68 + module Com_atproto_admin_disableAccountInvites = Com_atproto_admin_disableAccountInvites 69 + module Com_atproto_admin_enableAccountInvites = Com_atproto_admin_enableAccountInvites 70 + module Com_atproto_admin_updateAccountSigningKey = Com_atproto_admin_updateAccountSigningKey 71 + module Com_atproto_admin_getInviteCodes = Com_atproto_admin_getInviteCodes 72 + module Com_atproto_admin_updateAccountHandle = Com_atproto_admin_updateAccountHandle 73 + module Com_atproto_admin_updateAccountPassword = Com_atproto_admin_updateAccountPassword 74 + module Com_atproto_admin_searchAccounts = Com_atproto_admin_searchAccounts 75 + module Com_atproto_admin_defs = Com_atproto_admin_defs 76 + module Com_atproto_admin_getSubjectStatus = Com_atproto_admin_getSubjectStatus 77 + module Com_atproto_admin_getAccountInfo = Com_atproto_admin_getAccountInfo 78 + module Com_atproto_admin_updateAccountEmail = Com_atproto_admin_updateAccountEmail 79 + module Com_atproto_identity_resolveDid = Com_atproto_identity_resolveDid 80 + module Com_atproto_identity_getRecommendedDidCredentials = Com_atproto_identity_getRecommendedDidCredentials 81 + module Com_atproto_identity_requestPlcOperationSignature = Com_atproto_identity_requestPlcOperationSignature 82 + module Com_atproto_identity_resolveHandle = Com_atproto_identity_resolveHandle 83 + module Com_atproto_identity_refreshIdentity = Com_atproto_identity_refreshIdentity 84 + module Com_atproto_identity_resolveIdentity = Com_atproto_identity_resolveIdentity 85 + module Com_atproto_identity_submitPlcOperation = Com_atproto_identity_submitPlcOperation 86 + module Com_atproto_identity_signPlcOperation = Com_atproto_identity_signPlcOperation 87 + module Com_atproto_identity_defs = Com_atproto_identity_defs 88 + module Com_atproto_identity_updateHandle = Com_atproto_identity_updateHandle 89 + module Com_atproto_temp_fetchLabels = Com_atproto_temp_fetchLabels 90 + module Com_atproto_temp_revokeAccountCredentials = Com_atproto_temp_revokeAccountCredentials 91 + module Com_atproto_temp_requestPhoneVerification = Com_atproto_temp_requestPhoneVerification 92 + module Com_atproto_temp_checkHandleAvailability = Com_atproto_temp_checkHandleAvailability 93 + module Com_atproto_temp_checkSignupQueue = Com_atproto_temp_checkSignupQueue 94 + module Com_atproto_temp_addReservedHandle = Com_atproto_temp_addReservedHandle 95 + module Com_atproto_temp_dereferenceScope = Com_atproto_temp_dereferenceScope 96 + module App_bsky_labeler_getServices = App_bsky_labeler_getServices 97 + module App_bsky_labeler_service = App_bsky_labeler_service 98 + module App_bsky_labeler_defs = App_bsky_labeler_defs 99 + module App_bsky_actor_profile = App_bsky_actor_profile 100 + module App_bsky_actor_getPreferences = App_bsky_actor_getPreferences 101 + module App_bsky_actor_status = App_bsky_actor_status 102 + module App_bsky_actor_getProfiles = App_bsky_actor_getProfiles 103 + module App_bsky_actor_searchActors = App_bsky_actor_searchActors 104 + module App_bsky_actor_getSuggestions = App_bsky_actor_getSuggestions 105 + module App_bsky_actor_getProfile = App_bsky_actor_getProfile 106 + module App_bsky_actor_putPreferences = App_bsky_actor_putPreferences 107 + module App_bsky_actor_defs = App_bsky_actor_defs 108 + module App_bsky_actor_searchActorsTypeahead = App_bsky_actor_searchActorsTypeahead 109 + module App_bsky_ageassurance_getConfig = App_bsky_ageassurance_getConfig 110 + module App_bsky_ageassurance_getState = App_bsky_ageassurance_getState 111 + module App_bsky_ageassurance_defs = App_bsky_ageassurance_defs 112 + module App_bsky_ageassurance_begin = App_bsky_ageassurance_begin 113 + module App_bsky_richtext_facet = App_bsky_richtext_facet 114 + module App_bsky_feed_post = App_bsky_feed_post 115 + module App_bsky_feed_getActorFeeds = App_bsky_feed_getActorFeeds 116 + module App_bsky_feed_getSuggestedFeeds = App_bsky_feed_getSuggestedFeeds 117 + module App_bsky_feed_getListFeed = App_bsky_feed_getListFeed 118 + module App_bsky_feed_getFeedSkeleton = App_bsky_feed_getFeedSkeleton 119 + module App_bsky_feed_getQuotes = App_bsky_feed_getQuotes 120 + module App_bsky_feed_getFeed = App_bsky_feed_getFeed 121 + module App_bsky_feed_getPosts = App_bsky_feed_getPosts 122 + module App_bsky_feed_searchPosts = App_bsky_feed_searchPosts 123 + module App_bsky_feed_describeFeedGenerator = App_bsky_feed_describeFeedGenerator 124 + module App_bsky_feed_repost = App_bsky_feed_repost 125 + module App_bsky_feed_getRepostedBy = App_bsky_feed_getRepostedBy 126 + module App_bsky_feed_like = App_bsky_feed_like 127 + module App_bsky_feed_getActorLikes = App_bsky_feed_getActorLikes 128 + module App_bsky_feed_getPostThread = App_bsky_feed_getPostThread 129 + module App_bsky_feed_threadgate = App_bsky_feed_threadgate 130 + module App_bsky_feed_postgate = App_bsky_feed_postgate 131 + module App_bsky_feed_getLikes = App_bsky_feed_getLikes 132 + module App_bsky_feed_getAuthorFeed = App_bsky_feed_getAuthorFeed 133 + module App_bsky_feed_getFeedGenerator = App_bsky_feed_getFeedGenerator 134 + module App_bsky_feed_getTimeline = App_bsky_feed_getTimeline 135 + module App_bsky_feed_getFeedGenerators = App_bsky_feed_getFeedGenerators 136 + module App_bsky_feed_defs = App_bsky_feed_defs 137 + module App_bsky_feed_sendInteractions = App_bsky_feed_sendInteractions 138 + module App_bsky_feed_generator = App_bsky_feed_generator 139 + module App_bsky_graph_getList = App_bsky_graph_getList 140 + module App_bsky_graph_unmuteActor = App_bsky_graph_unmuteActor 141 + module App_bsky_graph_getRelationships = App_bsky_graph_getRelationships 142 + module App_bsky_graph_getBlocks = App_bsky_graph_getBlocks 143 + module App_bsky_graph_getFollows = App_bsky_graph_getFollows 144 + module App_bsky_graph_getListMutes = App_bsky_graph_getListMutes 145 + module App_bsky_graph_verification = App_bsky_graph_verification 146 + module App_bsky_graph_getKnownFollowers = App_bsky_graph_getKnownFollowers 147 + module App_bsky_graph_list = App_bsky_graph_list 148 + module App_bsky_graph_listitem = App_bsky_graph_listitem 149 + module App_bsky_graph_getMutes = App_bsky_graph_getMutes 150 + module App_bsky_graph_muteActor = App_bsky_graph_muteActor 151 + module App_bsky_graph_unmuteThread = App_bsky_graph_unmuteThread 152 + module App_bsky_graph_getFollowers = App_bsky_graph_getFollowers 153 + module App_bsky_graph_getLists = App_bsky_graph_getLists 154 + module App_bsky_graph_getActorStarterPacks = App_bsky_graph_getActorStarterPacks 155 + module App_bsky_graph_searchStarterPacks = App_bsky_graph_searchStarterPacks 156 + module App_bsky_graph_muteThread = App_bsky_graph_muteThread 157 + module App_bsky_graph_muteActorList = App_bsky_graph_muteActorList 158 + module App_bsky_graph_starterpack = App_bsky_graph_starterpack 159 + module App_bsky_graph_getStarterPack = App_bsky_graph_getStarterPack 160 + module App_bsky_graph_listblock = App_bsky_graph_listblock 161 + module App_bsky_graph_getListBlocks = App_bsky_graph_getListBlocks 162 + module App_bsky_graph_unmuteActorList = App_bsky_graph_unmuteActorList 163 + module App_bsky_graph_getListsWithMembership = App_bsky_graph_getListsWithMembership 164 + module App_bsky_graph_defs = App_bsky_graph_defs 165 + module App_bsky_graph_follow = App_bsky_graph_follow 166 + module App_bsky_graph_getStarterPacksWithMembership = App_bsky_graph_getStarterPacksWithMembership 167 + module App_bsky_graph_block = App_bsky_graph_block 168 + module App_bsky_graph_getSuggestedFollowsByActor = App_bsky_graph_getSuggestedFollowsByActor 169 + module App_bsky_graph_getStarterPacks = App_bsky_graph_getStarterPacks 170 + module App_bsky_unspecced_getConfig = App_bsky_unspecced_getConfig 171 + module App_bsky_unspecced_getTrendsSkeleton = App_bsky_unspecced_getTrendsSkeleton 172 + module App_bsky_unspecced_getSuggestedFeeds = App_bsky_unspecced_getSuggestedFeeds 173 + module App_bsky_unspecced_getTaggedSuggestions = App_bsky_unspecced_getTaggedSuggestions 174 + module App_bsky_unspecced_getTrendingTopics = App_bsky_unspecced_getTrendingTopics 175 + module App_bsky_unspecced_initAgeAssurance = App_bsky_unspecced_initAgeAssurance 176 + module App_bsky_unspecced_getPopularFeedGenerators = App_bsky_unspecced_getPopularFeedGenerators 177 + module App_bsky_unspecced_getAgeAssuranceState = App_bsky_unspecced_getAgeAssuranceState 178 + module App_bsky_unspecced_searchPostsSkeleton = App_bsky_unspecced_searchPostsSkeleton 179 + module App_bsky_unspecced_getSuggestionsSkeleton = App_bsky_unspecced_getSuggestionsSkeleton 180 + module App_bsky_unspecced_searchActorsSkeleton = App_bsky_unspecced_searchActorsSkeleton 181 + module App_bsky_unspecced_getTrends = App_bsky_unspecced_getTrends 182 + module App_bsky_unspecced_getPostThreadV2 = App_bsky_unspecced_getPostThreadV2 183 + module App_bsky_unspecced_getSuggestedUsersSkeleton = App_bsky_unspecced_getSuggestedUsersSkeleton 184 + module App_bsky_unspecced_getOnboardingSuggestedStarterPacks = App_bsky_unspecced_getOnboardingSuggestedStarterPacks 185 + module App_bsky_unspecced_getSuggestedStarterPacksSkeleton = App_bsky_unspecced_getSuggestedStarterPacksSkeleton 186 + module App_bsky_unspecced_getSuggestedStarterPacks = App_bsky_unspecced_getSuggestedStarterPacks 187 + module App_bsky_unspecced_getPostThreadOtherV2 = App_bsky_unspecced_getPostThreadOtherV2 188 + module App_bsky_unspecced_getSuggestedUsers = App_bsky_unspecced_getSuggestedUsers 189 + module App_bsky_unspecced_getOnboardingSuggestedStarterPacksSkeleton = App_bsky_unspecced_getOnboardingSuggestedStarterPacksSkeleton 190 + module App_bsky_unspecced_defs = App_bsky_unspecced_defs 191 + module App_bsky_unspecced_searchStarterPacksSkeleton = App_bsky_unspecced_searchStarterPacksSkeleton 192 + module App_bsky_unspecced_getSuggestedFeedsSkeleton = App_bsky_unspecced_getSuggestedFeedsSkeleton 193 + module App_bsky_notification_getUnreadCount = App_bsky_notification_getUnreadCount 194 + module App_bsky_notification_listNotifications = App_bsky_notification_listNotifications 195 + module App_bsky_notification_getPreferences = App_bsky_notification_getPreferences 196 + module App_bsky_notification_unregisterPush = App_bsky_notification_unregisterPush 197 + module App_bsky_notification_listActivitySubscriptions = App_bsky_notification_listActivitySubscriptions 198 + module App_bsky_notification_updateSeen = App_bsky_notification_updateSeen 199 + module App_bsky_notification_putPreferencesV2 = App_bsky_notification_putPreferencesV2 200 + module App_bsky_notification_declaration = App_bsky_notification_declaration 201 + module App_bsky_notification_putActivitySubscription = App_bsky_notification_putActivitySubscription 202 + module App_bsky_notification_putPreferences = App_bsky_notification_putPreferences 203 + module App_bsky_notification_registerPush = App_bsky_notification_registerPush 204 + module App_bsky_notification_defs = App_bsky_notification_defs 205 + module App_bsky_embed_external = App_bsky_embed_external 206 + module App_bsky_embed_video = App_bsky_embed_video 207 + module App_bsky_embed_recordWithMedia = App_bsky_embed_recordWithMedia 208 + module App_bsky_embed_images = App_bsky_embed_images 209 + module App_bsky_embed_record = App_bsky_embed_record 210 + module App_bsky_embed_defs = App_bsky_embed_defs 211 + module App_bsky_bookmark_createBookmark = App_bsky_bookmark_createBookmark 212 + module App_bsky_bookmark_getBookmarks = App_bsky_bookmark_getBookmarks 213 + module App_bsky_bookmark_deleteBookmark = App_bsky_bookmark_deleteBookmark 214 + module App_bsky_bookmark_defs = App_bsky_bookmark_defs 215 + module App_bsky_contact_verifyPhone = App_bsky_contact_verifyPhone 216 + module App_bsky_contact_removeData = App_bsky_contact_removeData 217 + module App_bsky_contact_dismissMatch = App_bsky_contact_dismissMatch 218 + module App_bsky_contact_importContacts = App_bsky_contact_importContacts 219 + module App_bsky_contact_getMatches = App_bsky_contact_getMatches 220 + module App_bsky_contact_startPhoneVerification = App_bsky_contact_startPhoneVerification 221 + module App_bsky_contact_getSyncStatus = App_bsky_contact_getSyncStatus 222 + module App_bsky_contact_sendNotification = App_bsky_contact_sendNotification 223 + module App_bsky_contact_defs = App_bsky_contact_defs 224 + module App_bsky_video_getUploadLimits = App_bsky_video_getUploadLimits 225 + module App_bsky_video_getJobStatus = App_bsky_video_getJobStatus 226 + module App_bsky_video_defs = App_bsky_video_defs 227 + module App_bsky_video_uploadVideo = App_bsky_video_uploadVideo