mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 14:42:02 +03:00
5f4fc28bc9
Improved the namespacing by dropping the app prefix on types, e.g. chat-hook-action -> action. Compensated for shadowing by importing the /sur files behind a face. End result is that a chat-hook-action becomes an action:hook. Splits chat-json into lib/chat-{hook,store,view}. Uses ^? on changes files in /lib and /sur to discourage deeply nested importing.
52 lines
1.0 KiB
Plaintext
52 lines
1.0 KiB
Plaintext
/- *chat-view, *rw-security
|
|
^?
|
|
|%
|
|
++ dejs
|
|
|%
|
|
++ action
|
|
|= jon=json
|
|
^- ^action
|
|
=, dejs:format
|
|
=< (parse-json jon)
|
|
|%
|
|
++ parse-json
|
|
%- of
|
|
:~ [%create create]
|
|
[%delete delete]
|
|
[%join join]
|
|
[%groupify groupify]
|
|
==
|
|
::
|
|
++ create
|
|
%- ot
|
|
:~ [%title so]
|
|
[%description so]
|
|
[%app-path pa]
|
|
[%group-path pa]
|
|
[%security sec]
|
|
[%members (as (su ;~(pfix sig fed:ag)))]
|
|
[%allow-history bo]
|
|
==
|
|
::
|
|
++ delete
|
|
(ot [%app-path pa]~)
|
|
::
|
|
++ join
|
|
%- ot
|
|
:~ [%ship (su ;~(pfix sig fed:ag))]
|
|
[%app-path pa]
|
|
[%ask-history bo]
|
|
==
|
|
::
|
|
++ groupify
|
|
=- (ot [%app-path pa] [%existing -] ~)
|
|
(mu (ot [%group-path pa] [%inclusive bo] ~))
|
|
::
|
|
++ sec
|
|
=, dejs:format
|
|
^- $-(json rw-security)
|
|
(su (perk %channel %village %journal %mailbox ~))
|
|
--
|
|
--
|
|
--
|