diff options
Diffstat (limited to 'desk/lib/json')
-rw-r--r-- | desk/lib/json/nostrill.hoon | 51 | ||||
-rw-r--r-- | desk/lib/json/trill.hoon | 30 |
2 files changed, 69 insertions, 12 deletions
diff --git a/desk/lib/json/nostrill.hoon b/desk/lib/json/nostrill.hoon index bd34acc..b5a619c 100644 --- a/desk/lib/json/nostrill.hoon +++ b/desk/lib/json/nostrill.hoon @@ -1,4 +1,4 @@ -/- sur=nostrill, nsur=nostr, feed=trill-feed +/- sur=nostrill, nsur=nostr, feed=trill-feed, comms=nostrill-comms /+ sr=sortug, common=json-common, trill=json-trill, nostr=json-nostr |% ++ en @@ -70,9 +70,13 @@ %+ frond %fact %+ frond -.f ?- -.f - %post (postfact +.f) - %enga (enga +.f) + %nostr (en-nostr-feed +.f) + %post (postfact +.f) + %enga (enga +.f) == + ++ tedfact |= pf=post-fact:ui:sur ^- json + %+ frond -.pf + (post-wrapper +.pf) ++ postfact |= pf=post-fact:ui:sur ^- json %+ frond -.pf (post-wrapper +.pf) @@ -93,6 +97,21 @@ =. l ?~ relay.p l :_ l ['relay' %s u.relay.p] =. l ?~ pr.p l :_ l ['profile' (user-meta:en:nostr u.pr.p)] %- pairs l + + ++ beg-res |= =res:comms ^- json + %+ frond %begs %+ frond -.res + ?- -.res + %ok (resd +.res) + %ng [%s msg.res] + == + ++ resd |= rd=res-data:comms ^- json + %+ frond -.rd + ?- -.rd + %feed (feed-with-cursor:en:trill +.rd) + :: TODO wrap it for nostr shit + %thread (full-node:en:trill +.rd) + %prof (user-meta:en:nostr +.rd) + == -- ++ de =, dejs-soft:format @@ -102,6 +121,7 @@ %- of :~ keys+ul fols+ui-fols + begs+ui-begs prof+ui-prof post+ui-post rela+ui-relay @@ -111,15 +131,21 @@ add+hex:de:common del+hex:de:common == +++ ui-begs + %- of :~ + feed+(se:de:common %p) + thread+de-pid + == +++ de-pid + %- ot :~ + host+(se:de:common %p) + id+de-atom-id + == ++ ui-prof %- of :~ - add+add-prof - del+hex:de:common + add+user-meta:de:nostr + del+ul == -++ add-prof %- ot :~ - pubkey+hex:de:common - meta+user-meta:de:nostr -== ++ ui-post %- of :~ add+de-post @@ -138,9 +164,12 @@ == ++ ui-relay %- of :~ - send+de-relay + add+so + del+so + sync+ul + send+de-relay-send == -++ de-relay %- ot :~ +++ de-relay-send %- ot :~ host+(se:de:common %p) id+de-atom-id relays+(ar so) diff --git a/desk/lib/json/trill.hoon b/desk/lib/json/trill.hoon index efa4ffc..415d2f4 100644 --- a/desk/lib/json/trill.hoon +++ b/desk/lib/json/trill.hoon @@ -185,7 +185,35 @@ :~ ship+(patp:en:common ship.pid) id+(ud:en:common id.pid) == - :: + ++ full-node + |= p=full-node:post ^- json + %- pairs + :~ id+(ud:en:common id.p) + host+(patp:en:common host.p) + author+(patp:en:common author.p) + thread+(ud:en:common thread.p) + parent+?~(parent.p ~ (ud:en:common u.parent.p)) + contents+(content contents.p) + hash+(b64:en:common hash.p) + engagement+(engagement engagement.p) + children+(internal-graph children.p) + time+(time id.p) + == + ++ internal-graph + |= int=internal-graph:post ^- json + ?- -.int + %empty ~ + %full (full-graph +.int) + == + ++ full-graph + |= f=full-graph:post + ^- json + %- pairs + %+ turn (tap:form:post f) + |= [post-id=@da fn=full-node:post] + ^- [@ta json] + :- (crip (scow:sr %ud `@ud`post-id)) + (full-node fn) :: -- -- |