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

View File

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

View File

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

View File

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

View File

@ -155,7 +155,7 @@
|^ |^
=^ cards state =^ cards state
?+ mark (on-poke:def mark vase) ?+ mark (on-poke:def mark vase)
?(%metadata-action %metadata-update-1) ?(%metadata-action %metadata-update-2)
(poke-metadata-update !<(update:store vase)) (poke-metadata-update !<(update:store vase))
:: ::
%import %import
@ -299,7 +299,7 @@
=/ cards=(list card) =/ cards=(list card)
?+ path (on-watch:def path) ?+ path (on-watch:def path)
[%all ~] [%all ~]
(give %metadata-update-1 !>([%associations associations])) (give %metadata-update-2 !>([%associations associations]))
:: ::
[%updates ~] [%updates ~]
~ ~
@ -307,7 +307,7 @@
[%app-name @ ~] [%app-name @ ~]
=/ =app-name:store i.t.path =/ =app-name:store i.t.path
=/ app-indices (metadata-for-app:mc app-name) =/ app-indices (metadata-for-app:mc app-name)
(give %metadata-update-1 !>([%associations app-indices])) (give %metadata-update-2 !>([%associations app-indices]))
== ==
[cards this] [cards this]
:: ::
@ -565,6 +565,6 @@
++ update-subscribers ++ update-subscribers
|= [pax=path =update:store] |= [pax=path =update:store]
^- (list card) ^- (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 /+ store=metadata-store
|_ =update:store |_ =update:one:store
++ grad %noun ++ grad %noun
++ grow ++ grow
|% |%
++ noun update ++ noun update
++ json (update:enjs:store update) ++ metadata-update-2
^- update:store
update
-- --
:: ::
++ grab ++ grab
|% |%
++ noun update:store ++ noun update:one:store
++ json action:dejs: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 :: historical
++ one
|%
::
+$ action
$~ [%remove *resource *md-resource]
$< %edit ^action
::
+$ update
$~ [%remove *resource *md-resource]
$< %edit ^update
::
--
++ zero ++ zero
|% |%
:: ::

View File

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

View File

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

View File

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

View File

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