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 "sources": { 32 "type": "array", 33 "items": { 34 "type": "string" 35 }, 36 "description": "Record paths into the inner response restricting which references get payloads. All references are enriched when omitted." 37 }, 38 "viewer": { 39 "type": "string", 40 "format": "did", 41 "description": "DID whose own relation to each reference is looked up for viewer payloads. Required when any descriptor requests one." 42 } 43 } 44 } 45 }, 46 "output": { 47 "encoding": "application/json", 48 "schema": { 49 "type": "object", 50 "required": ["output", "data"], 51 "properties": { 52 "output": { 53 "type": "unknown", 54 "description": "The inner query's response, unmodified." 55 }, 56 "data": { 57 "type": "unknown", 58 "description": "Reference (did or at-uri) -> link source -> payload type nsid -> payload. References no descriptor applies to are absent." 59 } 60 } 61 } 62 }, 63 "errors": [ 64 { 65 "name": "UnknownQuery", 66 "description": "The xrpc parameter does not name a query this server can execute" 67 }, 68 { 69 "name": "InvalidSourcePath", 70 "description": "A sources entry is not a valid record path" 71 }, 72 { 73 "name": "InvalidLinkDescriptor", 74 "description": "An enrich entry names an unknown payload type, collection, or path" 75 } 76 ] 77 }, 78 "linkDescriptor": { 79 "type": "object", 80 "required": ["source", "type"], 81 "description": "One sidecar payload, computed from the records at a link source whose reference equals the found reference.", 82 "properties": { 83 "source": { 84 "type": "string", 85 "description": "Collection whose records are linked, a colon, then an index-backed path (subject or .repo)." 86 }, 87 "type": { 88 "type": "string", 89 "knownValues": [ 90 "sh.tangled.query.enrichResponse#count", 91 "sh.tangled.query.enrichResponse#distinctAuthors", 92 "sh.tangled.query.enrichResponse#viewer", 93 "com.bad-example.identity.miniDoc" 94 ], 95 "description": "NSID of the payload type to produce, which also defines the payload's shape. Results land at data[ref][source][type]." 96 } 97 } 98 } 99 } 100}