mindoodb 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/README.md +97 -24
  2. package/dist/__mocks__/expo-standard-web-crypto.d.ts +10 -0
  3. package/dist/__mocks__/expo-standard-web-crypto.d.ts.map +1 -0
  4. package/dist/__mocks__/expo-standard-web-crypto.js +22 -0
  5. package/dist/__mocks__/expo-standard-web-crypto.js.map +1 -0
  6. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.d.ts +8 -0
  7. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.d.ts.map +1 -0
  8. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.js +16 -0
  9. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.js.map +1 -0
  10. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.d.ts +1 -1
  11. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.d.ts.map +1 -1
  12. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.js +2 -2
  13. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.js.map +1 -1
  14. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts +19 -2
  15. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts.map +1 -1
  16. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js +133 -22
  17. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js.map +1 -1
  18. package/dist/appendonlystores/network/HttpTransport.d.ts +20 -3
  19. package/dist/appendonlystores/network/HttpTransport.d.ts.map +1 -1
  20. package/dist/appendonlystores/network/HttpTransport.js +136 -21
  21. package/dist/appendonlystores/network/HttpTransport.js.map +1 -1
  22. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts +33 -3
  23. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts.map +1 -1
  24. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js +148 -27
  25. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js.map +1 -1
  26. package/dist/appendonlystores/network/index.d.ts +1 -1
  27. package/dist/appendonlystores/network/index.d.ts.map +1 -1
  28. package/dist/appendonlystores/network/index.js.map +1 -1
  29. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.d.ts +61 -0
  30. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.d.ts.map +1 -0
  31. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.js +685 -0
  32. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.js.map +1 -0
  33. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.d.ts +25 -0
  34. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.d.ts.map +1 -0
  35. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.js +41 -0
  36. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.js.map +1 -0
  37. package/dist/browser/index.d.ts +5 -0
  38. package/dist/browser/index.d.ts.map +1 -1
  39. package/dist/browser/index.js +13 -1
  40. package/dist/browser/index.js.map +1 -1
  41. package/dist/core/BaseMindooDB.d.ts +38 -4
  42. package/dist/core/BaseMindooDB.d.ts.map +1 -1
  43. package/dist/core/BaseMindooDB.js +810 -329
  44. package/dist/core/BaseMindooDB.js.map +1 -1
  45. package/dist/core/BaseMindooTenant.d.ts +42 -6
  46. package/dist/core/BaseMindooTenant.d.ts.map +1 -1
  47. package/dist/core/BaseMindooTenant.js +259 -93
  48. package/dist/core/BaseMindooTenant.js.map +1 -1
  49. package/dist/core/BaseMindooTenantDirectory.d.ts +3 -1
  50. package/dist/core/BaseMindooTenantDirectory.d.ts.map +1 -1
  51. package/dist/core/BaseMindooTenantDirectory.js +50 -40
  52. package/dist/core/BaseMindooTenantDirectory.js.map +1 -1
  53. package/dist/core/BaseMindooTenantFactory.d.ts +25 -29
  54. package/dist/core/BaseMindooTenantFactory.d.ts.map +1 -1
  55. package/dist/core/BaseMindooTenantFactory.js +175 -73
  56. package/dist/core/BaseMindooTenantFactory.js.map +1 -1
  57. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.d.ts +68 -0
  58. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.d.ts.map +1 -0
  59. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.js +659 -0
  60. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.js.map +1 -0
  61. package/dist/core/appendonlystores/InMemoryContentAddressedStore.d.ts +50 -4
  62. package/dist/core/appendonlystores/InMemoryContentAddressedStore.d.ts.map +1 -1
  63. package/dist/core/appendonlystores/InMemoryContentAddressedStore.js +204 -39
  64. package/dist/core/appendonlystores/InMemoryContentAddressedStore.js.map +1 -1
  65. package/dist/core/appendonlystores/bloom.d.ts +85 -0
  66. package/dist/core/appendonlystores/bloom.d.ts.map +1 -0
  67. package/dist/core/appendonlystores/bloom.js +228 -0
  68. package/dist/core/appendonlystores/bloom.js.map +1 -0
  69. package/dist/core/appendonlystores/network/AuthenticationService.d.ts +3 -0
  70. package/dist/core/appendonlystores/network/AuthenticationService.d.ts.map +1 -1
  71. package/dist/core/appendonlystores/network/AuthenticationService.js +21 -17
  72. package/dist/core/appendonlystores/network/AuthenticationService.js.map +1 -1
  73. package/dist/core/appendonlystores/network/NetworkTransport.d.ts +36 -2
  74. package/dist/core/appendonlystores/network/NetworkTransport.d.ts.map +1 -1
  75. package/dist/core/appendonlystores/network/types.d.ts +10 -0
  76. package/dist/core/appendonlystores/network/types.d.ts.map +1 -1
  77. package/dist/core/appendonlystores/network/types.js.map +1 -1
  78. package/dist/core/appendonlystores/types.d.ts +137 -1
  79. package/dist/core/appendonlystores/types.d.ts.map +1 -1
  80. package/dist/core/automerge-adapter.d.ts +15 -0
  81. package/dist/core/automerge-adapter.d.ts.map +1 -0
  82. package/dist/core/automerge-adapter.js +73 -0
  83. package/dist/core/automerge-adapter.js.map +1 -0
  84. package/dist/core/crypto/MindooDocSigner.d.ts +3 -1
  85. package/dist/core/crypto/MindooDocSigner.d.ts.map +1 -1
  86. package/dist/core/crypto/MindooDocSigner.js +9 -5
  87. package/dist/core/crypto/MindooDocSigner.js.map +1 -1
  88. package/dist/core/crypto/RSAEncryption.d.ts +3 -1
  89. package/dist/core/crypto/RSAEncryption.d.ts.map +1 -1
  90. package/dist/core/crypto/RSAEncryption.js +13 -9
  91. package/dist/core/crypto/RSAEncryption.js.map +1 -1
  92. package/dist/core/crypto/pbkdf2Iterations.d.ts +12 -0
  93. package/dist/core/crypto/pbkdf2Iterations.d.ts.map +1 -0
  94. package/dist/core/crypto/pbkdf2Iterations.js +55 -0
  95. package/dist/core/crypto/pbkdf2Iterations.js.map +1 -0
  96. package/dist/core/index.d.ts +7 -2
  97. package/dist/core/index.d.ts.map +1 -1
  98. package/dist/core/index.js +30 -1
  99. package/dist/core/index.js.map +1 -1
  100. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.d.ts +1 -1
  101. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.js +2 -2
  102. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.js.map +1 -1
  103. package/dist/core/indexing/virtualviews/index.d.ts +1 -1
  104. package/dist/core/indexing/virtualviews/index.js +1 -1
  105. package/dist/core/keys/KeyBag.d.ts +36 -13
  106. package/dist/core/keys/KeyBag.d.ts.map +1 -1
  107. package/dist/core/keys/KeyBag.js +96 -31
  108. package/dist/core/keys/KeyBag.js.map +1 -1
  109. package/dist/core/keys/KeyContext.d.ts +4 -0
  110. package/dist/core/keys/KeyContext.d.ts.map +1 -0
  111. package/dist/core/keys/KeyContext.js +11 -0
  112. package/dist/core/keys/KeyContext.js.map +1 -0
  113. package/dist/core/logging/LogLevel.d.ts +21 -0
  114. package/dist/core/logging/LogLevel.d.ts.map +1 -0
  115. package/dist/core/logging/LogLevel.js +56 -0
  116. package/dist/core/logging/LogLevel.js.map +1 -0
  117. package/dist/core/logging/Logger.d.ts +37 -0
  118. package/dist/core/logging/Logger.d.ts.map +1 -0
  119. package/dist/core/logging/Logger.js +3 -0
  120. package/dist/core/logging/Logger.js.map +1 -0
  121. package/dist/core/logging/MindooLogger.d.ts +28 -0
  122. package/dist/core/logging/MindooLogger.d.ts.map +1 -0
  123. package/dist/core/logging/MindooLogger.js +217 -0
  124. package/dist/core/logging/MindooLogger.js.map +1 -0
  125. package/dist/core/logging/index.d.ts +4 -0
  126. package/dist/core/logging/index.d.ts.map +1 -0
  127. package/dist/core/logging/index.js +10 -0
  128. package/dist/core/logging/index.js.map +1 -0
  129. package/dist/core/types.d.ts +313 -77
  130. package/dist/core/types.d.ts.map +1 -1
  131. package/dist/core/types.js +2 -0
  132. package/dist/core/types.js.map +1 -1
  133. package/dist/core/uri/MindooURI.d.ts +58 -0
  134. package/dist/core/uri/MindooURI.d.ts.map +1 -0
  135. package/dist/core/uri/MindooURI.js +169 -0
  136. package/dist/core/uri/MindooURI.js.map +1 -0
  137. package/dist/core/userid/index.d.ts +0 -10
  138. package/dist/core/userid/index.d.ts.map +1 -1
  139. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.d.ts +541 -0
  140. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.d.ts.map +1 -0
  141. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.js +1334 -0
  142. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.js.map +1 -0
  143. package/dist/node/index.d.ts +1 -0
  144. package/dist/node/index.d.ts.map +1 -1
  145. package/dist/node/index.js +5 -1
  146. package/dist/node/index.js.map +1 -1
  147. package/dist/reactnative/crypto/AESAdapter.d.ts +18 -0
  148. package/dist/reactnative/crypto/AESAdapter.d.ts.map +1 -0
  149. package/dist/reactnative/crypto/AESAdapter.js +112 -0
  150. package/dist/reactnative/crypto/AESAdapter.js.map +1 -0
  151. package/dist/reactnative/crypto/Ed25519Adapter.d.ts +34 -0
  152. package/dist/reactnative/crypto/Ed25519Adapter.d.ts.map +1 -0
  153. package/dist/reactnative/crypto/Ed25519Adapter.js +386 -0
  154. package/dist/reactnative/crypto/Ed25519Adapter.js.map +1 -0
  155. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.d.ts +23 -0
  156. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.d.ts.map +1 -0
  157. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.js +51 -0
  158. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.js.map +1 -0
  159. package/dist/reactnative/crypto/HMACAdapter.d.ts +13 -0
  160. package/dist/reactnative/crypto/HMACAdapter.d.ts.map +1 -0
  161. package/dist/reactnative/crypto/HMACAdapter.js +50 -0
  162. package/dist/reactnative/crypto/HMACAdapter.js.map +1 -0
  163. package/dist/reactnative/crypto/KeyFormatConverter.d.ts +21 -0
  164. package/dist/reactnative/crypto/KeyFormatConverter.d.ts.map +1 -0
  165. package/dist/reactnative/crypto/KeyFormatConverter.js +72 -0
  166. package/dist/reactnative/crypto/KeyFormatConverter.js.map +1 -0
  167. package/dist/reactnative/crypto/PBKDF2Adapter.d.ts +19 -0
  168. package/dist/reactnative/crypto/PBKDF2Adapter.d.ts.map +1 -0
  169. package/dist/reactnative/crypto/PBKDF2Adapter.js +67 -0
  170. package/dist/reactnative/crypto/PBKDF2Adapter.js.map +1 -0
  171. package/dist/reactnative/crypto/QuickCryptoAdapter.d.ts +37 -0
  172. package/dist/reactnative/crypto/QuickCryptoAdapter.d.ts.map +1 -0
  173. package/dist/reactnative/crypto/QuickCryptoAdapter.js +72 -0
  174. package/dist/reactnative/crypto/QuickCryptoAdapter.js.map +1 -0
  175. package/dist/reactnative/crypto/RSAAdapter.d.ts +38 -0
  176. package/dist/reactnative/crypto/RSAAdapter.d.ts.map +1 -0
  177. package/dist/reactnative/crypto/RSAAdapter.js +184 -0
  178. package/dist/reactnative/crypto/RSAAdapter.js.map +1 -0
  179. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.d.ts +33 -0
  180. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.d.ts.map +1 -0
  181. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.js +61 -0
  182. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.js.map +1 -0
  183. package/dist/reactnative/crypto/SHA256Adapter.d.ts +9 -0
  184. package/dist/reactnative/crypto/SHA256Adapter.d.ts.map +1 -0
  185. package/dist/reactnative/crypto/SHA256Adapter.js +29 -0
  186. package/dist/reactnative/crypto/SHA256Adapter.js.map +1 -0
  187. package/dist/reactnative/crypto/SubtleCryptoPolyfill.d.ts +63 -0
  188. package/dist/reactnative/crypto/SubtleCryptoPolyfill.d.ts.map +1 -0
  189. package/dist/reactnative/crypto/SubtleCryptoPolyfill.js +350 -0
  190. package/dist/reactnative/crypto/SubtleCryptoPolyfill.js.map +1 -0
  191. package/dist/reactnative/index.d.ts +8 -0
  192. package/dist/reactnative/index.d.ts.map +1 -0
  193. package/dist/reactnative/index.js +38 -0
  194. package/dist/reactnative/index.js.map +1 -0
  195. package/package.json +51 -6
  196. package/patches/PATCHES.md +111 -0
  197. package/patches/react-native+0.76.9.patch +34 -0
  198. package/patches/react-native-quick-crypto+1.0.7.patch +42 -0
  199. package/scripts/cli.js +21 -0
  200. package/scripts/setup-react-native.js +228 -0
  201. package/templates/reactnative/App.js +252 -0
  202. package/templates/reactnative/app.json +29 -0
  203. package/templates/reactnative/babel.config.js +6 -0
  204. package/templates/reactnative/index.js +26 -0
  205. package/templates/reactnative/metro.config.snippet.js +39 -0
  206. package/templates/reactnative/mindoodb-polyfills.js +116 -0
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ServerNetworkContentAddressedStore = void 0;
4
+ const bloom_1 = require("../../core/appendonlystores/bloom");
4
5
  const types_1 = require("../../core/appendonlystores/network/types");
5
6
  const RSAEncryption_1 = require("../../core/crypto/RSAEncryption");
7
+ const logging_1 = require("../../core/logging");
6
8
  /**
7
9
  * Server-side network handler for ContentAddressedStore operations.
8
10
  *
@@ -23,13 +25,18 @@ class ServerNetworkContentAddressedStore {
23
25
  * @param directory The tenant directory for user lookup
24
26
  * @param authService The authentication service for token validation
25
27
  * @param cryptoAdapter The crypto adapter for encryption
28
+ * @param logger Optional logger instance
26
29
  */
27
- constructor(localStore, directory, authService, cryptoAdapter) {
30
+ constructor(localStore, directory, authService, cryptoAdapter, logger) {
28
31
  this.localStore = localStore;
29
32
  this.directory = directory;
30
33
  this.authService = authService;
31
34
  this.cryptoAdapter = cryptoAdapter;
32
- this.rsaEncryption = new RSAEncryption_1.RSAEncryption(cryptoAdapter);
35
+ this.logger =
36
+ logger ||
37
+ new logging_1.MindooLogger((0, logging_1.getDefaultLogLevel)(), `ServerNetworkStore:${localStore.getId()}`, true);
38
+ const rsaLogger = this.logger.createChild("RSAEncryption");
39
+ this.rsaEncryption = new RSAEncryption_1.RSAEncryption(cryptoAdapter, rsaLogger);
33
40
  }
34
41
  /**
35
42
  * Get the ID of the underlying store.
@@ -44,7 +51,7 @@ class ServerNetworkContentAddressedStore {
44
51
  * @returns The challenge string
45
52
  */
46
53
  async handleChallengeRequest(username) {
47
- console.log(`[ServerNetworkContentAddressedStore] Handling challenge request for user: ${username}`);
54
+ this.logger.debug(`Handling challenge request for user: ${username}`);
48
55
  return this.authService.generateChallenge(username);
49
56
  }
50
57
  /**
@@ -55,7 +62,7 @@ class ServerNetworkContentAddressedStore {
55
62
  * @returns The authentication result with JWT token
56
63
  */
57
64
  async handleAuthenticate(challenge, signature) {
58
- console.log(`[ServerNetworkContentAddressedStore] Handling authentication for challenge: ${challenge}`);
65
+ this.logger.debug(`Handling authentication for challenge: ${challenge}`);
59
66
  return this.authService.authenticate(challenge, signature);
60
67
  }
61
68
  /**
@@ -66,13 +73,13 @@ class ServerNetworkContentAddressedStore {
66
73
  * @returns List of new entry metadata
67
74
  */
68
75
  async handleFindNewEntries(token, knownIds) {
69
- console.log(`[ServerNetworkContentAddressedStore] Handling findNewEntries request`);
76
+ this.logger.debug(`Handling findNewEntries request`);
70
77
  // Validate token
71
78
  const tokenPayload = await this.validateToken(token);
72
- console.log(`[ServerNetworkContentAddressedStore] Token validated for user: ${tokenPayload.sub}`);
79
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
73
80
  // Find new entries
74
81
  const newEntries = await this.localStore.findNewEntries(knownIds);
75
- console.log(`[ServerNetworkContentAddressedStore] Found ${newEntries.length} new entries`);
82
+ this.logger.debug(`Found ${newEntries.length} new entries`);
76
83
  return newEntries;
77
84
  }
78
85
  /**
@@ -85,15 +92,129 @@ class ServerNetworkContentAddressedStore {
85
92
  * @returns List of new entry metadata for the specified document
86
93
  */
87
94
  async handleFindNewEntriesForDoc(token, knownIds, docId) {
88
- console.log(`[ServerNetworkContentAddressedStore] Handling findNewEntriesForDoc request for doc ${docId}`);
95
+ this.logger.debug(`Handling findNewEntriesForDoc request for doc ${docId}`);
89
96
  // Validate token
90
97
  const tokenPayload = await this.validateToken(token);
91
- console.log(`[ServerNetworkContentAddressedStore] Token validated for user: ${tokenPayload.sub}`);
98
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
92
99
  // Find new entries for the specific document
93
100
  const newEntries = await this.localStore.findNewEntriesForDoc(knownIds, docId);
94
- console.log(`[ServerNetworkContentAddressedStore] Found ${newEntries.length} new entries for doc ${docId}`);
101
+ this.logger.debug(`Found ${newEntries.length} new entries for doc ${docId}`);
95
102
  return newEntries;
96
103
  }
104
+ /**
105
+ * Handle a findEntries request from a client.
106
+ *
107
+ * @param token The JWT access token
108
+ * @param type The entry type to filter by
109
+ * @param creationDateFrom Optional start timestamp (inclusive)
110
+ * @param creationDateUntil Optional end timestamp (exclusive)
111
+ * @returns List of entry metadata matching the criteria
112
+ */
113
+ async handleFindEntries(token, type, creationDateFrom, creationDateUntil) {
114
+ this.logger.debug(`Handling findEntries request for type ${type}`);
115
+ // Validate token
116
+ const tokenPayload = await this.validateToken(token);
117
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
118
+ // Find entries
119
+ const entries = await this.localStore.findEntries(type, creationDateFrom, creationDateUntil);
120
+ this.logger.debug(`Found ${entries.length} entries`);
121
+ return entries;
122
+ }
123
+ /**
124
+ * Handle a cursor-based scanEntriesSince request from a client.
125
+ * Uses local store native support when available, with legacy fallback.
126
+ */
127
+ async handleScanEntriesSince(token, cursor, limit, filters) {
128
+ this.logger.debug(`Handling scanEntriesSince request`);
129
+ // Validate token
130
+ const tokenPayload = await this.validateToken(token);
131
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
132
+ if (this.localStore.scanEntriesSince) {
133
+ return this.localStore.scanEntriesSince(cursor, limit, filters);
134
+ }
135
+ // Fallback: emulate cursor scan using existing metadata query.
136
+ const all = filters?.docId
137
+ ? await this.localStore.findNewEntriesForDoc([], filters.docId)
138
+ : await this.localStore.findNewEntries([]);
139
+ const sorted = all
140
+ .filter((meta) => {
141
+ if (filters?.entryTypes && filters.entryTypes.length > 0 && !filters.entryTypes.includes(meta.entryType)) {
142
+ return false;
143
+ }
144
+ if (filters?.creationDateFrom !== undefined && filters.creationDateFrom !== null && meta.createdAt < filters.creationDateFrom) {
145
+ return false;
146
+ }
147
+ if (filters?.creationDateUntil !== undefined && filters.creationDateUntil !== null && meta.createdAt >= filters.creationDateUntil) {
148
+ return false;
149
+ }
150
+ return true;
151
+ })
152
+ .sort((a, b) => (a.createdAt === b.createdAt ? a.id.localeCompare(b.id) : a.createdAt - b.createdAt));
153
+ const max = limit ?? Number.MAX_SAFE_INTEGER;
154
+ const startIndex = cursor === null
155
+ ? 0
156
+ : sorted.findIndex((meta) => meta.createdAt > cursor.createdAt || (meta.createdAt === cursor.createdAt && meta.id > cursor.id));
157
+ if (startIndex === -1) {
158
+ return { entries: [], nextCursor: cursor, hasMore: false };
159
+ }
160
+ const page = sorted.slice(startIndex, startIndex + max);
161
+ const last = page.length > 0 ? page[page.length - 1] : null;
162
+ return {
163
+ entries: page,
164
+ nextCursor: last ? { createdAt: last.createdAt, id: last.id } : cursor,
165
+ hasMore: startIndex + page.length < sorted.length,
166
+ };
167
+ }
168
+ /**
169
+ * Handle a getIdBloomSummary request from a client.
170
+ */
171
+ async handleGetIdBloomSummary(token) {
172
+ this.logger.debug(`Handling getIdBloomSummary request`);
173
+ const tokenPayload = await this.validateToken(token);
174
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
175
+ if (this.localStore.getIdBloomSummary) {
176
+ return this.localStore.getIdBloomSummary();
177
+ }
178
+ const ids = await this.localStore.getAllIds();
179
+ return (0, bloom_1.createIdBloomSummary)(ids);
180
+ }
181
+ /**
182
+ * Handle sync capability negotiation.
183
+ */
184
+ async handleGetCapabilities(token) {
185
+ const tokenPayload = await this.validateToken(token);
186
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
187
+ return {
188
+ protocolVersion: "sync-v2",
189
+ supportsCursorScan: typeof this.localStore.scanEntriesSince === "function",
190
+ supportsIdBloomSummary: typeof this.localStore.getIdBloomSummary === "function",
191
+ supportsCompactionStatus: typeof this.localStore.getCompactionStatus === "function",
192
+ };
193
+ }
194
+ /**
195
+ * Handle a getCompactionStatus request from a client.
196
+ */
197
+ async handleGetCompactionStatus(token) {
198
+ this.logger.debug(`Handling getCompactionStatus request`);
199
+ const tokenPayload = await this.validateToken(token);
200
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
201
+ if (this.localStore.getCompactionStatus) {
202
+ return this.localStore.getCompactionStatus();
203
+ }
204
+ return {
205
+ enabled: false,
206
+ compactionMinFiles: 0,
207
+ compactionMaxBytes: 0,
208
+ totalCompactions: 0,
209
+ totalCompactedFiles: 0,
210
+ totalCompactedBytes: 0,
211
+ totalCompactionDurationMs: 0,
212
+ lastCompactionAt: null,
213
+ lastCompactedFiles: 0,
214
+ lastCompactedBytes: 0,
215
+ lastCompactionDurationMs: 0,
216
+ };
217
+ }
97
218
  /**
98
219
  * Handle a getEntries request from a client.
99
220
  * Encrypts the entries with the client's RSA public key.
@@ -103,23 +224,23 @@ class ServerNetworkContentAddressedStore {
103
224
  * @returns The entries with RSA-encrypted payloads
104
225
  */
105
226
  async handleGetEntries(token, ids) {
106
- console.log(`[ServerNetworkContentAddressedStore] Handling getEntries request for ${ids.length} entries`);
227
+ this.logger.debug(`Handling getEntries request for ${ids.length} entries`);
107
228
  // Validate token
108
229
  const tokenPayload = await this.validateToken(token);
109
230
  const username = tokenPayload.sub;
110
- console.log(`[ServerNetworkContentAddressedStore] Token validated for user: ${username}`);
231
+ this.logger.debug(`Token validated for user: ${username}`);
111
232
  // Get user's public encryption key
112
233
  const userKeys = await this.directory.getUserPublicKeys(username);
113
234
  if (!userKeys) {
114
235
  throw new types_1.NetworkError(types_1.NetworkErrorType.USER_NOT_FOUND, `User ${username} not found or revoked`);
115
236
  }
116
- console.log(`[ServerNetworkContentAddressedStore] Retrieved encryption key for user: ${username}`);
237
+ this.logger.debug(`Retrieved encryption key for user: ${username}`);
117
238
  // Get the entries from local store
118
239
  const entries = await this.localStore.getEntries(ids);
119
- console.log(`[ServerNetworkContentAddressedStore] Retrieved ${entries.length} entries from local store`);
240
+ this.logger.debug(`Retrieved ${entries.length} entries from local store`);
120
241
  // Encrypt each entry with the user's RSA public key
121
242
  const encryptedEntries = await this.encryptEntriesForUser(entries, userKeys.encryptionPublicKey);
122
- console.log(`[ServerNetworkContentAddressedStore] Encrypted ${encryptedEntries.length} entries for user: ${username}`);
243
+ this.logger.debug(`Encrypted ${encryptedEntries.length} entries for user: ${username}`);
123
244
  return encryptedEntries;
124
245
  }
125
246
  /**
@@ -129,10 +250,10 @@ class ServerNetworkContentAddressedStore {
129
250
  * @param entries The entries to store
130
251
  */
131
252
  async handlePutEntries(token, entries) {
132
- console.log(`[ServerNetworkContentAddressedStore] Handling putEntries request for ${entries.length} entries`);
253
+ this.logger.debug(`Handling putEntries request for ${entries.length} entries`);
133
254
  // Validate token
134
255
  const tokenPayload = await this.validateToken(token);
135
- console.log(`[ServerNetworkContentAddressedStore] Token validated for user: ${tokenPayload.sub}`);
256
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
136
257
  // Process each entry
137
258
  for (const entry of entries) {
138
259
  // Verify the entry was created by a trusted user
@@ -143,7 +264,7 @@ class ServerNetworkContentAddressedStore {
143
264
  }
144
265
  // Store all entries
145
266
  await this.localStore.putEntries(entries);
146
- console.log(`[ServerNetworkContentAddressedStore] Successfully stored ${entries.length} entries`);
267
+ this.logger.debug(`Successfully stored ${entries.length} entries`);
147
268
  }
148
269
  /**
149
270
  * Handle a hasEntries request from a client.
@@ -154,13 +275,13 @@ class ServerNetworkContentAddressedStore {
154
275
  * @returns List of IDs that exist in the store
155
276
  */
156
277
  async handleHasEntries(token, ids) {
157
- console.log(`[ServerNetworkContentAddressedStore] Handling hasEntries request for ${ids.length} IDs`);
278
+ this.logger.debug(`Handling hasEntries request for ${ids.length} IDs`);
158
279
  // Validate token
159
280
  const tokenPayload = await this.validateToken(token);
160
- console.log(`[ServerNetworkContentAddressedStore] Token validated for user: ${tokenPayload.sub}`);
281
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
161
282
  // Check which IDs exist in local store
162
283
  const existingIds = await this.localStore.hasEntries(ids);
163
- console.log(`[ServerNetworkContentAddressedStore] Found ${existingIds.length} existing entries out of ${ids.length} checked`);
284
+ this.logger.debug(`Found ${existingIds.length} existing entries out of ${ids.length} checked`);
164
285
  return existingIds;
165
286
  }
166
287
  /**
@@ -171,13 +292,13 @@ class ServerNetworkContentAddressedStore {
171
292
  * @returns List of all entry IDs in the store
172
293
  */
173
294
  async handleGetAllIds(token) {
174
- console.log(`[ServerNetworkContentAddressedStore] Handling getAllIds request`);
295
+ this.logger.debug(`Handling getAllIds request`);
175
296
  // Validate token
176
297
  const tokenPayload = await this.validateToken(token);
177
- console.log(`[ServerNetworkContentAddressedStore] Token validated for user: ${tokenPayload.sub}`);
298
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
178
299
  // Get all entry IDs from local store
179
300
  const allIds = await this.localStore.getAllIds();
180
- console.log(`[ServerNetworkContentAddressedStore] Returning ${allIds.length} entry IDs`);
301
+ this.logger.debug(`Returning ${allIds.length} entry IDs`);
181
302
  return allIds;
182
303
  }
183
304
  /**
@@ -190,13 +311,13 @@ class ServerNetworkContentAddressedStore {
190
311
  * @returns List of entry IDs in dependency order
191
312
  */
192
313
  async handleResolveDependencies(token, startId, options) {
193
- console.log(`[ServerNetworkContentAddressedStore] Handling resolveDependencies request for ${startId}`);
314
+ this.logger.debug(`Handling resolveDependencies request for ${startId}`);
194
315
  // Validate token
195
316
  const tokenPayload = await this.validateToken(token);
196
- console.log(`[ServerNetworkContentAddressedStore] Token validated for user: ${tokenPayload.sub}`);
317
+ this.logger.debug(`Token validated for user: ${tokenPayload.sub}`);
197
318
  // Resolve dependencies in local store
198
319
  const resolvedIds = await this.localStore.resolveDependencies(startId, options);
199
- console.log(`[ServerNetworkContentAddressedStore] Resolved ${resolvedIds.length} dependencies`);
320
+ this.logger.debug(`Resolved ${resolvedIds.length} dependencies`);
200
321
  return resolvedIds;
201
322
  }
202
323
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ServerNetworkContentAddressedStore.js","sourceRoot":"","sources":["../../../src/appendonlystores/network/ServerNetworkContentAddressedStore.ts"],"names":[],"mappings":";;;AAIA,qEAA2F;AAC3F,mEAAgE;AAGhE;;;;;;;;;;;GAWG;AACH,MAAa,kCAAkC;IAO7C;;;;;;;OAOG;IACH,YACE,UAAiC,EACjC,SAAgC,EAChC,WAAkC,EAClC,aAA4B;QAE5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,IAAI,6BAAa,CAAC,aAAa,CAAC,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,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Ac,CAAC,CAAC;QAC/B,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA9TD,gFA8TC"}
1
+ {"version":3,"file":"ServerNetworkContentAddressedStore.js","sourceRoot":"","sources":["../../../src/appendonlystores/network/ServerNetworkContentAddressedStore.ts"],"names":[],"mappings":";;;AAYA,6DAAyE;AAOzE,qEAA2F;AAC3F,mEAAgE;AAEhE,gDAA8E;AAE9E;;;;;;;;;;;GAWG;AACH,MAAa,kCAAkC;IAQ7C;;;;;;;;OAQG;IACH,YACE,UAAiC,EACjC,SAAgC,EAChC,WAAkC,EAClC,aAA4B,EAC5B,MAAe;QAEf,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,MAAM;YACT,MAAM;gBACN,IAAI,sBAAY,CAAC,IAAA,4BAAkB,GAAE,EAAE,sBAAsB,UAAU,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAC3F,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAC3D,IAAI,CAAC,aAAa,GAAG,IAAI,6BAAa,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,sBAAsB,CAAC,QAAgB;QAC3C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,QAAQ,EAAE,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,kBAAkB,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,EAAE,KAAK,CAAC,aAAa;gBAClC,mBAAmB;aACpB,CAAC;YAEF,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/B,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA3dD,gFA2dC"}
@@ -1,4 +1,4 @@
1
- export type { NetworkEncryptedEntry, UserPublicKeys, NetworkAuthTokenPayload, AuthChallenge, AuthResult, } from "../../core/appendonlystores/network/types";
1
+ export type { NetworkEncryptedEntry, UserPublicKeys, NetworkAuthTokenPayload, AuthChallenge, AuthResult, NetworkSyncCapabilities, } from "../../core/appendonlystores/network/types";
2
2
  export { NetworkError, NetworkErrorType } from "../../core/appendonlystores/network/types";
3
3
  export type { NetworkTransport, NetworkTransportConfig } from "../../core/appendonlystores/network/NetworkTransport";
4
4
  export { ClientNetworkContentAddressedStore } from "./ClientNetworkContentAddressedStore";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/appendonlystores/network/index.ts"],"names":[],"mappings":"AAIA,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,UAAU,GACX,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAG3F,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAGrH,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAG1F,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAG1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAGlG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/appendonlystores/network/index.ts"],"names":[],"mappings":"AAIA,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,uBAAuB,GACxB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAG3F,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAGrH,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAG1F,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAG1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAGlG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/appendonlystores/network/index.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,sEAAsE;;;AAUtE,mEAA2F;AAAlF,qGAAA,YAAY,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAKvC,cAAc;AACd,2FAA0F;AAAjF,wJAAA,kCAAkC,OAAA;AAE3C,cAAc;AACd,2FAA0F;AAAjF,wJAAA,kCAAkC,OAAA;AAE3C,iBAAiB;AACjB,mGAAkG;AAAzF,8HAAA,qBAAqB,OAAA;AAE9B,4BAA4B;AAC5B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/appendonlystores/network/index.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,sEAAsE;;;AAWtE,mEAA2F;AAAlF,qGAAA,YAAY,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAKvC,cAAc;AACd,2FAA0F;AAAjF,wJAAA,kCAAkC,OAAA;AAE3C,cAAc;AACd,2FAA0F;AAAjF,wJAAA,kCAAkC,OAAA;AAE3C,iBAAiB;AACjB,mGAAkG;AAAzF,8HAAA,qBAAqB,OAAA;AAE9B,4BAA4B;AAC5B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * IndexedDB-backed ContentAddressedStore for browser environments.
3
+ *
4
+ * Provides persistent, indexed storage using the IndexedDB API. All indexing
5
+ * is delegated to IDB itself (no in-memory maps), keeping memory usage low
6
+ * even for stores with hundreds of thousands of entries.
7
+ *
8
+ * Schema (IDB version 1):
9
+ * - `entries` : metadata per entry id, indexed by docId, contentHash,
10
+ * (entryType, createdAt), and (createdAt, id)
11
+ * - `content` : encrypted payload per contentHash with reference counting
12
+ * - `bloom_cache` : single cached bloom filter summary, incrementally updated
13
+ * on inserts and fully rebuilt on purge or size threshold
14
+ *
15
+ * @module IndexedDBContentAddressedStore
16
+ */
17
+ import type { ContentAddressedStore, StoreIndexBuildStatus, AwaitIndexReadyOptions, StoreScanCursor, StoreScanFilters, StoreScanResult, StoreIdBloomSummary, OpenStoreOptions } from "../../core/appendonlystores/types";
18
+ import type { StoreEntry, StoreEntryMetadata, StoreEntryType } from "../../core/types";
19
+ import { Logger } from "../../core/logging";
20
+ /**
21
+ * An IndexedDB-backed ContentAddressedStore.
22
+ *
23
+ * Each instance maps to a single IndexedDB database named
24
+ * `mindoodb_<prefix>_<storeId>` where `prefix` comes from `options.basePath`
25
+ * and defaults to `"default"`.
26
+ *
27
+ * Entries are stored in an `entries` object store with IDB indexes that
28
+ * replace the in-memory Map indexes used by the InMemory and OnDisk stores.
29
+ * Encrypted payloads are deduplicated via a `content` object store keyed
30
+ * by `contentHash` with a `refCount` field.
31
+ *
32
+ * A single `bloom_cache` record avoids recomputing the bloom filter on every
33
+ * `getIdBloomSummary()` call.
34
+ */
35
+ export declare class IndexedDBContentAddressedStore implements ContentAddressedStore {
36
+ private readonly storeId;
37
+ private readonly idbName;
38
+ private readonly logger;
39
+ private db;
40
+ private openPromise;
41
+ constructor(storeId: string, logger?: Logger, options?: OpenStoreOptions);
42
+ /** Lazily open the IDB database, creating object stores on first access. */
43
+ private ensureOpen;
44
+ getId(): string;
45
+ putEntries(entries: StoreEntry[]): Promise<void>;
46
+ getEntries(ids: string[]): Promise<StoreEntry[]>;
47
+ hasEntries(ids: string[]): Promise<string[]>;
48
+ findNewEntries(knownIds: string[]): Promise<StoreEntryMetadata[]>;
49
+ findNewEntriesForDoc(knownIds: string[], docId: string): Promise<StoreEntryMetadata[]>;
50
+ findEntries(type: StoreEntryType, creationDateFrom: number | null, creationDateUntil: number | null): Promise<StoreEntryMetadata[]>;
51
+ getAllIds(): Promise<string[]>;
52
+ scanEntriesSince(cursor: StoreScanCursor | null, limit?: number, filters?: StoreScanFilters): Promise<StoreScanResult>;
53
+ getIdBloomSummary(): Promise<StoreIdBloomSummary>;
54
+ resolveDependencies(startId: string, options?: Record<string, unknown>): Promise<string[]>;
55
+ purgeDocHistory(docId: string): Promise<void>;
56
+ clearAllLocalData(): Promise<void>;
57
+ awaitIndexReady(_options?: AwaitIndexReadyOptions): Promise<StoreIndexBuildStatus>;
58
+ getIndexBuildStatus(): StoreIndexBuildStatus;
59
+ private matchesScanFilters;
60
+ }
61
+ //# sourceMappingURL=IndexedDBContentAddressedStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexedDBContentAddressedStore.d.ts","sourceRoot":"","sources":["../../../src/browser/appendonlystores/IndexedDBContentAddressedStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAoC,MAAM,oBAAoB,CAAC;AAyN9E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,8BAA+B,YAAW,qBAAqB;IAC1E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QA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