@fireproof/core 0.20.5-dev-preview-1 → 0.20.5-dev-preview-3

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 (437) 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 +19 -0
  6. package/blockstore/attachable-store.d.ts.map +1 -0
  7. package/blockstore/attachable-store.js +316 -0
  8. package/blockstore/attachable-store.js.map +1 -0
  9. package/blockstore/commit-queue.d.ts +17 -0
  10. package/blockstore/commit-queue.d.ts.map +1 -0
  11. package/blockstore/commit-queue.js +60 -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 +95 -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 +10 -0
  46. package/blockstore/loader-helpers.d.ts.map +1 -0
  47. package/blockstore/loader-helpers.js +115 -0
  48. package/blockstore/loader-helpers.js.map +1 -0
  49. package/blockstore/loader.d.ts +61 -0
  50. package/blockstore/loader.d.ts.map +1 -0
  51. package/blockstore/loader.js +494 -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 +104 -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 +86 -0
  70. package/blockstore/store.d.ts.map +1 -0
  71. package/blockstore/store.js +439 -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 +62 -0
  78. package/blockstore/transaction.d.ts.map +1 -0
  79. package/blockstore/transaction.js +261 -0
  80. package/blockstore/transaction.js.map +1 -0
  81. package/blockstore/types.d.ts +508 -0
  82. package/blockstore/types.d.ts.map +1 -0
  83. package/blockstore/types.js +83 -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 +26616 -0
  94. package/crdt-clock.d.ts +27 -0
  95. package/crdt-clock.d.ts.map +1 -0
  96. package/crdt-clock.js +138 -0
  97. package/crdt-clock.js.map +1 -0
  98. package/crdt-helpers.d.ts +19 -0
  99. package/crdt-helpers.d.ts.map +1 -0
  100. package/crdt-helpers.js +332 -0
  101. package/crdt-helpers.js.map +1 -0
  102. package/crdt.d.ts +41 -0
  103. package/crdt.d.ts.map +1 -0
  104. package/crdt.js +164 -0
  105. package/crdt.js.map +1 -0
  106. package/database.d.ts +34 -0
  107. package/database.d.ts.map +1 -0
  108. package/database.js +124 -0
  109. package/database.js.map +1 -0
  110. package/deno.json +2 -2
  111. package/index.d.ts +15 -2741
  112. package/index.d.ts.map +1 -0
  113. package/index.js +14 -7274
  114. package/index.js.map +1 -1
  115. package/indexer-helpers.d.ts +69 -0
  116. package/indexer-helpers.d.ts.map +1 -0
  117. package/indexer-helpers.js +136 -0
  118. package/indexer-helpers.js.map +1 -0
  119. package/indexer.d.ts +24 -0
  120. package/indexer.d.ts.map +1 -0
  121. package/indexer.js +230 -0
  122. package/indexer.js.map +1 -0
  123. package/ledger.d.ts +55 -0
  124. package/ledger.d.ts.map +1 -0
  125. package/ledger.js +234 -0
  126. package/ledger.js.map +1 -0
  127. package/package.json +26 -17
  128. package/protocols/cloud/http-connection.d.ts +25 -0
  129. package/protocols/cloud/http-connection.d.ts.map +1 -0
  130. package/protocols/cloud/http-connection.js +153 -0
  131. package/protocols/cloud/http-connection.js.map +1 -0
  132. package/protocols/cloud/index.d.ts +10 -0
  133. package/protocols/cloud/index.d.ts.map +1 -0
  134. package/protocols/cloud/index.js +10 -0
  135. package/protocols/cloud/index.js.map +1 -0
  136. package/protocols/cloud/msg-raw-connection-base.d.ts +16 -0
  137. package/protocols/cloud/msg-raw-connection-base.d.ts.map +1 -0
  138. package/protocols/cloud/msg-raw-connection-base.js +22 -0
  139. package/protocols/cloud/msg-raw-connection-base.js.map +1 -0
  140. package/protocols/cloud/msg-types-data.d.ts +36 -0
  141. package/protocols/cloud/msg-types-data.d.ts.map +1 -0
  142. package/protocols/cloud/msg-types-data.js +38 -0
  143. package/protocols/cloud/msg-types-data.js.map +1 -0
  144. package/protocols/cloud/msg-types-meta.d.ts +41 -0
  145. package/protocols/cloud/msg-types-meta.d.ts.map +1 -0
  146. package/protocols/cloud/msg-types-meta.js +98 -0
  147. package/protocols/cloud/msg-types-meta.js.map +1 -0
  148. package/protocols/cloud/msg-types-wal.d.ts +33 -0
  149. package/protocols/cloud/msg-types-wal.d.ts.map +1 -0
  150. package/protocols/cloud/msg-types-wal.js +38 -0
  151. package/protocols/cloud/msg-types-wal.js.map +1 -0
  152. package/protocols/cloud/msg-types.d.ts +282 -0
  153. package/protocols/cloud/msg-types.d.ts.map +1 -0
  154. package/protocols/cloud/msg-types.js +278 -0
  155. package/protocols/cloud/msg-types.js.map +1 -0
  156. package/protocols/cloud/msger.d.ts +79 -0
  157. package/protocols/cloud/msger.d.ts.map +1 -0
  158. package/protocols/cloud/msger.js +198 -0
  159. package/protocols/cloud/msger.js.map +1 -0
  160. package/protocols/cloud/ws-connection.d.ts +29 -0
  161. package/protocols/cloud/ws-connection.d.ts.map +1 -0
  162. package/protocols/cloud/ws-connection.js +166 -0
  163. package/protocols/cloud/ws-connection.js.map +1 -0
  164. package/protocols/index.d.ts +2 -0
  165. package/protocols/index.d.ts.map +1 -0
  166. package/protocols/index.js +2 -0
  167. package/protocols/index.js.map +1 -0
  168. package/react/create-attach.d.ts +6 -0
  169. package/react/create-attach.d.ts.map +1 -0
  170. package/react/create-attach.js +75 -0
  171. package/react/create-attach.js.map +1 -0
  172. package/react/{index.d.cts → img-file.d.ts} +6 -53
  173. package/react/img-file.d.ts.map +1 -0
  174. package/react/img-file.js +57 -0
  175. package/react/img-file.js.map +1 -0
  176. package/react/index.d.ts +5 -336
  177. package/react/index.d.ts.map +1 -0
  178. package/react/index.js +4 -358
  179. package/react/index.js.map +1 -1
  180. package/react/types.d.ts +71 -0
  181. package/react/types.d.ts.map +1 -0
  182. package/react/types.js +2 -0
  183. package/react/types.js.map +1 -0
  184. package/react/use-all-docs.d.ts +4 -0
  185. package/react/use-all-docs.d.ts.map +1 -0
  186. package/react/use-all-docs.js +25 -0
  187. package/react/use-all-docs.js.map +1 -0
  188. package/react/use-attach.d.ts +6 -0
  189. package/react/use-attach.d.ts.map +1 -0
  190. package/react/use-attach.js +75 -0
  191. package/react/use-attach.js.map +1 -0
  192. package/react/use-changes.d.ts +4 -0
  193. package/react/use-changes.d.ts.map +1 -0
  194. package/react/use-changes.js +19 -0
  195. package/react/use-changes.js.map +1 -0
  196. package/react/use-document.d.ts +4 -0
  197. package/react/use-document.d.ts.map +1 -0
  198. package/react/use-document.js +109 -0
  199. package/react/use-document.js.map +1 -0
  200. package/react/use-fireproof.d.ts +6 -0
  201. package/react/use-fireproof.d.ts.map +1 -0
  202. package/react/use-fireproof.js +20 -0
  203. package/react/use-fireproof.js.map +1 -0
  204. package/react/use-live-query.d.ts +4 -0
  205. package/react/use-live-query.d.ts.map +1 -0
  206. package/react/use-live-query.js +27 -0
  207. package/react/use-live-query.js.map +1 -0
  208. package/runtime/files.d.ts +12 -0
  209. package/runtime/files.d.ts.map +1 -0
  210. package/runtime/files.js +29 -0
  211. package/runtime/files.js.map +1 -0
  212. package/runtime/gateways/cloud/gateway.d.ts +42 -0
  213. package/runtime/gateways/cloud/gateway.d.ts.map +1 -0
  214. package/runtime/gateways/cloud/gateway.js +528 -0
  215. package/runtime/gateways/cloud/gateway.js.map +1 -0
  216. package/runtime/gateways/cloud/index.d.ts +3 -0
  217. package/runtime/gateways/cloud/index.d.ts.map +1 -0
  218. package/runtime/gateways/cloud/index.js +3 -0
  219. package/runtime/gateways/cloud/index.js.map +1 -0
  220. package/runtime/gateways/cloud/to-cloud.d.ts +46 -0
  221. package/runtime/gateways/cloud/to-cloud.d.ts.map +1 -0
  222. package/runtime/gateways/cloud/to-cloud.js +159 -0
  223. package/runtime/gateways/cloud/to-cloud.js.map +1 -0
  224. package/runtime/gateways/def-serde-gateway.d.ts +18 -0
  225. package/runtime/gateways/def-serde-gateway.d.ts.map +1 -0
  226. package/runtime/gateways/def-serde-gateway.js +89 -0
  227. package/runtime/gateways/def-serde-gateway.js.map +1 -0
  228. package/runtime/gateways/file/deno/deno-filesystem.d.ts +27 -0
  229. package/runtime/gateways/file/deno/deno-filesystem.d.ts.map +1 -0
  230. package/runtime/gateways/file/deno/deno-filesystem.js +52 -0
  231. package/runtime/gateways/file/deno/deno-filesystem.js.map +1 -0
  232. package/runtime/gateways/file/deno/get-sys-file-system.d.ts +4 -0
  233. package/runtime/gateways/file/deno/get-sys-file-system.d.ts.map +1 -0
  234. package/runtime/gateways/file/deno/get-sys-file-system.js +11 -0
  235. package/runtime/gateways/file/deno/get-sys-file-system.js.map +1 -0
  236. package/runtime/gateways/file/deno/index.d.ts +2 -0
  237. package/runtime/gateways/file/deno/index.d.ts.map +1 -0
  238. package/runtime/gateways/file/deno/index.js +2 -0
  239. package/runtime/gateways/file/deno/index.js.map +1 -0
  240. package/runtime/gateways/file/gateway-impl.d.ts +18 -0
  241. package/runtime/gateways/file/gateway-impl.d.ts.map +1 -0
  242. package/runtime/gateways/file/gateway-impl.js +121 -0
  243. package/runtime/gateways/file/gateway-impl.js.map +1 -0
  244. package/runtime/gateways/file/index.d.ts +3 -0
  245. package/runtime/gateways/file/index.d.ts.map +1 -0
  246. package/runtime/gateways/file/index.js +3 -0
  247. package/runtime/gateways/file/index.js.map +1 -0
  248. package/runtime/gateways/file/key-bag-file.d.ts +19 -0
  249. package/runtime/gateways/file/key-bag-file.d.ts.map +1 -0
  250. package/runtime/gateways/file/key-bag-file.js +40 -0
  251. package/runtime/gateways/file/key-bag-file.js.map +1 -0
  252. package/runtime/gateways/file/node/get-sys-file-system.d.ts +4 -0
  253. package/runtime/gateways/file/node/get-sys-file-system.d.ts.map +1 -0
  254. package/runtime/gateways/file/node/get-sys-file-system.js +11 -0
  255. package/runtime/gateways/file/node/get-sys-file-system.js.map +1 -0
  256. package/runtime/gateways/file/node/index.d.ts +2 -0
  257. package/runtime/gateways/file/node/index.d.ts.map +1 -0
  258. package/runtime/gateways/file/node/index.js +2 -0
  259. package/runtime/gateways/file/node/index.js.map +1 -0
  260. package/runtime/gateways/file/node/node-filesystem.d.ts +32 -0
  261. package/runtime/gateways/file/node/node-filesystem.d.ts.map +1 -0
  262. package/runtime/gateways/file/node/node-filesystem.js +33 -0
  263. package/runtime/gateways/file/node/node-filesystem.js.map +1 -0
  264. package/runtime/gateways/file/node/to-array-buffer.d.ts +2 -0
  265. package/runtime/gateways/file/node/to-array-buffer.d.ts.map +1 -0
  266. package/runtime/gateways/file/node/to-array-buffer.js +12 -0
  267. package/runtime/gateways/file/node/to-array-buffer.js.map +1 -0
  268. package/runtime/gateways/file/sys-file-system-factory.d.ts +4 -0
  269. package/runtime/gateways/file/sys-file-system-factory.d.ts.map +1 -0
  270. package/runtime/gateways/file/sys-file-system-factory.js +13 -0
  271. package/runtime/gateways/file/sys-file-system-factory.js.map +1 -0
  272. package/runtime/gateways/file/utils.d.ts +5 -0
  273. package/runtime/gateways/file/utils.d.ts.map +1 -0
  274. package/runtime/gateways/file/utils.js +27 -0
  275. package/runtime/gateways/file/utils.js.map +1 -0
  276. package/runtime/gateways/file/version.d.ts +2 -0
  277. package/runtime/gateways/file/version.d.ts.map +1 -0
  278. package/runtime/gateways/file/version.js +2 -0
  279. package/runtime/gateways/file/version.js.map +1 -0
  280. package/runtime/gateways/fp-envelope-serialize.d.ts +50 -0
  281. package/runtime/gateways/fp-envelope-serialize.d.ts.map +1 -0
  282. package/runtime/gateways/fp-envelope-serialize.js +141 -0
  283. package/runtime/gateways/fp-envelope-serialize.js.map +1 -0
  284. package/runtime/gateways/index.d.ts +6 -0
  285. package/runtime/gateways/index.d.ts.map +1 -0
  286. package/runtime/gateways/index.js +6 -0
  287. package/runtime/gateways/index.js.map +1 -0
  288. package/runtime/gateways/indexeddb/gateway-impl.d.ts +22 -0
  289. package/runtime/gateways/indexeddb/gateway-impl.d.ts.map +1 -0
  290. package/runtime/gateways/indexeddb/gateway-impl.js +147 -0
  291. package/runtime/gateways/indexeddb/gateway-impl.js.map +1 -0
  292. package/runtime/gateways/indexeddb/index.d.ts +6 -0
  293. package/runtime/gateways/indexeddb/index.d.ts.map +1 -0
  294. package/runtime/gateways/indexeddb/index.js +6 -0
  295. package/runtime/gateways/indexeddb/index.js.map +1 -0
  296. package/runtime/gateways/indexeddb/key-bag-indexeddb.d.ts +15 -0
  297. package/runtime/gateways/indexeddb/key-bag-indexeddb.d.ts.map +1 -0
  298. package/runtime/gateways/indexeddb/key-bag-indexeddb.js +42 -0
  299. package/runtime/gateways/indexeddb/key-bag-indexeddb.js.map +1 -0
  300. package/runtime/gateways/indexeddb-version.d.ts +2 -0
  301. package/runtime/gateways/indexeddb-version.d.ts.map +1 -0
  302. package/runtime/gateways/indexeddb-version.js +2 -0
  303. package/runtime/gateways/indexeddb-version.js.map +1 -0
  304. package/runtime/gateways/memory/gateway.d.ts +18 -0
  305. package/runtime/gateways/memory/gateway.d.ts.map +1 -0
  306. package/runtime/gateways/memory/gateway.js +73 -0
  307. package/runtime/gateways/memory/gateway.js.map +1 -0
  308. package/runtime/gateways/memory/version.d.ts +2 -0
  309. package/runtime/gateways/memory/version.d.ts.map +1 -0
  310. package/runtime/gateways/memory/version.js +2 -0
  311. package/runtime/gateways/memory/version.js.map +1 -0
  312. package/runtime/index.d.ts +13 -0
  313. package/runtime/index.d.ts.map +1 -0
  314. package/runtime/index.js +13 -0
  315. package/runtime/index.js.map +1 -0
  316. package/runtime/key-bag-memory.d.ts +12 -0
  317. package/runtime/key-bag-memory.d.ts.map +1 -0
  318. package/runtime/key-bag-memory.js +23 -0
  319. package/runtime/key-bag-memory.js.map +1 -0
  320. package/runtime/key-bag.d.ts +85 -0
  321. package/runtime/key-bag.d.ts.map +1 -0
  322. package/runtime/key-bag.js +411 -0
  323. package/runtime/key-bag.js.map +1 -0
  324. package/runtime/keyed-crypto.d.ts +19 -0
  325. package/runtime/keyed-crypto.d.ts.map +1 -0
  326. package/runtime/keyed-crypto.js +192 -0
  327. package/runtime/keyed-crypto.js.map +1 -0
  328. package/runtime/memory-sys-container.d.ts +2 -0
  329. package/runtime/memory-sys-container.d.ts.map +1 -0
  330. package/runtime/memory-sys-container.js +2 -0
  331. package/runtime/memory-sys-container.js.map +1 -0
  332. package/runtime/meta-key-hack.d.ts +42 -0
  333. package/runtime/meta-key-hack.d.ts.map +1 -0
  334. package/runtime/meta-key-hack.js +201 -0
  335. package/runtime/meta-key-hack.js.map +1 -0
  336. package/runtime/sts-service/index.d.ts +40 -0
  337. package/runtime/sts-service/index.d.ts.map +1 -0
  338. package/runtime/sts-service/index.js +102 -0
  339. package/runtime/sts-service/index.js.map +1 -0
  340. package/runtime/sys-container.d.ts +2 -0
  341. package/runtime/sys-container.d.ts.map +1 -0
  342. package/runtime/sys-container.js +2 -0
  343. package/runtime/sys-container.js.map +1 -0
  344. package/runtime/wait-pr-multiformats/block.d.ts +47 -0
  345. package/runtime/wait-pr-multiformats/block.d.ts.map +1 -0
  346. package/runtime/wait-pr-multiformats/block.js +64 -0
  347. package/runtime/wait-pr-multiformats/block.js.map +1 -0
  348. package/runtime/wait-pr-multiformats/codec-interface.d.ts +29 -0
  349. package/runtime/wait-pr-multiformats/codec-interface.d.ts.map +1 -0
  350. package/runtime/wait-pr-multiformats/codec-interface.js +2 -0
  351. package/runtime/wait-pr-multiformats/codec-interface.js.map +1 -0
  352. package/runtime/wait-pr-multiformats/index.d.ts +3 -0
  353. package/runtime/wait-pr-multiformats/index.d.ts.map +1 -0
  354. package/runtime/wait-pr-multiformats/index.js +3 -0
  355. package/runtime/wait-pr-multiformats/index.js.map +1 -0
  356. package/tests/blockstore/interceptor-gateway.test.ts +10 -9
  357. package/tests/blockstore/keyed-crypto.test.ts +2 -2
  358. package/tests/blockstore/loader.test.ts +68 -51
  359. package/tests/blockstore/standalone.test.ts +152 -0
  360. package/tests/blockstore/store.test.ts +16 -9
  361. package/tests/blockstore/transaction.test.ts +19 -16
  362. package/tests/fireproof/all-gateway.test.ts +12 -27
  363. package/tests/fireproof/attachable.test.ts +426 -97
  364. package/tests/fireproof/crdt.test.ts +23 -0
  365. package/tests/fireproof/database.test.ts +13 -12
  366. package/tests/fireproof/fireproof.test.ts +2 -5
  367. package/tests/fireproof/indexer.test.ts +4 -0
  368. package/tests/helpers.ts +30 -14
  369. package/tests/react/img-file.test.tsx +0 -9
  370. package/tests/react/use-fireproof-stability.test.tsx +5 -5
  371. package/tests/react/use-fireproof.test.tsx +18 -13
  372. package/tests/runtime/meta-key-hack.test.ts +7 -6
  373. package/tests/setup.indexeddb.ts +0 -9
  374. package/types.d.ts +460 -0
  375. package/types.d.ts.map +1 -0
  376. package/types.js +60 -0
  377. package/types.js.map +1 -0
  378. package/use-fireproof/iframe-strategy.d.ts +13 -0
  379. package/use-fireproof/iframe-strategy.d.ts.map +1 -0
  380. package/use-fireproof/iframe-strategy.js +83 -0
  381. package/use-fireproof/iframe-strategy.js.map +1 -0
  382. package/use-fireproof/index.d.ts +10 -0
  383. package/use-fireproof/index.d.ts.map +1 -0
  384. package/use-fireproof/index.js +16 -0
  385. package/use-fireproof/index.js.map +1 -0
  386. package/use-fireproof/redirect-strategy.d.ts +8 -0
  387. package/use-fireproof/redirect-strategy.d.ts.map +1 -0
  388. package/use-fireproof/redirect-strategy.js +31 -0
  389. package/use-fireproof/redirect-strategy.js.map +1 -0
  390. package/utils.d.ts +45 -0
  391. package/utils.d.ts.map +1 -0
  392. package/utils.js +406 -0
  393. package/utils.js.map +1 -0
  394. package/version.d.ts +2 -0
  395. package/version.d.ts.map +1 -0
  396. package/version.js +4 -0
  397. package/version.js.map +1 -0
  398. package/write-queue.d.ts +9 -0
  399. package/write-queue.d.ts.map +1 -0
  400. package/write-queue.js +70 -0
  401. package/write-queue.js.map +1 -0
  402. package/deno/index.d.ts +0 -7
  403. package/deno/index.js +0 -67
  404. package/deno/index.js.map +0 -1
  405. package/deno/metafile-esm.json +0 -1
  406. package/index.cjs +0 -7275
  407. package/index.cjs.map +0 -1
  408. package/index.d.cts +0 -2741
  409. package/indexeddb/index.cjs +0 -218
  410. package/indexeddb/index.cjs.map +0 -1
  411. package/indexeddb/index.d.cts +0 -30
  412. package/indexeddb/index.d.ts +0 -30
  413. package/indexeddb/index.js +0 -195
  414. package/indexeddb/index.js.map +0 -1
  415. package/indexeddb/metafile-cjs.json +0 -1
  416. package/indexeddb/metafile-esm.json +0 -1
  417. package/metafile-cjs.json +0 -1
  418. package/metafile-esm.json +0 -1
  419. package/node/index.cjs +0 -93
  420. package/node/index.cjs.map +0 -1
  421. package/node/index.d.cts +0 -7
  422. package/node/index.d.ts +0 -7
  423. package/node/index.js +0 -60
  424. package/node/index.js.map +0 -1
  425. package/node/metafile-cjs.json +0 -1
  426. package/node/metafile-esm.json +0 -1
  427. package/react/index.cjs +0 -392
  428. package/react/index.cjs.map +0 -1
  429. package/react/metafile-cjs.json +0 -1
  430. package/react/metafile-esm.json +0 -1
  431. package/tests/www/gallery.html +0 -132
  432. package/tests/www/iife.html +0 -42
  433. package/tests/www/todo-aws.html +0 -232
  434. package/tests/www/todo-ipfs.html +0 -213
  435. package/tests/www/todo-local.html +0 -214
  436. package/tests/www/todo-netlify.html +0 -227
  437. package/tests/www/todo.html +0 -254
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connect-raw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect-raw.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/connect-raw.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connect-raw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect-raw.js","sourceRoot":"","sources":["../../../../src/blockstore/connect-raw.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connection-base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-base.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/connection-base.ts"],"names":[],"mappings":""}
@@ -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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,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEzG,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;CAChF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../../../src/blockstore/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, 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,EAEjB,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,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ughGateway {
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,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,GAAoB,EAAE,GAAQ;QACxC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,GAAoB,EAAE,GAAQ;QACxC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,GAAoB,EAAE,GAAQ;QACzC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,GAAoB,EAAE,GAAQ;QAC1C,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,GAAG,CAAI,GAAoB,EAAE,GAAQ,EAAE,IAAmB;QAC9D,MA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AAK,EAAE,CAAC;YAC1B,OAAO,GAAG,CAAC,KAAK,CAAC;QACnB,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAoB,EAAE,GAAQ;QACzC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACrD,IAAI,IAAI,CAAC,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,10 @@
1
+ import { Logger } from "@adviser/cement";
2
+ import { AnyBlock, CarHeader, FPBlock, ReadyCarBlockItem } from "./types.js";
3
+ import { DocObject } from "../types.js";
4
+ export declare function uint82FPBlock(value: Uint8Array): Promise<FPBlock>;
5
+ export declare function fileBlock2FPBlock(value: AnyBlock): FPBlock;
6
+ export declare function anyBlock2FPBlock(fp: AnyBlock): Promise<FPBlock>;
7
+ export declare function doc2FPBlock(doc: Partial<DocObject>): Promise<FPBlock>;
8
+ export declare function carHeader2FPBlock<T>(fp: CarHeader<T>): Promise<FPBlock>;
9
+ export declare function parseCarFile<T>(reader: FPBlock<ReadyCarBlockItem>, logger: Logger): Promise<CarHeader<T>>;
10
+ //# 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":"AAIA,OAAO,EAAoB,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EACL,QAAQ,EAIR,SAAS,EAKT,OAAO,EAIP,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAqFxC,wBAAsB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAGvE;AAeD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAE1D;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAE/D;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAG3E;AACD,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAiB7E;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CA8B/G"}
@@ -0,0 +1,115 @@
1
+ import { encode } 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
+ import { decode as syncDecode } from "multiformats/block";
5
+ import { exception2Result } from "@adviser/cement";
6
+ import { isFPBlockItem, } from "./types.js";
7
+ class FPBlockImpl {
8
+ static async fromBlockItem(item) {
9
+ const block = await encode({ value: item.value, hasher, codec: dagCodec });
10
+ return new FPBlockImpl(block.cid, block.bytes, item);
11
+ }
12
+ static async fromAnyBlock(cid, bytes) {
13
+ const rcontent = await exception2Result(async () => await syncDecode({ bytes, hasher, codec: dagCodec }));
14
+ if (rcontent.isErr()) {
15
+ return new FileFPBlock(cid, bytes);
16
+ }
17
+ const content = rcontent.Ok();
18
+ switch (true) {
19
+ case "doc" in content.value:
20
+ return FPBlockImpl.fromBlockItem({
21
+ type: "doc",
22
+ status: "ready",
23
+ value: content.value,
24
+ });
25
+ case "entries" in content.value:
26
+ return FPBlockImpl.fromBlockItem({
27
+ type: "entries",
28
+ status: "ready",
29
+ value: content.value,
30
+ });
31
+ case "fp" in content.value:
32
+ return FPBlockImpl.fromBlockItem({
33
+ type: "fp",
34
+ status: "ready",
35
+ value: content.value,
36
+ });
37
+ case "data" in content.value:
38
+ return FPBlockImpl.fromBlockItem({
39
+ type: "data",
40
+ status: "ready",
41
+ value: content.value,
42
+ });
43
+ case "del" in content.value:
44
+ return FPBlockImpl.fromBlockItem({
45
+ type: "del",
46
+ status: "ready",
47
+ value: content.value,
48
+ });
49
+ case "leaf" in content.value:
50
+ return FPBlockImpl.fromBlockItem({
51
+ type: "leaf",
52
+ status: "ready",
53
+ value: content.value,
54
+ });
55
+ case "branch" in content.value:
56
+ return FPBlockImpl.fromBlockItem({
57
+ type: "branch",
58
+ status: "ready",
59
+ value: content.value,
60
+ });
61
+ default:
62
+ return FPBlockImpl.fromBlockItem({
63
+ type: "unknown",
64
+ status: "ready",
65
+ value: content.value,
66
+ });
67
+ }
68
+ }
69
+ constructor(cid, bytes, item) {
70
+ this.cid = cid;
71
+ this.bytes = bytes;
72
+ this.item = item;
73
+ }
74
+ }
75
+ export async function uint82FPBlock(value) {
76
+ const block = await encode({ value, hasher, codec: dagCodec });
77
+ return FPBlockImpl.fromAnyBlock(block.cid, block.bytes);
78
+ }
79
+ class FileFPBlock {
80
+ get item() {
81
+ throw new Error("FileFPBlock: item not available");
82
+ }
83
+ constructor(cid, bytes) {
84
+ this.cid = cid;
85
+ this.bytes = bytes;
86
+ }
87
+ }
88
+ export function fileBlock2FPBlock(value) {
89
+ return new FileFPBlock(value.cid, value.bytes);
90
+ }
91
+ export function anyBlock2FPBlock(fp) {
92
+ return FPBlockImpl.fromAnyBlock(fp.cid, fp.bytes);
93
+ }
94
+ export async function doc2FPBlock(doc) {
95
+ const block = await encode({ value: doc, hasher, codec: dagCodec });
96
+ return anyBlock2FPBlock(block);
97
+ }
98
+ export async function carHeader2FPBlock(fp) {
99
+ return anyBlock2FPBlock((await encode({
100
+ value: { fp },
101
+ hasher,
102
+ codec: dagCodec,
103
+ })));
104
+ }
105
+ export async function parseCarFile(reader, logger) {
106
+ const roots = await reader.item.value.car.roots;
107
+ const header = reader.item.value.car.blocks.find((i) => i.cid.equals(roots[0]));
108
+ if (!header)
109
+ throw logger.Error().Msg("missing header block").AsError();
110
+ if (!isFPBlockItem(header)) {
111
+ throw logger.Error().Msg("missing fp").AsError();
112
+ }
113
+ return header.item.value.fp;
114
+ }
115
+ //# 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;AAC3C,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAU,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAYL,aAAa,GAGd,MAAM,YAAY,CAAC;AAGpB,M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MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,IAAI,CAAC,MAAM;QAAE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,OAAO,EAAE,CAAC;IAkBxE,IAAI,CAAC,aAAa,CAAI,MAAM,CAAC,EAAE,CAAC;QAC9B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;IACnD,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AAM9B,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { KeyedResolvOnce, Logger, LRUSet, Result, URI } from "@adviser/cement";
2
+ import { type AnyLink, type CarHeader, type CommitOpts, type TransactionMeta, type CarGroup, type Loadable, BlockstoreRuntime, BlockstoreOpts, AttachedStores, ActiveStore, CIDActiveStore, CarLog, FroozenCarLog, FPBlock, CarBlockItem, BlockFetcher } 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 blockstoreParent?: BlockFetcher;
10
+ readonly ebOpts: BlockstoreRuntime;
11
+ readonly logger: Logger;
12
+ readonly commitQueue: CommitQueue<CarGroup>;
13
+ isCompacting: boolean;
14
+ readonly cidCache: KeyedResolvOnce<FPBlock>;
15
+ private readonly maxConcurrentCarReader;
16
+ private readonly maxConcurrentWrite;
17
+ readonly seenCompacted: LRUSet<string>;
18
+ readonly sthis: SuperThis;
19
+ readonly taskManager: TaskManager;
20
+ readonly carLog: CarLog;
21
+ readonly attachedStores: AttachedStores;
22
+ tryToLoadStaleCars(store: ActiveStore): Promise<this | undefined>;
23
+ attach(attachable: Attachable): Promise<Attached>;
24
+ private ensureAttachedStore;
25
+ private seenMeta;
26
+ keyBag(): Promise<KeyBag>;
27
+ private readonly onceReady;
28
+ metaStreamReader: ReadableStreamDefaultReader<DbMeta[]>;
29
+ ready(): Promise<void>;
30
+ currentMeta: CarGroup;
31
+ waitFirstMeta(reader: ReadableStreamDefaultReader<DbMeta[]>, local: ActiveStore, opts?: {
32
+ meta?: DbMeta;
33
+ origin?: URI;
34
+ }): Promise<CarGroup>;
35
+ handleMetaStream(reader: ReadableStreamDefaultReader<DbMeta[]>, local: ActiveStore, opts?: {
36
+ meta?: DbMeta;
37
+ origin?: URI;
38
+ first: (v: CarGroup) => void;
39
+ }): void;
40
+ close(): Promise<void>;
41
+ destroy(): Promise<void>;
42
+ readonly id: string;
43
+ constructor(sthis: SuperThis, ebOpts: BlockstoreOpts, blockstore?: BlockFetcher);
44
+ handleDbMetasFromStore(metas: DbMeta[], activeStore: ActiveStore): Promise<CarGroup>;
45
+ mergeDbMetaIntoClock(meta: DbMeta, activeStore: ActiveStore): Promise<CarGroup[]>;
46
+ loadCarHeaderFromMeta<T>(dbm: DbMeta, astore: ActiveStore): Promise<CarHeader<T>>;
47
+ commitFiles(t: CarTransaction, done: TransactionMeta): Promise<CarGroup>;
48
+ loadFileCar(cid: AnyLink, store: ActiveStore): Promise<FPBlock<CarBlockItem>>;
49
+ commit<T = TransactionMeta>(t: CarTransaction, done: T, opts?: CommitOpts): Promise<CarGroup>;
50
+ updateCarLog<T>(cids: CarGroup, cHeader: CarHeader<T>, compact: boolean): Promise<void>;
51
+ cacheTransaction(t: CarTransaction): Promise<void>;
52
+ removeCidsForCompact(cid: AnyLink, store: ActiveStore): Promise<void>;
53
+ entries(): AsyncIterableIterator<FPBlock>;
54
+ getBlock(cid: AnyLink): Promise<FPBlock | Falsy>;
55
+ getCompactCarCids(carCid: AnyLink, store: ActiveStore): Promise<void>;
56
+ loadCar(cid: AnyLink, store: ActiveStore): Promise<FPBlock<CarBlockItem>>;
57
+ private makeDecoderAndCarReader;
58
+ protected storesLoadCar(carCid: AnyLink, store: CIDActiveStore): Promise<FPBlock<CarBlockItem>>;
59
+ protected getMoreReaders(cids: AnyLink[], store: ActiveStore): Promise<Result<FPBlock<CarBlockItem>>[]>;
60
+ }
61
+ //# 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,EAAoB,eAAe,EAAE,MAAM,EAAE,MAAM,EAAe,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE9G,OAAO,EAEL,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,EACX,cAAc,EACd,MAAM,EACN,aAAa,EAEb,OAAO,EACP,YAAY,EACZ,YAAY,EAMb,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,SAAS,EAEf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAa,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD,wBAAgB,mBAAmB,CAAC,IAAI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