shrub/pkg/arvo/lib/graph-view.hoon

111 lines
2.0 KiB
Plaintext
Raw Normal View History

/- sur=graph-view, store=graph-store
2020-09-03 17:12:12 +03:00
/+ resource, group-store
^?
=< [sur .]
=, sur
|%
++ dejs
=, dejs:format
|%
++ action
|^
^- $-(json ^action)
%- of
:~ create+create
delete+delete
join+join
2020-09-04 10:51:28 +03:00
leave+leave
2020-09-10 14:36:00 +03:00
groupify+groupify
2020-12-11 08:51:29 +03:00
eval+so
pending-indices+pending-indices
create-group-feed+create-group-feed
dismiss-group-feed+dismiss-group-feed
2020-09-03 17:12:12 +03:00
::invite+invite
==
::
++ create
2020-09-15 04:23:13 +03:00
%- ou
:~ resource+(un dejs:resource)
title+(un so)
description+(un so)
mark+(uf ~ (mu so))
associated+(un associated)
module+(un so)
2020-09-10 13:20:00 +03:00
==
2020-09-03 17:12:12 +03:00
::
2020-09-04 10:51:28 +03:00
++ leave
%- ot
:~ resource+dejs:resource
==
::
2020-09-03 17:12:12 +03:00
++ delete
%- ot
:~ resource+dejs:resource
==
::
++ join
%- ot
:~ resource+dejs:resource
2020-09-11 03:10:44 +03:00
ship+(su ;~(pfix sig fed:ag))
2020-09-03 17:12:12 +03:00
==
::
2020-09-10 14:36:00 +03:00
++ groupify
%- ou
:~ resource+(un dejs:resource)
to+(uf ~ (mu dejs:resource))
==
::
++ pending-indices (op hex (su ;~(pfix fas (more fas dem))))
::
2020-09-03 17:12:12 +03:00
++ invite !!
2020-09-04 10:51:28 +03:00
::
2020-09-03 17:12:12 +03:00
++ associated
%- of
:~ group+dejs:resource
policy+policy:dejs:group-store
==
::
++ create-group-feed
%- ot
:~ resource+dejs:resource
==
::
++ dismiss-group-feed
%- ot
:~ resource+dejs:resource
==
2020-09-03 17:12:12 +03:00
--
--
::
++ enjs
=, enjs:format
|%
++ action
|= act=^action
^- json
?> ?=(%pending-indices -.act)
%+ frond %pending-indices
%- pairs
%+ turn ~(tap by pending.act)
|= [h=hash:store i=index:store]
^- [@t json]
=/ idx (index i)
?> ?=(%s -.idx)
[p.idx s+(scot %ux h)]
::
++ index
|= i=index:store
^- json
?: =(~ i) s+'/'
=/ j=^tape ""
|-
?~ i [%s (crip j)]
=/ k=json (numb i.i)
?> ?=(%n -.k)
%_ $
i t.i
j (weld j (weld "/" (trip +.k)))
==
--
2020-09-03 17:12:12 +03:00
--