wao 0.12.4 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/aoconnect-base.js +307 -167
- package/cjs/armem-base.js +38 -28
- package/cjs/bar.js +260 -193
- package/cjs/hb.js +418 -0
- package/cjs/index.js +7 -0
- package/cjs/lua/aos_mainnet.wasm +0 -0
- package/cjs/server.js +425 -231
- package/cjs/waosm-node/waosm_bg.wasm.js +19 -0
- package/cjs/waosm-node.js +8 -22
- package/cjs/weavedb.js +59 -49
- package/cjs/weavedrive.js +24 -19
- package/esm/aoconnect-base.js +123 -55
- package/esm/armem-base.js +9 -4
- package/esm/bar.js +30 -6
- package/esm/hb.js +121 -0
- package/esm/index.js +2 -1
- package/esm/lua/aos_mainnet.wasm +0 -0
- package/esm/server.js +172 -21
- package/esm/waosm-node/waosm_bg.wasm.js +14 -0
- package/esm/waosm-node.js +6 -22
- package/esm/weavedb.js +15 -11
- package/esm/weavedrive.js +13 -11
- package/package.json +4 -1
- package/esm/.cache/data.mdb +0 -0
- package/esm/.cache/lock.mdb +0 -0
- package/esm/.db/100040/data/1/123.json +0 -1
- package/esm/.db/103252/data/0/13315.json +0 -1
- package/esm/.db/103252/data/1/120.json +0 -1
- package/esm/.db/103252/data/1/123.json +0 -1
- package/esm/.db/105470/data/0/0.json +0 -1
- package/esm/.db/105470/data/1/120.json +0 -1
- package/esm/.db/105470/data/1/123.json +0 -1
- package/esm/.db/105470/data/3/104.json +0 -1
- package/esm/.db/105667/data/ppl/bob.json +0 -1
- package/esm/.db/105869/data/1/120.json +0 -1
- package/esm/.db/105869/data/1/123.json +0 -1
- package/esm/.db/113125/data/1/example.json +0 -1
- package/esm/.db/116234/data/1/123.json +0 -1
- package/esm/.db/119911/data/1/120.json +0 -1
- package/esm/.db/119911/data/1/123.json +0 -1
- package/esm/.db/122989/data/0/0.json +0 -1
- package/esm/.db/122989/data/1/120.json +0 -1
- package/esm/.db/122989/data/1/123.json +0 -1
- package/esm/.db/125755/data/1/123.json +0 -1
- package/esm/.db/126241/data/1/123.json +0 -1
- package/esm/.db/129099/data/1/123.json +0 -1
- package/esm/.db/129781/data/0/14083.json +0 -1
- package/esm/.db/129781/data/1/120.json +0 -1
- package/esm/.db/129781/data/1/123.json +0 -1
- package/esm/.db/129781/data/15/0.json +0 -1
- package/esm/.db/132860/data/0/13315.json +0 -1
- package/esm/.db/132860/data/1/120.json +0 -1
- package/esm/.db/132860/data/1/123.json +0 -1
- package/esm/.db/134721/data/1/123.json +0 -1
- package/esm/.db/137408/data/ppl/bob.json +0 -1
- package/esm/.db/137556/data/1/123.json +0 -1
- package/esm/.db/143417/data/1/123.json +0 -1
- package/esm/.db/143799/data/1/123.json +0 -1
- package/esm/.db/146558/data/0/0.json +0 -1
- package/esm/.db/146558/data/1/120.json +0 -1
- package/esm/.db/146558/data/1/123.json +0 -1
- package/esm/.db/153145/data/1/123.json +0 -1
- package/esm/.db/153912/data/1/example.json +0 -1
- package/esm/.db/154536/data/0/13315.json +0 -1
- package/esm/.db/154536/data/1/120.json +0 -1
- package/esm/.db/154536/data/1/123.json +0 -1
- package/esm/.db/158777/data/1/123.json +0 -1
- package/esm/.db/170678/data/0/13315.json +0 -1
- package/esm/.db/170678/data/1/120.json +0 -1
- package/esm/.db/170678/data/1/123.json +0 -1
- package/esm/.db/17434/data/1/123.json +0 -1
- package/esm/.db/176113/data/1/123.json +0 -1
- package/esm/.db/179669/data/0/13315.json +0 -1
- package/esm/.db/179669/data/1/120.json +0 -1
- package/esm/.db/179669/data/1/123.json +0 -1
- package/esm/.db/183368/data/1/120.json +0 -1
- package/esm/.db/183368/data/1/123.json +0 -1
- package/esm/.db/188491/data/0/14083.json +0 -1
- package/esm/.db/188491/data/1/120.json +0 -1
- package/esm/.db/188491/data/1/123.json +0 -1
- package/esm/.db/188491/data/15/0.json +0 -1
- package/esm/.db/189189/data/ppl/bob.json +0 -1
- package/esm/.db/195025/data/1/120.json +0 -1
- package/esm/.db/195025/data/1/123.json +0 -1
- package/esm/.db/19852/data/1/123.json +0 -1
- package/esm/.db/204968/data/1/123.json +0 -1
- package/esm/.db/207069/data/0/0.json +0 -1
- package/esm/.db/207069/data/1/120.json +0 -1
- package/esm/.db/207069/data/1/123.json +0 -1
- package/esm/.db/211038/data/1/120.json +0 -1
- package/esm/.db/211038/data/1/123.json +0 -1
- package/esm/.db/211580/data/1/120.json +0 -1
- package/esm/.db/211580/data/1/123.json +0 -1
- package/esm/.db/214305/data/0/0.json +0 -1
- package/esm/.db/214305/data/1/120.json +0 -1
- package/esm/.db/214305/data/1/123.json +0 -1
- package/esm/.db/214712/data/0/13315.json +0 -1
- package/esm/.db/214712/data/1/120.json +0 -1
- package/esm/.db/214712/data/1/123.json +0 -1
- package/esm/.db/218886/data/0/14083.json +0 -1
- package/esm/.db/218886/data/1/120.json +0 -1
- package/esm/.db/218886/data/1/123.json +0 -1
- package/esm/.db/218886/data/15/0.json +0 -1
- package/esm/.db/221009/data/1/123.json +0 -1
- package/esm/.db/221818/data/1/120.json +0 -1
- package/esm/.db/221818/data/1/123.json +0 -1
- package/esm/.db/226668/data/0/13315.json +0 -1
- package/esm/.db/226668/data/1/120.json +0 -1
- package/esm/.db/226668/data/1/123.json +0 -1
- package/esm/.db/226981/data/0/123.json +0 -1
- package/esm/.db/235331/data/0/13315.json +0 -1
- package/esm/.db/235331/data/1/120.json +0 -1
- package/esm/.db/235331/data/1/123.json +0 -1
- package/esm/.db/247863/data/1/123.json +0 -1
- package/esm/.db/247918/data/0/0.json +0 -1
- package/esm/.db/247918/data/1/120.json +0 -1
- package/esm/.db/247918/data/1/123.json +0 -1
- package/esm/.db/247918/data/3/104.json +0 -1
- package/esm/.db/250384/data/1/123.json +0 -1
- package/esm/.db/253205/data/1/120.json +0 -1
- package/esm/.db/253205/data/1/123.json +0 -1
- package/esm/.db/26452/data/1/120.json +0 -1
- package/esm/.db/26452/data/1/123.json +0 -1
- package/esm/.db/265430/data/1/120.json +0 -1
- package/esm/.db/265430/data/1/123.json +0 -1
- package/esm/.db/269049/data/0/0.json +0 -1
- package/esm/.db/269049/data/1/120.json +0 -1
- package/esm/.db/269049/data/1/123.json +0 -1
- package/esm/.db/273652/data/0/0.json +0 -1
- package/esm/.db/273652/data/1/120.json +0 -1
- package/esm/.db/273652/data/1/123.json +0 -1
- package/esm/.db/281035/data/0/0.json +0 -1
- package/esm/.db/281035/data/1/120.json +0 -1
- package/esm/.db/281035/data/1/123.json +0 -1
- package/esm/.db/281140/data/0/13315.json +0 -1
- package/esm/.db/281140/data/1/120.json +0 -1
- package/esm/.db/281140/data/1/123.json +0 -1
- package/esm/.db/295732/data/ppl/bob.json +0 -1
- package/esm/.db/296113/data/1/123.json +0 -1
- package/esm/.db/297154/data/0/13315.json +0 -1
- package/esm/.db/297154/data/1/120.json +0 -1
- package/esm/.db/297154/data/1/123.json +0 -1
- package/esm/.db/304770/data/1/120.json +0 -1
- package/esm/.db/304770/data/1/123.json +0 -1
- package/esm/.db/3081/data/0/0.json +0 -1
- package/esm/.db/3081/data/1/120.json +0 -1
- package/esm/.db/3081/data/1/123.json +0 -1
- package/esm/.db/310793/data/1/120.json +0 -1
- package/esm/.db/310793/data/1/123.json +0 -1
- package/esm/.db/317310/data/1/123.json +0 -1
- package/esm/.db/317819/data/1/example.json +0 -1
- package/esm/.db/319464/data/0/0.json +0 -1
- package/esm/.db/319464/data/1/120.json +0 -1
- package/esm/.db/319464/data/1/123.json +0 -1
- package/esm/.db/32053/data/1/120.json +0 -1
- package/esm/.db/32053/data/1/123.json +0 -1
- package/esm/.db/322473/data/ppl/bob.json +0 -1
- package/esm/.db/323300/data/1/123.json +0 -1
- package/esm/.db/323840/data/0/0.json +0 -1
- package/esm/.db/323840/data/1/120.json +0 -1
- package/esm/.db/323840/data/1/123.json +0 -1
- package/esm/.db/328731/data/0/0.json +0 -1
- package/esm/.db/328731/data/1/120.json +0 -1
- package/esm/.db/328731/data/1/123.json +0 -1
- package/esm/.db/334158/data/1/example.json +0 -1
- package/esm/.db/334577/data/1/example.json +0 -1
- package/esm/.db/339914/data/1/123.json +0 -1
- package/esm/.db/34265/data/0/0.json +0 -1
- package/esm/.db/34265/data/1/120.json +0 -1
- package/esm/.db/34265/data/1/123.json +0 -1
- package/esm/.db/346364/data/1/123.json +0 -1
- package/esm/.db/349791/data/0/14083.json +0 -1
- package/esm/.db/349791/data/1/120.json +0 -1
- package/esm/.db/349791/data/1/123.json +0 -1
- package/esm/.db/349791/data/15/0.json +0 -1
- package/esm/.db/350767/data/ppl/bob.json +0 -1
- package/esm/.db/352310/data/0/13315.json +0 -1
- package/esm/.db/352310/data/1/120.json +0 -1
- package/esm/.db/352310/data/1/123.json +0 -1
- package/esm/.db/35438/data/1/123.json +0 -1
- package/esm/.db/354670/data/0/13315.json +0 -1
- package/esm/.db/354670/data/1/120.json +0 -1
- package/esm/.db/354670/data/1/123.json +0 -1
- package/esm/.db/354805/data/0/0.json +0 -1
- package/esm/.db/354805/data/1/120.json +0 -1
- package/esm/.db/354805/data/1/123.json +0 -1
- package/esm/.db/358368/data/1/example.json +0 -1
- package/esm/.db/358831/data/1/123.json +0 -1
- package/esm/.db/360133/data/0/0.json +0 -1
- package/esm/.db/360133/data/1/120.json +0 -1
- package/esm/.db/360133/data/1/123.json +0 -1
- package/esm/.db/367925/data/0/13315.json +0 -1
- package/esm/.db/367925/data/1/120.json +0 -1
- package/esm/.db/367925/data/1/123.json +0 -1
- package/esm/.db/369638/data/1/123.json +0 -1
- package/esm/.db/3700/data/1/120.json +0 -1
- package/esm/.db/3700/data/1/123.json +0 -1
- package/esm/.db/374988/data/0/0.json +0 -1
- package/esm/.db/374988/data/1/120.json +0 -1
- package/esm/.db/374988/data/1/123.json +0 -1
- package/esm/.db/380018/data/1/123.json +0 -1
- package/esm/.db/380021/data/1/123.json +0 -1
- package/esm/.db/386761/data/1/123.json +0 -1
- package/esm/.db/387217/data/0/13315.json +0 -1
- package/esm/.db/387217/data/1/120.json +0 -1
- package/esm/.db/387217/data/1/123.json +0 -1
- package/esm/.db/392652/data/1/123.json +0 -1
- package/esm/.db/392692/data/0/13315.json +0 -1
- package/esm/.db/392692/data/1/120.json +0 -1
- package/esm/.db/392692/data/1/123.json +0 -1
- package/esm/.db/396339/data/1/123.json +0 -1
- package/esm/.db/404348/data/1/123.json +0 -1
- package/esm/.db/405894/data/0/14083.json +0 -1
- package/esm/.db/405894/data/1/120.json +0 -1
- package/esm/.db/405894/data/1/123.json +0 -1
- package/esm/.db/405894/data/15/0.json +0 -1
- package/esm/.db/406165/data/1/example.json +0 -1
- package/esm/.db/407316/data/ppl/bob.json +0 -1
- package/esm/.db/407987/data/1/123.json +0 -1
- package/esm/.db/410181/data/1/123.json +0 -1
- package/esm/.db/411981/data/1/120.json +0 -1
- package/esm/.db/411981/data/1/123.json +0 -1
- package/esm/.db/416278/data/1/120.json +0 -1
- package/esm/.db/416278/data/1/123.json +0 -1
- package/esm/.db/418449/data/1/123.json +0 -1
- package/esm/.db/425620/data/1/120.json +0 -1
- package/esm/.db/425620/data/1/123.json +0 -1
- package/esm/.db/429727/data/1/123.json +0 -1
- package/esm/.db/435030/data/1/123.json +0 -1
- package/esm/.db/444362/data/1/120.json +0 -1
- package/esm/.db/444362/data/1/123.json +0 -1
- package/esm/.db/446985/data/1/123.json +0 -1
- package/esm/.db/451355/data/1/120.json +0 -1
- package/esm/.db/451355/data/1/123.json +0 -1
- package/esm/.db/45640/data/1/123.json +0 -1
- package/esm/.db/46155/data/0/0.json +0 -1
- package/esm/.db/46155/data/0/13315.json +0 -1
- package/esm/.db/46155/data/1/120.json +0 -1
- package/esm/.db/46155/data/1/123.json +0 -1
- package/esm/.db/46528/data/1/123.json +0 -1
- package/esm/.db/466476/data/1/123.json +0 -1
- package/esm/.db/467578/data/0/0.json +0 -1
- package/esm/.db/467578/data/1/120.json +0 -1
- package/esm/.db/467578/data/1/123.json +0 -1
- package/esm/.db/472245/data/1/123.json +0 -1
- package/esm/.db/474238/data/1/example.json +0 -1
- package/esm/.db/477291/data/1/123.json +0 -1
- package/esm/.db/477375/data/1/120.json +0 -1
- package/esm/.db/477375/data/1/123.json +0 -1
- package/esm/.db/479960/data/1/123.json +0 -1
- package/esm/.db/482327/data/1/123.json +0 -1
- package/esm/.db/487117/data/1/example.json +0 -1
- package/esm/.db/495075/data/1/123.json +0 -1
- package/esm/.db/498660/data/1/123.json +0 -1
- package/esm/.db/510578/data/1/123.json +0 -1
- package/esm/.db/514521/data/1/123.json +0 -1
- package/esm/.db/524536/data/1/120.json +0 -1
- package/esm/.db/524536/data/1/123.json +0 -1
- package/esm/.db/52751/data/1/example.json +0 -1
- package/esm/.db/530599/data/ppl/bob.json +0 -1
- package/esm/.db/536579/data/1/123.json +0 -1
- package/esm/.db/539183/data/1/123.json +0 -1
- package/esm/.db/539222/data/1/example.json +0 -1
- package/esm/.db/542071/data/0/0.json +0 -1
- package/esm/.db/542071/data/0/13315.json +0 -1
- package/esm/.db/542071/data/1/120.json +0 -1
- package/esm/.db/542071/data/1/123.json +0 -1
- package/esm/.db/542939/data/ppl/bob.json +0 -1
- package/esm/.db/547077/data/1/123.json +0 -1
- package/esm/.db/548947/data/ppl/bob.json +0 -1
- package/esm/.db/551385/data/0/0.json +0 -1
- package/esm/.db/551385/data/1/120.json +0 -1
- package/esm/.db/551385/data/1/123.json +0 -1
- package/esm/.db/553486/data/0/0.json +0 -1
- package/esm/.db/553486/data/1/120.json +0 -1
- package/esm/.db/553486/data/1/123.json +0 -1
- package/esm/.db/554578/data/1/123.json +0 -1
- package/esm/.db/555963/data/1/123.json +0 -1
- package/esm/.db/556201/data/1/123.json +0 -1
- package/esm/.db/572000/data/1/123.json +0 -1
- package/esm/.db/572151/data/1/123.json +0 -1
- package/esm/.db/573301/data/1/123.json +0 -1
- package/esm/.db/579648/data/0/0.json +0 -1
- package/esm/.db/579648/data/1/120.json +0 -1
- package/esm/.db/579648/data/1/123.json +0 -1
- package/esm/.db/579648/data/3/104.json +0 -1
- package/esm/.db/582311/data/1/example.json +0 -1
- package/esm/.db/587351/data/0/14083.json +0 -1
- package/esm/.db/587351/data/1/120.json +0 -1
- package/esm/.db/587351/data/1/123.json +0 -1
- package/esm/.db/587351/data/15/0.json +0 -1
- package/esm/.db/588867/data/0/0.json +0 -1
- package/esm/.db/588867/data/1/120.json +0 -1
- package/esm/.db/588867/data/1/123.json +0 -1
- package/esm/.db/589730/data/1/123.json +0 -1
- package/esm/.db/591738/data/0/13315.json +0 -1
- package/esm/.db/591738/data/1/120.json +0 -1
- package/esm/.db/591738/data/1/123.json +0 -1
- package/esm/.db/593460/data/1/123.json +0 -1
- package/esm/.db/595304/data/1/123.json +0 -1
- package/esm/.db/595772/data/0/13315.json +0 -1
- package/esm/.db/595772/data/1/120.json +0 -1
- package/esm/.db/595772/data/1/123.json +0 -1
- package/esm/.db/596051/data/0/0.json +0 -1
- package/esm/.db/596051/data/1/120.json +0 -1
- package/esm/.db/596051/data/1/123.json +0 -1
- package/esm/.db/601728/data/1/120.json +0 -1
- package/esm/.db/601728/data/1/123.json +0 -1
- package/esm/.db/619154/data/1/123.json +0 -1
- package/esm/.db/620185/data/1/123.json +0 -1
- package/esm/.db/623179/data/1/123.json +0 -1
- package/esm/.db/623265/data/1/123.json +0 -1
- package/esm/.db/630002/data/1/120.json +0 -1
- package/esm/.db/630002/data/1/123.json +0 -1
- package/esm/.db/631961/data/1/123.json +0 -1
- package/esm/.db/635637/data/0/14083.json +0 -1
- package/esm/.db/635637/data/1/120.json +0 -1
- package/esm/.db/635637/data/1/123.json +0 -1
- package/esm/.db/635637/data/15/0.json +0 -1
- package/esm/.db/636670/data/1/example.json +0 -1
- package/esm/.db/640527/data/0/0.json +0 -1
- package/esm/.db/640527/data/1/120.json +0 -1
- package/esm/.db/640527/data/1/123.json +0 -1
- package/esm/.db/644020/data/0/13315.json +0 -1
- package/esm/.db/644020/data/1/120.json +0 -1
- package/esm/.db/644020/data/1/123.json +0 -1
- package/esm/.db/64462/data/0/14083.json +0 -1
- package/esm/.db/64462/data/1/120.json +0 -1
- package/esm/.db/64462/data/1/123.json +0 -1
- package/esm/.db/64462/data/15/0.json +0 -1
- package/esm/.db/646266/data/1/123.json +0 -1
- package/esm/.db/650764/data/1/120.json +0 -1
- package/esm/.db/650764/data/1/123.json +0 -1
- package/esm/.db/654655/data/0/0.json +0 -1
- package/esm/.db/654655/data/1/120.json +0 -1
- package/esm/.db/654655/data/1/123.json +0 -1
- package/esm/.db/658164/data/1/120.json +0 -1
- package/esm/.db/658164/data/1/123.json +0 -1
- package/esm/.db/65937/data/1/123.json +0 -1
- package/esm/.db/659738/data/0/13315.json +0 -1
- package/esm/.db/659738/data/1/120.json +0 -1
- package/esm/.db/659738/data/1/123.json +0 -1
- package/esm/.db/660517/data/0/13315.json +0 -1
- package/esm/.db/660517/data/1/120.json +0 -1
- package/esm/.db/660517/data/1/123.json +0 -1
- package/esm/.db/664564/data/1/123.json +0 -1
- package/esm/.db/672001/data/1/example.json +0 -1
- package/esm/.db/674620/data/1/123.json +0 -1
- package/esm/.db/67532/data/1/123.json +0 -1
- package/esm/.db/675670/data/1/120.json +0 -1
- package/esm/.db/675670/data/1/123.json +0 -1
- package/esm/.db/686538/data/1/123.json +0 -1
- package/esm/.db/691017/data/1/123.json +0 -1
- package/esm/.db/691716/data/1/120.json +0 -1
- package/esm/.db/691716/data/1/123.json +0 -1
- package/esm/.db/693105/data/0/14083.json +0 -1
- package/esm/.db/693105/data/1/120.json +0 -1
- package/esm/.db/693105/data/1/123.json +0 -1
- package/esm/.db/693105/data/15/0.json +0 -1
- package/esm/.db/694486/data/1/123.json +0 -1
- package/esm/.db/702106/data/1/120.json +0 -1
- package/esm/.db/702106/data/1/123.json +0 -1
- package/esm/.db/7047/data/1/123.json +0 -1
- package/esm/.db/705954/data/0/13315.json +0 -1
- package/esm/.db/705954/data/1/120.json +0 -1
- package/esm/.db/705954/data/1/123.json +0 -1
- package/esm/.db/710967/data/1/120.json +0 -1
- package/esm/.db/710967/data/1/123.json +0 -1
- package/esm/.db/715883/data/0/13315.json +0 -1
- package/esm/.db/715883/data/1/120.json +0 -1
- package/esm/.db/715883/data/1/123.json +0 -1
- package/esm/.db/717358/data/1/120.json +0 -1
- package/esm/.db/717358/data/1/123.json +0 -1
- package/esm/.db/71999/data/0/13315.json +0 -1
- package/esm/.db/71999/data/1/120.json +0 -1
- package/esm/.db/71999/data/1/123.json +0 -1
- package/esm/.db/720364/data/1/123.json +0 -1
- package/esm/.db/727249/data/1/120.json +0 -1
- package/esm/.db/727249/data/1/123.json +0 -1
- package/esm/.db/728258/data/1/example.json +0 -1
- package/esm/.db/728986/data/0/13315.json +0 -1
- package/esm/.db/728986/data/1/120.json +0 -1
- package/esm/.db/728986/data/1/123.json +0 -1
- package/esm/.db/732768/data/1/120.json +0 -1
- package/esm/.db/732768/data/1/123.json +0 -1
- package/esm/.db/733885/data/1/123.json +0 -1
- package/esm/.db/736192/data/0/0.json +0 -1
- package/esm/.db/736192/data/1/120.json +0 -1
- package/esm/.db/736192/data/1/123.json +0 -1
- package/esm/.db/73856/data/0/0.json +0 -1
- package/esm/.db/73856/data/1/120.json +0 -1
- package/esm/.db/73856/data/1/123.json +0 -1
- package/esm/.db/738577/data/1/123.json +0 -1
- package/esm/.db/744844/data/1/123.json +0 -1
- package/esm/.db/745738/data/1/123.json +0 -1
- package/esm/.db/747240/data/1/123.json +0 -1
- package/esm/.db/749115/data/0/0.json +0 -1
- package/esm/.db/749115/data/1/120.json +0 -1
- package/esm/.db/749115/data/1/123.json +0 -1
- package/esm/.db/749514/data/0/0.json +0 -1
- package/esm/.db/749514/data/1/120.json +0 -1
- package/esm/.db/749514/data/1/123.json +0 -1
- package/esm/.db/754982/data/1/123.json +0 -1
- package/esm/.db/765281/data/0/13315.json +0 -1
- package/esm/.db/765281/data/1/120.json +0 -1
- package/esm/.db/765281/data/1/123.json +0 -1
- package/esm/.db/765521/data/0/14083.json +0 -1
- package/esm/.db/765521/data/1/120.json +0 -1
- package/esm/.db/765521/data/1/123.json +0 -1
- package/esm/.db/765521/data/15/0.json +0 -1
- package/esm/.db/766288/data/ppl/bob.json +0 -1
- package/esm/.db/766864/data/1/123.json +0 -1
- package/esm/.db/770788/data/0/14083.json +0 -1
- package/esm/.db/770788/data/1/120.json +0 -1
- package/esm/.db/770788/data/1/123.json +0 -1
- package/esm/.db/770788/data/15/0.json +0 -1
- package/esm/.db/774499/data/1/example.json +0 -1
- package/esm/.db/774617/data/ppl/bob.json +0 -1
- package/esm/.db/775617/data/1/123.json +0 -1
- package/esm/.db/779782/data/1/123.json +0 -1
- package/esm/.db/779921/data/1/123.json +0 -1
- package/esm/.db/782910/data/1/123.json +0 -1
- package/esm/.db/783279/data/0/13315.json +0 -1
- package/esm/.db/783279/data/1/120.json +0 -1
- package/esm/.db/783279/data/1/123.json +0 -1
- package/esm/.db/785515/data/1/123.json +0 -1
- package/esm/.db/791284/data/0/0.json +0 -1
- package/esm/.db/791284/data/1/120.json +0 -1
- package/esm/.db/791284/data/1/123.json +0 -1
- package/esm/.db/791361/data/0/14083.json +0 -1
- package/esm/.db/791361/data/1/120.json +0 -1
- package/esm/.db/791361/data/1/123.json +0 -1
- package/esm/.db/791361/data/15/0.json +0 -1
- package/esm/.db/791754/data/1/120.json +0 -1
- package/esm/.db/791754/data/1/123.json +0 -1
- package/esm/.db/792232/data/0/13315.json +0 -1
- package/esm/.db/792232/data/1/120.json +0 -1
- package/esm/.db/792232/data/1/123.json +0 -1
- package/esm/.db/792777/data/0/13315.json +0 -1
- package/esm/.db/792777/data/1/120.json +0 -1
- package/esm/.db/792777/data/1/123.json +0 -1
- package/esm/.db/793249/data/0/123.json +0 -1
- package/esm/.db/795512/data/0/0.json +0 -1
- package/esm/.db/795512/data/1/120.json +0 -1
- package/esm/.db/795512/data/1/123.json +0 -1
- package/esm/.db/795512/data/3/104.json +0 -1
- package/esm/.db/796663/data/1/123.json +0 -1
- package/esm/.db/797304/data/0/0.json +0 -1
- package/esm/.db/797304/data/1/120.json +0 -1
- package/esm/.db/797304/data/1/123.json +0 -1
- package/esm/.db/797304/data/3/104.json +0 -1
- package/esm/.db/800834/data/1/123.json +0 -1
- package/esm/.db/806421/data/1/120.json +0 -1
- package/esm/.db/806421/data/1/123.json +0 -1
- package/esm/.db/81623/data/0/14083.json +0 -1
- package/esm/.db/81623/data/1/120.json +0 -1
- package/esm/.db/81623/data/1/123.json +0 -1
- package/esm/.db/81623/data/15/0.json +0 -1
- package/esm/.db/81941/data/1/120.json +0 -1
- package/esm/.db/81941/data/1/123.json +0 -1
- package/esm/.db/820340/data/0/0.json +0 -1
- package/esm/.db/820340/data/1/120.json +0 -1
- package/esm/.db/820340/data/1/123.json +0 -1
- package/esm/.db/821932/data/1/120.json +0 -1
- package/esm/.db/821932/data/1/123.json +0 -1
- package/esm/.db/823440/data/1/123.json +0 -1
- package/esm/.db/823889/data/1/120.json +0 -1
- package/esm/.db/823889/data/1/123.json +0 -1
- package/esm/.db/823896/data/1/123.json +0 -1
- package/esm/.db/836077/data/0/14083.json +0 -1
- package/esm/.db/836077/data/1/120.json +0 -1
- package/esm/.db/836077/data/1/123.json +0 -1
- package/esm/.db/836077/data/15/0.json +0 -1
- package/esm/.db/837341/data/1/123.json +0 -1
- package/esm/.db/844882/data/1/123.json +0 -1
- package/esm/.db/847654/data/1/example.json +0 -1
- package/esm/.db/856010/data/0/13315.json +0 -1
- package/esm/.db/856010/data/1/120.json +0 -1
- package/esm/.db/856010/data/1/123.json +0 -1
- package/esm/.db/856047/data/1/120.json +0 -1
- package/esm/.db/856047/data/1/123.json +0 -1
- package/esm/.db/856820/data/1/123.json +0 -1
- package/esm/.db/857266/data/1/123.json +0 -1
- package/esm/.db/86017/data/0/13315.json +0 -1
- package/esm/.db/86017/data/1/120.json +0 -1
- package/esm/.db/86017/data/1/123.json +0 -1
- package/esm/.db/862600/data/1/120.json +0 -1
- package/esm/.db/862600/data/1/123.json +0 -1
- package/esm/.db/871866/data/0/13315.json +0 -1
- package/esm/.db/871866/data/1/120.json +0 -1
- package/esm/.db/871866/data/1/123.json +0 -1
- package/esm/.db/875359/data/0/0.json +0 -1
- package/esm/.db/875359/data/1/120.json +0 -1
- package/esm/.db/875359/data/1/123.json +0 -1
- package/esm/.db/875359/data/3/104.json +0 -1
- package/esm/.db/876330/data/1/example.json +0 -1
- package/esm/.db/880182/data/1/123.json +0 -1
- package/esm/.db/882138/data/0/0.json +0 -1
- package/esm/.db/882138/data/1/120.json +0 -1
- package/esm/.db/882138/data/1/123.json +0 -1
- package/esm/.db/882722/data/1/example.json +0 -1
- package/esm/.db/885449/data/ppl/bob.json +0 -1
- package/esm/.db/893417/data/1/example.json +0 -1
- package/esm/.db/897575/data/1/example.json +0 -1
- package/esm/.db/897832/data/0/13315.json +0 -1
- package/esm/.db/897832/data/1/120.json +0 -1
- package/esm/.db/897832/data/1/123.json +0 -1
- package/esm/.db/898043/data/0/0.json +0 -1
- package/esm/.db/898043/data/1/120.json +0 -1
- package/esm/.db/898043/data/1/123.json +0 -1
- package/esm/.db/898201/data/ppl/bob.json +0 -1
- package/esm/.db/900442/data/1/123.json +0 -1
- package/esm/.db/900800/data/0/0.json +0 -1
- package/esm/.db/900800/data/1/120.json +0 -1
- package/esm/.db/900800/data/1/123.json +0 -1
- package/esm/.db/910535/data/1/120.json +0 -1
- package/esm/.db/910535/data/1/123.json +0 -1
- package/esm/.db/911132/data/1/120.json +0 -1
- package/esm/.db/911132/data/1/123.json +0 -1
- package/esm/.db/913152/data/1/120.json +0 -1
- package/esm/.db/913152/data/1/123.json +0 -1
- package/esm/.db/91378/data/1/123.json +0 -1
- package/esm/.db/918654/data/1/example.json +0 -1
- package/esm/.db/929039/data/ppl/bob.json +0 -1
- package/esm/.db/932648/data/1/123.json +0 -1
- package/esm/.db/936016/data/1/example.json +0 -1
- package/esm/.db/936843/data/1/123.json +0 -1
- package/esm/.db/940099/data/1/example.json +0 -1
- package/esm/.db/941807/data/1/120.json +0 -1
- package/esm/.db/941807/data/1/123.json +0 -1
- package/esm/.db/941934/data/0/14083.json +0 -1
- package/esm/.db/941934/data/1/120.json +0 -1
- package/esm/.db/941934/data/1/123.json +0 -1
- package/esm/.db/941934/data/15/0.json +0 -1
- package/esm/.db/943744/data/1/120.json +0 -1
- package/esm/.db/943744/data/1/123.json +0 -1
- package/esm/.db/955716/data/1/123.json +0 -1
- package/esm/.db/956030/data/1/123.json +0 -1
- package/esm/.db/956395/data/1/120.json +0 -1
- package/esm/.db/956395/data/1/123.json +0 -1
- package/esm/.db/956498/data/1/123.json +0 -1
- package/esm/.db/957435/data/1/123.json +0 -1
- package/esm/.db/960302/data/1/example.json +0 -1
- package/esm/.db/964149/data/0/0.json +0 -1
- package/esm/.db/964149/data/1/120.json +0 -1
- package/esm/.db/964149/data/1/123.json +0 -1
- package/esm/.db/965213/data/0/13315.json +0 -1
- package/esm/.db/965213/data/1/120.json +0 -1
- package/esm/.db/965213/data/1/123.json +0 -1
- package/esm/.db/966774/data/1/120.json +0 -1
- package/esm/.db/966774/data/1/123.json +0 -1
- package/esm/.db/972484/data/1/123.json +0 -1
- package/esm/.db/973155/data/1/123.json +0 -1
- package/esm/.db/973642/data/1/123.json +0 -1
- package/esm/.db/975603/data/0/0.json +0 -1
- package/esm/.db/975603/data/1/120.json +0 -1
- package/esm/.db/975603/data/1/123.json +0 -1
- package/esm/.db/979812/data/0/13315.json +0 -1
- package/esm/.db/979812/data/1/120.json +0 -1
- package/esm/.db/979812/data/1/123.json +0 -1
- package/esm/.db/985666/data/1/example.json +0 -1
- package/esm/.db/986784/data/0/0.json +0 -1
- package/esm/.db/986784/data/1/120.json +0 -1
- package/esm/.db/986784/data/1/123.json +0 -1
- package/esm/.db/988463/data/1/120.json +0 -1
- package/esm/.db/988463/data/1/123.json +0 -1
- package/esm/.db/990386/data/1/120.json +0 -1
- package/esm/.db/990386/data/1/123.json +0 -1
- package/esm/.db/994488/data/0/0.json +0 -1
- package/esm/.db/994488/data/1/120.json +0 -1
- package/esm/.db/994488/data/1/123.json +0 -1
- package/esm/.db/999130/data/ppl/bob.json +0 -1
package/cjs/server.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports["default"] = void 0;
|
|
8
|
+
var _crypto = _interopRequireDefault(require("crypto"));
|
|
7
9
|
var _express = _interopRequireDefault(require("express"));
|
|
8
10
|
var _cors = _interopRequireDefault(require("cors"));
|
|
9
11
|
var _base64url = _interopRequireDefault(require("base64url"));
|
|
@@ -13,15 +15,14 @@ var _aoconnect = require("./aoconnect.js");
|
|
|
13
15
|
var _test = require("./test.js");
|
|
14
16
|
var _bodyParser = _interopRequireDefault(require("body-parser"));
|
|
15
17
|
var _ramda = require("ramda");
|
|
18
|
+
var _httpMessageSignatures = require("http-message-signatures");
|
|
19
|
+
var _nodeCrypto = require("node:crypto");
|
|
16
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
18
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
19
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
20
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
22
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
23
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
24
24
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
25
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
25
26
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
26
27
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
27
28
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -29,11 +30,68 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
29
30
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
30
31
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
31
32
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
33
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
34
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
35
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
36
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
37
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
38
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
39
|
+
var verifyMessage = _httpMessageSignatures.httpbis.verifyMessage;
|
|
40
|
+
function toANS104Request(fields) {
|
|
41
|
+
var _fields$anchor, _fields$Type, _fields$Variant;
|
|
42
|
+
var dataItem = {
|
|
43
|
+
target: fields.target,
|
|
44
|
+
anchor: (_fields$anchor = fields.anchor) !== null && _fields$anchor !== void 0 ? _fields$anchor : "",
|
|
45
|
+
tags: (0, _ramda.keys)((0, _ramda.omit)(["Target", "target", "Anchor", "anchor", "Data", "data", "data-protocol", "Data-Protocol", "variant", "Variant", "dryrun", "Dryrun", "Type", "type", "path", "method"], fields)).map(function (key) {
|
|
46
|
+
return {
|
|
47
|
+
name: key,
|
|
48
|
+
value: fields[key]
|
|
49
|
+
};
|
|
50
|
+
}, fields).concat([{
|
|
51
|
+
name: "Data-Protocol",
|
|
52
|
+
value: "ao"
|
|
53
|
+
}, {
|
|
54
|
+
name: "Type",
|
|
55
|
+
value: (_fields$Type = fields.Type) !== null && _fields$Type !== void 0 ? _fields$Type : "Message"
|
|
56
|
+
}, {
|
|
57
|
+
name: "Variant",
|
|
58
|
+
value: (_fields$Variant = fields.Variant) !== null && _fields$Variant !== void 0 ? _fields$Variant : "ao.N.1"
|
|
59
|
+
}]),
|
|
60
|
+
data: (fields === null || fields === void 0 ? void 0 : fields.data) || ""
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
headers: {
|
|
64
|
+
"Content-Type": "application/ans104",
|
|
65
|
+
"codec-device": "ans104@1.0"
|
|
66
|
+
},
|
|
67
|
+
item: dataItem
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function parseSignatureInput(input) {
|
|
71
|
+
var match = input.match(/^([^=]+)=\(([^)]+)\);alg="([^"]+)";keyid="([^"]+)"$/);
|
|
72
|
+
if (!match) throw new Error("Invalid signature-input format");
|
|
73
|
+
var _match = _slicedToArray(match, 5),
|
|
74
|
+
label = _match[1],
|
|
75
|
+
fieldsStr = _match[2],
|
|
76
|
+
alg = _match[3],
|
|
77
|
+
keyid = _match[4];
|
|
78
|
+
var fields = fieldsStr.split('" "').map(function (f) {
|
|
79
|
+
return f.replace(/"/g, "");
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
label: label,
|
|
83
|
+
fields: fields,
|
|
84
|
+
alg: alg,
|
|
85
|
+
keyid: keyid
|
|
86
|
+
};
|
|
87
|
+
}
|
|
32
88
|
var Server = /*#__PURE__*/function () {
|
|
33
89
|
function Server() {
|
|
34
90
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
35
91
|
_ref$ar = _ref.ar,
|
|
36
92
|
ar = _ref$ar === void 0 ? 4000 : _ref$ar,
|
|
93
|
+
_ref$bundler = _ref.bundler,
|
|
94
|
+
bundler = _ref$bundler === void 0 ? 4001 : _ref$bundler,
|
|
37
95
|
_ref$mu = _ref.mu,
|
|
38
96
|
mu = _ref$mu === void 0 ? 4002 : _ref$mu,
|
|
39
97
|
_ref$su = _ref.su,
|
|
@@ -48,6 +106,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
48
106
|
_classCallCheck(this, Server);
|
|
49
107
|
if (port) {
|
|
50
108
|
ar = port;
|
|
109
|
+
bundler = port + 1;
|
|
51
110
|
mu = port + 2;
|
|
52
111
|
su = port + 3;
|
|
53
112
|
cu = port + 4;
|
|
@@ -82,18 +141,175 @@ var Server = /*#__PURE__*/function () {
|
|
|
82
141
|
ar: ar,
|
|
83
142
|
mu: mu,
|
|
84
143
|
su: su,
|
|
85
|
-
cu: cu
|
|
144
|
+
cu: cu,
|
|
145
|
+
bundler: bundler
|
|
86
146
|
};
|
|
87
147
|
this.servers = [];
|
|
88
148
|
this.ar();
|
|
149
|
+
this.bundler();
|
|
89
150
|
this.mu();
|
|
90
151
|
this.su();
|
|
91
152
|
this.cu();
|
|
92
153
|
}
|
|
93
154
|
return _createClass(Server, [{
|
|
155
|
+
key: "bundler",
|
|
156
|
+
value: function bundler() {
|
|
157
|
+
var _this = this;
|
|
158
|
+
var app = (0, _express["default"])();
|
|
159
|
+
app.use((0, _cors["default"])());
|
|
160
|
+
app.use("/tx", _bodyParser["default"].raw({
|
|
161
|
+
type: "*/*",
|
|
162
|
+
limit: "100mb"
|
|
163
|
+
}));
|
|
164
|
+
app.post("/tx", /*#__PURE__*/function () {
|
|
165
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, res) {
|
|
166
|
+
var lines, sigs, currentKey, _iterator, _step, line, trimmed, headerMatch, _key, value, input, key, verifier, isValid, item, _iterator2, _step2, v, _res2, _res3;
|
|
167
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
168
|
+
while (1) switch (_context.prev = _context.next) {
|
|
169
|
+
case 0:
|
|
170
|
+
if (Buffer.isBuffer(req.body)) {
|
|
171
|
+
_context.next = 3;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
console.log("BD: Invalid body | expected raw Buffer");
|
|
175
|
+
return _context.abrupt("return", res.status(400).send("Invalid body: expected raw Buffer"));
|
|
176
|
+
case 3:
|
|
177
|
+
lines = req.body.toString("utf8").split(/\r?\n/);
|
|
178
|
+
sigs = {};
|
|
179
|
+
currentKey = null;
|
|
180
|
+
_iterator = _createForOfIteratorHelper(lines);
|
|
181
|
+
_context.prev = 7;
|
|
182
|
+
_iterator.s();
|
|
183
|
+
case 9:
|
|
184
|
+
if ((_step = _iterator.n()).done) {
|
|
185
|
+
_context.next = 19;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
line = _step.value;
|
|
189
|
+
trimmed = line.trim();
|
|
190
|
+
if (!/^--[a-zA-Z0-9_\-=]+/.test(trimmed)) {
|
|
191
|
+
_context.next = 15;
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
currentKey = null;
|
|
195
|
+
return _context.abrupt("continue", 17);
|
|
196
|
+
case 15:
|
|
197
|
+
headerMatch = trimmed.match(/^([a-zA-Z0-9_-]+):\s*(.*)$/);
|
|
198
|
+
if (headerMatch && !headerMatch[2].includes(": ")) {
|
|
199
|
+
_key = headerMatch[1];
|
|
200
|
+
value = headerMatch[2];
|
|
201
|
+
sigs[_key] = value;
|
|
202
|
+
currentKey = _key;
|
|
203
|
+
} else if (currentKey) sigs[currentKey] += "\n" + line;
|
|
204
|
+
case 17:
|
|
205
|
+
_context.next = 9;
|
|
206
|
+
break;
|
|
207
|
+
case 19:
|
|
208
|
+
_context.next = 24;
|
|
209
|
+
break;
|
|
210
|
+
case 21:
|
|
211
|
+
_context.prev = 21;
|
|
212
|
+
_context.t0 = _context["catch"](7);
|
|
213
|
+
_iterator.e(_context.t0);
|
|
214
|
+
case 24:
|
|
215
|
+
_context.prev = 24;
|
|
216
|
+
_iterator.f();
|
|
217
|
+
return _context.finish(24);
|
|
218
|
+
case 27:
|
|
219
|
+
sigs.target = req.headers.process;
|
|
220
|
+
sigs.slot = req.headers.slot;
|
|
221
|
+
input = parseSignatureInput(req.headers["signature-input"]);
|
|
222
|
+
key = {
|
|
223
|
+
kty: "RSA",
|
|
224
|
+
n: input.keyid,
|
|
225
|
+
e: "AQAB"
|
|
226
|
+
};
|
|
227
|
+
verifier = (0, _httpMessageSignatures.createVerifier)((0, _nodeCrypto.createPublicKey)({
|
|
228
|
+
key: key,
|
|
229
|
+
format: "jwk"
|
|
230
|
+
}), "rsa-pss-sha512");
|
|
231
|
+
_context.prev = 32;
|
|
232
|
+
_context.next = 35;
|
|
233
|
+
return verifyMessage({
|
|
234
|
+
keyLookup: function keyLookup(params) {
|
|
235
|
+
return {
|
|
236
|
+
verify: verifier
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}, {
|
|
240
|
+
method: req.method,
|
|
241
|
+
headers: req.headers,
|
|
242
|
+
url: "http://ao.com".concat(req.headers.path)
|
|
243
|
+
});
|
|
244
|
+
case 35:
|
|
245
|
+
isValid = _context.sent;
|
|
246
|
+
item = toANS104Request(sigs).item;
|
|
247
|
+
if (!(sigs.slot === "0" || sigs.type === "Process")) {
|
|
248
|
+
_context.next = 45;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
_iterator2 = _createForOfIteratorHelper(item.tags);
|
|
252
|
+
try {
|
|
253
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
254
|
+
v = _step2.value;
|
|
255
|
+
if (v.name === "Type") v.value = "Process";
|
|
256
|
+
}
|
|
257
|
+
} catch (err) {
|
|
258
|
+
_iterator2.e(err);
|
|
259
|
+
} finally {
|
|
260
|
+
_iterator2.f();
|
|
261
|
+
}
|
|
262
|
+
_context.next = 42;
|
|
263
|
+
return _this.spawn({
|
|
264
|
+
http_msg: item,
|
|
265
|
+
module: sigs.module,
|
|
266
|
+
scheduler: sigs.scheduler
|
|
267
|
+
});
|
|
268
|
+
case 42:
|
|
269
|
+
_res2 = _context.sent;
|
|
270
|
+
_context.next = 49;
|
|
271
|
+
break;
|
|
272
|
+
case 45:
|
|
273
|
+
if (!(sigs.type === "Message")) {
|
|
274
|
+
_context.next = 49;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
_context.next = 48;
|
|
278
|
+
return _this.message({
|
|
279
|
+
http_msg: item,
|
|
280
|
+
process: sigs.target
|
|
281
|
+
});
|
|
282
|
+
case 48:
|
|
283
|
+
_res3 = _context.sent;
|
|
284
|
+
case 49:
|
|
285
|
+
_context.next = 54;
|
|
286
|
+
break;
|
|
287
|
+
case 51:
|
|
288
|
+
_context.prev = 51;
|
|
289
|
+
_context.t1 = _context["catch"](32);
|
|
290
|
+
console.log(_context.t1, req.originalUrl);
|
|
291
|
+
case 54:
|
|
292
|
+
console.log("bundler success [pid]", sigs.target, "[slot]", sigs.slot);
|
|
293
|
+
return _context.abrupt("return", res.status(200).send("Success"));
|
|
294
|
+
case 56:
|
|
295
|
+
case "end":
|
|
296
|
+
return _context.stop();
|
|
297
|
+
}
|
|
298
|
+
}, _callee, null, [[7, 21, 24, 27], [32, 51]]);
|
|
299
|
+
}));
|
|
300
|
+
return function (_x, _x2) {
|
|
301
|
+
return _ref2.apply(this, arguments);
|
|
302
|
+
};
|
|
303
|
+
}());
|
|
304
|
+
var server = app.listen(this.ports.bundler, function () {
|
|
305
|
+
console.log("BD on port ".concat(_this.ports.bundler));
|
|
306
|
+
});
|
|
307
|
+
this.servers.push(server);
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
94
310
|
key: "ar",
|
|
95
311
|
value: function ar() {
|
|
96
|
-
var
|
|
312
|
+
var _this2 = this;
|
|
97
313
|
var app = (0, _express["default"])();
|
|
98
314
|
app.use((0, _cors["default"])());
|
|
99
315
|
app.use(_bodyParser["default"].json({
|
|
@@ -103,9 +319,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
103
319
|
return res.json({
|
|
104
320
|
version: 1,
|
|
105
321
|
timestamp: Date.now(),
|
|
106
|
-
height:
|
|
322
|
+
height: _this2.mem.height,
|
|
107
323
|
network: "wao.LN.1",
|
|
108
|
-
current:
|
|
324
|
+
current: _this2.mem.getAnchor()
|
|
109
325
|
});
|
|
110
326
|
});
|
|
111
327
|
app.get("/wallet/:id/balance", function (req, res) {
|
|
@@ -117,29 +333,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
117
333
|
});
|
|
118
334
|
});
|
|
119
335
|
app.get("/tx/:id/offset", /*#__PURE__*/function () {
|
|
120
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, res) {
|
|
121
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
122
|
-
while (1) switch (_context.prev = _context.next) {
|
|
123
|
-
case 0:
|
|
124
|
-
res.status(400);
|
|
125
|
-
res.send(null);
|
|
126
|
-
case 2:
|
|
127
|
-
case "end":
|
|
128
|
-
return _context.stop();
|
|
129
|
-
}
|
|
130
|
-
}, _callee);
|
|
131
|
-
}));
|
|
132
|
-
return function (_x, _x2) {
|
|
133
|
-
return _ref2.apply(this, arguments);
|
|
134
|
-
};
|
|
135
|
-
}());
|
|
136
|
-
app.get("/tx_anchor", /*#__PURE__*/function () {
|
|
137
336
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(req, res) {
|
|
138
337
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
139
338
|
while (1) switch (_context2.prev = _context2.next) {
|
|
140
339
|
case 0:
|
|
141
|
-
res.
|
|
142
|
-
|
|
340
|
+
res.status(400);
|
|
341
|
+
res.send(null);
|
|
342
|
+
case 2:
|
|
143
343
|
case "end":
|
|
144
344
|
return _context2.stop();
|
|
145
345
|
}
|
|
@@ -149,12 +349,12 @@ var Server = /*#__PURE__*/function () {
|
|
|
149
349
|
return _ref3.apply(this, arguments);
|
|
150
350
|
};
|
|
151
351
|
}());
|
|
152
|
-
app.get("/
|
|
352
|
+
app.get("/tx_anchor", /*#__PURE__*/function () {
|
|
153
353
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(req, res) {
|
|
154
354
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
155
355
|
while (1) switch (_context3.prev = _context3.next) {
|
|
156
356
|
case 0:
|
|
157
|
-
res.
|
|
357
|
+
res.send(_this2.mem.getAnchor());
|
|
158
358
|
case 1:
|
|
159
359
|
case "end":
|
|
160
360
|
return _context3.stop();
|
|
@@ -165,23 +365,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
165
365
|
return _ref4.apply(this, arguments);
|
|
166
366
|
};
|
|
167
367
|
}());
|
|
168
|
-
app.get("
|
|
368
|
+
app.get("/mine", /*#__PURE__*/function () {
|
|
169
369
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(req, res) {
|
|
170
|
-
var _data;
|
|
171
370
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
172
371
|
while (1) switch (_context4.prev = _context4.next) {
|
|
173
372
|
case 0:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
case 2:
|
|
177
|
-
_data = _context4.sent;
|
|
178
|
-
if (!_data) {
|
|
179
|
-
res.status(404);
|
|
180
|
-
res.send(null);
|
|
181
|
-
} else {
|
|
182
|
-
res.send(Buffer.from(_data, "base64"));
|
|
183
|
-
}
|
|
184
|
-
case 4:
|
|
373
|
+
res.json(req.params);
|
|
374
|
+
case 1:
|
|
185
375
|
case "end":
|
|
186
376
|
return _context4.stop();
|
|
187
377
|
}
|
|
@@ -191,13 +381,23 @@ var Server = /*#__PURE__*/function () {
|
|
|
191
381
|
return _ref5.apply(this, arguments);
|
|
192
382
|
};
|
|
193
383
|
}());
|
|
194
|
-
app.get("
|
|
384
|
+
app.get("/:id", /*#__PURE__*/function () {
|
|
195
385
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(req, res) {
|
|
386
|
+
var _data;
|
|
196
387
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
197
388
|
while (1) switch (_context5.prev = _context5.next) {
|
|
198
389
|
case 0:
|
|
199
|
-
|
|
200
|
-
|
|
390
|
+
_context5.next = 2;
|
|
391
|
+
return _this2._ar.data(req.params.id);
|
|
392
|
+
case 2:
|
|
393
|
+
_data = _context5.sent;
|
|
394
|
+
if (!_data) {
|
|
395
|
+
res.status(404);
|
|
396
|
+
res.send(null);
|
|
397
|
+
} else {
|
|
398
|
+
res.send(Buffer.from(_data, "base64"));
|
|
399
|
+
}
|
|
400
|
+
case 4:
|
|
201
401
|
case "end":
|
|
202
402
|
return _context5.stop();
|
|
203
403
|
}
|
|
@@ -207,13 +407,29 @@ var Server = /*#__PURE__*/function () {
|
|
|
207
407
|
return _ref6.apply(this, arguments);
|
|
208
408
|
};
|
|
209
409
|
}());
|
|
210
|
-
app.
|
|
410
|
+
app.get("/price/:id", /*#__PURE__*/function () {
|
|
211
411
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(req, res) {
|
|
212
|
-
var _req$body, query, variables, _toGraphObj, tar, args, res2, edges;
|
|
213
412
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
214
413
|
while (1) switch (_context6.prev = _context6.next) {
|
|
215
414
|
case 0:
|
|
216
|
-
|
|
415
|
+
res.send("0");
|
|
416
|
+
case 1:
|
|
417
|
+
case "end":
|
|
418
|
+
return _context6.stop();
|
|
419
|
+
}
|
|
420
|
+
}, _callee6);
|
|
421
|
+
}));
|
|
422
|
+
return function (_x11, _x12) {
|
|
423
|
+
return _ref7.apply(this, arguments);
|
|
424
|
+
};
|
|
425
|
+
}());
|
|
426
|
+
app.post("/graphql", /*#__PURE__*/function () {
|
|
427
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(req, res) {
|
|
428
|
+
var _req$body, query, variables, _toGraphObj, tar, args, res2, edges;
|
|
429
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
430
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
431
|
+
case 0:
|
|
432
|
+
_context7.prev = 0;
|
|
217
433
|
_req$body = req.body, query = _req$body.query, variables = _req$body.variables;
|
|
218
434
|
_toGraphObj = (0, _utils.toGraphObj)({
|
|
219
435
|
query: query,
|
|
@@ -221,24 +437,24 @@ var Server = /*#__PURE__*/function () {
|
|
|
221
437
|
}), tar = _toGraphObj.tar, args = _toGraphObj.args;
|
|
222
438
|
res2 = null;
|
|
223
439
|
if (!(tar === "transactions")) {
|
|
224
|
-
|
|
440
|
+
_context7.next = 10;
|
|
225
441
|
break;
|
|
226
442
|
}
|
|
227
|
-
|
|
228
|
-
return
|
|
443
|
+
_context7.next = 7;
|
|
444
|
+
return _this2.gql.txs(_objectSpread({}, args));
|
|
229
445
|
case 7:
|
|
230
|
-
res2 =
|
|
231
|
-
|
|
446
|
+
res2 = _context7.sent;
|
|
447
|
+
_context7.next = 14;
|
|
232
448
|
break;
|
|
233
449
|
case 10:
|
|
234
450
|
if (!(tar === "blocks")) {
|
|
235
|
-
|
|
451
|
+
_context7.next = 14;
|
|
236
452
|
break;
|
|
237
453
|
}
|
|
238
|
-
|
|
239
|
-
return
|
|
454
|
+
_context7.next = 13;
|
|
455
|
+
return _this2.gql.blocks(_objectSpread({}, args));
|
|
240
456
|
case 13:
|
|
241
|
-
res2 =
|
|
457
|
+
res2 = _context7.sent;
|
|
242
458
|
case 14:
|
|
243
459
|
edges = (0, _ramda.map)(function (v) {
|
|
244
460
|
return {
|
|
@@ -256,39 +472,39 @@ var Server = /*#__PURE__*/function () {
|
|
|
256
472
|
}
|
|
257
473
|
}
|
|
258
474
|
});
|
|
259
|
-
|
|
475
|
+
_context7.next = 23;
|
|
260
476
|
break;
|
|
261
477
|
case 18:
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
console.log(
|
|
478
|
+
_context7.prev = 18;
|
|
479
|
+
_context7.t0 = _context7["catch"](0);
|
|
480
|
+
console.log(_context7.t0);
|
|
265
481
|
res.status(400);
|
|
266
482
|
res.json({
|
|
267
483
|
error: "bad request"
|
|
268
484
|
});
|
|
269
485
|
case 23:
|
|
270
486
|
case "end":
|
|
271
|
-
return
|
|
487
|
+
return _context7.stop();
|
|
272
488
|
}
|
|
273
|
-
},
|
|
489
|
+
}, _callee7, null, [[0, 18]]);
|
|
274
490
|
}));
|
|
275
|
-
return function (
|
|
276
|
-
return
|
|
491
|
+
return function (_x13, _x14) {
|
|
492
|
+
return _ref8.apply(this, arguments);
|
|
277
493
|
};
|
|
278
494
|
}());
|
|
279
495
|
var data = {};
|
|
280
496
|
app.post("/:id", /*#__PURE__*/function () {
|
|
281
|
-
var
|
|
497
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(req, res) {
|
|
282
498
|
var buf;
|
|
283
|
-
return _regeneratorRuntime().wrap(function
|
|
284
|
-
while (1) switch (
|
|
499
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
500
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
285
501
|
case 0:
|
|
286
502
|
if (!req.body.chunk) {
|
|
287
|
-
|
|
503
|
+
_context8.next = 14;
|
|
288
504
|
break;
|
|
289
505
|
}
|
|
290
506
|
if (!data[req.body.data_root]) {
|
|
291
|
-
|
|
507
|
+
_context8.next = 11;
|
|
292
508
|
break;
|
|
293
509
|
}
|
|
294
510
|
data[req.body.data_root].data += req.body.chunk;
|
|
@@ -300,53 +516,36 @@ var Server = /*#__PURE__*/function () {
|
|
|
300
516
|
}
|
|
301
517
|
delete req.body.chunk;
|
|
302
518
|
if (!(data[req.body.data_root].data_size <= data[req.body.data_root].chunks.length)) {
|
|
303
|
-
|
|
519
|
+
_context8.next = 11;
|
|
304
520
|
break;
|
|
305
521
|
}
|
|
306
522
|
data[req.body.data_root].data = data[req.body.data_root].chunks.toString("base64");
|
|
307
|
-
|
|
308
|
-
return
|
|
523
|
+
_context8.next = 10;
|
|
524
|
+
return _this2._ar.postTx(data[req.body.data_root]);
|
|
309
525
|
case 10:
|
|
310
526
|
delete data[req.body.data_root];
|
|
311
527
|
case 11:
|
|
312
528
|
res.json({
|
|
313
529
|
id: req.body.id
|
|
314
530
|
});
|
|
315
|
-
|
|
531
|
+
_context8.next = 21;
|
|
316
532
|
break;
|
|
317
533
|
case 14:
|
|
318
534
|
if (!(req.body.data_root && req.body.data === "")) {
|
|
319
|
-
|
|
535
|
+
_context8.next = 18;
|
|
320
536
|
break;
|
|
321
537
|
}
|
|
322
538
|
data[req.body.data_root] = req.body;
|
|
323
|
-
|
|
539
|
+
_context8.next = 20;
|
|
324
540
|
break;
|
|
325
541
|
case 18:
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
case 21:
|
|
542
|
+
_context8.next = 20;
|
|
543
|
+
return _this2._ar.postTx(req.body);
|
|
544
|
+
case 20:
|
|
330
545
|
res.json({
|
|
331
546
|
id: req.body.id
|
|
332
547
|
});
|
|
333
|
-
case
|
|
334
|
-
case "end":
|
|
335
|
-
return _context7.stop();
|
|
336
|
-
}
|
|
337
|
-
}, _callee7);
|
|
338
|
-
}));
|
|
339
|
-
return function (_x13, _x14) {
|
|
340
|
-
return _ref8.apply(this, arguments);
|
|
341
|
-
};
|
|
342
|
-
}());
|
|
343
|
-
app.get("*", /*#__PURE__*/function () {
|
|
344
|
-
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(req, res) {
|
|
345
|
-
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
346
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
347
|
-
case 0:
|
|
348
|
-
console.log("what");
|
|
349
|
-
case 1:
|
|
548
|
+
case 21:
|
|
350
549
|
case "end":
|
|
351
550
|
return _context8.stop();
|
|
352
551
|
}
|
|
@@ -357,14 +556,14 @@ var Server = /*#__PURE__*/function () {
|
|
|
357
556
|
};
|
|
358
557
|
}());
|
|
359
558
|
var server = app.listen(this.ports.ar, function () {
|
|
360
|
-
console.log("AR on port ".concat(
|
|
559
|
+
console.log("AR on port ".concat(_this2.ports.ar));
|
|
361
560
|
});
|
|
362
561
|
this.servers.push(server);
|
|
363
562
|
}
|
|
364
563
|
}, {
|
|
365
564
|
key: "mu",
|
|
366
565
|
value: function mu() {
|
|
367
|
-
var
|
|
566
|
+
var _this3 = this;
|
|
368
567
|
var app = (0, _express["default"])();
|
|
369
568
|
app.use((0, _cors["default"])());
|
|
370
569
|
app.use(_express["default"].raw({
|
|
@@ -379,7 +578,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
379
578
|
while (1) switch (_context9.prev = _context9.next) {
|
|
380
579
|
case 0:
|
|
381
580
|
_context9.next = 2;
|
|
382
|
-
return
|
|
581
|
+
return _this3.monitor({
|
|
383
582
|
process: req.params.id
|
|
384
583
|
});
|
|
385
584
|
case 2:
|
|
@@ -403,7 +602,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
403
602
|
while (1) switch (_context10.prev = _context10.next) {
|
|
404
603
|
case 0:
|
|
405
604
|
_context10.next = 2;
|
|
406
|
-
return
|
|
605
|
+
return _this3.unmonitor({
|
|
407
606
|
process: req.params.id
|
|
408
607
|
});
|
|
409
608
|
case 2:
|
|
@@ -423,7 +622,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
423
622
|
}());
|
|
424
623
|
app.post("/", /*#__PURE__*/function () {
|
|
425
624
|
var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(req, res) {
|
|
426
|
-
var binary, valid, type, item, _tags, err,
|
|
625
|
+
var binary, valid, type, item, _tags, err, _res4;
|
|
427
626
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
428
627
|
while (1) switch (_context11.prev = _context11.next) {
|
|
429
628
|
case 0:
|
|
@@ -442,14 +641,14 @@ var Server = /*#__PURE__*/function () {
|
|
|
442
641
|
break;
|
|
443
642
|
}
|
|
444
643
|
_context11.next = 12;
|
|
445
|
-
return
|
|
644
|
+
return _this3.spawn({
|
|
446
645
|
item: item,
|
|
447
646
|
module: _tags.Module,
|
|
448
647
|
scheduler: _tags.Scheduler
|
|
449
648
|
});
|
|
450
649
|
case 12:
|
|
451
|
-
|
|
452
|
-
if (!
|
|
650
|
+
_res4 = _context11.sent;
|
|
651
|
+
if (!_res4) err = "bad requrest";
|
|
453
652
|
_context11.next = 22;
|
|
454
653
|
break;
|
|
455
654
|
case 16:
|
|
@@ -458,7 +657,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
458
657
|
break;
|
|
459
658
|
}
|
|
460
659
|
_context11.next = 19;
|
|
461
|
-
return
|
|
660
|
+
return _this3.message({
|
|
462
661
|
item: item,
|
|
463
662
|
process: item.target
|
|
464
663
|
});
|
|
@@ -489,14 +688,14 @@ var Server = /*#__PURE__*/function () {
|
|
|
489
688
|
};
|
|
490
689
|
}());
|
|
491
690
|
var server = app.listen(this.ports.mu, function () {
|
|
492
|
-
return console.log("MU on port ".concat(
|
|
691
|
+
return console.log("MU on port ".concat(_this3.ports.mu));
|
|
493
692
|
});
|
|
494
693
|
this.servers.push(server);
|
|
495
694
|
}
|
|
496
695
|
}, {
|
|
497
696
|
key: "su",
|
|
498
697
|
value: function su() {
|
|
499
|
-
var
|
|
698
|
+
var _this4 = this;
|
|
500
699
|
var app = (0, _express["default"])();
|
|
501
700
|
app.use((0, _cors["default"])());
|
|
502
701
|
app.use(_bodyParser["default"].json());
|
|
@@ -505,17 +704,17 @@ var Server = /*#__PURE__*/function () {
|
|
|
505
704
|
Unit: "Scheduler",
|
|
506
705
|
Timestamp: Date.now(),
|
|
507
706
|
Address: _test.su.addr,
|
|
508
|
-
Processes: (0, _ramda.keys)(
|
|
707
|
+
Processes: (0, _ramda.keys)(_this4.mem.env)
|
|
509
708
|
});
|
|
510
709
|
});
|
|
511
710
|
app.get("/timestamp", function (req, res) {
|
|
512
711
|
return res.json({
|
|
513
712
|
timestamp: Date.now(),
|
|
514
|
-
block_height:
|
|
713
|
+
block_height: _this4.mem.height
|
|
515
714
|
});
|
|
516
715
|
});
|
|
517
716
|
app.get("/:pid", function (req, res) {
|
|
518
|
-
var
|
|
717
|
+
var _this4$mem$env$pid$re, _this4$mem$env$pid;
|
|
519
718
|
var pid = req.params.pid;
|
|
520
719
|
var edges = (0, _ramda.map)(/*#__PURE__*/function () {
|
|
521
720
|
var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(v) {
|
|
@@ -525,13 +724,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
525
724
|
while (1) switch (_context12.prev = _context12.next) {
|
|
526
725
|
case 0:
|
|
527
726
|
_context12.next = 2;
|
|
528
|
-
return
|
|
727
|
+
return _this4.mem.getTx(v);
|
|
529
728
|
case 2:
|
|
530
729
|
tx = _context12.sent;
|
|
531
730
|
_tags = (0, _utils.tags)(v.tags);
|
|
532
731
|
mid = _tags.Message;
|
|
533
732
|
_context12.next = 7;
|
|
534
|
-
return
|
|
733
|
+
return _this4.mem.getTx(mid);
|
|
535
734
|
case 7:
|
|
536
735
|
mtx = _context12.sent;
|
|
537
736
|
return _context12.abrupt("return", {
|
|
@@ -540,7 +739,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
540
739
|
message: {
|
|
541
740
|
id: mtx.id,
|
|
542
741
|
tags: mtx.tags,
|
|
543
|
-
owner:
|
|
742
|
+
owner: _this4.mem.addrmap[mtx.owner],
|
|
544
743
|
anchor: (_mtx$anchor = mtx.anchor) !== null && _mtx$anchor !== void 0 ? _mtx$anchor : null,
|
|
545
744
|
target: pid,
|
|
546
745
|
signature: mtx.signature,
|
|
@@ -549,7 +748,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
549
748
|
assignment: {
|
|
550
749
|
id: tx.id,
|
|
551
750
|
tags: tx.tags,
|
|
552
|
-
owner:
|
|
751
|
+
owner: _this4.mem.addrmap[tx.owner],
|
|
553
752
|
anchor: (_tx$anchor = tx.anchor) !== null && _tx$anchor !== void 0 ? _tx$anchor : null,
|
|
554
753
|
target: null,
|
|
555
754
|
signature: tx.signature
|
|
@@ -565,7 +764,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
565
764
|
return function (_x23) {
|
|
566
765
|
return _ref13.apply(this, arguments);
|
|
567
766
|
};
|
|
568
|
-
}())((0, _ramda.reverse)((
|
|
767
|
+
}())((0, _ramda.reverse)((_this4$mem$env$pid$re = (_this4$mem$env$pid = _this4.mem.env[pid]) === null || _this4$mem$env$pid === void 0 ? void 0 : _this4$mem$env$pid.results) !== null && _this4$mem$env$pid$re !== void 0 ? _this4$mem$env$pid$re : [])); // need mod
|
|
569
768
|
res.json({
|
|
570
769
|
page_info: {
|
|
571
770
|
has_next_page: false
|
|
@@ -573,31 +772,15 @@ var Server = /*#__PURE__*/function () {
|
|
|
573
772
|
edges: edges
|
|
574
773
|
});
|
|
575
774
|
});
|
|
576
|
-
app.get("*", /*#__PURE__*/function () {
|
|
577
|
-
var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(req, res) {
|
|
578
|
-
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
579
|
-
while (1) switch (_context13.prev = _context13.next) {
|
|
580
|
-
case 0:
|
|
581
|
-
console.log("what2");
|
|
582
|
-
case 1:
|
|
583
|
-
case "end":
|
|
584
|
-
return _context13.stop();
|
|
585
|
-
}
|
|
586
|
-
}, _callee13);
|
|
587
|
-
}));
|
|
588
|
-
return function (_x24, _x25) {
|
|
589
|
-
return _ref14.apply(this, arguments);
|
|
590
|
-
};
|
|
591
|
-
}());
|
|
592
775
|
var server = app.listen(this.ports.su, function () {
|
|
593
|
-
return console.log("SU on port ".concat(
|
|
776
|
+
return console.log("SU on port ".concat(_this4.ports.su));
|
|
594
777
|
});
|
|
595
778
|
this.servers.push(server);
|
|
596
779
|
}
|
|
597
780
|
}, {
|
|
598
781
|
key: "cu",
|
|
599
782
|
value: function cu() {
|
|
600
|
-
var
|
|
783
|
+
var _this5 = this;
|
|
601
784
|
var app = (0, _express["default"])();
|
|
602
785
|
app.use((0, _cors["default"])());
|
|
603
786
|
app.use(_bodyParser["default"].json());
|
|
@@ -607,60 +790,71 @@ var Server = /*#__PURE__*/function () {
|
|
|
607
790
|
address: _test.cu.addr
|
|
608
791
|
});
|
|
609
792
|
});
|
|
610
|
-
|
|
611
|
-
var
|
|
612
|
-
var res2;
|
|
613
|
-
return _regeneratorRuntime().wrap(function
|
|
614
|
-
while (1) switch (
|
|
793
|
+
var result = /*#__PURE__*/function () {
|
|
794
|
+
var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(req, res) {
|
|
795
|
+
var message, process, _this5$mem$env$proces, res2;
|
|
796
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
797
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
615
798
|
case 0:
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
799
|
+
message = req.params.mid;
|
|
800
|
+
process = req.query["process-id"];
|
|
801
|
+
if (!(0, _ramda.isNil)(_this5.mem.env[process])) {
|
|
802
|
+
_context13.next = 8;
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
console.log("process not found:", req.query["process-id"]);
|
|
806
|
+
res.status(404);
|
|
807
|
+
res.json({
|
|
808
|
+
error: "not found"
|
|
620
809
|
});
|
|
621
|
-
|
|
622
|
-
|
|
810
|
+
setTimeout(function () {
|
|
811
|
+
console.log(_this5.mem.env);
|
|
812
|
+
}, 1000);
|
|
813
|
+
return _context13.abrupt("return");
|
|
814
|
+
case 8:
|
|
815
|
+
if (!/^--[0-9a-zA-Z_-]{43,44}$/.test(message)) {
|
|
816
|
+
message = (_this5$mem$env$proces = _this5.mem.env[process]) === null || _this5$mem$env$proces === void 0 || (_this5$mem$env$proces = _this5$mem$env$proces.results) === null || _this5$mem$env$proces === void 0 ? void 0 : _this5$mem$env$proces[message];
|
|
817
|
+
}
|
|
818
|
+
if (!(0, _ramda.isNil)(message)) {
|
|
819
|
+
_context13.next = 14;
|
|
820
|
+
break;
|
|
821
|
+
}
|
|
822
|
+
console.log("message not found", message, req.params);
|
|
823
|
+
res.status(404);
|
|
824
|
+
res.json({
|
|
825
|
+
error: "Not Found"
|
|
826
|
+
});
|
|
827
|
+
return _context13.abrupt("return");
|
|
828
|
+
case 14:
|
|
829
|
+
_context13.next = 16;
|
|
830
|
+
return _this5.result({
|
|
831
|
+
message: message,
|
|
832
|
+
process: process
|
|
833
|
+
});
|
|
834
|
+
case 16:
|
|
835
|
+
res2 = _context13.sent;
|
|
623
836
|
res.json(res2);
|
|
624
|
-
case
|
|
837
|
+
case 18:
|
|
625
838
|
case "end":
|
|
626
|
-
return
|
|
839
|
+
return _context13.stop();
|
|
627
840
|
}
|
|
628
|
-
},
|
|
841
|
+
}, _callee13);
|
|
629
842
|
}));
|
|
630
|
-
return function (
|
|
631
|
-
return
|
|
843
|
+
return function result(_x24, _x25) {
|
|
844
|
+
return _ref14.apply(this, arguments);
|
|
632
845
|
};
|
|
633
|
-
}()
|
|
846
|
+
}();
|
|
847
|
+
app.post("/result/:mid", result);
|
|
848
|
+
app.get("/result/:mid", result);
|
|
634
849
|
app.get("/state/:pid", /*#__PURE__*/function () {
|
|
635
|
-
var
|
|
636
|
-
var
|
|
850
|
+
var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(req, res) {
|
|
851
|
+
var _this5$mem$env$pid$me, _this5$mem$env$pid;
|
|
637
852
|
var pid, memory;
|
|
638
|
-
return _regeneratorRuntime().wrap(function
|
|
639
|
-
while (1) switch (
|
|
853
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
854
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
640
855
|
case 0:
|
|
641
856
|
pid = req.params.pid;
|
|
642
|
-
|
|
643
|
-
return (_this4$mem$env$pid = _this4.mem.env[pid]) === null || _this4$mem$env$pid === void 0 ? void 0 : _this4$mem$env$pid.memory;
|
|
644
|
-
case 3:
|
|
645
|
-
_context15.t1 = _yield$_this4$mem$env = _context15.sent;
|
|
646
|
-
_context15.t0 = _context15.t1 !== null;
|
|
647
|
-
if (!_context15.t0) {
|
|
648
|
-
_context15.next = 7;
|
|
649
|
-
break;
|
|
650
|
-
}
|
|
651
|
-
_context15.t0 = _yield$_this4$mem$env !== void 0;
|
|
652
|
-
case 7:
|
|
653
|
-
if (!_context15.t0) {
|
|
654
|
-
_context15.next = 11;
|
|
655
|
-
break;
|
|
656
|
-
}
|
|
657
|
-
_context15.t2 = _yield$_this4$mem$env;
|
|
658
|
-
_context15.next = 12;
|
|
659
|
-
break;
|
|
660
|
-
case 11:
|
|
661
|
-
_context15.t2 = null;
|
|
662
|
-
case 12:
|
|
663
|
-
memory = _context15.t2;
|
|
857
|
+
memory = (_this5$mem$env$pid$me = (_this5$mem$env$pid = _this5.mem.env[pid]) === null || _this5$mem$env$pid === void 0 ? void 0 : _this5$mem$env$pid.memory) !== null && _this5$mem$env$pid$me !== void 0 ? _this5$mem$env$pid$me : null;
|
|
664
858
|
if (!memory) {
|
|
665
859
|
res.status(404);
|
|
666
860
|
res.json({
|
|
@@ -669,26 +863,26 @@ var Server = /*#__PURE__*/function () {
|
|
|
669
863
|
} else {
|
|
670
864
|
res.send(Buffer.from(memory));
|
|
671
865
|
}
|
|
672
|
-
case
|
|
866
|
+
case 3:
|
|
673
867
|
case "end":
|
|
674
|
-
return
|
|
868
|
+
return _context14.stop();
|
|
675
869
|
}
|
|
676
|
-
},
|
|
870
|
+
}, _callee14);
|
|
677
871
|
}));
|
|
678
|
-
return function (
|
|
679
|
-
return
|
|
872
|
+
return function (_x26, _x27) {
|
|
873
|
+
return _ref15.apply(this, arguments);
|
|
680
874
|
};
|
|
681
875
|
}());
|
|
682
876
|
app.post("/dry-run", /*#__PURE__*/function () {
|
|
683
|
-
var
|
|
877
|
+
var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(req, res) {
|
|
684
878
|
var process, _req$body2, id, owner, tags, data, res2;
|
|
685
|
-
return _regeneratorRuntime().wrap(function
|
|
686
|
-
while (1) switch (
|
|
879
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
880
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
687
881
|
case 0:
|
|
688
882
|
process = req.query["process-id"];
|
|
689
883
|
_req$body2 = req.body, id = _req$body2.Id, owner = _req$body2.Owner, tags = _req$body2.Tags, data = _req$body2.Data;
|
|
690
|
-
|
|
691
|
-
return
|
|
884
|
+
_context15.next = 4;
|
|
885
|
+
return _this5.dryrun({
|
|
692
886
|
id: id,
|
|
693
887
|
owner: owner,
|
|
694
888
|
tags: tags,
|
|
@@ -696,7 +890,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
696
890
|
process: process
|
|
697
891
|
});
|
|
698
892
|
case 4:
|
|
699
|
-
res2 =
|
|
893
|
+
res2 = _context15.sent;
|
|
700
894
|
if (!res2) {
|
|
701
895
|
res.status(400);
|
|
702
896
|
res.json({
|
|
@@ -708,109 +902,109 @@ var Server = /*#__PURE__*/function () {
|
|
|
708
902
|
}
|
|
709
903
|
case 6:
|
|
710
904
|
case "end":
|
|
711
|
-
return
|
|
905
|
+
return _context15.stop();
|
|
712
906
|
}
|
|
713
|
-
},
|
|
907
|
+
}, _callee15);
|
|
714
908
|
}));
|
|
715
|
-
return function (
|
|
716
|
-
return
|
|
909
|
+
return function (_x28, _x29) {
|
|
910
|
+
return _ref16.apply(this, arguments);
|
|
717
911
|
};
|
|
718
912
|
}());
|
|
719
913
|
app.get("/results/:pid", /*#__PURE__*/function () {
|
|
720
|
-
var
|
|
721
|
-
var
|
|
722
|
-
var pid, _req$query, _req$query$from, from, _req$query$to, to, _req$query$sort, sort, _req$query$limit, limit, results, _res, i, count, started,
|
|
723
|
-
return _regeneratorRuntime().wrap(function
|
|
724
|
-
while (1) switch (
|
|
914
|
+
var _ref17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(req, res) {
|
|
915
|
+
var _this5$mem$env$pid$re, _this5$mem$env$pid2;
|
|
916
|
+
var pid, _req$query, _req$query$from, from, _req$query$to, to, _req$query$sort, sort, _req$query$limit, limit, results, _res, i, count, started, _iterator3, _step3, v, _this5$mem$msgs$v;
|
|
917
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
918
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
725
919
|
case 0:
|
|
726
920
|
pid = req.params.pid;
|
|
727
921
|
_req$query = req.query, _req$query$from = _req$query.from, from = _req$query$from === void 0 ? null : _req$query$from, _req$query$to = _req$query.to, to = _req$query$to === void 0 ? null : _req$query$to, _req$query$sort = _req$query.sort, sort = _req$query$sort === void 0 ? "ASC" : _req$query$sort, _req$query$limit = _req$query.limit, limit = _req$query$limit === void 0 ? 25 : _req$query$limit;
|
|
728
|
-
results = (
|
|
922
|
+
results = (_this5$mem$env$pid$re = (_this5$mem$env$pid2 = _this5.mem.env[pid]) === null || _this5$mem$env$pid2 === void 0 ? void 0 : _this5$mem$env$pid2.results) !== null && _this5$mem$env$pid$re !== void 0 ? _this5$mem$env$pid$re : [];
|
|
729
923
|
if (sort === "DESC") results = (0, _ramda.reverse)(results);
|
|
730
924
|
_res = [];
|
|
731
925
|
i = 1;
|
|
732
926
|
count = 0;
|
|
733
927
|
started = (0, _ramda.isNil)(from);
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
928
|
+
_iterator3 = _createForOfIteratorHelper(results);
|
|
929
|
+
_context16.prev = 9;
|
|
930
|
+
_iterator3.s();
|
|
737
931
|
case 11:
|
|
738
|
-
if ((
|
|
739
|
-
|
|
932
|
+
if ((_step3 = _iterator3.n()).done) {
|
|
933
|
+
_context16.next = 26;
|
|
740
934
|
break;
|
|
741
935
|
}
|
|
742
|
-
v =
|
|
936
|
+
v = _step3.value;
|
|
743
937
|
if (!started) {
|
|
744
|
-
|
|
938
|
+
_context16.next = 22;
|
|
745
939
|
break;
|
|
746
940
|
}
|
|
747
941
|
_res.push({
|
|
748
942
|
cursor: v,
|
|
749
|
-
node: (
|
|
943
|
+
node: (_this5$mem$msgs$v = _this5.mem.msgs[v]) === null || _this5$mem$msgs$v === void 0 ? void 0 : _this5$mem$msgs$v.res
|
|
750
944
|
});
|
|
751
945
|
count++;
|
|
752
946
|
if (!(!(0, _ramda.isNil)(to) && v === to)) {
|
|
753
|
-
|
|
947
|
+
_context16.next = 18;
|
|
754
948
|
break;
|
|
755
949
|
}
|
|
756
|
-
return
|
|
950
|
+
return _context16.abrupt("break", 26);
|
|
757
951
|
case 18:
|
|
758
952
|
if (!(limit <= count)) {
|
|
759
|
-
|
|
953
|
+
_context16.next = 20;
|
|
760
954
|
break;
|
|
761
955
|
}
|
|
762
|
-
return
|
|
956
|
+
return _context16.abrupt("break", 26);
|
|
763
957
|
case 20:
|
|
764
|
-
|
|
958
|
+
_context16.next = 23;
|
|
765
959
|
break;
|
|
766
960
|
case 22:
|
|
767
961
|
if (from === v) started = true;
|
|
768
962
|
case 23:
|
|
769
963
|
i++;
|
|
770
964
|
case 24:
|
|
771
|
-
|
|
965
|
+
_context16.next = 11;
|
|
772
966
|
break;
|
|
773
967
|
case 26:
|
|
774
|
-
|
|
968
|
+
_context16.next = 31;
|
|
775
969
|
break;
|
|
776
970
|
case 28:
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
971
|
+
_context16.prev = 28;
|
|
972
|
+
_context16.t0 = _context16["catch"](9);
|
|
973
|
+
_iterator3.e(_context16.t0);
|
|
780
974
|
case 31:
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
return
|
|
975
|
+
_context16.prev = 31;
|
|
976
|
+
_iterator3.f();
|
|
977
|
+
return _context16.finish(31);
|
|
784
978
|
case 34:
|
|
785
979
|
res.json({
|
|
786
980
|
edges: _res
|
|
787
981
|
});
|
|
788
982
|
case 35:
|
|
789
983
|
case "end":
|
|
790
|
-
return
|
|
984
|
+
return _context16.stop();
|
|
791
985
|
}
|
|
792
|
-
},
|
|
986
|
+
}, _callee16, null, [[9, 28, 31, 34]]);
|
|
793
987
|
}));
|
|
794
|
-
return function (
|
|
795
|
-
return
|
|
988
|
+
return function (_x30, _x31) {
|
|
989
|
+
return _ref17.apply(this, arguments);
|
|
796
990
|
};
|
|
797
991
|
}());
|
|
798
992
|
var server = app.listen(this.ports.cu, function () {
|
|
799
|
-
return console.log("CU on port ".concat(
|
|
993
|
+
return console.log("CU on port ".concat(_this5.ports.cu));
|
|
800
994
|
});
|
|
801
995
|
this.servers.push(server);
|
|
802
996
|
}
|
|
803
997
|
}, {
|
|
804
998
|
key: "end",
|
|
805
999
|
value: function end() {
|
|
806
|
-
var
|
|
1000
|
+
var _this6 = this;
|
|
807
1001
|
return new Promise(function (res) {
|
|
808
1002
|
var count = 0;
|
|
809
|
-
var
|
|
810
|
-
|
|
1003
|
+
var _iterator4 = _createForOfIteratorHelper(_this6.servers),
|
|
1004
|
+
_step4;
|
|
811
1005
|
try {
|
|
812
|
-
for (
|
|
813
|
-
var v =
|
|
1006
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1007
|
+
var v = _step4.value;
|
|
814
1008
|
v.close(function () {
|
|
815
1009
|
count += 1;
|
|
816
1010
|
if (count >= 4) {
|
|
@@ -820,9 +1014,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
820
1014
|
});
|
|
821
1015
|
}
|
|
822
1016
|
} catch (err) {
|
|
823
|
-
|
|
1017
|
+
_iterator4.e(err);
|
|
824
1018
|
} finally {
|
|
825
|
-
|
|
1019
|
+
_iterator4.f();
|
|
826
1020
|
}
|
|
827
1021
|
});
|
|
828
1022
|
}
|