2020-03-01 03:31:05 +03:00
|
|
|
:: metadata: helpers for getting data from the metadata-store
|
|
|
|
::
|
2021-01-28 09:13:57 +03:00
|
|
|
/- store=metadata-store
|
2021-02-08 05:07:32 +03:00
|
|
|
/+ resource, grpl=group
|
2020-03-01 03:31:05 +03:00
|
|
|
::
|
|
|
|
|_ =bowl:gall
|
2021-02-08 05:07:32 +03:00
|
|
|
+* grp ~(. grpl bowl)
|
|
|
|
::
|
|
|
|
++ get-preview
|
|
|
|
|= rid=resource
|
|
|
|
|^ ^- group-preview:store
|
|
|
|
?> (can-join:grp rid src.bowl)
|
|
|
|
=/ members
|
|
|
|
~(wyt in (members:grp rid))
|
|
|
|
=/ =metadatum:store
|
2021-02-19 09:58:31 +03:00
|
|
|
(need (peek-metadatum %groups rid))
|
2021-02-08 05:07:32 +03:00
|
|
|
[rid channels members channel-count metadatum]
|
|
|
|
::
|
|
|
|
++ channels
|
|
|
|
%- ~(gas by *associations:store)
|
|
|
|
%+ scag 5
|
|
|
|
%+ skim ~(tap by (app-metadata-for-group rid %graph))
|
|
|
|
|=([=md-resource:store group=resource =metadatum:store] preview.metadatum)
|
|
|
|
::
|
|
|
|
++ channel-count
|
|
|
|
~(wyt by (app-metadata-for-group rid %graph))
|
|
|
|
--
|
|
|
|
::
|
2021-02-02 07:31:35 +03:00
|
|
|
++ resource-for-update
|
|
|
|
|= =vase
|
|
|
|
^- (list resource)
|
|
|
|
=/ =update:store !<(update:store vase)
|
|
|
|
?. ?=(?(%add %remove %initial-group) -.update) ~
|
|
|
|
~[group.update]
|
|
|
|
::
|
2020-03-01 03:31:05 +03:00
|
|
|
++ app-paths-from-group
|
2021-01-28 09:13:57 +03:00
|
|
|
|= [=app-name:store group=resource]
|
2021-01-12 07:26:19 +03:00
|
|
|
^- (list resource)
|
2020-03-01 03:31:05 +03:00
|
|
|
%+ murn
|
|
|
|
%~ tap in
|
2021-01-12 07:26:19 +03:00
|
|
|
=- (~(gut by -) group ~)
|
2021-01-28 09:13:57 +03:00
|
|
|
.^ (jug resource md-resource:store)
|
2020-03-01 03:31:05 +03:00
|
|
|
%gy
|
|
|
|
(scot %p our.bowl)
|
|
|
|
%metadata-store
|
|
|
|
(scot %da now.bowl)
|
|
|
|
/group-indices
|
|
|
|
==
|
2021-01-28 09:13:57 +03:00
|
|
|
|= =md-resource:store
|
2021-01-12 07:26:19 +03:00
|
|
|
^- (unit resource)
|
2020-06-08 10:53:16 +03:00
|
|
|
?. =(app-name.md-resource app-name) ~
|
2021-01-12 07:26:19 +03:00
|
|
|
`resource.md-resource
|
2020-03-01 03:31:05 +03:00
|
|
|
::
|
2021-01-15 08:45:51 +03:00
|
|
|
++ app-metadata-for-group
|
2021-01-28 09:13:57 +03:00
|
|
|
|= [group=resource =app-name:store]
|
2021-08-20 02:09:28 +03:00
|
|
|
^- associations:store
|
2021-01-28 09:13:57 +03:00
|
|
|
=/ =associations:store
|
2021-01-15 08:45:51 +03:00
|
|
|
(metadata-for-group group)
|
2021-01-28 09:13:57 +03:00
|
|
|
%- ~(gas by *associations:store)
|
2021-01-15 08:45:51 +03:00
|
|
|
%+ skim ~(tap by associations)
|
2021-01-28 09:13:57 +03:00
|
|
|
|= [=md-resource:store association:store]
|
|
|
|
=(app-name app-name.md-resource)
|
2021-01-15 08:45:51 +03:00
|
|
|
::
|
2021-01-13 07:50:37 +03:00
|
|
|
++ metadata-for-group
|
|
|
|
|= group=resource
|
2021-08-20 02:09:28 +03:00
|
|
|
^- associations:store
|
2021-01-28 09:13:57 +03:00
|
|
|
.^ associations:store
|
2021-01-13 07:50:37 +03:00
|
|
|
%gx (scot %p our.bowl) %metadata-store (scot %da now.bowl)
|
2021-01-14 01:50:39 +03:00
|
|
|
%group (snoc (en-path:resource group) %noun)
|
2021-01-13 07:50:37 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ md-resources-from-group
|
|
|
|
|= group=resource
|
2021-08-20 02:09:28 +03:00
|
|
|
^- (set md-resource:store)
|
2021-01-13 07:50:37 +03:00
|
|
|
=- (~(get ju -) group)
|
2021-01-28 09:13:57 +03:00
|
|
|
.^ (jug resource md-resource:store)
|
2021-01-13 07:50:37 +03:00
|
|
|
%gy
|
|
|
|
(scot %p our.bowl)
|
|
|
|
%metadata-store
|
|
|
|
(scot %da now.bowl)
|
|
|
|
/group-indices
|
|
|
|
==
|
|
|
|
::
|
2021-01-13 07:05:22 +03:00
|
|
|
++ peek-association
|
|
|
|
|= [app-name=term rid=resource]
|
2021-08-20 02:09:28 +03:00
|
|
|
^- (unit association:store)
|
2021-01-28 09:13:57 +03:00
|
|
|
.^ (unit association:store)
|
2020-10-22 04:29:35 +03:00
|
|
|
%gx (scot %p our.bowl) %metadata-store (scot %da now.bowl)
|
2021-01-14 01:50:39 +03:00
|
|
|
%metadata app-name (snoc (en-path:resource rid) %noun)
|
2020-10-22 04:29:35 +03:00
|
|
|
==
|
|
|
|
::
|
2021-01-28 09:13:57 +03:00
|
|
|
++ peek-metadatum
|
|
|
|
|= =md-resource:store
|
2021-08-20 02:09:28 +03:00
|
|
|
^- (unit metadatum:store)
|
2021-01-13 07:05:22 +03:00
|
|
|
%+ bind (peek-association md-resource)
|
2021-01-28 09:13:57 +03:00
|
|
|
|=(association:store metadatum)
|
2020-10-22 04:29:35 +03:00
|
|
|
::
|
2021-01-13 07:05:22 +03:00
|
|
|
++ peek-group
|
2021-01-28 09:13:57 +03:00
|
|
|
|= =md-resource:store
|
2021-01-14 01:50:39 +03:00
|
|
|
^- (unit resource)
|
2021-01-13 07:05:22 +03:00
|
|
|
%+ bind (peek-association md-resource)
|
2021-01-28 09:13:57 +03:00
|
|
|
|=(association:store group)
|
2020-06-08 10:53:16 +03:00
|
|
|
--
|