diff --git a/desk/app/settings.hoon b/desk/app/settings.hoon index c6989e5..b4862d2 100644 --- a/desk/app/settings.hoon +++ b/desk/app/settings.hoon @@ -18,13 +18,23 @@ %+ verb | ^- agent:gall =< - |_ bol=bowl:gall + |_ =bowl:gall +* this . - do ~(. +> bol) - def ~(. (default-agent this %|) bol) - io ~(. agentio bol) + do ~(. +> bowl) + def ~(. (default-agent this %|) bowl) + io ~(. agentio bowl) :: - ++ on-init on-init:def + ++ on-init + :: XX: deprecated; migration code + ^- (quip card _this) + :_ this + :~ :* %pass + /migrate + %agent + [our dap]:bowl + %poke + noun+!>(%migrate) + == == :: ++ on-save !>(state) :: @@ -42,23 +52,36 @@ ++ on-poke |= [mar=mark vas=vase] ^- (quip card _this) - ?> (team:title our.bol src.bol) - ?. ?=(%settings-event mar) - (on-poke:def mar vas) - =/ evt=event !<(event vas) + ?> (team:title our.bowl src.bowl) =^ cards state - ?- -.evt - %put-bucket (put-bucket:do [desk key bucket]:evt) - %del-bucket (del-bucket:do [desk key]:evt) - %put-entry (put-entry:do [desk buc key val]:evt) - %del-entry (del-entry:do [desk buc key]:evt) + ?+ mar (on-poke:def mar vas) + %settings-event + =/ evt=event !<(event vas) + ?- -.evt + %put-bucket (put-bucket:do [desk key bucket]:evt) + %del-bucket (del-bucket:do [desk key]:evt) + %put-entry (put-entry:do [desk buc key val]:evt) + %del-entry (del-entry:do [desk buc key]:evt) + == + :: + :: XX: deprecated; migration code + %noun + ?> ?=(%migrate !<(%migrate vas)) + =/ bas /(scot %p our.bowl)/settings-store/(scot %da now.bowl) + :- ~ + ?. .^(? %gu bas) + state + =/ ful .^(data %gx (weld bas /all/noun)) + ?+ -.ful (on-poke:def mar vas) + %all state(settings +.ful) + == == [cards this] :: ++ on-watch |= pax=path ^- (quip card _this) - ?> (team:title our.bol src.bol) + ?> (team:title our.bowl src.bowl) ?+ pax (on-watch:def pax) [%all ~] [~ this] diff --git a/desk/app/storage.hoon b/desk/app/storage.hoon index 04f22fd..7e135cb 100644 --- a/desk/app/storage.hoon +++ b/desk/app/storage.hoon @@ -27,8 +27,18 @@ +* this . def ~(. (default-agent this %|) bowl) :: -++ on-init on-init:def -++ on-save !>(state) +++ on-init + :: XX: deprecated; migration code + ^- (quip card _this) + :_ this + :~ :* %pass + /migrate + %agent + [our dap]:bowl + %poke + noun+!>(%migrate) + == == +++ on-save !>(state) ++ on-load |= =vase =/ old !<(versioned-state vase) @@ -60,8 +70,30 @@ |^ ?> (team:title our.bowl src.bowl) =^ cards state - ?+ mark (on-poke:def mark vase) - %storage-action (poke-action !<(action vase)) + ?+ mark (on-poke:def mark vase) + %storage-action + (poke-action !<(action vase)) + :: + :: XX: deprecated; migration code + %noun + ?> ?=(%migrate !<(%migrate vase)) + =/ bas /(scot %p our.bowl)/s3-store/(scot %da now.bowl) + :- ~ + ?. .^(? %gu bas) + state + =: + credentials + =/ ful .^(update %gx (weld bas /credentials/noun)) + ?+ -.ful (on-poke:def mark vase) + %credentials +.ful + == + :: + configuration + =/ ful .^(update %gx (weld bas /configuration/noun)) + ?+ -.ful (on-poke:def mark vase) + %configuration +.ful + == == + state == [cards this] ::