mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 19:55:53 +03:00
metadata-store: upgrade to mark v2
This commit is contained in:
parent
0eb89a5715
commit
16d9a0f35b
@ -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
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
::
|
||||
|
@ -14,7 +14,7 @@
|
||||
update:store
|
||||
%metadata-update
|
||||
%metadata-pull-hook
|
||||
1 1
|
||||
2 2
|
||||
==
|
||||
::
|
||||
+$ agent (push-hook:push-hook config)
|
||||
|
@ -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)]~
|
||||
--
|
||||
--
|
||||
|
@ -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
|
||||
--
|
||||
--
|
||||
|
15
pkg/arvo/mar/metadata/update-2.hoon
Normal file
15
pkg/arvo/mar/metadata/update-2.hoon
Normal 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
|
||||
--
|
||||
--
|
@ -90,6 +90,18 @@
|
||||
==
|
||||
==
|
||||
:: historical
|
||||
++ one
|
||||
|%
|
||||
::
|
||||
+$ action
|
||||
$~ [%remove *resource *md-resource]
|
||||
$< %edit ^action
|
||||
::
|
||||
+$ update
|
||||
$~ [%remove *resource *md-resource]
|
||||
$< %edit ^update
|
||||
::
|
||||
--
|
||||
++ zero
|
||||
|%
|
||||
::
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
::
|
||||
|
@ -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 ~)
|
||||
|
@ -31,7 +31,7 @@
|
||||
==
|
||||
;< ~ bind:m
|
||||
%+ poke-our %metadata-push-hook
|
||||
:- %metadata-update-1
|
||||
:- %metadata-update-2
|
||||
!> ^- action:met
|
||||
:^ %add
|
||||
group.action
|
||||
|
Loading…
Reference in New Issue
Block a user