push-hook: use mark conversion to get resource

This commit is contained in:
Liam Fitzgerald 2021-01-14 09:27:32 +10:00
parent 20da8a6ed3
commit 478e45d373
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
4 changed files with 67 additions and 8 deletions

View File

@ -175,9 +175,11 @@
|^
?- -.old
%1
=. cards
:_(cards (build-mark:hc %sing))
=^ og-cards push-hook
(on-load:og inner-state.old)
[(weld cards og-cards) this(state old)]
[(weld (flop cards) og-cards) this(state old)]
::
%0
%_ $
@ -274,11 +276,18 @@
=^ cards push-hook
(on-leave:og path)
[cards this]
::
++ on-arvo
|= [=wire =sign-arvo]
=^ cards push-hook
(on-arvo:og wire sign-arvo)
[cards this]
?. ?=([%helper %push-hook @ *] wire)
=^ cards push-hook
(on-arvo:og wire sign-arvo)
[cards this]
?. ?=(%resource-conversion i.t.t.wire)
(on-arvo:def wire sign-arvo)
:_ this
~[(build-mark:hc %next)]
::
++ on-fail
|= [=term =tang]
=^ cards push-hook
@ -368,7 +377,7 @@
|= =vase
^- (list card:agent:gall)
=/ rid=(unit resource)
(resource-for-update:og vase)
(resource-for-update vase)
?~ rid ~
=/ prefix=path
resource+(en-path:resource u.rid)
@ -385,7 +394,7 @@
|= =vase
^- (list card:agent:gall)
=/ rid=(unit resource)
(resource-for-update:og vase)
(resource-for-update vase)
?~ rid ~
=/ =path
resource+(en-path:resource u.rid)
@ -394,5 +403,30 @@
=/ dap=term
?:(=(our.bowl entity.u.rid) store-name.config dap.bowl)
[%pass wire %agent [entity.u.rid dap] %poke update-mark.config vase]~
::
++ get-conversion
.^ tube:clay
%cc (scot %p our.bowl) %home (scot %da now.bowl)
/[update-mark.config]/resource
==
::
++ resource-for-update
|= update=vase
=/ =tube:clay
get-conversion
%+ bind
(mole |.((tube update)))
|=(=vase !<(resource vase))
::
++ build-mark
|= rav=?(%sing %next)
^- card
=/ =wire
(make-wire /resource-conversion)
=/ =mood:clay
[%c da+now.bowl /[update-mark.config]/resource]
=/ =rave:clay
?:(?=(%next rav) [rav mood] [rav mood])
[%pass wire %arvo %c %warp our.bowl [%home `rave]]
--
--

View File

@ -7,6 +7,13 @@
|%
++ noun upd
++ json (update:enjs upd)
++ resource
?+ -.q.upd !!
?(%run-updates %add-nodes %remove-nodes %add-graph) resource.q.upd
?(%remove-graph %archive-graph %unarchive-graph) resource.q.upd
?(%add-tag %remove-tag) resource.q.upd
?(%add-signatures %remove-signatures) resource.uid.q.upd
==
++ mime [/application/x-urb-graph-update (as-octs (jam upd))]
--
::

View File

@ -4,9 +4,13 @@
++ grow
|%
++ noun upd
++ resource
?< ?=(%initial -.upd)
resource.upd
::
++ json
%+ frond:enjs:format 'groupUpdate'
(update:enjs upd)
%+ frond:enjs:format 'groupUpdate'
(update:enjs upd)
--
++ grab
|%

View File

@ -0,0 +1,14 @@
/+ resource
|_ rid=resource
++ grad %noun
++ grow
|%
++ noun rid
++ json (enjs:resource rid)
--
++ grab
|%
++ noun resource
++ json dejs:resource
--
--