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

50 lines
1.7 KiB
Plaintext
Raw Normal View History

/- *resource
|%
++ serial @uvH
::
+$ invite
2019-11-01 01:13:23 +03:00
$: =ship :: ship to subscribe to upon accepting invite
app=@tas :: app to subscribe to upon accepting invite
2020-10-27 20:33:28 +03:00
=resource :: resource to subscribe to upon accepting invite
2019-11-01 01:13:23 +03:00
recipient=ship :: recipient to receive invite
text=cord :: text to describe the invite
==
::
+$ multi-invite
$: =ship :: ship to subscribe to upon accepting invite
app=@tas :: app to subscribe to upon accepting invite
2020-10-27 20:33:28 +03:00
=resource :: resource to subscribe to upon accepting invite
recipients=(set ship) :: recipient to receive invite
text=cord :: text to describe the invite
==
::
:: +invites: each application using invites creates its own resource that
2019-11-01 01:13:23 +03:00
:: contains a map of serial to invite. this allows it to only receive
:: invites that it is concerned with
::
+$ invites (map term invitatory) :: main data structure
2019-11-01 01:13:23 +03:00
::
+$ invitatory (map serial invite) :: containing or conveying an invitation
::
+$ invite-base
$% [%create =term] :: create a resource
[%delete =term] :: delete a resource
[%invite =term uid=serial =invite] :: receive an invite at term/uid
[%decline =term uid=serial] :: decline an invite at term/uid
==
::
+$ action
$% invite-base
[%accept =term uid=serial] :: accept an invite at term/uid
[%invites =term uid=serial invites=multi-invite]
==
::
+$ update
$% invite-base
[%initial =invites]
[%invitatory =invitatory] :: receive invitatory
2020-10-27 20:33:28 +03:00
[%accepted =term uid=serial =invite] :: an invite has been accepted
==
--