2021-01-11 22:39:36 +03:00
|
|
|
/- spider, grp=group-store, gra=graph-store, met=metadata-store
|
2020-12-01 01:30:20 +03:00
|
|
|
/+ strandio, res=resource
|
|
|
|
::
|
|
|
|
=* strand strand:spider
|
|
|
|
=* raw-poke raw-poke:strandio
|
|
|
|
=* scry scry:strandio
|
|
|
|
::
|
|
|
|
^- thread:spider
|
|
|
|
|= arg=vase
|
|
|
|
=/ m (strand ,vase)
|
|
|
|
^- form:m
|
2020-12-04 15:45:35 +03:00
|
|
|
=+ !<([~ =update:grp] arg)
|
2020-12-01 01:30:20 +03:00
|
|
|
?. ?=(%remove-group -.update)
|
|
|
|
(pure:m !>(~))
|
|
|
|
;< =bowl:spider bind:m get-bowl:strandio
|
2020-12-02 00:20:45 +03:00
|
|
|
:: tell group host to remove us as member
|
|
|
|
::
|
|
|
|
;< ~ bind:m
|
|
|
|
%+ raw-poke
|
|
|
|
[entity.resource.update %group-push-hook]
|
|
|
|
:- %group-update
|
|
|
|
!> ^- update:grp
|
|
|
|
[%remove-members resource.update (silt [our.bowl ~])]
|
|
|
|
:: stop serving or syncing group updates
|
|
|
|
::
|
|
|
|
;< ~ bind:m
|
|
|
|
%+ raw-poke
|
|
|
|
[our.bowl %group-push-hook]
|
|
|
|
:- %push-hook-action
|
|
|
|
!>([%remove resource.update])
|
|
|
|
;< ~ bind:m
|
|
|
|
%+ raw-poke
|
|
|
|
[our.bowl %group-pull-hook]
|
|
|
|
:- %pull-hook-action
|
|
|
|
!>([%remove resource.update])
|
2020-12-01 01:59:30 +03:00
|
|
|
:: stop serving or syncing metadata associated with group
|
|
|
|
::
|
2020-12-01 01:30:20 +03:00
|
|
|
;< ~ bind:m
|
|
|
|
%+ raw-poke
|
|
|
|
[our.bowl %metadata-hook]
|
|
|
|
:- %metadata-hook-action
|
2020-12-02 00:20:45 +03:00
|
|
|
!>([%remove (en-path:res resource.update)])
|
2020-12-01 01:59:30 +03:00
|
|
|
:: get metadata associated with group
|
2020-12-02 00:20:45 +03:00
|
|
|
::
|
2020-12-01 01:30:20 +03:00
|
|
|
;< =associations:met bind:m
|
|
|
|
%+ scry associations:met
|
|
|
|
;: weld
|
|
|
|
/gx/metadata-store/group
|
|
|
|
(en-path:res resource.update)
|
|
|
|
/noun
|
|
|
|
==
|
2020-12-01 01:59:30 +03:00
|
|
|
=/ entries=(list [g=group-path:met m=md-resource:met])
|
|
|
|
~(tap in ~(key by associations))
|
|
|
|
|- ^- form:m
|
|
|
|
=* loop $
|
|
|
|
?~ entries
|
|
|
|
(pure:m !>(~))
|
|
|
|
:: remove metadata associated with group
|
|
|
|
::
|
2020-12-01 01:30:20 +03:00
|
|
|
;< ~ bind:m
|
2020-12-01 01:59:30 +03:00
|
|
|
%+ raw-poke
|
|
|
|
[our.bowl %metadata-store]
|
|
|
|
:- %metadata-action
|
|
|
|
!> ^- metadata-action:met
|
|
|
|
[%remove g.i.entries m.i.entries]
|
|
|
|
:: archive graph associated with group
|
|
|
|
::
|
2020-12-10 22:49:51 +03:00
|
|
|
=/ app-resource (de-path-soft:res app-path.m.i.entries)
|
|
|
|
?~ app-resource
|
|
|
|
loop(entries t.entries)
|
2020-12-01 01:59:30 +03:00
|
|
|
;< ~ bind:m
|
|
|
|
%+ raw-poke
|
|
|
|
[our.bowl %graph-store]
|
|
|
|
:- %graph-update
|
|
|
|
!> ^- update:gra
|
2020-12-10 22:49:51 +03:00
|
|
|
[%0 now.bowl [%archive-graph u.app-resource]]
|
2020-12-01 21:51:26 +03:00
|
|
|
;< ~ bind:m
|
|
|
|
%+ raw-poke
|
|
|
|
[our.bowl %graph-pull-hook]
|
|
|
|
:- %pull-hook-action
|
2020-12-10 22:49:51 +03:00
|
|
|
!>([%remove u.app-resource])
|
2020-12-01 01:59:30 +03:00
|
|
|
loop(entries t.entries)
|