@connecttomahdi/rxdb 17.0.0-beta.17 → 17.1.1

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 (349) hide show
  1. package/AGENTS.md +4 -0
  2. package/CHANGELOG.md +47 -4
  3. package/CLAUDE.md +2 -0
  4. package/dist/cjs/change-event-buffer.js +2 -1
  5. package/dist/cjs/change-event-buffer.js.map +1 -1
  6. package/dist/cjs/custom-index.js +85 -12
  7. package/dist/cjs/custom-index.js.map +1 -1
  8. package/dist/cjs/doc-cache.js +117 -35
  9. package/dist/cjs/doc-cache.js.map +1 -1
  10. package/dist/cjs/event-reduce.js +10 -1
  11. package/dist/cjs/event-reduce.js.map +1 -1
  12. package/dist/cjs/plugin-helpers.js +16 -0
  13. package/dist/cjs/plugin-helpers.js.map +1 -1
  14. package/dist/cjs/plugins/attachments/index.js +3 -3
  15. package/dist/cjs/plugins/attachments/index.js.map +1 -1
  16. package/dist/cjs/plugins/cleanup/cleanup.js +5 -3
  17. package/dist/cjs/plugins/cleanup/cleanup.js.map +1 -1
  18. package/dist/cjs/plugins/crdt/index.js +52 -0
  19. package/dist/cjs/plugins/crdt/index.js.map +1 -1
  20. package/dist/cjs/plugins/dev-mode/check-query.js +7 -1
  21. package/dist/cjs/plugins/dev-mode/check-query.js.map +1 -1
  22. package/dist/cjs/plugins/dev-mode/check-schema.js +2 -1
  23. package/dist/cjs/plugins/dev-mode/check-schema.js.map +1 -1
  24. package/dist/cjs/plugins/dev-mode/error-messages.js +43 -5
  25. package/dist/cjs/plugins/dev-mode/error-messages.js.map +1 -1
  26. package/dist/cjs/plugins/encryption-crypto-js/index.js +22 -6
  27. package/dist/cjs/plugins/encryption-crypto-js/index.js.map +1 -1
  28. package/dist/cjs/plugins/leader-election/index.js +5 -5
  29. package/dist/cjs/plugins/leader-election/index.js.map +1 -1
  30. package/dist/cjs/plugins/local-documents/local-documents.js +20 -13
  31. package/dist/cjs/plugins/local-documents/local-documents.js.map +1 -1
  32. package/dist/cjs/plugins/migration-schema/migration-helpers.js +3 -0
  33. package/dist/cjs/plugins/migration-schema/migration-helpers.js.map +1 -1
  34. package/dist/cjs/plugins/migration-schema/rx-migration-state.js +1 -1
  35. package/dist/cjs/plugins/migration-schema/rx-migration-state.js.map +1 -1
  36. package/dist/cjs/plugins/pipeline/rx-pipeline.js +5 -1
  37. package/dist/cjs/plugins/pipeline/rx-pipeline.js.map +1 -1
  38. package/dist/cjs/plugins/query-builder/mquery/nosql-query-builder.js +4 -2
  39. package/dist/cjs/plugins/query-builder/mquery/nosql-query-builder.js.map +1 -1
  40. package/dist/cjs/plugins/replication/index.js +40 -2
  41. package/dist/cjs/plugins/replication/index.js.map +1 -1
  42. package/dist/cjs/plugins/replication-google-drive/document-handling.js +17 -6
  43. package/dist/cjs/plugins/replication-google-drive/document-handling.js.map +1 -1
  44. package/dist/cjs/plugins/replication-google-drive/google-drive-helper.js +1 -1
  45. package/dist/cjs/plugins/replication-google-drive/google-drive-helper.js.map +1 -1
  46. package/dist/cjs/plugins/replication-google-drive/google-drive-types.js.map +1 -1
  47. package/dist/cjs/plugins/replication-google-drive/signaling.js +4 -1
  48. package/dist/cjs/plugins/replication-google-drive/signaling.js.map +1 -1
  49. package/dist/cjs/plugins/replication-google-drive/upstream.js +7 -4
  50. package/dist/cjs/plugins/replication-google-drive/upstream.js.map +1 -1
  51. package/dist/cjs/plugins/replication-microsoft-onedrive/signaling.js +4 -1
  52. package/dist/cjs/plugins/replication-microsoft-onedrive/signaling.js.map +1 -1
  53. package/dist/cjs/plugins/state/rx-state.js +14 -3
  54. package/dist/cjs/plugins/state/rx-state.js.map +1 -1
  55. package/dist/cjs/plugins/storage-dexie/rx-storage-instance-dexie.js +0 -7
  56. package/dist/cjs/plugins/storage-dexie/rx-storage-instance-dexie.js.map +1 -1
  57. package/dist/cjs/plugins/storage-memory/binary-search-bounds.js +112 -40
  58. package/dist/cjs/plugins/storage-memory/binary-search-bounds.js.map +1 -1
  59. package/dist/cjs/plugins/storage-memory/memory-helper.js +127 -40
  60. package/dist/cjs/plugins/storage-memory/memory-helper.js.map +1 -1
  61. package/dist/cjs/plugins/storage-memory/memory-indexes.js +1 -0
  62. package/dist/cjs/plugins/storage-memory/memory-indexes.js.map +1 -1
  63. package/dist/cjs/plugins/storage-memory/memory-types.js.map +1 -1
  64. package/dist/cjs/plugins/storage-memory/rx-storage-instance-memory.js +97 -37
  65. package/dist/cjs/plugins/storage-memory/rx-storage-instance-memory.js.map +1 -1
  66. package/dist/cjs/plugins/storage-mongodb/mongodb-helper.js +42 -1
  67. package/dist/cjs/plugins/storage-mongodb/mongodb-helper.js.map +1 -1
  68. package/dist/cjs/plugins/storage-mongodb/rx-storage-instance-mongodb.js +7 -7
  69. package/dist/cjs/plugins/storage-mongodb/rx-storage-instance-mongodb.js.map +1 -1
  70. package/dist/cjs/plugins/test-utils/config.js +1 -1
  71. package/dist/cjs/plugins/test-utils/config.js.map +1 -1
  72. package/dist/cjs/plugins/test-utils/performance.js +122 -92
  73. package/dist/cjs/plugins/test-utils/performance.js.map +1 -1
  74. package/dist/cjs/plugins/test-utils/schema-objects.js +1 -1
  75. package/dist/cjs/plugins/test-utils/schema-objects.js.map +1 -1
  76. package/dist/cjs/plugins/test-utils/test-util.js +62 -0
  77. package/dist/cjs/plugins/test-utils/test-util.js.map +1 -1
  78. package/dist/cjs/plugins/utils/utils-map.js +2 -2
  79. package/dist/cjs/plugins/utils/utils-map.js.map +1 -1
  80. package/dist/cjs/plugins/utils/utils-object-deep-equal.js +3 -2
  81. package/dist/cjs/plugins/utils/utils-object-deep-equal.js.map +1 -1
  82. package/dist/cjs/plugins/utils/utils-object-dot-prop.js +25 -0
  83. package/dist/cjs/plugins/utils/utils-object-dot-prop.js.map +1 -1
  84. package/dist/cjs/plugins/utils/utils-object.js +102 -27
  85. package/dist/cjs/plugins/utils/utils-object.js.map +1 -1
  86. package/dist/cjs/plugins/utils/utils-other.js +9 -4
  87. package/dist/cjs/plugins/utils/utils-other.js.map +1 -1
  88. package/dist/cjs/plugins/utils/utils-premium.js +5 -23
  89. package/dist/cjs/plugins/utils/utils-premium.js.map +1 -1
  90. package/dist/cjs/plugins/utils/utils-revision.js +20 -10
  91. package/dist/cjs/plugins/utils/utils-revision.js.map +1 -1
  92. package/dist/cjs/plugins/utils/utils-rxdb-version.js +1 -1
  93. package/dist/cjs/plugins/utils/utils-rxdb-version.js.map +1 -1
  94. package/dist/cjs/plugins/utils/utils-string.js +11 -8
  95. package/dist/cjs/plugins/utils/utils-string.js.map +1 -1
  96. package/dist/cjs/plugins/utils/utils-time.js +21 -16
  97. package/dist/cjs/plugins/utils/utils-time.js.map +1 -1
  98. package/dist/cjs/query-cache.js +6 -4
  99. package/dist/cjs/query-cache.js.map +1 -1
  100. package/dist/cjs/query-planner.js +2 -2
  101. package/dist/cjs/query-planner.js.map +1 -1
  102. package/dist/cjs/replication-protocol/downstream.js +1 -1
  103. package/dist/cjs/replication-protocol/downstream.js.map +1 -1
  104. package/dist/cjs/rx-collection-helper.js +11 -6
  105. package/dist/cjs/rx-collection-helper.js.map +1 -1
  106. package/dist/cjs/rx-collection.js +34 -6
  107. package/dist/cjs/rx-collection.js.map +1 -1
  108. package/dist/cjs/rx-database.js +40 -7
  109. package/dist/cjs/rx-database.js.map +1 -1
  110. package/dist/cjs/rx-document.js +10 -3
  111. package/dist/cjs/rx-document.js.map +1 -1
  112. package/dist/cjs/rx-query-helper.js +35 -12
  113. package/dist/cjs/rx-query-helper.js.map +1 -1
  114. package/dist/cjs/rx-query-single-result.js +9 -2
  115. package/dist/cjs/rx-query-single-result.js.map +1 -1
  116. package/dist/cjs/rx-query.js +72 -29
  117. package/dist/cjs/rx-query.js.map +1 -1
  118. package/dist/cjs/rx-schema-helper.js +9 -3
  119. package/dist/cjs/rx-schema-helper.js.map +1 -1
  120. package/dist/cjs/rx-schema.js +1 -0
  121. package/dist/cjs/rx-schema.js.map +1 -1
  122. package/dist/cjs/rx-storage-helper.js +212 -129
  123. package/dist/cjs/rx-storage-helper.js.map +1 -1
  124. package/dist/cjs/types/rx-error.d.js.map +1 -1
  125. package/dist/cjs/types/rx-schema.d.js.map +1 -1
  126. package/dist/esm/change-event-buffer.js +2 -1
  127. package/dist/esm/change-event-buffer.js.map +1 -1
  128. package/dist/esm/custom-index.js +85 -12
  129. package/dist/esm/custom-index.js.map +1 -1
  130. package/dist/esm/doc-cache.js +118 -36
  131. package/dist/esm/doc-cache.js.map +1 -1
  132. package/dist/esm/event-reduce.js +10 -1
  133. package/dist/esm/event-reduce.js.map +1 -1
  134. package/dist/esm/plugin-helpers.js +16 -0
  135. package/dist/esm/plugin-helpers.js.map +1 -1
  136. package/dist/esm/plugins/attachments/index.js +3 -3
  137. package/dist/esm/plugins/attachments/index.js.map +1 -1
  138. package/dist/esm/plugins/cleanup/cleanup.js +5 -3
  139. package/dist/esm/plugins/cleanup/cleanup.js.map +1 -1
  140. package/dist/esm/plugins/crdt/index.js +52 -0
  141. package/dist/esm/plugins/crdt/index.js.map +1 -1
  142. package/dist/esm/plugins/dev-mode/check-query.js +7 -1
  143. package/dist/esm/plugins/dev-mode/check-query.js.map +1 -1
  144. package/dist/esm/plugins/dev-mode/check-schema.js +2 -1
  145. package/dist/esm/plugins/dev-mode/check-schema.js.map +1 -1
  146. package/dist/esm/plugins/dev-mode/error-messages.js +43 -5
  147. package/dist/esm/plugins/dev-mode/error-messages.js.map +1 -1
  148. package/dist/esm/plugins/encryption-crypto-js/index.js +22 -6
  149. package/dist/esm/plugins/encryption-crypto-js/index.js.map +1 -1
  150. package/dist/esm/plugins/leader-election/index.js +4 -4
  151. package/dist/esm/plugins/leader-election/index.js.map +1 -1
  152. package/dist/esm/plugins/local-documents/local-documents.js +20 -13
  153. package/dist/esm/plugins/local-documents/local-documents.js.map +1 -1
  154. package/dist/esm/plugins/migration-schema/migration-helpers.js +3 -0
  155. package/dist/esm/plugins/migration-schema/migration-helpers.js.map +1 -1
  156. package/dist/esm/plugins/migration-schema/rx-migration-state.js +1 -1
  157. package/dist/esm/plugins/migration-schema/rx-migration-state.js.map +1 -1
  158. package/dist/esm/plugins/pipeline/rx-pipeline.js +5 -1
  159. package/dist/esm/plugins/pipeline/rx-pipeline.js.map +1 -1
  160. package/dist/esm/plugins/query-builder/mquery/nosql-query-builder.js +4 -2
  161. package/dist/esm/plugins/query-builder/mquery/nosql-query-builder.js.map +1 -1
  162. package/dist/esm/plugins/replication/index.js +40 -2
  163. package/dist/esm/plugins/replication/index.js.map +1 -1
  164. package/dist/esm/plugins/replication-google-drive/document-handling.js +17 -6
  165. package/dist/esm/plugins/replication-google-drive/document-handling.js.map +1 -1
  166. package/dist/esm/plugins/replication-google-drive/google-drive-helper.js +1 -1
  167. package/dist/esm/plugins/replication-google-drive/google-drive-helper.js.map +1 -1
  168. package/dist/esm/plugins/replication-google-drive/google-drive-types.js.map +1 -1
  169. package/dist/esm/plugins/replication-google-drive/signaling.js +4 -1
  170. package/dist/esm/plugins/replication-google-drive/signaling.js.map +1 -1
  171. package/dist/esm/plugins/replication-google-drive/upstream.js +7 -4
  172. package/dist/esm/plugins/replication-google-drive/upstream.js.map +1 -1
  173. package/dist/esm/plugins/replication-microsoft-onedrive/signaling.js +4 -1
  174. package/dist/esm/plugins/replication-microsoft-onedrive/signaling.js.map +1 -1
  175. package/dist/esm/plugins/state/rx-state.js +15 -4
  176. package/dist/esm/plugins/state/rx-state.js.map +1 -1
  177. package/dist/esm/plugins/storage-dexie/rx-storage-instance-dexie.js +1 -8
  178. package/dist/esm/plugins/storage-dexie/rx-storage-instance-dexie.js.map +1 -1
  179. package/dist/esm/plugins/storage-memory/binary-search-bounds.js +107 -40
  180. package/dist/esm/plugins/storage-memory/binary-search-bounds.js.map +1 -1
  181. package/dist/esm/plugins/storage-memory/memory-helper.js +128 -41
  182. package/dist/esm/plugins/storage-memory/memory-helper.js.map +1 -1
  183. package/dist/esm/plugins/storage-memory/memory-indexes.js +1 -0
  184. package/dist/esm/plugins/storage-memory/memory-indexes.js.map +1 -1
  185. package/dist/esm/plugins/storage-memory/memory-types.js.map +1 -1
  186. package/dist/esm/plugins/storage-memory/rx-storage-instance-memory.js +90 -30
  187. package/dist/esm/plugins/storage-memory/rx-storage-instance-memory.js.map +1 -1
  188. package/dist/esm/plugins/storage-mongodb/mongodb-helper.js +39 -0
  189. package/dist/esm/plugins/storage-mongodb/mongodb-helper.js.map +1 -1
  190. package/dist/esm/plugins/storage-mongodb/rx-storage-instance-mongodb.js +8 -8
  191. package/dist/esm/plugins/storage-mongodb/rx-storage-instance-mongodb.js.map +1 -1
  192. package/dist/esm/plugins/test-utils/config.js +1 -1
  193. package/dist/esm/plugins/test-utils/config.js.map +1 -1
  194. package/dist/esm/plugins/test-utils/performance.js +122 -92
  195. package/dist/esm/plugins/test-utils/performance.js.map +1 -1
  196. package/dist/esm/plugins/test-utils/schema-objects.js +1 -1
  197. package/dist/esm/plugins/test-utils/schema-objects.js.map +1 -1
  198. package/dist/esm/plugins/test-utils/test-util.js +59 -0
  199. package/dist/esm/plugins/test-utils/test-util.js.map +1 -1
  200. package/dist/esm/plugins/utils/utils-map.js +2 -2
  201. package/dist/esm/plugins/utils/utils-map.js.map +1 -1
  202. package/dist/esm/plugins/utils/utils-object-deep-equal.js +3 -2
  203. package/dist/esm/plugins/utils/utils-object-deep-equal.js.map +1 -1
  204. package/dist/esm/plugins/utils/utils-object-dot-prop.js +25 -0
  205. package/dist/esm/plugins/utils/utils-object-dot-prop.js.map +1 -1
  206. package/dist/esm/plugins/utils/utils-object.js +102 -27
  207. package/dist/esm/plugins/utils/utils-object.js.map +1 -1
  208. package/dist/esm/plugins/utils/utils-other.js +9 -4
  209. package/dist/esm/plugins/utils/utils-other.js.map +1 -1
  210. package/dist/esm/plugins/utils/utils-premium.js +5 -23
  211. package/dist/esm/plugins/utils/utils-premium.js.map +1 -1
  212. package/dist/esm/plugins/utils/utils-revision.js +20 -10
  213. package/dist/esm/plugins/utils/utils-revision.js.map +1 -1
  214. package/dist/esm/plugins/utils/utils-rxdb-version.js +1 -1
  215. package/dist/esm/plugins/utils/utils-rxdb-version.js.map +1 -1
  216. package/dist/esm/plugins/utils/utils-string.js +11 -8
  217. package/dist/esm/plugins/utils/utils-string.js.map +1 -1
  218. package/dist/esm/plugins/utils/utils-time.js +21 -16
  219. package/dist/esm/plugins/utils/utils-time.js.map +1 -1
  220. package/dist/esm/query-cache.js +7 -5
  221. package/dist/esm/query-cache.js.map +1 -1
  222. package/dist/esm/query-planner.js +2 -2
  223. package/dist/esm/query-planner.js.map +1 -1
  224. package/dist/esm/replication-protocol/downstream.js +1 -1
  225. package/dist/esm/replication-protocol/downstream.js.map +1 -1
  226. package/dist/esm/rx-collection-helper.js +12 -7
  227. package/dist/esm/rx-collection-helper.js.map +1 -1
  228. package/dist/esm/rx-collection.js +35 -7
  229. package/dist/esm/rx-collection.js.map +1 -1
  230. package/dist/esm/rx-database.js +40 -7
  231. package/dist/esm/rx-database.js.map +1 -1
  232. package/dist/esm/rx-document.js +11 -4
  233. package/dist/esm/rx-document.js.map +1 -1
  234. package/dist/esm/rx-query-helper.js +35 -12
  235. package/dist/esm/rx-query-helper.js.map +1 -1
  236. package/dist/esm/rx-query-single-result.js +10 -3
  237. package/dist/esm/rx-query-single-result.js.map +1 -1
  238. package/dist/esm/rx-query.js +72 -29
  239. package/dist/esm/rx-query.js.map +1 -1
  240. package/dist/esm/rx-schema-helper.js +9 -3
  241. package/dist/esm/rx-schema-helper.js.map +1 -1
  242. package/dist/esm/rx-schema.js +1 -0
  243. package/dist/esm/rx-schema.js.map +1 -1
  244. package/dist/esm/rx-storage-helper.js +176 -94
  245. package/dist/esm/rx-storage-helper.js.map +1 -1
  246. package/dist/esm/types/rx-error.d.js.map +1 -1
  247. package/dist/esm/types/rx-schema.d.js.map +1 -1
  248. package/dist/types/custom-index.d.ts +5 -0
  249. package/dist/types/doc-cache.d.ts +1 -1
  250. package/dist/types/plugins/dev-mode/error-messages.d.ts +36 -0
  251. package/dist/types/plugins/leader-election/index.d.ts +1 -0
  252. package/dist/types/plugins/replication-google-drive/document-handling.d.ts +4 -1
  253. package/dist/types/plugins/replication-google-drive/google-drive-types.d.ts +1 -0
  254. package/dist/types/plugins/state/rx-state.d.ts +1 -1
  255. package/dist/types/plugins/storage-denokv/index.d.ts +1 -1
  256. package/dist/types/plugins/storage-dexie/rx-storage-dexie.d.ts +1 -1
  257. package/dist/types/plugins/storage-localstorage/index.d.ts +1 -1
  258. package/dist/types/plugins/storage-memory/binary-search-bounds.d.ts +21 -10
  259. package/dist/types/plugins/storage-memory/memory-helper.d.ts +7 -3
  260. package/dist/types/plugins/storage-memory/memory-types.d.ts +5 -0
  261. package/dist/types/plugins/storage-mongodb/mongodb-helper.d.ts +9 -1
  262. package/dist/types/plugins/storage-mongodb/rx-storage-instance-mongodb.d.ts +2 -2
  263. package/dist/types/plugins/storage-mongodb/rx-storage-mongodb.d.ts +1 -1
  264. package/dist/types/plugins/storage-remote/rx-storage-remote.d.ts +1 -1
  265. package/dist/types/plugins/storage-sqlite/index.d.ts +1 -1
  266. package/dist/types/plugins/test-utils/performance.d.ts +36 -0
  267. package/dist/types/plugins/test-utils/test-util.d.ts +17 -0
  268. package/dist/types/plugins/utils/utils-object.d.ts +8 -3
  269. package/dist/types/plugins/utils/utils-premium.d.ts +0 -2
  270. package/dist/types/plugins/utils/utils-rxdb-version.d.ts +1 -1
  271. package/dist/types/rx-database.d.ts +1 -1
  272. package/dist/types/rx-query-single-result.d.ts +1 -1
  273. package/dist/types/rx-query.d.ts +3 -2
  274. package/dist/types/rx-storage-helper.d.ts +15 -0
  275. package/dist/types/types/rx-error.d.ts +3 -0
  276. package/dist/types/types/rx-schema.d.ts +5 -0
  277. package/eslint.config.mjs +2 -1
  278. package/package.json +38 -35
  279. package/scripts/check-code-block-line-length.js +91 -0
  280. package/scripts/check-em-dashes.js +53 -0
  281. package/scripts/copy-path.mjs +20 -0
  282. package/scripts/docs-fetch-git-history.mjs +36 -0
  283. package/scripts/fix-types.mjs +15 -8
  284. package/scripts/install-foundationdb.sh +0 -6
  285. package/scripts/notify-indexnow.mjs +171 -0
  286. package/scripts/start-foundationdb-docker.sh +73 -0
  287. package/src/change-event-buffer.ts +4 -1
  288. package/src/custom-index.ts +93 -16
  289. package/src/doc-cache.ts +117 -41
  290. package/src/event-reduce.ts +10 -1
  291. package/src/plugin-helpers.ts +10 -0
  292. package/src/plugins/attachments/index.ts +10 -12
  293. package/src/plugins/cleanup/cleanup.ts +5 -3
  294. package/src/plugins/crdt/index.ts +55 -0
  295. package/src/plugins/dev-mode/check-query.ts +7 -1
  296. package/src/plugins/dev-mode/check-schema.ts +2 -1
  297. package/src/plugins/dev-mode/error-messages.ts +45 -5
  298. package/src/plugins/encryption-crypto-js/index.ts +18 -6
  299. package/src/plugins/leader-election/index.ts +9 -8
  300. package/src/plugins/local-documents/local-documents.ts +21 -12
  301. package/src/plugins/migration-schema/migration-helpers.ts +3 -0
  302. package/src/plugins/migration-schema/rx-migration-state.ts +1 -1
  303. package/src/plugins/pipeline/rx-pipeline.ts +5 -1
  304. package/src/plugins/query-builder/mquery/nosql-query-builder.ts +8 -2
  305. package/src/plugins/replication/index.ts +41 -3
  306. package/src/plugins/replication-google-drive/document-handling.ts +17 -5
  307. package/src/plugins/replication-google-drive/google-drive-helper.ts +1 -1
  308. package/src/plugins/replication-google-drive/google-drive-types.ts +1 -0
  309. package/src/plugins/replication-google-drive/signaling.ts +4 -1
  310. package/src/plugins/replication-google-drive/upstream.ts +7 -4
  311. package/src/plugins/replication-microsoft-onedrive/signaling.ts +4 -1
  312. package/src/plugins/state/rx-state.ts +17 -5
  313. package/src/plugins/storage-dexie/rx-storage-instance-dexie.ts +0 -27
  314. package/src/plugins/storage-memory/binary-search-bounds.ts +105 -40
  315. package/src/plugins/storage-memory/memory-helper.ts +158 -67
  316. package/src/plugins/storage-memory/memory-indexes.ts +1 -0
  317. package/src/plugins/storage-memory/memory-types.ts +5 -0
  318. package/src/plugins/storage-memory/rx-storage-instance-memory.ts +104 -53
  319. package/src/plugins/storage-mongodb/mongodb-helper.ts +43 -1
  320. package/src/plugins/storage-mongodb/rx-storage-instance-mongodb.ts +11 -9
  321. package/src/plugins/test-utils/config.ts +2 -1
  322. package/src/plugins/test-utils/performance.ts +159 -85
  323. package/src/plugins/test-utils/schema-objects.ts +1 -1
  324. package/src/plugins/test-utils/test-util.ts +71 -0
  325. package/src/plugins/utils/utils-map.ts +2 -2
  326. package/src/plugins/utils/utils-object-deep-equal.ts +2 -4
  327. package/src/plugins/utils/utils-object-dot-prop.ts +25 -0
  328. package/src/plugins/utils/utils-object.ts +103 -28
  329. package/src/plugins/utils/utils-other.ts +9 -4
  330. package/src/plugins/utils/utils-premium.ts +11 -37
  331. package/src/plugins/utils/utils-revision.ts +20 -9
  332. package/src/plugins/utils/utils-rxdb-version.ts +1 -1
  333. package/src/plugins/utils/utils-string.ts +11 -9
  334. package/src/plugins/utils/utils-time.ts +21 -17
  335. package/src/query-cache.ts +6 -5
  336. package/src/query-planner.ts +2 -2
  337. package/src/replication-protocol/downstream.ts +1 -1
  338. package/src/rx-collection-helper.ts +12 -6
  339. package/src/rx-collection.ts +39 -8
  340. package/src/rx-database.ts +49 -17
  341. package/src/rx-document.ts +12 -3
  342. package/src/rx-query-helper.ts +36 -15
  343. package/src/rx-query-single-result.ts +10 -3
  344. package/src/rx-query.ts +48 -8
  345. package/src/rx-schema-helper.ts +7 -4
  346. package/src/rx-schema.ts +1 -0
  347. package/src/rx-storage-helper.ts +210 -139
  348. package/src/types/rx-error.d.ts +3 -0
  349. package/src/types/rx-schema.d.ts +5 -0
@@ -1,14 +1,25 @@
1
1
  /**
2
- * Everything in this file was copied and adapted from
3
- * @link https://github.com/mikolalysenko/binary-search-bounds
4
- *
5
- * We should use the original npm module instead when this bug is fixed:
6
- * @link https://github.com/mikolalysenko/binary-search-bounds/pull/14
2
+ * Optimized binary search functions for the memory storage.
3
+ * Based on https://github.com/mikolalysenko/binary-search-bounds
4
+ * but with performance improvements:
5
+ * - Removed unnecessary undefined checks for comparator
6
+ * - Inlined the norm() wrapper to avoid extra function calls
7
+ * - Added string-specialized variants to avoid temporary array allocations
7
8
  */
8
9
  type Compare<T> = ((a: T, b: T) => number | null | undefined);
9
- export declare function boundGE<T>(a: T[], y: T, c: Compare<T>, l?: any, h?: any): any;
10
- export declare function boundGT<T>(a: T[], y: T, c: Compare<T>, l?: any, h?: any): any;
11
- export declare function boundLT<T>(a: T[], y: T, c: Compare<T>, l?: any, h?: any): any;
12
- export declare function boundLE<T>(a: T[], y: T, c: Compare<T>, l?: any, h?: any): any;
13
- export declare function boundEQ<T>(a: T[], y: T, c: Compare<T>, l?: any, h?: any): any;
10
+ export declare function boundGE<T>(a: T[], y: T, c: Compare<T>, lo?: any, hi?: any): number;
11
+ export declare function boundGT<T>(a: T[], y: T, c: Compare<T>, lo?: any, hi?: any): number;
12
+ export declare function boundLT<T>(a: T[], y: T, c: Compare<T>, lo?: any, hi?: any): number;
13
+ export declare function boundLE<T>(a: T[], y: T, c: Compare<T>, lo?: any, hi?: any): number;
14
+ export declare function boundEQ<T>(a: T[], y: T, c: Compare<T>, lo?: any, hi?: any): number;
15
+ /**
16
+ * Specialized binary search functions that compare DocWithIndexString
17
+ * entries directly against an index string, avoiding temporary array allocations.
18
+ * Used in query() and count() hot paths.
19
+ */
20
+ export declare function boundGEByIndexString<T extends [string, ...any[]]>(a: T[], indexString: string): number;
21
+ export declare function boundGTByIndexString<T extends [string, ...any[]]>(a: T[], indexString: string): number;
22
+ export declare function boundEQByIndexString<T extends [string, ...any[]]>(a: T[], indexString: string): number;
23
+ export declare function boundLTByIndexString<T extends [string, ...any[]]>(a: T[], indexString: string): number;
24
+ export declare function boundLEByIndexString<T extends [string, ...any[]]>(a: T[], indexString: string): number;
14
25
  export {};
@@ -11,9 +11,13 @@ export declare function putWriteRowToState<RxDocType>(docId: string, state: Memo
11
11
  /**
12
12
  * @hotPath
13
13
  * Efficiently inserts multiple documents into the state at once.
14
- * Instead of inserting one-by-one with Array.splice() (O(n) per insert),
15
- * this pre-computes all index entries, sorts them, and merges them into
16
- * the existing sorted arrays in a single pass (O(n log n + n + m)).
14
+ *
15
+ * Uses two strategies based on batch size:
16
+ * - For small batches (relative to existing index size), uses in-place
17
+ * binary search + splice per document. This avoids allocating a new
18
+ * full-size array and copying all elements, reducing GC pressure.
19
+ * - For large batches (or empty indexes), pre-computes all index entries,
20
+ * sorts them, and merges into the existing sorted arrays in a single pass.
17
21
  */
18
22
  export declare function bulkInsertToState<RxDocType>(primaryPath: string, state: MemoryStorageInternals<RxDocType>, stateByIndex: MemoryStorageInternalsByIndex<RxDocType>[], docs: {
19
23
  document: RxDocumentData<RxDocType>;
@@ -58,6 +58,11 @@ export type MemoryStorageInternals<RxDocType> = {
58
58
  */
59
59
  [indexName: string]: MemoryStorageInternalsByIndex<RxDocType>;
60
60
  };
61
+ /**
62
+ * Cached array of all MemoryStorageInternalsByIndex values.
63
+ * Avoids calling Object.values(byIndex) on every write operation.
64
+ */
65
+ byIndexArray: MemoryStorageInternalsByIndex<RxDocType>[];
61
66
  /**
62
67
  * We need these to do lazy writes.
63
68
  */
@@ -1,5 +1,5 @@
1
1
  import type { FilledMangoQuery, MangoQuerySelector, MangoQuerySortPart, RxDocumentData, RxJsonSchema } from '../../types/index.d.ts';
2
- import { Sort as MongoSort } from 'mongodb';
2
+ import { Sort as MongoSort, MongoClient } from 'mongodb';
3
3
  import { MongoDBPreparedQuery, MongoQuerySelector } from './mongodb-types.ts';
4
4
  export declare const RX_STORAGE_NAME_MONGODB = "mongodb";
5
5
  export declare const MONGO_OPTIONS_DRIVER_INFO: {
@@ -20,3 +20,11 @@ export declare function swapMongoToRxDoc<RxDocType>(docData: any): RxDocumentDat
20
20
  export declare function swapRxDocToMongo<RxDocType>(docData: RxDocumentData<RxDocType>): any;
21
21
  export declare function swapToMongoSort<RxDocType>(sort: MangoQuerySortPart<RxDocType>[]): MongoSort;
22
22
  export declare function getMongoDBIndexName(index: string[]): string;
23
+ export declare const MONGO_CLIENT_CACHE: Map<string, {
24
+ client: MongoClient;
25
+ refCount: number;
26
+ promise: Promise<MongoClient>;
27
+ closeTimeout?: ReturnType<typeof setTimeout>;
28
+ }>;
29
+ export declare function getMongoDBClient(connection: string): Promise<MongoClient>;
30
+ export declare function closeMongoDBClient(connection: string): Promise<void>;
@@ -11,11 +11,11 @@ export declare class RxStorageInstanceMongoDB<RxDocType> implements RxStorageIns
11
11
  readonly internals: MongoDBStorageInternals;
12
12
  readonly options: Readonly<RxStorageMongoDBInstanceCreationOptions>;
13
13
  readonly settings: RxStorageMongoDBSettings;
14
+ readonly mongoClient: MongoClient;
14
15
  readonly primaryPath: StringKeys<RxDocumentData<RxDocType>>;
15
16
  readonly inMongoPrimaryPath: string;
16
17
  closed?: Promise<void>;
17
18
  private readonly changes$;
18
- readonly mongoClient: MongoClient;
19
19
  readonly mongoDatabase: MongoDatabase;
20
20
  readonly mongoCollectionPromise: Promise<MongoCollection<RxDocumentData<RxDocType> | any>>;
21
21
  /**
@@ -32,7 +32,7 @@ export declare class RxStorageInstanceMongoDB<RxDocType> implements RxStorageIns
32
32
  * to RxDB
33
33
  */
34
34
  readonly mongoObjectIdCache: WeakMap<RxDocumentData<RxDocType>, ObjectId>;
35
- constructor(storage: RxStorageMongoDB, databaseName: string, collectionName: string, schema: Readonly<RxJsonSchema<RxDocumentData<RxDocType>>>, internals: MongoDBStorageInternals, options: Readonly<RxStorageMongoDBInstanceCreationOptions>, settings: RxStorageMongoDBSettings);
35
+ constructor(storage: RxStorageMongoDB, databaseName: string, collectionName: string, schema: Readonly<RxJsonSchema<RxDocumentData<RxDocType>>>, internals: MongoDBStorageInternals, options: Readonly<RxStorageMongoDBInstanceCreationOptions>, settings: RxStorageMongoDBSettings, mongoClient: MongoClient);
36
36
  /**
37
37
  * Bulk writes on the mongodb storage.
38
38
  * Notice that MongoDB does not support cross-document transactions
@@ -4,7 +4,7 @@ import { RxStorageInstanceMongoDB } from './rx-storage-instance-mongodb.ts';
4
4
  export declare class RxStorageMongoDB implements RxStorage<MongoDBStorageInternals, MongoDBSettings> {
5
5
  databaseSettings: MongoDBDatabaseSettings;
6
6
  name: string;
7
- readonly rxdbVersion = "17.0.0-beta.17";
7
+ readonly rxdbVersion = "17.1.0";
8
8
  constructor(databaseSettings: MongoDBDatabaseSettings);
9
9
  createStorageInstance<RxDocType>(params: RxStorageInstanceCreationParams<RxDocType, MongoDBSettings>): Promise<RxStorageInstanceMongoDB<RxDocType>>;
10
10
  }
@@ -4,7 +4,7 @@ import type { MessageFromRemote, RemoteMessageChannel, RxStorageRemoteInternals,
4
4
  export declare class RxStorageRemote implements RxStorage<RxStorageRemoteInternals, any> {
5
5
  readonly settings: RxStorageRemoteSettings;
6
6
  readonly name: string;
7
- readonly rxdbVersion = "17.0.0-beta.17";
7
+ readonly rxdbVersion = "17.1.0";
8
8
  private seed;
9
9
  private lastRequestId;
10
10
  messageChannelIfOneMode?: Promise<RemoteMessageChannel>;
@@ -8,7 +8,7 @@ export * from './sqlite-basics-helpers.ts';
8
8
  export declare class RxStorageSQLiteTrial implements RxStorage<SQLiteInternals, SQLiteInstanceCreationOptions> {
9
9
  settings: SQLiteStorageSettings;
10
10
  name: string;
11
- readonly rxdbVersion = "17.0.0-beta.17";
11
+ readonly rxdbVersion = "17.1.0";
12
12
  constructor(settings: SQLiteStorageSettings);
13
13
  createStorageInstance<RxDocType>(params: RxStorageInstanceCreationParams<RxDocType, SQLiteInstanceCreationOptions>): Promise<RxStorageInstanceSQLite<RxDocType>>;
14
14
  }
@@ -42,6 +42,42 @@ export type PerformanceTestConfig = {
42
42
  * @default true
43
43
  */
44
44
  log?: boolean;
45
+ /**
46
+ * If set, the database will be created with encryption
47
+ * and the schema will mark applicable fields as encrypted.
48
+ */
49
+ password?: any;
50
+ /**
51
+ * Whether to run the bulk find-by-ids test.
52
+ * @default true
53
+ */
54
+ testBulkFindByIds?: boolean;
55
+ /**
56
+ * Whether to run the serial find-by-id test.
57
+ * @default true
58
+ */
59
+ testSerialFindById?: boolean;
60
+ /**
61
+ * Whether to run the find-by-query test.
62
+ * @default true
63
+ */
64
+ testFindByQuery?: boolean;
65
+ /**
66
+ * Whether to run the find-by-query-parallel test.
67
+ * @default true
68
+ */
69
+ testFindByQueryParallel?: boolean;
70
+ /**
71
+ * Whether to run the count query test.
72
+ * @default true
73
+ */
74
+ testCount?: boolean;
75
+ /**
76
+ * Whether to run the property access test.
77
+ * Requires testFindByQuery to also be enabled.
78
+ * @default true
79
+ */
80
+ testPropertyAccess?: boolean;
45
81
  };
46
82
  export type PerformanceTestResult = {
47
83
  description: string;
@@ -7,4 +7,21 @@ export declare function ensureCollectionsHaveEqualState<RxDocType>(c1: RxCollect
7
7
  * Waits until the collections have the equal state.
8
8
  */
9
9
  export declare function awaitCollectionsHaveEqualState<RxDocType>(c1: RxCollection<RxDocType>, c2: RxCollection<RxDocType>, logContext?: string, timeout?: number): Promise<void>;
10
+ /**
11
+ * Deletes all locally stored IndexedDB databases.
12
+ * Noop if IndexedDB is not available (e.g. in Node.js)
13
+ * or if the .databases() method is not supported.
14
+ */
15
+ export declare function clearAllLocalIndexedDB(): Promise<void>;
16
+ /**
17
+ * Deletes all files and directories stored in the
18
+ * Origin Private File System (OPFS).
19
+ * Noop if OPFS is not available (e.g. in Node.js).
20
+ */
21
+ export declare function clearAllLocalOPFS(maxRetries?: number, delayMs?: number): Promise<void>;
22
+ /**
23
+ * Clears all localStorage data.
24
+ * Noop if localStorage is not available (e.g. in Node.js).
25
+ */
26
+ export declare function clearAllLocalStorage(): Promise<void>;
10
27
  export declare function ensureReplicationHasNoErrors(replicationState: RxReplicationState<any, any>): void;
@@ -19,8 +19,9 @@ export declare function getFromObjectOrThrow<V>(obj: {
19
19
  export declare function flattenObject(ob: any): any;
20
20
  /**
21
21
  * does a flat copy on the objects,
22
- * is about 3 times faster than using deepClone
23
- * @link https://jsperf.com/object-rest-spread-vs-clone/2
22
+ * is about 3 times faster than using deepClone.
23
+ * Using the spread operator instead of Object.assign
24
+ * because V8 optimizes spread for plain objects (~4x faster).
24
25
  */
25
26
  export declare function flatClone<T>(obj: T | DeepReadonlyObject<T> | Readonly<T>): T;
26
27
  /**
@@ -48,7 +49,11 @@ declare function deepClone<T>(src: T | DeepReadonlyObject<T>): T;
48
49
  export declare const clone: typeof deepClone;
49
50
  /**
50
51
  * overwrites the getter with the actual value
51
- * Mostly used for caching stuff on the first run
52
+ * Mostly used for caching stuff on the first run.
53
+ *
54
+ * Using a value descriptor instead of a getter descriptor
55
+ * so that subsequent property accesses are direct value lookups
56
+ * instead of function calls, which is ~37% faster for reads.
52
57
  */
53
58
  export declare function overwriteGetterForCaching<ValueType = any>(obj: any, getterName: string, value: ValueType): ValueType;
54
59
  export declare function hasDeepProperty(obj: any, property: string): boolean;
@@ -4,7 +4,5 @@ export declare const NON_PREMIUM_COLLECTION_LIMIT = 999;
4
4
  * Here we check if the premium flag has been set.
5
5
  * This code exists in the open source version of RxDB.
6
6
  * Yes you are allowed to fork the repo and just overwrite this function.
7
- * However you might better spend this time developing your real project
8
- * and supporting the RxDB efforts by buying premium.
9
7
  */
10
8
  export declare function hasPremiumFlag(): Promise<boolean>;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * This file is replaced in the 'npm run build:version' script.
3
3
  */
4
- export declare const RXDB_VERSION = "17.0.0-beta.17";
4
+ export declare const RXDB_VERSION = "17.1.0";
@@ -30,7 +30,7 @@ export declare class RxDatabaseBase<Internals, InstanceCreationOptions, Collecti
30
30
  readonly reactivity?: RxReactivityFactory<any> | undefined;
31
31
  readonly onClosed?: (() => void) | undefined;
32
32
  readonly idleQueue: IdleQueue;
33
- readonly rxdbVersion = "17.0.0-beta.17";
33
+ readonly rxdbVersion = "17.1.0";
34
34
  /**
35
35
  * Contains all known non-closed storage instances
36
36
  * that belong to this database.
@@ -11,7 +11,7 @@ export declare class RxQuerySingleResult<RxDocType> {
11
11
  readonly query: RxQueryBase<RxDocType, unknown>;
12
12
  readonly count: number;
13
13
  /**
14
- * Time at which the current _result state was created.
14
+ * Unique identifier for this result state.
15
15
  * Used to determine if the result set has changed since X
16
16
  * so that we do not emit the same result multiple times on subscription.
17
17
  */
@@ -21,7 +21,8 @@ export declare class RxQueryBase<RxDocType, RxQueryResult, OrmMethods = {}, Reac
21
21
  _creationTime: number;
22
22
  _lastEnsureEqual: number;
23
23
  uncached: boolean;
24
- refCount$: BehaviorSubject<null>;
24
+ _refCount$: BehaviorSubject<null> | null;
25
+ get refCount$(): BehaviorSubject<null>;
25
26
  isFindOneByIdQuery: false | string | string[];
26
27
  /**
27
28
  * Contains the current result state
@@ -98,7 +99,7 @@ export declare class RxQueryBase<RxDocType, RxQueryResult, OrmMethods = {}, Reac
98
99
  * deletes all found documents
99
100
  * @return promise with deleted documents
100
101
  */
101
- remove(): Promise<RxQueryResult>;
102
+ remove(throwIfMissing?: boolean): Promise<RxQueryResult>;
102
103
  incrementalRemove(): Promise<RxQueryResult>;
103
104
  /**
104
105
  * helper function to transform RxQueryBase to RxQuery type
@@ -5,6 +5,21 @@ import type { BulkWriteRow, BulkWriteRowProcessed, CategorizeBulkWriteRowsOutput
5
5
  import { Observable } from 'rxjs';
6
6
  export declare const INTERNAL_STORAGE_NAME = "_rxdb_internal";
7
7
  export declare const RX_DATABASE_LOCAL_DOCS_STORAGE_NAME = "rxdatabase_storage_local";
8
+ /**
9
+ * Context string used by RxCollection.bulkInsert().
10
+ * Documents written with this context are already cloned
11
+ * by fillObjectDataBeforeInsert(), so the wrapped storage
12
+ * can safely mutate them in place instead of cloning again.
13
+ */
14
+ export declare const RX_COLLECTION_BULK_INSERT_CONTEXT = "rx-collection-bulk-insert";
15
+ /**
16
+ * Register a bulkWrite context string as "mutable",
17
+ * meaning the caller guarantees that insert documents
18
+ * are already cloned and safe to mutate in place.
19
+ * This allows the wrapped storage to skip a redundant
20
+ * flatClone() call on the insert hot path.
21
+ */
22
+ export declare function registerMutableWriteContext(context: string): void;
8
23
  export declare function getSingleDocument<RxDocType>(storageInstance: RxStorageInstance<RxDocType, any, any>, documentId: string): Promise<RxDocumentData<RxDocType> | undefined>;
9
24
  /**
10
25
  * Writes a single document,
@@ -28,6 +28,7 @@ export interface RxErrorParameters {
28
28
  readonly rootPath?: string;
29
29
  readonly childpath?: string;
30
30
  readonly ids?: string[];
31
+ readonly duplicateIds?: string[];
31
32
  readonly obj?: any;
32
33
  readonly document?: any;
33
34
  readonly schema?: Readonly<RxJsonSchema<any> | RxSchema>;
@@ -71,6 +72,8 @@ export interface RxErrorParameters {
71
72
  readonly passwordHash?: string;
72
73
  readonly existingPasswordHash?: string;
73
74
  readonly password?: string | any;
75
+ readonly passwordType?: string;
76
+ readonly passwordLength?: number;
74
77
  readonly minPassLength?: number;
75
78
  readonly own?: any;
76
79
  readonly source?: any;
@@ -50,6 +50,11 @@ export type JsonSchema<RxDocType = any> = {
50
50
  maxProperties?: number;
51
51
  maximum?: number;
52
52
  minimum?: number;
53
+ /**
54
+ * Having a large maxLength for indexed fields and primary keys can negatively
55
+ * impact performance on many storages. Therefore, you should only set it
56
+ * as big as needed.
57
+ */
53
58
  maxLength?: number;
54
59
  minLength?: number;
55
60
  maxItems?: number;
package/eslint.config.mjs CHANGED
@@ -51,7 +51,8 @@ export default [
51
51
  'docs-src/build/',
52
52
  'docs-src/docusaurus-lunr-search-main',
53
53
  'config/.mocharc.cjs',
54
- 'config/karma.webpack.conf.cjs'
54
+ 'config/karma.webpack.conf.cjs',
55
+ '.chrome-profile-perf/'
55
56
  ]
56
57
  },
57
58
  ...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking'),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@connecttomahdi/rxdb",
3
3
  "description": "A local-first realtime NoSQL Database for JavaScript applications - https://rxdb.info/",
4
- "version": "17.0.0-beta.17",
4
+ "version": "17.1.1",
5
5
  "author": "pubkey",
6
6
  "repository": {
7
7
  "type": "git",
@@ -468,7 +468,6 @@
468
468
  "test:replication-supabase": "npm run transpile && cross-env DEFAULT_STORAGE=dexie mocha --config ./config/.mocharc.cjs ./test_tmp/replication-supabase.test.js",
469
469
  "test:replication-google-drive": "npm run transpile && cross-env DEFAULT_STORAGE=dexie tsx ./node_modules/mocha/bin/mocha --config ./config/.mocharc.cjs ./test/replication-google-drive.test.ts",
470
470
  "test:replication-microsoft-onedrive": "npm run transpile && cross-env DEFAULT_STORAGE=dexie tsx ./node_modules/mocha/bin/mocha --config ./config/.mocharc.cjs ./test/replication-microsoft-onedrive.test.ts",
471
- "test:core": "npm run transpile && mocha ./test_tmp/unit/core.node.js",
472
471
  "test:full": "npm run transpile && mocha ./test_tmp/unit/full.node.js",
473
472
  "test:typings": "npm run build:plugins && tsc --allowImportingTsExtensions --noEmit --skipLibCheck --lib \"ES2022,DOM\" ./test/typings.test.ts",
474
473
  "test:deps": "npm run build && dependency-check ./package.json ./dist/cjs/index.js ./dist/cjs/plugins/validate-is-my-json-valid/index.js ./dist/cjs/plugins/attachments-compression/index.js ./dist/cjs/plugins/validate-ajv/index.js ./dist/cjs/plugins/update/index.js ./dist/cjs/plugins/key-compression/index.js ./dist/cjs/plugins/dev-mode/index.js ./dist/cjs/plugins/encryption-crypto-js/index.js ./dist/cjs/plugins/replication-graphql/index.js ./dist/cjs/plugins/replication-webrtc/index.js ./dist/cjs/plugins/replication-websocket/index.js ./dist/cjs/plugins/replication-firestore/index.js ./dist/cjs/plugins/replication-nats/index.js ./dist/cjs/plugins/validate-z-schema/index.js ./dist/cjs/plugins/storage-dexie/index.js ./dist/cjs/plugins/storage-memory/index.js ./dist/cjs/plugins/storage-mongodb/index.js ./dist/cjs/plugins/reactivity-angular/index.js ./dist/cjs/plugins/reactivity-vue/index.js ./dist/cjs/plugins/react/index.js ./dist/cjs/plugins/reactivity-preact-signals/index.js --no-dev --ignore-module util --ignore-module url --ignore-module ws --ignore-module graphql --ignore-module as-typed --ignore-module \"@types/*\"",
@@ -476,10 +475,11 @@
476
475
  "test:performance:dexie": "npm run transpile && cross-env DEFAULT_STORAGE=dexie CI=true karma start ./config/karma.performance.conf.cjs --single-run",
477
476
  "test:performance:memory:browser": "npm run transpile && cross-env DEFAULT_STORAGE=memory CI=true karma start ./config/karma.performance.conf.cjs --single-run",
478
477
  "test:performance:memory:node": "npm run transpile && cross-env DEFAULT_STORAGE=memory mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc",
478
+ "test:performance:memory:crypto-js": "npm run transpile && cross-env DEFAULT_STORAGE=memory STORAGE_PASSWORD=test-password mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc",
479
479
  "test:performance:memory:bun": "npm run transpile && cross-env DEFAULT_STORAGE=memory bun run ./node_modules/mocha/bin/mocha test_tmp/performance.test.js --bail",
480
480
  "test:performance:memory:deno": "npm run transpile && cross-env DEFAULT_STORAGE=memory deno run --allow-env --allow-read -A npm:mocha test/performance.test.ts --bail",
481
481
  "test:performance:foundationdb": "npm run transpile && cross-env DEFAULT_STORAGE=foundationdb mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc",
482
- "test:performance:mongodb": "npm run transpile && cross-env DEFAULT_STORAGE=mongodb mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc",
482
+ "test:performance:mongodb": "node ./config/mongodb-connection-tester.js && npm run transpile && cross-env DEFAULT_STORAGE=mongodb mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc",
483
483
  "test:performance:custom:browser": "npm run transpile && cross-env DEFAULT_STORAGE=custom CI=true karma start ./config/karma.performance.conf.cjs --single-run",
484
484
  "test:performance:custom:node": "npm run transpile && cross-env DEFAULT_STORAGE=custom mocha --config ./config/.mocharc.cjs ./test_tmp/performance.test.js --unhandled-rejections=strict --expose-gc --experimental-sqlite",
485
485
  "test:performance": "npm run build && npm run test:performance:dexie && npm run test:performance:memory:browser && npm run test:performance:memory:node",
@@ -488,7 +488,9 @@
488
488
  "test:memory-leak:memory:node": "npm run transpile && cross-env DEFAULT_STORAGE=memory mocha --config ./config/.mocharc.cjs ./test_tmp/memory-leak.test.js --inspect --unhandled-rejections=strict --expose-gc --max-old-space-size=256",
489
489
  "couch:start": "docker run -p 5984:5984 -e COUCHDB_USER=root -e COUCHDB_PASSWORD=root --rm --name rxdb-couchdb couchdb:3.3.3",
490
490
  "couch:stop": "docker rm -f rxdb-couchdb",
491
- "mongodb:start": "docker run -p 27017:27017 -p 27018:27018 -p 27019:27019 --rm --name rxdb-mongodb mongo:8.0.4 mongod --replSet rs0 --bind_ip_all",
491
+ "mongodb:start": "docker run --ulimit nofile=65536:65536 -p 27017:27017 -p 27018:27018 -p 27019:27019 --rm --name rxdb-mongodb mongo:8.0.4 mongod --replSet rs0 --bind_ip_all",
492
+ "foundationdb:start": "sh ./scripts/start-foundationdb-docker.sh",
493
+ "foundationdb:stop": "docker rm -f rxdb-foundationdb",
492
494
  "mongodb:stop": "docker rm -f rxdb-mongodb",
493
495
  "supabase:start": "npm run supabase:stop && supabase start --workdir ./config/ -x storage-api,imgproxy,vector,edge-runtime,logflare,pgadmin-schema-diff,inbucket",
494
496
  "supabase:stop": "rm -rf ./config/supabase/.[!.]* && supabase stop --workdir ./config/ --no-backup",
@@ -502,12 +504,12 @@
502
504
  "lint:debug:files": "DEBUG=eslint:cli-engine eslint .",
503
505
  "lint:debug:time": "TIMING=1 eslint .",
504
506
  "check-types": "tsc",
505
- "transpile": "npm run build:version && node scripts/transpile.mjs && cp ./scripts/module_package.json test_tmp/package.json",
507
+ "transpile": "npm run build:version && node scripts/transpile.mjs && node ./scripts/copy-path.mjs ./scripts/module_package.json ./test_tmp/package.json",
506
508
  "build:version": "node ./scripts/update-version-variable.mjs",
507
509
  "build:cjs": "npm run build:version && rimraf -rf --max-retries=3 dist/cjs && cross-env NODE_ENV=es5 babel src --out-dir dist/cjs --source-maps --extensions \".ts,.tsx,.js\"",
508
- "build:test": "npm run build:version && rimraf -rf --max-retries=3 test_tmp && cross-env NODE_ENV=es6 babel test --out-dir test_tmp --source-maps --extensions \".ts,.tsx,.js\" && cp ./scripts/module_package.json test_tmp/package.json",
509
- "build:esm": "npm run build:version && rimraf -rf --max-retries=3 dist/esm && cross-env NODE_ENV=es6 babel src --out-dir dist/esm --source-maps --extensions \".ts,.tsx,.js\" && cp ./scripts/module_package_no_side.json dist/esm/package.json",
510
- "build:types": "npm run build:version && rimraf -rf --max-retries=3 ./dist/types && tsc --project ./config/tsconfig.types.json && cp -r ./src/types ./dist/types/types && node ./scripts/fix-types.mjs",
510
+ "build:test": "npm run build:version && rimraf -rf --max-retries=3 test_tmp && cross-env NODE_ENV=es6 babel test --out-dir test_tmp --source-maps --extensions \".ts,.tsx,.js\" && node ./scripts/copy-path.mjs ./scripts/module_package.json ./test_tmp/package.json",
511
+ "build:esm": "npm run build:version && rimraf -rf --max-retries=3 dist/esm && cross-env NODE_ENV=es6 babel src --out-dir dist/esm --source-maps --extensions \".ts,.tsx,.js\" && node ./scripts/copy-path.mjs ./scripts/module_package_no_side.json ./dist/esm/package.json",
512
+ "build:types": "npm run build:version && rimraf -rf --max-retries=3 ./dist/types && tsc --project ./config/tsconfig.types.json && node ./scripts/fix-types.mjs",
511
513
  "build": "npm run clear && npm run build:version && concurrently \"npm run build:cjs\" \"npm run build:esm\" \"npm run build:types\" \"npm run build:plugins\"",
512
514
  "build:plugins": "node ./scripts/generate-plugins-package-json.mjs",
513
515
  "build:webpack": "npm run build && cross-env NODE_ENV=build webpack --config ./config/webpack.config.js",
@@ -516,8 +518,9 @@
516
518
  "docs:install": "(cd docs-src/ && npm install)",
517
519
  "// docs:serve": "start a local server to watch the docs. Served at http://localhost:4000/",
518
520
  "docs:serve": "(cd docs-src/ && npm start)",
519
- "docs:build": "rimraf -rf ./docs && mkdir ./docs && (cd docs-src/ && npm run build) && cp -r ./docs-src/build/* ./docs && cp ./docs-src/CNAME ./docs/CNAME",
521
+ "docs:build": "node ./scripts/docs-fetch-git-history.mjs && rimraf -rf ./docs && mkdir ./docs && (cd docs-src/ && npm run build) && cp -r ./docs-src/build/* ./docs && cp ./docs-src/CNAME ./docs/CNAME",
520
522
  "docs:remove:time": "node ./scripts/docs-remove-time.mjs",
523
+ "docs:notify-indexnow": "node ./scripts/notify-indexnow.mjs",
521
524
  "disc": "npm run transpile && npm run build:esm && cross-env NODE_ENV=disc webpack --config ./config/webpack.config.js",
522
525
  "preversion": "npm run lint && npm run test",
523
526
  "dev": "watch 'npm run test:node:memory' src/ test/",
@@ -564,7 +567,7 @@
564
567
  }
565
568
  },
566
569
  "dependencies": {
567
- "@babel/runtime": "7.28.6",
570
+ "@babel/runtime": "7.29.2",
568
571
  "@types/clone": "2.1.4",
569
572
  "@types/cors": "2.8.19",
570
573
  "@types/express": "5.0.6",
@@ -572,15 +575,15 @@
572
575
  "@types/ws": "8.18.1",
573
576
  "ajv": "8.18.0",
574
577
  "ajv-formats": "3.0.1",
575
- "array-push-at-sort-position": "4.0.1",
578
+ "array-push-at-sort-position": "5.0.0",
576
579
  "as-typed": "1.3.2",
577
580
  "broadcast-channel": "7.3.0",
578
581
  "crypto-js": "4.2.0",
579
582
  "custom-idle-queue": "5.0.2",
580
583
  "dexie": "4.0.10",
581
- "event-reduce-js": "5.2.7",
584
+ "event-reduce-js": "6.0.0",
582
585
  "get-graphql-from-jsonschema": "8.1.0",
583
- "graphql": "16.13.1",
586
+ "graphql": "16.13.2",
584
587
  "graphql-ws": "5.16.2",
585
588
  "is-my-json-valid": "2.20.6",
586
589
  "js-base64": "3.7.8",
@@ -590,11 +593,11 @@
590
593
  "reconnecting-websocket": "4.4.0",
591
594
  "simple-peer": "9.11.1",
592
595
  "util": "0.12.5",
593
- "ws": "8.19.0",
594
- "z-schema": "12.0.2"
596
+ "ws": "8.20.0",
597
+ "z-schema": "12.1.0"
595
598
  },
596
599
  "devDependencies": {
597
- "@angular/core": "21.2.4",
600
+ "@angular/core": "21.2.6",
598
601
  "@babel/cli": "7.28.6",
599
602
  "@babel/core": "7.29.0",
600
603
  "@babel/plugin-external-helpers": "7.27.1",
@@ -611,7 +614,7 @@
611
614
  "@babel/plugin-transform-template-literals": "7.27.1",
612
615
  "@babel/plugin-transform-typescript": "7.28.6",
613
616
  "@babel/polyfill": "7.12.1",
614
- "@babel/preset-env": "7.29.0",
617
+ "@babel/preset-env": "7.29.2",
615
618
  "@babel/preset-typescript": "7.28.5",
616
619
  "@babel/types": "7.29.0",
617
620
  "@eslint/compat": "2.0.3",
@@ -623,7 +626,7 @@
623
626
  "@rollup/plugin-commonjs": "29.0.2",
624
627
  "@rollup/plugin-node-resolve": "16.0.3",
625
628
  "@stylistic/eslint-plugin": "5.10.0",
626
- "@supabase/supabase-js": "2.99.0",
629
+ "@supabase/supabase-js": "2.100.0",
627
630
  "@types/assert": "1.5.11",
628
631
  "@types/core-js": "2.5.8",
629
632
  "@types/cors": "2.8.19",
@@ -635,9 +638,9 @@
635
638
  "@types/request-promise-native": "1.0.21",
636
639
  "@types/sharp": "0.32.0",
637
640
  "@types/source-map-support": "0.5.10",
638
- "@typescript-eslint/eslint-plugin": "8.57.0",
639
- "@typescript-eslint/parser": "8.57.0",
640
- "appwrite": "23.0.0",
641
+ "@typescript-eslint/eslint-plugin": "8.58.0",
642
+ "@typescript-eslint/parser": "8.58.0",
643
+ "appwrite": "24.0.0",
641
644
  "assert": "2.1.0",
642
645
  "async-test-util": "2.5.0",
643
646
  "babel-loader": "10.1.1",
@@ -652,17 +655,17 @@
652
655
  "delete": "1.1.0",
653
656
  "dependency-check": "4.1.0",
654
657
  "disc": "1.3.3",
655
- "eslint": "10.0.3",
658
+ "eslint": "10.1.0",
656
659
  "eslint-plugin-import": "2.32.0",
657
- "eslint-plugin-jsdoc": "62.8.0",
660
+ "eslint-plugin-jsdoc": "62.8.1",
658
661
  "exists-file": "3.0.2",
659
662
  "express": "5.2.1",
660
663
  "fake-indexeddb": "6.2.5",
661
- "firebase": "12.10.0",
664
+ "firebase": "12.11.0",
662
665
  "firebase-tools": "14.27.0",
663
666
  "get-port": "5.1.1",
664
667
  "globals": "17.4.0",
665
- "google-drive-mock": "1.1.4",
668
+ "google-drive-mock": "1.1.5",
666
669
  "graphql-http": "1.22.4",
667
670
  "graphql-subscriptions": "3.0.0",
668
671
  "gzip-size-cli": "5.1.0",
@@ -683,13 +686,13 @@
683
686
  "leveldown": "6.1.1",
684
687
  "madge": "8.0.0",
685
688
  "microsoft-onedrive-mock": "1.0.5",
686
- "mini-css-extract-plugin": "2.10.1",
689
+ "mini-css-extract-plugin": "2.10.2",
687
690
  "mocha": "11.7.5",
688
691
  "mocha.parallel": "0.15.6",
689
- "mongodb": "7.1.0",
692
+ "mongodb": "7.1.1",
690
693
  "nats": "2.29.3",
691
694
  "nconf": "0.13.0",
692
- "node-appwrite": "22.1.3",
695
+ "node-appwrite": "23.0.0",
693
696
  "node-datachannel": "0.32.1",
694
697
  "node-pre-gyp": "0.17.0",
695
698
  "pre-commit": "1.2.2",
@@ -699,30 +702,30 @@
699
702
  "react": "19.2.4",
700
703
  "readline": "1.3.0",
701
704
  "rimraf": "6.1.3",
702
- "rollup": "4.59.0",
705
+ "rollup": "4.60.1",
703
706
  "rxdb-old": "npm:rxdb@16.21.1",
704
707
  "rxjs": "7.8.2",
705
708
  "sharp": "0.34.5",
706
709
  "shelljs": "0.10.0",
707
710
  "source-map-support": "0.5.21",
708
711
  "stream": "0.0.3",
709
- "supabase": "2.78.1",
710
- "terser": "5.46.0",
712
+ "supabase": "2.84.5",
713
+ "terser": "5.46.1",
711
714
  "terser-webpack-plugin": "5.4.0",
712
715
  "ts-loader": "9.5.4",
713
716
  "tsx": "4.21.0",
714
717
  "typescript": "5.9.3",
715
- "vue": "3.5.30",
718
+ "vue": "3.5.31",
716
719
  "walk-sync": "4.0.1",
717
720
  "watch": "1.0.2",
718
721
  "webpack": "5.105.4",
719
- "webpack-bundle-analyzer": "5.2.0",
720
- "webpack-cli": "6.0.1",
722
+ "webpack-bundle-analyzer": "5.3.0",
723
+ "webpack-cli": "7.0.2",
721
724
  "webpack-dev-server": "5.2.3",
722
725
  "wrtc": "0.4.7"
723
726
  },
724
727
  "overrides": {
725
- "eslint": "10.0.3",
728
+ "eslint": "10.1.0",
726
729
  "webpack-dev-server": "5.2.3"
727
730
  },
728
731
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"