urbit/pkg/arvo/sur/metadata-store.hoon

73 lines
1.6 KiB
Plaintext
Raw Normal View History

2021-01-12 07:26:19 +03:00
/- *resource
^?
2020-02-13 03:50:24 +03:00
|%
2021-01-12 07:26:19 +03:00
::
+$ app-name term
2021-01-12 07:26:19 +03:00
+$ md-resource [=app-name =resource]
2021-01-28 09:13:57 +03:00
+$ association [group=resource =metadatum]
+$ associations (map md-resource association)
+$ group-preview
$: group=resource
channels=associations
members=@ud
channel-count=@ud
2021-01-28 09:13:57 +03:00
=metadatum
==
2020-02-13 03:50:24 +03:00
::
+$ color @ux
2021-01-14 04:12:48 +03:00
+$ url @t
2021-01-20 04:51:07 +03:00
::
2021-01-26 04:46:06 +03:00
:: $vip-metadata: variation in permissions
2021-01-20 04:51:07 +03:00
::
:: This will be passed to the graph-permissions mark
:: conversion to allow for custom permissions.
::
:: %reader-comments: Allow readers to comment, regardless
2021-01-26 04:46:06 +03:00
:: of whether they can write. (notebook, collections)
:: %member-metadata: Allow members to add channels (groups)
2021-01-20 04:51:07 +03:00
:: %$: No variation
::
2021-01-26 04:46:06 +03:00
+$ vip-metadata ?(%reader-comments %member-metadata %$)
+$ md-config
$~ [%empty ~]
$% [%group feed=(unit (unit md-resource))]
[%graph module=term]
[%empty ~]
==
::
2021-01-28 09:13:57 +03:00
+$ metadatum
$: title=cord
description=cord
=color
date-created=time
creator=ship
config=md-config
2021-01-14 04:12:48 +03:00
picture=url
2021-01-26 04:46:06 +03:00
preview=?
hidden=?
2021-01-26 04:46:06 +03:00
vip=vip-metadata
2020-02-13 03:50:24 +03:00
==
::
2021-01-28 09:13:57 +03:00
+$ action
$% [%add group=resource resource=md-resource =metadatum]
2021-01-12 07:26:19 +03:00
[%remove group=resource resource=md-resource]
2021-01-13 07:50:37 +03:00
[%initial-group group=resource =associations]
2020-02-13 03:50:24 +03:00
==
::
2021-01-28 09:13:57 +03:00
+$ hook-update
$% [%req-preview group=resource]
[%preview group-preview]
==
::
2021-01-28 09:13:57 +03:00
+$ update
$% action
[%associations =associations]
2021-01-28 09:13:57 +03:00
$: %updated-metadata
group=resource
resource=md-resource
before=metadatum
=metadatum
==
==
2020-02-13 03:50:24 +03:00
--