···4545(** [of_timestamp_us ?clockid us] creates a TID from microsecond timestamp.
46464747 @param clockid Clock ID 0-1023 (default: random).
4848- @raise Eio.Io if timestamp out of range [0, 2^53) or clockid invalid. *)
4848+ @raise Eio.Io if timestamp out of range (0 to 2{^53}-1) or clockid invalid. *)
49495050val of_timestamp_ms : ?clockid:int -> int64 -> t
5151(** [of_timestamp_ms ?clockid ms] creates a TID from millisecond timestamp.
···1515 (libraries atp jsont jsont.bytesrw))|}
1616 name public_name_line
17171818+(* Parse a lexicon file using jsont *)
1919+let parse_file path =
2020+ try
2121+ let content = In_channel.with_open_bin path In_channel.input_all in
2222+ match Jsont_bytesrw.decode_string Lexicon_types.lexicon_doc_jsont content with
2323+ | Ok doc -> Ok doc
2424+ | Error e -> Error ("JSON decode error: " ^ e)
2525+ with
2626+ | Sys_error e -> Error ("File error: " ^ e)
2727+ | e -> Error ("Unexpected error: " ^ Printexc.to_string e)
2828+1829(* recursively find all json files in a path (file or directory) *)
1930let find_json_files path =
2031 let rec aux acc p =
···3849 let lexicons =
3950 List.filter_map
4051 (fun path ->
4141- match Parser.parse_file path with
5252+ match parse_file path with
4253 | Ok doc ->
4354 Printf.printf " Parsed: %s\n" doc.Lexicon_types.id;
4455 Some doc
+539
hermest/lib/lexicon_types.ml
···162162}
163163164164type parse_result = (lexicon_doc, string) result
165165+166166+(* Jsont codecs for all lexicon types *)
167167+168168+let string_spec_jsont : string_spec Jsont.t =
169169+ let make format min_length max_length min_graphemes max_graphemes known_values
170170+ enum const default description : string_spec =
171171+ {
172172+ format;
173173+ min_length;
174174+ max_length;
175175+ min_graphemes;
176176+ max_graphemes;
177177+ known_values;
178178+ enum;
179179+ const;
180180+ default;
181181+ description;
182182+ }
183183+ in
184184+ let map =
185185+ Jsont.Object.map ~kind:"string_spec" make
186186+ |> Jsont.Object.opt_mem "format" Jsont.string
187187+ ~enc:(fun (s : string_spec) -> s.format)
188188+ |> Jsont.Object.opt_mem "minLength" Jsont.int
189189+ ~enc:(fun (s : string_spec) -> s.min_length)
190190+ |> Jsont.Object.opt_mem "maxLength" Jsont.int
191191+ ~enc:(fun (s : string_spec) -> s.max_length)
192192+ |> Jsont.Object.opt_mem "minGraphemes" Jsont.int
193193+ ~enc:(fun (s : string_spec) -> s.min_graphemes)
194194+ |> Jsont.Object.opt_mem "maxGraphemes" Jsont.int
195195+ ~enc:(fun (s : string_spec) -> s.max_graphemes)
196196+ |> Jsont.Object.opt_mem "knownValues" Jsont.(list string)
197197+ ~enc:(fun (s : string_spec) -> s.known_values)
198198+ |> Jsont.Object.opt_mem "enum" Jsont.(list string)
199199+ ~enc:(fun (s : string_spec) -> s.enum)
200200+ |> Jsont.Object.opt_mem "const" Jsont.string
201201+ ~enc:(fun (s : string_spec) -> s.const)
202202+ |> Jsont.Object.opt_mem "default" Jsont.string
203203+ ~enc:(fun (s : string_spec) -> s.default)
204204+ |> Jsont.Object.opt_mem "description" Jsont.string
205205+ ~enc:(fun (s : string_spec) -> s.description)
206206+ |> Jsont.Object.skip_unknown
207207+ in
208208+ Jsont.Object.finish map
209209+210210+let integer_spec_jsont : integer_spec Jsont.t =
211211+ let make minimum maximum enum const default description : integer_spec =
212212+ { minimum; maximum; enum; const; default; description }
213213+ in
214214+ let map =
215215+ Jsont.Object.map ~kind:"integer_spec" make
216216+ |> Jsont.Object.opt_mem "minimum" Jsont.int
217217+ ~enc:(fun (s : integer_spec) -> s.minimum)
218218+ |> Jsont.Object.opt_mem "maximum" Jsont.int
219219+ ~enc:(fun (s : integer_spec) -> s.maximum)
220220+ |> Jsont.Object.opt_mem "enum" Jsont.(list int)
221221+ ~enc:(fun (s : integer_spec) -> s.enum)
222222+ |> Jsont.Object.opt_mem "const" Jsont.int
223223+ ~enc:(fun (s : integer_spec) -> s.const)
224224+ |> Jsont.Object.opt_mem "default" Jsont.int
225225+ ~enc:(fun (s : integer_spec) -> s.default)
226226+ |> Jsont.Object.opt_mem "description" Jsont.string
227227+ ~enc:(fun (s : integer_spec) -> s.description)
228228+ |> Jsont.Object.skip_unknown
229229+ in
230230+ Jsont.Object.finish map
231231+232232+let boolean_spec_jsont : boolean_spec Jsont.t =
233233+ let make const default description : boolean_spec =
234234+ { const; default; description }
235235+ in
236236+ let map =
237237+ Jsont.Object.map ~kind:"boolean_spec" make
238238+ |> Jsont.Object.opt_mem "const" Jsont.bool
239239+ ~enc:(fun (s : boolean_spec) -> s.const)
240240+ |> Jsont.Object.opt_mem "default" Jsont.bool
241241+ ~enc:(fun (s : boolean_spec) -> s.default)
242242+ |> Jsont.Object.opt_mem "description" Jsont.string
243243+ ~enc:(fun (s : boolean_spec) -> s.description)
244244+ |> Jsont.Object.skip_unknown
245245+ in
246246+ Jsont.Object.finish map
247247+248248+let bytes_spec_jsont : bytes_spec Jsont.t =
249249+ let make min_length max_length description : bytes_spec =
250250+ { min_length; max_length; description }
251251+ in
252252+ let map =
253253+ Jsont.Object.map ~kind:"bytes_spec" make
254254+ |> Jsont.Object.opt_mem "minLength" Jsont.int
255255+ ~enc:(fun (s : bytes_spec) -> s.min_length)
256256+ |> Jsont.Object.opt_mem "maxLength" Jsont.int
257257+ ~enc:(fun (s : bytes_spec) -> s.max_length)
258258+ |> Jsont.Object.opt_mem "description" Jsont.string
259259+ ~enc:(fun (s : bytes_spec) -> s.description)
260260+ |> Jsont.Object.skip_unknown
261261+ in
262262+ Jsont.Object.finish map
263263+264264+let blob_spec_jsont : blob_spec Jsont.t =
265265+ let make accept max_size description : blob_spec =
266266+ { accept; max_size; description }
267267+ in
268268+ let map =
269269+ Jsont.Object.map ~kind:"blob_spec" make
270270+ |> Jsont.Object.opt_mem "accept" Jsont.(list string)
271271+ ~enc:(fun (s : blob_spec) -> s.accept)
272272+ |> Jsont.Object.opt_mem "maxSize" Jsont.int
273273+ ~enc:(fun (s : blob_spec) -> s.max_size)
274274+ |> Jsont.Object.opt_mem "description" Jsont.string
275275+ ~enc:(fun (s : blob_spec) -> s.description)
276276+ |> Jsont.Object.skip_unknown
277277+ in
278278+ Jsont.Object.finish map
279279+280280+let cid_link_spec_jsont : cid_link_spec Jsont.t =
281281+ let make description : cid_link_spec = { description } in
282282+ let map =
283283+ Jsont.Object.map ~kind:"cid_link_spec" make
284284+ |> Jsont.Object.opt_mem "description" Jsont.string
285285+ ~enc:(fun (s : cid_link_spec) -> s.description)
286286+ |> Jsont.Object.skip_unknown
287287+ in
288288+ Jsont.Object.finish map
289289+290290+let ref_spec_jsont : ref_spec Jsont.t =
291291+ let make ref_ description : ref_spec = { ref_; description } in
292292+ let map =
293293+ Jsont.Object.map ~kind:"ref_spec" make
294294+ |> Jsont.Object.mem "ref" Jsont.string
295295+ ~enc:(fun (s : ref_spec) -> s.ref_)
296296+ |> Jsont.Object.opt_mem "description" Jsont.string
297297+ ~enc:(fun (s : ref_spec) -> s.description)
298298+ |> Jsont.Object.skip_unknown
299299+ in
300300+ Jsont.Object.finish map
301301+302302+let union_spec_jsont : union_spec Jsont.t =
303303+ let make refs closed description : union_spec = { refs; closed; description } in
304304+ let map =
305305+ Jsont.Object.map ~kind:"union_spec" make
306306+ |> Jsont.Object.mem "refs" Jsont.(list string)
307307+ ~enc:(fun (s : union_spec) -> s.refs)
308308+ |> Jsont.Object.opt_mem "closed" Jsont.bool
309309+ ~enc:(fun (s : union_spec) -> s.closed)
310310+ |> Jsont.Object.opt_mem "description" Jsont.string
311311+ ~enc:(fun (s : union_spec) -> s.description)
312312+ |> Jsont.Object.skip_unknown
313313+ in
314314+ Jsont.Object.finish map
315315+316316+let token_spec_jsont : token_spec Jsont.t =
317317+ let make description : token_spec = { description } in
318318+ let map =
319319+ Jsont.Object.map ~kind:"token_spec" make
320320+ |> Jsont.Object.opt_mem "description" Jsont.string
321321+ ~enc:(fun (s : token_spec) -> s.description)
322322+ |> Jsont.Object.skip_unknown
323323+ in
324324+ Jsont.Object.finish map
325325+326326+let unknown_spec_jsont : unknown_spec Jsont.t =
327327+ let make description : unknown_spec = { description } in
328328+ let map =
329329+ Jsont.Object.map ~kind:"unknown_spec" make
330330+ |> Jsont.Object.opt_mem "description" Jsont.string
331331+ ~enc:(fun (s : unknown_spec) -> s.description)
332332+ |> Jsont.Object.skip_unknown
333333+ in
334334+ Jsont.Object.finish map
335335+336336+let error_def_jsont : error_def Jsont.t =
337337+ let make name description : error_def = { name; description } in
338338+ let map =
339339+ Jsont.Object.map ~kind:"error_def" make
340340+ |> Jsont.Object.mem "name" Jsont.string
341341+ ~enc:(fun (s : error_def) -> s.name)
342342+ |> Jsont.Object.opt_mem "description" Jsont.string
343343+ ~enc:(fun (s : error_def) -> s.description)
344344+ |> Jsont.Object.skip_unknown
345345+ in
346346+ Jsont.Object.finish map
347347+348348+(* Recursive types using Jsont.rec' with lazy values *)
349349+350350+module StringMap = Map.Make(String)
351351+352352+(* Forward declarations for mutually recursive types *)
353353+let rec type_def_jsont_lazy : type_def Jsont.t Lazy.t = lazy (
354354+ (* Create case maps for each variant *)
355355+ let string_case = Jsont.Object.Case.map "string" string_spec_jsont
356356+ ~dec:(fun s -> String s) in
357357+ let integer_case = Jsont.Object.Case.map "integer" integer_spec_jsont
358358+ ~dec:(fun s -> Integer s) in
359359+ let boolean_case = Jsont.Object.Case.map "boolean" boolean_spec_jsont
360360+ ~dec:(fun s -> Boolean s) in
361361+ let bytes_case = Jsont.Object.Case.map "bytes" bytes_spec_jsont
362362+ ~dec:(fun s -> Bytes s) in
363363+ let blob_case = Jsont.Object.Case.map "blob" blob_spec_jsont
364364+ ~dec:(fun s -> Blob s) in
365365+ let cid_link_case = Jsont.Object.Case.map "cid-link" cid_link_spec_jsont
366366+ ~dec:(fun s -> CidLink s) in
367367+ let array_case = Jsont.Object.Case.map "array" (Lazy.force array_spec_jsont_lazy)
368368+ ~dec:(fun s -> Array s) in
369369+ let object_case = Jsont.Object.Case.map "object" (Lazy.force object_spec_jsont_lazy)
370370+ ~dec:(fun s -> Object s) in
371371+ let ref_case = Jsont.Object.Case.map "ref" ref_spec_jsont
372372+ ~dec:(fun s -> Ref s) in
373373+ let union_case = Jsont.Object.Case.map "union" union_spec_jsont
374374+ ~dec:(fun s -> Union s) in
375375+ let token_case = Jsont.Object.Case.map "token" token_spec_jsont
376376+ ~dec:(fun s -> Token s) in
377377+ let unknown_case = Jsont.Object.Case.map "unknown" unknown_spec_jsont
378378+ ~dec:(fun s -> Unknown s) in
379379+ let query_case = Jsont.Object.Case.map "query" (Lazy.force query_spec_jsont_lazy)
380380+ ~dec:(fun s -> Query s) in
381381+ let procedure_case = Jsont.Object.Case.map "procedure" (Lazy.force procedure_spec_jsont_lazy)
382382+ ~dec:(fun s -> Procedure s) in
383383+ let subscription_case = Jsont.Object.Case.map "subscription" (Lazy.force subscription_spec_jsont_lazy)
384384+ ~dec:(fun s -> Subscription s) in
385385+ let record_case = Jsont.Object.Case.map "record" (Lazy.force record_spec_jsont_lazy)
386386+ ~dec:(fun s -> Record s) in
387387+ let permission_set_case = Jsont.Object.Case.map "permission-set" (Lazy.force permission_set_spec_jsont_lazy)
388388+ ~dec:(fun s -> PermissionSet s) in
389389+ (* Create enc_case function for encoding *)
390390+ let enc_case = function
391391+ | String s -> Jsont.Object.Case.value string_case s
392392+ | Integer s -> Jsont.Object.Case.value integer_case s
393393+ | Boolean s -> Jsont.Object.Case.value boolean_case s
394394+ | Bytes s -> Jsont.Object.Case.value bytes_case s
395395+ | Blob s -> Jsont.Object.Case.value blob_case s
396396+ | CidLink s -> Jsont.Object.Case.value cid_link_case s
397397+ | Array s -> Jsont.Object.Case.value array_case s
398398+ | Object s -> Jsont.Object.Case.value object_case s
399399+ | Ref s -> Jsont.Object.Case.value ref_case s
400400+ | Union s -> Jsont.Object.Case.value union_case s
401401+ | Token s -> Jsont.Object.Case.value token_case s
402402+ | Unknown s -> Jsont.Object.Case.value unknown_case s
403403+ | Query s -> Jsont.Object.Case.value query_case s
404404+ | Procedure s -> Jsont.Object.Case.value procedure_case s
405405+ | Subscription s -> Jsont.Object.Case.value subscription_case s
406406+ | Record s -> Jsont.Object.Case.value record_case s
407407+ | PermissionSet s -> Jsont.Object.Case.value permission_set_case s
408408+ in
409409+ (* List of all cases *)
410410+ let cases = Jsont.Object.Case.[
411411+ make string_case; make integer_case; make boolean_case; make bytes_case;
412412+ make blob_case; make cid_link_case; make array_case; make object_case;
413413+ make ref_case; make union_case; make token_case; make unknown_case;
414414+ make query_case; make procedure_case; make subscription_case;
415415+ make record_case; make permission_set_case
416416+ ] in
417417+ (* Build the type_def codec *)
418418+ Jsont.Object.map ~kind:"type_def" Fun.id
419419+ |> Jsont.Object.case_mem "type" Jsont.string ~enc:Fun.id ~enc_case cases
420420+ |> Jsont.Object.finish
421421+)
422422+423423+and property_jsont_lazy : property Jsont.t Lazy.t = lazy (
424424+ let make type_def description : property = { type_def; description } in
425425+ let map =
426426+ Jsont.Object.map ~kind:"property" make
427427+ |> Jsont.Object.mem "type_def" (Jsont.rec' type_def_jsont_lazy)
428428+ ~enc:(fun (p : property) -> p.type_def)
429429+ |> Jsont.Object.opt_mem "description" Jsont.string
430430+ ~enc:(fun (p : property) -> p.description)
431431+ |> Jsont.Object.skip_unknown
432432+ in
433433+ Jsont.Object.finish map
434434+)
435435+436436+(* Extract description from a type_def. Each variant's spec contains the description. *)
437437+and get_type_def_description (td : type_def) : string option =
438438+ match td with
439439+ | String s -> s.description
440440+ | Integer s -> s.description
441441+ | Boolean s -> s.description
442442+ | Bytes s -> s.description
443443+ | Blob s -> s.description
444444+ | CidLink s -> s.description
445445+ | Array s -> s.description
446446+ | Object s -> s.description
447447+ | Ref s -> s.description
448448+ | Union s -> s.description
449449+ | Token s -> s.description
450450+ | Unknown s -> s.description
451451+ | Query s -> s.description
452452+ | Procedure s -> s.description
453453+ | Subscription s -> s.description
454454+ | Record s -> s.description
455455+ | PermissionSet s -> s.description
456456+457457+(* Helper to decode properties object as (string * property) list.
458458+ Each property value contains type_def fields including description.
459459+ We decode as type_def and extract the description from it.
460460+ Note: Field order is alphabetical since JSON object keys have no defined order. *)
461461+and properties_jsont_lazy : (string * property) list Jsont.t Lazy.t = lazy (
462462+ let map_jsont = Jsont.Object.as_string_map (Jsont.rec' type_def_jsont_lazy) in
463463+ Jsont.map
464464+ ~kind:"properties"
465465+ ~dec:(fun m ->
466466+ StringMap.bindings m |> List.map (fun (name, type_def) ->
467467+ let description = get_type_def_description type_def in
468468+ (name, { type_def; description })))
469469+ ~enc:(fun (props : (string * property) list) ->
470470+ List.fold_left (fun m (name, (prop : property)) ->
471471+ StringMap.add name prop.type_def m) StringMap.empty props)
472472+ map_jsont
473473+)
474474+475475+and object_spec_jsont_lazy : object_spec Jsont.t Lazy.t = lazy (
476476+ let make properties required nullable description : object_spec =
477477+ { properties; required; nullable; description }
478478+ in
479479+ let map =
480480+ Jsont.Object.map ~kind:"object_spec" make
481481+ |> Jsont.Object.mem "properties" (Jsont.rec' properties_jsont_lazy)
482482+ ~dec_absent:[] ~enc:(fun (s : object_spec) -> s.properties)
483483+ |> Jsont.Object.opt_mem "required" Jsont.(list string)
484484+ ~enc:(fun (s : object_spec) -> s.required)
485485+ |> Jsont.Object.opt_mem "nullable" Jsont.(list string)
486486+ ~enc:(fun (s : object_spec) -> s.nullable)
487487+ |> Jsont.Object.opt_mem "description" Jsont.string
488488+ ~enc:(fun (s : object_spec) -> s.description)
489489+ |> Jsont.Object.skip_unknown
490490+ in
491491+ Jsont.Object.finish map
492492+)
493493+494494+and array_spec_jsont_lazy : array_spec Jsont.t Lazy.t = lazy (
495495+ let make items min_length max_length description : array_spec =
496496+ { items; min_length; max_length; description }
497497+ in
498498+ let map =
499499+ Jsont.Object.map ~kind:"array_spec" make
500500+ |> Jsont.Object.mem "items" (Jsont.rec' type_def_jsont_lazy)
501501+ ~enc:(fun (s : array_spec) -> s.items)
502502+ |> Jsont.Object.opt_mem "minLength" Jsont.int
503503+ ~enc:(fun (s : array_spec) -> s.min_length)
504504+ |> Jsont.Object.opt_mem "maxLength" Jsont.int
505505+ ~enc:(fun (s : array_spec) -> s.max_length)
506506+ |> Jsont.Object.opt_mem "description" Jsont.string
507507+ ~enc:(fun (s : array_spec) -> s.description)
508508+ |> Jsont.Object.skip_unknown
509509+ in
510510+ Jsont.Object.finish map
511511+)
512512+513513+and params_spec_jsont_lazy : params_spec Jsont.t Lazy.t = lazy (
514514+ let make properties required description : params_spec =
515515+ { properties; required; description }
516516+ in
517517+ let map =
518518+ Jsont.Object.map ~kind:"params_spec" make
519519+ |> Jsont.Object.mem "properties" (Jsont.rec' properties_jsont_lazy)
520520+ ~dec_absent:[] ~enc:(fun (s : params_spec) -> s.properties)
521521+ |> Jsont.Object.opt_mem "required" Jsont.(list string)
522522+ ~enc:(fun (s : params_spec) -> s.required)
523523+ |> Jsont.Object.opt_mem "description" Jsont.string
524524+ ~enc:(fun (s : params_spec) -> s.description)
525525+ |> Jsont.Object.skip_unknown
526526+ in
527527+ Jsont.Object.finish map
528528+)
529529+530530+and body_def_jsont_lazy : body_def Jsont.t Lazy.t = lazy (
531531+ let make encoding schema description : body_def =
532532+ { encoding; schema; description }
533533+ in
534534+ let map =
535535+ Jsont.Object.map ~kind:"body_def" make
536536+ |> Jsont.Object.mem "encoding" Jsont.string
537537+ ~enc:(fun (s : body_def) -> s.encoding)
538538+ |> Jsont.Object.opt_mem "schema" (Jsont.rec' type_def_jsont_lazy)
539539+ ~enc:(fun (s : body_def) -> s.schema)
540540+ |> Jsont.Object.opt_mem "description" Jsont.string
541541+ ~enc:(fun (s : body_def) -> s.description)
542542+ |> Jsont.Object.skip_unknown
543543+ in
544544+ Jsont.Object.finish map
545545+)
546546+547547+and query_spec_jsont_lazy : query_spec Jsont.t Lazy.t = lazy (
548548+ let make parameters output errors description : query_spec =
549549+ { parameters; output; errors; description }
550550+ in
551551+ let map =
552552+ Jsont.Object.map ~kind:"query_spec" make
553553+ |> Jsont.Object.opt_mem "parameters" (Jsont.rec' params_spec_jsont_lazy)
554554+ ~enc:(fun (s : query_spec) -> s.parameters)
555555+ |> Jsont.Object.opt_mem "output" (Jsont.rec' body_def_jsont_lazy)
556556+ ~enc:(fun (s : query_spec) -> s.output)
557557+ |> Jsont.Object.opt_mem "errors" Jsont.(list error_def_jsont)
558558+ ~enc:(fun (s : query_spec) -> s.errors)
559559+ |> Jsont.Object.opt_mem "description" Jsont.string
560560+ ~enc:(fun (s : query_spec) -> s.description)
561561+ |> Jsont.Object.skip_unknown
562562+ in
563563+ Jsont.Object.finish map
564564+)
565565+566566+and procedure_spec_jsont_lazy : procedure_spec Jsont.t Lazy.t = lazy (
567567+ let make parameters input output errors description : procedure_spec =
568568+ { parameters; input; output; errors; description }
569569+ in
570570+ let map =
571571+ Jsont.Object.map ~kind:"procedure_spec" make
572572+ |> Jsont.Object.opt_mem "parameters" (Jsont.rec' params_spec_jsont_lazy)
573573+ ~enc:(fun (s : procedure_spec) -> s.parameters)
574574+ |> Jsont.Object.opt_mem "input" (Jsont.rec' body_def_jsont_lazy)
575575+ ~enc:(fun (s : procedure_spec) -> s.input)
576576+ |> Jsont.Object.opt_mem "output" (Jsont.rec' body_def_jsont_lazy)
577577+ ~enc:(fun (s : procedure_spec) -> s.output)
578578+ |> Jsont.Object.opt_mem "errors" Jsont.(list error_def_jsont)
579579+ ~enc:(fun (s : procedure_spec) -> s.errors)
580580+ |> Jsont.Object.opt_mem "description" Jsont.string
581581+ ~enc:(fun (s : procedure_spec) -> s.description)
582582+ |> Jsont.Object.skip_unknown
583583+ in
584584+ Jsont.Object.finish map
585585+)
586586+587587+and subscription_spec_jsont_lazy : subscription_spec Jsont.t Lazy.t = lazy (
588588+ let make parameters message errors description : subscription_spec =
589589+ { parameters; message; errors; description }
590590+ in
591591+ let map =
592592+ Jsont.Object.map ~kind:"subscription_spec" make
593593+ |> Jsont.Object.opt_mem "parameters" (Jsont.rec' params_spec_jsont_lazy)
594594+ ~enc:(fun (s : subscription_spec) -> s.parameters)
595595+ |> Jsont.Object.opt_mem "message" (Jsont.rec' body_def_jsont_lazy)
596596+ ~enc:(fun (s : subscription_spec) -> s.message)
597597+ |> Jsont.Object.opt_mem "errors" Jsont.(list error_def_jsont)
598598+ ~enc:(fun (s : subscription_spec) -> s.errors)
599599+ |> Jsont.Object.opt_mem "description" Jsont.string
600600+ ~enc:(fun (s : subscription_spec) -> s.description)
601601+ |> Jsont.Object.skip_unknown
602602+ in
603603+ Jsont.Object.finish map
604604+)
605605+606606+and record_spec_jsont_lazy : record_spec Jsont.t Lazy.t = lazy (
607607+ let make key record description : record_spec = { key; record; description } in
608608+ let map =
609609+ Jsont.Object.map ~kind:"record_spec" make
610610+ |> Jsont.Object.mem "key" Jsont.string
611611+ ~enc:(fun (s : record_spec) -> s.key)
612612+ |> Jsont.Object.mem "record" (Jsont.rec' object_spec_jsont_lazy)
613613+ ~enc:(fun (s : record_spec) -> s.record)
614614+ |> Jsont.Object.opt_mem "description" Jsont.string
615615+ ~enc:(fun (s : record_spec) -> s.description)
616616+ |> Jsont.Object.skip_unknown
617617+ in
618618+ Jsont.Object.finish map
619619+)
620620+621621+and permission_spec_jsont_lazy : permission_spec Jsont.t Lazy.t = lazy (
622622+ let make resource inherit_aud lxm action collection : permission_spec =
623623+ { resource; inherit_aud; lxm; action; collection }
624624+ in
625625+ let map =
626626+ Jsont.Object.map ~kind:"permission_spec" make
627627+ |> Jsont.Object.mem "resource" Jsont.string
628628+ ~enc:(fun (s : permission_spec) -> s.resource)
629629+ |> Jsont.Object.opt_mem "inherit_aud" Jsont.bool
630630+ ~enc:(fun (s : permission_spec) -> s.inherit_aud)
631631+ |> Jsont.Object.opt_mem "lxm" Jsont.(list string)
632632+ ~enc:(fun (s : permission_spec) -> s.lxm)
633633+ |> Jsont.Object.opt_mem "action" Jsont.(list string)
634634+ ~enc:(fun (s : permission_spec) -> s.action)
635635+ |> Jsont.Object.opt_mem "collection" Jsont.(list string)
636636+ ~enc:(fun (s : permission_spec) -> s.collection)
637637+ |> Jsont.Object.skip_unknown
638638+ in
639639+ Jsont.Object.finish map
640640+)
641641+642642+and permission_set_spec_jsont_lazy : permission_set_spec Jsont.t Lazy.t = lazy (
643643+ let make title detail permissions description : permission_set_spec =
644644+ { title; detail; permissions; description }
645645+ in
646646+ let map =
647647+ Jsont.Object.map ~kind:"permission_set_spec" make
648648+ |> Jsont.Object.mem "title" Jsont.string
649649+ ~enc:(fun (s : permission_set_spec) -> s.title)
650650+ |> Jsont.Object.opt_mem "detail" Jsont.string
651651+ ~enc:(fun (s : permission_set_spec) -> s.detail)
652652+ |> Jsont.Object.mem "permissions" Jsont.(list (Jsont.rec' permission_spec_jsont_lazy))
653653+ ~enc:(fun (s : permission_set_spec) -> s.permissions)
654654+ |> Jsont.Object.opt_mem "description" Jsont.string
655655+ ~enc:(fun (s : permission_set_spec) -> s.description)
656656+ |> Jsont.Object.skip_unknown
657657+ in
658658+ Jsont.Object.finish map
659659+)
660660+661661+(* Force lazy values to get the actual codecs *)
662662+let type_def_jsont = Lazy.force type_def_jsont_lazy
663663+let property_jsont = Lazy.force property_jsont_lazy
664664+let object_spec_jsont = Lazy.force object_spec_jsont_lazy
665665+let array_spec_jsont = Lazy.force array_spec_jsont_lazy
666666+let params_spec_jsont = Lazy.force params_spec_jsont_lazy
667667+let body_def_jsont = Lazy.force body_def_jsont_lazy
668668+let query_spec_jsont = Lazy.force query_spec_jsont_lazy
669669+let procedure_spec_jsont = Lazy.force procedure_spec_jsont_lazy
670670+let subscription_spec_jsont = Lazy.force subscription_spec_jsont_lazy
671671+let record_spec_jsont = Lazy.force record_spec_jsont_lazy
672672+673673+(* defs_jsont decodes an object {"name": type_def, ...} as a def_entry list *)
674674+let defs_jsont : def_entry list Jsont.t =
675675+ (* Decode as a string map of type_def values *)
676676+ let map_jsont = Jsont.Object.as_string_map type_def_jsont in
677677+ (* Wrap with conversion functions *)
678678+ Jsont.map
679679+ ~kind:"defs"
680680+ ~dec:(fun m -> StringMap.fold (fun name type_def acc -> { name; type_def } :: acc) m [])
681681+ ~enc:(fun defs -> List.fold_left (fun m d -> StringMap.add d.name d.type_def m) StringMap.empty defs)
682682+ map_jsont
683683+684684+let def_entry_jsont : def_entry Jsont.t =
685685+ let make name type_def = { name; type_def } in
686686+ Jsont.Object.map ~kind:"def_entry" make
687687+ |> Jsont.Object.mem "name" Jsont.string ~enc:(fun s -> s.name)
688688+ |> Jsont.Object.mem "type_def" type_def_jsont ~enc:(fun s -> s.type_def)
689689+ |> Jsont.Object.skip_unknown
690690+ |> Jsont.Object.finish
691691+692692+let lexicon_doc_jsont : lexicon_doc Jsont.t =
693693+ let make lexicon id revision description defs =
694694+ { lexicon; id; revision; description; defs }
695695+ in
696696+ Jsont.Object.map ~kind:"lexicon_doc" make
697697+ |> Jsont.Object.mem "lexicon" Jsont.int ~enc:(fun s -> s.lexicon)
698698+ |> Jsont.Object.mem "id" Jsont.string ~enc:(fun s -> s.id)
699699+ |> Jsont.Object.opt_mem "revision" Jsont.int ~enc:(fun s -> s.revision)
700700+ |> Jsont.Object.opt_mem "description" Jsont.string ~enc:(fun s -> s.description)
701701+ |> Jsont.Object.mem "defs" defs_jsont ~enc:(fun s -> s.defs)
702702+ |> Jsont.Object.skip_unknown
703703+ |> Jsont.Object.finish
+74
hermest/lib/lexicon_types.mli
···282282283283type parse_result = (lexicon_doc, string) result
284284(** Result of parsing a lexicon JSON file. *)
285285+286286+(** {1 Jsont Codecs}
287287+288288+ These codecs can be used to parse and serialize lexicon documents using the
289289+ jsont library. *)
290290+291291+val string_spec_jsont : string_spec Jsont.t
292292+(** JSON codec for string specifications. *)
293293+294294+val integer_spec_jsont : integer_spec Jsont.t
295295+(** JSON codec for integer specifications. *)
296296+297297+val boolean_spec_jsont : boolean_spec Jsont.t
298298+(** JSON codec for boolean specifications. *)
299299+300300+val bytes_spec_jsont : bytes_spec Jsont.t
301301+(** JSON codec for bytes specifications. *)
302302+303303+val blob_spec_jsont : blob_spec Jsont.t
304304+(** JSON codec for blob specifications. *)
305305+306306+val cid_link_spec_jsont : cid_link_spec Jsont.t
307307+(** JSON codec for CID link specifications. *)
308308+309309+val ref_spec_jsont : ref_spec Jsont.t
310310+(** JSON codec for reference specifications. *)
311311+312312+val union_spec_jsont : union_spec Jsont.t
313313+(** JSON codec for union specifications. *)
314314+315315+val token_spec_jsont : token_spec Jsont.t
316316+(** JSON codec for token specifications. *)
317317+318318+val unknown_spec_jsont : unknown_spec Jsont.t
319319+(** JSON codec for unknown type specifications. *)
320320+321321+val error_def_jsont : error_def Jsont.t
322322+(** JSON codec for error definitions. *)
323323+324324+val type_def_jsont : type_def Jsont.t
325325+(** JSON codec for type definitions (discriminated union). *)
326326+327327+val property_jsont : property Jsont.t
328328+(** JSON codec for object properties. *)
329329+330330+val object_spec_jsont : object_spec Jsont.t
331331+(** JSON codec for object specifications. *)
332332+333333+val array_spec_jsont : array_spec Jsont.t
334334+(** JSON codec for array specifications. *)
335335+336336+val params_spec_jsont : params_spec Jsont.t
337337+(** JSON codec for parameter specifications. *)
338338+339339+val body_def_jsont : body_def Jsont.t
340340+(** JSON codec for body definitions. *)
341341+342342+val query_spec_jsont : query_spec Jsont.t
343343+(** JSON codec for query specifications. *)
344344+345345+val procedure_spec_jsont : procedure_spec Jsont.t
346346+(** JSON codec for procedure specifications. *)
347347+348348+val subscription_spec_jsont : subscription_spec Jsont.t
349349+(** JSON codec for subscription specifications. *)
350350+351351+val record_spec_jsont : record_spec Jsont.t
352352+(** JSON codec for record specifications. *)
353353+354354+val def_entry_jsont : def_entry Jsont.t
355355+(** JSON codec for definition entries. *)
356356+357357+val lexicon_doc_jsont : lexicon_doc Jsont.t
358358+(** JSON codec for lexicon documents. *)
-320
hermest/lib/parser.ml
···11-(* This Source Code Form is subject to the terms of the Mozilla Public
22- License, v. 2.0. If a copy of the MPL was not distributed with this
33- file, You can obtain one at http://mozilla.org/MPL/2.0/. *)
44-55-(* parse lexicon json files into lexicon_types using jsont *)
66-77-open Lexicon_types
88-99-(* Helper to get object members as association list *)
1010-let get_members = function
1111- | Jsont.Object (mems, _) ->
1212- Some (List.map (fun ((name, _), value) -> (name, value)) mems)
1313- | _ -> None
1414-1515-(* Generic field extractor using Option.bind *)
1616-let get_field extract key json =
1717- Option.bind (get_members json) (fun pairs ->
1818- Option.bind (List.assoc_opt key pairs) extract)
1919-2020-let get_string_opt key =
2121- get_field (function Jsont.String (s, _) -> Some s | _ -> None) key
2222-2323-let get_int_opt key =
2424- get_field
2525- (function Jsont.Number (f, _) -> Some (int_of_float f) | _ -> None)
2626- key
2727-2828-let get_bool_opt key =
2929- get_field (function Jsont.Bool (b, _) -> Some b | _ -> None) key
3030-3131-let get_list_opt key =
3232- get_field (function Jsont.Array (l, _) -> Some l | _ -> None) key
3333-3434-let get_string key json =
3535- match get_string_opt key json with
3636- | Some s -> s
3737- | None -> failwith ("missing required string field: " ^ key)
3838-3939-let get_int key json =
4040- match get_int_opt key json with
4141- | Some i -> i
4242- | None -> failwith ("missing required int field: " ^ key)
4343-4444-let get_string_list_opt key json =
4545- Option.map
4646- (List.filter_map (function Jsont.String (s, _) -> Some s | _ -> None))
4747- (get_list_opt key json)
4848-4949-let get_int_list_opt key json =
5050- Option.map
5151- (List.filter_map (function
5252- | Jsont.Number (f, _) -> Some (int_of_float f)
5353- | _ -> None))
5454- (get_list_opt key json)
5555-5656-let get_assoc key json =
5757- match get_members json with
5858- | Some pairs -> (
5959- match List.assoc_opt key pairs with
6060- | Some (Jsont.Object _ as a) -> Some a
6161- | _ -> None)
6262- | None -> None
6363-6464-(* parse type definition from json *)
6565-let rec parse_type_def json : type_def =
6666- let type_str = get_string "type" json in
6767- match type_str with
6868- | "string" ->
6969- String
7070- {
7171- format = get_string_opt "format" json;
7272- min_length = get_int_opt "minLength" json;
7373- max_length = get_int_opt "maxLength" json;
7474- min_graphemes = get_int_opt "minGraphemes" json;
7575- max_graphemes = get_int_opt "maxGraphemes" json;
7676- known_values = get_string_list_opt "knownValues" json;
7777- enum = get_string_list_opt "enum" json;
7878- const = get_string_opt "const" json;
7979- default = get_string_opt "default" json;
8080- description = get_string_opt "description" json;
8181- }
8282- | "integer" ->
8383- Integer
8484- {
8585- minimum = get_int_opt "minimum" json;
8686- maximum = get_int_opt "maximum" json;
8787- enum = get_int_list_opt "enum" json;
8888- const = get_int_opt "const" json;
8989- default = get_int_opt "default" json;
9090- description = get_string_opt "description" json;
9191- }
9292- | "boolean" ->
9393- Boolean
9494- {
9595- const = get_bool_opt "const" json;
9696- default = get_bool_opt "default" json;
9797- description = get_string_opt "description" json;
9898- }
9999- | "bytes" ->
100100- Bytes
101101- {
102102- min_length = get_int_opt "minLength" json;
103103- max_length = get_int_opt "maxLength" json;
104104- description = get_string_opt "description" json;
105105- }
106106- | "blob" ->
107107- Blob
108108- {
109109- accept = get_string_list_opt "accept" json;
110110- max_size = get_int_opt "maxSize" json;
111111- description = get_string_opt "description" json;
112112- }
113113- | "cid-link" -> CidLink { description = get_string_opt "description" json }
114114- | "array" ->
115115- let items_json =
116116- match get_assoc "items" json with
117117- | Some j -> j
118118- | None -> failwith "array type missing items"
119119- in
120120- Array
121121- {
122122- items = parse_type_def items_json;
123123- min_length = get_int_opt "minLength" json;
124124- max_length = get_int_opt "maxLength" json;
125125- description = get_string_opt "description" json;
126126- }
127127- | "object" -> Object (parse_object_spec json)
128128- | "ref" ->
129129- Ref
130130- {
131131- ref_ = get_string "ref" json;
132132- description = get_string_opt "description" json;
133133- }
134134- | "union" ->
135135- Union
136136- {
137137- refs =
138138- (match get_string_list_opt "refs" json with
139139- | Some l -> l
140140- | None -> []);
141141- closed = get_bool_opt "closed" json;
142142- description = get_string_opt "description" json;
143143- }
144144- | "token" -> Token { description = get_string_opt "description" json }
145145- | "unknown" -> Unknown { description = get_string_opt "description" json }
146146- | "query" -> Query (parse_query_spec json)
147147- | "procedure" -> Procedure (parse_procedure_spec json)
148148- | "subscription" -> Subscription (parse_subscription_spec json)
149149- | "record" -> Record (parse_record_spec json)
150150- | "permission-set" -> PermissionSet (parse_permission_set_spec json)
151151- | "params" ->
152152- (* params type used in query/procedure parameters *)
153153- Object (parse_object_spec json)
154154- | t -> failwith ("unknown type: " ^ t)
155155-156156-and parse_object_spec json : object_spec =
157157- let properties =
158158- match get_assoc "properties" json with
159159- | Some obj -> (
160160- match get_members obj with
161161- | Some pairs ->
162162- List.map
163163- (fun (name, prop_json) ->
164164- let type_def = parse_type_def prop_json in
165165- let description = get_string_opt "description" prop_json in
166166- (name, { type_def; description }))
167167- pairs
168168- | None -> [])
169169- | _ -> []
170170- in
171171- {
172172- properties;
173173- required = get_string_list_opt "required" json;
174174- nullable = get_string_list_opt "nullable" json;
175175- description = get_string_opt "description" json;
176176- }
177177-178178-and parse_params_spec json : params_spec =
179179- let properties =
180180- match get_assoc "properties" json with
181181- | Some obj -> (
182182- match get_members obj with
183183- | Some pairs ->
184184- List.map
185185- (fun (name, prop_json) ->
186186- let type_def = parse_type_def prop_json in
187187- let description = get_string_opt "description" prop_json in
188188- (name, { type_def; description }))
189189- pairs
190190- | None -> [])
191191- | _ -> []
192192- in
193193- {
194194- properties;
195195- required = get_string_list_opt "required" json;
196196- description = get_string_opt "description" json;
197197- }
198198-199199-and parse_body_def json : body_def =
200200- {
201201- encoding = get_string "encoding" json;
202202- schema = Option.map parse_type_def (get_assoc "schema" json);
203203- description = get_string_opt "description" json;
204204- }
205205-206206-and parse_error_def json : error_def =
207207- {
208208- name = get_string "name" json;
209209- description = get_string_opt "description" json;
210210- }
211211-212212-and parse_errors_opt json =
213213- Option.map
214214- (List.map (function
215215- | Jsont.Object _ as j -> parse_error_def j
216216- | _ -> failwith "invalid error def"))
217217- (get_list_opt "errors" json)
218218-219219-and parse_query_spec json : query_spec =
220220- {
221221- parameters = Option.map parse_params_spec (get_assoc "parameters" json);
222222- output = Option.map parse_body_def (get_assoc "output" json);
223223- errors = parse_errors_opt json;
224224- description = get_string_opt "description" json;
225225- }
226226-227227-and parse_procedure_spec json : procedure_spec =
228228- {
229229- parameters = Option.map parse_params_spec (get_assoc "parameters" json);
230230- input = Option.map parse_body_def (get_assoc "input" json);
231231- output = Option.map parse_body_def (get_assoc "output" json);
232232- errors = parse_errors_opt json;
233233- description = get_string_opt "description" json;
234234- }
235235-236236-and parse_subscription_spec json : subscription_spec =
237237- {
238238- parameters = Option.map parse_params_spec (get_assoc "parameters" json);
239239- message = Option.map parse_body_def (get_assoc "message" json);
240240- errors = parse_errors_opt json;
241241- description = get_string_opt "description" json;
242242- }
243243-244244-and parse_record_spec json : record_spec =
245245- let key = get_string "key" json in
246246- let record_json =
247247- match get_assoc "record" json with
248248- | Some j -> j
249249- | None -> failwith "record type missing record field"
250250- in
251251- {
252252- key;
253253- record = parse_object_spec record_json;
254254- description = get_string_opt "description" json;
255255- }
256256-257257-and parse_permission_spec json : permission_spec =
258258- {
259259- resource = get_string "resource" json;
260260- inherit_aud = get_bool_opt "inheritAud" json;
261261- lxm = get_string_list_opt "lxm" json;
262262- action = get_string_list_opt "action" json;
263263- collection = get_string_list_opt "collection" json;
264264- }
265265-266266-and parse_permission_set_spec json : permission_set_spec =
267267- let permissions =
268268- match get_list_opt "permissions" json with
269269- | Some perms ->
270270- List.filter_map
271271- (function Jsont.Object _ as j -> Some (parse_permission_spec j) | _ -> None)
272272- perms
273273- | None -> []
274274- in
275275- {
276276- title = get_string "title" json;
277277- detail = get_string_opt "detail" json;
278278- permissions;
279279- description = get_string_opt "description" json;
280280- }
281281-282282-(* parse complete lexicon document *)
283283-let parse_lexicon_doc json : lexicon_doc =
284284- let lexicon = get_int "lexicon" json in
285285- let id = get_string "id" json in
286286- let revision = get_int_opt "revision" json in
287287- let description = get_string_opt "description" json in
288288- let defs =
289289- match get_assoc "defs" json with
290290- | Some obj -> (
291291- match get_members obj with
292292- | Some pairs ->
293293- List.map
294294- (fun (name, def_json) -> { name; type_def = parse_type_def def_json })
295295- pairs
296296- | None -> [])
297297- | _ -> []
298298- in
299299- { lexicon; id; revision; description; defs }
300300-301301-(* parse lexicon file *)
302302-let parse_file path : parse_result =
303303- try
304304- let content = In_channel.with_open_bin path In_channel.input_all in
305305- match Jsont_bytesrw.decode_string Jsont.json content with
306306- | Ok json -> Ok (parse_lexicon_doc json)
307307- | Error e -> Error ("JSON parse error: " ^ e)
308308- with
309309- | Failure e -> Error ("Parse error: " ^ e)
310310- | e -> Error ("Unexpected error: " ^ Printexc.to_string e)
311311-312312-(* parse json string *)
313313-let parse_string content : parse_result =
314314- try
315315- match Jsont_bytesrw.decode_string Jsont.json content with
316316- | Ok json -> Ok (parse_lexicon_doc json)
317317- | Error e -> Error ("JSON parse error: " ^ e)
318318- with
319319- | Failure e -> Error ("Parse error: " ^ e)
320320- | e -> Error ("Unexpected error: " ^ Printexc.to_string e)
-29
hermest/lib/parser.mli
···11-(* This Source Code Form is subject to the terms of the Mozilla Public
22- License, v. 2.0. If a copy of the MPL was not distributed with this
33- file, You can obtain one at http://mozilla.org/MPL/2.0/. *)
44-55-(** AT Protocol Lexicon JSON parser.
66-77- This module parses lexicon JSON files into {!Lexicon_types.lexicon_doc}
88- structures. Lexicons are typically stored as JSON files with the [.json]
99- extension.
1010-1111- {2 Usage}
1212-1313- {[
1414- match Parser.parse_file "app.bsky.feed.post.json" with
1515- | Ok doc -> Printf.printf "Parsed lexicon: %s\n" doc.id
1616- | Error msg -> Printf.eprintf "Error: %s\n" msg
1717- ]} *)
1818-1919-val parse_file : string -> Lexicon_types.parse_result
2020-(** [parse_file path] parses a lexicon JSON file at [path].
2121-2222- Returns [Ok doc] on success or [Error msg] with a descriptive error message
2323- on failure. *)
2424-2525-val parse_string : string -> Lexicon_types.parse_result
2626-(** [parse_string content] parses lexicon JSON from a string.
2727-2828- Returns [Ok doc] on success or [Error msg] with a descriptive error message
2929- on failure. *)
···1616 module StrongRef : sig
17171818type main = {
1919- uri : string;
2019 cid : string;
2020+ uri : string;
2121}
22222323(** Jsont codec for {!type:main}. *)
···3838 module ListRecords : sig
39394040type record = {
4141- uri : string;
4241 cid : string;
4242+ uri : string;
4343 value : Jsont.json;
4444}
4545···50505151(** Query/procedure parameters. *)
5252type params = {
5353- repo : string; (** The handle or DID of the repo. *)
5453 collection : string; (** The NSID of the record type. *)
5454+ cursor : string option;
5555 limit : int option; (** The number of records to return. *)
5656- cursor : string option;
5656+ repo : string; (** The handle or DID of the repo. *)
5757 reverse : bool option; (** Flag to reverse the order of the returned records. *)
5858}
5959···75757676(** Query/procedure parameters. *)
7777type params = {
7878- repo : string; (** The handle or DID of the repo. *)
7878+ cid : string option; (** The CID of the version of the record. If not specified, then return the most recent version. *)
7979 collection : string; (** The NSID of the record collection. *)
8080+ repo : string; (** The handle or DID of the repo. *)
8081 rkey : string; (** The Record Key. *)
8181- cid : string option; (** The CID of the version of the record. If not specified, then return the most recent version. *)
8282}
83838484(** Jsont codec for {!type:params}. *)
···868687878888type output = {
8989- uri : string;
9089 cid : string option;
9090+ uri : string;
9191 value : Jsont.json;
9292}
9393···100100101101102102type input = {
103103- repo : string; (** The handle or DID of the repo (aka, current account). *)
104103 collection : string; (** The NSID of the record collection. *)
105105- rkey : string; (** The Record Key. *)
106106- validate : bool option; (** Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. *)
107104 record : Jsont.json; (** The record to write. *)
108108- swap_record : string option; (** Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation *)
105105+ repo : string; (** The handle or DID of the repo (aka, current account). *)
106106+ rkey : string; (** The Record Key. *)
109107 swap_commit : string option; (** Compare and swap with the previous commit by CID. *)
108108+ swap_record : string option; (** Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation *)
109109+ validate : bool option; (** Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. *)
110110}
111111112112(** Jsont codec for {!type:input}. *)
···114114115115116116type output = {
117117- uri : string;
118117 cid : string;
119118 commit : Defs.commit_meta option;
119119+ uri : string;
120120 validation_status : string option;
121121}
122122···129129130130131131type input = {
132132- repo : string; (** The handle or DID of the repo (aka, current account). *)
133132 collection : string; (** The NSID of the record collection. *)
133133+ repo : string; (** The handle or DID of the repo (aka, current account). *)
134134 rkey : string; (** The Record Key. *)
135135- swap_record : string option; (** Compare and swap with the previous record by CID. *)
136135 swap_commit : string option; (** Compare and swap with the previous commit by CID. *)
136136+ swap_record : string option; (** Compare and swap with the previous record by CID. *)
137137}
138138139139(** Jsont codec for {!type:input}. *)
···153153154154155155type input = {
156156- repo : string; (** The handle or DID of the repo (aka, current account). *)
157156 collection : string; (** The NSID of the record collection. *)
158158- rkey : string option; (** The Record Key. *)
159159- validate : bool option; (** Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. *)
160157 record : Jsont.json; (** The record itself. Must contain a $type field. *)
158158+ repo : string; (** The handle or DID of the repo (aka, current account). *)
159159+ rkey : string option; (** The Record Key. *)
161160 swap_commit : string option; (** Compare and swap with the previous commit by CID. *)
161161+ validate : bool option; (** Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. *)
162162}
163163164164(** Jsont codec for {!type:input}. *)
···166166167167168168type output = {
169169- uri : string;
170169 cid : string;
171170 commit : Defs.commit_meta option;
171171+ uri : string;
172172 validation_status : string option;
173173}
174174
···1414 module Atproto : sig
1515 module Label : sig
1616 module Defs : sig
1717-(** Metadata tag on an atproto resource (eg, repo or record). *)
1818-1919-type label = {
2020- ver : int option; (** The AT Protocol version of the label object. *)
2121- src : string; (** DID of the actor who created this label. *)
2222- uri : string; (** AT URI of the record, repository (account), or other resource that this label applies to. *)
2323- cid : string option; (** Optionally, CID specifying the specific version of 'uri' resource this label applies to. *)
2424- val_ : string; (** The short string name of the value or type of this label. *)
2525- neg : bool option; (** If true, this is a negation label, overwriting a previous label. *)
2626- cts : string; (** Timestamp when this label was created. *)
2727- exp : string option; (** Timestamp at which this label expires (no longer applies). *)
2828- sig_ : string option; (** Signature of dag-cbor encoded label. *)
2929-}
3030-3131-(** Jsont codec for {!type:label}. *)
3232-val label_jsont : label Jsont.t
3333-3417(** Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel. *)
35183619type self_label = {
···4326(** Strings which describe the label in the UI, localized into a specific language. *)
44274528type label_value_definition_strings = {
2929+ description : string; (** A longer description of what the label means and why it might be applied. *)
4630 lang : string; (** The code of the language these strings are written in. *)
4731 name : string; (** A short human-readable name for the label. *)
4848- description : string; (** A longer description of what the label means and why it might be applied. *)
4932}
50335134(** Jsont codec for {!type:label_value_definition_strings}. *)
···5538type label_value = string
5639val label_value_jsont : label_value Jsont.t
57404141+(** Metadata tag on an atproto resource (eg, repo or record). *)
4242+4343+type label = {
4444+ cid : string option; (** Optionally, CID specifying the specific version of 'uri' resource this label applies to. *)
4545+ cts : string; (** Timestamp when this label was created. *)
4646+ exp : string option; (** Timestamp at which this label expires (no longer applies). *)
4747+ neg : bool option; (** If true, this is a negation label, overwriting a previous label. *)
4848+ sig_ : string option; (** Signature of dag-cbor encoded label. *)
4949+ src : string; (** DID of the actor who created this label. *)
5050+ uri : string; (** AT URI of the record, repository (account), or other resource that this label applies to. *)
5151+ val_ : string; (** The short string name of the value or type of this label. *)
5252+ ver : int option; (** The AT Protocol version of the label object. *)
5353+}
5454+5555+(** Jsont codec for {!type:label}. *)
5656+val label_jsont : label Jsont.t
5757+5858(** Metadata tags on an atproto record, published by the author within the record. *)
59596060type self_labels = {
···6767(** Declares a label value and its expected interpretations and behaviors. *)
68686969type label_value_definition = {
7070- identifier : string; (** The value of the label being defined. Must only include lowercase ascii and the '-' character (\[a-z-\]+). *)
7171- severity : string; (** How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. *)
7070+ adult_only : bool option; (** Does the user need to have adult content enabled in order to configure this label? *)
7271 blurs : string; (** What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing. *)
7372 default_setting : string option; (** The default setting for this label. *)
7474- adult_only : bool option; (** Does the user need to have adult content enabled in order to configure this label? *)
7373+ identifier : string; (** The value of the label being defined. Must only include lowercase ascii and the '-' character (\[a-z-\]+). *)
7574 locales : label_value_definition_strings list;
7575+ severity : string; (** How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. *)
7676}
77777878(** Jsont codec for {!type:label_value_definition}. *)
···8484 module StrongRef : sig
85858686type main = {
8787- uri : string;
8887 cid : string;
8888+ uri : string;
8989}
90909191(** Jsont codec for {!type:main}. *)
···9595 end
9696 module Moderation : sig
9797 module Defs : sig
9898+(** Tag describing a type of subject that might be reported. *)
9999+100100+type subject_type = string
101101+val subject_type_jsont : subject_type Jsont.t
102102+103103+(** Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`. *)
104104+105105+type reason_violation = string
106106+val reason_violation_jsont : reason_violation Jsont.t
107107+9810899109type reason_type = string
100110val reason_type_jsont : reason_type Jsont.t
···104114type reason_spam = string
105115val reason_spam_jsont : reason_spam Jsont.t
106116107107-(** Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`. *)
108108-109109-type reason_violation = string
110110-val reason_violation_jsont : reason_violation Jsont.t
111111-112112-(** Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`. *)
113113-114114-type reason_misleading = string
115115-val reason_misleading_jsont : reason_misleading Jsont.t
116116-117117(** Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`. *)
118118119119type reason_sexual = string
···128128129129type reason_other = string
130130val reason_other_jsont : reason_other Jsont.t
131131+132132+(** Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`. *)
133133+134134+type reason_misleading = string
135135+val reason_misleading_jsont : reason_misleading Jsont.t
131136132137(** Appeal a previously taken moderation action *)
133138134139type reason_appeal = string
135140val reason_appeal_jsont : reason_appeal Jsont.t
136141137137-(** Tag describing a type of subject that might be reported. *)
138138-139139-type subject_type = string
140140-val subject_type_jsont : subject_type Jsont.t
141141-142142 end
143143 end
144144 end
···165165 end
166166 module Richtext : sig
167167 module Facet : sig
168168+(** Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). *)
169169+170170+type tag = {
171171+ tag : string;
172172+}
173173+174174+(** Jsont codec for {!type:tag}. *)
175175+val tag_jsont : tag Jsont.t
176176+168177(** Facet feature for mention of another account. The text is usually a handle, including a '\@' prefix, but the facet reference is a DID. *)
169178170179type mention = {
···183192(** Jsont codec for {!type:link}. *)
184193val link_jsont : link Jsont.t
185194186186-(** Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). *)
187187-188188-type tag = {
189189- tag : string;
190190-}
191191-192192-(** Jsont codec for {!type:tag}. *)
193193-val tag_jsont : tag Jsont.t
194194-195195(** Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. *)
196196197197type byte_slice = {
198198+ byte_end : int;
198199 byte_start : int;
199199- byte_end : int;
200200}
201201202202(** Jsont codec for {!type:byte_slice}. *)
···205205(** Annotation of a sub-string within rich text. *)
206206207207type main = {
208208- index : byte_slice;
209208 features : Jsont.json list;
209209+ index : byte_slice;
210210}
211211212212(** Jsont codec for {!type:main}. *)
···240240 end
241241 module Ageassurance : sig
242242 module Defs : sig
243243-(** The access level granted based on Age Assurance data we've processed. *)
244244-245245-type access = string
246246-val access_jsont : access Jsont.t
247247-248243(** The status of the Age Assurance process. *)
249244250245type status = string
···259254(** Jsont codec for {!type:state_metadata}. *)
260255val state_metadata_jsont : state_metadata Jsont.t
261256262262-(** The Age Assurance configuration for a specific region. *)
263263-264264-type config_region = {
265265- country_code : string; (** The ISO 3166-1 alpha-2 country code this configuration applies to. *)
266266- region_code : string option; (** The ISO 3166-2 region code this configuration applies to. If omitted, the configuration applies to the entire country. *)
267267- min_access_age : int; (** The minimum age (as a whole integer) required to use Bluesky in this region. *)
268268- rules : Jsont.json list; (** The ordered list of Age Assurance rules that apply to this region. Rules should be applied in order, and the first matching rule determines the access level granted. The rules array should always include a default rule as the last item. *)
269269-}
270270-271271-(** Jsont codec for {!type:config_region}. *)
272272-val config_region_jsont : config_region Jsont.t
273273-274257(** Object used to store Age Assurance data in stash. *)
275258276259type event = {
277277- created_at : string; (** The date and time of this write operation. *)
278278- attempt_id : string; (** The unique identifier for this instance of the Age Assurance flow, in UUID format. *)
279279- status : string; (** The status of the Age Assurance process. *)
280260 access : string; (** The access level granted based on Age Assurance data we've processed. *)
261261+ attempt_id : string; (** The unique identifier for this instance of the Age Assurance flow, in UUID format. *)
262262+ complete_ip : string option; (** The IP address used when completing the Age Assurance flow. *)
263263+ complete_ua : string option; (** The user agent used when completing the Age Assurance flow. *)
281264 country_code : string; (** The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow. *)
282282- region_code : string option; (** The ISO 3166-2 region code provided when beginning the Age Assurance flow. *)
265265+ created_at : string; (** The date and time of this write operation. *)
283266 email : string option; (** The email used for Age Assurance. *)
284267 init_ip : string option; (** The IP address used when initiating the Age Assurance flow. *)
285268 init_ua : string option; (** The user agent used when initiating the Age Assurance flow. *)
286286- complete_ip : string option; (** The IP address used when completing the Age Assurance flow. *)
287287- complete_ua : string option; (** The user agent used when completing the Age Assurance flow. *)
269269+ region_code : string option; (** The ISO 3166-2 region code provided when beginning the Age Assurance flow. *)
270270+ status : string; (** The status of the Age Assurance process. *)
288271}
289272290273(** Jsont codec for {!type:event}. *)
291274val event_jsont : event Jsont.t
292275276276+(** The Age Assurance configuration for a specific region. *)
277277+278278+type config_region = {
279279+ country_code : string; (** The ISO 3166-1 alpha-2 country code this configuration applies to. *)
280280+ min_access_age : int; (** The minimum age (as a whole integer) required to use Bluesky in this region. *)
281281+ region_code : string option; (** The ISO 3166-2 region code this configuration applies to. If omitted, the configuration applies to the entire country. *)
282282+ rules : Jsont.json list; (** The ordered list of Age Assurance rules that apply to this region. Rules should be applied in order, and the first matching rule determines the access level granted. The rules array should always include a default rule as the last item. *)
283283+}
284284+285285+(** Jsont codec for {!type:config_region}. *)
286286+val config_region_jsont : config_region Jsont.t
287287+288288+(** The access level granted based on Age Assurance data we've processed. *)
289289+290290+type access = string
291291+val access_jsont : access Jsont.t
292292+293293(** The user's computed Age Assurance state. *)
294294295295type state = {
296296+ access : access;
296297 last_initiated_at : string option; (** The timestamp when this state was last updated. *)
297298 status : status;
298298- access : access;
299299}
300300301301(** Jsont codec for {!type:state}. *)
302302val state_jsont : state Jsont.t
303303304304+(** Age Assurance rule that applies if the user has declared themselves under a certain age. *)
304305305305-type config = {
306306- regions : config_region list; (** The per-region Age Assurance configuration. *)
307307-}
308308-309309-(** Jsont codec for {!type:config}. *)
310310-val config_jsont : config Jsont.t
311311-312312-(** Age Assurance rule that applies by default. *)
313313-314314-type config_region_rule_default = {
306306+type config_region_rule_if_declared_under_age = {
315307 access : access;
308308+ age : int; (** The age threshold as a whole integer. *)
316309}
317310318318-(** Jsont codec for {!type:config_region_rule_default}. *)
319319-val config_region_rule_default_jsont : config_region_rule_default Jsont.t
311311+(** Jsont codec for {!type:config_region_rule_if_declared_under_age}. *)
312312+val config_region_rule_if_declared_under_age_jsont : config_region_rule_if_declared_under_age Jsont.t
320313321314(** Age Assurance rule that applies if the user has declared themselves equal-to or over a certain age. *)
322315323316type config_region_rule_if_declared_over_age = {
324324- age : int; (** The age threshold as a whole integer. *)
325317 access : access;
318318+ age : int; (** The age threshold as a whole integer. *)
326319}
327320328321(** Jsont codec for {!type:config_region_rule_if_declared_over_age}. *)
329322val config_region_rule_if_declared_over_age_jsont : config_region_rule_if_declared_over_age Jsont.t
330323331331-(** Age Assurance rule that applies if the user has declared themselves under a certain age. *)
324324+(** Age Assurance rule that applies if the user has been assured to be under a certain age. *)
332325333333-type config_region_rule_if_declared_under_age = {
326326+type config_region_rule_if_assured_under_age = {
327327+ access : access;
334328 age : int; (** The age threshold as a whole integer. *)
335335- access : access;
336329}
337330338338-(** Jsont codec for {!type:config_region_rule_if_declared_under_age}. *)
339339-val config_region_rule_if_declared_under_age_jsont : config_region_rule_if_declared_under_age Jsont.t
331331+(** Jsont codec for {!type:config_region_rule_if_assured_under_age}. *)
332332+val config_region_rule_if_assured_under_age_jsont : config_region_rule_if_assured_under_age Jsont.t
340333341334(** Age Assurance rule that applies if the user has been assured to be equal-to or over a certain age. *)
342335343336type config_region_rule_if_assured_over_age = {
344344- age : int; (** The age threshold as a whole integer. *)
345337 access : access;
338338+ age : int; (** The age threshold as a whole integer. *)
346339}
347340348341(** Jsont codec for {!type:config_region_rule_if_assured_over_age}. *)
349342val config_region_rule_if_assured_over_age_jsont : config_region_rule_if_assured_over_age Jsont.t
350343351351-(** Age Assurance rule that applies if the user has been assured to be under a certain age. *)
344344+(** Age Assurance rule that applies if the account is older than a certain date. *)
352345353353-type config_region_rule_if_assured_under_age = {
354354- age : int; (** The age threshold as a whole integer. *)
346346+type config_region_rule_if_account_older_than = {
355347 access : access;
348348+ date : string; (** The date threshold as a datetime string. *)
356349}
357350358358-(** Jsont codec for {!type:config_region_rule_if_assured_under_age}. *)
359359-val config_region_rule_if_assured_under_age_jsont : config_region_rule_if_assured_under_age Jsont.t
351351+(** Jsont codec for {!type:config_region_rule_if_account_older_than}. *)
352352+val config_region_rule_if_account_older_than_jsont : config_region_rule_if_account_older_than Jsont.t
360353361354(** Age Assurance rule that applies if the account is equal-to or newer than a certain date. *)
362355363356type config_region_rule_if_account_newer_than = {
364364- date : string; (** The date threshold as a datetime string. *)
365357 access : access;
358358+ date : string; (** The date threshold as a datetime string. *)
366359}
367360368361(** Jsont codec for {!type:config_region_rule_if_account_newer_than}. *)
369362val config_region_rule_if_account_newer_than_jsont : config_region_rule_if_account_newer_than Jsont.t
370363371371-(** Age Assurance rule that applies if the account is older than a certain date. *)
364364+(** Age Assurance rule that applies by default. *)
372365373373-type config_region_rule_if_account_older_than = {
374374- date : string; (** The date threshold as a datetime string. *)
366366+type config_region_rule_default = {
375367 access : access;
376368}
377369378378-(** Jsont codec for {!type:config_region_rule_if_account_older_than}. *)
379379-val config_region_rule_if_account_older_than_jsont : config_region_rule_if_account_older_than Jsont.t
370370+(** Jsont codec for {!type:config_region_rule_default}. *)
371371+val config_region_rule_default_jsont : config_region_rule_default Jsont.t
372372+373373+374374+type config = {
375375+ regions : config_region list; (** The per-region Age Assurance configuration. *)
376376+}
377377+378378+(** Jsont codec for {!type:config}. *)
379379+val config_jsont : config Jsont.t
380380381381 end
382382 module Begin : sig
···384384385385386386type input = {
387387+ country_code : string; (** An ISO 3166-1 alpha-2 code of the user's location. *)
387388 email : string; (** The user's email address to receive Age Assurance instructions. *)
388389 language : string; (** The user's preferred language for communication during the Age Assurance process. *)
389389- country_code : string; (** An ISO 3166-1 alpha-2 code of the user's location. *)
390390 region_code : string option; (** An optional ISO 3166-2 code of the user's region or state within the country. *)
391391}
392392···414414415415416416type output = {
417417- state : Defs.state;
418417 metadata : Defs.state_metadata;
418418+ state : Defs.state;
419419}
420420421421(** Jsont codec for {!type:output}. *)
···445445446446447447type labeler_policies = {
448448+ label_value_definitions : Com.Atproto.Label.Defs.label_value_definition list option; (** Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. *)
448449 label_values : Com.Atproto.Label.Defs.label_value list; (** The label values which this labeler publishes. May include global or custom labels. *)
449449- label_value_definitions : Com.Atproto.Label.Defs.label_value_definition list option; (** Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. *)
450450}
451451452452(** Jsont codec for {!type:labeler_policies}. *)
453453val labeler_policies_jsont : labeler_policies Jsont.t
454454455455456456-type labeler_view = {
457457- uri : string;
456456+type labeler_view_detailed = {
458457 cid : string;
459458 creator : Jsont.json;
459459+ indexed_at : string;
460460+ labels : Com.Atproto.Label.Defs.label list option;
460461 like_count : int option;
462462+ policies : Jsont.json;
463463+ reason_types : Com.Atproto.Moderation.Defs.reason_type list option; (** The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. *)
464464+ subject_collections : string list option; (** Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. *)
465465+ subject_types : Com.Atproto.Moderation.Defs.subject_type list option; (** The set of subject types (account, record, etc) this service accepts reports on. *)
466466+ uri : string;
461467 viewer : Jsont.json option;
462462- indexed_at : string;
463463- labels : Com.Atproto.Label.Defs.label list option;
464468}
465469466466-(** Jsont codec for {!type:labeler_view}. *)
467467-val labeler_view_jsont : labeler_view Jsont.t
470470+(** Jsont codec for {!type:labeler_view_detailed}. *)
471471+val labeler_view_detailed_jsont : labeler_view_detailed Jsont.t
468472469473470470-type labeler_view_detailed = {
471471- uri : string;
474474+type labeler_view = {
472475 cid : string;
473476 creator : Jsont.json;
474474- policies : Jsont.json;
475475- like_count : int option;
476476- viewer : Jsont.json option;
477477 indexed_at : string;
478478 labels : Com.Atproto.Label.Defs.label list option;
479479- reason_types : Com.Atproto.Moderation.Defs.reason_type list option; (** The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. *)
480480- subject_types : Com.Atproto.Moderation.Defs.subject_type list option; (** The set of subject types (account, record, etc) this service accepts reports on. *)
481481- subject_collections : string list option; (** Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. *)
479479+ like_count : int option;
480480+ uri : string;
481481+ viewer : Jsont.json option;
482482}
483483484484-(** Jsont codec for {!type:labeler_view_detailed}. *)
485485-val labeler_view_detailed_jsont : labeler_view_detailed Jsont.t
484484+(** Jsont codec for {!type:labeler_view}. *)
485485+val labeler_view_jsont : labeler_view Jsont.t
486486487487 end
488488 module Service : sig
489489(** A declaration of the existence of labeler service. *)
490490491491type main = {
492492- policies : Jsont.json;
493493- labels : Com.Atproto.Label.Defs.self_labels option;
494492 created_at : string;
493493+ labels : Com.Atproto.Label.Defs.self_labels option;
494494+ policies : Jsont.json;
495495 reason_types : Com.Atproto.Moderation.Defs.reason_type list option; (** The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. *)
496496- subject_types : Com.Atproto.Moderation.Defs.subject_type list option; (** The set of subject types (account, record, etc) this service accepts reports on. *)
497496 subject_collections : string list option; (** Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. *)
497497+ subject_types : Com.Atproto.Moderation.Defs.subject_type list option; (** The set of subject types (account, record, etc) this service accepts reports on. *)
498498}
499499500500(** Jsont codec for {!type:main}. *)
···506506507507(** Query/procedure parameters. *)
508508type params = {
509509- dids : string list;
510509 detailed : bool option;
510510+ dids : string list;
511511}
512512513513(** Jsont codec for {!type:params}. *)
···536536537537type output = {
538538 can_upload : bool;
539539- remaining_daily_videos : int option;
540540- remaining_daily_bytes : int option;
541541- message : string option;
542539 error : string option;
540540+ message : string option;
541541+ remaining_daily_bytes : int option;
542542+ remaining_daily_videos : int option;
543543}
544544545545(** Jsont codec for {!type:output}. *)
···549549 module Defs : sig
550550551551type job_status = {
552552- job_id : string;
552552+ blob : Atp.Blob_ref.t option;
553553 did : string;
554554- state : string; (** The state of the video processing job. All values not listed as a known value indicate that the job is in process. *)
555555- progress : int option; (** Progress within the current processing state. *)
556556- blob : Atp.Blob_ref.t option;
557554 error : string option;
555555+ job_id : string;
558556 message : string option;
557557+ progress : int option; (** Progress within the current processing state. *)
558558+ state : string; (** The state of the video processing job. All values not listed as a known value indicate that the job is in process. *)
559559}
560560561561(** Jsont codec for {!type:job_status}. *)
···602602 module Embed : sig
603603 module External : sig
604604605605+type view_external = {
606606+ description : string;
607607+ thumb : string option;
608608+ title : string;
609609+ uri : string;
610610+}
611611+612612+(** Jsont codec for {!type:view_external}. *)
613613+val view_external_jsont : view_external Jsont.t
614614+615615+605616type external_ = {
606606- uri : string;
607607- title : string;
608617 description : string;
609618 thumb : Atp.Blob_ref.t option;
619619+ title : string;
620620+ uri : string;
610621}
611622612623(** Jsont codec for {!type:external_}. *)
613624val external__jsont : external_ Jsont.t
614625615626616616-type view_external = {
617617- uri : string;
618618- title : string;
619619- description : string;
620620- thumb : string option;
627627+type view = {
628628+ external_ : Jsont.json;
621629}
622630623623-(** Jsont codec for {!type:view_external}. *)
624624-val view_external_jsont : view_external Jsont.t
631631+(** Jsont codec for {!type:view}. *)
632632+val view_jsont : view Jsont.t
625633626634(** A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). *)
627635···632640(** Jsont codec for {!type:main}. *)
633641val main_jsont : main Jsont.t
634642635635-636636-type view = {
637637- external_ : Jsont.json;
638638-}
639639-640640-(** Jsont codec for {!type:view}. *)
641641-val view_jsont : view Jsont.t
642642-643643 end
644644 module Defs : sig
645645(** width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. *)
646646647647type aspect_ratio = {
648648- width : int;
649648 height : int;
649649+ width : int;
650650}
651651652652(** Jsont codec for {!type:aspect_ratio}. *)
···655655 end
656656 module Images : sig
657657658658+type view_image = {
659659+ alt : string; (** Alt text description of the image, for accessibility. *)
660660+ aspect_ratio : Jsont.json option;
661661+ fullsize : string; (** Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View. *)
662662+ thumb : string; (** Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. *)
663663+}
664664+665665+(** Jsont codec for {!type:view_image}. *)
666666+val view_image_jsont : view_image Jsont.t
667667+668668+658669type image = {
659659- image : Atp.Blob_ref.t;
660670 alt : string; (** Alt text description of the image, for accessibility. *)
661671 aspect_ratio : Jsont.json option;
672672+ image : Atp.Blob_ref.t;
662673}
663674664675(** Jsont codec for {!type:image}. *)
665676val image_jsont : image Jsont.t
666677667678668668-type view_image = {
669669- thumb : string; (** Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. *)
670670- fullsize : string; (** Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View. *)
671671- alt : string; (** Alt text description of the image, for accessibility. *)
672672- aspect_ratio : Jsont.json option;
679679+type view = {
680680+ images : Jsont.json list;
673681}
674682675675-(** Jsont codec for {!type:view_image}. *)
676676-val view_image_jsont : view_image Jsont.t
683683+(** Jsont codec for {!type:view}. *)
684684+val view_jsont : view Jsont.t
677685678686679687type main = {
···683691(** Jsont codec for {!type:main}. *)
684692val main_jsont : main Jsont.t
685693694694+ end
695695+ module Video : sig
686696687697type view = {
688688- images : Jsont.json list;
698698+ alt : string option;
699699+ aspect_ratio : Jsont.json option;
700700+ cid : string;
701701+ playlist : string;
702702+ thumbnail : string option;
689703}
690704691705(** Jsont codec for {!type:view}. *)
692706val view_jsont : view Jsont.t
693707694694- end
695695- module Video : sig
696708697709type caption = {
698698- lang : string;
699710 file : Atp.Blob_ref.t;
711711+ lang : string;
700712}
701713702714(** Jsont codec for {!type:caption}. *)
703715val caption_jsont : caption Jsont.t
704716705717706706-type view = {
707707- cid : string;
708708- playlist : string;
709709- thumbnail : string option;
710710- alt : string option;
711711- aspect_ratio : Jsont.json option;
712712-}
713713-714714-(** Jsont codec for {!type:view}. *)
715715-val view_jsont : view Jsont.t
716716-717717-718718type main = {
719719- video : Atp.Blob_ref.t; (** The mp4 video file. May be up to 100mb, formerly limited to 50mb. *)
720720- captions : Jsont.json list option;
721719 alt : string option; (** Alt text description of the video, for accessibility. *)
722720 aspect_ratio : Jsont.json option;
721721+ captions : Jsont.json list option;
722722+ video : Atp.Blob_ref.t; (** The mp4 video file. May be up to 100mb, formerly limited to 50mb. *)
723723}
724724725725(** Jsont codec for {!type:main}. *)
···728728 end
729729 module RecordWithMedia : sig
730730731731-type main = {
732732- record : Jsont.json;
733733- media : Jsont.json;
734734-}
735735-736736-(** Jsont codec for {!type:main}. *)
737737-val main_jsont : main Jsont.t
738738-739739-740731type view = {
741741- record : Jsont.json;
742732 media : Jsont.json;
733733+ record : Jsont.json;
743734}
744735745736(** Jsont codec for {!type:view}. *)
746737val view_jsont : view Jsont.t
747738748748- end
749749- module Record : sig
750739751740type main = {
752752- record : Com.Atproto.Repo.StrongRef.main;
741741+ media : Jsont.json;
742742+ record : Jsont.json;
753743}
754744755745(** Jsont codec for {!type:main}. *)
756746val main_jsont : main Jsont.t
757747758758-759759-type view = {
760760- record : Jsont.json;
761761-}
762762-763763-(** Jsont codec for {!type:view}. *)
764764-val view_jsont : view Jsont.t
765765-748748+ end
749749+ module Record : sig
766750767751type view_record = {
768768- uri : string;
769769- cid : string;
770752 author : Jsont.json;
771771- value : Jsont.json; (** The record data itself. *)
753753+ cid : string;
754754+ embeds : Jsont.json list option;
755755+ indexed_at : string;
772756 labels : Com.Atproto.Label.Defs.label list option;
773773- reply_count : int option;
774774- repost_count : int option;
775757 like_count : int option;
776758 quote_count : int option;
777777- embeds : Jsont.json list option;
778778- indexed_at : string;
759759+ reply_count : int option;
760760+ repost_count : int option;
761761+ uri : string;
762762+ value : Jsont.json; (** The record data itself. *)
779763}
780764781765(** Jsont codec for {!type:view_record}. *)
···783767784768785769type view_not_found = {
786786- uri : string;
787770 not_found : bool;
771771+ uri : string;
788772}
789773790774(** Jsont codec for {!type:view_not_found}. *)
791775val view_not_found_jsont : view_not_found Jsont.t
792776793777778778+type view_detached = {
779779+ detached : bool;
780780+ uri : string;
781781+}
782782+783783+(** Jsont codec for {!type:view_detached}. *)
784784+val view_detached_jsont : view_detached Jsont.t
785785+786786+794787type view_blocked = {
788788+ author : Jsont.json;
789789+ blocked : bool;
795790 uri : string;
796796- blocked : bool;
797797- author : Jsont.json;
798791}
799792800793(** Jsont codec for {!type:view_blocked}. *)
801794val view_blocked_jsont : view_blocked Jsont.t
802795803796804804-type view_detached = {
805805- uri : string;
806806- detached : bool;
797797+type view = {
798798+ record : Jsont.json;
807799}
808800809809-(** Jsont codec for {!type:view_detached}. *)
810810-val view_detached_jsont : view_detached Jsont.t
801801+(** Jsont codec for {!type:view}. *)
802802+val view_jsont : view Jsont.t
803803+804804+805805+type main = {
806806+ record : Com.Atproto.Repo.StrongRef.main;
807807+}
808808+809809+(** Jsont codec for {!type:main}. *)
810810+val main_jsont : main Jsont.t
811811812812 end
813813 end
···829829830830831831type input = {
832832+ age_restricted : bool option; (** Set to true when the actor is age restricted *)
833833+ app_id : string;
834834+ platform : string;
832835 service_did : string;
833836 token : string;
834834- platform : string;
835835- app_id : string;
836836- age_restricted : bool option; (** Set to true when the actor is age restricted *)
837837}
838838839839(** Jsont codec for {!type:input}. *)
···843843 module ListNotifications : sig
844844845845type notification = {
846846- uri : string;
846846+ author : Jsont.json;
847847 cid : string;
848848- author : Jsont.json;
848848+ indexed_at : string;
849849+ is_read : bool;
850850+ labels : Com.Atproto.Label.Defs.label list option;
849851 reason : string; (** The reason why this notification was delivered - e.g. your post was liked, or you received a new follower. *)
850852 reason_subject : string option;
851853 record : Jsont.json;
852852- is_read : bool;
853853- indexed_at : string;
854854- labels : Com.Atproto.Label.Defs.label list option;
854854+ uri : string;
855855}
856856857857(** Jsont codec for {!type:notification}. *)
···861861862862(** Query/procedure parameters. *)
863863type params = {
864864- reasons : string list option; (** Notification reasons to include in response. *)
864864+ cursor : string option;
865865 limit : int option;
866866 priority : bool option;
867867- cursor : string option;
867867+ reasons : string list option; (** Notification reasons to include in response. *)
868868 seen_at : string option;
869869}
870870···909909910910911911type input = {
912912+ app_id : string;
913913+ platform : string;
912914 service_did : string;
913915 token : string;
914914- platform : string;
915915- app_id : string;
916916}
917917918918(** Jsont codec for {!type:input}. *)
···939939val record_deleted_jsont : record_deleted Jsont.t
940940941941942942-type chat_preference = {
943943- include_ : string;
942942+type preference = {
943943+ list_ : bool;
944944 push : bool;
945945}
946946947947-(** Jsont codec for {!type:chat_preference}. *)
948948-val chat_preference_jsont : chat_preference Jsont.t
947947+(** Jsont codec for {!type:preference}. *)
948948+val preference_jsont : preference Jsont.t
949949950950951951type filterable_preference = {
···958958val filterable_preference_jsont : filterable_preference Jsont.t
959959960960961961-type preference = {
962962- list_ : bool;
961961+type chat_preference = {
962962+ include_ : string;
963963 push : bool;
964964}
965965966966-(** Jsont codec for {!type:preference}. *)
967967-val preference_jsont : preference Jsont.t
966966+(** Jsont codec for {!type:chat_preference}. *)
967967+val chat_preference_jsont : chat_preference Jsont.t
968968969969970970type activity_subscription = {
···974974975975(** Jsont codec for {!type:activity_subscription}. *)
976976val activity_subscription_jsont : activity_subscription Jsont.t
977977+978978+(** Object used to store activity subscription data in stash. *)
979979+980980+type subject_activity_subscription = {
981981+ activity_subscription : Jsont.json;
982982+ subject : string;
983983+}
984984+985985+(** Jsont codec for {!type:subject_activity_subscription}. *)
986986+val subject_activity_subscription_jsont : subject_activity_subscription Jsont.t
977987978988979989type preferences = {
···9951005(** Jsont codec for {!type:preferences}. *)
9961006val preferences_jsont : preferences Jsont.t
9971007998998-(** Object used to store activity subscription data in stash. *)
999999-10001000-type subject_activity_subscription = {
10011001- subject : string;
10021002- activity_subscription : Jsont.json;
10031003-}
10041004-10051005-(** Jsont codec for {!type:subject_activity_subscription}. *)
10061006-val subject_activity_subscription_jsont : subject_activity_subscription Jsont.t
10071007-10081008 end
10091009 module Declaration : sig
10101010(** A declaration of the user's choices related to notifications that can be produced by them. *)
···1022102210231023(** Query/procedure parameters. *)
10241024type params = {
10251025- limit : int option;
10261025 cursor : string option;
10261026+ limit : int option;
10271027}
1028102810291029(** Jsont codec for {!type:params}. *)
···106210621063106310641064type input = {
10651065- subject : string;
10661065 activity_subscription : Jsont.json;
10661066+ subject : string;
10671067}
1068106810691069(** Jsont codec for {!type:input}. *)
···107110711072107210731073type output = {
10741074- subject : string;
10751074 activity_subscription : Jsont.json option;
10751075+ subject : string;
10761076}
1077107710781078(** Jsont codec for {!type:output}. *)
···11221122(** A declaration of a Bluesky account status. *)
1123112311241124type main = {
11251125- status : string; (** The status for the account. *)
11261126- embed : Jsont.json option; (** An optional embed associated with the status. *)
11271127- duration_minutes : int option; (** The duration of the status in minutes. Applications can choose to impose minimum and maximum limits. *)
11281125 created_at : string;
11261126+ duration_minutes : int option; (** The duration of the status in minutes. Applications can choose to impose minimum and maximum limits. *)
11271127+ embed : Jsont.json option; (** An optional embed associated with the status. *)
11281128+ status : string; (** The status for the account. *)
11291129}
1130113011311131(** Jsont codec for {!type:main}. *)
···11361136(** A declaration of a Bluesky account profile. *)
1137113711381138type main = {
11391139- display_name : string option;
11401140- description : string option; (** Free-form profile description text. *)
11411141- pronouns : string option; (** Free-form pronouns text. *)
11421142- website : string option;
11431139 avatar : Atp.Blob_ref.t option; (** Small image to be displayed next to posts from account. AKA, 'profile picture' *)
11441140 banner : Atp.Blob_ref.t option; (** Larger horizontal image to display behind profile view. *)
11411141+ created_at : string option;
11421142+ description : string option; (** Free-form profile description text. *)
11431143+ display_name : string option;
11441144+ joined_via_starter_pack : Com.Atproto.Repo.StrongRef.main option;
11451145 labels : Com.Atproto.Label.Defs.self_labels option; (** Self-label values, specific to the Bluesky application, on the overall account. *)
11461146- joined_via_starter_pack : Com.Atproto.Repo.StrongRef.main option;
11471146 pinned_post : Com.Atproto.Repo.StrongRef.main option;
11481148- created_at : string option;
11471147+ pronouns : string option; (** Free-form pronouns text. *)
11481148+ website : string option;
11491149}
1150115011511151(** Jsont codec for {!type:main}. *)
···1153115311541154 end
11551155 module Defs : sig
11561156-11571157-type profile_associated_chat = {
11581158- allow_incoming : string;
11591159-}
11601160-11611161-(** Jsont codec for {!type:profile_associated_chat}. *)
11621162-val profile_associated_chat_jsont : profile_associated_chat Jsont.t
11631163-11641164-11651165-type profile_associated_activity_subscription = {
11661166- allow_subscriptions : string;
11671167-}
11681168-11691169-(** Jsont codec for {!type:profile_associated_activity_subscription}. *)
11701170-val profile_associated_activity_subscription_jsont : profile_associated_activity_subscription Jsont.t
11711171-11721156(** An individual verification for an associated subject. *)
1173115711741158type verification_view = {
11591159+ created_at : string; (** Timestamp when the verification was created. *)
11601160+ is_valid : bool; (** True if the verification passes validation, otherwise false. *)
11751161 issuer : string; (** The user who issued this verification. *)
11761162 uri : string; (** The AT-URI of the verification record. *)
11771177- is_valid : bool; (** True if the verification passes validation, otherwise false. *)
11781178- created_at : string; (** Timestamp when the verification was created. *)
11791163}
1180116411811165(** Jsont codec for {!type:verification_view}. *)
11821166val verification_view_jsont : verification_view Jsont.t
1183116711681168+(** Preferences for how verified accounts appear in the app. *)
1184116911851185-type preferences = Jsont.json list
11861186-val preferences_jsont : preferences Jsont.t
11871187-11881188-11891189-type adult_content_pref = {
11901190- enabled : bool;
11701170+type verification_prefs = {
11711171+ hide_badges : bool option; (** Hide the blue check badges for verified accounts and trusted verifiers. *)
11911172}
1192117311931193-(** Jsont codec for {!type:adult_content_pref}. *)
11941194-val adult_content_pref_jsont : adult_content_pref Jsont.t
11741174+(** Jsont codec for {!type:verification_prefs}. *)
11751175+val verification_prefs_jsont : verification_prefs Jsont.t
119511761196117711971197-type content_label_pref = {
11981198- labeler_did : string option; (** Which labeler does this preference apply to? If undefined, applies globally. *)
11991199- label : string;
12001200- visibility : string;
11781178+type thread_view_pref = {
11791179+ sort : string option; (** Sorting mode for threads. *)
12011180}
1202118112031203-(** Jsont codec for {!type:content_label_pref}. *)
12041204-val content_label_pref_jsont : content_label_pref Jsont.t
11821182+(** Jsont codec for {!type:thread_view_pref}. *)
11831183+val thread_view_pref_jsont : thread_view_pref Jsont.t
120511841206118512071207-type saved_feed = {
12081208- id : string;
12091209- type_ : string;
12101210- value : string;
12111211- pinned : bool;
11861186+type status_view = {
11871187+ cid : string option;
11881188+ embed : Jsont.json option; (** An optional embed associated with the status. *)
11891189+ expires_at : string option; (** The date when this status will expire. The application might choose to no longer return the status after expiration. *)
11901190+ is_active : bool option; (** True if the status is not expired, false if it is expired. Only present if expiration was set. *)
11911191+ is_disabled : bool option; (** True if the user's go-live access has been disabled by a moderator, false otherwise. *)
11921192+ record : Jsont.json;
11931193+ status : string; (** The status for the account. *)
11941194+ uri : string option;
12121195}
1213119612141214-(** Jsont codec for {!type:saved_feed}. *)
12151215-val saved_feed_jsont : saved_feed Jsont.t
11971197+(** Jsont codec for {!type:status_view}. *)
11981198+val status_view_jsont : status_view Jsont.t
121611991217120012181201type saved_feeds_pref = {
···12251208val saved_feeds_pref_jsont : saved_feeds_pref Jsont.t
122612091227121012281228-type personal_details_pref = {
12291229- birth_date : string option; (** The birth date of account owner. *)
12111211+type saved_feed = {
12121212+ id : string;
12131213+ pinned : bool;
12141214+ type_ : string;
12151215+ value : string;
12301216}
1231121712321232-(** Jsont codec for {!type:personal_details_pref}. *)
12331233-val personal_details_pref_jsont : personal_details_pref Jsont.t
12181218+(** Jsont codec for {!type:saved_feed}. *)
12191219+val saved_feed_jsont : saved_feed Jsont.t
1234122012351235-(** Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration. *)
1236122112371237-type declared_age_pref = {
12381238- is_over_age13 : bool option; (** Indicates if the user has declared that they are over 13 years of age. *)
12391239- is_over_age16 : bool option; (** Indicates if the user has declared that they are over 16 years of age. *)
12401240- is_over_age18 : bool option; (** Indicates if the user has declared that they are over 18 years of age. *)
12221222+type profile_associated_chat = {
12231223+ allow_incoming : string;
12411224}
1242122512431243-(** Jsont codec for {!type:declared_age_pref}. *)
12441244-val declared_age_pref_jsont : declared_age_pref Jsont.t
12261226+(** Jsont codec for {!type:profile_associated_chat}. *)
12271227+val profile_associated_chat_jsont : profile_associated_chat Jsont.t
124512281246122912471247-type feed_view_pref = {
12481248- feed : string; (** The URI of the feed, or an identifier which describes the feed. *)
12491249- hide_replies : bool option; (** Hide replies in the feed. *)
12501250- hide_replies_by_unfollowed : bool option; (** Hide replies in the feed if they are not by followed users. *)
12511251- hide_replies_by_like_count : int option; (** Hide replies in the feed if they do not have this number of likes. *)
12521252- hide_reposts : bool option; (** Hide reposts in the feed. *)
12531253- hide_quote_posts : bool option; (** Hide quote posts in the feed. *)
12301230+type profile_associated_activity_subscription = {
12311231+ allow_subscriptions : string;
12541232}
1255123312561256-(** Jsont codec for {!type:feed_view_pref}. *)
12571257-val feed_view_pref_jsont : feed_view_pref Jsont.t
12341234+(** Jsont codec for {!type:profile_associated_activity_subscription}. *)
12351235+val profile_associated_activity_subscription_jsont : profile_associated_activity_subscription Jsont.t
125812361259123712601260-type thread_view_pref = {
12611261- sort : string option; (** Sorting mode for threads. *)
12381238+type preferences = Jsont.json list
12391239+val preferences_jsont : preferences Jsont.t
12401240+12411241+(** Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly. *)
12421242+12431243+type post_interaction_settings_pref = {
12441244+ postgate_embedding_rules : Jsont.json list option; (** Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed. *)
12451245+ threadgate_allow_rules : Jsont.json list option; (** Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply. *)
12621246}
1263124712641264-(** Jsont codec for {!type:thread_view_pref}. *)
12651265-val thread_view_pref_jsont : thread_view_pref Jsont.t
12481248+(** Jsont codec for {!type:post_interaction_settings_pref}. *)
12491249+val post_interaction_settings_pref_jsont : post_interaction_settings_pref Jsont.t
126612501267125112681268-type interests_pref = {
12691269- tags : string list; (** A list of tags which describe the account owner's interests gathered during onboarding. *)
12521252+type personal_details_pref = {
12531253+ birth_date : string option; (** The birth date of account owner. *)
12701254}
1271125512721272-(** Jsont codec for {!type:interests_pref}. *)
12731273-val interests_pref_jsont : interests_pref Jsont.t
12561256+(** Jsont codec for {!type:personal_details_pref}. *)
12571257+val personal_details_pref_jsont : personal_details_pref Jsont.t
1274125812591259+(** A new user experiences (NUX) storage object *)
1275126012761276-type muted_word_target = string
12771277-val muted_word_target_jsont : muted_word_target Jsont.t
12611261+type nux = {
12621262+ completed : bool;
12631263+ data : string option; (** Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. *)
12641264+ expires_at : string option; (** The date and time at which the NUX will expire and should be considered completed. *)
12651265+ id : string;
12661266+}
1278126712681268+(** Jsont codec for {!type:nux}. *)
12691269+val nux_jsont : nux Jsont.t
1279127012801280-type hidden_posts_pref = {
12811281- items : string list; (** A list of URIs of posts the account owner has hidden. *)
12821282-}
1283127112841284-(** Jsont codec for {!type:hidden_posts_pref}. *)
12851285-val hidden_posts_pref_jsont : hidden_posts_pref Jsont.t
12721272+type muted_word_target = string
12731273+val muted_word_target_jsont : muted_word_target Jsont.t
128612741287127512881276type labeler_pref_item = {
···12921280(** Jsont codec for {!type:labeler_pref_item}. *)
12931281val labeler_pref_item_jsont : labeler_pref_item Jsont.t
1294128212951295-(** If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress. *)
1296128312971297-type bsky_app_progress_guide = {
12981298- guide : string;
12841284+type interests_pref = {
12851285+ tags : string list; (** A list of tags which describe the account owner's interests gathered during onboarding. *)
12991286}
1300128713011301-(** Jsont codec for {!type:bsky_app_progress_guide}. *)
13021302-val bsky_app_progress_guide_jsont : bsky_app_progress_guide Jsont.t
12881288+(** Jsont codec for {!type:interests_pref}. *)
12891289+val interests_pref_jsont : interests_pref Jsont.t
1303129013041304-(** A new user experiences (NUX) storage object *)
1305129113061306-type nux = {
13071307- id : string;
13081308- completed : bool;
13091309- data : string option; (** Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. *)
13101310- expires_at : string option; (** The date and time at which the NUX will expire and should be considered completed. *)
12921292+type hidden_posts_pref = {
12931293+ items : string list; (** A list of URIs of posts the account owner has hidden. *)
13111294}
1312129513131313-(** Jsont codec for {!type:nux}. *)
13141314-val nux_jsont : nux Jsont.t
12961296+(** Jsont codec for {!type:hidden_posts_pref}. *)
12971297+val hidden_posts_pref_jsont : hidden_posts_pref Jsont.t
1315129813161316-(** Preferences for how verified accounts appear in the app. *)
12991299+13001300+type feed_view_pref = {
13011301+ feed : string; (** The URI of the feed, or an identifier which describes the feed. *)
13021302+ hide_quote_posts : bool option; (** Hide quote posts in the feed. *)
13031303+ hide_replies : bool option; (** Hide replies in the feed. *)
13041304+ hide_replies_by_like_count : int option; (** Hide replies in the feed if they do not have this number of likes. *)
13051305+ hide_replies_by_unfollowed : bool option; (** Hide replies in the feed if they are not by followed users. *)
13061306+ hide_reposts : bool option; (** Hide reposts in the feed. *)
13071307+}
13081308+13091309+(** Jsont codec for {!type:feed_view_pref}. *)
13101310+val feed_view_pref_jsont : feed_view_pref Jsont.t
13111311+13121312+(** Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration. *)
1317131313181318-type verification_prefs = {
13191319- hide_badges : bool option; (** Hide the blue check badges for verified accounts and trusted verifiers. *)
13141314+type declared_age_pref = {
13151315+ is_over_age13 : bool option; (** Indicates if the user has declared that they are over 13 years of age. *)
13161316+ is_over_age16 : bool option; (** Indicates if the user has declared that they are over 16 years of age. *)
13171317+ is_over_age18 : bool option; (** Indicates if the user has declared that they are over 18 years of age. *)
13201318}
1321131913221322-(** Jsont codec for {!type:verification_prefs}. *)
13231323-val verification_prefs_jsont : verification_prefs Jsont.t
13201320+(** Jsont codec for {!type:declared_age_pref}. *)
13211321+val declared_age_pref_jsont : declared_age_pref Jsont.t
1324132213251325-(** Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly. *)
1326132313271327-type post_interaction_settings_pref = {
13281328- threadgate_allow_rules : Jsont.json list option; (** Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply. *)
13291329- postgate_embedding_rules : Jsont.json list option; (** Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed. *)
13241324+type content_label_pref = {
13251325+ label : string;
13261326+ labeler_did : string option; (** Which labeler does this preference apply to? If undefined, applies globally. *)
13271327+ visibility : string;
13301328}
1331132913321332-(** Jsont codec for {!type:post_interaction_settings_pref}. *)
13331333-val post_interaction_settings_pref_jsont : post_interaction_settings_pref Jsont.t
13301330+(** Jsont codec for {!type:content_label_pref}. *)
13311331+val content_label_pref_jsont : content_label_pref Jsont.t
1334133213331333+(** If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress. *)
1335133413361336-type status_view = {
13371337- uri : string option;
13381338- cid : string option;
13391339- status : string; (** The status for the account. *)
13401340- record : Jsont.json;
13411341- embed : Jsont.json option; (** An optional embed associated with the status. *)
13421342- expires_at : string option; (** The date when this status will expire. The application might choose to no longer return the status after expiration. *)
13431343- is_active : bool option; (** True if the status is not expired, false if it is expired. Only present if expiration was set. *)
13441344- is_disabled : bool option; (** True if the user's go-live access has been disabled by a moderator, false otherwise. *)
13351335+type bsky_app_progress_guide = {
13361336+ guide : string;
13451337}
1346133813471347-(** Jsont codec for {!type:status_view}. *)
13481348-val status_view_jsont : status_view Jsont.t
13391339+(** Jsont codec for {!type:bsky_app_progress_guide}. *)
13401340+val bsky_app_progress_guide_jsont : bsky_app_progress_guide Jsont.t
134913411350134213511351-type profile_associated = {
13521352- lists : int option;
13531353- feedgens : int option;
13541354- starter_packs : int option;
13551355- labeler : bool option;
13561356- chat : Jsont.json option;
13571357- activity_subscription : Jsont.json option;
13431343+type adult_content_pref = {
13441344+ enabled : bool;
13581345}
1359134613601360-(** Jsont codec for {!type:profile_associated}. *)
13611361-val profile_associated_jsont : profile_associated Jsont.t
13471347+(** Jsont codec for {!type:adult_content_pref}. *)
13481348+val adult_content_pref_jsont : adult_content_pref Jsont.t
1362134913631350(** Represents the verification information about the user this object is attached to. *)
1364135113651352type verification_state = {
13531353+ trusted_verifier_status : string; (** The user's status as a trusted verifier. *)
13661354 verifications : Jsont.json list; (** All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included. *)
13671355 verified_status : string; (** The user's status as a verified account. *)
13681368- trusted_verifier_status : string; (** The user's status as a trusted verifier. *)
13691356}
1370135713711358(** Jsont codec for {!type:verification_state}. *)
···13791366(** Jsont codec for {!type:saved_feeds_pref_v2}. *)
13801367val saved_feeds_pref_v2_jsont : saved_feeds_pref_v2 Jsont.t
1381136813691369+13701370+type profile_associated = {
13711371+ activity_subscription : Jsont.json option;
13721372+ chat : Jsont.json option;
13731373+ feedgens : int option;
13741374+ labeler : bool option;
13751375+ lists : int option;
13761376+ starter_packs : int option;
13771377+}
13781378+13791379+(** Jsont codec for {!type:profile_associated}. *)
13801380+val profile_associated_jsont : profile_associated Jsont.t
13811381+13821382(** A word that the account owner has muted. *)
1383138313841384type muted_word = {
13851385+ actor_target : string option; (** Groups of users to apply the muted word to. If undefined, applies to all users. *)
13861386+ expires_at : string option; (** The date and time at which the muted word will expire and no longer be applied. *)
13851387 id : string option;
13861386- value : string; (** The muted word itself. *)
13871388 targets : Jsont.json list; (** The intended targets of the muted word. *)
13881388- actor_target : string option; (** Groups of users to apply the muted word to. If undefined, applies to all users. *)
13891389- expires_at : string option; (** The date and time at which the muted word will expire and no longer be applied. *)
13891389+ value : string; (** The muted word itself. *)
13901390}
1391139113921392(** Jsont codec for {!type:muted_word}. *)
···1404140414051405type bsky_app_state_pref = {
14061406 active_progress_guide : Jsont.json option;
14071407- queued_nudges : string list option; (** An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. *)
14081407 nuxs : Jsont.json list option; (** Storage for NUXs the user has encountered. *)
14081408+ queued_nudges : string list option; (** An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. *)
14091409}
1410141014111411(** Jsont codec for {!type:bsky_app_state_pref}. *)
···14191419(** Jsont codec for {!type:muted_words_pref}. *)
14201420val muted_words_pref_jsont : muted_words_pref Jsont.t
1421142114221422+(** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. *)
1422142314231423-type profile_view_basic = {
14241424- did : string;
14251425- handle : string;
14261426- display_name : string option;
14271427- pronouns : string option;
14281428- avatar : string option;
14291429- associated : Jsont.json option;
14301430- viewer : Jsont.json option;
14311431- labels : Com.Atproto.Label.Defs.label list option;
14321432- created_at : string option;
14331433- verification : Jsont.json option;
14341434- status : Jsont.json option;
14351435- debug : Jsont.json option; (** Debug information for internal development *)
14241424+type viewer_state = {
14251425+ activity_subscription : Jsont.json option; (** This property is present only in selected cases, as an optimization. *)
14261426+ blocked_by : bool option;
14271427+ blocking : string option;
14281428+ blocking_by_list : Jsont.json option;
14291429+ followed_by : string option;
14301430+ following : string option;
14311431+ known_followers : Jsont.json option; (** This property is present only in selected cases, as an optimization. *)
14321432+ muted : bool option;
14331433+ muted_by_list : Jsont.json option;
14361434}
1437143514381438-(** Jsont codec for {!type:profile_view_basic}. *)
14391439-val profile_view_basic_jsont : profile_view_basic Jsont.t
14361436+(** Jsont codec for {!type:viewer_state}. *)
14371437+val viewer_state_jsont : viewer_state Jsont.t
144014381441143914421442-type profile_view = {
14431443- did : string;
14441444- handle : string;
14451445- display_name : string option;
14461446- pronouns : string option;
14471447- description : string option;
14481448- avatar : string option;
14401440+type profile_view_detailed = {
14491441 associated : Jsont.json option;
14501450- indexed_at : string option;
14421442+ avatar : string option;
14431443+ banner : string option;
14511444 created_at : string option;
14521452- viewer : Jsont.json option;
14531453- labels : Com.Atproto.Label.Defs.label list option;
14541454- verification : Jsont.json option;
14551455- status : Jsont.json option;
14561445 debug : Jsont.json option; (** Debug information for internal development *)
14571457-}
14581458-14591459-(** Jsont codec for {!type:profile_view}. *)
14601460-val profile_view_jsont : profile_view Jsont.t
14611461-14621462-14631463-type profile_view_detailed = {
14461446+ description : string option;
14641447 did : string;
14651465- handle : string;
14661448 display_name : string option;
14671467- description : string option;
14681468- pronouns : string option;
14691469- website : string option;
14701470- avatar : string option;
14711471- banner : string option;
14721449 followers_count : int option;
14731450 follows_count : int option;
14741474- posts_count : int option;
14751475- associated : Jsont.json option;
14761476- joined_via_starter_pack : Jsont.json option;
14511451+ handle : string;
14771452 indexed_at : string option;
14781478- created_at : string option;
14791479- viewer : Jsont.json option;
14531453+ joined_via_starter_pack : Jsont.json option;
14801454 labels : Com.Atproto.Label.Defs.label list option;
14811455 pinned_post : Com.Atproto.Repo.StrongRef.main option;
14821482- verification : Jsont.json option;
14561456+ posts_count : int option;
14571457+ pronouns : string option;
14831458 status : Jsont.json option;
14841484- debug : Jsont.json option; (** Debug information for internal development *)
14591459+ verification : Jsont.json option;
14601460+ viewer : Jsont.json option;
14611461+ website : string option;
14851462}
1486146314871464(** Jsont codec for {!type:profile_view_detailed}. *)
14881465val profile_view_detailed_jsont : profile_view_detailed Jsont.t
1489146614901490-(** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. *)
1491146714921492-type viewer_state = {
14931493- muted : bool option;
14941494- muted_by_list : Jsont.json option;
14951495- blocked_by : bool option;
14961496- blocking : string option;
14971497- blocking_by_list : Jsont.json option;
14981498- following : string option;
14991499- followed_by : string option;
15001500- known_followers : Jsont.json option; (** This property is present only in selected cases, as an optimization. *)
15011501- activity_subscription : Jsont.json option; (** This property is present only in selected cases, as an optimization. *)
14681468+type profile_view_basic = {
14691469+ associated : Jsont.json option;
14701470+ avatar : string option;
14711471+ created_at : string option;
14721472+ debug : Jsont.json option; (** Debug information for internal development *)
14731473+ did : string;
14741474+ display_name : string option;
14751475+ handle : string;
14761476+ labels : Com.Atproto.Label.Defs.label list option;
14771477+ pronouns : string option;
14781478+ status : Jsont.json option;
14791479+ verification : Jsont.json option;
14801480+ viewer : Jsont.json option;
15021481}
1503148215041504-(** Jsont codec for {!type:viewer_state}. *)
15051505-val viewer_state_jsont : viewer_state Jsont.t
14831483+(** Jsont codec for {!type:profile_view_basic}. *)
14841484+val profile_view_basic_jsont : profile_view_basic Jsont.t
14851485+14861486+14871487+type profile_view = {
14881488+ associated : Jsont.json option;
14891489+ avatar : string option;
14901490+ created_at : string option;
14911491+ debug : Jsont.json option; (** Debug information for internal development *)
14921492+ description : string option;
14931493+ did : string;
14941494+ display_name : string option;
14951495+ handle : string;
14961496+ indexed_at : string option;
14971497+ labels : Com.Atproto.Label.Defs.label list option;
14981498+ pronouns : string option;
14991499+ status : Jsont.json option;
15001500+ verification : Jsont.json option;
15011501+ viewer : Jsont.json option;
15021502+}
15031503+15041504+(** Jsont codec for {!type:profile_view}. *)
15051505+val profile_view_jsont : profile_view Jsont.t
1506150615071507(** The subject's followers whom you also follow *)
15081508···1538153815391539(** Query/procedure parameters. *)
15401540type params = {
15411541- term : string option; (** DEPRECATED: use 'q' instead. *)
15421542- q : string option; (** Search query prefix; not a full query string. *)
15431541 limit : int option;
15421542+ q : string option; (** Search query prefix; not a full query string. *)
15431543+ term : string option; (** DEPRECATED: use 'q' instead. *)
15441544}
1545154515461546(** Jsont codec for {!type:params}. *)
···1578157815791579(** Query/procedure parameters. *)
15801580type params = {
15811581- term : string option; (** DEPRECATED: use 'q' instead. *)
15811581+ cursor : string option;
15821582+ limit : int option;
15821583 q : string option; (** Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. *)
15831583- limit : int option;
15841584- cursor : string option;
15841584+ term : string option; (** DEPRECATED: use 'q' instead. *)
15851585}
1586158615871587(** Jsont codec for {!type:params}. *)
···158915891590159015911591type output = {
15921592- cursor : string option;
15931592 actors : Jsont.json list;
15931593+ cursor : string option;
15941594}
1595159515961596(** Jsont codec for {!type:output}. *)
···1602160216031603(** Query/procedure parameters. *)
16041604type params = {
16051605+ cursor : string option;
16051606 limit : int option;
16061606- cursor : string option;
16071607}
1608160816091609(** Jsont codec for {!type:params}. *)
···161116111612161216131613type output = {
16141614- cursor : string option;
16151614 actors : Jsont.json list;
16151615+ cursor : string option;
16161616 rec_id : int option; (** Snowflake for this recommendation, use when submitting recommendation events. *)
16171617}
16181618···16551655 end
16561656 module Contact : sig
16571657 module Defs : sig
16581658-(** Associates a profile with the positional index of the contact import input in the call to `app.bsky.contact.importContacts`, so clients can know which phone caused a particular match. *)
16591659-16601660-type match_and_contact_index = {
16611661- match_ : Jsont.json; (** Profile of the matched user. *)
16621662- contact_index : int; (** The index of this match in the import contact input. *)
16631663-}
16641664-16651665-(** Jsont codec for {!type:match_and_contact_index}. *)
16661666-val match_and_contact_index_jsont : match_and_contact_index Jsont.t
16671667-1668165816691659type sync_status = {
16701670- synced_at : string; (** Last date when contacts where imported. *)
16711660 matches_count : int; (** Number of existing contact matches resulting of the user imports and of their imported contacts having imported the user. Matches stop being counted when the user either follows the matched contact or dismisses the match. *)
16611661+ synced_at : string; (** Last date when contacts where imported. *)
16721662}
1673166316741664(** Jsont codec for {!type:sync_status}. *)
···16841674(** Jsont codec for {!type:notification}. *)
16851675val notification_jsont : notification Jsont.t
1686167616771677+(** Associates a profile with the positional index of the contact import input in the call to `app.bsky.contact.importContacts`, so clients can know which phone caused a particular match. *)
16781678+16791679+type match_and_contact_index = {
16801680+ contact_index : int; (** The index of this match in the import contact input. *)
16811681+ match_ : Jsont.json; (** Profile of the matched user. *)
16821682+}
16831683+16841684+(** Jsont codec for {!type:match_and_contact_index}. *)
16851685+val match_and_contact_index_jsont : match_and_contact_index Jsont.t
16861686+16871687 end
16881688 module RemoveData : sig
16891689(** Removes all stored hashes used for contact matching, existing matches, and sync status. Requires authentication. *)
···1724172417251725(** Query/procedure parameters. *)
17261726type params = {
17271727- limit : int option;
17281727 cursor : string option;
17281728+ limit : int option;
17291729}
1730173017311731(** Jsont codec for {!type:params}. *)
···174617461747174717481748type input = {
17491749- phone : string; (** The phone number to verify. Should be the same as the one passed to `app.bsky.contact.startPhoneVerification`. *)
17501749 code : string; (** The code received via SMS as a result of the call to `app.bsky.contact.startPhoneVerification`. *)
17501750+ phone : string; (** The phone number to verify. Should be the same as the one passed to `app.bsky.contact.startPhoneVerification`. *)
17511751}
1752175217531753(** Jsont codec for {!type:input}. *)
···182218221823182318241824type input = {
18251825- token : string; (** JWT to authenticate the call. Use the JWT received as a response to the call to `app.bsky.contact.verifyPhone`. *)
18261825 contacts : string list; (** List of phone numbers in global E.164 format (e.g., '+12125550123'). Phone numbers that cannot be normalized into a valid phone number will be discarded. Should not repeat the 'phone' input used in `app.bsky.contact.verifyPhone`. *)
18261826+ token : string; (** JWT to authenticate the call. Use the JWT received as a response to the call to `app.bsky.contact.verifyPhone`. *)
18271827}
1828182818291829(** Jsont codec for {!type:input}. *)
···18521852(** Record defining a starter pack of actors and feeds for new users. *)
1853185318541854type main = {
18551855- name : string; (** Display name for starter pack; can not be empty. *)
18551855+ created_at : string;
18561856 description : string option;
18571857 description_facets : Richtext.Facet.main list option;
18581858- list_ : string; (** Reference (AT-URI) to the list record. *)
18591858 feeds : Jsont.json list option;
18601860- created_at : string;
18591859+ list_ : string; (** Reference (AT-URI) to the list record. *)
18601860+ name : string; (** Display name for starter pack; can not be empty. *)
18611861}
1862186218631863(** Jsont codec for {!type:main}. *)
···18701870(** Query/procedure parameters. *)
18711871type params = {
18721872 actor : string;
18731873- limit : int option;
18741873 cursor : string option;
18741874+ limit : int option;
18751875}
1876187618771877(** Jsont codec for {!type:params}. *)
···187918791880188018811881type output = {
18821882- subject : Jsont.json;
18831882 cursor : string option;
18841883 follows : Jsont.json list;
18841884+ subject : Jsont.json;
18851885}
1886188618871887(** Jsont codec for {!type:output}. *)
···190119011902190219031903type output = {
19041904- suggestions : Jsont.json list;
19051904 is_fallback : bool option; (** If true, response has fallen-back to generic results, and is not scoped using relativeToDid *)
19061905 rec_id : int option; (** Snowflake for this recommendation, use when submitting recommendation events. *)
19061906+ suggestions : Jsont.json list;
19071907}
1908190819091909(** Jsont codec for {!type:output}. *)
···19141914(** Record declaring a 'block' relationship against another account. NOTE: blocks are public in Bluesky; see blog posts for details. *)
1915191519161916type main = {
19171917- subject : string; (** DID of the account to be blocked. *)
19181917 created_at : string;
19181918+ subject : string; (** DID of the account to be blocked. *)
19191919}
1920192019211921(** Jsont codec for {!type:main}. *)
···19261926(** Record representing a block relationship against an entire an entire list of accounts (actors). *)
1927192719281928type main = {
19291929- subject : string; (** Reference (AT-URI) to the mod list record. *)
19301929 created_at : string;
19301930+ subject : string; (** Reference (AT-URI) to the mod list record. *)
19311931}
1932193219331933(** Jsont codec for {!type:main}. *)
···19521952(** Query/procedure parameters. *)
19531953type params = {
19541954 actor : string;
19551955+ cursor : string option;
19551956 limit : int option;
19561956- cursor : string option;
19571957}
1958195819591959(** Jsont codec for {!type:params}. *)
···196119611962196219631963type output = {
19641964- subject : Jsont.json;
19651964 cursor : string option;
19661965 followers : Jsont.json list;
19661966+ subject : Jsont.json;
19671967}
1968196819691969(** Jsont codec for {!type:output}. *)
···19861986(** Record declaring a social 'follow' relationship of another account. Duplicate follows will be ignored by the AppView. *)
1987198719881988type main = {
19891989- subject : string;
19901989 created_at : string;
19901990+ subject : string;
19911991 via : Com.Atproto.Repo.StrongRef.main option;
19921992}
19931993···20372037(** Query/procedure parameters. *)
20382038type params = {
20392039 actor : string;
20402040- limit : int option;
20412040 cursor : string option;
20412041+ limit : int option;
20422042}
2043204320442044(** Jsont codec for {!type:params}. *)
···204620462047204720482048type output = {
20492049- subject : Jsont.json;
20502049 cursor : string option;
20512050 followers : Jsont.json list;
20512051+ subject : Jsont.json;
20522052}
2053205320542054(** Jsont codec for {!type:output}. *)
···20712071(** Record representing an account's inclusion on a specific list. The AppView will ignore duplicate listitem records. *)
2072207220732073type main = {
20742074- subject : string; (** The account which is included on the list. *)
20742074+ created_at : string;
20752075 list_ : string; (** Reference (AT-URI) to the list record (app.bsky.graph.list). *)
20762076- created_at : string;
20762076+ subject : string; (** The account which is included on the list. *)
20772077}
2078207820792079(** Jsont codec for {!type:main}. *)
···20822082 end
20832083 module Defs : sig
2084208420852085-type list_item_view = {
20862086- uri : string;
20872087- subject : Jsont.json;
20882088-}
20892089-20902090-(** Jsont codec for {!type:list_item_view}. *)
20912091-val list_item_view_jsont : list_item_view Jsont.t
20922092-20932093-20942085type starter_pack_view_basic = {
20952095- uri : string;
20962086 cid : string;
20972097- record : Jsont.json;
20982087 creator : Jsont.json;
20992099- list_item_count : int option;
20882088+ indexed_at : string;
20892089+ joined_all_time_count : int option;
21002090 joined_week_count : int option;
21012101- joined_all_time_count : int option;
21022091 labels : Com.Atproto.Label.Defs.label list option;
21032103- indexed_at : string;
20922092+ list_item_count : int option;
20932093+ record : Jsont.json;
20942094+ uri : string;
21042095}
2105209621062097(** Jsont codec for {!type:starter_pack_view_basic}. *)
21072098val starter_pack_view_basic_jsont : starter_pack_view_basic Jsont.t
2108209921002100+(** lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object) *)
2109210121102110-type list_purpose = string
21112111-val list_purpose_jsont : list_purpose Jsont.t
21122112-21132113-(** A list of actors to apply an aggregate moderation action (mute/block) on. *)
21142114-21152115-type modlist = string
21162116-val modlist_jsont : modlist Jsont.t
21172117-21182118-(** A list of actors used for curation purposes such as list feeds or interaction gating. *)
21022102+type relationship = {
21032103+ blocked_by : string option; (** if the actor is blocked by this DID, contains the AT-URI of the block record *)
21042104+ blocked_by_list : string option; (** if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record *)
21052105+ blocking : string option; (** if the actor blocks this DID, this is the AT-URI of the block record *)
21062106+ blocking_by_list : string option; (** if the actor blocks this DID via a block list, this is the AT-URI of the listblock record *)
21072107+ did : string;
21082108+ followed_by : string option; (** if the actor is followed by this DID, contains the AT-URI of the follow record *)
21092109+ following : string option; (** if the actor follows this DID, this is the AT-URI of the follow record *)
21102110+}
2119211121202120-type curatelist = string
21212121-val curatelist_jsont : curatelist Jsont.t
21122112+(** Jsont codec for {!type:relationship}. *)
21132113+val relationship_jsont : relationship Jsont.t
2122211421232115(** A list of actors used for only for reference purposes such as within a starter pack. *)
2124211621252117type referencelist = string
21262118val referencelist_jsont : referencelist Jsont.t
2127211921202120+(** indicates that a handle or DID could not be resolved *)
21212121+21222122+type not_found_actor = {
21232123+ actor : string;
21242124+ not_found : bool;
21252125+}
21262126+21272127+(** Jsont codec for {!type:not_found_actor}. *)
21282128+val not_found_actor_jsont : not_found_actor Jsont.t
21292129+21302130+(** A list of actors to apply an aggregate moderation action (mute/block) on. *)
21312131+21322132+type modlist = string
21332133+val modlist_jsont : modlist Jsont.t
21342134+2128213521292136type list_viewer_state = {
21372137+ blocked : string option;
21302138 muted : bool option;
21312131- blocked : string option;
21322139}
2133214021342141(** Jsont codec for {!type:list_viewer_state}. *)
21352142val list_viewer_state_jsont : list_viewer_state Jsont.t
2136214321372137-(** indicates that a handle or DID could not be resolved *)
2138214421392139-type not_found_actor = {
21402140- actor : string;
21412141- not_found : bool;
21452145+type list_purpose = string
21462146+val list_purpose_jsont : list_purpose Jsont.t
21472147+21482148+21492149+type list_item_view = {
21502150+ subject : Jsont.json;
21512151+ uri : string;
21422152}
2143215321442144-(** Jsont codec for {!type:not_found_actor}. *)
21452145-val not_found_actor_jsont : not_found_actor Jsont.t
21542154+(** Jsont codec for {!type:list_item_view}. *)
21552155+val list_item_view_jsont : list_item_view Jsont.t
2146215621472147-(** lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object) *)
21572157+(** A list of actors used for curation purposes such as list feeds or interaction gating. *)
2148215821492149-type relationship = {
21502150- did : string;
21512151- following : string option; (** if the actor follows this DID, this is the AT-URI of the follow record *)
21522152- followed_by : string option; (** if the actor is followed by this DID, contains the AT-URI of the follow record *)
21532153- blocking : string option; (** if the actor blocks this DID, this is the AT-URI of the block record *)
21542154- blocked_by : string option; (** if the actor is blocked by this DID, contains the AT-URI of the block record *)
21552155- blocking_by_list : string option; (** if the actor blocks this DID via a block list, this is the AT-URI of the listblock record *)
21562156- blocked_by_list : string option; (** if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record *)
21572157-}
21582158-21592159-(** Jsont codec for {!type:relationship}. *)
21602160-val relationship_jsont : relationship Jsont.t
21592159+type curatelist = string
21602160+val curatelist_jsont : curatelist Jsont.t
216121612162216221632163type list_view_basic = {
21642164- uri : string;
21642164+ avatar : string option;
21652165 cid : string;
21662166+ indexed_at : string option;
21672167+ labels : Com.Atproto.Label.Defs.label list option;
21682168+ list_item_count : int option;
21662169 name : string;
21672170 purpose : Jsont.json;
21682168- avatar : string option;
21692169- list_item_count : int option;
21702170- labels : Com.Atproto.Label.Defs.label list option;
21712171+ uri : string;
21712172 viewer : Jsont.json option;
21722172- indexed_at : string option;
21732173}
2174217421752175(** Jsont codec for {!type:list_view_basic}. *)
···217721772178217821792179type list_view = {
21802180- uri : string;
21802180+ avatar : string option;
21812181 cid : string;
21822182 creator : Jsont.json;
21832183- name : string;
21842184- purpose : Jsont.json;
21852183 description : string option;
21862184 description_facets : Richtext.Facet.main list option;
21872187- avatar : string option;
21852185+ indexed_at : string;
21862186+ labels : Com.Atproto.Label.Defs.label list option;
21882187 list_item_count : int option;
21892189- labels : Com.Atproto.Label.Defs.label list option;
21882188+ name : string;
21892189+ purpose : Jsont.json;
21902190+ uri : string;
21902191 viewer : Jsont.json option;
21912191- indexed_at : string;
21922192}
2193219321942194(** Jsont codec for {!type:list_view}. *)
···219621962197219721982198type starter_pack_view = {
21992199- uri : string;
22002199 cid : string;
22012201- record : Jsont.json;
22022200 creator : Jsont.json;
22032203- list_ : Jsont.json option;
22042204- list_items_sample : Jsont.json list option;
22052201 feeds : Jsont.json list option;
22022202+ indexed_at : string;
22032203+ joined_all_time_count : int option;
22062204 joined_week_count : int option;
22072207- joined_all_time_count : int option;
22082205 labels : Com.Atproto.Label.Defs.label list option;
22092209- indexed_at : string;
22062206+ list_ : Jsont.json option;
22072207+ list_items_sample : Jsont.json list option;
22082208+ record : Jsont.json;
22092209+ uri : string;
22102210}
2211221122122212(** Jsont codec for {!type:starter_pack_view}. *)
···2218221822192219(** Query/procedure parameters. *)
22202220type params = {
22212221- limit : int option;
22222221 cursor : string option;
22222222+ limit : int option;
22232223}
2224222422252225(** Jsont codec for {!type:params}. *)
···222722272228222822292229type output = {
22302230- cursor : string option;
22312230 blocks : Jsont.json list;
22312231+ cursor : string option;
22322232}
2233223322342234(** Jsont codec for {!type:output}. *)
···22392239(** Record declaring a verification relationship between two accounts. Verifications are only considered valid by an app if issued by an account the app considers trusted. *)
2240224022412241type main = {
22422242+ created_at : string; (** Date of when the verification was created. *)
22432243+ display_name : string; (** Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying. *)
22442244+ handle : string; (** Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying. *)
22422245 subject : string; (** DID of the subject the verification applies to. *)
22432243- handle : string; (** Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying. *)
22442244- display_name : string; (** Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying. *)
22452245- created_at : string; (** Date of when the verification was created. *)
22462246}
2247224722482248(** Jsont codec for {!type:main}. *)
···2254225422552255(** Query/procedure parameters. *)
22562256type params = {
22572257- limit : int option;
22582257 cursor : string option;
22582258+ limit : int option;
22592259}
2260226022612261(** Jsont codec for {!type:params}. *)
···22972297(** A starter pack and an optional list item indicating membership of a target user to that starter pack. *)
2298229822992299type starter_pack_with_membership = {
23002300- starter_pack : Jsont.json;
23012300 list_item : Jsont.json option;
23012301+ starter_pack : Jsont.json;
23022302}
2303230323042304(** Jsont codec for {!type:starter_pack_with_membership}. *)
···23092309(** Query/procedure parameters. *)
23102310type params = {
23112311 actor : string; (** The account (actor) to check for membership. *)
23122312+ cursor : string option;
23122313 limit : int option;
23132313- cursor : string option;
23142314}
2315231523162316(** Jsont codec for {!type:params}. *)
···23322332(** Query/procedure parameters. *)
23332333type params = {
23342334 actor : string;
23352335- limit : int option;
23362335 cursor : string option;
23362336+ limit : int option;
23372337}
2338233823392339(** Jsont codec for {!type:params}. *)
···23532353(** Record representing a list of accounts (actors). Scope includes both moderation-oriented lists and curration-oriented lists. *)
2354235423552355type main = {
23562356- purpose : Jsont.json; (** Defines the purpose of the list (aka, moderation-oriented or curration-oriented) *)
23572357- name : string; (** Display name for list; can not be empty. *)
23562356+ avatar : Atp.Blob_ref.t option;
23572357+ created_at : string;
23582358 description : string option;
23592359 description_facets : Richtext.Facet.main list option;
23602360- avatar : Atp.Blob_ref.t option;
23612360 labels : Com.Atproto.Label.Defs.self_labels option;
23622362- created_at : string;
23612361+ name : string; (** Display name for list; can not be empty. *)
23622362+ purpose : Jsont.json; (** Defines the purpose of the list (aka, moderation-oriented or curration-oriented) *)
23632363}
2364236423652365(** Jsont codec for {!type:main}. *)
···2371237123722372(** Query/procedure parameters. *)
23732373type params = {
23742374- q : string; (** Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. *)
23742374+ cursor : string option;
23752375 limit : int option;
23762376- cursor : string option;
23762376+ q : string; (** Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. *)
23772377}
2378237823792379(** Jsont codec for {!type:params}. *)
···2394239423952395(** Query/procedure parameters. *)
23962396type params = {
23972397- list_ : string; (** Reference (AT-URI) of the list record to hydrate. *)
23982398- limit : int option;
23992397 cursor : string option;
23982398+ limit : int option;
23992399+ list_ : string; (** Reference (AT-URI) of the list record to hydrate. *)
24002400}
2401240124022402(** Jsont codec for {!type:params}. *)
···2405240524062406type output = {
24072407 cursor : string option;
24082408- list_ : Jsont.json;
24092408 items : Jsont.json list;
24092409+ list_ : Jsont.json;
24102410}
2411241124122412(** Jsont codec for {!type:output}. *)
···2418241824192419(** Query/procedure parameters. *)
24202420type params = {
24212421- limit : int option;
24222421 cursor : string option;
24222422+ limit : int option;
24232423}
2424242424252425(** Jsont codec for {!type:params}. *)
···24712471(** Query/procedure parameters. *)
24722472type params = {
24732473 actor : string; (** The account (actor) to check for membership. *)
24742474- limit : int option;
24752474 cursor : string option;
24752475+ limit : int option;
24762476 purposes : string list option; (** Optional filter by list purpose. If not specified, all supported types are returned. *)
24772477}
24782478···2494249424952495(** Query/procedure parameters. *)
24962496type params = {
24972497- limit : int option;
24982497 cursor : string option;
24982498+ limit : int option;
24992499}
2500250025012501(** Jsont codec for {!type:params}. *)
···25372537(** Query/procedure parameters. *)
25382538type params = {
25392539 actor : string; (** The account (actor) to enumerate lists from. *)
25402540+ cursor : string option;
25402541 limit : int option;
25412541- cursor : string option;
25422542 purposes : string list option; (** Optional filter by list purpose. If not specified, all supported types are returned. *)
25432543}
25442544···25582558 end
25592559 module Feed : sig
25602560 module Post : sig
25612561-25622562-type reply_ref = {
25632563- root : Com.Atproto.Repo.StrongRef.main;
25642564- parent : Com.Atproto.Repo.StrongRef.main;
25652565-}
25662566-25672567-(** Jsont codec for {!type:reply_ref}. *)
25682568-val reply_ref_jsont : reply_ref Jsont.t
25692569-25702561(** Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. *)
2571256225722563type text_slice = {
25642564+ end_ : int;
25732565 start : int;
25742574- end_ : int;
25752566}
2576256725772568(** Jsont codec for {!type:text_slice}. *)
25782569val text_slice_jsont : text_slice Jsont.t
2579257025712571+25722572+type reply_ref = {
25732573+ parent : Com.Atproto.Repo.StrongRef.main;
25742574+ root : Com.Atproto.Repo.StrongRef.main;
25752575+}
25762576+25772577+(** Jsont codec for {!type:reply_ref}. *)
25782578+val reply_ref_jsont : reply_ref Jsont.t
25792579+25802580(** Deprecated: use facets instead. *)
2581258125822582type entity = {
···25912591(** Record containing a Bluesky post. *)
2592259225932593type main = {
25942594- text : string; (** The primary post content. May be an empty string, if there are embeds. *)
25942594+ created_at : string; (** Client-declared timestamp when this post was originally created. *)
25952595+ embed : Jsont.json option;
25952596 entities : Jsont.json list option; (** DEPRECATED: replaced by app.bsky.richtext.facet. *)
25962597 facets : Richtext.Facet.main list option; (** Annotations of text (mentions, URLs, hashtags, etc) *)
25982598+ labels : Com.Atproto.Label.Defs.self_labels option; (** Self-label values for this post. Effectively content warnings. *)
25992599+ langs : string list option; (** Indicates human language of post primary text content. *)
25972600 reply : Jsont.json option;
25982598- embed : Jsont.json option;
25992599- langs : string list option; (** Indicates human language of post primary text content. *)
26002600- labels : Com.Atproto.Label.Defs.self_labels option; (** Self-label values for this post. Effectively content warnings. *)
26012601 tags : string list option; (** Additional hashtags, in addition to any included in post text and facets. *)
26022602- created_at : string; (** Client-declared timestamp when this post was originally created. *)
26022602+ text : string; (** The primary post content. May be an empty string, if there are embeds. *)
26032603}
2604260426052605(** Jsont codec for {!type:main}. *)
···26092609 module GetLikes : sig
2610261026112611type like = {
26122612- indexed_at : string;
26122612+ actor : Jsont.json;
26132613 created_at : string;
26142614- actor : Jsont.json;
26142614+ indexed_at : string;
26152615}
2616261626172617(** Jsont codec for {!type:like}. *)
···2621262126222622(** Query/procedure parameters. *)
26232623type params = {
26242624- uri : string; (** AT-URI of the subject (eg, a post record). *)
26252624 cid : string option; (** CID of the subject record (aka, specific version of record), to filter likes. *)
26252625+ cursor : string option;
26262626 limit : int option;
26272627- cursor : string option;
26272627+ uri : string; (** AT-URI of the subject (eg, a post record). *)
26282628}
2629262926302630(** Jsont codec for {!type:params}. *)
···263226322633263326342634type output = {
26352635- uri : string;
26362635 cid : string option;
26372636 cursor : string option;
26382637 likes : Jsont.json list;
26382638+ uri : string;
26392639}
2640264026412641(** Jsont codec for {!type:output}. *)
···2654265426552655type main = {
26562656 created_at : string;
26572657- post : string; (** Reference (AT-URI) to the post record. *)
26582657 detached_embedding_uris : string list option; (** List of AT-URIs embedding this post that the author has detached from. *)
26592658 embedding_rules : Jsont.json list option; (** List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed. *)
26592659+ post : string; (** Reference (AT-URI) to the post record. *)
26602660}
2661266126622662(** Jsont codec for {!type:main}. *)
···2668266826692669(** Query/procedure parameters. *)
26702670type params = {
26712671- uri : string; (** Reference (AT-URI) of post record *)
26722671 cid : string option; (** If supplied, filters to reposts of specific version (by CID) of the post record. *)
26722672+ cursor : string option;
26732673 limit : int option;
26742674- cursor : string option;
26742674+ uri : string; (** Reference (AT-URI) of post record *)
26752675}
2676267626772677(** Jsont codec for {!type:params}. *)
···267926792680268026812681type output = {
26822682- uri : string;
26832682 cid : string option;
26842683 cursor : string option;
26852684 reposted_by : Jsont.json list;
26852685+ uri : string;
26862686}
2687268726882688(** Jsont codec for {!type:output}. *)
···26912691 end
26922692 module DescribeFeedGenerator : sig
2693269326942694-type feed = {
26952695- uri : string;
26962696-}
26972697-26982698-(** Jsont codec for {!type:feed}. *)
26992699-val feed_jsont : feed Jsont.t
27002700-27012701-27022694type links = {
27032695 privacy_policy : string option;
27042696 terms_of_service : string option;
···2706269827072699(** Jsont codec for {!type:links}. *)
27082700val links_jsont : links Jsont.t
27012701+27022702+27032703+type feed = {
27042704+ uri : string;
27052705+}
27062706+27072707+(** Jsont codec for {!type:feed}. *)
27082708+val feed_jsont : feed Jsont.t
2709270927102710(** Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View). *)
27112711···27282728(** Jsont codec for {!type:mention_rule}. *)
27292729val mention_rule_jsont : mention_rule Jsont.t
2730273027312731-(** Allow replies from actors who follow you. *)
27312731+(** Allow replies from actors on a list. *)
2732273227332733-type follower_rule = unit
27332733+type list_rule = {
27342734+ list_ : string;
27352735+}
2734273627352735-(** Jsont codec for {!type:follower_rule}. *)
27362736-val follower_rule_jsont : follower_rule Jsont.t
27372737+(** Jsont codec for {!type:list_rule}. *)
27382738+val list_rule_jsont : list_rule Jsont.t
2737273927382740(** Allow replies from actors you follow. *)
27392741···27422744(** Jsont codec for {!type:following_rule}. *)
27432745val following_rule_jsont : following_rule Jsont.t
2744274627452745-(** Allow replies from actors on a list. *)
27472747+(** Allow replies from actors who follow you. *)
2746274827472747-type list_rule = {
27482748- list_ : string;
27492749-}
27492749+type follower_rule = unit
2750275027512751-(** Jsont codec for {!type:list_rule}. *)
27522752-val list_rule_jsont : list_rule Jsont.t
27512751+(** Jsont codec for {!type:follower_rule}. *)
27522752+val follower_rule_jsont : follower_rule Jsont.t
2753275327542754(** Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository. *)
2755275527562756type main = {
27572757- post : string; (** Reference (AT-URI) to the post record. *)
27582757 allow : Jsont.json list option; (** List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply. *)
27592758 created_at : string;
27602759 hidden_replies : string list option; (** List of hidden reply URIs. *)
27602760+ post : string; (** Reference (AT-URI) to the post record. *)
27612761}
2762276227632763(** Jsont codec for {!type:main}. *)
···27682768(** Record declaring a 'like' of a piece of subject content. *)
2769276927702770type main = {
27712771- subject : Com.Atproto.Repo.StrongRef.main;
27722771 created_at : string;
27722772+ subject : Com.Atproto.Repo.StrongRef.main;
27732773 via : Com.Atproto.Repo.StrongRef.main option;
27742774}
27752775···27812781(** Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. *)
2782278227832783type viewer_state = {
27842784- repost : string option;
27852785- like : string option;
27862784 bookmarked : bool option;
27872787- thread_muted : bool option;
27882788- reply_disabled : bool option;
27892785 embedding_disabled : bool option;
27862786+ like : string option;
27902787 pinned : bool option;
27882788+ reply_disabled : bool option;
27892789+ repost : string option;
27902790+ thread_muted : bool option;
27912791}
2792279227932793(** Jsont codec for {!type:viewer_state}. *)
27942794val viewer_state_jsont : viewer_state Jsont.t
27952795+27962796+27972797+type threadgate_view = {
27982798+ cid : string option;
27992799+ lists : Jsont.json list option;
28002800+ record : Jsont.json option;
28012801+ uri : string option;
28022802+}
28032803+28042804+(** Jsont codec for {!type:threadgate_view}. *)
28052805+val threadgate_view_jsont : threadgate_view Jsont.t
2795280627962807(** Metadata about this post within the context of the thread it is in. *)
27972808···28032814val thread_context_jsont : thread_context Jsont.t
280428152805281628172817+type skeleton_reason_repost = {
28182818+ repost : string;
28192819+}
28202820+28212821+(** Jsont codec for {!type:skeleton_reason_repost}. *)
28222822+val skeleton_reason_repost_jsont : skeleton_reason_repost Jsont.t
28232823+28242824+28252825+type skeleton_reason_pin = unit
28262826+28272827+(** Jsont codec for {!type:skeleton_reason_pin}. *)
28282828+val skeleton_reason_pin_jsont : skeleton_reason_pin Jsont.t
28292829+28302830+28312831+type skeleton_feed_post = {
28322832+ feed_context : string option; (** Context that will be passed through to client and may be passed to feed generator back alongside interactions. *)
28332833+ post : string;
28342834+ reason : Jsont.json option;
28352835+}
28362836+28372837+(** Jsont codec for {!type:skeleton_feed_post}. *)
28382838+val skeleton_feed_post_jsont : skeleton_feed_post Jsont.t
28392839+28402840+(** Request that more content like the given feed item be shown in the feed *)
28412841+28422842+type request_more = string
28432843+val request_more_jsont : request_more Jsont.t
28442844+28452845+(** Request that less content like the given feed item be shown in the feed *)
28462846+28472847+type request_less = string
28482848+val request_less_jsont : request_less Jsont.t
28492849+28502850+28062851type reply_ref = {
28072807- root : Jsont.json;
28082808- parent : Jsont.json;
28092852 grandparent_author : Jsont.json option; (** When parent is a reply to another post, this is the author of that post. *)
28532853+ parent : Jsont.json;
28542854+ root : Jsont.json;
28102855}
2811285628122857(** Jsont codec for {!type:reply_ref}. *)
···2815286028162861type reason_repost = {
28172862 by : Jsont.json;
28182818- uri : string option;
28192863 cid : string option;
28202864 indexed_at : string;
28652865+ uri : string option;
28212866}
2822286728232868(** Jsont codec for {!type:reason_repost}. *)
···283128762832287728332878type not_found_post = {
28792879+ not_found : bool;
28342880 uri : string;
28352835- not_found : bool;
28362881}
2837288228382883(** Jsont codec for {!type:not_found_post}. *)
28392884val not_found_post_jsont : not_found_post Jsont.t
2840288528862886+(** User shared the feed item *)
2841288728422842-type blocked_author = {
28432843- did : string;
28442844- viewer : Jsont.json option;
28452845-}
28882888+type interaction_share = string
28892889+val interaction_share_jsont : interaction_share Jsont.t
2846289028472847-(** Jsont codec for {!type:blocked_author}. *)
28482848-val blocked_author_jsont : blocked_author Jsont.t
28912891+(** Feed item was seen by user *)
2849289228932893+type interaction_seen = string
28942894+val interaction_seen_jsont : interaction_seen Jsont.t
2850289528512851-type generator_viewer_state = {
28522852- like : string option;
28532853-}
28962896+(** User reposted the feed item *)
2854289728552855-(** Jsont codec for {!type:generator_viewer_state}. *)
28562856-val generator_viewer_state_jsont : generator_viewer_state Jsont.t
28982898+type interaction_repost = string
28992899+val interaction_repost_jsont : interaction_repost Jsont.t
2857290029012901+(** User replied to the feed item *)
2858290228592859-type skeleton_feed_post = {
28602860- post : string;
28612861- reason : Jsont.json option;
28622862- feed_context : string option; (** Context that will be passed through to client and may be passed to feed generator back alongside interactions. *)
28632863-}
29032903+type interaction_reply = string
29042904+val interaction_reply_jsont : interaction_reply Jsont.t
2864290528652865-(** Jsont codec for {!type:skeleton_feed_post}. *)
28662866-val skeleton_feed_post_jsont : skeleton_feed_post Jsont.t
29062906+(** User quoted the feed item *)
2867290729082908+type interaction_quote = string
29092909+val interaction_quote_jsont : interaction_quote Jsont.t
2868291028692869-type skeleton_reason_repost = {
28702870- repost : string;
28712871-}
29112911+(** User liked the feed item *)
2872291228732873-(** Jsont codec for {!type:skeleton_reason_repost}. *)
28742874-val skeleton_reason_repost_jsont : skeleton_reason_repost Jsont.t
28752875-28762876-28772877-type skeleton_reason_pin = unit
28782878-28792879-(** Jsont codec for {!type:skeleton_reason_pin}. *)
28802880-val skeleton_reason_pin_jsont : skeleton_reason_pin Jsont.t
28812881-28822882-28832883-type threadgate_view = {
28842884- uri : string option;
28852885- cid : string option;
28862886- record : Jsont.json option;
28872887- lists : Jsont.json list option;
28882888-}
28892889-28902890-(** Jsont codec for {!type:threadgate_view}. *)
28912891-val threadgate_view_jsont : threadgate_view Jsont.t
29132913+type interaction_like = string
29142914+val interaction_like_jsont : interaction_like Jsont.t
289229152893291628942917type interaction = {
28952895- item : string option;
28962918 event : string option;
28972919 feed_context : string option; (** Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. *)
29202920+ item : string option;
28982921 req_id : string option; (** Unique identifier per request that may be passed back alongside interactions. *)
28992922}
2900292329012924(** Jsont codec for {!type:interaction}. *)
29022925val interaction_jsont : interaction Jsont.t
2903292629042904-(** Request that less content like the given feed item be shown in the feed *)
2905292729062906-type request_less = string
29072907-val request_less_jsont : request_less Jsont.t
29282928+type generator_viewer_state = {
29292929+ like : string option;
29302930+}
2908293129092909-(** Request that more content like the given feed item be shown in the feed *)
29322932+(** Jsont codec for {!type:generator_viewer_state}. *)
29332933+val generator_viewer_state_jsont : generator_viewer_state Jsont.t
2910293429112911-type request_more = string
29122912-val request_more_jsont : request_more Jsont.t
29352935+(** Declares the feed generator returns posts containing app.bsky.embed.video embeds. *)
2913293629142914-(** User clicked through to the feed item *)
29372937+type content_mode_video = string
29382938+val content_mode_video_jsont : content_mode_video Jsont.t
2915293929162916-type clickthrough_item = string
29172917-val clickthrough_item_jsont : clickthrough_item Jsont.t
29402940+(** Declares the feed generator returns any types of posts. *)
2918294129192919-(** User clicked through to the author of the feed item *)
29202920-29212921-type clickthrough_author = string
29222922-val clickthrough_author_jsont : clickthrough_author Jsont.t
29422942+type content_mode_unspecified = string
29432943+val content_mode_unspecified_jsont : content_mode_unspecified Jsont.t
2923294429242945(** User clicked through to the reposter of the feed item *)
2925294629262947type clickthrough_reposter = string
29272948val clickthrough_reposter_jsont : clickthrough_reposter Jsont.t
2928294929502950+(** User clicked through to the feed item *)
29512951+29522952+type clickthrough_item = string
29532953+val clickthrough_item_jsont : clickthrough_item Jsont.t
29542954+29292955(** User clicked through to the embedded content of the feed item *)
2930295629312957type clickthrough_embed = string
29322958val clickthrough_embed_jsont : clickthrough_embed Jsont.t
2933295929342934-(** Declares the feed generator returns any types of posts. *)
29602960+(** User clicked through to the author of the feed item *)
2935296129362936-type content_mode_unspecified = string
29372937-val content_mode_unspecified_jsont : content_mode_unspecified Jsont.t
29622962+type clickthrough_author = string
29632963+val clickthrough_author_jsont : clickthrough_author Jsont.t
2938296429392939-(** Declares the feed generator returns posts containing app.bsky.embed.video embeds. *)
29402940-29412941-type content_mode_video = string
29422942-val content_mode_video_jsont : content_mode_video Jsont.t
29432943-29442944-(** Feed item was seen by user *)
29452945-29462946-type interaction_seen = string
29472947-val interaction_seen_jsont : interaction_seen Jsont.t
29482948-29492949-(** User liked the feed item *)
29502950-29512951-type interaction_like = string
29522952-val interaction_like_jsont : interaction_like Jsont.t
29532953-29542954-(** User reposted the feed item *)
29552955-29562956-type interaction_repost = string
29572957-val interaction_repost_jsont : interaction_repost Jsont.t
29582958-29592959-(** User replied to the feed item *)
29602960-29612961-type interaction_reply = string
29622962-val interaction_reply_jsont : interaction_reply Jsont.t
29632963-29642964-(** User quoted the feed item *)
2965296529662966-type interaction_quote = string
29672967-val interaction_quote_jsont : interaction_quote Jsont.t
29682968-29692969-(** User shared the feed item *)
29662966+type blocked_author = {
29672967+ did : string;
29682968+ viewer : Jsont.json option;
29692969+}
2970297029712971-type interaction_share = string
29722972-val interaction_share_jsont : interaction_share Jsont.t
29712971+(** Jsont codec for {!type:blocked_author}. *)
29722972+val blocked_author_jsont : blocked_author Jsont.t
297329732974297429752975type post_view = {
29762976- uri : string;
29762976+ author : Jsont.json;
29772977+ bookmark_count : int option;
29772978 cid : string;
29782978- author : Jsont.json;
29792979+ debug : Jsont.json option; (** Debug information for internal development *)
29802980+ embed : Jsont.json option;
29812981+ indexed_at : string;
29822982+ labels : Com.Atproto.Label.Defs.label list option;
29832983+ like_count : int option;
29842984+ quote_count : int option;
29792985 record : Jsont.json;
29802980- embed : Jsont.json option;
29812981- bookmark_count : int option;
29822986 reply_count : int option;
29832987 repost_count : int option;
29842984- like_count : int option;
29852985- quote_count : int option;
29862986- indexed_at : string;
29882988+ threadgate : Jsont.json option;
29892989+ uri : string;
29872990 viewer : Jsont.json option;
29882988- labels : Com.Atproto.Label.Defs.label list option;
29892989- threadgate : Jsont.json option;
29902990- debug : Jsont.json option; (** Debug information for internal development *)
29912991}
2992299229932993(** Jsont codec for {!type:post_view}. *)
29942994val post_view_jsont : post_view Jsont.t
299529952996299629972997-type blocked_post = {
29982998- uri : string;
29992999- blocked : bool;
30003000- author : Jsont.json;
30013001-}
30023002-30033003-(** Jsont codec for {!type:blocked_post}. *)
30043004-val blocked_post_jsont : blocked_post Jsont.t
30053005-30063006-30072997type generator_view = {
30083008- uri : string;
29982998+ accepts_interactions : bool option;
29992999+ avatar : string option;
30093000 cid : string;
30103010- did : string;
30013001+ content_mode : string option;
30113002 creator : Jsont.json;
30123012- display_name : string;
30133003 description : string option;
30143004 description_facets : Richtext.Facet.main list option;
30153015- avatar : string option;
30163016- like_count : int option;
30173017- accepts_interactions : bool option;
30053005+ did : string;
30063006+ display_name : string;
30073007+ indexed_at : string;
30183008 labels : Com.Atproto.Label.Defs.label list option;
30093009+ like_count : int option;
30103010+ uri : string;
30193011 viewer : Jsont.json option;
30203020- content_mode : string option;
30213021- indexed_at : string;
30223012}
3023301330243014(** Jsont codec for {!type:generator_view}. *)
30253015val generator_view_jsont : generator_view Jsont.t
302630163027301730283028-type feed_view_post = {
30293029- post : Jsont.json;
30303030- reply : Jsont.json option;
30313031- reason : Jsont.json option;
30323032- feed_context : string option; (** Context provided by feed generator that may be passed back alongside interactions. *)
30333033- req_id : string option; (** Unique identifier per request that may be passed back alongside interactions. *)
30183018+type blocked_post = {
30193019+ author : Jsont.json;
30203020+ blocked : bool;
30213021+ uri : string;
30343022}
3035302330363036-(** Jsont codec for {!type:feed_view_post}. *)
30373037-val feed_view_post_jsont : feed_view_post Jsont.t
30243024+(** Jsont codec for {!type:blocked_post}. *)
30253025+val blocked_post_jsont : blocked_post Jsont.t
303830263039302730403028type thread_view_post = {
30413041- post : Jsont.json;
30423029 parent : Jsont.json option;
30303030+ post : Jsont.json;
30433031 replies : Jsont.json list option;
30443032 thread_context : Jsont.json option;
30453033}
···30473035(** Jsont codec for {!type:thread_view_post}. *)
30483036val thread_view_post_jsont : thread_view_post Jsont.t
3049303730383038+30393039+type feed_view_post = {
30403040+ feed_context : string option; (** Context provided by feed generator that may be passed back alongside interactions. *)
30413041+ post : Jsont.json;
30423042+ reason : Jsont.json option;
30433043+ reply : Jsont.json option;
30443044+ req_id : string option; (** Unique identifier per request that may be passed back alongside interactions. *)
30453045+}
30463046+30473047+(** Jsont codec for {!type:feed_view_post}. *)
30483048+val feed_view_post_jsont : feed_view_post Jsont.t
30493049+30503050 end
30513051 module Repost : sig
30523052(** Record representing a 'repost' of an existing Bluesky post. *)
3053305330543054type main = {
30553055- subject : Com.Atproto.Repo.StrongRef.main;
30563055 created_at : string;
30563056+ subject : Com.Atproto.Repo.StrongRef.main;
30573057 via : Com.Atproto.Repo.StrongRef.main option;
30583058}
30593059···30653065(** Record declaring of the existence of a feed generator, and containing metadata about it. The record can exist in any repository. *)
3066306630673067type main = {
30683068+ accepts_interactions : bool option; (** Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions *)
30693069+ avatar : Atp.Blob_ref.t option;
30703070+ content_mode : string option;
30713071+ created_at : string;
30723072+ description : string option;
30733073+ description_facets : Richtext.Facet.main list option;
30683074 did : string;
30693075 display_name : string;
30703070- description : string option;
30713071- description_facets : Richtext.Facet.main list option;
30723072- avatar : Atp.Blob_ref.t option;
30733073- accepts_interactions : bool option; (** Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions *)
30743076 labels : Com.Atproto.Label.Defs.self_labels option; (** Self-label values *)
30753075- content_mode : string option;
30763076- created_at : string;
30773077}
3078307830793079(** Jsont codec for {!type:main}. *)
···3085308530863086(** Query/procedure parameters. *)
30873087type params = {
30883088- uri : string; (** Reference (AT-URI) to post record. *)
30893088 depth : int option; (** How many levels of reply depth should be included in response. *)
30903089 parent_height : int option; (** How many levels of parent (and grandparent, etc) post to include. *)
30903090+ uri : string; (** Reference (AT-URI) to post record. *)
30913091}
3092309230933093(** Jsont codec for {!type:params}. *)
···3108310831093109(** Query/procedure parameters. *)
31103110type params = {
31113111+ cursor : string option;
31113112 feed : string;
31123113 limit : int option;
31133113- cursor : string option;
31143114}
3115311531163116(** Jsont codec for {!type:params}. *)
···3131313131323132(** Query/procedure parameters. *)
31333133type params = {
31343134- uri : string; (** Reference (AT-URI) of post record *)
31353134 cid : string option; (** If supplied, filters to quotes of specific version (by CID) of the post record. *)
31363136- limit : int option;
31373135 cursor : string option;
31363136+ limit : int option;
31373137+ uri : string; (** Reference (AT-URI) of post record *)
31383138}
3139313931403140(** Jsont codec for {!type:params}. *)
···314231423143314331443144type output = {
31453145- uri : string;
31463145 cid : string option;
31473146 cursor : string option;
31483147 posts : Jsont.json list;
31483148+ uri : string;
31493149}
3150315031513151(** Jsont codec for {!type:output}. *)
···3157315731583158(** Query/procedure parameters. *)
31593159type params = {
31603160- list_ : string; (** Reference (AT-URI) to the list record. *)
31613161- limit : int option;
31623160 cursor : string option;
31613161+ limit : int option;
31623162+ list_ : string; (** Reference (AT-URI) to the list record. *)
31633163}
3164316431653165(** Jsont codec for {!type:params}. *)
···31813181(** Query/procedure parameters. *)
31823182type params = {
31833183 actor : string;
31843184- limit : int option;
31853184 cursor : string option;
31853185+ limit : int option;
31863186}
3187318731883188(** Jsont codec for {!type:params}. *)
···3203320332043204(** Query/procedure parameters. *)
32053205type params = {
32063206+ cursor : string option;
32063207 feed : string; (** Reference to feed generator record describing the specific feed being requested. *)
32073208 limit : int option;
32083208- cursor : string option;
32093209}
3210321032113211(** Jsont codec for {!type:params}. *)
···3227322732283228(** Query/procedure parameters. *)
32293229type params = {
32303230+ author : string option; (** Filter to posts by the given account. Handles are resolved to DID before query-time. *)
32313231+ cursor : string option; (** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. *)
32323232+ domain : string option; (** Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. *)
32333233+ lang : string option; (** Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. *)
32343234+ limit : int option;
32353235+ mentions : string option; (** Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. *)
32303236 q : string; (** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. *)
32313231- sort : string option; (** Specifies the ranking order of results. *)
32323237 since : string option; (** Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). *)
32383238+ sort : string option; (** Specifies the ranking order of results. *)
32393239+ tag : string list option; (** Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. *)
32333240 until : string option; (** Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD). *)
32343234- mentions : string option; (** Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. *)
32353235- author : string option; (** Filter to posts by the given account. Handles are resolved to DID before query-time. *)
32363236- lang : string option; (** Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. *)
32373237- domain : string option; (** Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. *)
32383241 url : string option; (** Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. *)
32393239- tag : string list option; (** Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. *)
32403240- limit : int option;
32413241- cursor : string option; (** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. *)
32423242}
3243324332443244(** Jsont codec for {!type:params}. *)
···32993299(** Query/procedure parameters. *)
33003300type params = {
33013301 actor : string;
33023302- limit : int option;
33033302 cursor : string option;
33043303 filter : string option; (** Combinations of post/repost types to include in response. *)
33053304 include_pins : bool option;
33053305+ limit : int option;
33063306}
3307330733083308(** Jsont codec for {!type:params}. *)
···333133313332333233333333type output = {
33343334- view : Jsont.json;
33353334 is_online : bool; (** Indicates whether the feed generator service has been online recently, or else seems to be inactive. *)
33363335 is_valid : bool; (** Indicates whether the feed generator service is compatible with the record declaration. *)
33363336+ view : Jsont.json;
33373337}
3338333833393339(** Jsont codec for {!type:output}. *)
···3345334533463346(** Query/procedure parameters. *)
33473347type params = {
33483348+ cursor : string option;
33483349 limit : int option;
33493349- cursor : string option;
33503350}
3351335133523352(** Jsont codec for {!type:params}. *)
···33683368(** Query/procedure parameters. *)
33693369type params = {
33703370 actor : string;
33713371- limit : int option;
33723371 cursor : string option;
33723372+ limit : int option;
33733373}
3374337433753375(** Jsont codec for {!type:params}. *)
···34113411(** Query/procedure parameters. *)
34123412type params = {
34133413 algorithm : string option; (** Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism. *)
34143414- limit : int option;
34153414 cursor : string option;
34153415+ limit : int option;
34163416}
3417341734183418(** Jsont codec for {!type:params}. *)
···344734473448344834493449type input = {
34503450- uri : string;
34513450 cid : string;
34513451+ uri : string;
34523452}
3453345334543454(** Jsont codec for {!type:input}. *)
···3456345634573457 end
34583458 module Defs : sig
34593459+34603460+type bookmark_view = {
34613461+ created_at : string option;
34623462+ item : Jsont.json;
34633463+ subject : Com.Atproto.Repo.StrongRef.main; (** A strong ref to the bookmarked record. *)
34643464+}
34653465+34663466+(** Jsont codec for {!type:bookmark_view}. *)
34673467+val bookmark_view_jsont : bookmark_view Jsont.t
34683468+34593469(** Object used to store bookmark data in stash. *)
3460347034613471type bookmark = {
···34653475(** Jsont codec for {!type:bookmark}. *)
34663476val bookmark_jsont : bookmark Jsont.t
3467347734683468-34693469-type bookmark_view = {
34703470- subject : Com.Atproto.Repo.StrongRef.main; (** A strong ref to the bookmarked record. *)
34713471- created_at : string option;
34723472- item : Jsont.json;
34733473-}
34743474-34753475-(** Jsont codec for {!type:bookmark_view}. *)
34763476-val bookmark_view_jsont : bookmark_view Jsont.t
34773477-34783478 end
34793479 module GetBookmarks : sig
34803480(** Gets views of records bookmarked by the authenticated user. Requires authentication. *)
3481348134823482(** Query/procedure parameters. *)
34833483type params = {
34843484+ cursor : string option;
34843485 limit : int option;
34853485- cursor : string option;
34863486}
3487348734883488(** Jsont codec for {!type:params}. *)
···349034903491349134923492type output = {
34933493- cursor : string option;
34943493 bookmarks : Defs.bookmark_view list;
34943494+ cursor : string option;
34953495}
3496349634973497(** Jsont codec for {!type:output}. *)
···3505350535063506(** Query/procedure parameters. *)
35073507type params = {
35083508- viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). *)
35093508 category : string option; (** Category of users to get suggestions for. *)
35103509 limit : int option;
35103510+ viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). *)
35113511}
3512351235133513(** Jsont codec for {!type:params}. *)
···3548354835493549(** Query/procedure parameters. *)
35503550type params = {
35513551- limit : int option;
35523551 cursor : string option;
35523552+ limit : int option;
35533553 query : string option;
35543554}
35553555···3571357135723572(** Query/procedure parameters. *)
35733573type params = {
35743574- viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). *)
35753574 limit : int option;
35753575+ viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). *)
35763576}
3577357735783578(** Jsont codec for {!type:params}. *)
···3612361236133613(** Query/procedure parameters. *)
36143614type params = {
36153615+ limit : int option;
36153616 viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). *)
36163616- limit : int option;
36173617}
3618361836193619(** Jsont codec for {!type:params}. *)
···3697369736983698(** Query/procedure parameters. *)
36993699type params = {
37003700- viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). *)
37013700 limit : int option;
37013701+ viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). *)
37023702}
3703370337043704(** Jsont codec for {!type:params}. *)
···37153715 end
37163716 module Defs : sig
3717371737183718-type skeleton_search_post = {
37193719- uri : string;
37203720-}
37213721-37223722-(** Jsont codec for {!type:skeleton_search_post}. *)
37233723-val skeleton_search_post_jsont : skeleton_search_post Jsont.t
37243724-37253725-37263726-type skeleton_search_actor = {
37273727- did : string;
37283728-}
37293729-37303730-(** Jsont codec for {!type:skeleton_search_actor}. *)
37313731-val skeleton_search_actor_jsont : skeleton_search_actor Jsont.t
37323732-37333733-37343734-type skeleton_search_starter_pack = {
37353735- uri : string;
37363736-}
37373737-37383738-(** Jsont codec for {!type:skeleton_search_starter_pack}. *)
37393739-val skeleton_search_starter_pack_jsont : skeleton_search_starter_pack Jsont.t
37403740-37413741-37423718type trending_topic = {
37433743- topic : string;
37443744- display_name : string option;
37453719 description : string option;
37203720+ display_name : string option;
37463721 link : string;
37223722+ topic : string;
37473723}
3748372437493725(** Jsont codec for {!type:trending_topic}. *)
37503726val trending_topic_jsont : trending_topic Jsont.t
375137273752372837533753-type skeleton_trend = {
37543754- topic : string;
37553755- display_name : string;
37563756- link : string;
37573757- started_at : string;
37583758- post_count : int;
37593759- status : string option;
37603760- category : string option;
37613761- dids : string list;
37623762-}
37633763-37643764-(** Jsont codec for {!type:skeleton_trend}. *)
37653765-val skeleton_trend_jsont : skeleton_trend Jsont.t
37663766-37673767-37683729type trend_view = {
37693769- topic : string;
37303730+ actors : Jsont.json list;
37313731+ category : string option;
37703732 display_name : string;
37713733 link : string;
37723772- started_at : string;
37733734 post_count : int;
37353735+ started_at : string;
37743736 status : string option;
37753775- category : string option;
37763776- actors : Jsont.json list;
37373737+ topic : string;
37773738}
3778373937793740(** Jsont codec for {!type:trend_view}. *)
···378137423782374337833744type thread_item_post = {
37843784- post : Jsont.json;
37453745+ hidden_by_threadgate : bool; (** The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread. *)
37853746 more_parents : bool; (** This post has more parents that were not present in the response. This is just a boolean, without the number of parents. *)
37863747 more_replies : int; (** This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate. *)
37483748+ muted_by_viewer : bool; (** This is by an account muted by the viewer requesting it. *)
37873749 op_thread : bool; (** This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread. *)
37883788- hidden_by_threadgate : bool; (** The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread. *)
37893789- muted_by_viewer : bool; (** This is by an account muted by the viewer requesting it. *)
37503750+ post : Jsont.json;
37903751}
3791375237923753(** Jsont codec for {!type:thread_item_post}. *)
37933754val thread_item_post_jsont : thread_item_post Jsont.t
379437553795375637573757+type thread_item_not_found = unit
37583758+37593759+(** Jsont codec for {!type:thread_item_not_found}. *)
37603760+val thread_item_not_found_jsont : thread_item_not_found Jsont.t
37613761+37623762+37963763type thread_item_no_unauthenticated = unit
3797376437983765(** Jsont codec for {!type:thread_item_no_unauthenticated}. *)
37993766val thread_item_no_unauthenticated_jsont : thread_item_no_unauthenticated Jsont.t
380037673801376838023802-type thread_item_not_found = unit
38033803-38043804-(** Jsont codec for {!type:thread_item_not_found}. *)
38053805-val thread_item_not_found_jsont : thread_item_not_found Jsont.t
38063806-38073807-38083769type thread_item_blocked = {
38093770 author : Jsont.json;
38103771}
···38123773(** Jsont codec for {!type:thread_item_blocked}. *)
38133774val thread_item_blocked_jsont : thread_item_blocked Jsont.t
3814377537763776+37773777+type skeleton_trend = {
37783778+ category : string option;
37793779+ dids : string list;
37803780+ display_name : string;
37813781+ link : string;
37823782+ post_count : int;
37833783+ started_at : string;
37843784+ status : string option;
37853785+ topic : string;
37863786+}
37873787+37883788+(** Jsont codec for {!type:skeleton_trend}. *)
37893789+val skeleton_trend_jsont : skeleton_trend Jsont.t
37903790+37913791+37923792+type skeleton_search_starter_pack = {
37933793+ uri : string;
37943794+}
37953795+37963796+(** Jsont codec for {!type:skeleton_search_starter_pack}. *)
37973797+val skeleton_search_starter_pack_jsont : skeleton_search_starter_pack Jsont.t
37983798+37993799+38003800+type skeleton_search_post = {
38013801+ uri : string;
38023802+}
38033803+38043804+(** Jsont codec for {!type:skeleton_search_post}. *)
38053805+val skeleton_search_post_jsont : skeleton_search_post Jsont.t
38063806+38073807+38083808+type skeleton_search_actor = {
38093809+ did : string;
38103810+}
38113811+38123812+(** Jsont codec for {!type:skeleton_search_actor}. *)
38133813+val skeleton_search_actor_jsont : skeleton_search_actor Jsont.t
38143814+38153815(** The computed state of the age assurance process, returned to the user in question on certain authenticated requests. *)
3816381638173817type age_assurance_state = {
···38253825(** Object used to store age assurance data in stash. *)
3826382638273827type age_assurance_event = {
38283828+ attempt_id : string; (** The unique identifier for this instance of the age assurance flow, in UUID format. *)
38293829+ complete_ip : string option; (** The IP address used when completing the AA flow. *)
38303830+ complete_ua : string option; (** The user agent used when completing the AA flow. *)
38283831 created_at : string; (** The date and time of this write operation. *)
38293829- status : string; (** The status of the age assurance process. *)
38303830- attempt_id : string; (** The unique identifier for this instance of the age assurance flow, in UUID format. *)
38313832 email : string option; (** The email used for AA. *)
38323833 init_ip : string option; (** The IP address used when initiating the AA flow. *)
38333834 init_ua : string option; (** The user agent used when initiating the AA flow. *)
38343834- complete_ip : string option; (** The IP address used when completing the AA flow. *)
38353835- complete_ua : string option; (** The user agent used when completing the AA flow. *)
38353835+ status : string; (** The status of the age assurance process. *)
38363836}
3837383738383838(** Jsont codec for {!type:age_assurance_event}. *)
···38423842 module GetTaggedSuggestions : sig
3843384338443844type suggestion = {
38453845- tag : string;
38463846- subject_type : string;
38473845 subject : string;
38463846+ subject_type : string;
38473847+ tag : string;
38483848}
3849384938503850(** Jsont codec for {!type:suggestion}. *)
···3872387238733873(** Query/procedure parameters. *)
38743874type params = {
38753875+ author : string option; (** Filter to posts by the given account. Handles are resolved to DID before query-time. *)
38763876+ cursor : string option; (** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. *)
38773877+ domain : string option; (** Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. *)
38783878+ lang : string option; (** Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. *)
38793879+ limit : int option;
38803880+ mentions : string option; (** Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. *)
38753881 q : string; (** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. *)
38823882+ since : string option; (** Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). *)
38763883 sort : string option; (** Specifies the ranking order of results. *)
38773877- since : string option; (** Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). *)
38843884+ tag : string list option; (** Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. *)
38783885 until : string option; (** Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD). *)
38793879- mentions : string option; (** Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. *)
38803880- author : string option; (** Filter to posts by the given account. Handles are resolved to DID before query-time. *)
38813881- lang : string option; (** Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. *)
38823882- domain : string option; (** Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. *)
38833886 url : string option; (** Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. *)
38843884- tag : string list option; (** Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. *)
38853887 viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries. *)
38863886- limit : int option;
38873887- cursor : string option; (** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. *)
38883888}
3889388938903890(** Jsont codec for {!type:params}. *)
···39043904 module GetPostThreadV2 : sig
3905390539063906type thread_item = {
39073907- uri : string;
39083907 depth : int; (** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. *)
39083908+ uri : string;
39093909 value : Jsont.json;
39103910}
39113911···3916391639173917(** Query/procedure parameters. *)
39183918type params = {
39193919+ above : bool option; (** Whether to include parents above the anchor. *)
39193920 anchor : string; (** Reference (AT-URI) to post record. This is the anchor post, and the thread will be built around it. It can be any post in the tree, not necessarily a root post. *)
39203920- above : bool option; (** Whether to include parents above the anchor. *)
39213921 below : int option; (** How many levels of replies to include below the anchor. *)
39223922 branching_factor : int option; (** Maximum of replies to include at each level of the thread, except for the direct replies to the anchor, which are (NOTE: currently, during unspecced phase) all returned (NOTE: later they might be paginated). *)
39233923 sort : string option; (** Sorting for the thread replies. *)
···392839283929392939303930type output = {
39313931+ has_other_replies : bool; (** Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. *)
39313932 thread : thread_item list; (** A flat list of thread items. The depth of each item is indicated by the depth property inside the item. *)
39323933 threadgate : Jsont.json option;
39333933- has_other_replies : bool; (** Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. *)
39343934}
3935393539363936(** Jsont codec for {!type:output}. *)
···3942394239433943(** Query/procedure parameters. *)
39443944type params = {
39453945- viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. *)
39463945 limit : int option;
39463946+ viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. *)
39473947}
3948394839493949(** Jsont codec for {!type:params}. *)
···395139513952395239533953type output = {
39543954- topics : Defs.trending_topic list;
39553954 suggested : Defs.trending_topic list;
39553955+ topics : Defs.trending_topic list;
39563956}
3957395739583958(** Jsont codec for {!type:output}. *)
···3964396439653965(** Query/procedure parameters. *)
39663966type params = {
39673967- viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). *)
39683967 limit : int option;
39683968+ viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). *)
39693969}
3970397039713971(** Jsont codec for {!type:params}. *)
···39833983 module GetPostThreadOtherV2 : sig
3984398439853985type thread_item = {
39863986+ depth : int; (** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. *)
39863987 uri : string;
39873987- depth : int; (** The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. *)
39883988 value : Defs.thread_item_post;
39893989}
39903990···401540154016401640174017type input = {
40184018+ country_code : string; (** An ISO 3166-1 alpha-2 code of the user's location. *)
40184019 email : string; (** The user's email address to receive assurance instructions. *)
40194020 language : string; (** The user's preferred language for communication during the assurance process. *)
40204020- country_code : string; (** An ISO 3166-1 alpha-2 code of the user's location. *)
40214021}
4022402240234023(** Jsont codec for {!type:input}. *)
···4035403540364036(** Query/procedure parameters. *)
40374037type params = {
40384038+ cursor : string option; (** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. *)
40394039+ limit : int option;
40384040 q : string; (** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. *)
40394041 viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). *)
40404040- limit : int option;
40414041- cursor : string option; (** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. *)
40424042}
4043404340444044(** Jsont codec for {!type:params}. *)
···4060406040614061(** Query/procedure parameters. *)
40624062type params = {
40634063+ cursor : string option; (** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. *)
40644064+ limit : int option;
40634065 q : string; (** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax. *)
40664066+ typeahead : bool option; (** If true, acts as fast/simple 'typeahead' query. *)
40644067 viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. *)
40654065- typeahead : bool option; (** If true, acts as fast/simple 'typeahead' query. *)
40664066- limit : int option;
40674067- cursor : string option; (** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. *)
40684068}
4069406940704070(** Jsont codec for {!type:params}. *)
···407240724073407340744074type output = {
40754075+ actors : Defs.skeleton_search_actor list;
40754076 cursor : string option;
40764077 hits_total : int option; (** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. *)
40774077- actors : Defs.skeleton_search_actor list;
40784078}
4079407940804080(** Jsont codec for {!type:output}. *)
···4096409640974097(** Query/procedure parameters. *)
40984098type params = {
40994099- viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. *)
40994099+ cursor : string option;
41004100 limit : int option;
41014101- cursor : string option;
41024101 relative_to_did : string option; (** DID of the account to get suggestions relative to. If not provided, suggestions will be based on the viewer. *)
41024102+ viewer : string option; (** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. *)
41034103}
4104410441054105(** Jsont codec for {!type:params}. *)
···410741074108410841094109type output = {
41104110- cursor : string option;
41114110 actors : Defs.skeleton_search_actor list;
41124112- relative_to_did : string option; (** DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. *)
41114111+ cursor : string option;
41134112 rec_id : int option; (** Snowflake for this recommendation, use when submitting recommendation events. *)
41134113+ relative_to_did : string option; (** DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. *)
41144114}
4115411541164116(** Jsont codec for {!type:output}. *)
···1717(** A URI with a content-hash fingerprint. *)
18181919type main = {
2020- uri : string;
2120 cid : string;
2121+ uri : string;
2222}
23232424(** Jsont codec for {!type:main}. *)
···4747(** A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently. *)
48484949type main = {
5050- site : string; (** Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes. *)
5050+ bsky_post_ref : Com.Atproto.Repo.StrongRef.main option; (** Strong reference to a Bluesky post. Useful to keep track of comments off-platform. *)
5151+ content : Jsont.json option; (** Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats. *)
5252+ cover_image : Atp.Blob_ref.t option; (** Image to used for thumbnail or cover image. Less than 1MB is size. *)
5353+ description : string option; (** A brief description or excerpt from the document. *)
5154 path : string option; (** Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash. *)
5555+ published_at : string; (** Timestamp of the documents publish time. *)
5656+ site : string; (** Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes. *)
5757+ tags : string list option; (** Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags. *)
5858+ text_content : string option; (** Plaintext representation of the documents contents. Should not contain markdown or other formatting. *)
5259 title : string; (** Title of the document. *)
5353- description : string option; (** A brief description or excerpt from the document. *)
5454- cover_image : Atp.Blob_ref.t option; (** Image to used for thumbnail or cover image. Less than 1MB is size. *)
5555- content : Jsont.json option; (** Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats. *)
5656- text_content : string option; (** Plaintext representation of the documents contents. Should not contain markdown or other formatting. *)
5757- bsky_post_ref : Com.Atproto.Repo.StrongRef.main option; (** Strong reference to a Bluesky post. Useful to keep track of comments off-platform. *)
5858- tags : string list option; (** Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags. *)
5959- published_at : string; (** Timestamp of the documents publish time. *)
6060 updated_at : string option; (** Timestamp of the documents last edit. *)
6161}
6262···6767 module Theme : sig
6868 module Color : sig
69697070-type rgb = {
7070+type rgba = {
7171+ a : int;
7272+ b : int;
7373+ g : int;
7174 r : int;
7272- g : int;
7373- b : int;
7475}
75767676-(** Jsont codec for {!type:rgb}. *)
7777-val rgb_jsont : rgb Jsont.t
7777+(** Jsont codec for {!type:rgba}. *)
7878+val rgba_jsont : rgba Jsont.t
787979808080-type rgba = {
8181+type rgb = {
8282+ b : int;
8383+ g : int;
8184 r : int;
8282- g : int;
8383- b : int;
8484- a : int;
8585}
86868787-(** Jsont codec for {!type:rgba}. *)
8888-val rgba_jsont : rgba Jsont.t
8787+(** Jsont codec for {!type:rgb}. *)
8888+val rgb_jsont : rgb Jsont.t
89899090 end
9191 module Basic : sig
9292(** A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications. *)
93939494type main = {
9595+ accent : Color.rgb; (** Color used for links and button backgrounds. *)
9696+ accent_foreground : Color.rgb; (** Color used for button text. *)
9597 background : Color.rgb; (** Color used for content background. *)
9698 foreground : Color.rgb; (** Color used for content text. *)
9797- accent : Color.rgb; (** Color used for links and button backgrounds. *)
9898- accent_foreground : Color.rgb; (** Color used for button text. *)
9999}
100100101101(** Jsont codec for {!type:main}. *)
···116116(** A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings. *)
117117118118type main = {
119119- url : string; (** Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path. *)
119119+ basic_theme : Theme.Basic.main option; (** Simplified publication theme for tools and apps to utilize when displaying content. *)
120120+ description : string option; (** Brief description of the publication. *)
120121 icon : Atp.Blob_ref.t option; (** Square image to identify the publication. Should be at least 256x256. *)
121122 name : string; (** Name of the publication. *)
122122- description : string option; (** Brief description of the publication. *)
123123- basic_theme : Theme.Basic.main option; (** Simplified publication theme for tools and apps to utilize when displaying content. *)
124123 preferences : preferences option; (** Object containing platform specific preferences (with a few shared properties). *)
124124+ url : string; (** Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path. *)
125125}
126126127127(** Jsont codec for {!type:main}. *)
···2424 module Member : sig
25252626type main = {
2727- subject : string;
2828- instance : string; (** spindle instance that the subject is now a member of *)
2927 created_at : string;
2828+ instance : string; (** spindle instance that the subject is now a member of *)
2929+ subject : string;
3030}
31313232(** Jsont codec for {!type:main}. *)
···474748484949type individual_email_commit_count = {
5050- email : string;
5150 count : int;
5151+ email : string;
5252}
53535454(** Jsont codec for {!type:individual_email_commit_count}. *)
···727273737474type meta = {
7575+ commit_count : commit_count_breakdown;
7576 is_default_ref : bool;
7677 lang_breakdown : lang_breakdown option;
7777- commit_count : commit_count_breakdown;
7878}
79798080(** Jsont codec for {!type:meta}. *)
···8383(** An update to a git repository, emitted by knots. *)
84848585type main = {
8686- ref_ : string; (** Ref being updated *)
8786 committer_did : string; (** did of the user that pushed this ref *)
8787+ meta : meta;
8888+ new_sha : string; (** new SHA of this ref *)
8989+ old_sha : string; (** old SHA of this ref *)
9090+ ref_ : string; (** Ref being updated *)
8891 repo_did : string; (** did of the owner of the repo *)
8992 repo_name : string; (** name of the repo *)
9090- old_sha : string; (** old SHA of this ref *)
9191- new_sha : string; (** new SHA of this ref *)
9292- meta : meta;
9393}
94949595(** Jsont codec for {!type:main}. *)
···102102(** A declaration of a Tangled account profile. *)
103103104104type main = {
105105+ bluesky : bool; (** Include link to this account on Bluesky. *)
105106 description : string option; (** Free-form profile description text. *)
106107 links : string list option;
107107- stats : string list option;
108108- bluesky : bool; (** Include link to this account on Bluesky. *)
109108 location : string option; (** Free-form location text. *)
110109 pinned_repositories : string list option; (** Any ATURI, it is up to appviews to validate these fields. *)
111110 pronouns : string option; (** Preferred gender pronouns. *)
111111+ stats : string list option;
112112}
113113114114(** Jsont codec for {!type:main}. *)
···119119 module String : sig
120120121121type main = {
122122- filename : string;
122122+ contents : string;
123123+ created_at : string;
123124 description : string;
124124- created_at : string;
125125- contents : string;
125125+ filename : string;
126126}
127127128128(** Jsont codec for {!type:main}. *)
···133133 module Star : sig
134134135135type main = {
136136- subject : string;
137136 created_at : string;
137137+ subject : string;
138138}
139139140140(** Jsont codec for {!type:main}. *)
···144144 module Reaction : sig
145145146146type main = {
147147+ created_at : string;
148148+ reaction : string;
147149 subject : string;
148148- reaction : string;
149149- created_at : string;
150150}
151151152152(** Jsont codec for {!type:main}. *)
···157157 module Repo : sig
158158159159type main = {
160160+ created_at : string;
161161+ description : string option;
162162+ knot : string; (** knot where the repo was created *)
163163+ labels : string list option; (** List of labels that this repo subscribes to *)
160164 name : string; (** name of the repo *)
161161- knot : string; (** knot where the repo was created *)
165165+ source : string option; (** source of the repo *)
162166 spindle : string option; (** CI runner to send jobs to and receive results from *)
163163- description : string option;
164164- website : string option; (** Any URI related to the repo *)
165167 topics : string list option; (** Topics related to the repo *)
166166- source : string option; (** source of the repo *)
167167- labels : string list option; (** List of labels that this repo subscribes to *)
168168- created_at : string;
168168+ website : string option; (** Any URI related to the repo *)
169169}
170170171171(** Jsont codec for {!type:main}. *)
···174174 module Artifact : sig
175175176176type main = {
177177+ artifact : Atp.Blob_ref.t; (** the artifact *)
178178+ created_at : string; (** time of creation of this artifact *)
177179 name : string; (** name of the artifact *)
178180 repo : string; (** repo that this artifact is being uploaded to *)
179181 tag : string; (** hash of the tag object that this artifact is attached to (only annotated tags are supported) *)
180180- created_at : string; (** time of creation of this artifact *)
181181- artifact : Atp.Blob_ref.t; (** the artifact *)
182182}
183183184184(** Jsont codec for {!type:main}. *)
···199199200200201201type input = {
202202+ branch : string; (** Target branch to merge into *)
202203 did : string; (** DID of the repository owner *)
203204 name : string; (** Name of the repository *)
204205 patch : string; (** Patch or pull request to check for merge conflicts *)
205205- branch : string; (** Target branch to merge into *)
206206}
207207208208(** Jsont codec for {!type:input}. *)
···210210211211212212type output = {
213213- is_conflicted : bool; (** Whether the merge has conflicts *)
214213 conflicts : conflict_info list option; (** List of files with merge conflicts *)
215215- message : string option; (** Additional message about the merge check *)
216214 error : string option; (** Error message if check failed *)
215215+ is_conflicted : bool; (** Whether the merge has conflicts *)
216216+ message : string option; (** Additional message about the merge check *)
217217}
218218219219(** Jsont codec for {!type:output}. *)
···223223 module Tree : sig
224224225225type readme = {
226226- filename : string; (** Name of the readme file *)
227226 contents : string; (** Contents of the readme file *)
227227+ filename : string; (** Name of the readme file *)
228228}
229229230230(** Jsont codec for {!type:readme}. *)
···242242243243244244type tree_entry = {
245245+ last_commit : last_commit option;
246246+ mode : string; (** File mode *)
245247 name : string; (** Relative file or directory name *)
246246- mode : string; (** File mode *)
247248 size : int; (** File size in bytes *)
248248- last_commit : last_commit option;
249249}
250250251251(** Jsont codec for {!type:tree_entry}. *)
···254254255255(** Query/procedure parameters. *)
256256type params = {
257257- repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
258258- ref_ : string; (** Git reference (branch, tag, or commit SHA) *)
259257 path : string option; (** Path within the repository tree *)
258258+ ref_ : string; (** Git reference (branch, tag, or commit SHA) *)
259259+ repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
260260}
261261262262(** Jsont codec for {!type:params}. *)
···264264265265266266type output = {
267267- ref_ : string; (** The git reference used *)
267267+ dotdot : string option; (** Parent directory path *)
268268+ files : tree_entry list;
268269 parent : string option; (** The parent path in the tree *)
269269- dotdot : string option; (** Parent directory path *)
270270 readme : readme option; (** Readme for this file tree *)
271271- files : tree_entry list;
271271+ ref_ : string; (** The git reference used *)
272272}
273273274274(** Jsont codec for {!type:output}. *)
···280280281281282282type input = {
283283- repo : string;
284283 default_branch : string;
284284+ repo : string;
285285}
286286287287(** Jsont codec for {!type:input}. *)
···311311312312313313type input = {
314314- did : string; (** DID of the repository owner *)
315315- name : string; (** Name of the repository *)
316316- patch : string; (** Patch content to merge *)
317317- branch : string; (** Target branch to merge into *)
314314+ author_email : string option; (** Author email for the merge commit *)
318315 author_name : string option; (** Author name for the merge commit *)
319319- author_email : string option; (** Author email for the merge commit *)
316316+ branch : string; (** Target branch to merge into *)
320317 commit_body : string option; (** Additional commit message body *)
321318 commit_message : string option; (** Merge commit message *)
319319+ did : string; (** DID of the repository owner *)
320320+ name : string; (** Name of the repository *)
321321+ patch : string; (** Patch content to merge *)
322322}
323323324324(** Jsont codec for {!type:input}. *)
···329329330330(** Query/procedure parameters. *)
331331type params = {
332332- repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
332332+ cursor : string option; (** Pagination cursor *)
333333 limit : int option; (** Maximum number of tags to return *)
334334- cursor : string option; (** Pagination cursor *)
334334+ repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
335335}
336336337337(** Jsont codec for {!type:params}. *)
···345345 module Collaborator : sig
346346347347type main = {
348348- subject : string;
349349- repo : string; (** repo to add this user to *)
350348 created_at : string;
349349+ repo : string; (** repo to add this user to *)
350350+ subject : string;
351351}
352352353353(** Jsont codec for {!type:main}. *)
···358358359359(** Query/procedure parameters. *)
360360type params = {
361361- repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
361361+ cursor : string option; (** Pagination cursor *)
362362 limit : int option; (** Maximum number of branches to return *)
363363- cursor : string option; (** Pagination cursor *)
363363+ repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
364364}
365365366366(** Jsont codec for {!type:params}. *)
···374374 module GetDefaultBranch : sig
375375376376type signature = {
377377- name : string; (** Author name *)
378377 email : string; (** Author email *)
378378+ name : string; (** Author name *)
379379 when_ : string; (** Author timestamp *)
380380}
381381···393393394394395395type output = {
396396+ author : signature option;
397397+ hash : string; (** Latest commit hash on default branch *)
398398+ message : string option; (** Latest commit message *)
396399 name : string; (** Default branch name *)
397397- hash : string; (** Latest commit hash on default branch *)
398400 short_hash : string option; (** Short commit hash *)
399401 when_ : string; (** Timestamp of latest commit *)
400400- message : string option; (** Latest commit message *)
401401- author : signature option;
402402}
403403404404(** Jsont codec for {!type:output}. *)
···410410411411412412type input = {
413413- rkey : string; (** Rkey of the repository record *)
414413 default_branch : string option; (** Default branch to push to *)
414414+ rkey : string; (** Rkey of the repository record *)
415415 source : string option; (** A source URL to clone from, populate this when forking or importing a repository. *)
416416}
417417···424424425425426426type input = {
427427+ branch : string; (** Branch to check status for *)
427428 did : string; (** DID of the fork owner *)
429429+ hidden_ref : string; (** Hidden ref to use for comparison *)
428430 name : string; (** Name of the forked repository *)
429431 source : string; (** Source repository URL *)
430430- branch : string; (** Branch to check status for *)
431431- hidden_ref : string; (** Hidden ref to use for comparison *)
432432}
433433434434(** Jsont codec for {!type:input}. *)
···446446 module Branch : sig
447447448448type signature = {
449449- name : string; (** Author name *)
450449 email : string; (** Author email *)
450450+ name : string; (** Author name *)
451451 when_ : string; (** Author timestamp *)
452452}
453453···457457458458(** Query/procedure parameters. *)
459459type params = {
460460+ name : string; (** Branch name to get information for *)
460461 repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
461461- name : string; (** Branch name to get information for *)
462462}
463463464464(** Jsont codec for {!type:params}. *)
···466466467467468468type output = {
469469- name : string; (** Branch name *)
469469+ author : signature option;
470470 hash : string; (** Latest commit hash on this branch *)
471471+ is_default : bool option; (** Whether this is the default branch *)
472472+ message : string option; (** Latest commit message *)
473473+ name : string; (** Branch name *)
471474 short_hash : string option; (** Short commit hash *)
472475 when_ : string; (** Timestamp of latest commit *)
473473- message : string option; (** Latest commit message *)
474474- author : signature option;
475475- is_default : bool option; (** Whether this is the default branch *)
476476}
477477478478(** Jsont codec for {!type:output}. *)
···484484485485486486type input = {
487487- repo : string;
488487 branch : string;
488488+ repo : string;
489489}
490490491491(** Jsont codec for {!type:input}. *)
···496496497497(** Query/procedure parameters. *)
498498type params = {
499499- repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
500500- ref_ : string; (** Git reference (branch, tag, or commit SHA) *)
501501- path : string option; (** Path to filter commits by *)
499499+ cursor : string option; (** Pagination cursor (commit SHA) *)
502500 limit : int option; (** Maximum number of commits to return *)
503503- cursor : string option; (** Pagination cursor (commit SHA) *)
501501+ path : string option; (** Path to filter commits by *)
502502+ ref_ : string; (** Git reference (branch, tag, or commit SHA) *)
503503+ repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
504504}
505505506506(** Jsont codec for {!type:params}. *)
···513513 end
514514 module Blob : sig
515515516516+type submodule = {
517517+ branch : string option; (** Branch to track in the submodule *)
518518+ name : string; (** Submodule name *)
519519+ url : string; (** Submodule repository URL *)
520520+}
521521+522522+(** Jsont codec for {!type:submodule}. *)
523523+val submodule_jsont : submodule Jsont.t
524524+525525+516526type signature = {
517517- name : string; (** Author name *)
518527 email : string; (** Author email *)
528528+ name : string; (** Author name *)
519529 when_ : string; (** Author timestamp *)
520530}
521531···523533val signature_jsont : signature Jsont.t
524534525535526526-type submodule = {
527527- name : string; (** Submodule name *)
528528- url : string; (** Submodule repository URL *)
529529- branch : string option; (** Branch to track in the submodule *)
530530-}
531531-532532-(** Jsont codec for {!type:submodule}. *)
533533-val submodule_jsont : submodule Jsont.t
534534-535535-536536type last_commit = {
537537+ author : signature option;
537538 hash : string; (** Commit hash *)
538538- short_hash : string option; (** Short commit hash *)
539539 message : string; (** Commit message *)
540540- author : signature option;
540540+ short_hash : string option; (** Short commit hash *)
541541 when_ : string; (** Commit timestamp *)
542542}
543543···547547548548(** Query/procedure parameters. *)
549549type params = {
550550- repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
551551- ref_ : string; (** Git reference (branch, tag, or commit SHA) *)
552550 path : string; (** Path to the file within the repository *)
553551 raw : bool option; (** Return raw file content instead of JSON response *)
552552+ ref_ : string; (** Git reference (branch, tag, or commit SHA) *)
553553+ repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
554554}
555555556556(** Jsont codec for {!type:params}. *)
···558558559559560560type output = {
561561- ref_ : string; (** The git reference used *)
562562- path : string; (** The file path *)
563561 content : string option; (** File content (base64 encoded for binary files) *)
564562 encoding : string option; (** Content encoding *)
565565- size : int option; (** File size in bytes *)
566563 is_binary : bool option; (** Whether the file is binary *)
564564+ last_commit : last_commit option;
567565 mime_type : string option; (** MIME type of the file *)
566566+ path : string; (** The file path *)
567567+ ref_ : string; (** The git reference used *)
568568+ size : int option; (** File size in bytes *)
568569 submodule : submodule option; (** Submodule information if path is a submodule *)
569569- last_commit : last_commit option;
570570}
571571572572(** Jsont codec for {!type:output}. *)
···578578579579580580type input = {
581581+ key : string;
581582 repo : string;
582582- key : string;
583583}
584584585585(** Jsont codec for {!type:input}. *)
···589589 module Languages : sig
590590591591type language = {
592592+ color : string option; (** Hex color code for this language *)
593593+ extensions : string list option; (** File extensions associated with this language *)
594594+ file_count : int option; (** Number of files in this language *)
592595 name : string; (** Programming language name *)
596596+ percentage : int; (** Percentage of total codebase (0-100) *)
593597 size : int; (** Total size of files in this language (bytes) *)
594594- percentage : int; (** Percentage of total codebase (0-100) *)
595595- file_count : int option; (** Number of files in this language *)
596596- color : string option; (** Hex color code for this language *)
597597- extensions : string list option; (** File extensions associated with this language *)
598598}
599599600600(** Jsont codec for {!type:language}. *)
···603603604604(** Query/procedure parameters. *)
605605type params = {
606606+ ref_ : string option; (** Git reference (branch, tag, or commit SHA) *)
606607 repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
607607- ref_ : string option; (** Git reference (branch, tag, or commit SHA) *)
608608}
609609610610(** Jsont codec for {!type:params}. *)
···612612613613614614type output = {
615615- ref_ : string; (** The git reference used *)
616615 languages : language list;
616616+ ref_ : string; (** The git reference used *)
617617+ total_files : int option; (** Total number of files analyzed *)
617618 total_size : int option; (** Total size of all analyzed files in bytes *)
618618- total_files : int option; (** Total number of files analyzed *)
619619}
620620621621(** Jsont codec for {!type:output}. *)
···626626627627(** Query/procedure parameters. *)
628628type params = {
629629- repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
630629 ref_ : string; (** Git reference (branch, tag, or commit SHA) *)
630630+ repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
631631}
632632633633(** Jsont codec for {!type:params}. *)
···643643644644645645type input = {
646646+ branch : string; (** Branch to sync *)
646647 did : string; (** DID of the fork owner *)
647647- source : string; (** AT-URI of the source repository *)
648648 name : string; (** Name of the forked repository *)
649649- branch : string; (** Branch to sync *)
649649+ source : string; (** AT-URI of the source repository *)
650650}
651651652652(** Jsont codec for {!type:input}. *)
···658658659659660660type input = {
661661- repo : string;
662661 key : string;
662662+ repo : string;
663663 value : string;
664664}
665665···684684 module ListSecrets : sig
685685686686type secret = {
687687- repo : string;
688688- key : string;
689687 created_at : string;
690688 created_by : string;
689689+ key : string;
690690+ repo : string;
691691}
692692693693(** Jsont codec for {!type:secret}. *)
···715715716716(** Query/procedure parameters. *)
717717type params = {
718718- repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
719719- ref_ : string; (** Git reference (branch, tag, or commit SHA) *)
720718 format : string option; (** Archive format *)
721719 prefix : string option; (** Prefix for files in the archive *)
720720+ ref_ : string; (** Git reference (branch, tag, or commit SHA) *)
721721+ repo : string; (** Repository identifier in format 'did:plc:.../repoName' *)
722722}
723723724724(** Jsont codec for {!type:params}. *)
···735735736736737737type input = {
738738- repo : string; (** AT-URI of the repository *)
739738 fork_ref : string; (** Fork reference name *)
740739 remote_ref : string; (** Remote reference name *)
740740+ repo : string; (** AT-URI of the repository *)
741741}
742742743743(** Jsont codec for {!type:input}. *)
···745745746746747747type output = {
748748- success : bool; (** Whether the hidden ref was created successfully *)
748748+ error : string option; (** Error message if creation failed *)
749749 ref_ : string option; (** The created hidden ref name *)
750750- error : string option; (** Error message if creation failed *)
750750+ success : bool; (** Whether the hidden ref was created successfully *)
751751}
752752753753(** Jsont codec for {!type:output}. *)
···757757 module Pull : sig
758758759759type target = {
760760- repo : string;
761760 branch : string;
761761+ repo : string;
762762}
763763764764(** Jsont codec for {!type:target}. *)
···767767768768type source = {
769769 branch : string;
770770- sha : string;
771770 repo : string option;
771771+ sha : string;
772772}
773773774774(** Jsont codec for {!type:source}. *)
···776776777777778778type main = {
779779- target : target;
780780- title : string;
781779 body : string option;
780780+ created_at : string;
781781+ mentions : string list option;
782782 patch : string option; (** (deprecated) use patchBlob instead *)
783783 patch_blob : Atp.Blob_ref.t; (** patch content *)
784784+ references : string list option;
784785 source : source option;
785785- created_at : string;
786786- mentions : string list option;
787787- references : string list option;
786786+ target : target;
787787+ title : string;
788788}
789789790790(** Jsont codec for {!type:main}. *)
···793793 module Comment : sig
794794795795type main = {
796796- pull : string;
797796 body : string;
798797 created_at : string;
799798 mentions : string list option;
799799+ pull : string;
800800 references : string list option;
801801}
802802···840840 module Issue : sig
841841842842type main = {
843843- repo : string;
844844- title : string;
845843 body : string option;
846844 created_at : string;
847845 mentions : string list option;
848846 references : string list option;
847847+ repo : string;
848848+ title : string;
849849}
850850851851(** Jsont codec for {!type:main}. *)
···854854 module Comment : sig
855855856856type main = {
857857- issue : string;
858857 body : string;
859858 created_at : string;
860860- reply_to : string option;
859859+ issue : string;
861860 mentions : string list option;
862861 references : string list option;
862862+ reply_to : string option;
863863}
864864865865(** Jsont codec for {!type:main}. *)
···897897 module Definition : sig
898898899899type value_type = {
900900- type_ : string; (** The concrete type of this label's value. *)
901901- format : string; (** An optional constraint that can be applied on string concrete types. *)
902900 enum : string list option; (** Closed set of values that this label can take. *)
901901+ format : string; (** An optional constraint that can be applied on string concrete types. *)
902902+ type_ : string; (** The concrete type of this label's value. *)
903903}
904904905905(** Jsont codec for {!type:value_type}. *)
···907907908908909909type main = {
910910- name : string; (** The display name of this label. *)
911911- value_type : value_type; (** The type definition of this label. Appviews may allow sorting for certain types. *)
912912- scope : string list; (** The areas of the repo this label may apply to, eg.: sh.tangled.repo.issue. Appviews may choose to respect this. *)
913910 color : string option; (** The hex value for the background color for the label. Appviews may choose to respect this. *)
914911 created_at : string;
915912 multiple : bool option; (** Whether this label can be repeated for a given entity, eg.: \[reviewer:foo, reviewer:bar\] *)
913913+ name : string; (** The display name of this label. *)
914914+ scope : string list; (** The areas of the repo this label may apply to, eg.: sh.tangled.repo.issue. Appviews may choose to respect this. *)
915915+ value_type : value_type; (** The type definition of this label. Appviews may allow sorting for certain types. *)
916916}
917917918918(** Jsont codec for {!type:main}. *)
···931931932932933933type main = {
934934- subject : string; (** The subject (task, pull or discussion) of this label. Appviews may apply a `scope` check and refuse this op. *)
935935- performed_at : string;
936934 add : operand list;
937935 delete : operand list;
936936+ performed_at : string;
937937+ subject : string; (** The subject (task, pull or discussion) of this label. Appviews may apply a `scope` check and refuse this op. *)
938938}
939939940940(** Jsont codec for {!type:main}. *)
···946946 module Follow : sig
947947948948type main = {
949949- subject : string;
950949 created_at : string;
950950+ subject : string;
951951}
952952953953(** Jsont codec for {!type:main}. *)
···967967 module Member : sig
968968969969type main = {
970970- subject : string;
970970+ created_at : string;
971971 domain : string; (** domain that this member now belongs to *)
972972- created_at : string;
972972+ subject : string;
973973}
974974975975(** Jsont codec for {!type:main}. *)
···979979 module ListKeys : sig
980980981981type public_key = {
982982+ created_at : string; (** Key upload timestamp *)
982983 did : string; (** DID associated with the public key *)
983984 key : string; (** Public key contents *)
984984- created_at : string; (** Key upload timestamp *)
985985}
986986987987(** Jsont codec for {!type:public_key}. *)
···991991992992(** Query/procedure parameters. *)
993993type params = {
994994- limit : int option; (** Maximum number of keys to return *)
995994 cursor : string option; (** Pagination cursor *)
995995+ limit : int option; (** Maximum number of keys to return *)
996996}
997997998998(** Jsont codec for {!type:params}. *)
···100010001001100110021002type output = {
10031003- keys : public_key list;
10041003 cursor : string option; (** Pagination cursor for next page *)
10041004+ keys : public_key list;
10051005}
1006100610071007(** Jsont codec for {!type:output}. *)
···10361036 module PublicKey : sig
1037103710381038type main = {
10391039+ created_at : string; (** key upload timestamp *)
10391040 key : string; (** public key contents *)
10401041 name : string; (** human-readable name for this key *)
10411041- created_at : string; (** key upload timestamp *)
10421042}
1043104310441044(** Jsont codec for {!type:main}. *)
···10481048 module Pipeline : sig
1049104910501050type trigger_repo = {
10511051- knot : string;
10511051+ default_branch : string;
10521052 did : string;
10531053+ knot : string;
10531054 repo : string;
10541054- default_branch : string;
10551055}
1056105610571057(** Jsont codec for {!type:trigger_repo}. *)
···105910591060106010611061type push_trigger_data = {
10621062- ref_ : string;
10631062 new_sha : string;
10641063 old_sha : string;
10641064+ ref_ : string;
10651065}
1066106610671067(** Jsont codec for {!type:push_trigger_data}. *)
···106910691070107010711071type pull_request_trigger_data = {
10721072+ action : string;
10721073 source_branch : string;
10731073- target_branch : string;
10741074 source_sha : string;
10751075- action : string;
10751075+ target_branch : string;
10761076}
1077107710781078(** Jsont codec for {!type:pull_request_trigger_data}. *)
10791079val pull_request_trigger_data_jsont : pull_request_trigger_data Jsont.t
108010801081108110821082-type clone_opts = {
10831083- skip : bool;
10841084- depth : int;
10851085- submodules : bool;
10861086-}
10871087-10881088-(** Jsont codec for {!type:clone_opts}. *)
10891089-val clone_opts_jsont : clone_opts Jsont.t
10901090-10911091-10921082type pair = {
10931083 key : string;
10941084 value : string;
···10981088val pair_jsont : pair Jsont.t
109910891100109011011101-type manual_trigger_data = {
11021102- inputs : pair list option;
10911091+type clone_opts = {
10921092+ depth : int;
10931093+ skip : bool;
10941094+ submodules : bool;
11031095}
1104109611051105-(** Jsont codec for {!type:manual_trigger_data}. *)
11061106-val manual_trigger_data_jsont : manual_trigger_data Jsont.t
10971097+(** Jsont codec for {!type:clone_opts}. *)
10981098+val clone_opts_jsont : clone_opts Jsont.t
110710991108110011091101type workflow = {
11101110- name : string;
11111111- engine : string;
11121102 clone : clone_opts;
11031103+ engine : string;
11041104+ name : string;
11131105 raw : string;
11141106}
11151107···11171109val workflow_jsont : workflow Jsont.t
111811101119111111121112+type manual_trigger_data = {
11131113+ inputs : pair list option;
11141114+}
11151115+11161116+(** Jsont codec for {!type:manual_trigger_data}. *)
11171117+val manual_trigger_data_jsont : manual_trigger_data Jsont.t
11181118+11191119+11201120type trigger_metadata = {
11211121 kind : string;
11221122+ manual : manual_trigger_data option;
11231123+ pull_request : pull_request_trigger_data option;
11241124+ push : push_trigger_data option;
11221125 repo : trigger_repo;
11231123- push : push_trigger_data option;
11241124- pull_request : pull_request_trigger_data option;
11251125- manual : manual_trigger_data option;
11261126}
1127112711281128(** Jsont codec for {!type:trigger_metadata}. *)
···11401140 module Status : sig
1141114111421142type main = {
11431143- pipeline : string; (** ATURI of the pipeline *)
11441144- workflow : string; (** name of the workflow within this pipeline *)
11451145- status : string; (** status of the workflow *)
11461143 created_at : string; (** time of creation of this status update *)
11471144 error : string option; (** error message if failed *)
11481145 exit_code : int option; (** exit code if failed *)
11461146+ pipeline : string; (** ATURI of the pipeline *)
11471147+ status : string; (** status of the workflow *)
11481148+ workflow : string; (** name of the workflow within this pipeline *)
11491149}
1150115011511151(** Jsont codec for {!type:main}. *)
+4-4
xrpc/xrpc.mli
···1818 The library provides:
1919 - {!Client}: Low-level XRPC operations (query, procedure, blob upload)
2020 - {!Credential}: Session management with automatic token refresh
2121- - {!Error}: Structured error types wrapped as Eio exceptions
2121+ - {!module:Error}: Structured error types wrapped as Eio exceptions
2222 - {!Jwt}: JWT payload decoding for token expiry checking
2323 - {!Types}: Core data types (session, error payload, etc.)
2424···8787(** {1 Type Aliases} *)
88888989type client = Xrpc_client.t
9090-(** Alias for {!Xrpc_client.t}. *)
9090+(** Alias for [Xrpc_client.t]. *)
91919292type session = Xrpc_types.session
9393-(** Alias for {!Xrpc_types.session}. *)
9393+(** Alias for [Xrpc_types.session]. *)
94949595type error = Xrpc_error.error
9696-(** Alias for {!Xrpc_error.error}. *)
9696+(** Alias for [Xrpc_error.error]. *)
+5-5
xrpc/xrpc_client.mli
···9393 @param params Query parameters as key-value pairs
9494 @param decoder jsont codec for decoding the response
95959696- @raise Eio.Io with {!Xrpc_error.E} on failure *)
9696+ @raise Eio.Io with [Xrpc_error.E] on failure *)
97979898val procedure :
9999 t ->
···112112 @param input_data Optional request body data
113113 @param decoder jsont codec for decoding the response
114114115115- @raise Eio.Io with {!Xrpc_error.E} on failure *)
115115+ @raise Eio.Io with [Xrpc_error.E] on failure *)
116116117117val procedure_blob :
118118 t ->
···130130 @param blob Raw binary data to upload
131131 @param content_type MIME type of the blob (e.g., ["image/jpeg"])
132132133133- @raise Eio.Io with {!Xrpc_error.E} on failure *)
133133+ @raise Eio.Io with [Xrpc_error.E] on failure *)
134134135135(** {1 Raw Binary Operations} *)
136136···141141 Returns [(body, content_type)]. Used for endpoints that return binary data
142142 like [com.atproto.sync.getBlob].
143143144144- @raise Eio.Io with {!Xrpc_error.E} on failure *)
144144+ @raise Eio.Io with [Xrpc_error.E] on failure *)
145145146146val procedure_bytes :
147147 t ->
···155155156156 Returns [Some (body, content_type)] or [None] for 204 No Content.
157157158158- @raise Eio.Io with {!Xrpc_error.E} on failure *)
158158+ @raise Eio.Io with [Xrpc_error.E] on failure *)
+3-3
xrpc/xrpc_cred.mli
···111111 @param password Account password or app password
112112 @param auth_factor_token Optional 2FA token if required
113113114114- @raise Eio.Io with {!Xrpc_error.E} on authentication failure *)
114114+ @raise Eio.Io with [Xrpc_error.E] on authentication failure *)
115115116116val login_client :
117117 t ->
···127127 Returns a new client with auto-refresh enabled. The original client is
128128 updated with the session but doesn't have the refresh interceptor.
129129130130- @raise Eio.Io with {!Xrpc_error.E} on authentication failure *)
130130+ @raise Eio.Io with [Xrpc_error.E] on authentication failure *)
131131132132val resume : t -> session:Xrpc_types.session -> unit -> Xrpc_client.t
133133(** [resume cred ~session ()] resumes from a stored session.
···135135 Returns a client with automatic token refresh. If the access token is
136136 expired but refresh token is valid, a refresh is attempted immediately.
137137138138- @raise Eio.Io with {!Xrpc_error.E} if the refresh token is also expired *)
138138+ @raise Eio.Io with [Xrpc_error.E] if the refresh token is also expired *)
139139140140val logout : t -> unit
141141(** [logout cred] logs out and clears the session.
+1-1
xrpc/xrpc_types.mli
···10101111 {2 Session}
12121313- The {!session} type represents an authenticated user session. Sessions
1313+ The {!type:session} type represents an authenticated user session. Sessions
1414 contain JWT tokens for authentication and metadata about the user.
15151616 {2 Error Payload}