mirror of
https://github.com/urbit/shrub.git
synced 2024-12-11 11:02:25 +03:00
graph-hooks: upgrade for versioning
This commit is contained in:
parent
360b447a3e
commit
4b305b5450
@ -9,6 +9,7 @@
|
||||
update:store
|
||||
%graph-update
|
||||
%graph-push-hook
|
||||
0 0
|
||||
%.n
|
||||
==
|
||||
--
|
||||
|
@ -12,6 +12,7 @@
|
||||
update:store
|
||||
%graph-update
|
||||
%graph-pull-hook
|
||||
0 0
|
||||
==
|
||||
::
|
||||
+$ agent (push-hook:push-hook config)
|
||||
|
@ -207,7 +207,7 @@
|
||||
++ give
|
||||
|= =update-0:store
|
||||
^- (list card)
|
||||
[%give %fact ~ [%graph-update !>([%0 now.bowl update-0])]]~
|
||||
[%give %fact ~ [%graph-update-0 !>([%0 now.bowl update-0])]]~
|
||||
--
|
||||
::
|
||||
++ on-poke
|
||||
@ -218,7 +218,7 @@
|
||||
?> (team:title our.bowl src.bowl)
|
||||
=^ cards state
|
||||
?+ mark (on-poke:def mark vase)
|
||||
%graph-update (graph-update !<(update:store vase))
|
||||
%graph-update-0 (graph-update !<(update:store vase))
|
||||
%noun (debug !<(debug-input vase))
|
||||
%import (poke-import q.vase)
|
||||
==
|
||||
@ -646,7 +646,7 @@
|
||||
[cards state]
|
||||
=* update upd.i.updates
|
||||
=^ crds state
|
||||
%- graph-update
|
||||
%- graph-update
|
||||
^- update:store
|
||||
?- -.q.update
|
||||
%add-graph update(resource.q resource)
|
||||
@ -660,7 +660,7 @@
|
||||
++ give
|
||||
|= [paths=(list path) update=update-0:store]
|
||||
^- (list card)
|
||||
[%give %fact paths [%graph-update !>([%0 now.bowl update])]]~
|
||||
[%give %fact paths [%graph-update-0 !>([%0 now.bowl update])]]~
|
||||
--
|
||||
::
|
||||
++ debug
|
||||
@ -862,15 +862,15 @@
|
||||
``noun+!>(q.u.result)
|
||||
::
|
||||
[%x %keys ~]
|
||||
:- ~ :- ~ :- %graph-update
|
||||
:- ~ :- ~ :- %graph-update-0
|
||||
!>(`update:store`[%0 now.bowl [%keys ~(key by graphs)]])
|
||||
::
|
||||
[%x %tags ~]
|
||||
:- ~ :- ~ :- %graph-update
|
||||
:- ~ :- ~ :- %graph-update-0
|
||||
!>(`update:store`[%0 now.bowl [%tags ~(key by tag-queries)]])
|
||||
::
|
||||
[%x %tag-queries ~]
|
||||
:- ~ :- ~ :- %graph-update
|
||||
:- ~ :- ~ :- %graph-update-0
|
||||
!>(`update:store`[%0 now.bowl [%tag-queries tag-queries]])
|
||||
::
|
||||
[%x %graph @ @ ~]
|
||||
@ -879,7 +879,7 @@
|
||||
=/ result=(unit marked-graph:store)
|
||||
(~(get by graphs) [ship term])
|
||||
?~ result [~ ~]
|
||||
:- ~ :- ~ :- %graph-update
|
||||
:- ~ :- ~ :- %graph-update-0
|
||||
!> ^- update:store
|
||||
:+ %0
|
||||
now.bowl
|
||||
@ -895,7 +895,7 @@
|
||||
?~ result
|
||||
~& no-archived-graph+[ship term]
|
||||
[~ ~]
|
||||
:- ~ :- ~ :- %graph-update
|
||||
:- ~ :- ~ :- %graph-update-0
|
||||
!> ^- update:store
|
||||
:+ %0
|
||||
now.bowl
|
||||
@ -912,7 +912,7 @@
|
||||
=/ graph=(unit marked-graph:store)
|
||||
(~(get by graphs) [ship term])
|
||||
?~ graph [~ ~]
|
||||
:- ~ :- ~ :- %graph-update
|
||||
:- ~ :- ~ :- %graph-update-0
|
||||
!> ^- update:store
|
||||
:+ %0 now.bowl
|
||||
:+ %add-nodes
|
||||
@ -939,7 +939,7 @@
|
||||
(turn t.t.t.t.path (cury slav %ud))
|
||||
=/ node=(unit node:store) (get-node ship term index)
|
||||
?~ node [~ ~]
|
||||
:- ~ :- ~ :- %graph-update
|
||||
:- ~ :- ~ :- %graph-update-0
|
||||
!> ^- update:store
|
||||
:+ %0
|
||||
now.bowl
|
||||
@ -959,7 +959,7 @@
|
||||
=/ graph
|
||||
(get-node-children ship term parent)
|
||||
?~ graph [~ ~]
|
||||
:- ~ :- ~ :- %graph-update
|
||||
:- ~ :- ~ :- %graph-update-0
|
||||
!> ^- update:store
|
||||
:+ %0
|
||||
now.bowl
|
||||
@ -990,7 +990,7 @@
|
||||
=/ children
|
||||
(get-node-children ship term index)
|
||||
?~ children [~ ~]
|
||||
:- ~ :- ~ :- %graph-update
|
||||
:- ~ :- ~ :- %graph-update-0
|
||||
!> ^- update:store
|
||||
:+ %0
|
||||
now.bowl
|
||||
@ -1017,7 +1017,7 @@
|
||||
?- -.children.u.node
|
||||
%empty [~ ~]
|
||||
%graph
|
||||
:- ~ :- ~ :- %graph-update
|
||||
:- ~ :- ~ :- %graph-update-0
|
||||
!> ^- update:store
|
||||
:+ %0
|
||||
now.bowl
|
||||
|
@ -5,6 +5,6 @@
|
||||
|= $: [now=@da eny=@uvJ =beak]
|
||||
[[=resource mark=(unit mark) overwrite=? ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
^- update
|
||||
[%0 now [%add-graph resource (gas:orm ~ ~) mark overwrite]]
|
||||
|
@ -12,7 +12,7 @@
|
||||
contents.post contents
|
||||
==
|
||||
::
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
^- update
|
||||
:+ %0 now
|
||||
:+ %add-nodes [our name]
|
||||
|
@ -5,6 +5,6 @@
|
||||
|= $: [now=@da eny=@uvJ =beak]
|
||||
[[[=resource =index] =signatures ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
^- update
|
||||
[%0 now [%add-signatures [resource index] signatures]]
|
||||
|
@ -5,6 +5,6 @@
|
||||
|= $: [now=@da eny=@uvJ =beak]
|
||||
[[=term =resource ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
^- update
|
||||
[%0 now [%add-tag term resource]]
|
||||
|
@ -5,6 +5,6 @@
|
||||
|= $: [now=@da eny=@uvJ =beak]
|
||||
[[=resource ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
^- update
|
||||
[%0 now [%archive-graph resource]]
|
||||
|
@ -4,7 +4,7 @@
|
||||
|= $: [now=@da eny=@uvJ bec=beak]
|
||||
[[=ship graph=term ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
=/ our (scot %p p.bec)
|
||||
=/ wen (scot %da now)
|
||||
=/ who (scot %p ship)
|
||||
|
@ -4,6 +4,6 @@
|
||||
|= $: [now=@da eny=@uvJ bec=beak]
|
||||
[[graph=term =path ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
=- ~& update=- -
|
||||
.^(=update:graph-store %cx path)
|
||||
|
@ -5,6 +5,6 @@
|
||||
|= $: [now=@da eny=@uvJ =beak]
|
||||
[[=resource ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
^- update
|
||||
[%0 now [%remove-graph resource]]
|
||||
|
@ -5,6 +5,6 @@
|
||||
|= $: [now=@da eny=@uvJ =beak]
|
||||
[[=resource indices=(set index) ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
^- update
|
||||
[%0 now [%remove-nodes resource indices]]
|
||||
|
@ -6,6 +6,6 @@
|
||||
|= $: [now=@da eny=@uvJ =beak]
|
||||
[[[=resource =index] =signatures ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
^- update
|
||||
[%0 now [%remove-signatures [resource index] signatures]]
|
||||
|
@ -5,6 +5,6 @@
|
||||
|= $: [now=@da eny=@uvJ =beak]
|
||||
[[=term =resource ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
^- update
|
||||
[%0 now [%remove-tag term resource]]
|
||||
|
@ -5,6 +5,6 @@
|
||||
|= $: [now=@da eny=@uvJ =beak]
|
||||
[[=resource ~] ~]
|
||||
==
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
^- update
|
||||
[%0 now [%unarchive-graph resource]]
|
||||
|
19
pkg/arvo/mar/graph/update-0.hoon
Normal file
19
pkg/arvo/mar/graph/update-0.hoon
Normal file
@ -0,0 +1,19 @@
|
||||
/+ *graph-store
|
||||
=* as-octs as-octs:mimes:html
|
||||
::
|
||||
|_ upd=update
|
||||
++ grad %noun
|
||||
++ grow
|
||||
|%
|
||||
++ noun upd
|
||||
++ json (update:enjs upd)
|
||||
++ mime [/application/x-urb-graph-update (as-octs (jam upd))]
|
||||
--
|
||||
::
|
||||
++ grab
|
||||
|%
|
||||
++ noun update
|
||||
++ json update:dejs
|
||||
++ mime |=([* =octs] ;;(update (cue q.octs)))
|
||||
--
|
||||
--
|
@ -33,7 +33,7 @@
|
||||
=/ hashes (nodes-to-pending-indices nodes.q.update)
|
||||
;< ~ bind:m
|
||||
%^ poke-our %graph-push-hook
|
||||
%graph-update
|
||||
%graph-update-0
|
||||
!>(update)
|
||||
(pure:m !>(`action:graph-view`[%pending-indices hashes]))
|
||||
::
|
||||
|
@ -54,7 +54,7 @@
|
||||
=/ =update:graph
|
||||
[%0 now.bowl %add-graph rid.action *graph:graph mark.action overwrite]
|
||||
;< ~ bind:m
|
||||
(poke-our %graph-store graph-update+!>(update))
|
||||
(poke-our %graph-store graph-update-0+!>(update))
|
||||
;< ~ bind:m
|
||||
(poke-our %graph-push-hook %push-hook-action !>([%add rid.action]))
|
||||
::
|
||||
|
@ -36,7 +36,7 @@
|
||||
^- form:m
|
||||
;< =bowl:spider bind:m get-bowl:strandio
|
||||
;< ~ bind:m
|
||||
(poke-our %graph-store %graph-update !>([%0 now.bowl %remove-graph rid]))
|
||||
(poke-our %graph-store %graph-update-0 !>([%0 now.bowl %remove-graph rid]))
|
||||
;< ~ bind:m
|
||||
(poke-our %graph-push-hook %push-hook-action !>([%remove rid]))
|
||||
;< ~ bind:m
|
||||
|
@ -39,7 +39,7 @@
|
||||
;< ~ bind:m
|
||||
(poke-our %graph-pull-hook %pull-hook-action !>([%remove rid]))
|
||||
;< ~ bind:m
|
||||
(poke-our %graph-store %graph-update !>([%0 now [%remove-graph rid]]))
|
||||
(poke-our %graph-store %graph-update-0 !>([%0 now [%remove-graph rid]]))
|
||||
(pure:m ~)
|
||||
--
|
||||
::
|
||||
|
@ -17,7 +17,7 @@
|
||||
;< =bowl:spider bind:m get-bowl:strandio
|
||||
:: unarchive graph and share it
|
||||
;< ~ bind:m
|
||||
(poke-our %graph-store %graph-update !>([%0 now.bowl %unarchive-graph rid]))
|
||||
(poke-our %graph-store %graph-update-0 !>([%0 now.bowl %unarchive-graph rid]))
|
||||
;< ~ bind:m
|
||||
(poke-our %graph-push-hook %push-hook-action !>([%add rid]))
|
||||
::
|
||||
|
@ -19,7 +19,7 @@
|
||||
;< ~ bind:m
|
||||
%+ raw-poke
|
||||
[entity.resource.update %group-push-hook]
|
||||
:- %group-update
|
||||
:- %group-update-0
|
||||
!> ^- update:grp
|
||||
[%remove-members resource.update (silt [our.bowl ~])]
|
||||
:: stop serving or syncing group updates
|
||||
@ -70,7 +70,7 @@
|
||||
;< ~ bind:m
|
||||
%+ raw-poke
|
||||
[our.bowl %graph-store]
|
||||
:- %graph-update
|
||||
:- %graph-update-0
|
||||
!> ^- update:gra
|
||||
[%0 now.bowl [%archive-graph app-resource]]
|
||||
;< ~ bind:m
|
||||
|
@ -14,7 +14,7 @@
|
||||
=/ =post:post [our index wen [%text body]~ ~ ~]
|
||||
=/ =node:graph-store [post %empty ~]
|
||||
=/ act=update:graph-store [%0 wen %add-nodes rid (my [index node] ~)]
|
||||
(poke-app our %graph-push-hook %graph-update act)
|
||||
(poke-app our %graph-push-hook %graph-update-0 act)
|
||||
--
|
||||
::
|
||||
^- thread:spider
|
||||
|
@ -14,7 +14,7 @@
|
||||
=/ =post:post [our index wen [%text body]~ ~ ~]
|
||||
=/ =node:graph-store [post %empty ~]
|
||||
=/ act=update:graph-store [%0 wen %add-nodes rid (my [index node] ~)]
|
||||
(poke-app our %graph-push-hook %graph-update act)
|
||||
(poke-app our %graph-push-hook %graph-update-0 act)
|
||||
--
|
||||
::
|
||||
^- thread:spider
|
||||
|
Loading…
Reference in New Issue
Block a user