mindoodb 0.0.2 → 0.0.4

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 (305) hide show
  1. package/README-server.md +1001 -0
  2. package/README.md +89 -28
  3. package/dist/__mocks__/expo-standard-web-crypto.d.ts +10 -0
  4. package/dist/__mocks__/expo-standard-web-crypto.d.ts.map +1 -0
  5. package/dist/__mocks__/expo-standard-web-crypto.js +22 -0
  6. package/dist/__mocks__/expo-standard-web-crypto.js.map +1 -0
  7. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.d.ts +8 -0
  8. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.d.ts.map +1 -0
  9. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.js +16 -0
  10. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.js.map +1 -0
  11. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.d.ts +1 -1
  12. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.d.ts.map +1 -1
  13. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.js +2 -2
  14. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.js.map +1 -1
  15. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts +30 -1
  16. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts.map +1 -1
  17. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js +152 -5
  18. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js.map +1 -1
  19. package/dist/appendonlystores/network/HttpTransport.d.ts +17 -2
  20. package/dist/appendonlystores/network/HttpTransport.d.ts.map +1 -1
  21. package/dist/appendonlystores/network/HttpTransport.js +129 -0
  22. package/dist/appendonlystores/network/HttpTransport.js.map +1 -1
  23. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts +22 -2
  24. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts.map +1 -1
  25. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js +110 -0
  26. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js.map +1 -1
  27. package/dist/appendonlystores/network/index.d.ts +1 -1
  28. package/dist/appendonlystores/network/index.d.ts.map +1 -1
  29. package/dist/appendonlystores/network/index.js.map +1 -1
  30. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.d.ts +65 -0
  31. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.d.ts.map +1 -0
  32. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.js +741 -0
  33. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.js.map +1 -0
  34. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.d.ts +25 -0
  35. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.d.ts.map +1 -0
  36. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.js +41 -0
  37. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.js.map +1 -0
  38. package/dist/browser/cache/IndexedDBLocalCacheStore.d.ts +21 -0
  39. package/dist/browser/cache/IndexedDBLocalCacheStore.d.ts.map +1 -0
  40. package/dist/browser/cache/IndexedDBLocalCacheStore.js +106 -0
  41. package/dist/browser/cache/IndexedDBLocalCacheStore.js.map +1 -0
  42. package/dist/browser/index.d.ts +8 -0
  43. package/dist/browser/index.d.ts.map +1 -1
  44. package/dist/browser/index.js +21 -1
  45. package/dist/browser/index.js.map +1 -1
  46. package/dist/core/BaseMindooDB.d.ts +115 -13
  47. package/dist/core/BaseMindooDB.d.ts.map +1 -1
  48. package/dist/core/BaseMindooDB.js +1232 -269
  49. package/dist/core/BaseMindooDB.js.map +1 -1
  50. package/dist/core/BaseMindooTenant.d.ts +69 -6
  51. package/dist/core/BaseMindooTenant.d.ts.map +1 -1
  52. package/dist/core/BaseMindooTenant.js +302 -109
  53. package/dist/core/BaseMindooTenant.js.map +1 -1
  54. package/dist/core/BaseMindooTenantDirectory.d.ts +13 -10
  55. package/dist/core/BaseMindooTenantDirectory.d.ts.map +1 -1
  56. package/dist/core/BaseMindooTenantDirectory.js +144 -27
  57. package/dist/core/BaseMindooTenantDirectory.js.map +1 -1
  58. package/dist/core/BaseMindooTenantFactory.d.ts +27 -29
  59. package/dist/core/BaseMindooTenantFactory.d.ts.map +1 -1
  60. package/dist/core/BaseMindooTenantFactory.js +185 -112
  61. package/dist/core/BaseMindooTenantFactory.js.map +1 -1
  62. package/dist/core/MindooDBServerAdmin.d.ts +238 -0
  63. package/dist/core/MindooDBServerAdmin.d.ts.map +1 -0
  64. package/dist/core/MindooDBServerAdmin.js +345 -0
  65. package/dist/core/MindooDBServerAdmin.js.map +1 -0
  66. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.d.ts +68 -0
  67. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.d.ts.map +1 -0
  68. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.js +659 -0
  69. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.js.map +1 -0
  70. package/dist/core/appendonlystores/InMemoryContentAddressedStore.d.ts +45 -3
  71. package/dist/core/appendonlystores/InMemoryContentAddressedStore.d.ts.map +1 -1
  72. package/dist/core/appendonlystores/InMemoryContentAddressedStore.js +184 -23
  73. package/dist/core/appendonlystores/InMemoryContentAddressedStore.js.map +1 -1
  74. package/dist/core/appendonlystores/MaterializationPlanner.d.ts +49 -0
  75. package/dist/core/appendonlystores/MaterializationPlanner.d.ts.map +1 -0
  76. package/dist/core/appendonlystores/MaterializationPlanner.js +325 -0
  77. package/dist/core/appendonlystores/MaterializationPlanner.js.map +1 -0
  78. package/dist/core/appendonlystores/bloom.d.ts +85 -0
  79. package/dist/core/appendonlystores/bloom.d.ts.map +1 -0
  80. package/dist/core/appendonlystores/bloom.js +228 -0
  81. package/dist/core/appendonlystores/bloom.js.map +1 -0
  82. package/dist/core/appendonlystores/network/NetworkTransport.d.ts +37 -2
  83. package/dist/core/appendonlystores/network/NetworkTransport.d.ts.map +1 -1
  84. package/dist/core/appendonlystores/network/types.d.ts +12 -0
  85. package/dist/core/appendonlystores/network/types.d.ts.map +1 -1
  86. package/dist/core/appendonlystores/network/types.js.map +1 -1
  87. package/dist/core/appendonlystores/types.d.ts +206 -0
  88. package/dist/core/appendonlystores/types.d.ts.map +1 -1
  89. package/dist/core/automerge-adapter.d.ts +15 -0
  90. package/dist/core/automerge-adapter.d.ts.map +1 -0
  91. package/dist/core/automerge-adapter.js +73 -0
  92. package/dist/core/automerge-adapter.js.map +1 -0
  93. package/dist/core/cache/CacheManager.d.ts +75 -0
  94. package/dist/core/cache/CacheManager.d.ts.map +1 -0
  95. package/dist/core/cache/CacheManager.js +101 -0
  96. package/dist/core/cache/CacheManager.js.map +1 -0
  97. package/dist/core/cache/EncryptedLocalCacheStore.d.ts +41 -0
  98. package/dist/core/cache/EncryptedLocalCacheStore.d.ts.map +1 -0
  99. package/dist/core/cache/EncryptedLocalCacheStore.js +120 -0
  100. package/dist/core/cache/EncryptedLocalCacheStore.js.map +1 -0
  101. package/dist/core/cache/LocalCacheStore.d.ts +50 -0
  102. package/dist/core/cache/LocalCacheStore.d.ts.map +1 -0
  103. package/dist/core/cache/LocalCacheStore.js +39 -0
  104. package/dist/core/cache/LocalCacheStore.js.map +1 -0
  105. package/dist/core/crypto/pbkdf2Iterations.d.ts +12 -0
  106. package/dist/core/crypto/pbkdf2Iterations.d.ts.map +1 -0
  107. package/dist/core/crypto/pbkdf2Iterations.js +55 -0
  108. package/dist/core/crypto/pbkdf2Iterations.js.map +1 -0
  109. package/dist/core/crypto/privateKeyEncryption.d.ts +5 -0
  110. package/dist/core/crypto/privateKeyEncryption.d.ts.map +1 -0
  111. package/dist/core/crypto/privateKeyEncryption.js +87 -0
  112. package/dist/core/crypto/privateKeyEncryption.js.map +1 -0
  113. package/dist/core/index.d.ts +18 -6
  114. package/dist/core/index.d.ts.map +1 -1
  115. package/dist/core/index.js +42 -1
  116. package/dist/core/index.js.map +1 -1
  117. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.d.ts +4 -1
  118. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.d.ts.map +1 -1
  119. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.js +39 -11
  120. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.js.map +1 -1
  121. package/dist/core/indexing/virtualviews/ViewEntrySortKeyComparator.d.ts +1 -0
  122. package/dist/core/indexing/virtualviews/ViewEntrySortKeyComparator.d.ts.map +1 -1
  123. package/dist/core/indexing/virtualviews/ViewEntrySortKeyComparator.js +3 -0
  124. package/dist/core/indexing/virtualviews/ViewEntrySortKeyComparator.js.map +1 -1
  125. package/dist/core/indexing/virtualviews/VirtualView.d.ts +43 -0
  126. package/dist/core/indexing/virtualviews/VirtualView.d.ts.map +1 -1
  127. package/dist/core/indexing/virtualviews/VirtualView.js +173 -0
  128. package/dist/core/indexing/virtualviews/VirtualView.js.map +1 -1
  129. package/dist/core/indexing/virtualviews/VirtualViewEntryData.d.ts +7 -0
  130. package/dist/core/indexing/virtualviews/VirtualViewEntryData.d.ts.map +1 -1
  131. package/dist/core/indexing/virtualviews/VirtualViewEntryData.js +28 -0
  132. package/dist/core/indexing/virtualviews/VirtualViewEntryData.js.map +1 -1
  133. package/dist/core/keys/KeyBag.d.ts +56 -12
  134. package/dist/core/keys/KeyBag.d.ts.map +1 -1
  135. package/dist/core/keys/KeyBag.js +156 -70
  136. package/dist/core/keys/KeyBag.js.map +1 -1
  137. package/dist/core/keys/KeyContext.d.ts +4 -0
  138. package/dist/core/keys/KeyContext.d.ts.map +1 -0
  139. package/dist/core/keys/KeyContext.js +17 -0
  140. package/dist/core/keys/KeyContext.js.map +1 -0
  141. package/dist/core/types.d.ts +512 -60
  142. package/dist/core/types.d.ts.map +1 -1
  143. package/dist/core/types.js +9 -1
  144. package/dist/core/types.js.map +1 -1
  145. package/dist/core/uri/MindooURI.d.ts +58 -0
  146. package/dist/core/uri/MindooURI.d.ts.map +1 -0
  147. package/dist/core/uri/MindooURI.js +169 -0
  148. package/dist/core/uri/MindooURI.js.map +1 -0
  149. package/dist/core/userid/index.d.ts +0 -10
  150. package/dist/core/userid/index.d.ts.map +1 -1
  151. package/dist/core/utils/idGeneration.d.ts.map +1 -1
  152. package/dist/core/utils/idGeneration.js +37 -3
  153. package/dist/core/utils/idGeneration.js.map +1 -1
  154. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.d.ts +544 -0
  155. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.d.ts.map +1 -0
  156. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.js +1358 -0
  157. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.js.map +1 -0
  158. package/dist/node/attachments/writeAttachmentToFile.d.ts +15 -0
  159. package/dist/node/attachments/writeAttachmentToFile.d.ts.map +1 -0
  160. package/dist/node/attachments/writeAttachmentToFile.js +73 -0
  161. package/dist/node/attachments/writeAttachmentToFile.js.map +1 -0
  162. package/dist/node/cache/FileSystemLocalCacheStore.d.ts +17 -0
  163. package/dist/node/cache/FileSystemLocalCacheStore.d.ts.map +1 -0
  164. package/dist/node/cache/FileSystemLocalCacheStore.js +128 -0
  165. package/dist/node/cache/FileSystemLocalCacheStore.js.map +1 -0
  166. package/dist/node/cli/change-identity-password.d.ts +7 -0
  167. package/dist/node/cli/change-identity-password.d.ts.map +1 -0
  168. package/dist/node/cli/change-identity-password.js +67 -0
  169. package/dist/node/cli/change-identity-password.js.map +1 -0
  170. package/dist/node/cli/cli-utils.d.ts +16 -0
  171. package/dist/node/cli/cli-utils.d.ts.map +1 -0
  172. package/dist/node/cli/cli-utils.js +113 -0
  173. package/dist/node/cli/cli-utils.js.map +1 -0
  174. package/dist/node/cli/identity-export-public.d.ts +4 -0
  175. package/dist/node/cli/identity-export-public.d.ts.map +1 -0
  176. package/dist/node/cli/identity-export-public.js +55 -0
  177. package/dist/node/cli/identity-export-public.js.map +1 -0
  178. package/dist/node/cli/identity-info.d.ts +4 -0
  179. package/dist/node/cli/identity-info.d.ts.map +1 -0
  180. package/dist/node/cli/identity-info.js +57 -0
  181. package/dist/node/cli/identity-info.js.map +1 -0
  182. package/dist/node/index.d.ts +2 -0
  183. package/dist/node/index.d.ts.map +1 -1
  184. package/dist/node/index.js +8 -1
  185. package/dist/node/index.js.map +1 -1
  186. package/dist/node/server/CapabilityMatcher.d.ts +45 -0
  187. package/dist/node/server/CapabilityMatcher.d.ts.map +1 -0
  188. package/dist/node/server/CapabilityMatcher.js +117 -0
  189. package/dist/node/server/CapabilityMatcher.js.map +1 -0
  190. package/dist/node/server/MindooDBServer.d.ts +87 -0
  191. package/dist/node/server/MindooDBServer.d.ts.map +1 -0
  192. package/dist/node/server/MindooDBServer.js +1040 -0
  193. package/dist/node/server/MindooDBServer.js.map +1 -0
  194. package/dist/node/server/ServerSync.d.ts +41 -0
  195. package/dist/node/server/ServerSync.d.ts.map +1 -0
  196. package/dist/node/server/ServerSync.js +187 -0
  197. package/dist/node/server/ServerSync.js.map +1 -0
  198. package/dist/node/server/StoreFactory.d.ts +45 -0
  199. package/dist/node/server/StoreFactory.d.ts.map +1 -0
  200. package/dist/node/server/StoreFactory.js +89 -0
  201. package/dist/node/server/StoreFactory.js.map +1 -0
  202. package/dist/node/server/SystemAdminAuth.d.ts +65 -0
  203. package/dist/node/server/SystemAdminAuth.d.ts.map +1 -0
  204. package/dist/node/server/SystemAdminAuth.js +200 -0
  205. package/dist/node/server/SystemAdminAuth.js.map +1 -0
  206. package/dist/node/server/SystemIpAllowlist.d.ts +21 -0
  207. package/dist/node/server/SystemIpAllowlist.d.ts.map +1 -0
  208. package/dist/node/server/SystemIpAllowlist.js +210 -0
  209. package/dist/node/server/SystemIpAllowlist.js.map +1 -0
  210. package/dist/node/server/TenantManager.d.ts +85 -0
  211. package/dist/node/server/TenantManager.d.ts.map +1 -0
  212. package/dist/node/server/TenantManager.js +493 -0
  213. package/dist/node/server/TenantManager.js.map +1 -0
  214. package/dist/node/server/add-to-network.d.ts +20 -0
  215. package/dist/node/server/add-to-network.d.ts.map +1 -0
  216. package/dist/node/server/add-to-network.js +275 -0
  217. package/dist/node/server/add-to-network.js.map +1 -0
  218. package/dist/node/server/config.d.ts +51 -0
  219. package/dist/node/server/config.d.ts.map +1 -0
  220. package/dist/node/server/config.js +218 -0
  221. package/dist/node/server/config.js.map +1 -0
  222. package/dist/node/server/resolveServerPassword.d.ts +7 -0
  223. package/dist/node/server/resolveServerPassword.d.ts.map +1 -0
  224. package/dist/node/server/resolveServerPassword.js +25 -0
  225. package/dist/node/server/resolveServerPassword.js.map +1 -0
  226. package/dist/node/server/server.d.ts +22 -0
  227. package/dist/node/server/server.d.ts.map +1 -0
  228. package/dist/node/server/server.js +225 -0
  229. package/dist/node/server/server.js.map +1 -0
  230. package/dist/node/server/serverinit.d.ts +21 -0
  231. package/dist/node/server/serverinit.d.ts.map +1 -0
  232. package/dist/node/server/serverinit.js +317 -0
  233. package/dist/node/server/serverinit.js.map +1 -0
  234. package/dist/node/server/types.d.ts +162 -0
  235. package/dist/node/server/types.d.ts.map +1 -0
  236. package/dist/node/server/types.js +24 -0
  237. package/dist/node/server/types.js.map +1 -0
  238. package/dist/node/server/validation.d.ts +47 -0
  239. package/dist/node/server/validation.d.ts.map +1 -0
  240. package/dist/node/server/validation.js +114 -0
  241. package/dist/node/server/validation.js.map +1 -0
  242. package/dist/reactnative/cache/MMKVLocalCacheStore.d.ts +48 -0
  243. package/dist/reactnative/cache/MMKVLocalCacheStore.d.ts.map +1 -0
  244. package/dist/reactnative/cache/MMKVLocalCacheStore.js +113 -0
  245. package/dist/reactnative/cache/MMKVLocalCacheStore.js.map +1 -0
  246. package/dist/reactnative/crypto/AESAdapter.d.ts +18 -0
  247. package/dist/reactnative/crypto/AESAdapter.d.ts.map +1 -0
  248. package/dist/reactnative/crypto/AESAdapter.js +112 -0
  249. package/dist/reactnative/crypto/AESAdapter.js.map +1 -0
  250. package/dist/reactnative/crypto/Ed25519Adapter.d.ts +34 -0
  251. package/dist/reactnative/crypto/Ed25519Adapter.d.ts.map +1 -0
  252. package/dist/reactnative/crypto/Ed25519Adapter.js +386 -0
  253. package/dist/reactnative/crypto/Ed25519Adapter.js.map +1 -0
  254. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.d.ts +23 -0
  255. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.d.ts.map +1 -0
  256. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.js +51 -0
  257. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.js.map +1 -0
  258. package/dist/reactnative/crypto/HMACAdapter.d.ts +13 -0
  259. package/dist/reactnative/crypto/HMACAdapter.d.ts.map +1 -0
  260. package/dist/reactnative/crypto/HMACAdapter.js +50 -0
  261. package/dist/reactnative/crypto/HMACAdapter.js.map +1 -0
  262. package/dist/reactnative/crypto/KeyFormatConverter.d.ts +21 -0
  263. package/dist/reactnative/crypto/KeyFormatConverter.d.ts.map +1 -0
  264. package/dist/reactnative/crypto/KeyFormatConverter.js +72 -0
  265. package/dist/reactnative/crypto/KeyFormatConverter.js.map +1 -0
  266. package/dist/reactnative/crypto/PBKDF2Adapter.d.ts +19 -0
  267. package/dist/reactnative/crypto/PBKDF2Adapter.d.ts.map +1 -0
  268. package/dist/reactnative/crypto/PBKDF2Adapter.js +67 -0
  269. package/dist/reactnative/crypto/PBKDF2Adapter.js.map +1 -0
  270. package/dist/reactnative/crypto/QuickCryptoAdapter.d.ts +37 -0
  271. package/dist/reactnative/crypto/QuickCryptoAdapter.d.ts.map +1 -0
  272. package/dist/reactnative/crypto/QuickCryptoAdapter.js +72 -0
  273. package/dist/reactnative/crypto/QuickCryptoAdapter.js.map +1 -0
  274. package/dist/reactnative/crypto/RSAAdapter.d.ts +38 -0
  275. package/dist/reactnative/crypto/RSAAdapter.d.ts.map +1 -0
  276. package/dist/reactnative/crypto/RSAAdapter.js +184 -0
  277. package/dist/reactnative/crypto/RSAAdapter.js.map +1 -0
  278. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.d.ts +33 -0
  279. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.d.ts.map +1 -0
  280. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.js +61 -0
  281. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.js.map +1 -0
  282. package/dist/reactnative/crypto/SHA256Adapter.d.ts +9 -0
  283. package/dist/reactnative/crypto/SHA256Adapter.d.ts.map +1 -0
  284. package/dist/reactnative/crypto/SHA256Adapter.js +29 -0
  285. package/dist/reactnative/crypto/SHA256Adapter.js.map +1 -0
  286. package/dist/reactnative/crypto/SubtleCryptoPolyfill.d.ts +63 -0
  287. package/dist/reactnative/crypto/SubtleCryptoPolyfill.d.ts.map +1 -0
  288. package/dist/reactnative/crypto/SubtleCryptoPolyfill.js +350 -0
  289. package/dist/reactnative/crypto/SubtleCryptoPolyfill.js.map +1 -0
  290. package/dist/reactnative/index.d.ts +9 -0
  291. package/dist/reactnative/index.d.ts.map +1 -0
  292. package/dist/reactnative/index.js +41 -0
  293. package/dist/reactnative/index.js.map +1 -0
  294. package/package.json +63 -7
  295. package/patches/PATCHES.md +111 -0
  296. package/patches/react-native+0.76.9.patch +34 -0
  297. package/patches/react-native-quick-crypto+1.0.7.patch +42 -0
  298. package/scripts/cli.js +21 -0
  299. package/scripts/setup-react-native.js +228 -0
  300. package/templates/reactnative/App.js +252 -0
  301. package/templates/reactnative/app.json +29 -0
  302. package/templates/reactnative/babel.config.js +6 -0
  303. package/templates/reactnative/index.js +26 -0
  304. package/templates/reactnative/metro.config.snippet.js +39 -0
  305. package/templates/reactnative/mindoodb-polyfills.js +116 -0
@@ -0,0 +1,544 @@
1
+ /**
2
+ * Node.js filesystem-backed implementation of {@link ContentAddressedStore}.
3
+ *
4
+ * This module provides a persistent, crash-resilient content-addressed store
5
+ * designed for the MindooDB sync protocol. Each database gets its own
6
+ * directory subtree where entry metadata (JSON) and encrypted payloads (binary)
7
+ * are stored as individual files. An optional in-memory index accelerates
8
+ * lookups, cursor-based scans, and bloom-filter generation for efficient
9
+ * network sync.
10
+ *
11
+ * ### On-disk layout
12
+ *
13
+ * ```
14
+ * <basePath>/<dbId>/
15
+ * entries/ one JSON file per entry id (source of truth)
16
+ * content/ one .bin file per unique contentHash
17
+ * metadata-index.json compact snapshot of the in-memory index
18
+ * metadata-segments/ append-only mutation log (upsert / delete)
19
+ * ```
20
+ *
21
+ * ### Durability & crash safety
22
+ *
23
+ * Every file write follows a write-tmp → fsync → atomic-rename → dir-fsync
24
+ * protocol so readers never observe partially written data. Metadata segments
25
+ * provide a low-write-amplification WAL that is periodically compacted into a
26
+ * full snapshot.
27
+ *
28
+ * ### Indexing
29
+ *
30
+ * When `indexingEnabled` is true (the default), the store maintains three
31
+ * in-memory structures:
32
+ * - `entries` — Map<id, metadata> for O(1) point lookups
33
+ * - `docIndex` — Map<docId, Set<id>> for fast per-document queries
34
+ * - `orderedMetadata` — sorted array for O(log N) cursor scans
35
+ *
36
+ * On startup the index is reconstructed from (snapshot + segments), then
37
+ * validated against the authoritative entry files.
38
+ *
39
+ * @module BasicOnDiskContentAddressedStore
40
+ */
41
+ import { ContentAddressedStore, ContentAddressedStoreFactory, CreateStoreResult, DocumentMaterializationBatchPlan, DocumentMaterializationPlan, MaterializationPlanOptions, OpenStoreOptions, StoreIndexBuildStatus, StoreCompactionStatus, AwaitIndexReadyOptions, StoreScanCursor, StoreScanFilters, StoreScanResult, StoreIdBloomSummary } from "../../core/appendonlystores/types";
42
+ import type { StoreEntry, StoreEntryMetadata, StoreEntryType } from "../../core/types";
43
+ import { Logger } from "../../core/logging";
44
+ /**
45
+ * Node.js persistent ContentAddressedStore implementation.
46
+ *
47
+ * On-disk layout per database id:
48
+ *
49
+ * <basePath>/<dbId>/
50
+ * entries/ // one metadata JSON file per entry id
51
+ * content/ // one binary payload file per contentHash
52
+ * metadata-index.json // compact snapshot of ordered metadata (optional)
53
+ * metadata-segments/ // append-only metadata mutation log (optional)
54
+ *
55
+ * Design goals:
56
+ * - Strong visibility: readers only observe committed files (atomic rename).
57
+ * - Crash resilience: fsync + rename + directory fsync for durability.
58
+ * - High sync/read throughput: in-memory ordered index + cursor scan.
59
+ * - Low write amplification: append metadata segments, compact periodically.
60
+ */
61
+ export declare class BasicOnDiskContentAddressedStore implements ContentAddressedStore {
62
+ /** Unique database identifier; used as the top-level directory name. */
63
+ private readonly dbId;
64
+ /** Logger scoped to this store instance. */
65
+ private readonly logger;
66
+ /** Root directory for this database: `<basePath>/<dbId>`. */
67
+ private readonly storeRoot;
68
+ /** Directory containing one JSON metadata file per entry id. */
69
+ private readonly entriesDir;
70
+ /** Directory containing one `.bin` payload file per unique contentHash. */
71
+ private readonly contentDir;
72
+ /** Path to the compact metadata-index snapshot file. */
73
+ private readonly metadataIndexPath;
74
+ /** Directory containing append-only metadata segment files. */
75
+ private readonly metadataSegmentsDir;
76
+ /** Whether in-memory indexing is active (default true). */
77
+ private readonly indexingEnabled;
78
+ /** Trigger compaction when this many segment files have accumulated. */
79
+ private readonly metadataSegmentCompactionMinFiles;
80
+ /** Trigger compaction when segment files exceed this total byte size. */
81
+ private readonly metadataSegmentCompactionMaxBytes;
82
+ /**
83
+ * Set of segment file names that have been replayed into the in-memory
84
+ * index (or were appended by this process). Only these files are eligible
85
+ * for compaction — files that appeared concurrently from another process
86
+ * are excluded until they have been replayed.
87
+ */
88
+ private readonly appliedMetadataSegmentFiles;
89
+ /** Cumulative compaction statistics exposed via {@link getCompactionStatus}. */
90
+ private compactionStatus;
91
+ /**
92
+ * Resolves once the store directories exist and the in-memory index has been
93
+ * built. Every public method awaits this promise before proceeding.
94
+ */
95
+ private initPromise;
96
+ /**
97
+ * Primary index: entry id -> full metadata.
98
+ * Provides O(1) point lookups for `hasEntries`, `getEntries`,
99
+ * `readMetadataById`, and dependency traversal.
100
+ */
101
+ private entries;
102
+ /**
103
+ * Secondary index: docId -> set of entry ids belonging to that document.
104
+ * Enables fast per-document queries in `findNewEntriesForDoc`.
105
+ */
106
+ private docIndex;
107
+ /**
108
+ * Reference count per content hash. Tracks how many entry ids share the
109
+ * same payload blob, used during `purgeDocHistory` to decide whether a
110
+ * content file can be safely deleted.
111
+ */
112
+ private contentRefCount;
113
+ /**
114
+ * All metadata sorted by `(createdAt ASC, id ASC)`.
115
+ * Supports O(log N) lower-bound binary search for cursor-based scans
116
+ * in {@link scanEntriesSince}.
117
+ */
118
+ private orderedMetadata;
119
+ /** Current phase and progress of the index build (building / ready). */
120
+ private indexStatus;
121
+ /**
122
+ * Create a new on-disk content-addressed store for the given database id.
123
+ *
124
+ * Initialization (directory creation, index loading) happens asynchronously.
125
+ * All public methods internally await the init promise so callers do not
126
+ * need to wait explicitly — but {@link awaitIndexReady} can be used to
127
+ * observe progress.
128
+ *
129
+ * @param dbId Unique database identifier (becomes the directory name).
130
+ * @param logger Optional logger; a default console logger is created if omitted.
131
+ * @param options Store configuration (base path, indexing, compaction thresholds, etc.).
132
+ */
133
+ constructor(dbId: string, logger?: Logger, options?: OpenStoreOptions);
134
+ /**
135
+ * One-time async initialization performed in the constructor's microtask.
136
+ *
137
+ * Steps:
138
+ * 1. Optionally wipe all local data (if `clearLocalDataOnStartup`).
139
+ * 2. Ensure on-disk directory structure exists.
140
+ * 3. When indexing is enabled:
141
+ * a. Attempt to load the persisted metadata-index snapshot (fast path).
142
+ * b. Replay any append-only segment files written since the snapshot.
143
+ * c. Validate the resulting in-memory index against the authoritative
144
+ * entry files on disk.
145
+ * d. If validation fails (stale snapshot, corruption, etc.), do a full
146
+ * rebuild from the entry files and write a fresh snapshot.
147
+ */
148
+ private initialize;
149
+ /** Block until async initialization has completed. Called by every public method. */
150
+ private ensureInitialized;
151
+ /**
152
+ * Unconditionally remove the entire store directory tree and reset all
153
+ * in-memory state. Called by the constructor when `clearLocalDataOnStartup`
154
+ * is set, and by {@link clearAllLocalData} at runtime.
155
+ */
156
+ private clearAllLocalDataInternal;
157
+ /**
158
+ * Full index rebuild from the authoritative entry files on disk.
159
+ *
160
+ * Clears all in-memory structures, reads every `entries/*.json` file,
161
+ * populates the primary, secondary, and ref-count indexes, and finally
162
+ * sorts `orderedMetadata` by `(createdAt, id)`.
163
+ *
164
+ * This is the slowest startup path (O(N) filesystem reads) and is only
165
+ * used when the persisted snapshot + segments cannot be validated.
166
+ */
167
+ private rebuildInMemoryIndexes;
168
+ /**
169
+ * Attempt to hydrate the in-memory index from the persisted
170
+ * `metadata-index.json` snapshot.
171
+ *
172
+ * This is the fast startup path: a single file read replaces the need to
173
+ * enumerate and parse every individual entry file.
174
+ *
175
+ * @returns `true` if the snapshot was loaded successfully; `false` if it
176
+ * does not exist or could not be parsed (caller should fall back
177
+ * to a full rebuild).
178
+ */
179
+ private tryLoadPersistedIndex;
180
+ /**
181
+ * Validate that the in-memory index (loaded from snapshot + segments)
182
+ * is consistent with the authoritative entry files on disk.
183
+ *
184
+ * Checks two invariants:
185
+ * 1. The number of entry files matches `this.entries.size`.
186
+ * 2. Every entry file's id exists in the in-memory map.
187
+ *
188
+ * This is a cheap O(N) directory listing + set-membership check (no file
189
+ * reads) that catches stale snapshots, missing segments, and external
190
+ * mutations that happened while the process was down.
191
+ *
192
+ * @returns `true` if the index fully covers the on-disk entries.
193
+ */
194
+ private validatePersistedIndexCoverage;
195
+ /**
196
+ * Write a full metadata-index snapshot to disk.
197
+ *
198
+ * Serializes the entire `orderedMetadata` array to `metadata-index.json`
199
+ * using an atomic write. After this, all segment files that have been
200
+ * replayed into the in-memory state are redundant and can be deleted.
201
+ */
202
+ private persistMetadataIndex;
203
+ /**
204
+ * Delete the given segment files from disk and remove them from the
205
+ * `appliedMetadataSegmentFiles` tracking set.
206
+ *
207
+ * Deletion failures (e.g. race with another process) are silently ignored.
208
+ */
209
+ private clearMetadataSegments;
210
+ /**
211
+ * List all `.json` segment files in the segments directory, sorted
212
+ * lexicographically. Since segment filenames are prefixed with a
213
+ * millisecond timestamp, lexicographic order approximates chronological
214
+ * append order.
215
+ */
216
+ private listMetadataSegmentFiles;
217
+ /**
218
+ * Replay all segment files into the in-memory index.
219
+ *
220
+ * Each segment file contains a JSON array of upsert/delete records.
221
+ * They are applied in lexicographic filename order (≈ chronological order)
222
+ * on top of whatever state the snapshot already provided.
223
+ *
224
+ * Successfully replayed files are tracked in `appliedMetadataSegmentFiles`
225
+ * so they become eligible for compaction. Corrupt or unreadable segment
226
+ * files are warned about and skipped — the subsequent
227
+ * {@link validatePersistedIndexCoverage} step will catch any resulting
228
+ * inconsistencies.
229
+ */
230
+ private replayMetadataSegments;
231
+ /**
232
+ * Append a new segment file containing the given mutation records.
233
+ *
234
+ * Segment files act as a lightweight write-ahead log: rather than
235
+ * rewriting the entire metadata-index snapshot on every mutation, we
236
+ * append a small file. This keeps per-write I/O proportional to the
237
+ * batch size rather than total store size.
238
+ *
239
+ * After writing, triggers {@link maybeCompactMetadataSegments} to check
240
+ * whether the accumulated segments should be folded into a fresh snapshot.
241
+ */
242
+ private appendMetadataSegment;
243
+ /**
244
+ * Conditionally compact metadata segments when a threshold is exceeded.
245
+ *
246
+ * Two independent thresholds can trigger compaction:
247
+ * - **File count**: the number of applied segment files ≥
248
+ * `metadataSegmentCompactionMinFiles`.
249
+ * - **Total bytes**: the cumulative size of applied segment files ≥
250
+ * `metadataSegmentCompactionMaxBytes`.
251
+ *
252
+ * Compaction writes a fresh metadata-index snapshot (which already
253
+ * includes all replayed segment data) and then deletes the covered
254
+ * segment files. Only files tracked in `appliedMetadataSegmentFiles`
255
+ * are compacted — files written concurrently by another process are
256
+ * left untouched.
257
+ *
258
+ * Compaction statistics are accumulated in `this.compactionStatus`.
259
+ */
260
+ private maybeCompactMetadataSegments;
261
+ /**
262
+ * Sum the on-disk sizes of the given segment files.
263
+ * Used to evaluate the byte-based compaction threshold.
264
+ * Files that have been deleted between listing and stat are silently skipped.
265
+ */
266
+ private computeSegmentFilesTotalBytes;
267
+ /**
268
+ * Compare two metadata entries by the canonical sort key `(createdAt, id)`.
269
+ * Used to maintain and query the `orderedMetadata` sorted array.
270
+ */
271
+ private compareMetadata;
272
+ /**
273
+ * Binary search for the first index in `orderedMetadata` that is strictly
274
+ * greater than the given cursor position `(createdAt, id)`.
275
+ *
276
+ * Returns 0 when cursor is `null` (start from the beginning).
277
+ * Runs in O(log N) time.
278
+ */
279
+ private lowerBoundForCursor;
280
+ /**
281
+ * Test whether a metadata entry passes the given scan filters.
282
+ * Evaluates docId, entryTypes whitelist, and creationDate range.
283
+ * Returns `true` when no filters are provided or all checks pass.
284
+ */
285
+ private metadataMatchesFilters;
286
+ /**
287
+ * Insert a metadata entry into `orderedMetadata` at the correct sorted
288
+ * position using binary search + splice. O(log N) search + O(N) splice.
289
+ */
290
+ private insertOrderedMetadata;
291
+ /**
292
+ * Remove an entry from `orderedMetadata` by id.
293
+ * Uses a linear scan; acceptable because removals (purge) are rare.
294
+ */
295
+ private removeOrderedMetadataById;
296
+ /**
297
+ * Remove an entry from all in-memory indexes.
298
+ *
299
+ * Updates `entries`, `docIndex`, `orderedMetadata`, and `contentRefCount`.
300
+ * When the content hash reference count drops to zero, the hash is removed
301
+ * from the ref-count map (the caller is responsible for deleting the
302
+ * on-disk content file if needed).
303
+ */
304
+ private applyMetadataDelete;
305
+ /**
306
+ * Insert or replace an entry in all in-memory indexes.
307
+ *
308
+ * If the id already exists, the old entry is removed first (via
309
+ * {@link applyMetadataDelete}) before the new one is inserted.
310
+ * Updates `entries`, `docIndex`, `orderedMetadata`, and `contentRefCount`.
311
+ */
312
+ private applyMetadataUpsert;
313
+ /** List all `.json` files in the `entries/` directory. */
314
+ private listEntryFiles;
315
+ /** Resolve the absolute path to the metadata file for a given entry id. */
316
+ private metadataPathForId;
317
+ /** Resolve the absolute path to the binary content file for a given hash. */
318
+ private contentPathForHash;
319
+ /** Check whether a file exists without reading its contents. */
320
+ private fileExists;
321
+ /**
322
+ * Write data to a file with full crash-safety guarantees.
323
+ *
324
+ * Protocol:
325
+ * 1. Write to a temporary file (unique per process + timestamp + random).
326
+ * 2. `fsync` the temp file to flush OS buffers to disk.
327
+ * 3. Atomically `rename` temp → final path (POSIX guarantees atomicity).
328
+ * 4. `fsync` the parent directory so the new directory entry is durable.
329
+ *
330
+ * This ensures readers never observe a partially written file, even after
331
+ * an unclean shutdown.
332
+ */
333
+ private writeFileAtomic;
334
+ /**
335
+ * Fsync the parent directory of a file to ensure its directory entry
336
+ * update is persisted. Required on POSIX systems after rename/unlink
337
+ * to guarantee that the directory metadata change survives a crash.
338
+ *
339
+ * Failures are logged at debug level and swallowed — some platforms
340
+ * (e.g. certain macOS configurations) do not support opening directories
341
+ * for fsync.
342
+ */
343
+ private syncParentDirectory;
344
+ /**
345
+ * Look up an entry's metadata by id.
346
+ *
347
+ * When indexing is enabled, this is an O(1) in-memory map lookup.
348
+ * Otherwise, falls back to reading the entry file from disk.
349
+ *
350
+ * @returns The metadata if found, or `null`.
351
+ */
352
+ private readMetadataById;
353
+ /**
354
+ * Read and deserialize a metadata entry directly from its on-disk file.
355
+ * Used during index rebuilds and non-indexed fallback paths.
356
+ * Parse failures are logged and result in `null`.
357
+ */
358
+ private readMetadataByFileName;
359
+ /**
360
+ * Return all metadata entries in the store.
361
+ *
362
+ * When indexing is enabled, returns a shallow copy of `orderedMetadata`
363
+ * (already sorted). Otherwise, reads and parses every entry file from
364
+ * disk (unsorted).
365
+ */
366
+ private listAllMetadata;
367
+ /** Return the database id this store was created for. */
368
+ getId(): string;
369
+ getCacheIdentity(): string;
370
+ /**
371
+ * Persist one or more entries to disk.
372
+ *
373
+ * For each entry the method:
374
+ * 1. Skips if the metadata file already exists (content-addressed idempotency).
375
+ * 2. Writes the encrypted payload to `content/<hash>.bin` (deduplicated by hash).
376
+ * 3. Writes the metadata to `entries/<id>.json`.
377
+ * 4. Updates the in-memory index and appends a segment record.
378
+ *
379
+ * The commit order (content → metadata → segment) ensures that a crash at
380
+ * any point leaves the store in a consistent state: orphaned content blobs
381
+ * are harmless, and the index can always be rebuilt from the metadata files.
382
+ */
383
+ putEntries(entries: StoreEntry[]): Promise<void>;
384
+ /**
385
+ * Retrieve full entries (metadata + encrypted payload) by id.
386
+ *
387
+ * IDs that are not found or whose content file is missing are silently
388
+ * omitted from the result. When indexing is enabled, the metadata lookup
389
+ * is O(1); the content read is always a disk I/O.
390
+ */
391
+ getEntries(ids: string[]): Promise<StoreEntry[]>;
392
+ /**
393
+ * Check which of the given ids exist in the store.
394
+ *
395
+ * When indexing is enabled, this is a fast in-memory set-membership test.
396
+ * Otherwise, it checks for the existence of the corresponding metadata
397
+ * file on disk.
398
+ *
399
+ * @returns The subset of `ids` that are present in the store.
400
+ */
401
+ hasEntries(ids: string[]): Promise<string[]>;
402
+ /**
403
+ * Find all entries whose ids are not in `knownIds`.
404
+ *
405
+ * Used during sync to discover entries the caller has not yet seen.
406
+ * Returns metadata only (no payload).
407
+ */
408
+ findNewEntries(knownIds: string[]): Promise<StoreEntryMetadata[]>;
409
+ /**
410
+ * Find entries for a specific document that are not in `knownIds`.
411
+ *
412
+ * When indexing is enabled, leverages the `docIndex` for an O(K) scan
413
+ * (K = entries for this doc) instead of the full store.
414
+ */
415
+ findNewEntriesForDoc(knownIds: string[], docId: string): Promise<StoreEntryMetadata[]>;
416
+ /**
417
+ * Find entries matching a given type and optional creation-date range.
418
+ *
419
+ * @param type Entry type to filter by (e.g. "doc_change").
420
+ * @param creationDateFrom Inclusive lower bound (epoch ms), or `null` for no lower bound.
421
+ * @param creationDateUntil Exclusive upper bound (epoch ms), or `null` for no upper bound.
422
+ * @returns Metadata of all matching entries.
423
+ */
424
+ findEntries(type: StoreEntryType, creationDateFrom: number | null, creationDateUntil: number | null): Promise<StoreEntryMetadata[]>;
425
+ /**
426
+ * Return all entry ids in the store.
427
+ *
428
+ * When indexing is enabled, returns ids in `(createdAt, id)` order.
429
+ * Without indexing, order depends on the filesystem directory listing.
430
+ */
431
+ getAllIds(): Promise<string[]>;
432
+ /**
433
+ * Cursor-based paginated scan over entry metadata.
434
+ *
435
+ * Designed for high-volume synchronization: the caller repeatedly advances
436
+ * a cursor to stream through all entries in deterministic
437
+ * `(createdAt ASC, id ASC)` order, optionally applying filters.
438
+ *
439
+ * **Indexed path** (default):
440
+ * - O(log N) binary search for the cursor position.
441
+ * - O(pageSize) slice for unfiltered scans; O(scan window) for filtered.
442
+ *
443
+ * **Non-indexed fallback**:
444
+ * - Reads and sorts *all* metadata on every call. Suitable only for
445
+ * small stores or when indexing is explicitly disabled.
446
+ *
447
+ * @param cursor Position to resume from (exclusive), or `null` to start
448
+ * from the beginning.
449
+ * @param limit Maximum number of entries to return in this page.
450
+ * @param filters Optional filters (docId, entryTypes, date range).
451
+ * @returns A page of metadata entries, the next cursor, and a `hasMore` flag.
452
+ */
453
+ scanEntriesSince(cursor: StoreScanCursor | null, limit?: number, filters?: StoreScanFilters): Promise<StoreScanResult>;
454
+ /**
455
+ * Build a bloom filter summary of all entry ids in this store.
456
+ *
457
+ * The summary is a compact probabilistic set representation that a remote
458
+ * peer can use during sync to cheaply test which of its own ids are
459
+ * *definitely absent* from this store — avoiding per-id network
460
+ * round-trips. See {@link createIdBloomSummary} for details on the bloom
461
+ * filter implementation.
462
+ *
463
+ * @returns A serializable {@link StoreIdBloomSummary} with a base64-encoded
464
+ * bitset, suitable for transmission over the network.
465
+ */
466
+ getIdBloomSummary(): Promise<StoreIdBloomSummary>;
467
+ planDocumentMaterialization(docId: string, options?: MaterializationPlanOptions): Promise<DocumentMaterializationPlan>;
468
+ planDocumentMaterializationBatch(docIds: string[], options?: MaterializationPlanOptions): Promise<DocumentMaterializationBatchPlan>;
469
+ /**
470
+ * Traverse the dependency graph starting from a given entry id.
471
+ *
472
+ * Performs a breadth-first traversal through `dependencyIds` links,
473
+ * collecting all reachable entries. The result is returned in
474
+ * **dependency-first order** (deepest dependencies first) so callers
475
+ * can process entries from oldest to newest.
476
+ *
477
+ * Use cases:
478
+ * - Loading all chunks of a large attachment (traverse from the last
479
+ * chunk back to the first).
480
+ * - Reconstructing a document state by collecting all changes.
481
+ * - Stopping at snapshots to avoid loading the full history.
482
+ *
483
+ * @param startId The entry id to begin traversal from.
484
+ * @param options Optional traversal controls:
485
+ * - `stopAtEntryType` — stop expanding when hitting this type (the
486
+ * matching entry is still included).
487
+ * - `maxDepth` — maximum number of hops from `startId`.
488
+ * - `includeStart` — whether `startId` itself appears in the result
489
+ * (default `true`).
490
+ * @returns Entry ids in dependency-first order.
491
+ */
492
+ resolveDependencies(startId: string, options?: Record<string, unknown>): Promise<string[]>;
493
+ /**
494
+ * Permanently delete all entries belonging to a document (GDPR purge).
495
+ *
496
+ * Steps:
497
+ * 1. Identify all metadata entries with the given `docId`.
498
+ * 2. Delete each metadata file and update the in-memory index.
499
+ * 3. Delete orphaned content blobs — content files whose hash is no
500
+ * longer referenced by any remaining entry.
501
+ * 4. Append "delete" segment records so the index stays consistent
502
+ * across restarts.
503
+ *
504
+ * @param docId The document whose entire history should be erased.
505
+ */
506
+ purgeDocHistory(docId: string): Promise<void>;
507
+ /**
508
+ * Delete all data for this database and recreate empty directories.
509
+ *
510
+ * Resets the index status to "building" temporarily, removes the entire
511
+ * store root, and re-creates the directory structure. The index is
512
+ * immediately marked "ready" afterwards since the store is now empty.
513
+ */
514
+ clearAllLocalData(): Promise<void>;
515
+ /**
516
+ * Wait until the in-memory index has finished building and return its
517
+ * status. Since initialization is fully awaited via `initPromise`, this
518
+ * effectively waits for the constructor's async init to complete.
519
+ */
520
+ awaitIndexReady(_options?: AwaitIndexReadyOptions): Promise<StoreIndexBuildStatus>;
521
+ /** Return the current index build status without waiting. */
522
+ getIndexBuildStatus(): StoreIndexBuildStatus;
523
+ /** Return a snapshot of cumulative metadata-segment compaction statistics. */
524
+ getCompactionStatus(): Promise<StoreCompactionStatus>;
525
+ }
526
+ /**
527
+ * Factory that creates {@link BasicOnDiskContentAddressedStore} instances.
528
+ *
529
+ * Implements the {@link ContentAddressedStoreFactory} interface so it can be
530
+ * plugged into MindooDB's store creation pipeline. Each call to
531
+ * `createStore` returns a fresh store backed by its own on-disk directory
532
+ * under the configured base path.
533
+ */
534
+ export declare class BasicOnDiskContentAddressedStoreFactory implements ContentAddressedStoreFactory {
535
+ /**
536
+ * Create a new on-disk content-addressed store for the given database.
537
+ *
538
+ * @param dbId Unique database identifier (becomes the directory name).
539
+ * @param options Store configuration forwarded to the constructor.
540
+ * @returns A {@link CreateStoreResult} containing the new store as `docStore`.
541
+ */
542
+ createStore(dbId: string, options?: OpenStoreOptions): CreateStoreResult;
543
+ }
544
+ //# sourceMappingURL=BasicOnDiskContentAddressedStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicOnDiskContentAddressedStore.d.ts","sourceRoot":"","sources":["../../../src/node/appendonlystores/BasicOnDiskContentAddressedStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAKH,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,gCAAgC,EAChC,2BAA2B,EAC3B,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACpB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,MAAM,EAAoC,MAAM,oBAAoB,CAAC;AA4G9E;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gCAAiC,YAAW,qBAAqB;IAK5E,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B,4CAA4C;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC,6DAA6D;IAC7D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,gEAAgE;IAChE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IAEpC,2EAA2E;IAC3E,OAAO,CAAC,QAAQ,CAAC,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