mirror of
https://github.com/urbit/shrub.git
synced 2024-12-29 15:14:17 +03:00
invite-json: first pass
This commit is contained in:
parent
52d7837420
commit
44f1ed6d03
@ -1,4 +1,5 @@
|
||||
/- *invite-store
|
||||
/+ resource
|
||||
|%
|
||||
++ slan |=(mod/@tas |=(txt/@ta (need (slaw mod txt))))
|
||||
::
|
||||
@ -12,9 +13,9 @@
|
||||
^- json
|
||||
%- pairs:enjs:format
|
||||
%+ turn ~(tap by inv)
|
||||
|= [=path =invitatory]
|
||||
|= [=term =invitatory]
|
||||
^- [cord json]
|
||||
[(spat path) (invitatory-to-json invitatory)]
|
||||
[term (invitatory-to-json invitatory)]
|
||||
::
|
||||
++ invitatory-to-json
|
||||
|= =invitatory
|
||||
@ -33,7 +34,7 @@
|
||||
%- pairs
|
||||
:~ [%ship (ship ship.invite)]
|
||||
[%app [%s app.invite]]
|
||||
[%path (path path.invite)]
|
||||
[%resource (enjs:resource resource.invite)]
|
||||
[%recipient (ship recipient.invite)]
|
||||
[%text [%s text.invite]]
|
||||
==
|
||||
@ -50,15 +51,15 @@
|
||||
[%initial (invites-to-json invites.upd)]
|
||||
?: =(%create -.upd)
|
||||
?> ?=(%create -.upd)
|
||||
[%create (pairs [%path (path path.upd)]~)]
|
||||
[%create (pairs [%term s+term.upd]~)]
|
||||
?: =(%delete -.upd)
|
||||
?> ?=(%delete -.upd)
|
||||
[%delete (pairs [%path (path path.upd)]~)]
|
||||
[%delete (pairs [%term s+term.upd]~)]
|
||||
?: =(%accepted -.upd)
|
||||
?> ?=(%accepted -.upd)
|
||||
:- %accepted
|
||||
%- pairs
|
||||
:~ [%path (path path.upd)]
|
||||
:~ [%term s+term.upd]
|
||||
[%uid s+(scot %uv uid.upd)]
|
||||
[%invite (invite-to-json invite.upd)]
|
||||
==
|
||||
@ -66,14 +67,14 @@
|
||||
?> ?=(%decline -.upd)
|
||||
:- %decline
|
||||
%- pairs
|
||||
:~ [%path (path path.upd)]
|
||||
:~ [%term s+term.upd]
|
||||
[%uid s+(scot %uv uid.upd)]
|
||||
==
|
||||
?: =(%invite -.upd)
|
||||
?> ?=(%invite -.upd)
|
||||
:- %invite
|
||||
%- pairs
|
||||
:~ [%path (path path.upd)]
|
||||
:~ [%term s+term.upd]
|
||||
[%uid s+(scot %uv uid.upd)]
|
||||
[%invite (invite-to-json invite.upd)]
|
||||
==
|
||||
@ -94,44 +95,37 @@
|
||||
|%
|
||||
++ parse-json
|
||||
%- of
|
||||
:~ [%create create]
|
||||
[%delete delete]
|
||||
:~ [%create so]
|
||||
[%delete so]
|
||||
[%invite invite]
|
||||
[%accept accept]
|
||||
[%decline decline]
|
||||
==
|
||||
::
|
||||
++ create
|
||||
(ot [%path pa]~)
|
||||
::
|
||||
++ delete
|
||||
(ot [%path pa]~)
|
||||
::
|
||||
|
||||
++ invite
|
||||
%- ot
|
||||
:~ [%path pa]
|
||||
:~ [%term so]
|
||||
[%uid seri]
|
||||
[%invite invi]
|
||||
==
|
||||
::
|
||||
++ accept
|
||||
%- ot
|
||||
:~ [%path pa]
|
||||
:~ [%term so]
|
||||
[%uid seri]
|
||||
==
|
||||
::
|
||||
++ decline
|
||||
%- ot
|
||||
:~ [%path pa]
|
||||
:~ [%term so]
|
||||
[%uid seri]
|
||||
==
|
||||
::
|
||||
++ invi
|
||||
%- ot
|
||||
:~ [%ship (su ;~(pfix sig fed:ag))]
|
||||
[%app (se %tas)]
|
||||
[%path pa]
|
||||
[%app so]
|
||||
[%resource dejs:resource]
|
||||
[%recipient (su ;~(pfix sig fed:ag))]
|
||||
[%text so]
|
||||
==
|
||||
|
Loading…
Reference in New Issue
Block a user