@fireproof/core 0.21.0-dev-preview-7 → 0.22.0-keybag

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 (444) hide show
  1. package/index.d.ts +2 -16
  2. package/index.js +2 -15
  3. package/index.js.map +1 -1
  4. package/index.ts +2 -0
  5. package/package.json +12 -70
  6. package/tsconfig.json +18 -0
  7. package/README.md +0 -269
  8. package/apply-head-queue.d.ts +0 -18
  9. package/apply-head-queue.d.ts.map +0 -1
  10. package/apply-head-queue.js +0 -47
  11. package/apply-head-queue.js.map +0 -1
  12. package/blockstore/attachable-store.d.ts +0 -19
  13. package/blockstore/attachable-store.d.ts.map +0 -1
  14. package/blockstore/attachable-store.js +0 -316
  15. package/blockstore/attachable-store.js.map +0 -1
  16. package/blockstore/commit-queue.d.ts +0 -17
  17. package/blockstore/commit-queue.d.ts.map +0 -1
  18. package/blockstore/commit-queue.js +0 -60
  19. package/blockstore/commit-queue.js.map +0 -1
  20. package/blockstore/commitor.d.ts +0 -21
  21. package/blockstore/commitor.d.ts.map +0 -1
  22. package/blockstore/commitor.js +0 -95
  23. package/blockstore/commitor.js.map +0 -1
  24. package/blockstore/connect-raw.d.ts +0 -2
  25. package/blockstore/connect-raw.d.ts.map +0 -1
  26. package/blockstore/connect-raw.js +0 -2
  27. package/blockstore/connect-raw.js.map +0 -1
  28. package/blockstore/connection-base.d.ts +0 -2
  29. package/blockstore/connection-base.d.ts.map +0 -1
  30. package/blockstore/connection-base.js +0 -2
  31. package/blockstore/connection-base.js.map +0 -1
  32. package/blockstore/encrypt-helpers.d.ts +0 -2
  33. package/blockstore/encrypt-helpers.d.ts.map +0 -1
  34. package/blockstore/encrypt-helpers.js +0 -2
  35. package/blockstore/encrypt-helpers.js.map +0 -1
  36. package/blockstore/fp-envelope.d.ts +0 -32
  37. package/blockstore/fp-envelope.d.ts.map +0 -1
  38. package/blockstore/fp-envelope.js +0 -14
  39. package/blockstore/fp-envelope.js.map +0 -1
  40. package/blockstore/gateway.d.ts +0 -20
  41. package/blockstore/gateway.d.ts.map +0 -1
  42. package/blockstore/gateway.js +0 -2
  43. package/blockstore/gateway.js.map +0 -1
  44. package/blockstore/index.d.ts +0 -17
  45. package/blockstore/index.d.ts.map +0 -1
  46. package/blockstore/index.js +0 -17
  47. package/blockstore/index.js.map +0 -1
  48. package/blockstore/interceptor-gateway.d.ts +0 -29
  49. package/blockstore/interceptor-gateway.d.ts.map +0 -1
  50. package/blockstore/interceptor-gateway.js +0 -137
  51. package/blockstore/interceptor-gateway.js.map +0 -1
  52. package/blockstore/loader-helpers.d.ts +0 -10
  53. package/blockstore/loader-helpers.d.ts.map +0 -1
  54. package/blockstore/loader-helpers.js +0 -115
  55. package/blockstore/loader-helpers.js.map +0 -1
  56. package/blockstore/loader.d.ts +0 -62
  57. package/blockstore/loader.d.ts.map +0 -1
  58. package/blockstore/loader.js +0 -523
  59. package/blockstore/loader.js.map +0 -1
  60. package/blockstore/register-store-protocol.d.ts +0 -22
  61. package/blockstore/register-store-protocol.d.ts.map +0 -1
  62. package/blockstore/register-store-protocol.js +0 -125
  63. package/blockstore/register-store-protocol.js.map +0 -1
  64. package/blockstore/serde-gateway.d.ts +0 -78
  65. package/blockstore/serde-gateway.d.ts.map +0 -1
  66. package/blockstore/serde-gateway.js +0 -2
  67. package/blockstore/serde-gateway.js.map +0 -1
  68. package/blockstore/store-factory.d.ts +0 -11
  69. package/blockstore/store-factory.d.ts.map +0 -1
  70. package/blockstore/store-factory.js +0 -104
  71. package/blockstore/store-factory.js.map +0 -1
  72. package/blockstore/store-remote.d.ts +0 -2
  73. package/blockstore/store-remote.d.ts.map +0 -1
  74. package/blockstore/store-remote.js +0 -2
  75. package/blockstore/store-remote.js.map +0 -1
  76. package/blockstore/store.d.ts +0 -86
  77. package/blockstore/store.d.ts.map +0 -1
  78. package/blockstore/store.js +0 -437
  79. package/blockstore/store.js.map +0 -1
  80. package/blockstore/task-manager.d.ts +0 -19
  81. package/blockstore/task-manager.d.ts.map +0 -1
  82. package/blockstore/task-manager.js +0 -50
  83. package/blockstore/task-manager.js.map +0 -1
  84. package/blockstore/transaction.d.ts +0 -62
  85. package/blockstore/transaction.d.ts.map +0 -1
  86. package/blockstore/transaction.js +0 -256
  87. package/blockstore/transaction.js.map +0 -1
  88. package/blockstore/types.d.ts +0 -508
  89. package/blockstore/types.d.ts.map +0 -1
  90. package/blockstore/types.js +0 -83
  91. package/blockstore/types.js.map +0 -1
  92. package/blockstore/uri-interceptor.d.ts +0 -19
  93. package/blockstore/uri-interceptor.d.ts.map +0 -1
  94. package/blockstore/uri-interceptor.js +0 -61
  95. package/blockstore/uri-interceptor.js.map +0 -1
  96. package/bundle-not-impl.d.ts +0 -2
  97. package/bundle-not-impl.d.ts.map +0 -1
  98. package/bundle-not-impl.js +0 -4
  99. package/bundle-not-impl.js.map +0 -1
  100. package/cli/main.js +0 -26645
  101. package/crdt-clock.d.ts +0 -26
  102. package/crdt-clock.d.ts.map +0 -1
  103. package/crdt-clock.js +0 -133
  104. package/crdt-clock.js.map +0 -1
  105. package/crdt-helpers.d.ts +0 -19
  106. package/crdt-helpers.d.ts.map +0 -1
  107. package/crdt-helpers.js +0 -332
  108. package/crdt-helpers.js.map +0 -1
  109. package/crdt.d.ts +0 -41
  110. package/crdt.d.ts.map +0 -1
  111. package/crdt.js +0 -164
  112. package/crdt.js.map +0 -1
  113. package/database.d.ts +0 -33
  114. package/database.d.ts.map +0 -1
  115. package/database.js +0 -132
  116. package/database.js.map +0 -1
  117. package/deno.json +0 -20
  118. package/index.d.ts.map +0 -1
  119. package/indexer-helpers.d.ts +0 -68
  120. package/indexer-helpers.d.ts.map +0 -1
  121. package/indexer-helpers.js +0 -157
  122. package/indexer-helpers.js.map +0 -1
  123. package/indexer.d.ts +0 -24
  124. package/indexer.d.ts.map +0 -1
  125. package/indexer.js +0 -239
  126. package/indexer.js.map +0 -1
  127. package/ledger.d.ts +0 -56
  128. package/ledger.d.ts.map +0 -1
  129. package/ledger.js +0 -237
  130. package/ledger.js.map +0 -1
  131. package/protocols/cloud/http-connection.d.ts +0 -26
  132. package/protocols/cloud/http-connection.d.ts.map +0 -1
  133. package/protocols/cloud/http-connection.js +0 -154
  134. package/protocols/cloud/http-connection.js.map +0 -1
  135. package/protocols/cloud/index.d.ts +0 -10
  136. package/protocols/cloud/index.d.ts.map +0 -1
  137. package/protocols/cloud/index.js +0 -10
  138. package/protocols/cloud/index.js.map +0 -1
  139. package/protocols/cloud/msg-raw-connection-base.d.ts +0 -16
  140. package/protocols/cloud/msg-raw-connection-base.d.ts.map +0 -1
  141. package/protocols/cloud/msg-raw-connection-base.js +0 -22
  142. package/protocols/cloud/msg-raw-connection-base.js.map +0 -1
  143. package/protocols/cloud/msg-types-data.d.ts +0 -36
  144. package/protocols/cloud/msg-types-data.d.ts.map +0 -1
  145. package/protocols/cloud/msg-types-data.js +0 -38
  146. package/protocols/cloud/msg-types-data.js.map +0 -1
  147. package/protocols/cloud/msg-types-meta.d.ts +0 -41
  148. package/protocols/cloud/msg-types-meta.d.ts.map +0 -1
  149. package/protocols/cloud/msg-types-meta.js +0 -98
  150. package/protocols/cloud/msg-types-meta.js.map +0 -1
  151. package/protocols/cloud/msg-types-wal.d.ts +0 -33
  152. package/protocols/cloud/msg-types-wal.d.ts.map +0 -1
  153. package/protocols/cloud/msg-types-wal.js +0 -38
  154. package/protocols/cloud/msg-types-wal.js.map +0 -1
  155. package/protocols/cloud/msg-types.d.ts +0 -310
  156. package/protocols/cloud/msg-types.d.ts.map +0 -1
  157. package/protocols/cloud/msg-types.js +0 -299
  158. package/protocols/cloud/msg-types.js.map +0 -1
  159. package/protocols/cloud/msger.d.ts +0 -94
  160. package/protocols/cloud/msger.d.ts.map +0 -1
  161. package/protocols/cloud/msger.js +0 -319
  162. package/protocols/cloud/msger.js.map +0 -1
  163. package/protocols/cloud/ws-connection.d.ts +0 -40
  164. package/protocols/cloud/ws-connection.d.ts.map +0 -1
  165. package/protocols/cloud/ws-connection.js +0 -205
  166. package/protocols/cloud/ws-connection.js.map +0 -1
  167. package/protocols/dashboard/index.d.ts +0 -4
  168. package/protocols/dashboard/index.d.ts.map +0 -1
  169. package/protocols/dashboard/index.js +0 -4
  170. package/protocols/dashboard/index.js.map +0 -1
  171. package/protocols/dashboard/msg-api.d.ts +0 -11
  172. package/protocols/dashboard/msg-api.d.ts.map +0 -1
  173. package/protocols/dashboard/msg-api.js +0 -55
  174. package/protocols/dashboard/msg-api.js.map +0 -1
  175. package/protocols/dashboard/msg-is.d.ts +0 -45
  176. package/protocols/dashboard/msg-is.d.ts.map +0 -1
  177. package/protocols/dashboard/msg-is.js +0 -63
  178. package/protocols/dashboard/msg-is.js.map +0 -1
  179. package/protocols/dashboard/msg-types.d.ts +0 -397
  180. package/protocols/dashboard/msg-types.d.ts.map +0 -1
  181. package/protocols/dashboard/msg-types.js +0 -4
  182. package/protocols/dashboard/msg-types.js.map +0 -1
  183. package/protocols/index.d.ts +0 -3
  184. package/protocols/index.d.ts.map +0 -1
  185. package/protocols/index.js +0 -3
  186. package/protocols/index.js.map +0 -1
  187. package/react/img-file.d.ts +0 -303
  188. package/react/img-file.d.ts.map +0 -1
  189. package/react/img-file.js +0 -92
  190. package/react/img-file.js.map +0 -1
  191. package/react/index.d.ts +0 -5
  192. package/react/index.d.ts.map +0 -1
  193. package/react/index.js +0 -5
  194. package/react/index.js.map +0 -1
  195. package/react/types.d.ts +0 -91
  196. package/react/types.d.ts.map +0 -1
  197. package/react/types.js +0 -2
  198. package/react/types.js.map +0 -1
  199. package/react/use-all-docs.d.ts +0 -4
  200. package/react/use-all-docs.d.ts.map +0 -1
  201. package/react/use-all-docs.js +0 -25
  202. package/react/use-all-docs.js.map +0 -1
  203. package/react/use-attach.d.ts +0 -11
  204. package/react/use-attach.d.ts.map +0 -1
  205. package/react/use-attach.js +0 -169
  206. package/react/use-attach.js.map +0 -1
  207. package/react/use-changes.d.ts +0 -4
  208. package/react/use-changes.d.ts.map +0 -1
  209. package/react/use-changes.js +0 -19
  210. package/react/use-changes.js.map +0 -1
  211. package/react/use-document.d.ts +0 -4
  212. package/react/use-document.d.ts.map +0 -1
  213. package/react/use-document.js +0 -109
  214. package/react/use-document.js.map +0 -1
  215. package/react/use-fireproof.d.ts +0 -6
  216. package/react/use-fireproof.d.ts.map +0 -1
  217. package/react/use-fireproof.js +0 -20
  218. package/react/use-fireproof.js.map +0 -1
  219. package/react/use-live-query.d.ts +0 -4
  220. package/react/use-live-query.d.ts.map +0 -1
  221. package/react/use-live-query.js +0 -24
  222. package/react/use-live-query.js.map +0 -1
  223. package/runtime/files.d.ts +0 -12
  224. package/runtime/files.d.ts.map +0 -1
  225. package/runtime/files.js +0 -29
  226. package/runtime/files.js.map +0 -1
  227. package/runtime/gateways/cloud/gateway.d.ts +0 -41
  228. package/runtime/gateways/cloud/gateway.d.ts.map +0 -1
  229. package/runtime/gateways/cloud/gateway.js +0 -514
  230. package/runtime/gateways/cloud/gateway.js.map +0 -1
  231. package/runtime/gateways/cloud/index.d.ts +0 -3
  232. package/runtime/gateways/cloud/index.d.ts.map +0 -1
  233. package/runtime/gateways/cloud/index.js +0 -3
  234. package/runtime/gateways/cloud/index.js.map +0 -1
  235. package/runtime/gateways/cloud/to-cloud.d.ts +0 -59
  236. package/runtime/gateways/cloud/to-cloud.d.ts.map +0 -1
  237. package/runtime/gateways/cloud/to-cloud.js +0 -175
  238. package/runtime/gateways/cloud/to-cloud.js.map +0 -1
  239. package/runtime/gateways/def-serde-gateway.d.ts +0 -18
  240. package/runtime/gateways/def-serde-gateway.d.ts.map +0 -1
  241. package/runtime/gateways/def-serde-gateway.js +0 -92
  242. package/runtime/gateways/def-serde-gateway.js.map +0 -1
  243. package/runtime/gateways/file/deno/deno-filesystem.d.ts +0 -27
  244. package/runtime/gateways/file/deno/deno-filesystem.d.ts.map +0 -1
  245. package/runtime/gateways/file/deno/deno-filesystem.js +0 -52
  246. package/runtime/gateways/file/deno/deno-filesystem.js.map +0 -1
  247. package/runtime/gateways/file/deno/get-sys-file-system.d.ts +0 -4
  248. package/runtime/gateways/file/deno/get-sys-file-system.d.ts.map +0 -1
  249. package/runtime/gateways/file/deno/get-sys-file-system.js +0 -11
  250. package/runtime/gateways/file/deno/get-sys-file-system.js.map +0 -1
  251. package/runtime/gateways/file/deno/index.d.ts +0 -2
  252. package/runtime/gateways/file/deno/index.d.ts.map +0 -1
  253. package/runtime/gateways/file/deno/index.js +0 -2
  254. package/runtime/gateways/file/deno/index.js.map +0 -1
  255. package/runtime/gateways/file/gateway-impl.d.ts +0 -18
  256. package/runtime/gateways/file/gateway-impl.d.ts.map +0 -1
  257. package/runtime/gateways/file/gateway-impl.js +0 -121
  258. package/runtime/gateways/file/gateway-impl.js.map +0 -1
  259. package/runtime/gateways/file/index.d.ts +0 -3
  260. package/runtime/gateways/file/index.d.ts.map +0 -1
  261. package/runtime/gateways/file/index.js +0 -3
  262. package/runtime/gateways/file/index.js.map +0 -1
  263. package/runtime/gateways/file/key-bag-file.d.ts +0 -20
  264. package/runtime/gateways/file/key-bag-file.d.ts.map +0 -1
  265. package/runtime/gateways/file/key-bag-file.js +0 -52
  266. package/runtime/gateways/file/key-bag-file.js.map +0 -1
  267. package/runtime/gateways/file/node/get-sys-file-system.d.ts +0 -4
  268. package/runtime/gateways/file/node/get-sys-file-system.d.ts.map +0 -1
  269. package/runtime/gateways/file/node/get-sys-file-system.js +0 -11
  270. package/runtime/gateways/file/node/get-sys-file-system.js.map +0 -1
  271. package/runtime/gateways/file/node/index.d.ts +0 -2
  272. package/runtime/gateways/file/node/index.d.ts.map +0 -1
  273. package/runtime/gateways/file/node/index.js +0 -2
  274. package/runtime/gateways/file/node/index.js.map +0 -1
  275. package/runtime/gateways/file/node/node-filesystem.d.ts +0 -32
  276. package/runtime/gateways/file/node/node-filesystem.d.ts.map +0 -1
  277. package/runtime/gateways/file/node/node-filesystem.js +0 -33
  278. package/runtime/gateways/file/node/node-filesystem.js.map +0 -1
  279. package/runtime/gateways/file/node/to-array-buffer.d.ts +0 -2
  280. package/runtime/gateways/file/node/to-array-buffer.d.ts.map +0 -1
  281. package/runtime/gateways/file/node/to-array-buffer.js +0 -12
  282. package/runtime/gateways/file/node/to-array-buffer.js.map +0 -1
  283. package/runtime/gateways/file/sys-file-system-factory.d.ts +0 -4
  284. package/runtime/gateways/file/sys-file-system-factory.d.ts.map +0 -1
  285. package/runtime/gateways/file/sys-file-system-factory.js +0 -13
  286. package/runtime/gateways/file/sys-file-system-factory.js.map +0 -1
  287. package/runtime/gateways/file/utils.d.ts +0 -5
  288. package/runtime/gateways/file/utils.d.ts.map +0 -1
  289. package/runtime/gateways/file/utils.js +0 -27
  290. package/runtime/gateways/file/utils.js.map +0 -1
  291. package/runtime/gateways/file/version.d.ts +0 -2
  292. package/runtime/gateways/file/version.d.ts.map +0 -1
  293. package/runtime/gateways/file/version.js +0 -2
  294. package/runtime/gateways/file/version.js.map +0 -1
  295. package/runtime/gateways/fp-envelope-serialize.d.ts +0 -50
  296. package/runtime/gateways/fp-envelope-serialize.d.ts.map +0 -1
  297. package/runtime/gateways/fp-envelope-serialize.js +0 -141
  298. package/runtime/gateways/fp-envelope-serialize.js.map +0 -1
  299. package/runtime/gateways/index.d.ts +0 -6
  300. package/runtime/gateways/index.d.ts.map +0 -1
  301. package/runtime/gateways/index.js +0 -6
  302. package/runtime/gateways/index.js.map +0 -1
  303. package/runtime/gateways/indexeddb/gateway-impl.d.ts +0 -22
  304. package/runtime/gateways/indexeddb/gateway-impl.d.ts.map +0 -1
  305. package/runtime/gateways/indexeddb/gateway-impl.js +0 -147
  306. package/runtime/gateways/indexeddb/gateway-impl.js.map +0 -1
  307. package/runtime/gateways/indexeddb/index.d.ts +0 -6
  308. package/runtime/gateways/indexeddb/index.d.ts.map +0 -1
  309. package/runtime/gateways/indexeddb/index.js +0 -6
  310. package/runtime/gateways/indexeddb/index.js.map +0 -1
  311. package/runtime/gateways/indexeddb/key-bag-indexeddb.d.ts +0 -16
  312. package/runtime/gateways/indexeddb/key-bag-indexeddb.d.ts.map +0 -1
  313. package/runtime/gateways/indexeddb/key-bag-indexeddb.js +0 -48
  314. package/runtime/gateways/indexeddb/key-bag-indexeddb.js.map +0 -1
  315. package/runtime/gateways/indexeddb-version.d.ts +0 -2
  316. package/runtime/gateways/indexeddb-version.d.ts.map +0 -1
  317. package/runtime/gateways/indexeddb-version.js +0 -2
  318. package/runtime/gateways/indexeddb-version.js.map +0 -1
  319. package/runtime/gateways/memory/gateway.d.ts +0 -18
  320. package/runtime/gateways/memory/gateway.d.ts.map +0 -1
  321. package/runtime/gateways/memory/gateway.js +0 -73
  322. package/runtime/gateways/memory/gateway.js.map +0 -1
  323. package/runtime/gateways/memory/version.d.ts +0 -2
  324. package/runtime/gateways/memory/version.d.ts.map +0 -1
  325. package/runtime/gateways/memory/version.js +0 -2
  326. package/runtime/gateways/memory/version.js.map +0 -1
  327. package/runtime/index.d.ts +0 -13
  328. package/runtime/index.d.ts.map +0 -1
  329. package/runtime/index.js +0 -13
  330. package/runtime/index.js.map +0 -1
  331. package/runtime/key-bag-memory.d.ts +0 -13
  332. package/runtime/key-bag-memory.d.ts.map +0 -1
  333. package/runtime/key-bag-memory.js +0 -30
  334. package/runtime/key-bag-memory.js.map +0 -1
  335. package/runtime/key-bag.d.ts +0 -88
  336. package/runtime/key-bag.d.ts.map +0 -1
  337. package/runtime/key-bag.js +0 -417
  338. package/runtime/key-bag.js.map +0 -1
  339. package/runtime/keyed-crypto.d.ts +0 -19
  340. package/runtime/keyed-crypto.d.ts.map +0 -1
  341. package/runtime/keyed-crypto.js +0 -192
  342. package/runtime/keyed-crypto.js.map +0 -1
  343. package/runtime/memory-sys-container.d.ts +0 -2
  344. package/runtime/memory-sys-container.d.ts.map +0 -1
  345. package/runtime/memory-sys-container.js +0 -2
  346. package/runtime/memory-sys-container.js.map +0 -1
  347. package/runtime/meta-key-hack.d.ts +0 -42
  348. package/runtime/meta-key-hack.d.ts.map +0 -1
  349. package/runtime/meta-key-hack.js +0 -201
  350. package/runtime/meta-key-hack.js.map +0 -1
  351. package/runtime/sts-service/index.d.ts +0 -40
  352. package/runtime/sts-service/index.d.ts.map +0 -1
  353. package/runtime/sts-service/index.js +0 -108
  354. package/runtime/sts-service/index.js.map +0 -1
  355. package/runtime/sys-container.d.ts +0 -2
  356. package/runtime/sys-container.d.ts.map +0 -1
  357. package/runtime/sys-container.js +0 -2
  358. package/runtime/sys-container.js.map +0 -1
  359. package/runtime/wait-pr-multiformats/block.d.ts +0 -47
  360. package/runtime/wait-pr-multiformats/block.d.ts.map +0 -1
  361. package/runtime/wait-pr-multiformats/block.js +0 -64
  362. package/runtime/wait-pr-multiformats/block.js.map +0 -1
  363. package/runtime/wait-pr-multiformats/codec-interface.d.ts +0 -29
  364. package/runtime/wait-pr-multiformats/codec-interface.d.ts.map +0 -1
  365. package/runtime/wait-pr-multiformats/codec-interface.js +0 -2
  366. package/runtime/wait-pr-multiformats/codec-interface.js.map +0 -1
  367. package/runtime/wait-pr-multiformats/index.d.ts +0 -3
  368. package/runtime/wait-pr-multiformats/index.d.ts.map +0 -1
  369. package/runtime/wait-pr-multiformats/index.js +0 -3
  370. package/runtime/wait-pr-multiformats/index.js.map +0 -1
  371. package/tests/blockstore/fp-envelope.test.ts-off +0 -65
  372. package/tests/blockstore/fragment-gateway.test.ts-off +0 -106
  373. package/tests/blockstore/interceptor-gateway.test.ts +0 -254
  374. package/tests/blockstore/keyed-crypto-indexeddb-file.test.ts +0 -128
  375. package/tests/blockstore/keyed-crypto.test.ts +0 -376
  376. package/tests/blockstore/loader.test.ts +0 -298
  377. package/tests/blockstore/standalone.test.ts +0 -152
  378. package/tests/blockstore/store.test.ts +0 -192
  379. package/tests/blockstore/transaction.test.ts +0 -130
  380. package/tests/fireproof/all-gateway.test.ts +0 -461
  381. package/tests/fireproof/attachable.test.ts +0 -686
  382. package/tests/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.car +0 -0
  383. package/tests/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.ts +0 -324
  384. package/tests/fireproof/charwise-boolean.test.ts +0 -66
  385. package/tests/fireproof/crdt.test.ts +0 -570
  386. package/tests/fireproof/database.test.ts +0 -779
  387. package/tests/fireproof/deleted-docs-handling.test.ts +0 -111
  388. package/tests/fireproof/fireproof.test.fixture.ts +0 -133
  389. package/tests/fireproof/fireproof.test.ts +0 -777
  390. package/tests/fireproof/hello.test.ts +0 -74
  391. package/tests/fireproof/indexer.test.ts +0 -458
  392. package/tests/fireproof/multiple-ledger.test.ts +0 -65
  393. package/tests/fireproof/query-docs.test.ts +0 -116
  394. package/tests/fireproof/query-limit-issue.test.ts +0 -147
  395. package/tests/fireproof/query-property-inconsistency.test.ts +0 -89
  396. package/tests/fireproof/query-result-properties.test.ts +0 -42
  397. package/tests/fireproof/stable-cid.test.ts +0 -69
  398. package/tests/fireproof/utils.test.ts +0 -135
  399. package/tests/gateway/file/loader-config.test.ts +0 -307
  400. package/tests/gateway/indexeddb/loader-config.test.ts +0 -79
  401. package/tests/helpers.ts +0 -172
  402. package/tests/protocols/cloud/msger.test.ts +0 -548
  403. package/tests/react/img-file.test.tsx +0 -190
  404. package/tests/react/use-all-docs.test.tsx +0 -172
  405. package/tests/react/use-document-with-nonexistent-id.test.tsx +0 -96
  406. package/tests/react/use-fireproof-db-switch.test.tsx +0 -91
  407. package/tests/react/use-fireproof-stability.test.tsx +0 -145
  408. package/tests/react/use-fireproof.test.tsx +0 -645
  409. package/tests/runtime/fp-envelope-serialize.test.ts +0 -254
  410. package/tests/runtime/meta-key-hack.test.ts +0 -95
  411. package/tests/setup.file.ts +0 -1
  412. package/tests/setup.indexeddb.ts +0 -0
  413. package/tests/setup.memory.ts +0 -2
  414. package/tests/vitest.file.config.ts +0 -14
  415. package/tests/vitest.indexeddb.config.ts +0 -37
  416. package/tests/vitest.memory.config.ts +0 -25
  417. package/types.d.ts +0 -461
  418. package/types.d.ts.map +0 -1
  419. package/types.js +0 -60
  420. package/types.js.map +0 -1
  421. package/use-fireproof/iframe-strategy.d.ts +0 -14
  422. package/use-fireproof/iframe-strategy.d.ts.map +0 -1
  423. package/use-fireproof/iframe-strategy.js +0 -79
  424. package/use-fireproof/iframe-strategy.js.map +0 -1
  425. package/use-fireproof/index.d.ts +0 -14
  426. package/use-fireproof/index.d.ts.map +0 -1
  427. package/use-fireproof/index.js +0 -36
  428. package/use-fireproof/index.js.map +0 -1
  429. package/use-fireproof/redirect-strategy.d.ts +0 -15
  430. package/use-fireproof/redirect-strategy.d.ts.map +0 -1
  431. package/use-fireproof/redirect-strategy.js +0 -153
  432. package/use-fireproof/redirect-strategy.js.map +0 -1
  433. package/utils.d.ts +0 -48
  434. package/utils.d.ts.map +0 -1
  435. package/utils.js +0 -406
  436. package/utils.js.map +0 -1
  437. package/version.d.ts +0 -2
  438. package/version.d.ts.map +0 -1
  439. package/version.js +0 -4
  440. package/version.js.map +0 -1
  441. package/write-queue.d.ts +0 -9
  442. package/write-queue.d.ts.map +0 -1
  443. package/write-queue.js +0 -70
  444. package/write-queue.js.map +0 -1
@@ -1,125 +0,0 @@
1
- import { BuildURI, runtimeFn, URI } from "@adviser/cement";
2
- import { PARAM } from "../types.js";
3
- import { FileGateway } from "../runtime/gateways/file/gateway-impl.js";
4
- import { MemoryGateway } from "../runtime/gateways/memory/gateway.js";
5
- import { DefSerdeGateway } from "../runtime/gateways/def-serde-gateway.js";
6
- import { FILESTORE_VERSION } from "../runtime/gateways/file/version.js";
7
- import { INDEXEDDB_VERSION } from "../runtime/gateways/indexeddb-version.js";
8
- import { sysFileSystemFactory } from "../runtime/gateways/file/sys-file-system-factory.js";
9
- import { FireproofCloudGateway } from "../runtime/gateways/cloud/gateway.js";
10
- const storeFactory = new Map();
11
- export function getDefaultURI(sthis, protocol) {
12
- if (protocol) {
13
- if (!protocol.endsWith(":")) {
14
- protocol += ":";
15
- }
16
- const gfi = storeFactory.get(protocol);
17
- if (gfi) {
18
- return gfi.defaultURI(sthis);
19
- }
20
- }
21
- const found = Array.from(storeFactory.values()).find((item) => item.isDefault);
22
- if (!found) {
23
- throw sthis.logger.Error().Msg("no default found").AsError();
24
- }
25
- return found.defaultURI(sthis);
26
- }
27
- export function registerStoreProtocol(item) {
28
- let protocol = item.protocol;
29
- if (!protocol.endsWith(":")) {
30
- protocol += ":";
31
- }
32
- if (!item.serdegateway && !item.gateway) {
33
- throw new Error(`registerStoreProtocol needs a gateway or serdegateway`);
34
- }
35
- let serdegateway;
36
- if (item.gateway) {
37
- serdegateway = async (sthis) => {
38
- const m = await item.gateway(sthis);
39
- return new DefSerdeGateway(m);
40
- };
41
- }
42
- else {
43
- serdegateway = item.serdegateway;
44
- }
45
- if (item.isDefault) {
46
- Array.from(storeFactory.values()).forEach((items) => {
47
- items.isDefault = false;
48
- });
49
- }
50
- storeFactory.set(protocol, {
51
- ...item,
52
- serdegateway,
53
- });
54
- return () => {
55
- storeFactory.delete(protocol);
56
- };
57
- }
58
- export function getGatewayFactoryItem(protocol) {
59
- return storeFactory.get(protocol);
60
- }
61
- export function defaultGatewayFactoryItem() {
62
- const found = Array.from(storeFactory.values()).find((item) => item.isDefault);
63
- if (!found) {
64
- throw new Error("no default found");
65
- }
66
- return found;
67
- }
68
- function defaultURI(sthis) {
69
- const rt = runtimeFn();
70
- return (BuildURI.from("file://")
71
- .pathname(`${sthis.env.get("HOME")}/.fireproof/${FILESTORE_VERSION.replace(/-.*$/, "")}`)
72
- .setParam(PARAM.VERSION, FILESTORE_VERSION)
73
- .setParam(PARAM.URL_GEN, "default")
74
- .setParam(PARAM.RUNTIME, rt.isNodeIsh ? "node" : rt.isDeno ? "deno" : "unknown")
75
- .URI());
76
- }
77
- if (runtimeFn().isNodeIsh || runtimeFn().isDeno) {
78
- registerStoreProtocol({
79
- protocol: "file:",
80
- isDefault: true,
81
- defaultURI,
82
- gateway: async (sthis) => {
83
- return new FileGateway(sthis, await sysFileSystemFactory(defaultURI(sthis)));
84
- },
85
- });
86
- }
87
- if (runtimeFn().isBrowser) {
88
- registerStoreProtocol({
89
- protocol: "indexeddb:",
90
- isDefault: true,
91
- defaultURI: () => {
92
- return BuildURI.from("indexeddb://")
93
- .pathname("fp")
94
- .setParam(PARAM.VERSION, INDEXEDDB_VERSION)
95
- .setParam(PARAM.RUNTIME, "browser")
96
- .URI();
97
- },
98
- gateway: async () => {
99
- const { GatewayImpl } = await import("@fireproof/core/indexeddb");
100
- return new GatewayImpl();
101
- },
102
- });
103
- }
104
- const memory = new Map();
105
- registerStoreProtocol({
106
- protocol: "memory:",
107
- isDefault: false,
108
- defaultURI: () => {
109
- return BuildURI.from("memory://").pathname("ram").URI();
110
- },
111
- gateway: async (sthis) => {
112
- return new MemoryGateway(sthis, memory);
113
- },
114
- });
115
- URI.protocolHasHostpart("fpcloud");
116
- registerStoreProtocol({
117
- protocol: "fpcloud",
118
- defaultURI() {
119
- return URI.from("fpcloud://fireproof.cloud/");
120
- },
121
- serdegateway: async (sthis) => {
122
- return new FireproofCloudGateway(sthis);
123
- },
124
- });
125
- //# sourceMappingURL=register-store-protocol.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register-store-protocol.js","sourceRoot":"","sources":["../../../../src/blockstore/register-store-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAa,MAAM,aAAa,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EA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CAAC;QACX,CAAC;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,2BAA2B,CAAC,CAAC;YAClE,OAAO,IAAI,WAAW,EAAE,CAAC;QAC3B,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,MAAM,GAAG,IAAI,GAAG,EAAsB,CAAC;AAC7C,qBAAqB,CAAC;IACpB,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,GAAG,EAAE;QACf,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QACvB,OAAO,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;CACF,CAAC,CAAC;AAKH,GAAG,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;AACnC,qBAAqB,CAAC;IACpB,QAAQ,EAAE,SAAS;IACnB,UAAU;QACR,OAAO,GAAG,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,KAAgB,EAAE,EAAE;QACvC,OAAO,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;CACF,CAAC,CAAC"}
@@ -1,78 +0,0 @@
1
- import { Result, URI } from "@adviser/cement";
2
- import { NotFoundError } from "../utils.js";
3
- import { FPEnvelope, FPEnvelopeMeta } from "./fp-envelope.js";
4
- import { type Loadable } from "./types.js";
5
- import { FPDecoder, type FPEncoder } from "../runtime/gateways/fp-envelope-serialize.js";
6
- export interface SerdeGatewayOpts {
7
- readonly gateway: SerdeGateway;
8
- }
9
- export type SerdeGetResult<S> = Result<FPEnvelope<S>, NotFoundError | Error>;
10
- export type VoidResult = Result<void>;
11
- export type UnsubscribeResult = Result<() => void>;
12
- export interface SerdeGatewayCtx {
13
- readonly loader: Loadable;
14
- readonly encoder?: Partial<FPEncoder>;
15
- readonly decoder?: Partial<FPDecoder>;
16
- }
17
- export interface SerdeGateway {
18
- buildUrl(ctx: SerdeGatewayCtx, baseUrl: URI, key: string): Promise<Result<URI>>;
19
- start(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<Result<URI>>;
20
- close(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<VoidResult>;
21
- put<T>(ctx: SerdeGatewayCtx, url: URI, body: FPEnvelope<T>): Promise<VoidResult>;
22
- get<S>(ctx: SerdeGatewayCtx, url: URI): Promise<SerdeGetResult<S>>;
23
- delete(ctx: SerdeGatewayCtx, url: URI): Promise<VoidResult>;
24
- subscribe(ctx: SerdeGatewayCtx, url: URI, callback: (meta: FPEnvelopeMeta) => Promise<void>): Promise<UnsubscribeResult>;
25
- getPlain(ctx: SerdeGatewayCtx, url: URI, key: string): Promise<Result<Uint8Array>>;
26
- destroy(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<VoidResult>;
27
- }
28
- export interface SerdeGatewayReturn<O, T> {
29
- readonly op: O;
30
- readonly value?: T;
31
- readonly stop?: boolean;
32
- }
33
- export interface SerdeGatewayBuildUrlOp {
34
- readonly url: URI;
35
- readonly key: string;
36
- }
37
- export type SerdeGatewayBuildUrlReturn = SerdeGatewayReturn<SerdeGatewayBuildUrlOp, Result<URI>>;
38
- export interface SerdeGatewayStartOp {
39
- readonly url: URI;
40
- }
41
- export type SerdeGatewayStartReturn = SerdeGatewayReturn<SerdeGatewayStartOp, Result<URI>>;
42
- export interface SerdeGatewayCloseOp {
43
- readonly url: URI;
44
- }
45
- export type SerdeGatewayCloseReturn = SerdeGatewayReturn<SerdeGatewayCloseOp, VoidResult>;
46
- export interface SerdeGatewayDestroyOp {
47
- readonly url: URI;
48
- }
49
- export type SerdeGatewayDestroyReturn = SerdeGatewayReturn<SerdeGatewayDestroyOp, VoidResult>;
50
- export interface SerdeGatewayPutOp<T> {
51
- readonly url: URI;
52
- readonly body: FPEnvelope<T>;
53
- }
54
- export type SerdeGatewayPutReturn<T> = SerdeGatewayReturn<SerdeGatewayPutOp<T>, VoidResult>;
55
- export interface SerdeGatewayGetOp {
56
- readonly url: URI;
57
- }
58
- export type SerdeGatewayGetReturn<S> = SerdeGatewayReturn<SerdeGatewayGetOp, SerdeGetResult<S>>;
59
- export interface SerdeGatewayDeleteOp {
60
- readonly url: URI;
61
- }
62
- export type SerdeGatewayDeleteReturn = SerdeGatewayReturn<SerdeGatewayDeleteOp, VoidResult>;
63
- export interface SerdeGatewaySubscribeOp {
64
- readonly url: URI;
65
- readonly callback: (meta: FPEnvelopeMeta) => Promise<void>;
66
- }
67
- export type SerdeGatewaySubscribeReturn = SerdeGatewayReturn<SerdeGatewaySubscribeOp, UnsubscribeResult>;
68
- export interface SerdeGatewayInterceptor {
69
- buildUrl(ctx: SerdeGatewayCtx, baseUrl: URI, key: string): Promise<Result<SerdeGatewayBuildUrlReturn>>;
70
- start(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<Result<SerdeGatewayStartReturn>>;
71
- close(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<Result<SerdeGatewayCloseReturn>>;
72
- delete(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<Result<SerdeGatewayDeleteReturn>>;
73
- destroy(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<Result<SerdeGatewayDestroyReturn>>;
74
- put<T>(ctx: SerdeGatewayCtx, url: URI, body: FPEnvelope<T>): Promise<Result<SerdeGatewayPutReturn<T>>>;
75
- get<S>(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayGetReturn<S>>>;
76
- subscribe(ctx: SerdeGatewayCtx, url: URI, callback: (meta: FPEnvelopeMeta) => Promise<void>): Promise<Result<SerdeGatewaySubscribeReturn>>;
77
- }
78
- //# sourceMappingURL=serde-gateway.d.ts.map
@@ -1 +0,0 @@
1
- {"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CAAC,GAChD,OAAO,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC;CACjD"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=serde-gateway.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serde-gateway.js","sourceRoot":"","sources":["../../../../src/blockstore/serde-gateway.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import { URI, Result } from "@adviser/cement";
2
- import { StoreEnDeFile, StoreRuntime } from "./types.js";
3
- import { SuperThis } from "../types.js";
4
- import { SerdeGatewayCtx, SerdeGatewayInterceptor } from "./serde-gateway.js";
5
- import { InterceptorGateway } from "./interceptor-gateway.js";
6
- export declare function getInterceptableGateway(ctx: SerdeGatewayCtx, url: URI, opt: {
7
- gatewayInterceptor?: SerdeGatewayInterceptor;
8
- }): Promise<Result<InterceptorGateway>>;
9
- export declare function ensureStoreEnDeFile(ende?: Partial<StoreEnDeFile>): StoreEnDeFile;
10
- export declare function toStoreRuntime(sthis: SuperThis, endeOpts?: Partial<StoreEnDeFile>): StoreRuntime;
11
- //# sourceMappingURL=store-factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-factory.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/store-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,GAAG,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAItD,OAAO,EAKL,aAAa,EAEb,YAAY,EAGb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAS,SAAS,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAS9D,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE;IAAE,kBAAkB,CAAC,EAAE,uBAAuB,CAAA;CAAE,GACpD,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAMrC;AAgGD,wBAAgB,mBAAmB,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAMhF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,YAAY,CA+BpG"}
@@ -1,104 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- import { decodeFile, encodeFile } from "../runtime/files.js";
3
- import { CarStoreImpl, FileStoreImpl, MetaStoreImpl, WALStoreImpl } from "./store.js";
4
- import { PARAM } from "../types.js";
5
- import { getGatewayFactoryItem } from "./register-store-protocol.js";
6
- import { InterceptorGateway } from "./interceptor-gateway.js";
7
- export async function getInterceptableGateway(ctx, url, opt) {
8
- const item = getGatewayFactoryItem(url.protocol);
9
- if (item) {
10
- return Result.Ok(new InterceptorGateway(ctx.loader.sthis, await item.serdegateway(ctx.loader.sthis), opt.gatewayInterceptor));
11
- }
12
- return Result.Err(ctx.loader.sthis.logger.Warn().Url(url).Msg("unsupported protocol").AsError());
13
- }
14
- async function carStoreFactory(ctx, uai) {
15
- const storeUrl = uai.url.build().setParam(PARAM.STORE, "car").URI();
16
- const rgateway = await getInterceptableGateway(ctx, storeUrl, uai);
17
- if (rgateway.isErr()) {
18
- throw ctx.loader.sthis.logger.Error().Result("err", rgateway).Url(uai.url).Msg("notfound").AsError();
19
- }
20
- const gateway = rgateway.Ok();
21
- const store = new CarStoreImpl(ctx.loader.sthis, uai.url, {
22
- gateway,
23
- loader: ctx.loader,
24
- });
25
- return store;
26
- }
27
- async function fileStoreFactory(ctx, uai) {
28
- const storeUrl = uai.url.build().setParam(PARAM.STORE, "file").URI();
29
- const rgateway = await getInterceptableGateway(ctx, storeUrl, uai);
30
- if (rgateway.isErr()) {
31
- throw ctx.loader.sthis.logger.Error().Result("err", rgateway).Url(uai.url).Msg("notfound").AsError();
32
- }
33
- const gateway = rgateway.Ok();
34
- const store = new FileStoreImpl(ctx.loader.sthis, uai.url, {
35
- gateway: gateway,
36
- loader: ctx.loader,
37
- });
38
- return store;
39
- }
40
- async function metaStoreFactory(ctx, uai) {
41
- const storeUrl = uai.url.build().setParam(PARAM.STORE, "meta").URI();
42
- const rgateway = await getInterceptableGateway(ctx, storeUrl, uai);
43
- if (rgateway.isErr()) {
44
- throw ctx.loader.sthis.logger.Error().Result("err", rgateway).Url(uai.url).Msg("notfound").AsError();
45
- }
46
- const gateway = rgateway.Ok();
47
- const store = new MetaStoreImpl(ctx.loader.sthis, uai.url, {
48
- gateway,
49
- loader: ctx.loader,
50
- });
51
- return store;
52
- }
53
- async function WALStoreFactory(ctx, uai) {
54
- const storeUrl = uai.url.build().setParam(PARAM.STORE, "wal").URI();
55
- const rgateway = await getInterceptableGateway(ctx, storeUrl, uai);
56
- if (rgateway.isErr()) {
57
- throw ctx.loader.sthis.logger.Error().Result("err", rgateway).Url(uai.url).Msg("notfound").AsError();
58
- }
59
- const gateway = rgateway.Ok();
60
- const store = new WALStoreImpl(ctx.loader.sthis, uai.url, {
61
- gateway,
62
- loader: ctx.loader,
63
- });
64
- return store;
65
- }
66
- async function ensureStart(store, damaw) {
67
- const ret = await store.start(damaw);
68
- if (ret.isErr()) {
69
- throw store.logger.Error().Result("start", ret).Msg("start failed").AsError();
70
- }
71
- return store;
72
- }
73
- export function ensureStoreEnDeFile(ende) {
74
- ende = ende || {};
75
- return {
76
- encodeFile: ende.encodeFile || encodeFile,
77
- decodeFile: ende.decodeFile || decodeFile,
78
- };
79
- }
80
- export function toStoreRuntime(sthis, endeOpts = {}) {
81
- return {
82
- makeStores: async (sfi) => {
83
- const ctx = {
84
- loader: sfi.loader,
85
- };
86
- const storeSet = {};
87
- storeSet.meta = await metaStoreFactory(ctx, sfi.byStore.meta);
88
- storeSet.car = await carStoreFactory(ctx, sfi.byStore.car);
89
- storeSet.file = await fileStoreFactory(ctx, sfi.byStore.file);
90
- if (sfi.byStore.wal) {
91
- storeSet.wal = await WALStoreFactory(ctx, sfi.byStore.wal);
92
- }
93
- await ensureStart(storeSet.meta, storeSet);
94
- await ensureStart(storeSet.car, storeSet);
95
- await ensureStart(storeSet.file, storeSet);
96
- if (storeSet.wal) {
97
- await ensureStart(storeSet.wal, storeSet);
98
- }
99
- return storeSet;
100
- },
101
- ...ensureStoreEnDeFile(endeOpts),
102
- };
103
- }
104
- //# sourceMappingURL=store-factory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-factory.js","sourceRoot":"","sources":["../../../../src/blockstore/store-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAYtF,OAAO,EAAE,KAAK,EAAa,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAS9D,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,GAAoB,EACpB,GAAQ,EACR,GAAqD;IAErD,MAAM,IAAI,GAAG,qBAAqB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,MAAM,CAAC,EAAE,CAAC,IAAI,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAChI,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG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AQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAC5C,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;QAMD,GAAG,mBAAmB,CAAC,QAAQ,CAAC;KACjC,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=store-remote.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-remote.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/store-remote.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=store-remote.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-remote.js","sourceRoot":"","sources":["../../../../src/blockstore/store-remote.ts"],"names":[],"mappings":""}
@@ -1,86 +0,0 @@
1
- import { Logger, ResolveOnce, Result, URI } from "@adviser/cement";
2
- import type { AnyBlock, AnyLink, CommitOpts, DataSaveOpts, DbMeta, WALStore as WALStore, WALState, LoadHandler, CryptoAction, Loadable, CarClockHead, DbMetaEvent, MetaStore, DataAndMetaStore, CarStore, FileStore } from "./types.js";
3
- import { Falsy, StoreType, SuperThis } from "../types.js";
4
- import { SerdeGateway, SerdeGatewayInterceptor } from "./serde-gateway.js";
5
- import { CommitQueue } from "./commit-queue.js";
6
- import { InterceptorGateway } from "./interceptor-gateway.js";
7
- export interface StoreOpts {
8
- readonly gateway: SerdeGateway;
9
- readonly gatewayInterceptor?: SerdeGatewayInterceptor;
10
- readonly loader: Loadable;
11
- }
12
- export interface BaseStoreOpts {
13
- readonly gateway: InterceptorGateway;
14
- readonly loader: Loadable;
15
- }
16
- export declare abstract class BaseStoreImpl {
17
- abstract readonly storeType: StoreType;
18
- private _url;
19
- readonly logger: Logger;
20
- readonly sthis: SuperThis;
21
- readonly gateway: InterceptorGateway;
22
- get realGateway(): SerdeGateway;
23
- readonly opts: StoreOpts;
24
- readonly loader: Loadable;
25
- readonly myId: string;
26
- constructor(sthis: SuperThis, url: URI, opts: BaseStoreOpts, logger: Logger);
27
- url(): URI;
28
- readonly _id: ResolveOnce<unknown, void>;
29
- id(): Promise<string>;
30
- readonly _onStarted: ((dam: DataAndMetaStore) => void)[];
31
- onStarted(fn: (dam: DataAndMetaStore) => void): void;
32
- readonly _onClosed: (() => void)[];
33
- onClosed(fn: () => void): void;
34
- abstract close(): Promise<Result<void>>;
35
- ready(): Promise<void>;
36
- keyedCrypto(): Promise<CryptoAction>;
37
- start(dam: DataAndMetaStore): Promise<Result<URI>>;
38
- }
39
- export declare function createDbMetaEvent(sthis: SuperThis, dbMeta: DbMeta, parents: CarClockHead): Promise<DbMetaEvent>;
40
- export declare class MetaStoreImpl extends BaseStoreImpl implements MetaStore {
41
- readonly storeType = "meta";
42
- readonly subscribers: Map<string, LoadHandler[]>;
43
- parents: CarClockHead;
44
- constructor(sthis: SuperThis, url: URI, opts: BaseStoreOpts);
45
- private updateParentsFromDbMetas;
46
- cnt: number;
47
- stream(branch?: string): ReadableStream<DbMeta[]>;
48
- save(meta: DbMeta, branch?: string): Promise<Result<void>>;
49
- close(): Promise<Result<void>>;
50
- destroy(): Promise<Result<void>>;
51
- }
52
- declare abstract class DataStoreImpl extends BaseStoreImpl {
53
- constructor(sthis: SuperThis, url: URI, opts: BaseStoreOpts, logger: Logger);
54
- load(cid: AnyLink): Promise<AnyBlock>;
55
- save(car: AnyBlock, opts?: DataSaveOpts): Promise<void>;
56
- remove(cid: AnyLink): Promise<Result<void>>;
57
- close(): Promise<Result<void>>;
58
- destroy(): Promise<Result<void>>;
59
- }
60
- export declare class CarStoreImpl extends DataStoreImpl implements CarStore {
61
- readonly storeType = "car";
62
- constructor(sthis: SuperThis, url: URI, opts: BaseStoreOpts);
63
- }
64
- export declare class FileStoreImpl extends DataStoreImpl implements FileStore {
65
- readonly storeType = "file";
66
- constructor(sthis: SuperThis, url: URI, opts: BaseStoreOpts);
67
- }
68
- export declare class WALStoreImpl extends BaseStoreImpl implements WALStore {
69
- readonly storeType = "wal";
70
- readonly _ready: ResolveOnce<void, void>;
71
- readonly walState: WALState;
72
- readonly processing?: Promise<void>;
73
- readonly processQueue: CommitQueue<unknown>;
74
- constructor(sthis: SuperThis, url: URI, opts: BaseStoreOpts);
75
- ready(): Promise<void>;
76
- enqueue(dbMeta: DbMeta, opts: CommitOpts): Promise<void>;
77
- enqueueFile(fileCid: AnyLink, publicFile?: boolean): Promise<void>;
78
- process(): Promise<void>;
79
- _doProcess(): Promise<void>;
80
- load(): Promise<WALState | Falsy>;
81
- save(state: WALState): Promise<void>;
82
- close(): Promise<Result<undefined, Error>>;
83
- destroy(): Promise<Result<void, Error>>;
84
- }
85
- export {};
86
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,KAAK,EACV,QAAQ,EACR,OAAO,EACP,UAAU,EACV,YAAY,EACZ,MAAM,EACN,QAAQ,IAAI,QAAQ,EACpB,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,YAAY,EAGZ,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAAS,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAqB,MAAM,oBAAoB,CAAC;AAG9F,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAS9D,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAE/B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,uBAAuB,CAAC;IACtD,QAAQ,CAAC,MAAM,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