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

202 lines
4.2 KiB
Plaintext
Raw Normal View History

/- chat-store, graph-store, post, *resource, group-store, metadata-store
2020-10-21 08:54:59 +03:00
^?
|%
++ state-zero
|%
+$ state
$: %0
notifications=notifications
archive=notifications
current-timebox=@da
dnd=_|
==
++ orm
((ordered-map @da timebox) gth)
::
+$ notifications
((mop @da timebox) gth)
::
+$ timebox
(map index notification)
::
+$ index
$% [%graph group=resource graph=resource module=@t description=@t]
[%group group=resource description=@t]
[%chat chat=path mention=?]
==
::
+$ group-contents
$~ [%add-members *resource ~]
$% [%add *]
[%remove *] :: old metadata actions
$>(?(%add-members %remove-members) update:group-store)
==
::
+$ contents
2021-03-18 10:02:39 +03:00
$% [%graph =(list post:post-zero:post)]
[%group =(list group-contents)]
[%chat =(list envelope:chat-store)]
==
::
+$ notification
[date=@da read=? =contents]
--
::
2020-12-16 07:22:23 +03:00
++ state-one
|%
2020-12-16 10:37:10 +03:00
+$ state
$: %1
unreads-each=(jug index index:graph-store)
2020-12-16 07:22:23 +03:00
unreads-count=(map index @ud)
last-seen=(map index @da)
=notifications:state-two
archive=notifications:state-two
current-timebox=@da
dnd=_|
==
--
++ state-two
=< state
|%
+$ state
$: unreads-each=(jug stats-index index:graph-store)
unreads-count=(map stats-index @ud)
last-seen=(map stats-index @da)
2020-12-16 07:22:23 +03:00
=notifications
archive=notifications
current-timebox=@da
dnd=_|
==
::
++ orm
((ordered-map @da timebox) gth)
::
+$ notification
[date=@da read=? =contents]
::
+$ contents
2021-03-18 10:02:39 +03:00
$% [%graph =(list post:post-zero:post)]
[%group =(list group-contents)]
==
::
+$ group-contents
group-contents:state-zero
::
+$ timebox
(map index notification)
::
+$ notifications
((mop @da timebox) gth)
::
2020-12-16 07:22:23 +03:00
--
::
2021-03-18 10:02:39 +03:00
++ state-three
=< state
|%
+$ state
$: unreads-each=(jug stats-index index:graph-store)
unreads-count=(map stats-index @ud)
last-seen=(map stats-index @da)
=notifications
archive=notifications
current-timebox=@da
dnd=_|
==
::
++ orm
((ordered-map @da timebox) gth)
::
+$ notification
[date=@da read=? =contents]
::
+$ contents
$% [%graph =(list post:post-zero:post)]
[%group =(list group-contents)]
==
::
+$ timebox
(map index notification)
::
+$ notifications
((mop @da timebox) gth)
::
--
::
2020-10-21 08:54:59 +03:00
+$ index
$% $: %graph
group=resource
graph=resource
module=@t
description=@t
=index:graph-store
==
2020-10-21 08:54:59 +03:00
[%group group=resource description=@t]
==
::
+$ group-contents
$~ [%add-members *resource ~]
2021-01-12 07:26:19 +03:00
$>(?(%add-members %remove-members) update:group-store)
2020-10-21 08:54:59 +03:00
::
+$ notification
[date=@da read=? =contents]
::
+$ contents
2020-10-27 08:04:39 +03:00
$% [%graph =(list post:post)]
2020-10-21 08:54:59 +03:00
[%group =(list group-contents)]
==
::
+$ timebox
(map index notification)
::
+$ notifications
2020-11-16 06:52:45 +03:00
((mop @da timebox) gth)
2020-10-21 08:54:59 +03:00
::
+$ action
$% [%add-note =index =notification]
2020-10-21 08:54:59 +03:00
[%archive time=@da index]
::
2020-12-16 07:22:23 +03:00
[%unread-count =stats-index =time]
[%read-count =stats-index]
::
::
2020-12-16 07:22:23 +03:00
[%unread-each =stats-index ref=index:graph-store time=@da]
[%read-each =stats-index ref=index:graph-store]
::
[%read-note time=@da index]
[%unread-note time=@da index]
::
2020-12-16 07:22:23 +03:00
[%seen-index time=@da =stats-index]
2020-12-17 09:10:26 +03:00
[%remove-graph =resource]
::
[%read-all ~]
2020-10-27 08:04:39 +03:00
[%set-dnd dnd=?]
2020-10-21 08:54:59 +03:00
[%seen ~]
==
2020-10-27 08:04:39 +03:00
::
2020-12-16 07:22:23 +03:00
++ stats-index
$% [%graph graph=resource =index:graph-store]
[%group group=resource]
==
::
+$ indexed-notification
2020-10-27 08:04:39 +03:00
[index notification]
::
2020-12-16 07:22:23 +03:00
+$ stats
[notifications=(set [time index]) =unreads last-seen=@da]
::
+$ unreads
2020-12-01 08:46:28 +03:00
$% [%count num=@ud]
[%each indices=(set index:graph-store)]
==
2020-10-21 08:54:59 +03:00
::
+$ update
$% action
2020-11-16 05:22:42 +03:00
[%more more=(list update)]
2020-10-28 08:52:59 +03:00
[%added time=@da =index =notification]
2020-10-27 08:04:39 +03:00
[%timebox time=@da archived=? =(list [index notification])]
[%count count=@ud]
2020-12-17 09:10:26 +03:00
[%clear =stats-index]
2020-12-16 07:22:23 +03:00
[%unreads unreads=(list [stats-index stats])]
2020-10-21 08:54:59 +03:00
==
--