@fireproof/core 0.20.0-dev-preview-61 → 0.20.0-dev-preview-63

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 (404) hide show
  1. package/apply-head-queue.d.ts +18 -0
  2. package/apply-head-queue.d.ts.map +1 -0
  3. package/apply-head-queue.js +47 -0
  4. package/apply-head-queue.js.map +1 -0
  5. package/blockstore/attachable-store.d.ts +17 -0
  6. package/blockstore/attachable-store.d.ts.map +1 -0
  7. package/blockstore/attachable-store.js +295 -0
  8. package/blockstore/attachable-store.js.map +1 -0
  9. package/blockstore/commit-queue.d.ts +12 -0
  10. package/blockstore/commit-queue.d.ts.map +1 -0
  11. package/blockstore/commit-queue.js +52 -0
  12. package/blockstore/commit-queue.js.map +1 -0
  13. package/blockstore/commitor.d.ts +21 -0
  14. package/blockstore/commitor.d.ts.map +1 -0
  15. package/blockstore/commitor.js +104 -0
  16. package/blockstore/commitor.js.map +1 -0
  17. package/blockstore/connect-raw.d.ts +2 -0
  18. package/blockstore/connect-raw.d.ts.map +1 -0
  19. package/blockstore/connect-raw.js +2 -0
  20. package/blockstore/connect-raw.js.map +1 -0
  21. package/blockstore/connection-base.d.ts +2 -0
  22. package/blockstore/connection-base.d.ts.map +1 -0
  23. package/blockstore/connection-base.js +2 -0
  24. package/blockstore/connection-base.js.map +1 -0
  25. package/blockstore/encrypt-helpers.d.ts +2 -0
  26. package/blockstore/encrypt-helpers.d.ts.map +1 -0
  27. package/blockstore/encrypt-helpers.js +2 -0
  28. package/blockstore/encrypt-helpers.js.map +1 -0
  29. package/blockstore/fp-envelope.d.ts +32 -0
  30. package/blockstore/fp-envelope.d.ts.map +1 -0
  31. package/blockstore/fp-envelope.js +14 -0
  32. package/blockstore/fp-envelope.js.map +1 -0
  33. package/blockstore/gateway.d.ts +20 -0
  34. package/blockstore/gateway.d.ts.map +1 -0
  35. package/blockstore/gateway.js +2 -0
  36. package/blockstore/gateway.js.map +1 -0
  37. package/blockstore/index.d.ts +16 -0
  38. package/blockstore/index.d.ts.map +1 -0
  39. package/blockstore/index.js +16 -0
  40. package/blockstore/index.js.map +1 -0
  41. package/blockstore/interceptor-gateway.d.ts +29 -0
  42. package/blockstore/interceptor-gateway.d.ts.map +1 -0
  43. package/blockstore/interceptor-gateway.js +137 -0
  44. package/blockstore/interceptor-gateway.js.map +1 -0
  45. package/blockstore/loader-helpers.d.ts +4 -0
  46. package/blockstore/loader-helpers.d.ts.map +1 -0
  47. package/blockstore/loader-helpers.js +16 -0
  48. package/blockstore/loader-helpers.js.map +1 -0
  49. package/blockstore/loader.d.ts +45 -0
  50. package/blockstore/loader.d.ts.map +1 -0
  51. package/blockstore/loader.js +352 -0
  52. package/blockstore/loader.js.map +1 -0
  53. package/blockstore/register-store-protocol.d.ts +22 -0
  54. package/blockstore/register-store-protocol.d.ts.map +1 -0
  55. package/blockstore/register-store-protocol.js +114 -0
  56. package/blockstore/register-store-protocol.js.map +1 -0
  57. package/blockstore/serde-gateway.d.ts +78 -0
  58. package/blockstore/serde-gateway.d.ts.map +1 -0
  59. package/blockstore/serde-gateway.js +2 -0
  60. package/blockstore/serde-gateway.js.map +1 -0
  61. package/blockstore/store-factory.d.ts +11 -0
  62. package/blockstore/store-factory.d.ts.map +1 -0
  63. package/blockstore/store-factory.js +105 -0
  64. package/blockstore/store-factory.js.map +1 -0
  65. package/blockstore/store-remote.d.ts +2 -0
  66. package/blockstore/store-remote.d.ts.map +1 -0
  67. package/blockstore/store-remote.js +2 -0
  68. package/blockstore/store-remote.js.map +1 -0
  69. package/blockstore/store.d.ts +82 -0
  70. package/blockstore/store.d.ts.map +1 -0
  71. package/blockstore/store.js +438 -0
  72. package/blockstore/store.js.map +1 -0
  73. package/blockstore/task-manager.d.ts +19 -0
  74. package/blockstore/task-manager.d.ts.map +1 -0
  75. package/blockstore/task-manager.js +50 -0
  76. package/blockstore/task-manager.js.map +1 -0
  77. package/blockstore/transaction.d.ts +64 -0
  78. package/blockstore/transaction.d.ts.map +1 -0
  79. package/blockstore/transaction.js +249 -0
  80. package/blockstore/transaction.js.map +1 -0
  81. package/blockstore/types.d.ts +400 -0
  82. package/blockstore/types.d.ts.map +1 -0
  83. package/blockstore/types.js +55 -0
  84. package/blockstore/types.js.map +1 -0
  85. package/blockstore/uri-interceptor.d.ts +19 -0
  86. package/blockstore/uri-interceptor.d.ts.map +1 -0
  87. package/blockstore/uri-interceptor.js +61 -0
  88. package/blockstore/uri-interceptor.js.map +1 -0
  89. package/bundle-not-impl.d.ts +2 -0
  90. package/bundle-not-impl.d.ts.map +1 -0
  91. package/bundle-not-impl.js +4 -0
  92. package/bundle-not-impl.js.map +1 -0
  93. package/cli/main.js +26114 -0
  94. package/context.d.ts +7 -0
  95. package/context.d.ts.map +1 -0
  96. package/context.js +15 -0
  97. package/context.js.map +1 -0
  98. package/crdt-clock.d.ts +27 -0
  99. package/crdt-clock.d.ts.map +1 -0
  100. package/crdt-clock.js +140 -0
  101. package/crdt-clock.js.map +1 -0
  102. package/crdt-helpers.d.ts +16 -0
  103. package/crdt-helpers.d.ts.map +1 -0
  104. package/crdt-helpers.js +316 -0
  105. package/crdt-helpers.js.map +1 -0
  106. package/crdt.d.ts +34 -0
  107. package/crdt.d.ts.map +1 -0
  108. package/crdt.js +131 -0
  109. package/crdt.js.map +1 -0
  110. package/database.d.ts +34 -0
  111. package/database.d.ts.map +1 -0
  112. package/database.js +121 -0
  113. package/database.js.map +1 -0
  114. package/index.d.ts +15 -2742
  115. package/index.d.ts.map +1 -0
  116. package/index.js +14 -7267
  117. package/index.js.map +1 -1
  118. package/indexer-helpers.d.ts +69 -0
  119. package/indexer-helpers.d.ts.map +1 -0
  120. package/indexer-helpers.js +135 -0
  121. package/indexer-helpers.js.map +1 -0
  122. package/indexer.d.ts +25 -0
  123. package/indexer.d.ts.map +1 -0
  124. package/indexer.js +231 -0
  125. package/indexer.js.map +1 -0
  126. package/ledger.d.ts +56 -0
  127. package/ledger.d.ts.map +1 -0
  128. package/ledger.js +224 -0
  129. package/ledger.js.map +1 -0
  130. package/package.json +18 -15
  131. package/protocols/cloud/http-connection.d.ts +25 -0
  132. package/protocols/cloud/http-connection.d.ts.map +1 -0
  133. package/protocols/cloud/http-connection.js +153 -0
  134. package/protocols/cloud/http-connection.js.map +1 -0
  135. package/protocols/cloud/index.d.ts +10 -0
  136. package/protocols/cloud/index.d.ts.map +1 -0
  137. package/protocols/cloud/index.js +10 -0
  138. package/protocols/cloud/index.js.map +1 -0
  139. package/protocols/cloud/msg-raw-connection-base.d.ts +16 -0
  140. package/protocols/cloud/msg-raw-connection-base.d.ts.map +1 -0
  141. package/protocols/cloud/msg-raw-connection-base.js +22 -0
  142. package/protocols/cloud/msg-raw-connection-base.js.map +1 -0
  143. package/protocols/cloud/msg-types-data.d.ts +36 -0
  144. package/protocols/cloud/msg-types-data.d.ts.map +1 -0
  145. package/protocols/cloud/msg-types-data.js +38 -0
  146. package/protocols/cloud/msg-types-data.js.map +1 -0
  147. package/protocols/cloud/msg-types-meta.d.ts +41 -0
  148. package/protocols/cloud/msg-types-meta.d.ts.map +1 -0
  149. package/protocols/cloud/msg-types-meta.js +98 -0
  150. package/protocols/cloud/msg-types-meta.js.map +1 -0
  151. package/protocols/cloud/msg-types-wal.d.ts +33 -0
  152. package/protocols/cloud/msg-types-wal.d.ts.map +1 -0
  153. package/protocols/cloud/msg-types-wal.js +38 -0
  154. package/protocols/cloud/msg-types-wal.js.map +1 -0
  155. package/protocols/cloud/msg-types.d.ts +279 -0
  156. package/protocols/cloud/msg-types.d.ts.map +1 -0
  157. package/protocols/cloud/msg-types.js +278 -0
  158. package/protocols/cloud/msg-types.js.map +1 -0
  159. package/protocols/cloud/msger.d.ts +79 -0
  160. package/protocols/cloud/msger.d.ts.map +1 -0
  161. package/protocols/cloud/msger.js +198 -0
  162. package/protocols/cloud/msger.js.map +1 -0
  163. package/protocols/cloud/ws-connection.d.ts +29 -0
  164. package/protocols/cloud/ws-connection.d.ts.map +1 -0
  165. package/protocols/cloud/ws-connection.js +163 -0
  166. package/protocols/cloud/ws-connection.js.map +1 -0
  167. package/protocols/index.d.ts +2 -0
  168. package/protocols/index.d.ts.map +1 -0
  169. package/protocols/index.js +2 -0
  170. package/protocols/index.js.map +1 -0
  171. package/react/{index.d.cts → img-file.d.ts} +6 -53
  172. package/react/img-file.d.ts.map +1 -0
  173. package/react/img-file.js +58 -0
  174. package/react/img-file.js.map +1 -0
  175. package/react/index.d.ts +4 -336
  176. package/react/index.d.ts.map +1 -0
  177. package/react/index.js +3 -263
  178. package/react/index.js.map +1 -1
  179. package/react/types.d.ts +43 -0
  180. package/react/types.d.ts.map +1 -0
  181. package/react/types.js +2 -0
  182. package/react/types.js.map +1 -0
  183. package/react/use-all-docs.d.ts +4 -0
  184. package/react/use-all-docs.d.ts.map +1 -0
  185. package/react/use-all-docs.js +19 -0
  186. package/react/use-all-docs.js.map +1 -0
  187. package/react/use-changes.d.ts +4 -0
  188. package/react/use-changes.d.ts.map +1 -0
  189. package/react/use-changes.js +19 -0
  190. package/react/use-changes.js.map +1 -0
  191. package/react/use-document.d.ts +4 -0
  192. package/react/use-document.d.ts.map +1 -0
  193. package/react/use-document.js +99 -0
  194. package/react/use-document.js.map +1 -0
  195. package/react/use-fireproof.d.ts +6 -0
  196. package/react/use-fireproof.d.ts.map +1 -0
  197. package/react/use-fireproof.js +15 -0
  198. package/react/use-fireproof.js.map +1 -0
  199. package/react/use-live-query.d.ts +4 -0
  200. package/react/use-live-query.d.ts.map +1 -0
  201. package/react/use-live-query.js +38 -0
  202. package/react/use-live-query.js.map +1 -0
  203. package/react/utils.d.ts +2 -0
  204. package/react/utils.d.ts.map +1 -0
  205. package/react/utils.js +4 -0
  206. package/react/utils.js.map +1 -0
  207. package/runtime/files.d.ts +12 -0
  208. package/runtime/files.d.ts.map +1 -0
  209. package/runtime/files.js +29 -0
  210. package/runtime/files.js.map +1 -0
  211. package/runtime/gateways/cloud/gateway.d.ts +44 -0
  212. package/runtime/gateways/cloud/gateway.d.ts.map +1 -0
  213. package/runtime/gateways/cloud/gateway.js +496 -0
  214. package/runtime/gateways/cloud/gateway.js.map +1 -0
  215. package/runtime/gateways/def-serde-gateway.d.ts +19 -0
  216. package/runtime/gateways/def-serde-gateway.d.ts.map +1 -0
  217. package/runtime/gateways/def-serde-gateway.js +73 -0
  218. package/runtime/gateways/def-serde-gateway.js.map +1 -0
  219. package/runtime/gateways/file/deno/deno-filesystem.d.ts +27 -0
  220. package/runtime/gateways/file/deno/deno-filesystem.d.ts.map +1 -0
  221. package/runtime/gateways/file/deno/deno-filesystem.js +51 -0
  222. package/runtime/gateways/file/deno/deno-filesystem.js.map +1 -0
  223. package/runtime/gateways/file/deno/get-sys-file-system.d.ts +4 -0
  224. package/runtime/gateways/file/deno/get-sys-file-system.d.ts.map +1 -0
  225. package/runtime/gateways/file/deno/get-sys-file-system.js +11 -0
  226. package/runtime/gateways/file/deno/get-sys-file-system.js.map +1 -0
  227. package/runtime/gateways/file/deno/index.d.ts +2 -0
  228. package/runtime/gateways/file/deno/index.d.ts.map +1 -0
  229. package/runtime/gateways/file/deno/index.js +2 -0
  230. package/runtime/gateways/file/deno/index.js.map +1 -0
  231. package/runtime/gateways/file/gateway-impl.d.ts +18 -0
  232. package/runtime/gateways/file/gateway-impl.d.ts.map +1 -0
  233. package/runtime/gateways/file/gateway-impl.js +121 -0
  234. package/runtime/gateways/file/gateway-impl.js.map +1 -0
  235. package/runtime/gateways/file/index.d.ts +3 -0
  236. package/runtime/gateways/file/index.d.ts.map +1 -0
  237. package/runtime/gateways/file/index.js +3 -0
  238. package/runtime/gateways/file/index.js.map +1 -0
  239. package/runtime/gateways/file/key-bag-file.d.ts +19 -0
  240. package/runtime/gateways/file/key-bag-file.d.ts.map +1 -0
  241. package/runtime/gateways/file/key-bag-file.js +40 -0
  242. package/runtime/gateways/file/key-bag-file.js.map +1 -0
  243. package/runtime/gateways/file/node/get-sys-file-system.d.ts +4 -0
  244. package/runtime/gateways/file/node/get-sys-file-system.d.ts.map +1 -0
  245. package/runtime/gateways/file/node/get-sys-file-system.js +11 -0
  246. package/runtime/gateways/file/node/get-sys-file-system.js.map +1 -0
  247. package/runtime/gateways/file/node/index.d.ts +2 -0
  248. package/runtime/gateways/file/node/index.d.ts.map +1 -0
  249. package/runtime/gateways/file/node/index.js +2 -0
  250. package/runtime/gateways/file/node/index.js.map +1 -0
  251. package/runtime/gateways/file/node/node-filesystem.d.ts +32 -0
  252. package/runtime/gateways/file/node/node-filesystem.d.ts.map +1 -0
  253. package/runtime/gateways/file/node/node-filesystem.js +37 -0
  254. package/runtime/gateways/file/node/node-filesystem.js.map +1 -0
  255. package/runtime/gateways/file/node/to-array-buffer.d.ts +2 -0
  256. package/runtime/gateways/file/node/to-array-buffer.d.ts.map +1 -0
  257. package/runtime/gateways/file/node/to-array-buffer.js +12 -0
  258. package/runtime/gateways/file/node/to-array-buffer.js.map +1 -0
  259. package/runtime/gateways/file/sys-file-system-factory.d.ts +4 -0
  260. package/runtime/gateways/file/sys-file-system-factory.d.ts.map +1 -0
  261. package/runtime/gateways/file/sys-file-system-factory.js +13 -0
  262. package/runtime/gateways/file/sys-file-system-factory.js.map +1 -0
  263. package/runtime/gateways/file/utils.d.ts +5 -0
  264. package/runtime/gateways/file/utils.d.ts.map +1 -0
  265. package/runtime/gateways/file/utils.js +27 -0
  266. package/runtime/gateways/file/utils.js.map +1 -0
  267. package/runtime/gateways/file/version.d.ts +2 -0
  268. package/runtime/gateways/file/version.d.ts.map +1 -0
  269. package/runtime/gateways/file/version.js +2 -0
  270. package/runtime/gateways/file/version.js.map +1 -0
  271. package/runtime/gateways/fp-envelope-serialize.d.ts +50 -0
  272. package/runtime/gateways/fp-envelope-serialize.d.ts.map +1 -0
  273. package/runtime/gateways/fp-envelope-serialize.js +141 -0
  274. package/runtime/gateways/fp-envelope-serialize.js.map +1 -0
  275. package/runtime/gateways/index.d.ts +6 -0
  276. package/runtime/gateways/index.d.ts.map +1 -0
  277. package/runtime/gateways/index.js +6 -0
  278. package/runtime/gateways/index.js.map +1 -0
  279. package/runtime/gateways/indexeddb/gateway-impl.d.ts +22 -0
  280. package/runtime/gateways/indexeddb/gateway-impl.d.ts.map +1 -0
  281. package/runtime/gateways/indexeddb/gateway-impl.js +147 -0
  282. package/runtime/gateways/indexeddb/gateway-impl.js.map +1 -0
  283. package/runtime/gateways/indexeddb/index.d.ts +6 -0
  284. package/runtime/gateways/indexeddb/index.d.ts.map +1 -0
  285. package/runtime/gateways/indexeddb/index.js +6 -0
  286. package/runtime/gateways/indexeddb/index.js.map +1 -0
  287. package/runtime/gateways/indexeddb/key-bag-indexeddb.d.ts +15 -0
  288. package/runtime/gateways/indexeddb/key-bag-indexeddb.d.ts.map +1 -0
  289. package/runtime/gateways/indexeddb/key-bag-indexeddb.js +42 -0
  290. package/runtime/gateways/indexeddb/key-bag-indexeddb.js.map +1 -0
  291. package/runtime/gateways/indexeddb-version.d.ts +2 -0
  292. package/runtime/gateways/indexeddb-version.d.ts.map +1 -0
  293. package/runtime/gateways/indexeddb-version.js +2 -0
  294. package/runtime/gateways/indexeddb-version.js.map +1 -0
  295. package/runtime/gateways/memory/gateway.d.ts +18 -0
  296. package/runtime/gateways/memory/gateway.d.ts.map +1 -0
  297. package/runtime/gateways/memory/gateway.js +58 -0
  298. package/runtime/gateways/memory/gateway.js.map +1 -0
  299. package/runtime/gateways/memory/version.d.ts +2 -0
  300. package/runtime/gateways/memory/version.d.ts.map +1 -0
  301. package/runtime/gateways/memory/version.js +2 -0
  302. package/runtime/gateways/memory/version.js.map +1 -0
  303. package/runtime/index.d.ts +13 -0
  304. package/runtime/index.d.ts.map +1 -0
  305. package/runtime/index.js +13 -0
  306. package/runtime/index.js.map +1 -0
  307. package/runtime/key-bag-memory.d.ts +12 -0
  308. package/runtime/key-bag-memory.d.ts.map +1 -0
  309. package/runtime/key-bag-memory.js +23 -0
  310. package/runtime/key-bag-memory.js.map +1 -0
  311. package/runtime/key-bag.d.ts +85 -0
  312. package/runtime/key-bag.d.ts.map +1 -0
  313. package/runtime/key-bag.js +415 -0
  314. package/runtime/key-bag.js.map +1 -0
  315. package/runtime/keyed-crypto.d.ts +19 -0
  316. package/runtime/keyed-crypto.d.ts.map +1 -0
  317. package/runtime/keyed-crypto.js +192 -0
  318. package/runtime/keyed-crypto.js.map +1 -0
  319. package/runtime/memory-sys-container.d.ts +2 -0
  320. package/runtime/memory-sys-container.d.ts.map +1 -0
  321. package/runtime/memory-sys-container.js +2 -0
  322. package/runtime/memory-sys-container.js.map +1 -0
  323. package/runtime/meta-key-hack.d.ts +42 -0
  324. package/runtime/meta-key-hack.d.ts.map +1 -0
  325. package/runtime/meta-key-hack.js +201 -0
  326. package/runtime/meta-key-hack.js.map +1 -0
  327. package/runtime/sts-service/index.d.ts +40 -0
  328. package/runtime/sts-service/index.d.ts.map +1 -0
  329. package/runtime/sts-service/index.js +102 -0
  330. package/runtime/sts-service/index.js.map +1 -0
  331. package/runtime/sys-container.d.ts +2 -0
  332. package/runtime/sys-container.d.ts.map +1 -0
  333. package/runtime/sys-container.js +2 -0
  334. package/runtime/sys-container.js.map +1 -0
  335. package/runtime/wait-pr-multiformats/block.d.ts +47 -0
  336. package/runtime/wait-pr-multiformats/block.d.ts.map +1 -0
  337. package/runtime/wait-pr-multiformats/block.js +64 -0
  338. package/runtime/wait-pr-multiformats/block.js.map +1 -0
  339. package/runtime/wait-pr-multiformats/codec-interface.d.ts +29 -0
  340. package/runtime/wait-pr-multiformats/codec-interface.d.ts.map +1 -0
  341. package/runtime/wait-pr-multiformats/codec-interface.js +2 -0
  342. package/runtime/wait-pr-multiformats/codec-interface.js.map +1 -0
  343. package/runtime/wait-pr-multiformats/index.d.ts +3 -0
  344. package/runtime/wait-pr-multiformats/index.d.ts.map +1 -0
  345. package/runtime/wait-pr-multiformats/index.js +3 -0
  346. package/runtime/wait-pr-multiformats/index.js.map +1 -0
  347. package/tests/blockstore/store.test.ts +9 -4
  348. package/tests/fireproof/attachable.test.ts +3 -3
  349. package/types.d.ts +427 -0
  350. package/types.d.ts.map +1 -0
  351. package/types.js +54 -0
  352. package/types.js.map +1 -0
  353. package/use-fireproof/index.d.ts +3 -0
  354. package/use-fireproof/index.d.ts.map +1 -0
  355. package/use-fireproof/index.js +3 -0
  356. package/use-fireproof/index.js.map +1 -0
  357. package/utils.d.ts +36 -0
  358. package/utils.d.ts.map +1 -0
  359. package/utils.js +379 -0
  360. package/utils.js.map +1 -0
  361. package/version.d.ts +2 -0
  362. package/version.d.ts.map +1 -0
  363. package/version.js +4 -0
  364. package/version.js.map +1 -0
  365. package/write-queue.d.ts +9 -0
  366. package/write-queue.d.ts.map +1 -0
  367. package/write-queue.js +70 -0
  368. package/write-queue.js.map +1 -0
  369. package/deno/index.d.ts +0 -7
  370. package/deno/index.js +0 -66
  371. package/deno/index.js.map +0 -1
  372. package/deno/metafile-esm.json +0 -1
  373. package/index.cjs +0 -7268
  374. package/index.cjs.map +0 -1
  375. package/index.d.cts +0 -2742
  376. package/indexeddb/index.cjs +0 -218
  377. package/indexeddb/index.cjs.map +0 -1
  378. package/indexeddb/index.d.cts +0 -30
  379. package/indexeddb/index.d.ts +0 -30
  380. package/indexeddb/index.js +0 -195
  381. package/indexeddb/index.js.map +0 -1
  382. package/indexeddb/metafile-cjs.json +0 -1
  383. package/indexeddb/metafile-esm.json +0 -1
  384. package/metafile-cjs.json +0 -1
  385. package/metafile-esm.json +0 -1
  386. package/node/index.cjs +0 -97
  387. package/node/index.cjs.map +0 -1
  388. package/node/index.d.cts +0 -7
  389. package/node/index.d.ts +0 -7
  390. package/node/index.js +0 -64
  391. package/node/index.js.map +0 -1
  392. package/node/metafile-cjs.json +0 -1
  393. package/node/metafile-esm.json +0 -1
  394. package/react/index.cjs +0 -297
  395. package/react/index.cjs.map +0 -1
  396. package/react/metafile-cjs.json +0 -1
  397. package/react/metafile-esm.json +0 -1
  398. package/tests/www/gallery.html +0 -132
  399. package/tests/www/iife.html +0 -42
  400. package/tests/www/todo-aws.html +0 -232
  401. package/tests/www/todo-ipfs.html +0 -213
  402. package/tests/www/todo-local.html +0 -214
  403. package/tests/www/todo-netlify.html +0 -227
  404. package/tests/www/todo.html +0 -254
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connection-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-base.js","sourceRoot":"","sources":["../../../../src/blockstore/connection-base.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=encrypt-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encrypt-helpers.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/encrypt-helpers.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=encrypt-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encrypt-helpers.js","sourceRoot":"","sources":["../../../../src/blockstore/encrypt-helpers.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ import { CID } from "multiformats";
2
+ import { DbMetaEvent, WALState } from "./types.js";
3
+ import { Result } from "@adviser/cement";
4
+ export declare const FPEnvelopeTypes: {
5
+ readonly CAR: "car";
6
+ readonly FILE: "file";
7
+ readonly META: "meta";
8
+ readonly WAL: "wal";
9
+ };
10
+ export type FPEnvelopeType = (typeof FPEnvelopeTypes)[keyof typeof FPEnvelopeTypes];
11
+ export interface FPEnvelope<T> {
12
+ readonly type: FPEnvelopeType;
13
+ readonly payload: T;
14
+ }
15
+ export interface FPEnvelopeCar extends FPEnvelope<Uint8Array> {
16
+ readonly type: typeof FPEnvelopeTypes.CAR;
17
+ }
18
+ export interface FPEnvelopeFile extends FPEnvelope<Uint8Array> {
19
+ readonly type: typeof FPEnvelopeTypes.FILE;
20
+ }
21
+ export interface FPEnvelopeMeta extends FPEnvelope<DbMetaEvent[]> {
22
+ readonly type: typeof FPEnvelopeTypes.META;
23
+ }
24
+ export interface FPWALCarsOps {
25
+ readonly cars: CID[];
26
+ }
27
+ export interface FPEnvelopeWAL extends FPEnvelope<WALState> {
28
+ readonly type: typeof FPEnvelopeTypes.WAL;
29
+ }
30
+ export declare function Car2FPMsg(fpcar: Uint8Array): Result<FPEnvelopeCar>;
31
+ export declare function File2FPMsg(fpfile: Uint8Array): Result<FPEnvelopeFile>;
32
+ //# sourceMappingURL=fp-envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fp-envelope.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/fp-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,eAAO,MAAM,eAAe;;;;;CAKlB,CAAC;AAWX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AASpF,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACrB;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU,CAAC,UAAU,CAAC;IAC3D,QAAQ,CAAC,IAAI,EAAE,OAAO,eAAe,CAAC,GAAG,CAAC;CAC3C;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU,CAAC,UAAU,CAAC;IAC5D,QAAQ,CAAC,IAAI,EAAE,OAAO,eAAe,CAAC,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU,CAAC,WAAW,EAAE,CAAC;IAC/D,QAAQ,CAAC,IAAI,EAAE,OAAO,eAAe,CAAC,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC;CACtB;AAMD,MAAM,WAAW,aAAc,SAAQ,UAAU,CAAC,QAAQ,CAAC;IACzD,QAAQ,CAAC,IAAI,EAAE,OAAO,eAAe,CAAC,GAAG,CAAC;CAC3C;AAmDD,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAElE;AAUD,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC,CAErE"}
@@ -0,0 +1,14 @@
1
+ import { Result } from "@adviser/cement";
2
+ export const FPEnvelopeTypes = {
3
+ CAR: "car",
4
+ FILE: "file",
5
+ META: "meta",
6
+ WAL: "wal",
7
+ };
8
+ export function Car2FPMsg(fpcar) {
9
+ return Result.Ok({ type: FPEnvelopeTypes.CAR, payload: fpcar });
10
+ }
11
+ export function File2FPMsg(fpfile) {
12
+ return Result.Ok({ type: FPEnvelopeTypes.FILE, payload: fpfile });
13
+ }
14
+ //# sourceMappingURL=fp-envelope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fp-envelope.js","sourceRoot":"","sources":["../../../../src/blockstore/fp-envelope.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;CACF,CAAC;AAkGX,MAAM,UAAU,SAAS,CAAC,KAAiB;IACzC,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAClE,CAAC;AAUD,MAAM,UAAU,UAAU,CAAC,MAAkB;IAC3C,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Result, URI } from "@adviser/cement";
2
+ import type { NotFoundError } from "../utils.js";
3
+ import type { UnsubscribeResult, VoidResult } from "./serde-gateway.js";
4
+ import type { SuperThis } from "../types.js";
5
+ export interface GatewayOpts {
6
+ readonly gateway: Gateway;
7
+ }
8
+ export type GetResult = Result<Uint8Array, NotFoundError | Error>;
9
+ export interface Gateway {
10
+ buildUrl(baseUrl: URI, key: string, sthis: SuperThis): Promise<Result<URI>>;
11
+ start(baseUrl: URI, sthis: SuperThis): Promise<Result<URI>>;
12
+ close(baseUrl: URI, sthis: SuperThis): Promise<VoidResult>;
13
+ destroy(baseUrl: URI, sthis: SuperThis): Promise<VoidResult>;
14
+ put(url: URI, body: Uint8Array, sthis: SuperThis): Promise<VoidResult>;
15
+ get(url: URI, sthis: SuperThis): Promise<GetResult>;
16
+ delete(url: URI, sthis: SuperThis): Promise<VoidResult>;
17
+ subscribe?(url: URI, callback: (meta: Uint8Array) => void, sthis: SuperThis): Promise<UnsubscribeResult>;
18
+ getPlain(url: URI, key: string, sthis: SuperThis): Promise<Result<Uint8Array>>;
19
+ }
20
+ //# sourceMappingURL=gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,EAAE,aAAa,GAAG,KAAK,CAAC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/gateway.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ export * from "./types.js";
2
+ export * from "./store-factory.js";
3
+ export * from "./serde-gateway.js";
4
+ export * from "./gateway.js";
5
+ export * from "./fp-envelope.js";
6
+ export * from "./store-factory.js";
7
+ export * from "./interceptor-gateway.js";
8
+ export { createDbMetaEvent } from "./store.js";
9
+ export * from "./register-store-protocol.js";
10
+ export * from "./attachable-store.js";
11
+ export * from "./task-manager.js";
12
+ export * from "./uri-interceptor.js";
13
+ export { EncryptedBlockstore, BaseBlockstoreImpl, CompactionFetcher, type BlockFetcher, CarTransactionImpl, type CarTransactionOpts, } from "./transaction.js";
14
+ export { Loader } from "./loader.js";
15
+ export { parseCarFile } from "./loader-helpers.js";
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAE3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAE7B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,cAAc,8BAA8B,CAAC;AAE7C,cAAc,uBAAuB,CAAC;AAEtC,cAAc,mBAAmB,CAAC;AAElC,cAAc,sBAAsB,CAAC;AAErC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export * from "./types.js";
2
+ export * from "./store-factory.js";
3
+ export * from "./serde-gateway.js";
4
+ export * from "./gateway.js";
5
+ export * from "./fp-envelope.js";
6
+ export * from "./store-factory.js";
7
+ export * from "./interceptor-gateway.js";
8
+ export { createDbMetaEvent } from "./store.js";
9
+ export * from "./register-store-protocol.js";
10
+ export * from "./attachable-store.js";
11
+ export * from "./task-manager.js";
12
+ export * from "./uri-interceptor.js";
13
+ export { EncryptedBlockstore, BaseBlockstoreImpl, CompactionFetcher, CarTransactionImpl, } from "./transaction.js";
14
+ export { Loader } from "./loader.js";
15
+ export { parseCarFile } from "./loader-helpers.js";
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/blockstore/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAE3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAE7B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,cAAc,8BAA8B,CAAC;AAE7C,cAAc,uBAAuB,CAAC;AAEtC,cAAc,mBAAmB,CAAC;AAElC,cAAc,sBAAsB,CAAC;AAErC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAEjB,kBAAkB,GAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { Result, URI } from "@adviser/cement";
2
+ import type { SerdeGateway, SerdeGatewayBuildUrlReturn, SerdeGatewayCloseReturn, SerdeGatewayCtx, SerdeGatewayDeleteReturn, SerdeGatewayDestroyReturn, SerdeGatewayGetReturn, SerdeGatewayInterceptor, SerdeGatewayPutReturn, SerdeGatewayStartReturn, SerdeGatewaySubscribeReturn, SerdeGetResult, UnsubscribeResult, VoidResult } from "./serde-gateway.js";
3
+ import type { SuperThis } from "../types.js";
4
+ import { FPEnvelope, FPEnvelopeMeta } from "./fp-envelope.js";
5
+ export declare class PassThroughGateway implements SerdeGatewayInterceptor {
6
+ buildUrl(ctx: SerdeGatewayCtx, url: URI, key: string): Promise<Result<SerdeGatewayBuildUrlReturn>>;
7
+ start(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayStartReturn>>;
8
+ close(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayCloseReturn>>;
9
+ delete(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayDeleteReturn>>;
10
+ destroy(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayDestroyReturn>>;
11
+ put<T>(ctx: SerdeGatewayCtx, url: URI, body: FPEnvelope<T>): Promise<Result<SerdeGatewayPutReturn<T>>>;
12
+ get<S>(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayGetReturn<S>>>;
13
+ subscribe(ctx: SerdeGatewayCtx, url: URI, callback: (meta: FPEnvelopeMeta) => Promise<void>): Promise<Result<SerdeGatewaySubscribeReturn>>;
14
+ }
15
+ export declare class InterceptorGateway implements SerdeGateway {
16
+ readonly innerGW: SerdeGateway;
17
+ readonly interceptor: SerdeGatewayInterceptor;
18
+ constructor(sthis: SuperThis, innerGW: SerdeGateway, interceptor: SerdeGatewayInterceptor | undefined);
19
+ buildUrl(ctx: SerdeGatewayCtx, baseUrl: URI, key: string): Promise<Result<URI>>;
20
+ destroy(ctx: SerdeGatewayCtx, iurl: URI): Promise<Result<void>>;
21
+ start(ctx: SerdeGatewayCtx, url: URI): Promise<Result<URI>>;
22
+ close(ctx: SerdeGatewayCtx, url: URI): Promise<VoidResult>;
23
+ put<T>(ctx: SerdeGatewayCtx, url: URI, fpEnv: FPEnvelope<T>): Promise<VoidResult>;
24
+ get<S>(ctx: SerdeGatewayCtx, url: URI): Promise<SerdeGetResult<S>>;
25
+ subscribe(ctx: SerdeGatewayCtx, url: URI, callback: (msg: FPEnvelopeMeta) => Promise<void>): Promise<UnsubscribeResult>;
26
+ delete(ctx: SerdeGatewayCtx, url: URI): Promise<VoidResult>;
27
+ getPlain(ctx: SerdeGatewayCtx, url: URI, key: string): Promise<Result<Uint8Array>>;
28
+ }
29
+ //# sourceMappingURL=interceptor-gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interceptor-gateway.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/interceptor-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EACV,YAAY,EACZ,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,UAAU,EACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE9D,qBAAa,kBAAmB,YAAW,uBAAuB;IAC1D,QAAQ,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;IAIlG,KAAK,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAI/E,KAAK,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAI/E,MAAM,CAAC,GAAG,EAAE,eAAe,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C,MAAM,CAAC,GAAG,CAAC,CAAC;IAY3D,KAAK,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC;IAY1D,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAYjF,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAYlE,SAAS,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAevH,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC;IAY3D,QAAQ,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;CAGzF"}
@@ -0,0 +1,137 @@
1
+ import { Result } from "@adviser/cement";
2
+ export class PassThroughGateway {
3
+ async buildUrl(ctx, url, key) {
4
+ const op = { url, key };
5
+ return Result.Ok({ op });
6
+ }
7
+ async start(ctx, url) {
8
+ const op = { url };
9
+ return Result.Ok({ op });
10
+ }
11
+ async close(ctx, url) {
12
+ const op = { url };
13
+ return Result.Ok({ op });
14
+ }
15
+ async delete(ctx, url) {
16
+ const op = { url };
17
+ return Result.Ok({ op });
18
+ }
19
+ async destroy(ctx, url) {
20
+ const op = { url };
21
+ return Result.Ok({ op });
22
+ }
23
+ async put(ctx, url, body) {
24
+ const op = { url, body };
25
+ return Result.Ok({ op });
26
+ }
27
+ async get(ctx, url) {
28
+ const op = { url };
29
+ return Result.Ok({ op });
30
+ }
31
+ async subscribe(ctx, url, callback) {
32
+ const op = { url, callback };
33
+ return Result.Ok({ op });
34
+ }
35
+ }
36
+ const passThrougthGateway = new PassThroughGateway();
37
+ export class InterceptorGateway {
38
+ constructor(sthis, innerGW, interceptor) {
39
+ this.innerGW = innerGW;
40
+ this.interceptor = interceptor || passThrougthGateway;
41
+ }
42
+ async buildUrl(ctx, baseUrl, key) {
43
+ const rret = await this.interceptor.buildUrl(ctx, baseUrl, key);
44
+ if (rret.isErr()) {
45
+ return Result.Err(rret.Err());
46
+ }
47
+ const ret = rret.unwrap();
48
+ if (ret.stop && ret.value) {
49
+ return ret.value;
50
+ }
51
+ return this.innerGW.buildUrl(ctx, ret.op.url, ret.op.key);
52
+ }
53
+ async destroy(ctx, iurl) {
54
+ const rret = await this.interceptor.destroy(ctx, iurl);
55
+ if (rret.isErr()) {
56
+ return Result.Err(rret.Err());
57
+ }
58
+ const ret = rret.unwrap();
59
+ if (ret.stop && ret.value) {
60
+ return ret.value;
61
+ }
62
+ return this.innerGW.destroy(ctx, ret.op.url);
63
+ }
64
+ async start(ctx, url) {
65
+ const rret = await this.interceptor.start(ctx, url);
66
+ if (rret.isErr()) {
67
+ return Result.Err(rret.Err());
68
+ }
69
+ const ret = rret.unwrap();
70
+ if (ret.stop && ret.value) {
71
+ return ret.value;
72
+ }
73
+ return await this.innerGW.start(ctx, ret.op.url);
74
+ }
75
+ async close(ctx, url) {
76
+ const rret = await this.interceptor.close(ctx, url);
77
+ if (rret.isErr()) {
78
+ return Result.Err(rret.Err());
79
+ }
80
+ const ret = rret.unwrap();
81
+ if (ret.stop && ret.value) {
82
+ return ret.value;
83
+ }
84
+ return await this.innerGW.close(ctx, ret.op.url);
85
+ }
86
+ async put(ctx, url, fpEnv) {
87
+ const rret = await this.interceptor.put(ctx, url, fpEnv);
88
+ if (rret.isErr()) {
89
+ return Result.Err(rret.Err());
90
+ }
91
+ const ret = rret.unwrap();
92
+ if (ret.stop && ret.value) {
93
+ return ret.value;
94
+ }
95
+ return this.innerGW.put(ctx, ret.op.url, ret.op.body);
96
+ }
97
+ async get(ctx, url) {
98
+ const rret = await this.interceptor.get(ctx, url);
99
+ if (rret.isErr()) {
100
+ return Result.Err(rret.Err());
101
+ }
102
+ const ret = rret.unwrap();
103
+ if (ret.stop && ret.value) {
104
+ return ret.value;
105
+ }
106
+ return this.innerGW.get(ctx, ret.op.url);
107
+ }
108
+ async subscribe(ctx, url, callback) {
109
+ if (!this.innerGW.subscribe) {
110
+ return Result.Err(ctx.loader.sthis.logger.Error().Url(url).Msg("subscribe not supported").AsError());
111
+ }
112
+ const rret = await this.interceptor.subscribe(ctx, url, callback);
113
+ if (rret.isErr()) {
114
+ return Result.Err(rret.Err());
115
+ }
116
+ const ret = rret.unwrap();
117
+ if (ret.stop && ret.value) {
118
+ return ret.value;
119
+ }
120
+ return this.innerGW.subscribe(ctx, ret.op.url, ret.op.callback);
121
+ }
122
+ async delete(ctx, url) {
123
+ const rret = await this.interceptor.delete(ctx, url);
124
+ if (rret.isErr()) {
125
+ return Result.Err(rret.Err());
126
+ }
127
+ const ret = rret.unwrap();
128
+ if (ret.stop && ret.value) {
129
+ return ret.value;
130
+ }
131
+ return this.innerGW.delete(ctx, url);
132
+ }
133
+ async getPlain(ctx, url, key) {
134
+ return this.innerGW.getPlain(ctx, url, key);
135
+ }
136
+ }
137
+ //# sourceMappingURL=interceptor-gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interceptor-gateway.js","sourceRoot":"","sources":["../../../../src/blockstore/interceptor-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,iBAAiB,CAAC;AAoB9C,MAAM,OAAO,kBAAkB;IAC7B,KAAK,CAAC,QAAQ,CAAC,GAAoB,EAAE,GAAQ,EAAE,GAAW;QACxD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;QACxB,OAAO,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C,KAAK,EAAE,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAChC,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC1B,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;YAC1B,OAAO,GAAG,CAAC,KAAK,CAAC;QACnB,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,GAAoB,EAAE,GAAQ,EAAE,GAAW;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ import type { Logger } from "@adviser/cement";
2
+ import { CarCacheItem, CarHeader } from "./types.js";
3
+ export declare function parseCarFile<T>(reader: CarCacheItem, logger: Logger): Promise<CarHeader<T>>;
4
+ //# sourceMappingURL=loader-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader-helpers.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/loader-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAwBrD,wBAAsB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CA2BjG"}
@@ -0,0 +1,16 @@
1
+ import { decode } from "../runtime/wait-pr-multiformats/block.js";
2
+ import { sha256 as hasher } from "multiformats/hashes/sha2";
3
+ import * as dagCodec from "@ipld/dag-cbor";
4
+ export async function parseCarFile(reader, logger) {
5
+ const roots = await reader.roots;
6
+ const header = reader.blocks.find((i) => i.cid.equals(roots[0]));
7
+ if (!header)
8
+ throw logger.Error().Msg("missing header block").AsError();
9
+ const dec = await decode({ bytes: header.bytes, hasher, codec: dagCodec });
10
+ const fpvalue = dec.value;
11
+ if (fpvalue && !fpvalue.fp) {
12
+ throw logger.Error().Msg("missing fp").AsError();
13
+ }
14
+ return fpvalue.fp;
15
+ }
16
+ //# sourceMappingURL=loader-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader-helpers.js","sourceRoot":"","sources":["../../../../src/blockstore/loader-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AA2B3C,MAAM,CAAC,KAAK,UAAU,YAAY,CAAI,MAAoB,EAAE,MAAc;IACxE,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;IACjC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,IAAI,CAAC,MAAM;QAAE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,OAAO,EAAE,CAAC;IACxE,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAiB3E,MAAM,OAAO,GAAG,GAAG,CAAC,KAAsB,CAAC;IAE3C,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;IACnD,CAAC;IACD,OAAO,OAAO,CAAC,EAAE,CAAC;AACpB,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { Logger, LRUSet } from "@adviser/cement";
2
+ import { type AnyBlock, type AnyLink, type CarHeader, type CommitOpts, type TransactionMeta, type CarGroup, type Loadable, BlockstoreRuntime, BlockstoreOpts, AttachedStores, ActiveStore, CIDActiveStore, CarCacheItem, CarLog, FroozenCarLog } from "./types.js";
3
+ import { CommitQueue } from "./commit-queue.js";
4
+ import { type Attachable, type Attached, type CarTransaction, type DbMeta, type Falsy, type SuperThis } from "../types.js";
5
+ import { KeyBag } from "../runtime/key-bag.js";
6
+ import { TaskManager } from "./task-manager.js";
7
+ export declare function carLogIncludesGroup(list: FroozenCarLog, cids: CarGroup): boolean;
8
+ export declare class Loader implements Loadable {
9
+ readonly ebOpts: BlockstoreRuntime;
10
+ readonly logger: Logger;
11
+ readonly commitQueue: CommitQueue<CarGroup>;
12
+ isCompacting: boolean;
13
+ private readonly cidCache;
14
+ private readonly maxConcurrentCarReader;
15
+ private readonly maxConcurrentWrite;
16
+ readonly seenCompacted: LRUSet<string>;
17
+ readonly sthis: SuperThis;
18
+ readonly taskManager: TaskManager;
19
+ readonly carLog: CarLog;
20
+ readonly attachedStores: AttachedStores;
21
+ attach(attached: Attachable): Promise<Attached>;
22
+ private seenMeta;
23
+ keyBag(): Promise<KeyBag>;
24
+ private readonly onceReady;
25
+ ready(): Promise<void>;
26
+ close(): Promise<void>;
27
+ destroy(): Promise<void>;
28
+ constructor(sthis: SuperThis, ebOpts: BlockstoreOpts);
29
+ handleDbMetasFromStore(metas: DbMeta[], activeStore: ActiveStore): Promise<void>;
30
+ mergeDbMetaIntoClock(meta: DbMeta, activeStore: ActiveStore): Promise<void>;
31
+ loadCarHeaderFromMeta<T>(dbm: DbMeta, astore: ActiveStore): Promise<CarHeader<T>>;
32
+ commitFiles(t: CarTransaction, done: TransactionMeta): Promise<CarGroup>;
33
+ loadFileCar(cid: AnyLink, store: ActiveStore): Promise<CarCacheItem>;
34
+ commit<T = TransactionMeta>(t: CarTransaction, done: T, opts?: CommitOpts): Promise<CarGroup>;
35
+ updateCarLog<T>(cids: CarGroup, cHeader: CarHeader<T>, compact: boolean): Promise<void>;
36
+ cacheTransaction(t: CarTransaction): Promise<void>;
37
+ removeCidsForCompact(cid: AnyLink, store: ActiveStore): Promise<void>;
38
+ entries(): AsyncIterableIterator<AnyBlock>;
39
+ getBlock(cid: AnyLink, store: ActiveStore): Promise<AnyBlock | Falsy>;
40
+ loadCar(cid: AnyLink, store: ActiveStore): Promise<CarCacheItem>;
41
+ private makeDecoderAndCarReader;
42
+ protected storesLoadCar(carCid: AnyLink, store: CIDActiveStore): Promise<CarCacheItem>;
43
+ protected getMoreReaders(cids: AnyLink[], store: ActiveStore): Promise<void>;
44
+ }
45
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/loader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,MAAM,EAAE,MAAM,EAAe,MAAM,iBAAiB,CAAC;AAG/E,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,WAAW,EAEX,cAAc,EACd,YAAY,EACZ,MAAM,EACN,aAAa,EAEd,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAa,MAAM,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