Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
3.5 kB · 65 lines
Go
at next-dev
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
package org_tangled
// schema: org.tangled.query.enrichResponse
import ( "context"
comatprototypes "github.com/bluesky-social/indigo/api/atproto" "github.com/bluesky-social/indigo/lex/util")
const ( QueryEnrichResponseNSID = "org.tangled.query.enrichResponse")
// QueryEnrichResponse_Input is the input argument to a org.tangled.query.enrichResponse call.type QueryEnrichResponse_Input struct { // enrich: Payloads to compute for each found reference. Enrich []*QueryEnrichResponse_LinkDescriptor `json:"enrich" cborgen:"enrich"` // params: Parameters for the inner query, exactly as it declares them. Params *util.LexiconTypeDecoder `json:"params,omitempty" cborgen:"params,omitempty"` // viewer: DID whose own relation to each reference is looked up for viewer payloads and views. Required when any descriptor requests a viewer payload. Viewer *string `json:"viewer,omitempty" cborgen:"viewer,omitempty"` // xrpc: NSID of the inner query to run, e.g. org.tangled.repo.listRepos. Xrpc string `json:"xrpc" cborgen:"xrpc"`}
// QueryEnrichResponse_Labels is a "labels" in the org.tangled.query.enrichResponse schema.//// Moderation labels the configured labeler applied. Only !hide and !warn are served, takedowns leave subjects out instead. Use collection:. for labels on the record, collection:.repo for labels on its author's account. Absent when there are none.type QueryEnrichResponse_Labels struct { Labels []*comatprototypes.LabelDefs_Label `json:"labels" cborgen:"labels"`}
// QueryEnrichResponse_LinkDescriptor is a "linkDescriptor" in the org.tangled.query.enrichResponse schema.//// One sidecar payload, computed from the records at a link source whose reference equals the found reference.type QueryEnrichResponse_LinkDescriptor struct { // source: Collection whose records are linked, a colon, then an index-backed path (subject or .repo), or . for the record the reference names, which hydrates into that collection's view. Source string `json:"source" cborgen:"source"` // targets: Record paths into the inner response selecting references for this payload. A path can end in an envelope: path:.repo for a ref's author, path:.rkey for the did its rkey names, path:. for the ref itself. All references are considered when omitted. Targets []string `json:"targets,omitempty" cborgen:"targets,omitempty"` // type: NSID of the payload type to produce, which also defines the payload's shape. Results land at data[ref][source][type]. Type string `json:"type" cborgen:"type"`}
// QueryEnrichResponse_Output is the output of a org.tangled.query.enrichResponse call.type QueryEnrichResponse_Output struct { // data: Reference (did or at-uri) -> link source -> payload type nsid -> payload. References no descriptor applies to are absent. Data *util.LexiconTypeDecoder `json:"data" cborgen:"data"` // output: The inner query's response, unmodified. Output *util.LexiconTypeDecoder `json:"output" cborgen:"output"`}
// QueryEnrichResponse calls the XRPC method "org.tangled.query.enrichResponse".func QueryEnrichResponse(ctx context.Context, c util.LexClient, input *QueryEnrichResponse_Input) (*QueryEnrichResponse_Output, error) { var out QueryEnrichResponse_Output if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.query.enrichResponse", nil, input, &out); err != nil { return nil, err }
return &out, nil}