mirror of
https://github.com/urbit/shrub.git
synced 2024-12-02 08:55:07 +03:00
fixed telegrams serialization
This commit is contained in:
parent
a4634d96f1
commit
e0b3f6b2b1
1
mar/helm/reload.hoon
Normal file
1
mar/helm/reload.hoon
Normal file
@ -0,0 +1 @@
|
||||
|*(* ~)
|
@ -7,15 +7,148 @@
|
||||
=+ talk
|
||||
|_ gam=(list telegram)
|
||||
::
|
||||
++ grab-work-duty => [jo work-stuff]
|
||||
|^ dute
|
||||
++ as
|
||||
:: |*(a=fist (cu sa (ar a))) :: XX types
|
||||
|* a=fist
|
||||
%- cu :_ (ar a)
|
||||
~(gas in *(set ,_(need *a)))
|
||||
++ ot
|
||||
|* a=(pole ,[@tas fist])
|
||||
|= b=json
|
||||
%. ((^ot a) b)
|
||||
%- slog
|
||||
?+ b ~
|
||||
[%o *]
|
||||
%+ murn `(list ,[@tas fist])`a
|
||||
|= [c=term d=fist] ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - (some >[c (turn (~(tap by p.b)) head)]<)
|
||||
=+ (d u)
|
||||
?~ - (some >[c u]<)
|
||||
~
|
||||
==
|
||||
++ of
|
||||
|* a=(pole ,[@tas fist])
|
||||
|= b=json
|
||||
%. ((of:jo a) b)
|
||||
%- slog
|
||||
?+ b ~
|
||||
[%o *]
|
||||
%+ murn `(list ,[@tas fist])`a
|
||||
|= [c=term d=fist] ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - ~
|
||||
=+ (d u)
|
||||
?~ - (some >[c u]<)
|
||||
~
|
||||
==
|
||||
++ id (ci (slat %uv) so)
|
||||
++ ship (su fed:ag)
|
||||
++ dute
|
||||
%- of :~
|
||||
create/task change/(ot id/id meat/uppd ~)
|
||||
archive/id update/(ot id/id version/ni her/(su fed:ag) meat/uppd ~)
|
||||
==
|
||||
++ task
|
||||
%- ot :~
|
||||
id/id 'date_created'^di
|
||||
version/ni 'date_modified'^di
|
||||
creator/ship doer/(mu ship)
|
||||
tags/(as so) 'date_due'^(mu di)
|
||||
done/(mu di) title/so
|
||||
description/so discussion/(ar (ot date/di ship/ship body/so ~))
|
||||
==
|
||||
++ audi (as stan)
|
||||
++ stan (su ;~((glue fas) ;~(pfix sig fed:ag) urs:ab))
|
||||
++ uppd
|
||||
%- of :~
|
||||
set-doer/(mu (su fed:ag))
|
||||
set-date-due/(mu di)
|
||||
set-tags/(as so)
|
||||
set-title/so
|
||||
set-description/so
|
||||
set-done/bo
|
||||
add-comment/so
|
||||
==
|
||||
--
|
||||
++ grow-work-duty
|
||||
=> work-stuff
|
||||
=+ jope=|=(a=ship [%s (rsh 3 1 (scot %p a))])
|
||||
=+ jove=|=(a=@uvI [%s (scot %uv a)])
|
||||
=< |= duty
|
||||
%+ joba +<-
|
||||
?- +<-
|
||||
%create (task tax)
|
||||
%archive (jove id)
|
||||
%change (jobe id/(jove id) meat/(flesh meat) ~)
|
||||
%update
|
||||
%- jobe :~
|
||||
id/(jove id)
|
||||
version/(jone version)
|
||||
her/(jope her)
|
||||
meat/(flesh meat)
|
||||
==
|
||||
==
|
||||
|%
|
||||
++ tags
|
||||
|= a=(set ,@t)
|
||||
[%a (turn (sort (~(tap in a)) aor) |=(b=cord s/b))]
|
||||
::
|
||||
++ task
|
||||
|= ^task
|
||||
%- jobe :~ id/[%s (scot %uv id)]
|
||||
tags/(^tags tags)
|
||||
doer/?~(doer ~ (jope u.doer))
|
||||
title/[%s title]
|
||||
creator/(jope creator)
|
||||
version/(jone version)
|
||||
'date_created'^(jode date-created)
|
||||
'date_modified'^(jode date-modified)
|
||||
description/[%s description]
|
||||
=< discussion/[%a (turn discussion .)]
|
||||
|=(comment (jobe date/(jode date) ship/(jope ship) body/[%s body] ~))
|
||||
'date_due'^?~(date-due ~ (jode u.date-due))
|
||||
done/?~(done ~ (jode u.done))
|
||||
==
|
||||
++ flesh
|
||||
|= ^flesh
|
||||
%+ joba +<-
|
||||
?- +<-
|
||||
%set-doer ?~(her ~ (jope u.her))
|
||||
%set-date-due ?~(wen ~ (jode u.wen))
|
||||
%set-tags (tags tag)
|
||||
%set-title [%s til]
|
||||
%set-description [%s des]
|
||||
%set-done [%b don]
|
||||
%add-comment [%s com]
|
||||
==
|
||||
--
|
||||
++ grab
|
||||
|%
|
||||
++ noun (list telegram)
|
||||
++ mime |=(^mime (json (rash q.q apex:poja)))
|
||||
++ json
|
||||
=> [jo ..telegram]
|
||||
=> [jo ..telegram dute=grab-work-duty]
|
||||
|= a=json ^- (list telegram)
|
||||
=- (need ((ar (ot ship/(su fed:ag) thought/thot ~)) a))
|
||||
|%
|
||||
++ of
|
||||
|* a=(pole ,[@tas fist])
|
||||
|= b=json
|
||||
%. ((of:jo a) b)
|
||||
%- slog
|
||||
?+ b ~
|
||||
[%o *]
|
||||
%+ murn `(list ,[@tas fist])`a
|
||||
|= [c=term d=fist] ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - ~
|
||||
=+ (d u)
|
||||
?~ - (some >[c u]<)
|
||||
~
|
||||
==
|
||||
++ op :: parse keys of map
|
||||
|* [fel=_rule wit=fist]
|
||||
%+ cu mo
|
||||
@ -30,14 +163,14 @@
|
||||
%- cu :_ (ar a)
|
||||
~(gas in *(set ,_(need *a)))
|
||||
::
|
||||
++ lake |*(a=_,* $+(json (unit a)))
|
||||
++ peach
|
||||
|* a=_[rule rule]
|
||||
|= tub=nail
|
||||
^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a))))
|
||||
%. tub
|
||||
;~(pose (stag %& -.a) (stag %| +.a))
|
||||
++ ke :: callbacks
|
||||
|* [gar=* sef=_|.(fist)]
|
||||
|= jon=json
|
||||
^- (unit ,_gar)
|
||||
=- ~! gar ~! (need -) -
|
||||
((sef) jon)
|
||||
::
|
||||
++ lake |*(a=_,* $+(json (unit a)))
|
||||
++ head-rush
|
||||
|* a=_rule
|
||||
|* [b=cord c=*]
|
||||
@ -61,28 +194,34 @@
|
||||
::
|
||||
++ parn
|
||||
^- $+(nail (like partner))
|
||||
%+ peach
|
||||
%+ pick
|
||||
;~((glue fas) ;~(pfix sig fed:ag) urs:ab)
|
||||
%+ sear (soft passport)
|
||||
;~((glue fas) sym urs:ab) :: XX [a-z0-9_]{1,15}
|
||||
::
|
||||
++ eval
|
||||
|= a=(trel ,@da bouquet ?(speech [%eval p=@t])) ^- statement
|
||||
?. ?=(%eval -.r.a) a
|
||||
=+ pax=[&1:% &2:% (scot %da p.a) |3:%]
|
||||
=- a(r [%fat tank/- %exp p.r.a])
|
||||
p:(mule |.([(sell (slap !>(..zuse) (rain pax p.r.a)))]~))
|
||||
::
|
||||
++ stam
|
||||
^- $+(json (unit statement))
|
||||
%+ cu eval
|
||||
=- (ot date/di bouquet/(as (ar so)) speech/(of -) ~)
|
||||
:~ lin/(ot say/bo txt/so ~)
|
||||
++ stam (ot date/di bouquet/(as (ar so)) speech/spec ~)
|
||||
++ spec
|
||||
%+ ke *speech |. ~+
|
||||
%- of :~
|
||||
lin/(ot say/bo txt/so ~)
|
||||
url/(su aurf:urlp)
|
||||
eval/so
|
||||
:: exp/(cu |=(a=cord [a ~]) so)
|
||||
exp/so
|
||||
tax/dute
|
||||
app/(ot txt/so src/so ~)
|
||||
fat/(ot tor/tors taf/spec ~)
|
||||
ext/(ot nom/so txe/blob ~)
|
||||
non/ul
|
||||
:: inv/(ot ship/(su fed:ag) party/(su urs:ab) ~)
|
||||
==
|
||||
++ tors
|
||||
%+ ke *torso |. ~+
|
||||
%- of :~
|
||||
name/(ot nom/so mon/tors ~)
|
||||
text/(cu lore so)
|
||||
tank/(cu (hard (list tank)) blob)
|
||||
==
|
||||
::
|
||||
++ blob (cu cue (su fel:ofis))
|
||||
--
|
||||
--
|
||||
::
|
||||
@ -105,7 +244,6 @@
|
||||
==
|
||||
::
|
||||
++ jope |=(a=ship (jape +:<a>)) ::[%s (crip +:(scow %p a))])
|
||||
++ joke |=(a=tank [%s (role (turn (wash 0^80 a) crip))])
|
||||
++ jode |=(a=time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1)))
|
||||
++ jome :: stringify keys
|
||||
|* [a=_cord b=_json]
|
||||
@ -148,11 +286,13 @@
|
||||
%+ joba -.a
|
||||
?+ -.a ~|(stub/-.a !!)
|
||||
%lin (jobe txt/[%s q.a] say/[%b p.a] ~)
|
||||
%url (joba txt/[%s (crip (earf p.a))])
|
||||
%exp (joba txt/[%s p.a])
|
||||
%tax (joba txt/(jape <p.a>))
|
||||
%url (jape (earf p.a))
|
||||
%exp [%s p.a]
|
||||
%tax (grow-work-duty p.a)
|
||||
%app (jobe txt/[%s q.a] src/[%s p.a] ~)
|
||||
%fat (jobe tor/(tors p.a) taf/$(a q.a) ~)
|
||||
%ext (jobe nom/[%s p.a] txe/(jape (sifo (jam +.a))) ~)
|
||||
%non ~
|
||||
:: %inv (jobe ship/(jope p.a) party/[%s q.a] ~)
|
||||
==
|
||||
::
|
||||
@ -161,7 +301,7 @@
|
||||
%+ joba -.a
|
||||
?- -.a
|
||||
%text [%s (role +.a)]
|
||||
%tank [%a (turn +.a joke)]
|
||||
%tank (jape (sifo (jam +.a)))
|
||||
%name (jobe nom/s/p.a mon/$(a q.a) ~)
|
||||
==
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user