wao 0.11.2 → 0.12.1

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.
Files changed (558) hide show
  1. package/cjs/bar.js +37 -28
  2. package/cjs/lua/weavedb_mock.lua +3 -2
  3. package/cjs/waosm-node.js +3 -1
  4. package/cjs/weavedb.js +138 -66
  5. package/esm/.db/100040/data/1/123.json +1 -0
  6. package/esm/.db/103252/data/0/13315.json +1 -0
  7. package/esm/.db/103252/data/1/120.json +1 -0
  8. package/esm/.db/103252/data/1/123.json +1 -0
  9. package/esm/.db/105470/data/0/0.json +1 -0
  10. package/esm/.db/105470/data/1/120.json +1 -0
  11. package/esm/.db/105470/data/1/123.json +1 -0
  12. package/esm/.db/105470/data/3/104.json +1 -0
  13. package/esm/.db/105667/data/ppl/bob.json +1 -0
  14. package/esm/.db/105869/data/1/120.json +1 -0
  15. package/esm/.db/105869/data/1/123.json +1 -0
  16. package/esm/.db/113125/data/1/example.json +1 -0
  17. package/esm/.db/116234/data/1/123.json +1 -0
  18. package/esm/.db/119911/data/1/120.json +1 -0
  19. package/esm/.db/119911/data/1/123.json +1 -0
  20. package/esm/.db/122989/data/0/0.json +1 -0
  21. package/esm/.db/122989/data/1/120.json +1 -0
  22. package/esm/.db/122989/data/1/123.json +1 -0
  23. package/esm/.db/125755/data/1/123.json +1 -0
  24. package/esm/.db/126241/data/1/123.json +1 -0
  25. package/esm/.db/129099/data/1/123.json +1 -0
  26. package/esm/.db/129781/data/0/14083.json +1 -0
  27. package/esm/.db/129781/data/1/120.json +1 -0
  28. package/esm/.db/129781/data/1/123.json +1 -0
  29. package/esm/.db/129781/data/15/0.json +1 -0
  30. package/esm/.db/132860/data/0/13315.json +1 -0
  31. package/esm/.db/132860/data/1/120.json +1 -0
  32. package/esm/.db/132860/data/1/123.json +1 -0
  33. package/esm/.db/134721/data/1/123.json +1 -0
  34. package/esm/.db/137408/data/ppl/bob.json +1 -0
  35. package/esm/.db/137556/data/1/123.json +1 -0
  36. package/esm/.db/143417/data/1/123.json +1 -0
  37. package/esm/.db/143799/data/1/123.json +1 -0
  38. package/esm/.db/146558/data/0/0.json +1 -0
  39. package/esm/.db/146558/data/1/120.json +1 -0
  40. package/esm/.db/146558/data/1/123.json +1 -0
  41. package/esm/.db/153145/data/1/123.json +1 -0
  42. package/esm/.db/153912/data/1/example.json +1 -0
  43. package/esm/.db/154536/data/0/13315.json +1 -0
  44. package/esm/.db/154536/data/1/120.json +1 -0
  45. package/esm/.db/154536/data/1/123.json +1 -0
  46. package/esm/.db/158777/data/1/123.json +1 -0
  47. package/esm/.db/170678/data/0/13315.json +1 -0
  48. package/esm/.db/170678/data/1/120.json +1 -0
  49. package/esm/.db/170678/data/1/123.json +1 -0
  50. package/esm/.db/17434/data/1/123.json +1 -0
  51. package/esm/.db/176113/data/1/123.json +1 -0
  52. package/esm/.db/179669/data/0/13315.json +1 -0
  53. package/esm/.db/179669/data/1/120.json +1 -0
  54. package/esm/.db/179669/data/1/123.json +1 -0
  55. package/esm/.db/183368/data/1/120.json +1 -0
  56. package/esm/.db/183368/data/1/123.json +1 -0
  57. package/esm/.db/188491/data/0/14083.json +1 -0
  58. package/esm/.db/188491/data/1/120.json +1 -0
  59. package/esm/.db/188491/data/1/123.json +1 -0
  60. package/esm/.db/188491/data/15/0.json +1 -0
  61. package/esm/.db/189189/data/ppl/bob.json +1 -0
  62. package/esm/.db/195025/data/1/120.json +1 -0
  63. package/esm/.db/195025/data/1/123.json +1 -0
  64. package/esm/.db/19852/data/1/123.json +1 -0
  65. package/esm/.db/204968/data/1/123.json +1 -0
  66. package/esm/.db/207069/data/0/0.json +1 -0
  67. package/esm/.db/207069/data/1/120.json +1 -0
  68. package/esm/.db/207069/data/1/123.json +1 -0
  69. package/esm/.db/211038/data/1/120.json +1 -0
  70. package/esm/.db/211038/data/1/123.json +1 -0
  71. package/esm/.db/211580/data/1/120.json +1 -0
  72. package/esm/.db/211580/data/1/123.json +1 -0
  73. package/esm/.db/214305/data/0/0.json +1 -0
  74. package/esm/.db/214305/data/1/120.json +1 -0
  75. package/esm/.db/214305/data/1/123.json +1 -0
  76. package/esm/.db/214712/data/0/13315.json +1 -0
  77. package/esm/.db/214712/data/1/120.json +1 -0
  78. package/esm/.db/214712/data/1/123.json +1 -0
  79. package/esm/.db/218886/data/0/14083.json +1 -0
  80. package/esm/.db/218886/data/1/120.json +1 -0
  81. package/esm/.db/218886/data/1/123.json +1 -0
  82. package/esm/.db/218886/data/15/0.json +1 -0
  83. package/esm/.db/221009/data/1/123.json +1 -0
  84. package/esm/.db/221818/data/1/120.json +1 -0
  85. package/esm/.db/221818/data/1/123.json +1 -0
  86. package/esm/.db/226668/data/0/13315.json +1 -0
  87. package/esm/.db/226668/data/1/120.json +1 -0
  88. package/esm/.db/226668/data/1/123.json +1 -0
  89. package/esm/.db/226981/data/0/123.json +1 -0
  90. package/esm/.db/235331/data/0/13315.json +1 -0
  91. package/esm/.db/235331/data/1/120.json +1 -0
  92. package/esm/.db/235331/data/1/123.json +1 -0
  93. package/esm/.db/247863/data/1/123.json +1 -0
  94. package/esm/.db/247918/data/0/0.json +1 -0
  95. package/esm/.db/247918/data/1/120.json +1 -0
  96. package/esm/.db/247918/data/1/123.json +1 -0
  97. package/esm/.db/247918/data/3/104.json +1 -0
  98. package/esm/.db/250384/data/1/123.json +1 -0
  99. package/esm/.db/253205/data/1/120.json +1 -0
  100. package/esm/.db/253205/data/1/123.json +1 -0
  101. package/esm/.db/26452/data/1/120.json +1 -0
  102. package/esm/.db/26452/data/1/123.json +1 -0
  103. package/esm/.db/265430/data/1/120.json +1 -0
  104. package/esm/.db/265430/data/1/123.json +1 -0
  105. package/esm/.db/269049/data/0/0.json +1 -0
  106. package/esm/.db/269049/data/1/120.json +1 -0
  107. package/esm/.db/269049/data/1/123.json +1 -0
  108. package/esm/.db/273652/data/0/0.json +1 -0
  109. package/esm/.db/273652/data/1/120.json +1 -0
  110. package/esm/.db/273652/data/1/123.json +1 -0
  111. package/esm/.db/281035/data/0/0.json +1 -0
  112. package/esm/.db/281035/data/1/120.json +1 -0
  113. package/esm/.db/281035/data/1/123.json +1 -0
  114. package/esm/.db/281140/data/0/13315.json +1 -0
  115. package/esm/.db/281140/data/1/120.json +1 -0
  116. package/esm/.db/281140/data/1/123.json +1 -0
  117. package/esm/.db/295732/data/ppl/bob.json +1 -0
  118. package/esm/.db/296113/data/1/123.json +1 -0
  119. package/esm/.db/297154/data/0/13315.json +1 -0
  120. package/esm/.db/297154/data/1/120.json +1 -0
  121. package/esm/.db/297154/data/1/123.json +1 -0
  122. package/esm/.db/304770/data/1/120.json +1 -0
  123. package/esm/.db/304770/data/1/123.json +1 -0
  124. package/esm/.db/3081/data/0/0.json +1 -0
  125. package/esm/.db/3081/data/1/120.json +1 -0
  126. package/esm/.db/3081/data/1/123.json +1 -0
  127. package/esm/.db/310793/data/1/120.json +1 -0
  128. package/esm/.db/310793/data/1/123.json +1 -0
  129. package/esm/.db/317310/data/1/123.json +1 -0
  130. package/esm/.db/317819/data/1/example.json +1 -0
  131. package/esm/.db/319464/data/0/0.json +1 -0
  132. package/esm/.db/319464/data/1/120.json +1 -0
  133. package/esm/.db/319464/data/1/123.json +1 -0
  134. package/esm/.db/32053/data/1/120.json +1 -0
  135. package/esm/.db/32053/data/1/123.json +1 -0
  136. package/esm/.db/322473/data/ppl/bob.json +1 -0
  137. package/esm/.db/323300/data/1/123.json +1 -0
  138. package/esm/.db/323840/data/0/0.json +1 -0
  139. package/esm/.db/323840/data/1/120.json +1 -0
  140. package/esm/.db/323840/data/1/123.json +1 -0
  141. package/esm/.db/328731/data/0/0.json +1 -0
  142. package/esm/.db/328731/data/1/120.json +1 -0
  143. package/esm/.db/328731/data/1/123.json +1 -0
  144. package/esm/.db/334158/data/1/example.json +1 -0
  145. package/esm/.db/334577/data/1/example.json +1 -0
  146. package/esm/.db/339914/data/1/123.json +1 -0
  147. package/esm/.db/34265/data/0/0.json +1 -0
  148. package/esm/.db/34265/data/1/120.json +1 -0
  149. package/esm/.db/34265/data/1/123.json +1 -0
  150. package/esm/.db/346364/data/1/123.json +1 -0
  151. package/esm/.db/349791/data/0/14083.json +1 -0
  152. package/esm/.db/349791/data/1/120.json +1 -0
  153. package/esm/.db/349791/data/1/123.json +1 -0
  154. package/esm/.db/349791/data/15/0.json +1 -0
  155. package/esm/.db/350767/data/ppl/bob.json +1 -0
  156. package/esm/.db/352310/data/0/13315.json +1 -0
  157. package/esm/.db/352310/data/1/120.json +1 -0
  158. package/esm/.db/352310/data/1/123.json +1 -0
  159. package/esm/.db/35438/data/1/123.json +1 -0
  160. package/esm/.db/354670/data/0/13315.json +1 -0
  161. package/esm/.db/354670/data/1/120.json +1 -0
  162. package/esm/.db/354670/data/1/123.json +1 -0
  163. package/esm/.db/354805/data/0/0.json +1 -0
  164. package/esm/.db/354805/data/1/120.json +1 -0
  165. package/esm/.db/354805/data/1/123.json +1 -0
  166. package/esm/.db/358368/data/1/example.json +1 -0
  167. package/esm/.db/358831/data/1/123.json +1 -0
  168. package/esm/.db/360133/data/0/0.json +1 -0
  169. package/esm/.db/360133/data/1/120.json +1 -0
  170. package/esm/.db/360133/data/1/123.json +1 -0
  171. package/esm/.db/367925/data/0/13315.json +1 -0
  172. package/esm/.db/367925/data/1/120.json +1 -0
  173. package/esm/.db/367925/data/1/123.json +1 -0
  174. package/esm/.db/369638/data/1/123.json +1 -0
  175. package/esm/.db/3700/data/1/120.json +1 -0
  176. package/esm/.db/3700/data/1/123.json +1 -0
  177. package/esm/.db/374988/data/0/0.json +1 -0
  178. package/esm/.db/374988/data/1/120.json +1 -0
  179. package/esm/.db/374988/data/1/123.json +1 -0
  180. package/esm/.db/380018/data/1/123.json +1 -0
  181. package/esm/.db/380021/data/1/123.json +1 -0
  182. package/esm/.db/386761/data/1/123.json +1 -0
  183. package/esm/.db/387217/data/0/13315.json +1 -0
  184. package/esm/.db/387217/data/1/120.json +1 -0
  185. package/esm/.db/387217/data/1/123.json +1 -0
  186. package/esm/.db/392652/data/1/123.json +1 -0
  187. package/esm/.db/392692/data/0/13315.json +1 -0
  188. package/esm/.db/392692/data/1/120.json +1 -0
  189. package/esm/.db/392692/data/1/123.json +1 -0
  190. package/esm/.db/396339/data/1/123.json +1 -0
  191. package/esm/.db/404348/data/1/123.json +1 -0
  192. package/esm/.db/405894/data/0/14083.json +1 -0
  193. package/esm/.db/405894/data/1/120.json +1 -0
  194. package/esm/.db/405894/data/1/123.json +1 -0
  195. package/esm/.db/405894/data/15/0.json +1 -0
  196. package/esm/.db/406165/data/1/example.json +1 -0
  197. package/esm/.db/407316/data/ppl/bob.json +1 -0
  198. package/esm/.db/407987/data/1/123.json +1 -0
  199. package/esm/.db/410181/data/1/123.json +1 -0
  200. package/esm/.db/411981/data/1/120.json +1 -0
  201. package/esm/.db/411981/data/1/123.json +1 -0
  202. package/esm/.db/416278/data/1/120.json +1 -0
  203. package/esm/.db/416278/data/1/123.json +1 -0
  204. package/esm/.db/418449/data/1/123.json +1 -0
  205. package/esm/.db/425620/data/1/120.json +1 -0
  206. package/esm/.db/425620/data/1/123.json +1 -0
  207. package/esm/.db/429727/data/1/123.json +1 -0
  208. package/esm/.db/435030/data/1/123.json +1 -0
  209. package/esm/.db/444362/data/1/120.json +1 -0
  210. package/esm/.db/444362/data/1/123.json +1 -0
  211. package/esm/.db/446985/data/1/123.json +1 -0
  212. package/esm/.db/451355/data/1/120.json +1 -0
  213. package/esm/.db/451355/data/1/123.json +1 -0
  214. package/esm/.db/45640/data/1/123.json +1 -0
  215. package/esm/.db/46155/data/0/0.json +1 -0
  216. package/esm/.db/46155/data/0/13315.json +1 -0
  217. package/esm/.db/46155/data/1/120.json +1 -0
  218. package/esm/.db/46155/data/1/123.json +1 -0
  219. package/esm/.db/46528/data/1/123.json +1 -0
  220. package/esm/.db/466476/data/1/123.json +1 -0
  221. package/esm/.db/467578/data/0/0.json +1 -0
  222. package/esm/.db/467578/data/1/120.json +1 -0
  223. package/esm/.db/467578/data/1/123.json +1 -0
  224. package/esm/.db/472245/data/1/123.json +1 -0
  225. package/esm/.db/474238/data/1/example.json +1 -0
  226. package/esm/.db/477291/data/1/123.json +1 -0
  227. package/esm/.db/477375/data/1/120.json +1 -0
  228. package/esm/.db/477375/data/1/123.json +1 -0
  229. package/esm/.db/479960/data/1/123.json +1 -0
  230. package/esm/.db/482327/data/1/123.json +1 -0
  231. package/esm/.db/487117/data/1/example.json +1 -0
  232. package/esm/.db/495075/data/1/123.json +1 -0
  233. package/esm/.db/498660/data/1/123.json +1 -0
  234. package/esm/.db/510578/data/1/123.json +1 -0
  235. package/esm/.db/514521/data/1/123.json +1 -0
  236. package/esm/.db/524536/data/1/120.json +1 -0
  237. package/esm/.db/524536/data/1/123.json +1 -0
  238. package/esm/.db/52751/data/1/example.json +1 -0
  239. package/esm/.db/530599/data/ppl/bob.json +1 -0
  240. package/esm/.db/536579/data/1/123.json +1 -0
  241. package/esm/.db/539183/data/1/123.json +1 -0
  242. package/esm/.db/539222/data/1/example.json +1 -0
  243. package/esm/.db/542071/data/0/0.json +1 -0
  244. package/esm/.db/542071/data/0/13315.json +1 -0
  245. package/esm/.db/542071/data/1/120.json +1 -0
  246. package/esm/.db/542071/data/1/123.json +1 -0
  247. package/esm/.db/542939/data/ppl/bob.json +1 -0
  248. package/esm/.db/547077/data/1/123.json +1 -0
  249. package/esm/.db/548947/data/ppl/bob.json +1 -0
  250. package/esm/.db/551385/data/0/0.json +1 -0
  251. package/esm/.db/551385/data/1/120.json +1 -0
  252. package/esm/.db/551385/data/1/123.json +1 -0
  253. package/esm/.db/553486/data/0/0.json +1 -0
  254. package/esm/.db/553486/data/1/120.json +1 -0
  255. package/esm/.db/553486/data/1/123.json +1 -0
  256. package/esm/.db/554578/data/1/123.json +1 -0
  257. package/esm/.db/555963/data/1/123.json +1 -0
  258. package/esm/.db/556201/data/1/123.json +1 -0
  259. package/esm/.db/572000/data/1/123.json +1 -0
  260. package/esm/.db/572151/data/1/123.json +1 -0
  261. package/esm/.db/573301/data/1/123.json +1 -0
  262. package/esm/.db/579648/data/0/0.json +1 -0
  263. package/esm/.db/579648/data/1/120.json +1 -0
  264. package/esm/.db/579648/data/1/123.json +1 -0
  265. package/esm/.db/579648/data/3/104.json +1 -0
  266. package/esm/.db/582311/data/1/example.json +1 -0
  267. package/esm/.db/587351/data/0/14083.json +1 -0
  268. package/esm/.db/587351/data/1/120.json +1 -0
  269. package/esm/.db/587351/data/1/123.json +1 -0
  270. package/esm/.db/587351/data/15/0.json +1 -0
  271. package/esm/.db/588867/data/0/0.json +1 -0
  272. package/esm/.db/588867/data/1/120.json +1 -0
  273. package/esm/.db/588867/data/1/123.json +1 -0
  274. package/esm/.db/589730/data/1/123.json +1 -0
  275. package/esm/.db/591738/data/0/13315.json +1 -0
  276. package/esm/.db/591738/data/1/120.json +1 -0
  277. package/esm/.db/591738/data/1/123.json +1 -0
  278. package/esm/.db/593460/data/1/123.json +1 -0
  279. package/esm/.db/595304/data/1/123.json +1 -0
  280. package/esm/.db/595772/data/0/13315.json +1 -0
  281. package/esm/.db/595772/data/1/120.json +1 -0
  282. package/esm/.db/595772/data/1/123.json +1 -0
  283. package/esm/.db/596051/data/0/0.json +1 -0
  284. package/esm/.db/596051/data/1/120.json +1 -0
  285. package/esm/.db/596051/data/1/123.json +1 -0
  286. package/esm/.db/601728/data/1/120.json +1 -0
  287. package/esm/.db/601728/data/1/123.json +1 -0
  288. package/esm/.db/619154/data/1/123.json +1 -0
  289. package/esm/.db/620185/data/1/123.json +1 -0
  290. package/esm/.db/623179/data/1/123.json +1 -0
  291. package/esm/.db/623265/data/1/123.json +1 -0
  292. package/esm/.db/630002/data/1/120.json +1 -0
  293. package/esm/.db/630002/data/1/123.json +1 -0
  294. package/esm/.db/631961/data/1/123.json +1 -0
  295. package/esm/.db/635637/data/0/14083.json +1 -0
  296. package/esm/.db/635637/data/1/120.json +1 -0
  297. package/esm/.db/635637/data/1/123.json +1 -0
  298. package/esm/.db/635637/data/15/0.json +1 -0
  299. package/esm/.db/636670/data/1/example.json +1 -0
  300. package/esm/.db/640527/data/0/0.json +1 -0
  301. package/esm/.db/640527/data/1/120.json +1 -0
  302. package/esm/.db/640527/data/1/123.json +1 -0
  303. package/esm/.db/644020/data/0/13315.json +1 -0
  304. package/esm/.db/644020/data/1/120.json +1 -0
  305. package/esm/.db/644020/data/1/123.json +1 -0
  306. package/esm/.db/64462/data/0/14083.json +1 -0
  307. package/esm/.db/64462/data/1/120.json +1 -0
  308. package/esm/.db/64462/data/1/123.json +1 -0
  309. package/esm/.db/64462/data/15/0.json +1 -0
  310. package/esm/.db/646266/data/1/123.json +1 -0
  311. package/esm/.db/650764/data/1/120.json +1 -0
  312. package/esm/.db/650764/data/1/123.json +1 -0
  313. package/esm/.db/654655/data/0/0.json +1 -0
  314. package/esm/.db/654655/data/1/120.json +1 -0
  315. package/esm/.db/654655/data/1/123.json +1 -0
  316. package/esm/.db/658164/data/1/120.json +1 -0
  317. package/esm/.db/658164/data/1/123.json +1 -0
  318. package/esm/.db/65937/data/1/123.json +1 -0
  319. package/esm/.db/659738/data/0/13315.json +1 -0
  320. package/esm/.db/659738/data/1/120.json +1 -0
  321. package/esm/.db/659738/data/1/123.json +1 -0
  322. package/esm/.db/660517/data/0/13315.json +1 -0
  323. package/esm/.db/660517/data/1/120.json +1 -0
  324. package/esm/.db/660517/data/1/123.json +1 -0
  325. package/esm/.db/664564/data/1/123.json +1 -0
  326. package/esm/.db/672001/data/1/example.json +1 -0
  327. package/esm/.db/674620/data/1/123.json +1 -0
  328. package/esm/.db/67532/data/1/123.json +1 -0
  329. package/esm/.db/675670/data/1/120.json +1 -0
  330. package/esm/.db/675670/data/1/123.json +1 -0
  331. package/esm/.db/686538/data/1/123.json +1 -0
  332. package/esm/.db/691017/data/1/123.json +1 -0
  333. package/esm/.db/691716/data/1/120.json +1 -0
  334. package/esm/.db/691716/data/1/123.json +1 -0
  335. package/esm/.db/693105/data/0/14083.json +1 -0
  336. package/esm/.db/693105/data/1/120.json +1 -0
  337. package/esm/.db/693105/data/1/123.json +1 -0
  338. package/esm/.db/693105/data/15/0.json +1 -0
  339. package/esm/.db/694486/data/1/123.json +1 -0
  340. package/esm/.db/702106/data/1/120.json +1 -0
  341. package/esm/.db/702106/data/1/123.json +1 -0
  342. package/esm/.db/7047/data/1/123.json +1 -0
  343. package/esm/.db/705954/data/0/13315.json +1 -0
  344. package/esm/.db/705954/data/1/120.json +1 -0
  345. package/esm/.db/705954/data/1/123.json +1 -0
  346. package/esm/.db/710967/data/1/120.json +1 -0
  347. package/esm/.db/710967/data/1/123.json +1 -0
  348. package/esm/.db/715883/data/0/13315.json +1 -0
  349. package/esm/.db/715883/data/1/120.json +1 -0
  350. package/esm/.db/715883/data/1/123.json +1 -0
  351. package/esm/.db/717358/data/1/120.json +1 -0
  352. package/esm/.db/717358/data/1/123.json +1 -0
  353. package/esm/.db/71999/data/0/13315.json +1 -0
  354. package/esm/.db/71999/data/1/120.json +1 -0
  355. package/esm/.db/71999/data/1/123.json +1 -0
  356. package/esm/.db/720364/data/1/123.json +1 -0
  357. package/esm/.db/727249/data/1/120.json +1 -0
  358. package/esm/.db/727249/data/1/123.json +1 -0
  359. package/esm/.db/728258/data/1/example.json +1 -0
  360. package/esm/.db/728986/data/0/13315.json +1 -0
  361. package/esm/.db/728986/data/1/120.json +1 -0
  362. package/esm/.db/728986/data/1/123.json +1 -0
  363. package/esm/.db/732768/data/1/120.json +1 -0
  364. package/esm/.db/732768/data/1/123.json +1 -0
  365. package/esm/.db/733885/data/1/123.json +1 -0
  366. package/esm/.db/736192/data/0/0.json +1 -0
  367. package/esm/.db/736192/data/1/120.json +1 -0
  368. package/esm/.db/736192/data/1/123.json +1 -0
  369. package/esm/.db/73856/data/0/0.json +1 -0
  370. package/esm/.db/73856/data/1/120.json +1 -0
  371. package/esm/.db/73856/data/1/123.json +1 -0
  372. package/esm/.db/738577/data/1/123.json +1 -0
  373. package/esm/.db/744844/data/1/123.json +1 -0
  374. package/esm/.db/745738/data/1/123.json +1 -0
  375. package/esm/.db/747240/data/1/123.json +1 -0
  376. package/esm/.db/749115/data/0/0.json +1 -0
  377. package/esm/.db/749115/data/1/120.json +1 -0
  378. package/esm/.db/749115/data/1/123.json +1 -0
  379. package/esm/.db/749514/data/0/0.json +1 -0
  380. package/esm/.db/749514/data/1/120.json +1 -0
  381. package/esm/.db/749514/data/1/123.json +1 -0
  382. package/esm/.db/754982/data/1/123.json +1 -0
  383. package/esm/.db/765281/data/0/13315.json +1 -0
  384. package/esm/.db/765281/data/1/120.json +1 -0
  385. package/esm/.db/765281/data/1/123.json +1 -0
  386. package/esm/.db/765521/data/0/14083.json +1 -0
  387. package/esm/.db/765521/data/1/120.json +1 -0
  388. package/esm/.db/765521/data/1/123.json +1 -0
  389. package/esm/.db/765521/data/15/0.json +1 -0
  390. package/esm/.db/766864/data/1/123.json +1 -0
  391. package/esm/.db/770788/data/0/14083.json +1 -0
  392. package/esm/.db/770788/data/1/120.json +1 -0
  393. package/esm/.db/770788/data/1/123.json +1 -0
  394. package/esm/.db/770788/data/15/0.json +1 -0
  395. package/esm/.db/774499/data/1/example.json +1 -0
  396. package/esm/.db/774617/data/ppl/bob.json +1 -0
  397. package/esm/.db/775617/data/1/123.json +1 -0
  398. package/esm/.db/779782/data/1/123.json +1 -0
  399. package/esm/.db/779921/data/1/123.json +1 -0
  400. package/esm/.db/782910/data/1/123.json +1 -0
  401. package/esm/.db/783279/data/0/13315.json +1 -0
  402. package/esm/.db/783279/data/1/120.json +1 -0
  403. package/esm/.db/783279/data/1/123.json +1 -0
  404. package/esm/.db/785515/data/1/123.json +1 -0
  405. package/esm/.db/791284/data/0/0.json +1 -0
  406. package/esm/.db/791284/data/1/120.json +1 -0
  407. package/esm/.db/791284/data/1/123.json +1 -0
  408. package/esm/.db/791361/data/0/14083.json +1 -0
  409. package/esm/.db/791361/data/1/120.json +1 -0
  410. package/esm/.db/791361/data/1/123.json +1 -0
  411. package/esm/.db/791361/data/15/0.json +1 -0
  412. package/esm/.db/791754/data/1/120.json +1 -0
  413. package/esm/.db/791754/data/1/123.json +1 -0
  414. package/esm/.db/792232/data/0/13315.json +1 -0
  415. package/esm/.db/792232/data/1/120.json +1 -0
  416. package/esm/.db/792232/data/1/123.json +1 -0
  417. package/esm/.db/792777/data/0/13315.json +1 -0
  418. package/esm/.db/792777/data/1/120.json +1 -0
  419. package/esm/.db/792777/data/1/123.json +1 -0
  420. package/esm/.db/793249/data/0/123.json +1 -0
  421. package/esm/.db/795512/data/0/0.json +1 -0
  422. package/esm/.db/795512/data/1/120.json +1 -0
  423. package/esm/.db/795512/data/1/123.json +1 -0
  424. package/esm/.db/795512/data/3/104.json +1 -0
  425. package/esm/.db/796663/data/1/123.json +1 -0
  426. package/esm/.db/797304/data/0/0.json +1 -0
  427. package/esm/.db/797304/data/1/120.json +1 -0
  428. package/esm/.db/797304/data/1/123.json +1 -0
  429. package/esm/.db/797304/data/3/104.json +1 -0
  430. package/esm/.db/800834/data/1/123.json +1 -0
  431. package/esm/.db/806421/data/1/120.json +1 -0
  432. package/esm/.db/806421/data/1/123.json +1 -0
  433. package/esm/.db/81623/data/0/14083.json +1 -0
  434. package/esm/.db/81623/data/1/120.json +1 -0
  435. package/esm/.db/81623/data/1/123.json +1 -0
  436. package/esm/.db/81623/data/15/0.json +1 -0
  437. package/esm/.db/81941/data/1/120.json +1 -0
  438. package/esm/.db/81941/data/1/123.json +1 -0
  439. package/esm/.db/820340/data/0/0.json +1 -0
  440. package/esm/.db/820340/data/1/120.json +1 -0
  441. package/esm/.db/820340/data/1/123.json +1 -0
  442. package/esm/.db/821932/data/1/120.json +1 -0
  443. package/esm/.db/821932/data/1/123.json +1 -0
  444. package/esm/.db/823440/data/1/123.json +1 -0
  445. package/esm/.db/823889/data/1/120.json +1 -0
  446. package/esm/.db/823889/data/1/123.json +1 -0
  447. package/esm/.db/823896/data/1/123.json +1 -0
  448. package/esm/.db/836077/data/0/14083.json +1 -0
  449. package/esm/.db/836077/data/1/120.json +1 -0
  450. package/esm/.db/836077/data/1/123.json +1 -0
  451. package/esm/.db/836077/data/15/0.json +1 -0
  452. package/esm/.db/837341/data/1/123.json +1 -0
  453. package/esm/.db/844882/data/1/123.json +1 -0
  454. package/esm/.db/847654/data/1/example.json +1 -0
  455. package/esm/.db/856010/data/0/13315.json +1 -0
  456. package/esm/.db/856010/data/1/120.json +1 -0
  457. package/esm/.db/856010/data/1/123.json +1 -0
  458. package/esm/.db/856047/data/1/120.json +1 -0
  459. package/esm/.db/856047/data/1/123.json +1 -0
  460. package/esm/.db/856820/data/1/123.json +1 -0
  461. package/esm/.db/857266/data/1/123.json +1 -0
  462. package/esm/.db/86017/data/0/13315.json +1 -0
  463. package/esm/.db/86017/data/1/120.json +1 -0
  464. package/esm/.db/86017/data/1/123.json +1 -0
  465. package/esm/.db/862600/data/1/120.json +1 -0
  466. package/esm/.db/862600/data/1/123.json +1 -0
  467. package/esm/.db/871866/data/0/13315.json +1 -0
  468. package/esm/.db/871866/data/1/120.json +1 -0
  469. package/esm/.db/871866/data/1/123.json +1 -0
  470. package/esm/.db/875359/data/0/0.json +1 -0
  471. package/esm/.db/875359/data/1/120.json +1 -0
  472. package/esm/.db/875359/data/1/123.json +1 -0
  473. package/esm/.db/875359/data/3/104.json +1 -0
  474. package/esm/.db/876330/data/1/example.json +1 -0
  475. package/esm/.db/880182/data/1/123.json +1 -0
  476. package/esm/.db/882138/data/0/0.json +1 -0
  477. package/esm/.db/882138/data/1/120.json +1 -0
  478. package/esm/.db/882138/data/1/123.json +1 -0
  479. package/esm/.db/882722/data/1/example.json +1 -0
  480. package/esm/.db/893417/data/1/example.json +1 -0
  481. package/esm/.db/897575/data/1/example.json +1 -0
  482. package/esm/.db/897832/data/0/13315.json +1 -0
  483. package/esm/.db/897832/data/1/120.json +1 -0
  484. package/esm/.db/897832/data/1/123.json +1 -0
  485. package/esm/.db/898043/data/0/0.json +1 -0
  486. package/esm/.db/898043/data/1/120.json +1 -0
  487. package/esm/.db/898043/data/1/123.json +1 -0
  488. package/esm/.db/898201/data/ppl/bob.json +1 -0
  489. package/esm/.db/900442/data/1/123.json +1 -0
  490. package/esm/.db/900800/data/0/0.json +1 -0
  491. package/esm/.db/900800/data/1/120.json +1 -0
  492. package/esm/.db/900800/data/1/123.json +1 -0
  493. package/esm/.db/910535/data/1/120.json +1 -0
  494. package/esm/.db/910535/data/1/123.json +1 -0
  495. package/esm/.db/911132/data/1/120.json +1 -0
  496. package/esm/.db/911132/data/1/123.json +1 -0
  497. package/esm/.db/913152/data/1/120.json +1 -0
  498. package/esm/.db/913152/data/1/123.json +1 -0
  499. package/esm/.db/91378/data/1/123.json +1 -0
  500. package/esm/.db/918654/data/1/example.json +1 -0
  501. package/esm/.db/932648/data/1/123.json +1 -0
  502. package/esm/.db/936016/data/1/example.json +1 -0
  503. package/esm/.db/936843/data/1/123.json +1 -0
  504. package/esm/.db/940099/data/1/example.json +1 -0
  505. package/esm/.db/941807/data/1/120.json +1 -0
  506. package/esm/.db/941807/data/1/123.json +1 -0
  507. package/esm/.db/941934/data/0/14083.json +1 -0
  508. package/esm/.db/941934/data/1/120.json +1 -0
  509. package/esm/.db/941934/data/1/123.json +1 -0
  510. package/esm/.db/941934/data/15/0.json +1 -0
  511. package/esm/.db/943744/data/1/120.json +1 -0
  512. package/esm/.db/943744/data/1/123.json +1 -0
  513. package/esm/.db/955716/data/1/123.json +1 -0
  514. package/esm/.db/956030/data/1/123.json +1 -0
  515. package/esm/.db/956395/data/1/120.json +1 -0
  516. package/esm/.db/956395/data/1/123.json +1 -0
  517. package/esm/.db/956498/data/1/123.json +1 -0
  518. package/esm/.db/957435/data/1/123.json +1 -0
  519. package/esm/.db/960302/data/1/example.json +1 -0
  520. package/esm/.db/964149/data/0/0.json +1 -0
  521. package/esm/.db/964149/data/1/120.json +1 -0
  522. package/esm/.db/964149/data/1/123.json +1 -0
  523. package/esm/.db/965213/data/0/13315.json +1 -0
  524. package/esm/.db/965213/data/1/120.json +1 -0
  525. package/esm/.db/965213/data/1/123.json +1 -0
  526. package/esm/.db/966774/data/1/120.json +1 -0
  527. package/esm/.db/966774/data/1/123.json +1 -0
  528. package/esm/.db/972484/data/1/123.json +1 -0
  529. package/esm/.db/973155/data/1/123.json +1 -0
  530. package/esm/.db/973642/data/1/123.json +1 -0
  531. package/esm/.db/975603/data/0/0.json +1 -0
  532. package/esm/.db/975603/data/1/120.json +1 -0
  533. package/esm/.db/975603/data/1/123.json +1 -0
  534. package/esm/.db/979812/data/0/13315.json +1 -0
  535. package/esm/.db/979812/data/1/120.json +1 -0
  536. package/esm/.db/979812/data/1/123.json +1 -0
  537. package/esm/.db/985666/data/1/example.json +1 -0
  538. package/esm/.db/986784/data/0/0.json +1 -0
  539. package/esm/.db/986784/data/1/120.json +1 -0
  540. package/esm/.db/986784/data/1/123.json +1 -0
  541. package/esm/.db/988463/data/1/120.json +1 -0
  542. package/esm/.db/988463/data/1/123.json +1 -0
  543. package/esm/.db/990386/data/1/120.json +1 -0
  544. package/esm/.db/990386/data/1/123.json +1 -0
  545. package/esm/.db/994488/data/0/0.json +1 -0
  546. package/esm/.db/994488/data/1/120.json +1 -0
  547. package/esm/.db/994488/data/1/123.json +1 -0
  548. package/esm/.db/999130/data/ppl/bob.json +1 -0
  549. package/esm/bar.js +15 -3
  550. package/esm/lua/weavedb_mock.lua +3 -2
  551. package/esm/waosm/README.md +4 -6
  552. package/esm/waosm/waosm_bg.wasm +0 -0
  553. package/esm/waosm-node/README.md +4 -6
  554. package/esm/waosm-node/waosm_bg.wasm +0 -0
  555. package/esm/waosm-node.js +7 -3
  556. package/esm/weavedb.js +92 -12
  557. package/package.json +2 -1
  558. package/esm/waosm/package.json +0 -14
package/cjs/bar.js CHANGED
@@ -202,7 +202,7 @@ var AR = /*#__PURE__*/function (_MAR) {
202
202
  key: "postItems",
203
203
  value: function () {
204
204
  var _postItems = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(items, jwk) {
205
- var err, _yield$this$checkWall2, _items, _iterator2, _step2, di, data_size, data_type, _iterator3, _step3, _t, owner, data, _item, bundle, tx;
205
+ var err, _yield$this$checkWall2, _items, _iterator2, _step2, di, data_size, data_type, _iterator3, _step3, _t, owner, _item, bundle, tx;
206
206
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
207
207
  while (1) switch (_context4.prev = _context4.next) {
208
208
  case 0:
@@ -230,7 +230,7 @@ var AR = /*#__PURE__*/function (_MAR) {
230
230
  _iterator2.s();
231
231
  case 13:
232
232
  if ((_step2 = _iterator2.n()).done) {
233
- _context4.next = 50;
233
+ _context4.next = 49;
234
234
  break;
235
235
  }
236
236
  di = _step2.value;
@@ -261,7 +261,6 @@ var AR = /*#__PURE__*/function (_MAR) {
261
261
  address: owner
262
262
  }, "addrmap", owner);
263
263
  case 27:
264
- data = di.data;
265
264
  _context4.t0 = {
266
265
  size: data_size,
267
266
  type: data_type
@@ -269,14 +268,14 @@ var AR = /*#__PURE__*/function (_MAR) {
269
268
  _context4.t1 = di.anchor;
270
269
  _context4.t2 = di.signature;
271
270
  _context4.t3 = di.target;
272
- _context4.next = 34;
271
+ _context4.next = 33;
273
272
  return di.id;
274
- case 34:
273
+ case 33:
275
274
  _context4.t4 = _context4.sent;
276
275
  _context4.t5 = di;
277
276
  _context4.t6 = owner;
278
277
  _context4.t7 = di.tags;
279
- _context4.t8 = data;
278
+ _context4.t8 = di.data;
280
279
  _item = {
281
280
  _data: _context4.t0,
282
281
  anchor: _context4.t1,
@@ -290,50 +289,50 @@ var AR = /*#__PURE__*/function (_MAR) {
290
289
  };
291
290
  _context4.t9 = this.mem;
292
291
  _context4.t10 = _item;
293
- _context4.next = 44;
292
+ _context4.next = 43;
294
293
  return di.id;
295
- case 44:
294
+ case 43:
296
295
  _context4.t11 = _context4.sent;
297
- _context4.next = 47;
296
+ _context4.next = 46;
298
297
  return _context4.t9.set.call(_context4.t9, _context4.t10, "txs", _context4.t11);
299
- case 47:
298
+ case 46:
300
299
  _items.push(_item);
301
- case 48:
300
+ case 47:
302
301
  _context4.next = 13;
303
302
  break;
304
- case 50:
305
- _context4.next = 55;
303
+ case 49:
304
+ _context4.next = 54;
306
305
  break;
307
- case 52:
308
- _context4.prev = 52;
306
+ case 51:
307
+ _context4.prev = 51;
309
308
  _context4.t12 = _context4["catch"](11);
310
309
  _iterator2.e(_context4.t12);
311
- case 55:
312
- _context4.prev = 55;
310
+ case 54:
311
+ _context4.prev = 54;
313
312
  _iterator2.f();
314
- return _context4.finish(55);
315
- case 58:
316
- _context4.next = 60;
313
+ return _context4.finish(54);
314
+ case 57:
315
+ _context4.next = 59;
317
316
  return (0, _arbundles.bundleAndSignData)(items, new _arbundles.ArweaveSigner(jwk));
318
- case 60:
317
+ case 59:
319
318
  bundle = _context4.sent;
320
- _context4.next = 63;
319
+ _context4.next = 62;
321
320
  return this.mem.arweave.createTransaction({
322
321
  data: bundle.binary
323
322
  }, jwk);
324
- case 63:
323
+ case 62:
325
324
  tx = _context4.sent;
326
325
  tx.addTag("Bundle-Format", "binary");
327
326
  tx.addTag("Bundle-Version", "2.0.0");
328
- _context4.next = 68;
327
+ _context4.next = 67;
329
328
  return this.postTx(tx, jwk, _items);
330
- case 68:
329
+ case 67:
331
330
  return _context4.abrupt("return", _context4.sent);
332
- case 69:
331
+ case 68:
333
332
  case "end":
334
333
  return _context4.stop();
335
334
  }
336
- }, _callee4, this, [[11, 52, 55, 58]]);
335
+ }, _callee4, this, [[11, 51, 54, 57]]);
337
336
  }));
338
337
  function postItems(_x4, _x5) {
339
338
  return _postItems.apply(this, arguments);
@@ -642,7 +641,12 @@ var AR = /*#__PURE__*/function (_MAR) {
642
641
  if ((tx === null || tx === void 0 ? void 0 : tx.format) === 2 && _data) {
643
642
  _data = Buffer.from(_data, "base64");
644
643
  } else if (_data) {
645
- _data = Buffer.from(_base64url["default"].decode(_data));
644
+ // need to check production
645
+ if (tx._data.type === "") {
646
+ _data = tobuff(_data);
647
+ } else {
648
+ _data = Buffer.from(_base64url["default"].decode(_data));
649
+ }
646
650
  }
647
651
  isBuf = (0, _ramda.is)(Uint8Array, _data) || (0, _ramda.is)(ArrayBuffer, _data);
648
652
  isStr = (0, _ramda.is)(String, _data);
@@ -679,4 +683,9 @@ var AR = /*#__PURE__*/function (_MAR) {
679
683
  }()
680
684
  }]);
681
685
  }(_ar["default"]);
686
+ function tobuff(base64url) {
687
+ var base64 = base64url.replace(/-/g, "+").replace(/_/g, "/");
688
+ var paddedBase64 = base64.padEnd(base64.length + (4 - base64.length % 4) % 4, "=");
689
+ return Buffer.from(paddedBase64, "base64");
690
+ }
682
691
  var _default = exports["default"] = AR;
@@ -1,10 +1,11 @@
1
1
  local json = require("json")
2
+
2
3
  function rollup (id)
3
4
  local file = io.open("/rollup/" .. id)
4
5
  local data = nil
5
6
  if file then data = file:read(file:seek('end')) end
6
7
  file:close()
7
- return data
8
+ return true
8
9
  end
9
10
 
10
11
  function get (col, doc)
@@ -27,7 +28,7 @@ Handlers.add(
27
28
  "Finalize",
28
29
  "Finalize",
29
30
  function (msg)
30
- local data = json.decode(rollup(msg.TXID))
31
+ rollup(msg.TXID)
31
32
  msg.reply({ Data = "finalized!" })
32
33
  end
33
34
  )
package/cjs/waosm-node.js CHANGED
@@ -20,7 +20,9 @@ var _fs = require("fs");
20
20
  var _path = require("path");
21
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
23
- var wasm = (0, _fs.readFileSync)((0, _path.resolve)(import.meta.dirname, "./waosm-node/waosm_bg.wasm"));
23
+ var dirPath;
24
+ if (typeof __filename !== "undefined" && typeof __dirname !== "undefined") dirPath = __dirname;else dirPath = dirname(fileURLToPath(import.meta.url));
25
+ var wasm = (0, _fs.readFileSync)((0, _path.resolve)(dirPath, "./waosm-node/waosm_bg.wasm"));
24
26
  var wasmModule = new WebAssembly.Module(wasm);
25
27
  var wasmInstance = new WebAssembly.Instance(wasmModule, {
26
28
  "./waosm_bg.js": wasmBindings
package/cjs/weavedb.js CHANGED
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports["default"] = void 0;
8
8
  var _path = require("path");
9
9
  var _fs = require("fs");
10
+ var _index = require("../../arjson/sdk/src/index.js");
10
11
  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; } } }; }
11
12
  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; } }
12
13
  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; }
@@ -25,6 +26,49 @@ var CHUNK_SZ = 128 * MB;
25
26
  var NOTIFY_SZ = 512 * MB;
26
27
  var log = console.log;
27
28
  var rand = Math.floor(Math.random() * 1000000).toString();
29
+ function tobits(arr) {
30
+ var cursor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
31
+ var bitStr = "";
32
+ for (var i = 0; i < arr.length; i++) {
33
+ bitStr += arr[i].toString(2).padStart(8, "0");
34
+ }
35
+ var remaining = bitStr.slice(cursor);
36
+ var result = [];
37
+ var offset = cursor % 8;
38
+ if (offset !== 0) {
39
+ var firstChunkSize = 8 - offset;
40
+ result.push(remaining.slice(0, firstChunkSize));
41
+ remaining = remaining.slice(firstChunkSize);
42
+ }
43
+ while (remaining.length >= 8) {
44
+ result.push(remaining.slice(0, 8));
45
+ remaining = remaining.slice(8);
46
+ }
47
+ if (remaining.length > 0) result.push(remaining);
48
+ return result;
49
+ }
50
+ function frombits(bitArray) {
51
+ // Join all bit strings
52
+ var bitStr = bitArray.join("");
53
+
54
+ // Calculate how many bytes we need
55
+ var byteCount = Math.ceil(bitStr.length / 8);
56
+
57
+ // Create a new Uint8Array
58
+ var result = new Uint8Array(byteCount);
59
+
60
+ // Fill the Uint8Array
61
+ for (var i = 0; i < byteCount; i++) {
62
+ // Get the next 8 bits (or fewer for the last byte)
63
+ var start = i * 8;
64
+ var end = Math.min(start + 8, bitStr.length);
65
+ var bits = bitStr.substring(start, end).padEnd(8, "0");
66
+
67
+ // Convert the bits to a byte
68
+ result[i] = parseInt(bits, 2);
69
+ }
70
+ return result;
71
+ }
28
72
  var WeaveDB = exports["default"] = /*#__PURE__*/_createClass(function WeaveDB(ar, dir) {
29
73
  var _dir;
30
74
  _classCallCheck(this, WeaveDB);
@@ -56,7 +100,7 @@ var WeaveDB = exports["default"] = /*#__PURE__*/_createClass(function WeaveDB(ar
56
100
  if (!FS.analyzePath("/rollup/").exists) FS.mkdir("/rollup/");
57
101
  node = FS.createFile("/", "rollup/" + id, properties, true, false); // Set initial parame
58
102
  _context.next = 5;
59
- return ar.data(id);
103
+ return ar.data(id, null, log);
60
104
  case 5:
61
105
  data = _context.sent;
62
106
  bytesLength = (_data$length = data === null || data === void 0 ? void 0 : data.length) !== null && _data$length !== void 0 ? _data$length : 0;
@@ -112,7 +156,7 @@ var WeaveDB = exports["default"] = /*#__PURE__*/_createClass(function WeaveDB(ar
112
156
  Object.defineProperties(node, {
113
157
  usedBytes: {
114
158
  get: function get() {
115
- return bytesLength;
159
+ return this.total_size;
116
160
  }
117
161
  }
118
162
  });
@@ -206,7 +250,7 @@ var WeaveDB = exports["default"] = /*#__PURE__*/_createClass(function WeaveDB(ar
206
250
  read: function read(fd, raw_dst_ptr, raw_length, val) {
207
251
  var _this2 = this;
208
252
  return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
209
- var to_read, dst_ptr, stream, i, bytes_read, chunk_download_sz, to, data, sp, _readFileSync2, col_dir, _data, json, _iterator, _step, _v, _val, _fd, _col_dir, start, end, chunk, response, reader, bytes_until_cache, bytes_until_notify, downloaded_bytes, cache_chunks, _yield$reader$read, done, chunk_bytes, write_length, chunk_to_cache;
253
+ var to_read, dst_ptr, stream, i, bytes_read, chunk_download_sz, to, data, sp, _readFileSync2, col_dir, _data, updates, isNext, d, _decode, op, col, doc, json, left, len, _col_dir, _data3, u, _e, p, res, _i2, _updates, _v, _val, _fd, _col_dir2, _i3, start, end, chunk, response, reader, bytes_until_cache, bytes_until_notify, downloaded_bytes, cache_chunks, _yield$reader$read, done, chunk_bytes, write_length, chunk_to_cache;
210
254
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
211
255
  while (1) switch (_context4.prev = _context4.next) {
212
256
  case 0:
@@ -237,7 +281,7 @@ var WeaveDB = exports["default"] = /*#__PURE__*/_createClass(function WeaveDB(ar
237
281
  to = Math.min(stream.node.total_size, stream.position + chunk_download_sz);
238
282
  data = val;
239
283
  if (data) {
240
- _context4.next = 56;
284
+ _context4.next = 57;
241
285
  break;
242
286
  }
243
287
  sp = stream.path.split("/");
@@ -248,56 +292,84 @@ var WeaveDB = exports["default"] = /*#__PURE__*/_createClass(function WeaveDB(ar
248
292
  col_dir = (0, _path.resolve)(data_dir, sp[2]);
249
293
  _data = (_readFileSync2 = (0, _fs.readFileSync)((0, _path.resolve)(col_dir, "".concat(sp[3], ".json")), "utf8")) !== null && _readFileSync2 !== void 0 ? _readFileSync2 : "";
250
294
  data = Buffer.from(_data, "utf8");
251
- _context4.next = 56;
295
+ _context4.next = 57;
252
296
  break;
253
297
  case 22:
254
298
  _context4.next = 24;
255
- return ar.data(stream.node.name);
299
+ return ar.data(stream.node.name, null, log);
256
300
  case 24:
257
301
  data = _context4.sent;
258
- _context4.prev = 25;
259
- json = JSON.parse(Buffer.from(data).toString());
260
- _iterator = _createForOfIteratorHelper(json.diffs);
261
- _context4.prev = 28;
262
- _iterator.s();
302
+ updates = [];
303
+ isNext = function isNext(b) {
304
+ return b.length > 1 || b.length === 1 && b[0] !== 0;
305
+ };
306
+ _context4.prev = 27;
307
+ while (isNext(data)) {
308
+ d = new _index.Decoder();
309
+ _decode = (0, _index.decode)(data, d, true), op = _decode.op, col = _decode.col, doc = _decode.doc, json = _decode.json, left = _decode.left, len = _decode.len;
310
+ data = frombits(left);
311
+ if (op === 2) {
312
+ _col_dir = (0, _path.resolve)(data_dir, col.toString());
313
+ _data3 = JSON.parse((0, _fs.readFileSync)((0, _path.resolve)(_col_dir, "".concat(doc, ".json")), "utf8"));
314
+ u = new _index.Encoder();
315
+ _e = (0, _index.encode)(_data3, u);
316
+ p = new _index.Parser(d.cols());
317
+ res = p.update(_e, data, len);
318
+ json = res.json;
319
+ data = res.left;
320
+ } else if (op === 3) json = null;
321
+ updates.push({
322
+ col: col,
323
+ doc: doc,
324
+ json: json
325
+ });
326
+ }
327
+ _i2 = 0, _updates = updates;
263
328
  case 30:
264
- if ((_step = _iterator.n()).done) {
265
- _context4.next = 43;
329
+ if (!(_i2 < _updates.length)) {
330
+ _context4.next = 52;
266
331
  break;
267
332
  }
268
- _v = _step.value;
269
- _val = Buffer.from(JSON.stringify(_v.data));
333
+ _v = _updates[_i2];
334
+ _val = Buffer.from(JSON.stringify(_v.json));
270
335
  _context4.next = 35;
271
- return _this2.open("/data/".concat(_v.collection, "/").concat(_v.doc), _val);
336
+ return _this2.open("/data/".concat(_v.col, "/").concat(_v.doc), _val);
272
337
  case 35:
273
338
  _fd = _context4.sent;
274
- _col_dir = (0, _path.resolve)(data_dir, _v.collection);
275
- if (!(0, _fs.existsSync)(_col_dir)) (0, _fs.mkdirSync)(_col_dir);
276
- (0, _fs.writeFileSync)((0, _path.resolve)(_col_dir, "".concat(_v.doc, ".json")), JSON.stringify(_v.data));
277
- _context4.next = 41;
339
+ _col_dir2 = (0, _path.resolve)(data_dir, _v.col.toString());
340
+ if (!(0, _fs.existsSync)(_col_dir2)) (0, _fs.mkdirSync)(_col_dir2);
341
+ (0, _fs.writeFileSync)((0, _path.resolve)(_col_dir2, "".concat(_v.doc, ".json")), JSON.stringify(_v.json));
342
+ _i3 = 0;
343
+ case 40:
344
+ if (!(_i3 < FS.streams.length)) {
345
+ _context4.next = 47;
346
+ break;
347
+ }
348
+ if (!(FS.streams[_i3].fd === _fd)) {
349
+ _context4.next = 44;
350
+ break;
351
+ }
352
+ FS.streams[_i3].node.total_size = _val.length;
353
+ return _context4.abrupt("break", 47);
354
+ case 44:
355
+ _i3++;
356
+ _context4.next = 40;
357
+ break;
358
+ case 47:
359
+ _context4.next = 49;
278
360
  return _this2.read(_fd, _fd, _val.length, _val);
279
- case 41:
361
+ case 49:
362
+ _i2++;
280
363
  _context4.next = 30;
281
364
  break;
282
- case 43:
283
- _context4.next = 48;
284
- break;
285
- case 45:
286
- _context4.prev = 45;
287
- _context4.t0 = _context4["catch"](28);
288
- _iterator.e(_context4.t0);
289
- case 48:
290
- _context4.prev = 48;
291
- _iterator.f();
292
- return _context4.finish(48);
293
- case 51:
294
- _context4.next = 56;
365
+ case 52:
366
+ _context4.next = 57;
295
367
  break;
296
- case 53:
297
- _context4.prev = 53;
298
- _context4.t1 = _context4["catch"](25);
299
- log(_context4.t1);
300
- case 56:
368
+ case 54:
369
+ _context4.prev = 54;
370
+ _context4.t0 = _context4["catch"](27);
371
+ log(_context4.t0);
372
+ case 57:
301
373
  // Extract the Range header to determine the start and end of the requested chunk
302
374
  start = 0;
303
375
  end = data.length; // Create a ReadableStream for the requested chunk
@@ -317,24 +389,24 @@ var WeaveDB = exports["default"] = /*#__PURE__*/_createClass(function WeaveDB(ar
317
389
  bytes_until_notify = NOTIFY_SZ;
318
390
  downloaded_bytes = 0;
319
391
  cache_chunks = [];
320
- _context4.prev = 65;
321
- case 66:
392
+ _context4.prev = 66;
393
+ case 67:
322
394
  if (!true) {
323
- _context4.next = 84;
395
+ _context4.next = 85;
324
396
  break;
325
397
  }
326
- _context4.next = 69;
398
+ _context4.next = 70;
327
399
  return reader.read();
328
- case 69:
400
+ case 70:
329
401
  _yield$reader$read = _context4.sent;
330
402
  done = _yield$reader$read.done;
331
403
  chunk_bytes = _yield$reader$read.value;
332
404
  if (!done) {
333
- _context4.next = 74;
405
+ _context4.next = 75;
334
406
  break;
335
407
  }
336
- return _context4.abrupt("break", 84);
337
- case 74:
408
+ return _context4.abrupt("break", 85);
409
+ case 75:
338
410
  // Update the number of downloaded bytes to be _all_, not just the write length
339
411
  downloaded_bytes += chunk_bytes.length;
340
412
  bytes_until_cache -= chunk_bytes.length;
@@ -365,20 +437,20 @@ var WeaveDB = exports["default"] = /*#__PURE__*/_createClass(function WeaveDB(ar
365
437
  console.log("KV: Downloaded: ", downloaded_bytes / stream.node.total_size * 100, "%");
366
438
  bytes_until_notify = NOTIFY_SZ;
367
439
  }
368
- _context4.next = 66;
440
+ _context4.next = 67;
369
441
  break;
370
- case 84:
371
- _context4.next = 89;
442
+ case 85:
443
+ _context4.next = 90;
372
444
  break;
373
- case 86:
374
- _context4.prev = 86;
375
- _context4.t2 = _context4["catch"](65);
376
- console.error("KV: Error reading the stream: ", _context4.t2);
377
- case 89:
378
- _context4.prev = 89;
445
+ case 87:
446
+ _context4.prev = 87;
447
+ _context4.t1 = _context4["catch"](66);
448
+ console.error("KV: Error reading the stream: ", _context4.t1);
449
+ case 90:
450
+ _context4.prev = 90;
379
451
  reader.releaseLock();
380
- return _context4.finish(89);
381
- case 92:
452
+ return _context4.finish(90);
453
+ case 93:
382
454
  // If we have no cache, or we have not satisfied the full request, we need to download the rest
383
455
  // Rebuild the cache from the new cache chunks
384
456
  stream.node.cache = _this2.addChunksToCache(stream.node.cache, cache_chunks);
@@ -386,11 +458,11 @@ var WeaveDB = exports["default"] = /*#__PURE__*/_createClass(function WeaveDB(ar
386
458
  // Update the last read position
387
459
  stream.lastReadPosition = stream.position;
388
460
  return _context4.abrupt("return", bytes_read);
389
- case 95:
461
+ case 96:
390
462
  case "end":
391
463
  return _context4.stop();
392
464
  }
393
- }, _callee4, null, [[25, 53], [28, 45, 48, 51], [65, 86, 89, 92]]);
465
+ }, _callee4, null, [[27, 54], [66, 87, 90, 93]]);
394
466
  }))();
395
467
  },
396
468
  close: function close(fd) {
@@ -425,20 +497,20 @@ var WeaveDB = exports["default"] = /*#__PURE__*/_createClass(function WeaveDB(ar
425
497
  new_cache.set(old_cache, 0);
426
498
  // Load the cache chunks into the new cache
427
499
  var current_offset = old_cache.length;
428
- var _iterator2 = _createForOfIteratorHelper(chunks),
429
- _step2;
500
+ var _iterator = _createForOfIteratorHelper(chunks),
501
+ _step;
430
502
  try {
431
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
432
- var chunk = _step2.value;
503
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
504
+ var chunk = _step.value;
433
505
  if (current_offset < new_cache_length) {
434
506
  new_cache.set(chunk.subarray(0, new_cache_length - current_offset), current_offset);
435
507
  current_offset += chunk.length;
436
508
  }
437
509
  }
438
510
  } catch (err) {
439
- _iterator2.e(err);
511
+ _iterator.e(err);
440
512
  } finally {
441
- _iterator2.f();
513
+ _iterator.f();
442
514
  }
443
515
  return new_cache;
444
516
  }
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ {"test":2}
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1 @@
1
+ {"test":2}
@@ -0,0 +1 @@
1
+ 2
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1 @@
1
+ {"name":"Bob","age":40}
@@ -0,0 +1 @@
1
+ {"test":2}
@@ -0,0 +1 @@
1
+ {"test":1}
@@ -0,0 +1 @@
1
+ {"test":1}
@@ -0,0 +1 @@
1
+ {"test":1}
@@ -0,0 +1 @@
1
+ {"test":2}
@@ -0,0 +1 @@
1
+ {"test":1}
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1 @@
1
+ {"test":2}
@@ -0,0 +1 @@
1
+ {"test":1}
@@ -0,0 +1 @@
1
+ 29
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ {"test":2}
@@ -0,0 +1 @@
1
+ {"test":2}
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ {"test":2}
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ {"test":2}
@@ -0,0 +1 @@
1
+ {"name":"Bob","age":40}
@@ -0,0 +1 @@
1
+ {"t":3}
@@ -0,0 +1 @@
1
+ {"test":1}
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ {"test":20}
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ {"test":1}
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ {"test":2}
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1 @@
1
+ {"test":2}