From 4550bc6dc18d0f6aab13ba3f72dfc6bf712c625d Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Fri, 22 May 2020 14:21:10 -0400 Subject: [PATCH] apps: updated apps to use consistent %initial update --- pkg/arvo/app/chat-store.hoon | 17 +- pkg/arvo/app/chat-view.hoon | 21 +-- pkg/arvo/app/contact-store.hoon | 2 +- pkg/arvo/app/contact-view.hoon | 2 +- pkg/arvo/app/group-hook.hoon | 12 +- pkg/arvo/app/group-store.hoon | 7 +- pkg/arvo/app/invite-store.hoon | 4 +- pkg/arvo/app/link-listen-hook.hoon | 2 +- pkg/arvo/app/permission-group-hook.hoon | 1 + pkg/arvo/app/permission-store.hoon | 4 +- pkg/arvo/app/publish.hoon | 219 ++++-------------------- pkg/arvo/lib/contact-json.hoon | 3 +- pkg/arvo/lib/group-json.hoon | 1 - pkg/arvo/lib/invite-json.hoon | 4 +- pkg/arvo/mar/chat/config.hoon | 14 -- pkg/arvo/mar/chat/configs.hoon | 14 -- pkg/arvo/mar/chat/initial.hoon | 14 -- pkg/arvo/mar/group/initial.hoon | 14 -- pkg/arvo/mar/group/update.hoon | 4 + pkg/arvo/mar/invite/initial.hoon | 14 -- pkg/arvo/mar/publish/primary-delta.hoon | 1 + pkg/arvo/sur/chat-store.hoon | 10 ++ pkg/arvo/sur/contact-store.hoon | 2 +- pkg/arvo/sur/group-store.hoon | 3 +- pkg/arvo/sur/invite-store.hoon | 1 + 25 files changed, 86 insertions(+), 304 deletions(-) delete mode 100644 pkg/arvo/mar/chat/config.hoon delete mode 100644 pkg/arvo/mar/chat/configs.hoon delete mode 100644 pkg/arvo/mar/chat/initial.hoon delete mode 100644 pkg/arvo/mar/group/initial.hoon delete mode 100644 pkg/arvo/mar/invite/initial.hoon diff --git a/pkg/arvo/app/chat-store.hoon b/pkg/arvo/app/chat-store.hoon index ab4d3e6a68..c65941c4ed 100644 --- a/pkg/arvo/app/chat-store.hoon +++ b/pkg/arvo/app/chat-store.hoon @@ -10,15 +10,9 @@ state-two == :: -+$ state-zero [%0 =inbox:store] -+$ state-one [%1 =inbox:store] -+$ state-two [%2 =inbox:store] -:: -+$ diff - $% [%chat-initial inbox:store] - [%chat-configs configs:store] - [%chat-update update:store] - == ++$ state-zero [%0 =inbox] ++$ state-one [%1 =inbox] ++$ state-two [%2 =inbox] -- :: =| state-two @@ -70,8 +64,7 @@ =/ cards=(list card) ?+ path (on-watch:def path) [%keys ~] (give %chat-update !>([%keys ~(key by inbox)])) - [%all ~] (give %chat-initial !>(inbox)) - [%configs ~] (give %chat-configs !>((inbox-to-configs:store inbox))) + [%all ~] (give %chat-update !>([%initial inbox])) [%updates ~] ~ [%mailbox @ *] ?> (~(has by inbox) t.path) @@ -92,7 +85,6 @@ ^- (unit (unit cage)) ?+ path (on-peek:def path) [%x %all ~] ``noun+!>(inbox) - [%x %configs ~] ``noun+!>((inbox-to-configs:store inbox)) [%x %keys ~] ``noun+!>(~(key by inbox)) [%x %envelopes *] (peek-x-envelopes:cc t.t.path) [%x %mailbox *] @@ -274,7 +266,6 @@ (update-subscribers [%mailbox pax] upd) ?. |(|(=(%read -.upd) =(%message -.upd)) =(%messages -.upd)) ~ - (update-subscribers /configs upd) ?. |(=(%create -.upd) =(%delete -.upd)) ~ (update-subscribers /keys upd) diff --git a/pkg/arvo/app/chat-view.hoon b/pkg/arvo/app/chat-view.hoon index 430cf96e0a..1b77e740e7 100644 --- a/pkg/arvo/app/chat-view.hoon +++ b/pkg/arvo/app/chat-view.hoon @@ -73,17 +73,14 @@ :: create inbox with 20 messages max per mailbox and send that along :: then quit the subscription :_ this - [%give %fact ~ %json !>((inbox:enjs:store truncated-inbox-scry))]~ - ?: =(/configs path) - [[%give %fact ~ %json !>(*json)]~ this] + [%give %fact ~ %json !>((update-to-json [%initial truncated-inbox]))]~ (on-watch:def path) :: ++ message-limit 20 :: - ++ truncated-inbox-scry - ^- inbox:store - =/ =inbox:store - .^(inbox:store %gx /=chat-store/(scot %da now.bol)/all/noun) + ++ truncated-inbox + ^- inbox + =/ =inbox .^(inbox %gx /=chat-store/(scot %da now.bol)/all/noun) %- ~(run by inbox) |= =mailbox:store ^- mailbox:store @@ -442,11 +439,7 @@ ++ diff-chat-update |= upd=update:store ^- (list card) - =/ updates-json (update:enjs:store upd) - =/ configs-json (configs:enjs:store configs-scry) - :~ [%give %fact ~[/primary] %json !>(updates-json)] - [%give %fact ~[/configs] %json !>(configs-json)] - == + [%give %fact ~[/primary] %json !>((update-to-json upd))]~ :: :: +utilities :: @@ -489,10 +482,6 @@ ^- (list envelope:store) (scry-for (list envelope:store) %chat-store [%envelopes pax]) :: -++ configs-scry - ^- configs:store - (scry-for configs:store %chat-store /configs) -:: ++ group-scry |= pax=path ^- (unit group) diff --git a/pkg/arvo/app/contact-store.hoon b/pkg/arvo/app/contact-store.hoon index d0ee582c99..86da8b3669 100644 --- a/pkg/arvo/app/contact-store.hoon +++ b/pkg/arvo/app/contact-store.hoon @@ -84,7 +84,7 @@ |^ =/ cards=(list card) ?+ path (on-watch:def path) - [%all ~] (give %contact-update !>([%rolodex rolodex])) + [%all ~] (give %contact-update !>([%initial rolodex])) [%updates ~] ~ [%contacts @ *] %+ give %contact-update diff --git a/pkg/arvo/app/contact-view.hoon b/pkg/arvo/app/contact-view.hoon index 5467c51c70..c6174f5f19 100644 --- a/pkg/arvo/app/contact-view.hoon +++ b/pkg/arvo/app/contact-view.hoon @@ -67,7 +67,7 @@ ?> (team:title our.bowl src.bowl) ?: ?=([%http-response *] path) [~ this] ?. =(/primary path) (on-watch:def path) - [[%give %fact ~ %json !>((rolodex-to-json all-scry:cc))]~ this] + [[%give %fact ~ %json !>((update-to-json [%initial all-scry:cc]))]~ this] :: ++ on-agent |= [=wire =sign:agent:gall] diff --git a/pkg/arvo/app/group-hook.hoon b/pkg/arvo/app/group-hook.hoon index ea882756ff..ebc19456d9 100644 --- a/pkg/arvo/app/group-hook.hoon +++ b/pkg/arvo/app/group-hook.hoon @@ -160,9 +160,10 @@ |= diff=group-update ^- (quip card _state) ?- -.diff - %keys [~ state] - %path [~ state] - %bundle [~ state] + %initial [~ state] + %keys [~ state] + %path [~ state] + %bundle [~ state] %add [(update-subscribers [%group pax.diff] diff) state] %remove [(update-subscribers [%group pax.diff] diff) state] :: @@ -176,8 +177,9 @@ |= diff=group-update ^- (quip card _state) ?- -.diff - %keys [~ state] - %bundle [~ state] + %initial [~ state] + %keys [~ state] + %bundle [~ state] %path :_ state ?~ pax.diff ~ diff --git a/pkg/arvo/app/group-store.hoon b/pkg/arvo/app/group-store.hoon index 6110dd30db..a5b4e07847 100644 --- a/pkg/arvo/app/group-store.hoon +++ b/pkg/arvo/app/group-store.hoon @@ -14,10 +14,7 @@ =groups == :: -+$ diff - $% [%group-update group-update] - [%group-initial groups] - == ++$ diff [%group-update group-update] -- :: =| state-zero @@ -56,7 +53,7 @@ |^ =/ cards=(list card) ?+ path (on-watch:def path) - [%all ~] (give %group-initial !>(groups)) + [%all ~] (give %group-update !>([%initial groups])) [%updates ~] ~ [%keys ~] (give %group-update !>([%keys ~(key by groups)])) [%group *] diff --git a/pkg/arvo/app/invite-store.hoon b/pkg/arvo/app/invite-store.hoon index 03f8db317c..f08bb6cbf4 100644 --- a/pkg/arvo/app/invite-store.hoon +++ b/pkg/arvo/app/invite-store.hoon @@ -44,8 +44,8 @@ ^- (quip card _this) =/ cards=(list card) ?+ path (on-watch:def path) - [%all ~] [%give %fact ~ %invite-initial !>(invites)]~ - [%updates ~] ~ + [%all ~] [%give %fact ~ %invite-update !>([%initial invites])]~ + [%updates ~] ~ [%invitatory *] =/ inv=invitatory (~(got by invites) t.path) [%give %fact ~ %invite-update !>([%invitatory inv])]~ diff --git a/pkg/arvo/app/link-listen-hook.hoon b/pkg/arvo/app/link-listen-hook.hoon index 8cc921d4bf..42711b2fd4 100644 --- a/pkg/arvo/app/link-listen-hook.hoon +++ b/pkg/arvo/app/link-listen-hook.hoon @@ -338,7 +338,6 @@ =* mark p.cage.sign =* vase q.cage.sign ?+ mark ~|([dap.bowl %unexpected-mark mark] !!) - %group-initial [~ state] ::NOTE initial handled using metadata %group-update (handle-group-update !<(group-update:group-store vase)) == == @@ -346,6 +345,7 @@ ++ handle-group-update |= upd=group-update:group-store ^- (quip card _state) + :: NOTE initial handled using metadata ?. ?=(?(%path %add %remove) -.upd) [~ state] =/ socs=(list app-path) diff --git a/pkg/arvo/app/permission-group-hook.hoon b/pkg/arvo/app/permission-group-hook.hoon index 6ef4197296..f3e7935b3c 100644 --- a/pkg/arvo/app/permission-group-hook.hoon +++ b/pkg/arvo/app/permission-group-hook.hoon @@ -145,6 +145,7 @@ |= diff=group-update ^- (quip card _state) ?- -.diff + %initial [~ state] %keys [~ state] %bundle [~ state] :: diff --git a/pkg/arvo/app/permission-store.hoon b/pkg/arvo/app/permission-store.hoon index 5e4cda0208..28826edd47 100644 --- a/pkg/arvo/app/permission-store.hoon +++ b/pkg/arvo/app/permission-store.hoon @@ -51,8 +51,8 @@ |^ =/ cards=(list card) ?+ path (on-watch:def path) - [%all ~] (give %permission-initial !>(permissions)) - [%updates ~] ~ + [%all ~] (give %permission-update !>([%initial permissions])) + [%updates ~] ~ [%permission @ *] =/ =vase !>([%create t.path (~(got by permissions) t.path)]) (give %permission-update vase) diff --git a/pkg/arvo/app/publish.hoon b/pkg/arvo/app/publish.hoon index 9439173467..3921ecfe80 100644 --- a/pkg/arvo/app/publish.hoon +++ b/pkg/arvo/app/publish.hoon @@ -1,4 +1,3 @@ -:: /- *publish, *group-store, *group-hook, @@ -11,35 +10,6 @@ *rw-security /+ *server, *publish, cram, default-agent, dbug :: -/= index - /^ $-(json manx) - /: /===/app/publish/index /!noun/ -:: -/= js - /^ octs - /; as-octs:mimes:html - /| /: /===/app/publish/js/index /js/ - /~ ~ - == -:: -/= css - /^ octs - /; as-octs:mimes:html - /| /: /===/app/publish/css/index /css/ - /~ ~ - == -:: -/= tile-js - /^ octs - /; as-octs:mimes:html - /| /: /===/app/publish/js/tile /js/ - /~ ~ - == -:: -/= images - /^ (map knot @) - /: /===/app/publish/img /_ /png/ -:: ~% %publish ..is ~ |% +$ card card:agent:gall @@ -101,7 +71,7 @@ ^- (quip card _this) =/ rav [%sing %t [%da now.bol] /app/publish/notebooks] :_ this - :~ [%pass /bind %arvo %e %connect [~ /'~publish'] %publish] + :~ [%pass /bind %arvo %e %connect [~ /'publish-view'] %publish] [%pass /read/paths %arvo %c %warp our.bol q.byk.bol `rav] [%pass /permissions %agent [our.bol %permission-store] %watch /updates] (invite-poke:main [%create /publish]) @@ -125,8 +95,6 @@ ?: ?=(%| -.old-state) =/ zero !<(state-zero old) =/ rav [%next %t [%da now.bol] /app/publish/notebooks] - =/ tile-json - (frond:enjs:format %notifications (numb:enjs:format 0)) =/ init-cards=(list card) :~ [%pass /read/paths %arvo %c %warp our.bol q.byk.bol `rav] :* %pass /permissions %agent [our.bol %permission-store] %watch @@ -136,7 +104,6 @@ :* %pass /invites %agent [our.bol %invite-store] %watch /invitatory/publish == - [%give %fact [/publishtile]~ %json !>(tile-json)] == =+ ^- [kick-cards=(list card) old-subs=(jug @tas @p)] kick-subs =/ inv-scry-pax @@ -359,19 +326,11 @@ ^- (quip card _this) ?+ pax (on-watch:def pax) [%http-response *] [~ this] - :: + [%primary ~] [~ this] [%notebook @ ~] =^ cards state (watch-notebook:main pax) [cards this] - :: - [%primary ~] [~ this] - :: - [%publishtile ~] - =/ jon=json - (frond:enjs:format %notifications (numb:enjs:format tile-num)) - :_ this - [%give %fact ~ %json !>(jon)]~ == :: ++ on-leave on-leave:def @@ -379,7 +338,6 @@ |= pax=path ^- (unit (unit cage)) ?+ pax (on-peek:def pax) - :: [%t %limbo ~] :^ ~ ~ %noun !> ^- (list path) @@ -917,40 +875,20 @@ [~ state] :: %delete - =/ scry-pax - /(scot %p our.bol)/invite-store/(scot %da now.bol)/invitatory/publish/noun - =/ inv=(unit invitatory) .^((unit invitatory) %gx scry-pax) - ?~ inv - [~ state] - =. tile-num (sub tile-num ~(wyt by u.inv)) - =/ jon=json (frond:enjs:format %notifications (numb:enjs:format tile-num)) - :_ state - [%give %fact [/publishtile]~ %json !>(jon)]~ + [~ state] :: %invite - =. tile-num +(tile-num) - =/ jon=json (frond:enjs:format %notifications (numb:enjs:format tile-num)) - :_ state - [%give %fact [/publishtile]~ %json !>(jon)]~ + [~ state] :: %decline - =? tile-num (gth tile-num 0) - (dec tile-num) - =/ jon=json (frond:enjs:format %notifications (numb:enjs:format tile-num)) - :_ state - [%give %fact [/publishtile]~ %json !>(jon)]~ + [~ state] :: %accepted ?> ?=([%notebook @ ~] path.invite.upd) =/ book i.t.path.invite.upd =/ wir=wire /subscribe/(scot %p ship.invite.upd)/[book] - =? tile-num (gth tile-num 0) - (dec tile-num) - =/ jon=json (frond:enjs:format %notifications (numb:enjs:format tile-num)) :_ state - :~ [%pass wir %agent [ship.invite.upd %publish] %watch path.invite.upd] - [%give %fact [/publishtile]~ %json !>(jon)] - == + [%pass wir %agent [ship.invite.upd %publish] %watch path.invite.upd]~ == :: ++ watch-notebook @@ -1718,12 +1656,8 @@ =. read.u.not %.y =. notes.u.book (~(put by notes.u.book) note.act u.not) =. books (~(put by books) [who.act book.act] u.book) - =/ jon=json - (frond:enjs:format %notifications (numb:enjs:format tile-num)) :_ state - :~ [%give %fact [/primary]~ %publish-primary-delta !>(act)] - [%give %fact [/publishtile]~ %json !>(jon)] - == + [%give %fact [/primary]~ %publish-primary-delta !>(act)]~ :: %groupify :: %groupify @@ -1847,11 +1781,7 @@ :~ [%give %fact [/notebook/[book-name]]~ %publish-notebook-delta !>(del)] [%give %fact [/primary]~ %publish-primary-delta !>(del)] == - =/ jon=json - (frond:enjs:format %notifications (numb:enjs:format tile-num)) - :~ [%give %fact [/primary]~ %publish-primary-delta !>(del)] - [%give %fact [/publishtile]~ %json !>(jon)] - == + [%give %fact [/primary]~ %publish-primary-delta !>(del)]~ :: ++ metadata-poke |= act=metadata-action @@ -1943,7 +1873,7 @@ ^- (quip card _state) ?- -.del %add-book - =. tile-num (add tile-num (get-unread data.del)) + ::=. tile-num (add tile-num (get-unread data.del)) ?: =(our.bol host.del) =^ cards state (emit-updates-and-state host.del book.del data.del del sty) @@ -1976,8 +1906,8 @@ ?~ book [~ sty] =. read.data.del =(our.bol author.data.del) - =? tile-num.sty !read.data.del - +(tile-num.sty) + ::=? tile-num.sty !read.data.del + :: +(tile-num.sty) =. notes.u.book (~(put by notes.u.book) note.del data.del) (emit-updates-and-state host.del book.del u.book del sty) :: @@ -2073,15 +2003,8 @@ ?~ book [~ sty] :_ sty(books (~(del by books.sty) host.del book.del)) ?. =(our.bol host.del) - =. tile-num - %+ sub tile-num - (get-unread (~(got by books) host.del book.del)) - =/ jon=json - (frond:enjs:format %notifications (numb:enjs:format tile-num.sty)) %+ welp - :~ [%give %fact [/primary]~ %publish-primary-delta !>(del)] - [%give %fact [/publishtile]~ %json !>(jon)] - == + [%give %fact [/primary]~ %publish-primary-delta !>(del)]~ ?: (is-managed writers.u.book) ~ [(metadata-hook-poke [%remove writers.u.book])]~ %- zing @@ -2102,8 +2025,8 @@ =/ not=(unit note) (~(get by notes.u.book) note.del) ?~ not [~ sty] - =? tile-num &(!read.u.not (gth tile-num 0)) - (dec tile-num) + ::=? tile-num &(!read.u.not (gth tile-num 0)) + :: (dec tile-num) =. notes.u.book (~(del by notes.u.book) note.del) (emit-updates-and-state host.del book.del u.book del sty) :: @@ -2189,35 +2112,19 @@ |= req=inbound-request:eyre ^- simple-payload:http =/ url (parse-request-line url.request.req) - ?+ url - not-found:gen - :: - [[[~ %png] [%'~publish' @t ~]] ~] - =/ filename=@t i.t.site.url - =/ img=(unit @t) (~(get by images) filename) - ?~ img - not-found:gen - (png-response:gen (as-octs:mimes:html u.img)) - :: - [[[~ %css] [%'~publish' %index ~]] ~] - (css-response:gen css) - :: - [[[~ %js] [%'~publish' %index ~]] ~] - (js-response:gen js) - :: - [[[~ %js] [%'~publish' %tile ~]] ~] - (js-response:gen tile-js) + ?+ url not-found:gen :: :: pagination endpoints :: :: all notebooks, short form - [[[~ %json] [%'~publish' %notebooks ~]] ~] + [[[~ %json] [%'publish-view' %notebooks ~]] ~] %- json-response:gen %- json-to-octs - (notebooks-map:enjs our.bol books) + %+ frond:enjs:format %publish-response + (notebooks-map-json our.bol books) :: :: notes pagination - [[[~ %json] [%'~publish' %notes @ @ @ @ ~]] ~] + [[[~ %json] [%'publish-view' %notes @ @ @ @ ~]] ~] =/ host=(unit @p) (slaw %p i.t.t.site.url) ?~ host not-found:gen @@ -2233,11 +2140,12 @@ not-found:gen %- json-response:gen %- json-to-octs + %+ frond:enjs:format %publish-response :- %o (notes-page:enjs notes.u.book u.start u.length) :: :: comments pagination - [[[~ %json] [%'~publish' %comments @ @ @ @ @ ~]] ~] + [[[~ %json] [%'publish-view' %comments @ @ @ @ @ ~]] ~] =/ host=(unit @p) (slaw %p i.t.t.site.url) ?~ host not-found:gen @@ -2257,97 +2165,42 @@ not-found:gen %- json-response:gen %- json-to-octs - (comments-page:enjs comments.u.note u.start u.length) + %+ frond:enjs:format %publish-response + (comments-page comments.u.note u.start u.length) :: :: single notebook with initial 50 notes in short form, as json - [[[~ %json] [%'~publish' @ @ ~]] ~] + [[[~ %json] [%'publish-view' @ @ ~]] ~] =, enjs:format =/ host=(unit @p) (slaw %p i.t.site.url) - ?~ host - not-found:gen + ?~ host not-found:gen =/ book-name i.t.t.site.url =/ book=(unit notebook) (~(get by books) u.host book-name) - ?~ book - not-found:gen - =/ notebook-json (notebook-full:enjs u.host book-name u.book) + ?~ book not-found:gen + =/ notebook-json (notebook-full-json u.host book-name u.book) ?> ?=(%o -.notebook-json) =. p.notebook-json (~(uni by p.notebook-json) (notes-page:enjs notes.u.book 0 50)) =. p.notebook-json (~(put by p.notebook-json) %subscribers (get-subscribers-json book-name)) - =/ jon=json (pairs notebook+notebook-json ~) + =/ jon=json + (frond:enjs:format %publish-response (pairs notebook+notebook-json ~)) (json-response:gen (json-to-octs jon)) :: :: single note, with initial 50 comments, as json - [[[~ %json] [%'~publish' @ @ @ ~]] ~] + [[[~ %json] [%'publish-view' @ @ @ ~]] ~] =, enjs:format =/ host=(unit @p) (slaw %p i.t.site.url) - ?~ host - not-found:gen + ?~ host not-found:gen =/ book-name i.t.t.site.url =/ book=(unit notebook) (~(get by books) u.host book-name) - ?~ book - not-found:gen + ?~ book not-found:gen =/ note-name i.t.t.t.site.url =/ note=(unit note) (~(get by notes.u.book) note-name) - ?~ note - not-found:gen - =/ jon=json o+(note-presentation:enjs u.book note-name u.note) + ?~ note not-found:gen + =/ jon=json + %+ frond %publish-response:enjs:format + o+(note-presentation-json u.book note-name u.note) (json-response:gen (json-to-octs jon)) - :: - :: presentation endpoints - :: - :: all notebooks, short form, wrapped in html - [[~ [%'~publish' ?(~ [%join *] [%new ~])]] ~] - =, enjs:format - =/ jon=json (pairs notebooks+(notebooks-map:enjs our.bol books) ~) - (manx-response:gen (index jon)) - :: - :: single notebook, with initial 50 notes in short form, wrapped in html - [[~ [%'~publish' %notebook @ @ *]] ~] - =/ host=(unit @p) (slaw %p i.t.t.site.url) - ?~ host - not-found:gen - =/ book-name i.t.t.t.site.url - =/ book-json=(unit json) (get-notebook-json u.host book-name) - ?~ book-json - not-found:gen - (manx-response:gen (index u.book-json)) - :: - :: single notebook, with initial 50 notes in short form, wrapped in html - [[~ [%'~publish' %popout %notebook @ @ *]] ~] - =/ host=(unit @p) (slaw %p i.t.t.t.site.url) - ?~ host - not-found:gen - =/ book-name i.t.t.t.t.site.url - =/ book-json=(unit json) (get-notebook-json u.host book-name) - ?~ book-json - not-found:gen - (manx-response:gen (index u.book-json)) - :: - :: single note, with initial 50 comments, wrapped in html - [[~ [%'~publish' %note @ @ @ *]] ~] - =/ host=(unit @p) (slaw %p i.t.t.site.url) - ?~ host - not-found:gen - =/ book-name i.t.t.t.site.url - =/ note-name i.t.t.t.t.site.url - =/ note-json=(unit json) (get-note-json u.host book-name note-name) - ?~ note-json - not-found:gen - (manx-response:gen (index u.note-json)) - :: - :: single note, with initial 50 comments, wrapped in html - [[~ [%'~publish' %popout %note @ @ @ *]] ~] - =/ host=(unit @p) (slaw %p i.t.t.t.site.url) - ?~ host - not-found:gen - =/ book-name i.t.t.t.t.site.url - =/ note-name i.t.t.t.t.t.site.url - =/ note-json=(unit json) (get-note-json u.host book-name note-name) - ?~ note-json - not-found:gen - (manx-response:gen (index u.note-json)) == :: -- diff --git a/pkg/arvo/lib/contact-json.hoon b/pkg/arvo/lib/contact-json.hoon index ad0831363c..2c6c0b5145 100644 --- a/pkg/arvo/lib/contact-json.hoon +++ b/pkg/arvo/lib/contact-json.hoon @@ -21,7 +21,6 @@ |= rolo=rolodex =, enjs:format ^- json - %+ frond %contact-initial %- pairs %+ turn ~(tap by rolo) |= [pax=^path =contacts] @@ -90,6 +89,8 @@ %+ frond %contact-update %- pairs :~ + ?: ?=(%initial -.upd) + [%initial (rolodex-to-json rolodex.upd)] ?: ?=(%create -.upd) [%create (pairs [%path (path path.upd)]~)] ?: ?=(%delete -.upd) diff --git a/pkg/arvo/lib/group-json.hoon b/pkg/arvo/lib/group-json.hoon index 4dc0e6a9c1..da42dbc18a 100644 --- a/pkg/arvo/lib/group-json.hoon +++ b/pkg/arvo/lib/group-json.hoon @@ -4,7 +4,6 @@ |= grp=groups ^- json =, enjs:format - %+ frond %group-initial %- pairs %+ turn ~(tap by grp) |= [pax=^path =group] diff --git a/pkg/arvo/lib/invite-json.hoon b/pkg/arvo/lib/invite-json.hoon index 5c11a6363d..c28cd16c86 100644 --- a/pkg/arvo/lib/invite-json.hoon +++ b/pkg/arvo/lib/invite-json.hoon @@ -10,7 +10,6 @@ ++ invites-to-json |= inv=invites ^- json - %+ frond:enjs:format %invite-initial %- pairs:enjs:format %+ turn ~(tap by inv) |= [=path =invitatory] @@ -46,6 +45,9 @@ %+ frond %invite-update %- pairs :~ + ?: =(%initial -.upd) + ?> ?=(%initial -.upd) + [%initial (invites-to-json invites.upd)] ?: =(%create -.upd) ?> ?=(%create -.upd) [%create (pairs [%path (path path.upd)]~)] diff --git a/pkg/arvo/mar/chat/config.hoon b/pkg/arvo/mar/chat/config.hoon deleted file mode 100644 index 7f28d43cce..0000000000 --- a/pkg/arvo/mar/chat/config.hoon +++ /dev/null @@ -1,14 +0,0 @@ -/+ *chat-store -|_ cfg=config -:: -++ grow - |% - ++ json (config:enjs cfg) - -- -:: -++ grab - |% - ++ noun config - -- -:: --- diff --git a/pkg/arvo/mar/chat/configs.hoon b/pkg/arvo/mar/chat/configs.hoon deleted file mode 100644 index 2b5717a3d6..0000000000 --- a/pkg/arvo/mar/chat/configs.hoon +++ /dev/null @@ -1,14 +0,0 @@ -/+ *chat-store -|_ cfg=configs -:: -++ grow - |% - ++ json (configs:dejs cfg) - -- -:: -++ grab - |% - ++ noun configs - -- -:: --- diff --git a/pkg/arvo/mar/chat/initial.hoon b/pkg/arvo/mar/chat/initial.hoon deleted file mode 100644 index 1455aee185..0000000000 --- a/pkg/arvo/mar/chat/initial.hoon +++ /dev/null @@ -1,14 +0,0 @@ -/+ *chat-store -|_ box=inbox -:: -++ grow - |% - ++ json (inbox:enjs box) - -- -:: -++ grab - |% - ++ noun inbox - -- -:: --- diff --git a/pkg/arvo/mar/group/initial.hoon b/pkg/arvo/mar/group/initial.hoon deleted file mode 100644 index 947ba554cf..0000000000 --- a/pkg/arvo/mar/group/initial.hoon +++ /dev/null @@ -1,14 +0,0 @@ -/+ *group-json -|_ grp=groups -:: -++ grow - |% - ++ json (groups-to-json grp) - -- -:: -++ grab - |% - ++ noun groups - -- -:: --- diff --git a/pkg/arvo/mar/group/update.hoon b/pkg/arvo/mar/group/update.hoon index 43bdb20a22..75aca24ae2 100644 --- a/pkg/arvo/mar/group/update.hoon +++ b/pkg/arvo/mar/group/update.hoon @@ -12,6 +12,10 @@ %+ frond %group-update %- pairs :~ + ?: =(%initial -.upd) + ?> ?=(%initial -.upd) + :- %initial + (groups-to-json grp) :: :: %add ?: =(%add -.upd) diff --git a/pkg/arvo/mar/invite/initial.hoon b/pkg/arvo/mar/invite/initial.hoon deleted file mode 100644 index a9cdab6c09..0000000000 --- a/pkg/arvo/mar/invite/initial.hoon +++ /dev/null @@ -1,14 +0,0 @@ -/+ *invite-json -|_ inv=invites -:: -++ grow - |% - ++ json (invites-to-json inv) - -- -:: -++ grab - |% - ++ noun invites - -- -:: --- diff --git a/pkg/arvo/mar/publish/primary-delta.hoon b/pkg/arvo/mar/publish/primary-delta.hoon index 64ab97a702..ff1b9bf6a6 100644 --- a/pkg/arvo/mar/publish/primary-delta.hoon +++ b/pkg/arvo/mar/publish/primary-delta.hoon @@ -12,6 +12,7 @@ ++ grow |% ++ json + %+ frond:enjs:format %publish-update %+ frond:enjs:format -.del ?- -.del %add-book diff --git a/pkg/arvo/sur/chat-store.hoon b/pkg/arvo/sur/chat-store.hoon index 1bae255dc1..cbf2ff2aab 100644 --- a/pkg/arvo/sur/chat-store.hoon +++ b/pkg/arvo/sur/chat-store.hoon @@ -29,9 +29,13 @@ :: +$ inbox (map path mailbox) :: +<<<<<<< HEAD +$ configs (map path config) :: +$ diff +======= ++$ chat-base +>>>>>>> 51f0e5eb3... apps: updated apps to use consistent %initial update $% [%create =path] :: %create: create a mailbox at path [%delete =path] :: %delete: delete a mailbox at path [%message =path =envelope] :: %message: append a message to mailbox @@ -45,9 +49,15 @@ diff == :: +<<<<<<< HEAD +$ update $% [%keys keys=(set path)] [%config =path =config] +======= ++$ chat-update + $% [%initial =inbox] + [%keys keys=(set path)] +>>>>>>> 51f0e5eb3... apps: updated apps to use consistent %initial update [%messages =path start=@ud end=@ud envelopes=(list envelope)] diff == diff --git a/pkg/arvo/sur/contact-store.hoon b/pkg/arvo/sur/contact-store.hoon index d7f93d9a3c..7bd642b7b9 100644 --- a/pkg/arvo/sur/contact-store.hoon +++ b/pkg/arvo/sur/contact-store.hoon @@ -36,7 +36,7 @@ == :: +$ contact-update - $% [%rolodex =rolodex] + $% [%initial =rolodex] [%contacts =path =contacts] contact-action == diff --git a/pkg/arvo/sur/group-store.hoon b/pkg/arvo/sur/group-store.hoon index 9ccce82fa2..4b0fec173a 100644 --- a/pkg/arvo/sur/group-store.hoon +++ b/pkg/arvo/sur/group-store.hoon @@ -9,7 +9,8 @@ == :: +$ group-update - $% [%keys keys=(set path)] :: keys have changed + $% [%initial =groups] + [%keys keys=(set path)] :: keys have changed [%path members=group pax=path] group-action == diff --git a/pkg/arvo/sur/invite-store.hoon b/pkg/arvo/sur/invite-store.hoon index e6e0d9b6d5..ff8aa46d6a 100644 --- a/pkg/arvo/sur/invite-store.hoon +++ b/pkg/arvo/sur/invite-store.hoon @@ -32,6 +32,7 @@ :: +$ invite-update $% invite-base + [%initial =invites] [%invitatory =invitatory] :: receive invitatory [%accepted =path uid=serial =invite] :: an invite has been accepted ==