This repository has no description
0

Configure Feed

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

core / lexicons / query / enrichResponse.json
3.6 kB 100 lines
1{ 2 "lexicon": 1, 3 "id": "sh.tangled.query.enrichResponse", 4 "defs": { 5 "main": { 6 "type": "procedure", 7 "description": "Run an XRPC query and hydrate its response with a data sidecar: typed payloads for every did / at-uri / strong-ref found in the response.", 8 "input": { 9 "encoding": "application/json", 10 "schema": { 11 "type": "object", 12 "required": ["xrpc", "enrich"], 13 "properties": { 14 "xrpc": { 15 "type": "string", 16 "format": "nsid", 17 "description": "NSID of the inner query to run, e.g. sh.tangled.repo.listRepos." 18 }, 19 "params": { 20 "type": "unknown", 21 "description": "Parameters for the inner query, exactly as it declares them." 22 }, 23 "enrich": { 24 "type": "array", 25 "items": { 26 "type": "ref", 27 "ref": "#linkDescriptor" 28 }, 29 "description": "Payloads to compute for each found reference." 30 }, 31 "viewer": { 32 "type": "string", 33 "format": "did", 34 "description": "DID whose own relation to each reference is looked up for viewer payloads. Required when any descriptor requests one." 35 } 36 } 37 } 38 }, 39 "output": { 40 "encoding": "application/json", 41 "schema": { 42 "type": "object", 43 "required": ["output", "data"], 44 "properties": { 45 "output": { 46 "type": "unknown", 47 "description": "The inner query's response, unmodified." 48 }, 49 "data": { 50 "type": "unknown", 51 "description": "Reference (did or at-uri) -> link source -> payload type nsid -> payload. References no descriptor applies to are absent." 52 } 53 } 54 } 55 }, 56 "errors": [ 57 { 58 "name": "UnknownQuery", 59 "description": "The xrpc parameter does not name a query this server can execute" 60 }, 61 { 62 "name": "InvalidTargetPath", 63 "description": "A targets entry is not a valid record path" 64 }, 65 { 66 "name": "InvalidLinkDescriptor", 67 "description": "An enrich entry names an unknown payload type, collection, or path" 68 } 69 ] 70 }, 71 "linkDescriptor": { 72 "type": "object", 73 "required": ["source", "type"], 74 "description": "One sidecar payload, computed from the records at a link source whose reference equals the found reference.", 75 "properties": { 76 "source": { 77 "type": "string", 78 "description": "Collection whose records are linked, a colon, then an index-backed path (subject or .repo)." 79 }, 80 "type": { 81 "type": "string", 82 "knownValues": [ 83 "sh.tangled.query.enrichResponse#count", 84 "sh.tangled.query.enrichResponse#distinctAuthors", 85 "sh.tangled.query.enrichResponse#viewer", 86 "com.bad-example.identity.miniDoc" 87 ], 88 "description": "NSID of the payload type to produce, which also defines the payload's shape. Results land at data[ref][source][type]." 89 }, 90 "targets": { 91 "type": "array", 92 "items": { 93 "type": "string" 94 }, 95 "description": "Record paths into the inner response selecting references for this payload. All references are considered when omitted." 96 } 97 } 98 } 99 } 100}