2019-10-31 21:38:23 +03:00
|
|
|
/- *invite-store
|
2020-10-21 01:27:44 +03:00
|
|
|
/+ resource
|
2019-10-31 21:38:23 +03:00
|
|
|
|%
|
2020-11-25 23:22:55 +03:00
|
|
|
++ slan |=(mod=@tas |=(txt=@ta (need (slaw mod txt))))
|
2019-10-31 21:38:23 +03:00
|
|
|
::
|
|
|
|
++ seri ::: serial
|
|
|
|
=, dejs:format
|
|
|
|
^- $-(json serial)
|
|
|
|
(cu (slan %uv) so)
|
|
|
|
::
|
|
|
|
++ invites-to-json
|
|
|
|
|= inv=invites
|
|
|
|
^- json
|
|
|
|
%- pairs:enjs:format
|
|
|
|
%+ turn ~(tap by inv)
|
2020-10-21 01:27:44 +03:00
|
|
|
|= [=term =invitatory]
|
2019-10-31 21:38:23 +03:00
|
|
|
^- [cord json]
|
2020-10-21 01:27:44 +03:00
|
|
|
[term (invitatory-to-json invitatory)]
|
2019-10-31 21:38:23 +03:00
|
|
|
::
|
|
|
|
++ invitatory-to-json
|
|
|
|
|= =invitatory
|
|
|
|
^- json
|
|
|
|
=, enjs:format
|
|
|
|
%- pairs
|
|
|
|
%+ turn ~(tap by invitatory)
|
|
|
|
|= [=serial =invite]
|
|
|
|
^- [cord json]
|
|
|
|
[(scot %uv serial) (invite-to-json invite)]
|
|
|
|
::
|
|
|
|
++ invite-to-json
|
|
|
|
|= =invite
|
|
|
|
^- json
|
|
|
|
=, enjs:format
|
|
|
|
%- pairs
|
2019-11-01 01:13:23 +03:00
|
|
|
:~ [%ship (ship ship.invite)]
|
2019-10-31 21:38:23 +03:00
|
|
|
[%app [%s app.invite]]
|
2020-10-21 01:27:44 +03:00
|
|
|
[%resource (enjs:resource resource.invite)]
|
2019-11-01 01:13:23 +03:00
|
|
|
[%recipient (ship recipient.invite)]
|
2019-10-31 21:38:23 +03:00
|
|
|
[%text [%s text.invite]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ update-to-json
|
2020-10-22 20:17:15 +03:00
|
|
|
|= upd=update
|
2019-10-31 21:38:23 +03:00
|
|
|
=, enjs:format
|
|
|
|
^- json
|
|
|
|
%+ frond %invite-update
|
|
|
|
%- pairs
|
|
|
|
:~
|
2020-05-22 21:21:10 +03:00
|
|
|
?: =(%initial -.upd)
|
|
|
|
?> ?=(%initial -.upd)
|
|
|
|
[%initial (invites-to-json invites.upd)]
|
2019-10-31 21:38:23 +03:00
|
|
|
?: =(%create -.upd)
|
|
|
|
?> ?=(%create -.upd)
|
2020-10-21 01:27:44 +03:00
|
|
|
[%create (pairs [%term s+term.upd]~)]
|
2019-10-31 21:38:23 +03:00
|
|
|
?: =(%delete -.upd)
|
|
|
|
?> ?=(%delete -.upd)
|
2020-10-21 01:27:44 +03:00
|
|
|
[%delete (pairs [%term s+term.upd]~)]
|
2019-10-31 21:38:23 +03:00
|
|
|
?: =(%accepted -.upd)
|
|
|
|
?> ?=(%accepted -.upd)
|
|
|
|
:- %accepted
|
|
|
|
%- pairs
|
2020-10-21 01:27:44 +03:00
|
|
|
:~ [%term s+term.upd]
|
2019-10-31 21:38:23 +03:00
|
|
|
[%uid s+(scot %uv uid.upd)]
|
|
|
|
[%invite (invite-to-json invite.upd)]
|
|
|
|
==
|
|
|
|
?: =(%decline -.upd)
|
|
|
|
?> ?=(%decline -.upd)
|
|
|
|
:- %decline
|
|
|
|
%- pairs
|
2020-10-21 01:27:44 +03:00
|
|
|
:~ [%term s+term.upd]
|
2019-10-31 21:38:23 +03:00
|
|
|
[%uid s+(scot %uv uid.upd)]
|
|
|
|
==
|
|
|
|
?: =(%invite -.upd)
|
|
|
|
?> ?=(%invite -.upd)
|
|
|
|
:- %invite
|
|
|
|
%- pairs
|
2020-10-21 01:27:44 +03:00
|
|
|
:~ [%term s+term.upd]
|
2019-10-31 21:38:23 +03:00
|
|
|
[%uid s+(scot %uv uid.upd)]
|
|
|
|
[%invite (invite-to-json invite.upd)]
|
|
|
|
==
|
|
|
|
?: =(%invitatory -.upd)
|
|
|
|
?> ?=(%invitatory -.upd)
|
|
|
|
:- %invitatory
|
|
|
|
(invitatory-to-json invitatory.upd)
|
|
|
|
::
|
|
|
|
:: %noop
|
|
|
|
[*@t *json]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ json-to-action
|
|
|
|
|= jon=json
|
2020-10-22 20:17:15 +03:00
|
|
|
^- action
|
2019-10-31 21:38:23 +03:00
|
|
|
=, dejs:format
|
|
|
|
=< (parse-json jon)
|
|
|
|
|%
|
|
|
|
++ parse-json
|
|
|
|
%- of
|
2020-10-21 01:27:44 +03:00
|
|
|
:~ [%create so]
|
|
|
|
[%delete so]
|
2019-10-31 21:38:23 +03:00
|
|
|
[%invite invite]
|
|
|
|
[%accept accept]
|
|
|
|
[%decline decline]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ invite
|
|
|
|
%- ot
|
2020-10-21 01:27:44 +03:00
|
|
|
:~ [%term so]
|
2019-10-31 21:38:23 +03:00
|
|
|
[%uid seri]
|
|
|
|
[%invite invi]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ accept
|
|
|
|
%- ot
|
2020-10-21 01:27:44 +03:00
|
|
|
:~ [%term so]
|
2019-10-31 21:38:23 +03:00
|
|
|
[%uid seri]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ decline
|
|
|
|
%- ot
|
2020-10-21 01:27:44 +03:00
|
|
|
:~ [%term so]
|
2019-10-31 21:38:23 +03:00
|
|
|
[%uid seri]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ invi
|
|
|
|
%- ot
|
2019-11-01 01:13:23 +03:00
|
|
|
:~ [%ship (su ;~(pfix sig fed:ag))]
|
2020-10-21 01:27:44 +03:00
|
|
|
[%app so]
|
|
|
|
[%resource dejs:resource]
|
2019-11-01 01:13:23 +03:00
|
|
|
[%recipient (su ;~(pfix sig fed:ag))]
|
2019-10-31 21:38:23 +03:00
|
|
|
[%text so]
|
|
|
|
==
|
|
|
|
--
|
|
|
|
--
|