Monorepo for Tangled tangled.org
1

Configure Feed

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

bobbin: add sh.tangled.string.getString

mimicing getIssue and getPublicKey

Signed-off-by: oppiliappan <me@oppi.li>

author
oppiliappan
committer
Tangled
date (Jul 24, 2026, 9:09 PM +0300) commit e48927d1 parent 24e4c43f change-id svokotky
+68 -1
+22 -1
bobbin/crates/xrpc/src/lib.rs
··· 74 74 Member as SpindleMember, MemberRecord as SpindleMemberRecord, 75 75 }; 76 76 use bobbin_types::sh_tangled::spindle::{Spindle, SpindleRecord}; 77 - use bobbin_types::sh_tangled::string::{TangledString, TangledStringRecord}; 77 + use bobbin_types::sh_tangled::string::{ 78 + TangledString, TangledStringGetRecordOutput, TangledStringRecord, 79 + }; 78 80 use futures::Stream; 79 81 use futures::stream::{self, StreamExt, TryStreamExt}; 80 82 use jacquard_common::types::did::Did; ··· 401 403 "/xrpc/sh.tangled.spindle.countMembers", 402 404 get(count_spindle_members), 403 405 ) 406 + .route("/xrpc/sh.tangled.string.getString", get(get_string)) 404 407 .route("/xrpc/sh.tangled.string.listStrings", get(list_strings)) 405 408 .route("/xrpc/sh.tangled.string.countStrings", get(count_strings)) 406 409 .route("/xrpc/sh.tangled.search.query", get(search_query)) ··· 617 620 #[derive(Debug, Deserialize)] 618 621 struct GetPullQuery { 619 622 pull: AtUri<DefaultStr>, 623 + } 624 + 625 + #[derive(Debug, Deserialize)] 626 + struct GetStringQuery { 627 + string: AtUri<DefaultStr>, 620 628 } 621 629 622 630 #[derive(Debug, Deserialize)] ··· 1313 1321 ) -> Result<Json<Deduped<PullGetRecordOutput<DefaultStr>>>, XrpcError> { 1314 1322 let (body, value) = fetch::<PullRecord, Pull<DefaultStr>>(&state, &q.pull).await?; 1315 1323 Ok(Json(Deduped(PullGetRecordOutput { 1324 + cid: Some(body.cid.clone()), 1325 + uri: body.uri.clone(), 1326 + value, 1327 + }))) 1328 + } 1329 + 1330 + async fn get_string( 1331 + State(state): State<AppState>, 1332 + XrpcQuery(q): XrpcQuery<GetStringQuery>, 1333 + ) -> Result<Json<Deduped<TangledStringGetRecordOutput<DefaultStr>>>, XrpcError> { 1334 + let (body, value) = 1335 + fetch::<TangledStringRecord, TangledString<DefaultStr>>(&state, &q.string).await?; 1336 + Ok(Json(Deduped(TangledStringGetRecordOutput { 1316 1337 cid: Some(body.cid.clone()), 1317 1338 uri: body.uri.clone(), 1318 1339 value,
+41
lexicons/string/getString.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.tangled.string.getString", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "parameters": { 8 + "type": "params", 9 + "required": ["string"], 10 + "properties": { 11 + "string": { 12 + "type": "string", 13 + "format": "at-uri", 14 + "description": "AT-URI of the sh.tangled.string record to fetch." 15 + } 16 + } 17 + }, 18 + "output": { 19 + "encoding": "application/json", 20 + "schema": { 21 + "type": "object", 22 + "required": ["uri", "value"], 23 + "properties": { 24 + "uri": { 25 + "type": "string", 26 + "format": "at-uri" 27 + }, 28 + "cid": { 29 + "type": "string", 30 + "format": "cid" 31 + }, 32 + "value": { 33 + "type": "unknown", 34 + "description": "Embedded sh.tangled.string record." 35 + } 36 + } 37 + } 38 + } 39 + } 40 + } 41 + }
+5
localinfra/pds.env
··· 10 10 PDS_DID_PLC_URL=http://localhost:8080 11 11 PDS_HOSTNAME=pds.tngl.boltless.dev 12 12 PDS_PORT=3000 13 + 14 + # firehose backfill window. default is 24h (DAY), which makes cursor=0 emit an 15 + # OutdatedCursor #info once history is >24h old; hydrant mishandles that info 16 + # frame and loops. widen the window so cursor=0 streams from seq 1 cleanly. 17 + PDS_REPO_BACKFILL_LIMIT_MS=31536000000 13 18 # PDS_CRAWLERS=https://relay.tngl.boltless.dev