initial prep subscribe, mark and app stubs

This commit is contained in:
Isaac Visintainer 2018-11-13 10:38:56 -08:00
parent a95ca0dbf2
commit 0c6baef0d9
4 changed files with 292 additions and 19 deletions

View File

@ -29,7 +29,7 @@
:: stores the collection built by above by :cols so that we can compare old :: stores the collection built by above by :cols so that we can compare old
:: and new versions whenever the rendered data changes :: and new versions whenever the rendered data changes
:: ::
~% %collections ..^is ~ ~% %landscape ..^is ~
|_ [bol=bowl:gall sta=state] |_ [bol=bowl:gall sta=state]
:: ::
:: +this: app core subject :: +this: app core subject
@ -44,19 +44,29 @@
:: then update state to store the new collection data :: then update state to store the new collection data
:: ::
++ prep ++ prep
~/ %coll-prep ~/ %land-prep
|= old=(unit state) |= old=(unit state)
^- (quip move _this) ^- (quip move _this)
?~ old ?~ old
:_ this :_ this
=< ta-done ;: welp
(~(ta-hall-create-circle ta ~ bol) /c 'collections') =< ta-done
(~(ta-hall-create-circle ta ~ bol) /c 'collections')
::
:~ [ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]
[ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]
[ost.bol %peer /invites [our.bol %hall] /circle/i/grams]
==
==
?- -.u.old ?- -.u.old
%0 %0
=/ mow=(list move) =/ mow=(list move)
=< ta-done =< ta-done
(~(ta-update ta ~ bol) col.u.old cols) (~(ta-update ta ~ bol) col.u.old cols)
[mow this(sta [%0 cols])] :- mow
%= this
sta [%0 cols str.u.old]
==
== ==
:: ::
:: +mack: :: +mack:
@ -64,7 +74,6 @@
:: recieve acknowledgement for permissions changes, print error if it failed :: recieve acknowledgement for permissions changes, print error if it failed
:: ::
++ mack ++ mack
~/ %coll-mack
|= [wir=wire err=(unit tang)] |= [wir=wire err=(unit tang)]
^- (quip move _this) ^- (quip move _this)
?~ err ?~ err
@ -74,7 +83,6 @@
:: +coup: recieve acknowledgement for poke, print error if it failed :: +coup: recieve acknowledgement for poke, print error if it failed
:: ::
++ coup ++ coup
~/ %coll-coup
|= [wir=wire err=(unit tang)] |= [wir=wire err=(unit tang)]
^- (quip move _this) ^- (quip move _this)
?~ err ?~ err
@ -116,4 +124,188 @@
=< ta-done =< ta-done
(~(ta-write ta ~ bol) /web/landscape/onboard/json [%json !>(jon)]) (~(ta-write ta ~ bol) /web/landscape/onboard/json [%json !>(jon)])
[~ this] [~ this]
::
::
::
::
::
++ peer
|= wir=wire
^- (quip move _this)
[~ this]
::
:: +reap: recieve acknowledgement for peer, retry on failure
::
++ reap
|= [wir=wire err=(unit tang)]
^- (quip move _this)
?~ err
[~ this]
?~ wir
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
?+ i.wir
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
::
%circles
:_ this
[ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]~
::
%inbox
:_ this
[ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]~
::
%invites
:_ this
[ost.bol %peer /invites [our.bol %hall] /circle/i/grams]~
::
%our
[~ this]
::
%sub
[~ this]
==
:: :~ [ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]
:: [ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]
:: [ost.bol %peer /invites [our.bol %hall] /circle/i/grams]
:: ==
::
:: +quit:
::
++ quit
|= [wir=wire err=(unit tang)]
^- (quip move _this)
?~ err
[~ this]
?~ wir
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
?+ i.wir
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
::
%circles
:_ this
[ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]~
::
%inbox
:_ this
[ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]~
::
%invites
:_ this
[ost.bol %peer /invites [our.bol %hall] /circle/i/grams]~
::
%our
[~ this]
::
%sub
[~ this]
==
::
:: +diff-hall-prize:
::
::
::
++ diff-hall-prize
|= [wir=wire piz=prize:hall]
^- (quip move _this)
?~ wir
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
?+ i.wir
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
::
:: %circles: subscribe to the configuration of each of our circles
::
%circles
?> ?=(%circles -.piz)
=/ circs=(set name:hall) (~(dif in cis.piz) (sy ~[%inbox %i %public]))
::
:_ this
^- (list move)
%+ turn ~(tap in circs)
|= circ=name:hall
^- move
[ost.bol %peer /our/[circ] [our.bol %hall] /circle/[circ]/config]
::
:: %inbox:
::
%inbox
[~ this]
::
:: %invites
::
%invites
[~ this]
::
%our
[~ this]
::
%sub
[~ this]
==
:: :~ [ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]
:: [ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]
:: [ost.bol %peer /invites [our.bol %hall] /circle/i/grams]
:: ==
::
:: +diff-hall-rumor
::
::
::
++ diff-hall-rumor
|= [wir=wire rum=rumor:hall]
^- (quip move _this)
?~ wir
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
?+ i.wir
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
::
%circles
[~ this]
::
%inbox
[~ this]
::
%invites
[~ this]
::
%our
[~ this]
::
%sub
[~ this]
==
-- --

View File

@ -8,35 +8,81 @@
:: ::
~% %collections-lib ..is ~ ~% %collections-lib ..is ~
|% |%
+= move [bone card] +$ move [bone card]
+= card ::
+$ card
$% [%info wire toro:clay] $% [%info wire toro:clay]
[%poke wire dock poke] [%poke wire dock poke]
[%perm wire desk path rite:clay] [%perm wire desk path rite:clay]
[%peer wire dock path]
[%pull wire dock ~]
== ==
+= poke ::
+$ poke
$% [%hall-action action:hall] $% [%hall-action action:hall]
[%collections-action action] [%collections-action action]
[%json json] [%json json]
== ==
+= state ::
$% [%0 col=collection] +$ state
$% [%0 col=collection str=streams]
== ==
:: ::
+$ streams
$: :: inbox config and the last 30 messages in it
::
inbox=[con=config env=(list envelope:hall)]
:: names and configs of all circles we own
::
our-circles=(map name:hall config:hall)
:: names and configs of all circles we're subscribed to
::
sub-circles=(map circle:hall config:hall)
:: all the DM invites we've received
::
invites=(list envelope:hall)
==
:: ::
+= collection [meta=config data=(map nom=knot =item)] +$ prize
+= item $: :: inbox config and the last 30 messages in it
::
inbox=[con=config env=(list envelope:hall)]
:: names and configs of all circles we own
::
our-circles=(map name:hall config:hall)
:: names and configs of all circles we're subscribed to
::
sub-circles=(map circle:hall config:hall)
:: all the DM invites we've received
::
invites=(list envelope:hall)
==
::
+$ rumor
$% :: if config is given, either add new circle or update existing one
:: if config is nil then delete circle
::
[%circle-change circle:hall config:hall]
:: recieved a new inbox message or DM invite
::
[%new-msg ?(%inbox %invites) envelope:hall]
==
::
+$ collection [meta=config data=(map nom=knot =item)]
::
+$ item
$~ [%error ~] $~ [%error ~]
$% [%collection col=collection] $% [%collection col=collection]
[%raw raw=raw-item] [%raw raw=raw-item]
[%both col=collection raw=raw-item] [%both col=collection raw=raw-item]
[%error ~] [%error ~]
== ==
+= raw-item ::
+$ raw-item
$% [%udon meta=(map knot cord) data=@t] $% [%udon meta=(map knot cord) data=@t]
== ==
:: ::
+= config +$ config
$: full-path=beam $: full-path=beam
name=@t name=@t
description=@t description=@t
@ -53,12 +99,13 @@
:: ::
== ==
:: ::
+= action +$ action
$: who=ship $: who=ship
dek=desk dek=desk
acts=(list sub-action) acts=(list sub-action)
== ==
+= sub-action ::
+$ sub-action
$% [%write pax=path for=form] $% [%write pax=path for=form]
[%delete pax=path] [%delete pax=path]
[%perms pax=path r=rule:clay w=rule:clay] [%perms pax=path r=rule:clay w=rule:clay]
@ -68,7 +115,7 @@
[%comment pax=path content=@t] [%comment pax=path content=@t]
== ==
:: ::
+= form +$ form
$% [%udon @t] $% [%udon @t]
[%collections-config config] [%collections-config config]
== ==

View File

@ -0,0 +1,17 @@
::
::
/? 309
::
/+ collections, hall-json
::
|_ piz=prize:collections
++ grow
|%
++ json ~
--
::
++ grab
|%
++ noun prize:collections
--
--

View File

@ -0,0 +1,17 @@
::
::
/? 309
::
/+ collections, hall-json
::
|_ rum=rumor:collections
++ grow
|%
++ json ~
--
::
++ grab
|%
++ noun rumor:collections
--
--