graph-hooks: upgrade for versioning

This commit is contained in:
Liam Fitzgerald 2021-03-11 14:00:50 +10:00
parent 360b447a3e
commit 4b305b5450
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
24 changed files with 56 additions and 35 deletions

View File

@ -9,6 +9,7 @@
update:store
%graph-update
%graph-push-hook
0 0
%.n
==
--

View File

@ -12,6 +12,7 @@
update:store
%graph-update
%graph-pull-hook
0 0
==
::
+$ agent (push-hook:push-hook config)

View File

@ -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

View File

@ -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]]

View File

@ -12,7 +12,7 @@
contents.post contents
==
::
:- %graph-update
:- %graph-update-0
^- update
:+ %0 now
:+ %add-nodes [our name]

View File

@ -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]]

View File

@ -5,6 +5,6 @@
|= $: [now=@da eny=@uvJ =beak]
[[=term =resource ~] ~]
==
:- %graph-update
:- %graph-update-0
^- update
[%0 now [%add-tag term resource]]

View File

@ -5,6 +5,6 @@
|= $: [now=@da eny=@uvJ =beak]
[[=resource ~] ~]
==
:- %graph-update
:- %graph-update-0
^- update
[%0 now [%archive-graph resource]]

View File

@ -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)

View File

@ -4,6 +4,6 @@
|= $: [now=@da eny=@uvJ bec=beak]
[[graph=term =path ~] ~]
==
:- %graph-update
:- %graph-update-0
=- ~& update=- -
.^(=update:graph-store %cx path)

View File

@ -5,6 +5,6 @@
|= $: [now=@da eny=@uvJ =beak]
[[=resource ~] ~]
==
:- %graph-update
:- %graph-update-0
^- update
[%0 now [%remove-graph resource]]

View File

@ -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]]

View File

@ -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]]

View File

@ -5,6 +5,6 @@
|= $: [now=@da eny=@uvJ =beak]
[[=term =resource ~] ~]
==
:- %graph-update
:- %graph-update-0
^- update
[%0 now [%remove-tag term resource]]

View File

@ -5,6 +5,6 @@
|= $: [now=@da eny=@uvJ =beak]
[[=resource ~] ~]
==
:- %graph-update
:- %graph-update-0
^- update
[%0 now [%unarchive-graph resource]]

View 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)))
--
--

View File

@ -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]))
::

View File

@ -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]))
::

View File

@ -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

View File

@ -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 ~)
--
::

View File

@ -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]))
::

View File

@ -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

View File

@ -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

View File

@ -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