metadata-store: upgrade to mark v2

This commit is contained in:
Liam Fitzgerald 2021-07-09 12:54:55 +10:00
parent 0eb89a5715
commit 16d9a0f35b
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
12 changed files with 53 additions and 19 deletions

View File

@ -289,7 +289,7 @@
::
++ md-fact
|= [=mark =vase]
?. ?=(%metadata-update-1 mark) jn-core
?. ?=(%metadata-update-2 mark) jn-core
=+ !<(=update:metadata vase)
?. ?=(%initial-group -.update) jn-core
?. =(group.update rid) jn-core

View File

@ -113,7 +113,7 @@
(group-update !<(update:group-store q.cage.sign))
[cards this]
::
%metadata-update-1
%metadata-update-2
=^ cards state
(metadata-update !<(update:metadata q.cage.sign))
[cards this]

View File

@ -38,7 +38,7 @@
update:metadata
%metadata-update
%metadata-push-hook
1 1
2 2
%.n
==
+$ state-zero
@ -180,7 +180,7 @@
%kick [watch-store^~ state]
::
%fact
?> ?=(%metadata-update-1 p.cage.sign)
?> ?=(%metadata-update-2 p.cage.sign)
=+ !<(=update:metadata q.cage.sign)
?. ?=(%initial-group -.update) `state
`state(previews (~(del by previews) group.update))
@ -325,7 +325,7 @@
%+ turn ~(tap by associations)
|= [=md-resource:metadata =association:metadata]
%+ poke-our:pass:io %metadata-store
:- %metadata-update-1
:- %metadata-update-2
!> ^- update:metadata
[%remove resource md-resource]
::

View File

@ -14,7 +14,7 @@
update:store
%metadata-update
%metadata-pull-hook
1 1
2 2
==
::
+$ agent (push-hook:push-hook config)

View File

@ -155,7 +155,7 @@
|^
=^ cards state
?+ mark (on-poke:def mark vase)
?(%metadata-action %metadata-update-1)
?(%metadata-action %metadata-update-2)
(poke-metadata-update !<(update:store vase))
::
%import
@ -299,7 +299,7 @@
=/ cards=(list card)
?+ path (on-watch:def path)
[%all ~]
(give %metadata-update-1 !>([%associations associations]))
(give %metadata-update-2 !>([%associations associations]))
::
[%updates ~]
~
@ -307,7 +307,7 @@
[%app-name @ ~]
=/ =app-name:store i.t.path
=/ app-indices (metadata-for-app:mc app-name)
(give %metadata-update-1 !>([%associations app-indices]))
(give %metadata-update-2 !>([%associations app-indices]))
==
[cards this]
::
@ -565,6 +565,6 @@
++ update-subscribers
|= [pax=path =update:store]
^- (list card)
[%give %fact ~[pax] %metadata-update-1 !>(update)]~
[%give %fact ~[pax] %metadata-update-2 !>(update)]~
--
--

View File

@ -1,15 +1,22 @@
/+ store=metadata-store
|_ =update:store
|_ =update:one:store
++ grad %noun
++ grow
|%
++ noun update
++ json (update:enjs:store update)
++ metadata-update-2
^- update:store
update
--
::
++ grab
|%
++ noun update:store
++ json action:dejs:store
++ noun update:one:store
:: This is ok, we don't send %edit over the wire yet.
++ metadata-update-2
|= upd=update:store
^- update:one:store
?< ?=(%edit -.upd)
upd
--
--

View File

@ -0,0 +1,15 @@
/+ store=metadata-store
|_ =update:store
++ grad %noun
++ grow
|%
++ noun update
++ json (update:enjs:store update)
--
::
++ grab
|%
++ noun update:store
++ json update:dejs:store
--
--

View File

@ -90,6 +90,18 @@
==
==
:: historical
++ one
|%
::
+$ action
$~ [%remove *resource *md-resource]
$< %edit ^action
::
+$ update
$~ [%remove *resource *md-resource]
$< %edit ^update
::
--
++ zero
|%
::

View File

@ -46,7 +46,7 @@
(poke-our %graph-push-hook %push-hook-action !>([%add feed-rid]))
;< ~ bind:m
%+ poke-our %metadata-push-hook
:- %metadata-update-1
:- %metadata-update-2
!> ^- action:met
:^ %add
group.action
@ -54,7 +54,7 @@
metadatum(feed.config ``[%graph feed-rid])
;< ~ bind:m
%+ poke-our %metadata-push-hook
:- %metadata-update-1
:- %metadata-update-2
!> ^- action:met
:^ %add
group.action

View File

@ -78,7 +78,7 @@
=/ met-action=action:met
[%add group graph+rid.action metadatum]
;< ~ bind:m
(poke-our %metadata-push-hook metadata-update-1+!>(met-action))
(poke-our %metadata-push-hook metadata-update-2+!>(met-action))
::
:: Send invites
::

View File

@ -41,7 +41,7 @@
(poke-our %graph-push-hook %push-hook-action !>([%remove rid]))
;< ~ bind:m
%+ poke-our %metadata-push-hook
:- %metadata-update-1
:- %metadata-update-2
!> ^- action:metadata
[%remove group-rid [%graph rid]]
(pure:m ~)

View File

@ -31,7 +31,7 @@
==
;< ~ bind:m
%+ poke-our %metadata-push-hook
:- %metadata-update-1
:- %metadata-update-2
!> ^- action:met
:^ %add
group.action