@connecttomahdi/rxdb 17.0.0-beta.17

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 (1969) hide show
  1. package/AGENTS.md +54 -0
  2. package/CHANGELOG.md +2469 -0
  3. package/CLAUDE.md +63 -0
  4. package/LICENSE.txt +201 -0
  5. package/README.md +263 -0
  6. package/babel.config.js +58 -0
  7. package/dist/cjs/change-event-buffer.js +146 -0
  8. package/dist/cjs/change-event-buffer.js.map +1 -0
  9. package/dist/cjs/custom-index.js +284 -0
  10. package/dist/cjs/custom-index.js.map +1 -0
  11. package/dist/cjs/doc-cache.js +231 -0
  12. package/dist/cjs/doc-cache.js.map +1 -0
  13. package/dist/cjs/event-reduce.js +102 -0
  14. package/dist/cjs/event-reduce.js.map +1 -0
  15. package/dist/cjs/hooks.js +131 -0
  16. package/dist/cjs/hooks.js.map +1 -0
  17. package/dist/cjs/incremental-write.js +169 -0
  18. package/dist/cjs/incremental-write.js.map +1 -0
  19. package/dist/cjs/index.js +270 -0
  20. package/dist/cjs/index.js.map +1 -0
  21. package/dist/cjs/overwritable.js +39 -0
  22. package/dist/cjs/overwritable.js.map +1 -0
  23. package/dist/cjs/plugin-helpers.js +223 -0
  24. package/dist/cjs/plugin-helpers.js.map +1 -0
  25. package/dist/cjs/plugin.js +94 -0
  26. package/dist/cjs/plugin.js.map +1 -0
  27. package/dist/cjs/plugins/attachments/attachments-utils.js +49 -0
  28. package/dist/cjs/plugins/attachments/attachments-utils.js.map +1 -0
  29. package/dist/cjs/plugins/attachments/index.js +237 -0
  30. package/dist/cjs/plugins/attachments/index.js.map +1 -0
  31. package/dist/cjs/plugins/attachments-compression/index.js +143 -0
  32. package/dist/cjs/plugins/attachments-compression/index.js.map +1 -0
  33. package/dist/cjs/plugins/backup/file-util.js +102 -0
  34. package/dist/cjs/plugins/backup/file-util.js.map +1 -0
  35. package/dist/cjs/plugins/backup/index.js +206 -0
  36. package/dist/cjs/plugins/backup/index.js.map +1 -0
  37. package/dist/cjs/plugins/cleanup/cleanup-helper.js +17 -0
  38. package/dist/cjs/plugins/cleanup/cleanup-helper.js.map +1 -0
  39. package/dist/cjs/plugins/cleanup/cleanup-state.js +83 -0
  40. package/dist/cjs/plugins/cleanup/cleanup-state.js.map +1 -0
  41. package/dist/cjs/plugins/cleanup/cleanup.js +116 -0
  42. package/dist/cjs/plugins/cleanup/cleanup.js.map +1 -0
  43. package/dist/cjs/plugins/cleanup/index.js +64 -0
  44. package/dist/cjs/plugins/cleanup/index.js.map +1 -0
  45. package/dist/cjs/plugins/crdt/index.js +392 -0
  46. package/dist/cjs/plugins/crdt/index.js.map +1 -0
  47. package/dist/cjs/plugins/dev-mode/check-document.js +158 -0
  48. package/dist/cjs/plugins/dev-mode/check-document.js.map +1 -0
  49. package/dist/cjs/plugins/dev-mode/check-migration-strategies.js +43 -0
  50. package/dist/cjs/plugins/dev-mode/check-migration-strategies.js.map +1 -0
  51. package/dist/cjs/plugins/dev-mode/check-orm.js +53 -0
  52. package/dist/cjs/plugins/dev-mode/check-orm.js.map +1 -0
  53. package/dist/cjs/plugins/dev-mode/check-query.js +183 -0
  54. package/dist/cjs/plugins/dev-mode/check-query.js.map +1 -0
  55. package/dist/cjs/plugins/dev-mode/check-schema.js +487 -0
  56. package/dist/cjs/plugins/dev-mode/check-schema.js.map +1 -0
  57. package/dist/cjs/plugins/dev-mode/dev-mode-tracking.js +93 -0
  58. package/dist/cjs/plugins/dev-mode/dev-mode-tracking.js.map +1 -0
  59. package/dist/cjs/plugins/dev-mode/entity-properties.js +56 -0
  60. package/dist/cjs/plugins/dev-mode/entity-properties.js.map +1 -0
  61. package/dist/cjs/plugins/dev-mode/error-messages.js +1295 -0
  62. package/dist/cjs/plugins/dev-mode/error-messages.js.map +1 -0
  63. package/dist/cjs/plugins/dev-mode/index.js +195 -0
  64. package/dist/cjs/plugins/dev-mode/index.js.map +1 -0
  65. package/dist/cjs/plugins/dev-mode/unallowed-properties.js +88 -0
  66. package/dist/cjs/plugins/dev-mode/unallowed-properties.js.map +1 -0
  67. package/dist/cjs/plugins/electron/electron-helper.js +9 -0
  68. package/dist/cjs/plugins/electron/electron-helper.js.map +1 -0
  69. package/dist/cjs/plugins/electron/index.js +39 -0
  70. package/dist/cjs/plugins/electron/index.js.map +1 -0
  71. package/dist/cjs/plugins/electron/rx-storage-ipc-main.js +45 -0
  72. package/dist/cjs/plugins/electron/rx-storage-ipc-main.js.map +1 -0
  73. package/dist/cjs/plugins/electron/rx-storage-ipc-renderer.js +37 -0
  74. package/dist/cjs/plugins/electron/rx-storage-ipc-renderer.js.map +1 -0
  75. package/dist/cjs/plugins/encryption-crypto-js/index.js +165 -0
  76. package/dist/cjs/plugins/encryption-crypto-js/index.js.map +1 -0
  77. package/dist/cjs/plugins/flutter/index.js +62 -0
  78. package/dist/cjs/plugins/flutter/index.js.map +1 -0
  79. package/dist/cjs/plugins/json-dump/index.js +94 -0
  80. package/dist/cjs/plugins/json-dump/index.js.map +1 -0
  81. package/dist/cjs/plugins/key-compression/index.js +136 -0
  82. package/dist/cjs/plugins/key-compression/index.js.map +1 -0
  83. package/dist/cjs/plugins/leader-election/index.js +107 -0
  84. package/dist/cjs/plugins/leader-election/index.js.map +1 -0
  85. package/dist/cjs/plugins/local-documents/index.js +109 -0
  86. package/dist/cjs/plugins/local-documents/index.js.map +1 -0
  87. package/dist/cjs/plugins/local-documents/local-documents-helper.js +78 -0
  88. package/dist/cjs/plugins/local-documents/local-documents-helper.js.map +1 -0
  89. package/dist/cjs/plugins/local-documents/local-documents.js +107 -0
  90. package/dist/cjs/plugins/local-documents/local-documents.js.map +1 -0
  91. package/dist/cjs/plugins/local-documents/rx-local-document.js +257 -0
  92. package/dist/cjs/plugins/local-documents/rx-local-document.js.map +1 -0
  93. package/dist/cjs/plugins/migration-schema/index.js +84 -0
  94. package/dist/cjs/plugins/migration-schema/index.js.map +1 -0
  95. package/dist/cjs/plugins/migration-schema/migration-helpers.js +116 -0
  96. package/dist/cjs/plugins/migration-schema/migration-helpers.js.map +1 -0
  97. package/dist/cjs/plugins/migration-schema/migration-types.js +2 -0
  98. package/dist/cjs/plugins/migration-schema/migration-types.js.map +1 -0
  99. package/dist/cjs/plugins/migration-schema/rx-migration-state.js +410 -0
  100. package/dist/cjs/plugins/migration-schema/rx-migration-state.js.map +1 -0
  101. package/dist/cjs/plugins/migration-storage/index.js +173 -0
  102. package/dist/cjs/plugins/migration-storage/index.js.map +1 -0
  103. package/dist/cjs/plugins/pipeline/flagged-functions.js +129 -0
  104. package/dist/cjs/plugins/pipeline/flagged-functions.js.map +1 -0
  105. package/dist/cjs/plugins/pipeline/index.js +43 -0
  106. package/dist/cjs/plugins/pipeline/index.js.map +1 -0
  107. package/dist/cjs/plugins/pipeline/rx-pipeline.js +219 -0
  108. package/dist/cjs/plugins/pipeline/rx-pipeline.js.map +1 -0
  109. package/dist/cjs/plugins/pipeline/types.js +2 -0
  110. package/dist/cjs/plugins/pipeline/types.js.map +1 -0
  111. package/dist/cjs/plugins/query-builder/index.js +70 -0
  112. package/dist/cjs/plugins/query-builder/index.js.map +1 -0
  113. package/dist/cjs/plugins/query-builder/mquery/mquery-utils.js +40 -0
  114. package/dist/cjs/plugins/query-builder/mquery/mquery-utils.js.map +1 -0
  115. package/dist/cjs/plugins/query-builder/mquery/nosql-query-builder.js +488 -0
  116. package/dist/cjs/plugins/query-builder/mquery/nosql-query-builder.js.map +1 -0
  117. package/dist/cjs/plugins/react/database-context.js +15 -0
  118. package/dist/cjs/plugins/react/database-context.js.map +1 -0
  119. package/dist/cjs/plugins/react/database-provider.js +41 -0
  120. package/dist/cjs/plugins/react/database-provider.js.map +1 -0
  121. package/dist/cjs/plugins/react/hooks/index.js +50 -0
  122. package/dist/cjs/plugins/react/hooks/index.js.map +1 -0
  123. package/dist/cjs/plugins/react/hooks/use-live-rx-query.js +27 -0
  124. package/dist/cjs/plugins/react/hooks/use-live-rx-query.js.map +1 -0
  125. package/dist/cjs/plugins/react/hooks/use-rx-collection.js +39 -0
  126. package/dist/cjs/plugins/react/hooks/use-rx-collection.js.map +1 -0
  127. package/dist/cjs/plugins/react/hooks/use-rx-database.js +24 -0
  128. package/dist/cjs/plugins/react/hooks/use-rx-database.js.map +1 -0
  129. package/dist/cjs/plugins/react/hooks/use-rx-query.js +99 -0
  130. package/dist/cjs/plugins/react/hooks/use-rx-query.js.map +1 -0
  131. package/dist/cjs/plugins/react/index.js +28 -0
  132. package/dist/cjs/plugins/react/index.js.map +1 -0
  133. package/dist/cjs/plugins/reactivity-angular/index.js +30 -0
  134. package/dist/cjs/plugins/reactivity-angular/index.js.map +1 -0
  135. package/dist/cjs/plugins/reactivity-preact-signals/index.js +67 -0
  136. package/dist/cjs/plugins/reactivity-preact-signals/index.js.map +1 -0
  137. package/dist/cjs/plugins/reactivity-vue/index.js +32 -0
  138. package/dist/cjs/plugins/reactivity-vue/index.js.map +1 -0
  139. package/dist/cjs/plugins/replication/index.js +487 -0
  140. package/dist/cjs/plugins/replication/index.js.map +1 -0
  141. package/dist/cjs/plugins/replication/replication-helper.js +97 -0
  142. package/dist/cjs/plugins/replication/replication-helper.js.map +1 -0
  143. package/dist/cjs/plugins/replication-appwrite/appwrite-helpers.js +33 -0
  144. package/dist/cjs/plugins/replication-appwrite/appwrite-helpers.js.map +1 -0
  145. package/dist/cjs/plugins/replication-appwrite/appwrite-types.js +2 -0
  146. package/dist/cjs/plugins/replication-appwrite/appwrite-types.js.map +1 -0
  147. package/dist/cjs/plugins/replication-appwrite/index.js +176 -0
  148. package/dist/cjs/plugins/replication-appwrite/index.js.map +1 -0
  149. package/dist/cjs/plugins/replication-couchdb/couchdb-helper.js +77 -0
  150. package/dist/cjs/plugins/replication-couchdb/couchdb-helper.js.map +1 -0
  151. package/dist/cjs/plugins/replication-couchdb/couchdb-types.js +2 -0
  152. package/dist/cjs/plugins/replication-couchdb/couchdb-types.js.map +1 -0
  153. package/dist/cjs/plugins/replication-couchdb/index.js +287 -0
  154. package/dist/cjs/plugins/replication-couchdb/index.js.map +1 -0
  155. package/dist/cjs/plugins/replication-firestore/firestore-helper.js +61 -0
  156. package/dist/cjs/plugins/replication-firestore/firestore-helper.js.map +1 -0
  157. package/dist/cjs/plugins/replication-firestore/firestore-types.js +2 -0
  158. package/dist/cjs/plugins/replication-firestore/firestore-types.js.map +1 -0
  159. package/dist/cjs/plugins/replication-firestore/index.js +266 -0
  160. package/dist/cjs/plugins/replication-firestore/index.js.map +1 -0
  161. package/dist/cjs/plugins/replication-google-drive/document-handling.js +150 -0
  162. package/dist/cjs/plugins/replication-google-drive/document-handling.js.map +1 -0
  163. package/dist/cjs/plugins/replication-google-drive/downstream.js +73 -0
  164. package/dist/cjs/plugins/replication-google-drive/downstream.js.map +1 -0
  165. package/dist/cjs/plugins/replication-google-drive/google-drive-helper.js +349 -0
  166. package/dist/cjs/plugins/replication-google-drive/google-drive-helper.js.map +1 -0
  167. package/dist/cjs/plugins/replication-google-drive/google-drive-types.js +2 -0
  168. package/dist/cjs/plugins/replication-google-drive/google-drive-types.js.map +1 -0
  169. package/dist/cjs/plugins/replication-google-drive/index.js +233 -0
  170. package/dist/cjs/plugins/replication-google-drive/index.js.map +1 -0
  171. package/dist/cjs/plugins/replication-google-drive/init.js +76 -0
  172. package/dist/cjs/plugins/replication-google-drive/init.js.map +1 -0
  173. package/dist/cjs/plugins/replication-google-drive/multipart.js +74 -0
  174. package/dist/cjs/plugins/replication-google-drive/multipart.js.map +1 -0
  175. package/dist/cjs/plugins/replication-google-drive/signaling.js +262 -0
  176. package/dist/cjs/plugins/replication-google-drive/signaling.js.map +1 -0
  177. package/dist/cjs/plugins/replication-google-drive/transaction.js +134 -0
  178. package/dist/cjs/plugins/replication-google-drive/transaction.js.map +1 -0
  179. package/dist/cjs/plugins/replication-google-drive/upstream.js +182 -0
  180. package/dist/cjs/plugins/replication-google-drive/upstream.js.map +1 -0
  181. package/dist/cjs/plugins/replication-graphql/graphql-schema-from-rx-schema.js +235 -0
  182. package/dist/cjs/plugins/replication-graphql/graphql-schema-from-rx-schema.js.map +1 -0
  183. package/dist/cjs/plugins/replication-graphql/graphql-websocket.js +43 -0
  184. package/dist/cjs/plugins/replication-graphql/graphql-websocket.js.map +1 -0
  185. package/dist/cjs/plugins/replication-graphql/helper.js +29 -0
  186. package/dist/cjs/plugins/replication-graphql/helper.js.map +1 -0
  187. package/dist/cjs/plugins/replication-graphql/index.js +215 -0
  188. package/dist/cjs/plugins/replication-graphql/index.js.map +1 -0
  189. package/dist/cjs/plugins/replication-graphql/query-builder-from-rx-schema.js +141 -0
  190. package/dist/cjs/plugins/replication-graphql/query-builder-from-rx-schema.js.map +1 -0
  191. package/dist/cjs/plugins/replication-microsoft-onedrive/document-handling.js +187 -0
  192. package/dist/cjs/plugins/replication-microsoft-onedrive/document-handling.js.map +1 -0
  193. package/dist/cjs/plugins/replication-microsoft-onedrive/downstream.js +78 -0
  194. package/dist/cjs/plugins/replication-microsoft-onedrive/downstream.js.map +1 -0
  195. package/dist/cjs/plugins/replication-microsoft-onedrive/index.js +222 -0
  196. package/dist/cjs/plugins/replication-microsoft-onedrive/index.js.map +1 -0
  197. package/dist/cjs/plugins/replication-microsoft-onedrive/init.js +76 -0
  198. package/dist/cjs/plugins/replication-microsoft-onedrive/init.js.map +1 -0
  199. package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js +273 -0
  200. package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js.map +1 -0
  201. package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js +2 -0
  202. package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js.map +1 -0
  203. package/dist/cjs/plugins/replication-microsoft-onedrive/signaling.js +235 -0
  204. package/dist/cjs/plugins/replication-microsoft-onedrive/signaling.js.map +1 -0
  205. package/dist/cjs/plugins/replication-microsoft-onedrive/transaction.js +138 -0
  206. package/dist/cjs/plugins/replication-microsoft-onedrive/transaction.js.map +1 -0
  207. package/dist/cjs/plugins/replication-microsoft-onedrive/upstream.js +190 -0
  208. package/dist/cjs/plugins/replication-microsoft-onedrive/upstream.js.map +1 -0
  209. package/dist/cjs/plugins/replication-mongodb/index.js +229 -0
  210. package/dist/cjs/plugins/replication-mongodb/index.js.map +1 -0
  211. package/dist/cjs/plugins/replication-mongodb/mongodb-checkpoint.js +140 -0
  212. package/dist/cjs/plugins/replication-mongodb/mongodb-checkpoint.js.map +1 -0
  213. package/dist/cjs/plugins/replication-mongodb/mongodb-helper.js +53 -0
  214. package/dist/cjs/plugins/replication-mongodb/mongodb-helper.js.map +1 -0
  215. package/dist/cjs/plugins/replication-mongodb/mongodb-types.js +2 -0
  216. package/dist/cjs/plugins/replication-mongodb/mongodb-types.js.map +1 -0
  217. package/dist/cjs/plugins/replication-nats/index.js +232 -0
  218. package/dist/cjs/plugins/replication-nats/index.js.map +1 -0
  219. package/dist/cjs/plugins/replication-nats/nats-helper.js +13 -0
  220. package/dist/cjs/plugins/replication-nats/nats-helper.js.map +1 -0
  221. package/dist/cjs/plugins/replication-nats/nats-types.js +2 -0
  222. package/dist/cjs/plugins/replication-nats/nats-types.js.map +1 -0
  223. package/dist/cjs/plugins/replication-supabase/helper.js +42 -0
  224. package/dist/cjs/plugins/replication-supabase/helper.js.map +1 -0
  225. package/dist/cjs/plugins/replication-supabase/index.js +239 -0
  226. package/dist/cjs/plugins/replication-supabase/index.js.map +1 -0
  227. package/dist/cjs/plugins/replication-supabase/types.js +2 -0
  228. package/dist/cjs/plugins/replication-supabase/types.js.map +1 -0
  229. package/dist/cjs/plugins/replication-webrtc/connection-handler-p2pcf.js +79 -0
  230. package/dist/cjs/plugins/replication-webrtc/connection-handler-p2pcf.js.map +1 -0
  231. package/dist/cjs/plugins/replication-webrtc/connection-handler-simple-peer.js +199 -0
  232. package/dist/cjs/plugins/replication-webrtc/connection-handler-simple-peer.js.map +1 -0
  233. package/dist/cjs/plugins/replication-webrtc/connection-handler-webtorrent.js +137 -0
  234. package/dist/cjs/plugins/replication-webrtc/connection-handler-webtorrent.js.map +1 -0
  235. package/dist/cjs/plugins/replication-webrtc/index.js +260 -0
  236. package/dist/cjs/plugins/replication-webrtc/index.js.map +1 -0
  237. package/dist/cjs/plugins/replication-webrtc/signaling-server.js +151 -0
  238. package/dist/cjs/plugins/replication-webrtc/signaling-server.js.map +1 -0
  239. package/dist/cjs/plugins/replication-webrtc/webrtc-helper.js +32 -0
  240. package/dist/cjs/plugins/replication-webrtc/webrtc-helper.js.map +1 -0
  241. package/dist/cjs/plugins/replication-webrtc/webrtc-types.js +2 -0
  242. package/dist/cjs/plugins/replication-webrtc/webrtc-types.js.map +1 -0
  243. package/dist/cjs/plugins/replication-websocket/index.js +39 -0
  244. package/dist/cjs/plugins/replication-websocket/index.js.map +1 -0
  245. package/dist/cjs/plugins/replication-websocket/websocket-client.js +133 -0
  246. package/dist/cjs/plugins/replication-websocket/websocket-client.js.map +1 -0
  247. package/dist/cjs/plugins/replication-websocket/websocket-server.js +108 -0
  248. package/dist/cjs/plugins/replication-websocket/websocket-server.js.map +1 -0
  249. package/dist/cjs/plugins/replication-websocket/websocket-types.js +2 -0
  250. package/dist/cjs/plugins/replication-websocket/websocket-types.js.map +1 -0
  251. package/dist/cjs/plugins/state/helpers.js +81 -0
  252. package/dist/cjs/plugins/state/helpers.js.map +1 -0
  253. package/dist/cjs/plugins/state/index.js +42 -0
  254. package/dist/cjs/plugins/state/index.js.map +1 -0
  255. package/dist/cjs/plugins/state/rx-state.js +293 -0
  256. package/dist/cjs/plugins/state/rx-state.js.map +1 -0
  257. package/dist/cjs/plugins/state/types.js +2 -0
  258. package/dist/cjs/plugins/state/types.js.map +1 -0
  259. package/dist/cjs/plugins/storage-denokv/denokv-helper.js +49 -0
  260. package/dist/cjs/plugins/storage-denokv/denokv-helper.js.map +1 -0
  261. package/dist/cjs/plugins/storage-denokv/denokv-query.js +99 -0
  262. package/dist/cjs/plugins/storage-denokv/denokv-query.js.map +1 -0
  263. package/dist/cjs/plugins/storage-denokv/denokv-types.js +2 -0
  264. package/dist/cjs/plugins/storage-denokv/denokv-types.js.map +1 -0
  265. package/dist/cjs/plugins/storage-denokv/index.js +31 -0
  266. package/dist/cjs/plugins/storage-denokv/index.js.map +1 -0
  267. package/dist/cjs/plugins/storage-denokv/rx-storage-instance-denokv.js +332 -0
  268. package/dist/cjs/plugins/storage-denokv/rx-storage-instance-denokv.js.map +1 -0
  269. package/dist/cjs/plugins/storage-dexie/dexie-helper.js +259 -0
  270. package/dist/cjs/plugins/storage-dexie/dexie-helper.js.map +1 -0
  271. package/dist/cjs/plugins/storage-dexie/dexie-query.js +178 -0
  272. package/dist/cjs/plugins/storage-dexie/dexie-query.js.map +1 -0
  273. package/dist/cjs/plugins/storage-dexie/index.js +50 -0
  274. package/dist/cjs/plugins/storage-dexie/index.js.map +1 -0
  275. package/dist/cjs/plugins/storage-dexie/rx-storage-dexie.js +46 -0
  276. package/dist/cjs/plugins/storage-dexie/rx-storage-dexie.js.map +1 -0
  277. package/dist/cjs/plugins/storage-dexie/rx-storage-instance-dexie.js +229 -0
  278. package/dist/cjs/plugins/storage-dexie/rx-storage-instance-dexie.js.map +1 -0
  279. package/dist/cjs/plugins/storage-foundationdb/foundationdb-helpers.js +13 -0
  280. package/dist/cjs/plugins/storage-foundationdb/foundationdb-helpers.js.map +1 -0
  281. package/dist/cjs/plugins/storage-foundationdb/foundationdb-query.js +96 -0
  282. package/dist/cjs/plugins/storage-foundationdb/foundationdb-query.js.map +1 -0
  283. package/dist/cjs/plugins/storage-foundationdb/foundationdb-types.js +2 -0
  284. package/dist/cjs/plugins/storage-foundationdb/foundationdb-types.js.map +1 -0
  285. package/dist/cjs/plugins/storage-foundationdb/index.js +62 -0
  286. package/dist/cjs/plugins/storage-foundationdb/index.js.map +1 -0
  287. package/dist/cjs/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js +309 -0
  288. package/dist/cjs/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js.map +1 -0
  289. package/dist/cjs/plugins/storage-localstorage/index.js +45 -0
  290. package/dist/cjs/plugins/storage-localstorage/index.js.map +1 -0
  291. package/dist/cjs/plugins/storage-localstorage/localstorage-mock.js +38 -0
  292. package/dist/cjs/plugins/storage-localstorage/localstorage-mock.js.map +1 -0
  293. package/dist/cjs/plugins/storage-localstorage/rx-storage-instance-localstorage.js +443 -0
  294. package/dist/cjs/plugins/storage-localstorage/rx-storage-instance-localstorage.js.map +1 -0
  295. package/dist/cjs/plugins/storage-memory/binary-search-bounds.js +113 -0
  296. package/dist/cjs/plugins/storage-memory/binary-search-bounds.js.map +1 -0
  297. package/dist/cjs/plugins/storage-memory/index.js +91 -0
  298. package/dist/cjs/plugins/storage-memory/index.js.map +1 -0
  299. package/dist/cjs/plugins/storage-memory/memory-helper.js +177 -0
  300. package/dist/cjs/plugins/storage-memory/memory-helper.js.map +1 -0
  301. package/dist/cjs/plugins/storage-memory/memory-indexes.js +28 -0
  302. package/dist/cjs/plugins/storage-memory/memory-indexes.js.map +1 -0
  303. package/dist/cjs/plugins/storage-memory/memory-types.js +2 -0
  304. package/dist/cjs/plugins/storage-memory/memory-types.js.map +1 -0
  305. package/dist/cjs/plugins/storage-memory/rx-storage-instance-memory.js +371 -0
  306. package/dist/cjs/plugins/storage-memory/rx-storage-instance-memory.js.map +1 -0
  307. package/dist/cjs/plugins/storage-mongodb/index.js +50 -0
  308. package/dist/cjs/plugins/storage-mongodb/index.js.map +1 -0
  309. package/dist/cjs/plugins/storage-mongodb/mongodb-helper.js +97 -0
  310. package/dist/cjs/plugins/storage-mongodb/mongodb-helper.js.map +1 -0
  311. package/dist/cjs/plugins/storage-mongodb/mongodb-types.js +2 -0
  312. package/dist/cjs/plugins/storage-mongodb/mongodb-types.js.map +1 -0
  313. package/dist/cjs/plugins/storage-mongodb/rx-storage-instance-mongodb.js +324 -0
  314. package/dist/cjs/plugins/storage-mongodb/rx-storage-instance-mongodb.js.map +1 -0
  315. package/dist/cjs/plugins/storage-mongodb/rx-storage-mongodb.js +29 -0
  316. package/dist/cjs/plugins/storage-mongodb/rx-storage-mongodb.js.map +1 -0
  317. package/dist/cjs/plugins/storage-remote/index.js +61 -0
  318. package/dist/cjs/plugins/storage-remote/index.js.map +1 -0
  319. package/dist/cjs/plugins/storage-remote/message-channel-cache.js +52 -0
  320. package/dist/cjs/plugins/storage-remote/message-channel-cache.js.map +1 -0
  321. package/dist/cjs/plugins/storage-remote/remote.js +217 -0
  322. package/dist/cjs/plugins/storage-remote/remote.js.map +1 -0
  323. package/dist/cjs/plugins/storage-remote/rx-storage-remote.js +199 -0
  324. package/dist/cjs/plugins/storage-remote/rx-storage-remote.js.map +1 -0
  325. package/dist/cjs/plugins/storage-remote/storage-remote-helpers.js +25 -0
  326. package/dist/cjs/plugins/storage-remote/storage-remote-helpers.js.map +1 -0
  327. package/dist/cjs/plugins/storage-remote/storage-remote-types.js +2 -0
  328. package/dist/cjs/plugins/storage-remote/storage-remote-types.js.map +1 -0
  329. package/dist/cjs/plugins/storage-remote-websocket/index.js +183 -0
  330. package/dist/cjs/plugins/storage-remote-websocket/index.js.map +1 -0
  331. package/dist/cjs/plugins/storage-remote-websocket/types.js +2 -0
  332. package/dist/cjs/plugins/storage-remote-websocket/types.js.map +1 -0
  333. package/dist/cjs/plugins/storage-sqlite/index.js +84 -0
  334. package/dist/cjs/plugins/storage-sqlite/index.js.map +1 -0
  335. package/dist/cjs/plugins/storage-sqlite/sqlite-basics-helpers.js +530 -0
  336. package/dist/cjs/plugins/storage-sqlite/sqlite-basics-helpers.js.map +1 -0
  337. package/dist/cjs/plugins/storage-sqlite/sqlite-helpers.js +203 -0
  338. package/dist/cjs/plugins/storage-sqlite/sqlite-helpers.js.map +1 -0
  339. package/dist/cjs/plugins/storage-sqlite/sqlite-storage-instance.js +291 -0
  340. package/dist/cjs/plugins/storage-sqlite/sqlite-storage-instance.js.map +1 -0
  341. package/dist/cjs/plugins/storage-sqlite/sqlite-types.js +2 -0
  342. package/dist/cjs/plugins/storage-sqlite/sqlite-types.js.map +1 -0
  343. package/dist/cjs/plugins/test-utils/config.js +120 -0
  344. package/dist/cjs/plugins/test-utils/config.js.map +1 -0
  345. package/dist/cjs/plugins/test-utils/humans-collection.js +420 -0
  346. package/dist/cjs/plugins/test-utils/humans-collection.js.map +1 -0
  347. package/dist/cjs/plugins/test-utils/index.js +130 -0
  348. package/dist/cjs/plugins/test-utils/index.js.map +1 -0
  349. package/dist/cjs/plugins/test-utils/performance.js +275 -0
  350. package/dist/cjs/plugins/test-utils/performance.js.map +1 -0
  351. package/dist/cjs/plugins/test-utils/replication-base-test-suite.js +179 -0
  352. package/dist/cjs/plugins/test-utils/replication-base-test-suite.js.map +1 -0
  353. package/dist/cjs/plugins/test-utils/replication.js +54 -0
  354. package/dist/cjs/plugins/test-utils/replication.js.map +1 -0
  355. package/dist/cjs/plugins/test-utils/revisions.js +11 -0
  356. package/dist/cjs/plugins/test-utils/revisions.js.map +1 -0
  357. package/dist/cjs/plugins/test-utils/schema-objects.js +315 -0
  358. package/dist/cjs/plugins/test-utils/schema-objects.js.map +1 -0
  359. package/dist/cjs/plugins/test-utils/schemas.js +1254 -0
  360. package/dist/cjs/plugins/test-utils/schemas.js.map +1 -0
  361. package/dist/cjs/plugins/test-utils/test-util.js +72 -0
  362. package/dist/cjs/plugins/test-utils/test-util.js.map +1 -0
  363. package/dist/cjs/plugins/update/index.js +45 -0
  364. package/dist/cjs/plugins/update/index.js.map +1 -0
  365. package/dist/cjs/plugins/update/mingo-updater.js +20 -0
  366. package/dist/cjs/plugins/update/mingo-updater.js.map +1 -0
  367. package/dist/cjs/plugins/utils/index.js +226 -0
  368. package/dist/cjs/plugins/utils/index.js.map +1 -0
  369. package/dist/cjs/plugins/utils/utils-array.js +150 -0
  370. package/dist/cjs/plugins/utils/utils-array.js.map +1 -0
  371. package/dist/cjs/plugins/utils/utils-base64.js +57 -0
  372. package/dist/cjs/plugins/utils/utils-base64.js.map +1 -0
  373. package/dist/cjs/plugins/utils/utils-blob.js +62 -0
  374. package/dist/cjs/plugins/utils/utils-blob.js.map +1 -0
  375. package/dist/cjs/plugins/utils/utils-document.js +100 -0
  376. package/dist/cjs/plugins/utils/utils-document.js.map +1 -0
  377. package/dist/cjs/plugins/utils/utils-error.js +42 -0
  378. package/dist/cjs/plugins/utils/utils-error.js.map +1 -0
  379. package/dist/cjs/plugins/utils/utils-global.js +12 -0
  380. package/dist/cjs/plugins/utils/utils-global.js.map +1 -0
  381. package/dist/cjs/plugins/utils/utils-hash.js +59 -0
  382. package/dist/cjs/plugins/utils/utils-hash.js.map +1 -0
  383. package/dist/cjs/plugins/utils/utils-map.js +25 -0
  384. package/dist/cjs/plugins/utils/utils-map.js.map +1 -0
  385. package/dist/cjs/plugins/utils/utils-number.js +16 -0
  386. package/dist/cjs/plugins/utils/utils-number.js.map +1 -0
  387. package/dist/cjs/plugins/utils/utils-object-deep-equal.js +42 -0
  388. package/dist/cjs/plugins/utils/utils-object-deep-equal.js.map +1 -0
  389. package/dist/cjs/plugins/utils/utils-object-dot-prop.js +306 -0
  390. package/dist/cjs/plugins/utils/utils-object-dot-prop.js.map +1 -0
  391. package/dist/cjs/plugins/utils/utils-object.js +245 -0
  392. package/dist/cjs/plugins/utils/utils-object.js.map +1 -0
  393. package/dist/cjs/plugins/utils/utils-other.js +69 -0
  394. package/dist/cjs/plugins/utils/utils-other.js.map +1 -0
  395. package/dist/cjs/plugins/utils/utils-premium.js +37 -0
  396. package/dist/cjs/plugins/utils/utils-premium.js.map +1 -0
  397. package/dist/cjs/plugins/utils/utils-promise.js +149 -0
  398. package/dist/cjs/plugins/utils/utils-promise.js.map +1 -0
  399. package/dist/cjs/plugins/utils/utils-regex.js +9 -0
  400. package/dist/cjs/plugins/utils/utils-regex.js.map +1 -0
  401. package/dist/cjs/plugins/utils/utils-revision.js +60 -0
  402. package/dist/cjs/plugins/utils/utils-revision.js.map +1 -0
  403. package/dist/cjs/plugins/utils/utils-rxdb-version.js +11 -0
  404. package/dist/cjs/plugins/utils/utils-rxdb-version.js.map +1 -0
  405. package/dist/cjs/plugins/utils/utils-rxdb-version.template.js +11 -0
  406. package/dist/cjs/plugins/utils/utils-rxdb-version.template.js.map +1 -0
  407. package/dist/cjs/plugins/utils/utils-string.js +97 -0
  408. package/dist/cjs/plugins/utils/utils-string.js.map +1 -0
  409. package/dist/cjs/plugins/utils/utils-time.js +42 -0
  410. package/dist/cjs/plugins/utils/utils-time.js.map +1 -0
  411. package/dist/cjs/plugins/validate-ajv/index.js +53 -0
  412. package/dist/cjs/plugins/validate-ajv/index.js.map +1 -0
  413. package/dist/cjs/plugins/validate-is-my-json-valid/index.js +29 -0
  414. package/dist/cjs/plugins/validate-is-my-json-valid/index.js.map +1 -0
  415. package/dist/cjs/plugins/validate-z-schema/index.js +58 -0
  416. package/dist/cjs/plugins/validate-z-schema/index.js.map +1 -0
  417. package/dist/cjs/plugins/vector/helper.js +2 -0
  418. package/dist/cjs/plugins/vector/helper.js.map +1 -0
  419. package/dist/cjs/plugins/vector/index.js +17 -0
  420. package/dist/cjs/plugins/vector/index.js.map +1 -0
  421. package/dist/cjs/plugins/vector/types.js +2 -0
  422. package/dist/cjs/plugins/vector/types.js.map +1 -0
  423. package/dist/cjs/plugins/vector/vector-distance.js +38 -0
  424. package/dist/cjs/plugins/vector/vector-distance.js.map +1 -0
  425. package/dist/cjs/plugins/webmcp/index.js +28 -0
  426. package/dist/cjs/plugins/webmcp/index.js.map +1 -0
  427. package/dist/cjs/plugins/webmcp/nosql-query-schema.js +360 -0
  428. package/dist/cjs/plugins/webmcp/nosql-query-schema.js.map +1 -0
  429. package/dist/cjs/plugins/webmcp/webmcp.js +315 -0
  430. package/dist/cjs/plugins/webmcp/webmcp.js.map +1 -0
  431. package/dist/cjs/query-cache.js +110 -0
  432. package/dist/cjs/query-cache.js.map +1 -0
  433. package/dist/cjs/query-planner.js +307 -0
  434. package/dist/cjs/query-planner.js.map +1 -0
  435. package/dist/cjs/replication-protocol/checkpoint.js +103 -0
  436. package/dist/cjs/replication-protocol/checkpoint.js.map +1 -0
  437. package/dist/cjs/replication-protocol/conflicts.js +36 -0
  438. package/dist/cjs/replication-protocol/conflicts.js.map +1 -0
  439. package/dist/cjs/replication-protocol/default-conflict-handler.js +39 -0
  440. package/dist/cjs/replication-protocol/default-conflict-handler.js.map +1 -0
  441. package/dist/cjs/replication-protocol/downstream.js +339 -0
  442. package/dist/cjs/replication-protocol/downstream.js.map +1 -0
  443. package/dist/cjs/replication-protocol/helper.js +58 -0
  444. package/dist/cjs/replication-protocol/helper.js.map +1 -0
  445. package/dist/cjs/replication-protocol/index.js +314 -0
  446. package/dist/cjs/replication-protocol/index.js.map +1 -0
  447. package/dist/cjs/replication-protocol/meta-instance.js +130 -0
  448. package/dist/cjs/replication-protocol/meta-instance.js.map +1 -0
  449. package/dist/cjs/replication-protocol/upstream.js +384 -0
  450. package/dist/cjs/replication-protocol/upstream.js.map +1 -0
  451. package/dist/cjs/rx-change-event.js +112 -0
  452. package/dist/cjs/rx-change-event.js.map +1 -0
  453. package/dist/cjs/rx-collection-helper.js +205 -0
  454. package/dist/cjs/rx-collection-helper.js.map +1 -0
  455. package/dist/cjs/rx-collection.js +931 -0
  456. package/dist/cjs/rx-collection.js.map +1 -0
  457. package/dist/cjs/rx-database-internal-store.js +283 -0
  458. package/dist/cjs/rx-database-internal-store.js.map +1 -0
  459. package/dist/cjs/rx-database.js +682 -0
  460. package/dist/cjs/rx-database.js.map +1 -0
  461. package/dist/cjs/rx-document-prototype-merge.js +87 -0
  462. package/dist/cjs/rx-document-prototype-merge.js.map +1 -0
  463. package/dist/cjs/rx-document.js +404 -0
  464. package/dist/cjs/rx-document.js.map +1 -0
  465. package/dist/cjs/rx-error.js +167 -0
  466. package/dist/cjs/rx-error.js.map +1 -0
  467. package/dist/cjs/rx-query-helper.js +277 -0
  468. package/dist/cjs/rx-query-helper.js.map +1 -0
  469. package/dist/cjs/rx-query-mingo.js +60 -0
  470. package/dist/cjs/rx-query-mingo.js.map +1 -0
  471. package/dist/cjs/rx-query-single-result.js +105 -0
  472. package/dist/cjs/rx-query-single-result.js.map +1 -0
  473. package/dist/cjs/rx-query.js +703 -0
  474. package/dist/cjs/rx-query.js.map +1 -0
  475. package/dist/cjs/rx-schema-helper.js +333 -0
  476. package/dist/cjs/rx-schema-helper.js.map +1 -0
  477. package/dist/cjs/rx-schema.js +189 -0
  478. package/dist/cjs/rx-schema.js.map +1 -0
  479. package/dist/cjs/rx-storage-helper.js +808 -0
  480. package/dist/cjs/rx-storage-helper.js.map +1 -0
  481. package/dist/cjs/rx-storage-multiinstance.js +121 -0
  482. package/dist/cjs/rx-storage-multiinstance.js.map +1 -0
  483. package/dist/cjs/types/conflict-handling.d.js +2 -0
  484. package/dist/cjs/types/conflict-handling.d.js.map +1 -0
  485. package/dist/cjs/types/couchdb.d.js +2 -0
  486. package/dist/cjs/types/couchdb.d.js.map +1 -0
  487. package/dist/cjs/types/index.d.js +2 -0
  488. package/dist/cjs/types/index.d.js.map +1 -0
  489. package/dist/cjs/types/modules/index.d.js +2 -0
  490. package/dist/cjs/types/modules/index.d.js.map +1 -0
  491. package/dist/cjs/types/modules/mocha.parallel.d.js +2 -0
  492. package/dist/cjs/types/modules/mocha.parallel.d.js.map +1 -0
  493. package/dist/cjs/types/plugins/backup.d.js +2 -0
  494. package/dist/cjs/types/plugins/backup.d.js.map +1 -0
  495. package/dist/cjs/types/plugins/cleanup.d.js +2 -0
  496. package/dist/cjs/types/plugins/cleanup.d.js.map +1 -0
  497. package/dist/cjs/types/plugins/crdt.d.js +2 -0
  498. package/dist/cjs/types/plugins/crdt.d.js.map +1 -0
  499. package/dist/cjs/types/plugins/dexie.d.js +2 -0
  500. package/dist/cjs/types/plugins/dexie.d.js.map +1 -0
  501. package/dist/cjs/types/plugins/local-documents.d.js +2 -0
  502. package/dist/cjs/types/plugins/local-documents.d.js.map +1 -0
  503. package/dist/cjs/types/plugins/migration.d.js +2 -0
  504. package/dist/cjs/types/plugins/migration.d.js.map +1 -0
  505. package/dist/cjs/types/plugins/reactivity.d.js +2 -0
  506. package/dist/cjs/types/plugins/reactivity.d.js.map +1 -0
  507. package/dist/cjs/types/plugins/replication-graphql.d.js +2 -0
  508. package/dist/cjs/types/plugins/replication-graphql.d.js.map +1 -0
  509. package/dist/cjs/types/plugins/replication.d.js +2 -0
  510. package/dist/cjs/types/plugins/replication.d.js.map +1 -0
  511. package/dist/cjs/types/plugins/state.d.js +2 -0
  512. package/dist/cjs/types/plugins/state.d.js.map +1 -0
  513. package/dist/cjs/types/plugins/update.d.js +2 -0
  514. package/dist/cjs/types/plugins/update.d.js.map +1 -0
  515. package/dist/cjs/types/plugins/webmcp.d.js +2 -0
  516. package/dist/cjs/types/plugins/webmcp.d.js.map +1 -0
  517. package/dist/cjs/types/query-planner.d.js +2 -0
  518. package/dist/cjs/types/query-planner.d.js.map +1 -0
  519. package/dist/cjs/types/replication-protocol.d.js +2 -0
  520. package/dist/cjs/types/replication-protocol.d.js.map +1 -0
  521. package/dist/cjs/types/rx-attachment.d.js +2 -0
  522. package/dist/cjs/types/rx-attachment.d.js.map +1 -0
  523. package/dist/cjs/types/rx-change-event.d.js +2 -0
  524. package/dist/cjs/types/rx-change-event.d.js.map +1 -0
  525. package/dist/cjs/types/rx-collection.d.js +2 -0
  526. package/dist/cjs/types/rx-collection.d.js.map +1 -0
  527. package/dist/cjs/types/rx-database-internal-store.d.js +2 -0
  528. package/dist/cjs/types/rx-database-internal-store.d.js.map +1 -0
  529. package/dist/cjs/types/rx-database.d.js +2 -0
  530. package/dist/cjs/types/rx-database.d.js.map +1 -0
  531. package/dist/cjs/types/rx-document.d.js +2 -0
  532. package/dist/cjs/types/rx-document.d.js.map +1 -0
  533. package/dist/cjs/types/rx-error.d.js +2 -0
  534. package/dist/cjs/types/rx-error.d.js.map +1 -0
  535. package/dist/cjs/types/rx-plugin.d.js +2 -0
  536. package/dist/cjs/types/rx-plugin.d.js.map +1 -0
  537. package/dist/cjs/types/rx-query.d.js +2 -0
  538. package/dist/cjs/types/rx-query.d.js.map +1 -0
  539. package/dist/cjs/types/rx-schema.d.js +2 -0
  540. package/dist/cjs/types/rx-schema.d.js.map +1 -0
  541. package/dist/cjs/types/rx-storage.d.js +2 -0
  542. package/dist/cjs/types/rx-storage.d.js.map +1 -0
  543. package/dist/cjs/types/rx-storage.interface.d.js +2 -0
  544. package/dist/cjs/types/rx-storage.interface.d.js.map +1 -0
  545. package/dist/cjs/types/util.d.js +2 -0
  546. package/dist/cjs/types/util.d.js.map +1 -0
  547. package/dist/esm/change-event-buffer.js +141 -0
  548. package/dist/esm/change-event-buffer.js.map +1 -0
  549. package/dist/esm/custom-index.js +271 -0
  550. package/dist/esm/custom-index.js.map +1 -0
  551. package/dist/esm/doc-cache.js +227 -0
  552. package/dist/esm/doc-cache.js.map +1 -0
  553. package/dist/esm/event-reduce.js +93 -0
  554. package/dist/esm/event-reduce.js.map +1 -0
  555. package/dist/esm/hooks.js +122 -0
  556. package/dist/esm/hooks.js.map +1 -0
  557. package/dist/esm/incremental-write.js +161 -0
  558. package/dist/esm/incremental-write.js.map +1 -0
  559. package/dist/esm/index.js +30 -0
  560. package/dist/esm/index.js.map +1 -0
  561. package/dist/esm/overwritable.js +33 -0
  562. package/dist/esm/overwritable.js.map +1 -0
  563. package/dist/esm/package.json +1 -0
  564. package/dist/esm/plugin-helpers.js +217 -0
  565. package/dist/esm/plugin-helpers.js.map +1 -0
  566. package/dist/esm/plugin.js +88 -0
  567. package/dist/esm/plugin.js.map +1 -0
  568. package/dist/esm/plugins/attachments/attachments-utils.js +41 -0
  569. package/dist/esm/plugins/attachments/attachments-utils.js.map +1 -0
  570. package/dist/esm/plugins/attachments/index.js +202 -0
  571. package/dist/esm/plugins/attachments/index.js.map +1 -0
  572. package/dist/esm/plugins/attachments-compression/index.js +134 -0
  573. package/dist/esm/plugins/attachments-compression/index.js.map +1 -0
  574. package/dist/esm/plugins/backup/file-util.js +87 -0
  575. package/dist/esm/plugins/backup/file-util.js.map +1 -0
  576. package/dist/esm/plugins/backup/index.js +183 -0
  577. package/dist/esm/plugins/backup/index.js.map +1 -0
  578. package/dist/esm/plugins/cleanup/cleanup-helper.js +11 -0
  579. package/dist/esm/plugins/cleanup/cleanup-helper.js.map +1 -0
  580. package/dist/esm/plugins/cleanup/cleanup-state.js +75 -0
  581. package/dist/esm/plugins/cleanup/cleanup-state.js.map +1 -0
  582. package/dist/esm/plugins/cleanup/cleanup.js +108 -0
  583. package/dist/esm/plugins/cleanup/cleanup.js.map +1 -0
  584. package/dist/esm/plugins/cleanup/index.js +35 -0
  585. package/dist/esm/plugins/cleanup/index.js.map +1 -0
  586. package/dist/esm/plugins/crdt/index.js +378 -0
  587. package/dist/esm/plugins/crdt/index.js.map +1 -0
  588. package/dist/esm/plugins/dev-mode/check-document.js +150 -0
  589. package/dist/esm/plugins/dev-mode/check-document.js.map +1 -0
  590. package/dist/esm/plugins/dev-mode/check-migration-strategies.js +38 -0
  591. package/dist/esm/plugins/dev-mode/check-migration-strategies.js.map +1 -0
  592. package/dist/esm/plugins/dev-mode/check-orm.js +47 -0
  593. package/dist/esm/plugins/dev-mode/check-orm.js.map +1 -0
  594. package/dist/esm/plugins/dev-mode/check-query.js +174 -0
  595. package/dist/esm/plugins/dev-mode/check-query.js.map +1 -0
  596. package/dist/esm/plugins/dev-mode/check-schema.js +478 -0
  597. package/dist/esm/plugins/dev-mode/check-schema.js.map +1 -0
  598. package/dist/esm/plugins/dev-mode/dev-mode-tracking.js +87 -0
  599. package/dist/esm/plugins/dev-mode/dev-mode-tracking.js.map +1 -0
  600. package/dist/esm/plugins/dev-mode/entity-properties.js +49 -0
  601. package/dist/esm/plugins/dev-mode/entity-properties.js.map +1 -0
  602. package/dist/esm/plugins/dev-mode/error-messages.js +1289 -0
  603. package/dist/esm/plugins/dev-mode/error-messages.js.map +1 -0
  604. package/dist/esm/plugins/dev-mode/index.js +151 -0
  605. package/dist/esm/plugins/dev-mode/index.js.map +1 -0
  606. package/dist/esm/plugins/dev-mode/unallowed-properties.js +81 -0
  607. package/dist/esm/plugins/dev-mode/unallowed-properties.js.map +1 -0
  608. package/dist/esm/plugins/electron/electron-helper.js +3 -0
  609. package/dist/esm/plugins/electron/electron-helper.js.map +1 -0
  610. package/dist/esm/plugins/electron/index.js +4 -0
  611. package/dist/esm/plugins/electron/index.js.map +1 -0
  612. package/dist/esm/plugins/electron/rx-storage-ipc-main.js +39 -0
  613. package/dist/esm/plugins/electron/rx-storage-ipc-main.js.map +1 -0
  614. package/dist/esm/plugins/electron/rx-storage-ipc-renderer.js +31 -0
  615. package/dist/esm/plugins/electron/rx-storage-ipc-renderer.js.map +1 -0
  616. package/dist/esm/plugins/encryption-crypto-js/index.js +154 -0
  617. package/dist/esm/plugins/encryption-crypto-js/index.js.map +1 -0
  618. package/dist/esm/plugins/flutter/index.js +55 -0
  619. package/dist/esm/plugins/flutter/index.js.map +1 -0
  620. package/dist/esm/plugins/json-dump/index.js +87 -0
  621. package/dist/esm/plugins/json-dump/index.js.map +1 -0
  622. package/dist/esm/plugins/key-compression/index.js +127 -0
  623. package/dist/esm/plugins/key-compression/index.js.map +1 -0
  624. package/dist/esm/plugins/leader-election/index.js +95 -0
  625. package/dist/esm/plugins/leader-election/index.js.map +1 -0
  626. package/dist/esm/plugins/local-documents/index.js +70 -0
  627. package/dist/esm/plugins/local-documents/index.js.map +1 -0
  628. package/dist/esm/plugins/local-documents/local-documents-helper.js +67 -0
  629. package/dist/esm/plugins/local-documents/local-documents-helper.js.map +1 -0
  630. package/dist/esm/plugins/local-documents/local-documents.js +99 -0
  631. package/dist/esm/plugins/local-documents/local-documents.js.map +1 -0
  632. package/dist/esm/plugins/local-documents/rx-local-document.js +248 -0
  633. package/dist/esm/plugins/local-documents/rx-local-document.js.map +1 -0
  634. package/dist/esm/plugins/migration-schema/index.js +42 -0
  635. package/dist/esm/plugins/migration-schema/index.js.map +1 -0
  636. package/dist/esm/plugins/migration-schema/migration-helpers.js +103 -0
  637. package/dist/esm/plugins/migration-schema/migration-helpers.js.map +1 -0
  638. package/dist/esm/plugins/migration-schema/migration-types.js +3 -0
  639. package/dist/esm/plugins/migration-schema/migration-types.js.map +1 -0
  640. package/dist/esm/plugins/migration-schema/rx-migration-state.js +404 -0
  641. package/dist/esm/plugins/migration-schema/rx-migration-state.js.map +1 -0
  642. package/dist/esm/plugins/migration-storage/index.js +166 -0
  643. package/dist/esm/plugins/migration-storage/index.js.map +1 -0
  644. package/dist/esm/plugins/pipeline/flagged-functions.js +122 -0
  645. package/dist/esm/plugins/pipeline/flagged-functions.js.map +1 -0
  646. package/dist/esm/plugins/pipeline/index.js +13 -0
  647. package/dist/esm/plugins/pipeline/index.js.map +1 -0
  648. package/dist/esm/plugins/pipeline/rx-pipeline.js +210 -0
  649. package/dist/esm/plugins/pipeline/rx-pipeline.js.map +1 -0
  650. package/dist/esm/plugins/pipeline/types.js +3 -0
  651. package/dist/esm/plugins/pipeline/types.js.map +1 -0
  652. package/dist/esm/plugins/query-builder/index.js +48 -0
  653. package/dist/esm/plugins/query-builder/index.js.map +1 -0
  654. package/dist/esm/plugins/query-builder/mquery/mquery-utils.js +33 -0
  655. package/dist/esm/plugins/query-builder/mquery/mquery-utils.js.map +1 -0
  656. package/dist/esm/plugins/query-builder/mquery/nosql-query-builder.js +478 -0
  657. package/dist/esm/plugins/query-builder/mquery/nosql-query-builder.js.map +1 -0
  658. package/dist/esm/plugins/react/database-context.js +8 -0
  659. package/dist/esm/plugins/react/database-context.js.map +1 -0
  660. package/dist/esm/plugins/react/database-provider.js +34 -0
  661. package/dist/esm/plugins/react/database-provider.js.map +1 -0
  662. package/dist/esm/plugins/react/hooks/index.js +5 -0
  663. package/dist/esm/plugins/react/hooks/index.js.map +1 -0
  664. package/dist/esm/plugins/react/hooks/use-live-rx-query.js +22 -0
  665. package/dist/esm/plugins/react/hooks/use-live-rx-query.js.map +1 -0
  666. package/dist/esm/plugins/react/hooks/use-rx-collection.js +34 -0
  667. package/dist/esm/plugins/react/hooks/use-rx-collection.js.map +1 -0
  668. package/dist/esm/plugins/react/hooks/use-rx-database.js +19 -0
  669. package/dist/esm/plugins/react/hooks/use-rx-database.js.map +1 -0
  670. package/dist/esm/plugins/react/hooks/use-rx-query.js +92 -0
  671. package/dist/esm/plugins/react/hooks/use-rx-query.js.map +1 -0
  672. package/dist/esm/plugins/react/index.js +3 -0
  673. package/dist/esm/plugins/react/index.js.map +1 -0
  674. package/dist/esm/plugins/reactivity-angular/index.js +25 -0
  675. package/dist/esm/plugins/reactivity-angular/index.js.map +1 -0
  676. package/dist/esm/plugins/reactivity-preact-signals/index.js +62 -0
  677. package/dist/esm/plugins/reactivity-preact-signals/index.js.map +1 -0
  678. package/dist/esm/plugins/reactivity-vue/index.js +27 -0
  679. package/dist/esm/plugins/reactivity-vue/index.js.map +1 -0
  680. package/dist/esm/plugins/replication/index.js +479 -0
  681. package/dist/esm/plugins/replication/index.js.map +1 -0
  682. package/dist/esm/plugins/replication/replication-helper.js +86 -0
  683. package/dist/esm/plugins/replication/replication-helper.js.map +1 -0
  684. package/dist/esm/plugins/replication-appwrite/appwrite-helpers.js +26 -0
  685. package/dist/esm/plugins/replication-appwrite/appwrite-helpers.js.map +1 -0
  686. package/dist/esm/plugins/replication-appwrite/appwrite-types.js +3 -0
  687. package/dist/esm/plugins/replication-appwrite/appwrite-types.js.map +1 -0
  688. package/dist/esm/plugins/replication-appwrite/index.js +168 -0
  689. package/dist/esm/plugins/replication-appwrite/index.js.map +1 -0
  690. package/dist/esm/plugins/replication-couchdb/couchdb-helper.js +65 -0
  691. package/dist/esm/plugins/replication-couchdb/couchdb-helper.js.map +1 -0
  692. package/dist/esm/plugins/replication-couchdb/couchdb-types.js +3 -0
  693. package/dist/esm/plugins/replication-couchdb/couchdb-types.js.map +1 -0
  694. package/dist/esm/plugins/replication-couchdb/index.js +254 -0
  695. package/dist/esm/plugins/replication-couchdb/index.js.map +1 -0
  696. package/dist/esm/plugins/replication-firestore/firestore-helper.js +49 -0
  697. package/dist/esm/plugins/replication-firestore/firestore-helper.js.map +1 -0
  698. package/dist/esm/plugins/replication-firestore/firestore-types.js +3 -0
  699. package/dist/esm/plugins/replication-firestore/firestore-types.js.map +1 -0
  700. package/dist/esm/plugins/replication-firestore/index.js +233 -0
  701. package/dist/esm/plugins/replication-firestore/index.js.map +1 -0
  702. package/dist/esm/plugins/replication-google-drive/document-handling.js +140 -0
  703. package/dist/esm/plugins/replication-google-drive/document-handling.js.map +1 -0
  704. package/dist/esm/plugins/replication-google-drive/downstream.js +66 -0
  705. package/dist/esm/plugins/replication-google-drive/downstream.js.map +1 -0
  706. package/dist/esm/plugins/replication-google-drive/google-drive-helper.js +331 -0
  707. package/dist/esm/plugins/replication-google-drive/google-drive-helper.js.map +1 -0
  708. package/dist/esm/plugins/replication-google-drive/google-drive-types.js +3 -0
  709. package/dist/esm/plugins/replication-google-drive/google-drive-types.js.map +1 -0
  710. package/dist/esm/plugins/replication-google-drive/index.js +126 -0
  711. package/dist/esm/plugins/replication-google-drive/index.js.map +1 -0
  712. package/dist/esm/plugins/replication-google-drive/init.js +70 -0
  713. package/dist/esm/plugins/replication-google-drive/init.js.map +1 -0
  714. package/dist/esm/plugins/replication-google-drive/multipart.js +67 -0
  715. package/dist/esm/plugins/replication-google-drive/multipart.js.map +1 -0
  716. package/dist/esm/plugins/replication-google-drive/signaling.js +253 -0
  717. package/dist/esm/plugins/replication-google-drive/signaling.js.map +1 -0
  718. package/dist/esm/plugins/replication-google-drive/transaction.js +123 -0
  719. package/dist/esm/plugins/replication-google-drive/transaction.js.map +1 -0
  720. package/dist/esm/plugins/replication-google-drive/upstream.js +171 -0
  721. package/dist/esm/plugins/replication-google-drive/upstream.js.map +1 -0
  722. package/dist/esm/plugins/replication-graphql/graphql-schema-from-rx-schema.js +228 -0
  723. package/dist/esm/plugins/replication-graphql/graphql-schema-from-rx-schema.js.map +1 -0
  724. package/dist/esm/plugins/replication-graphql/graphql-websocket.js +35 -0
  725. package/dist/esm/plugins/replication-graphql/graphql-websocket.js.map +1 -0
  726. package/dist/esm/plugins/replication-graphql/helper.js +21 -0
  727. package/dist/esm/plugins/replication-graphql/helper.js.map +1 -0
  728. package/dist/esm/plugins/replication-graphql/index.js +161 -0
  729. package/dist/esm/plugins/replication-graphql/index.js.map +1 -0
  730. package/dist/esm/plugins/replication-graphql/query-builder-from-rx-schema.js +133 -0
  731. package/dist/esm/plugins/replication-graphql/query-builder-from-rx-schema.js.map +1 -0
  732. package/dist/esm/plugins/replication-microsoft-onedrive/document-handling.js +178 -0
  733. package/dist/esm/plugins/replication-microsoft-onedrive/document-handling.js.map +1 -0
  734. package/dist/esm/plugins/replication-microsoft-onedrive/downstream.js +71 -0
  735. package/dist/esm/plugins/replication-microsoft-onedrive/downstream.js.map +1 -0
  736. package/dist/esm/plugins/replication-microsoft-onedrive/index.js +126 -0
  737. package/dist/esm/plugins/replication-microsoft-onedrive/index.js.map +1 -0
  738. package/dist/esm/plugins/replication-microsoft-onedrive/init.js +70 -0
  739. package/dist/esm/plugins/replication-microsoft-onedrive/init.js.map +1 -0
  740. package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js +258 -0
  741. package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js.map +1 -0
  742. package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js +3 -0
  743. package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js.map +1 -0
  744. package/dist/esm/plugins/replication-microsoft-onedrive/signaling.js +226 -0
  745. package/dist/esm/plugins/replication-microsoft-onedrive/signaling.js.map +1 -0
  746. package/dist/esm/plugins/replication-microsoft-onedrive/transaction.js +127 -0
  747. package/dist/esm/plugins/replication-microsoft-onedrive/transaction.js.map +1 -0
  748. package/dist/esm/plugins/replication-microsoft-onedrive/upstream.js +179 -0
  749. package/dist/esm/plugins/replication-microsoft-onedrive/upstream.js.map +1 -0
  750. package/dist/esm/plugins/replication-mongodb/index.js +197 -0
  751. package/dist/esm/plugins/replication-mongodb/index.js.map +1 -0
  752. package/dist/esm/plugins/replication-mongodb/mongodb-checkpoint.js +131 -0
  753. package/dist/esm/plugins/replication-mongodb/mongodb-checkpoint.js.map +1 -0
  754. package/dist/esm/plugins/replication-mongodb/mongodb-helper.js +45 -0
  755. package/dist/esm/plugins/replication-mongodb/mongodb-helper.js.map +1 -0
  756. package/dist/esm/plugins/replication-mongodb/mongodb-types.js +3 -0
  757. package/dist/esm/plugins/replication-mongodb/mongodb-types.js.map +1 -0
  758. package/dist/esm/plugins/replication-nats/index.js +199 -0
  759. package/dist/esm/plugins/replication-nats/index.js.map +1 -0
  760. package/dist/esm/plugins/replication-nats/nats-helper.js +7 -0
  761. package/dist/esm/plugins/replication-nats/nats-helper.js.map +1 -0
  762. package/dist/esm/plugins/replication-nats/nats-types.js +3 -0
  763. package/dist/esm/plugins/replication-nats/nats-types.js.map +1 -0
  764. package/dist/esm/plugins/replication-supabase/helper.js +35 -0
  765. package/dist/esm/plugins/replication-supabase/helper.js.map +1 -0
  766. package/dist/esm/plugins/replication-supabase/index.js +231 -0
  767. package/dist/esm/plugins/replication-supabase/index.js.map +1 -0
  768. package/dist/esm/plugins/replication-supabase/types.js +3 -0
  769. package/dist/esm/plugins/replication-supabase/types.js.map +1 -0
  770. package/dist/esm/plugins/replication-webrtc/connection-handler-p2pcf.js +78 -0
  771. package/dist/esm/plugins/replication-webrtc/connection-handler-p2pcf.js.map +1 -0
  772. package/dist/esm/plugins/replication-webrtc/connection-handler-simple-peer.js +192 -0
  773. package/dist/esm/plugins/replication-webrtc/connection-handler-simple-peer.js.map +1 -0
  774. package/dist/esm/plugins/replication-webrtc/connection-handler-webtorrent.js +136 -0
  775. package/dist/esm/plugins/replication-webrtc/connection-handler-webtorrent.js.map +1 -0
  776. package/dist/esm/plugins/replication-webrtc/index.js +207 -0
  777. package/dist/esm/plugins/replication-webrtc/index.js.map +1 -0
  778. package/dist/esm/plugins/replication-webrtc/signaling-server.js +144 -0
  779. package/dist/esm/plugins/replication-webrtc/signaling-server.js.map +1 -0
  780. package/dist/esm/plugins/replication-webrtc/webrtc-helper.js +26 -0
  781. package/dist/esm/plugins/replication-webrtc/webrtc-helper.js.map +1 -0
  782. package/dist/esm/plugins/replication-webrtc/webrtc-types.js +3 -0
  783. package/dist/esm/plugins/replication-webrtc/webrtc-types.js.map +1 -0
  784. package/dist/esm/plugins/replication-websocket/index.js +4 -0
  785. package/dist/esm/plugins/replication-websocket/index.js.map +1 -0
  786. package/dist/esm/plugins/replication-websocket/websocket-client.js +125 -0
  787. package/dist/esm/plugins/replication-websocket/websocket-client.js.map +1 -0
  788. package/dist/esm/plugins/replication-websocket/websocket-server.js +100 -0
  789. package/dist/esm/plugins/replication-websocket/websocket-server.js.map +1 -0
  790. package/dist/esm/plugins/replication-websocket/websocket-types.js +3 -0
  791. package/dist/esm/plugins/replication-websocket/websocket-types.js.map +1 -0
  792. package/dist/esm/plugins/state/helpers.js +73 -0
  793. package/dist/esm/plugins/state/helpers.js.map +1 -0
  794. package/dist/esm/plugins/state/index.js +20 -0
  795. package/dist/esm/plugins/state/index.js.map +1 -0
  796. package/dist/esm/plugins/state/rx-state.js +285 -0
  797. package/dist/esm/plugins/state/rx-state.js.map +1 -0
  798. package/dist/esm/plugins/state/types.js +3 -0
  799. package/dist/esm/plugins/state/types.js.map +1 -0
  800. package/dist/esm/plugins/storage-denokv/denokv-helper.js +40 -0
  801. package/dist/esm/plugins/storage-denokv/denokv-helper.js.map +1 -0
  802. package/dist/esm/plugins/storage-denokv/denokv-query.js +93 -0
  803. package/dist/esm/plugins/storage-denokv/denokv-query.js.map +1 -0
  804. package/dist/esm/plugins/storage-denokv/denokv-types.js +3 -0
  805. package/dist/esm/plugins/storage-denokv/denokv-types.js.map +1 -0
  806. package/dist/esm/plugins/storage-denokv/index.js +24 -0
  807. package/dist/esm/plugins/storage-denokv/index.js.map +1 -0
  808. package/dist/esm/plugins/storage-denokv/rx-storage-instance-denokv.js +325 -0
  809. package/dist/esm/plugins/storage-denokv/rx-storage-instance-denokv.js.map +1 -0
  810. package/dist/esm/plugins/storage-dexie/dexie-helper.js +241 -0
  811. package/dist/esm/plugins/storage-dexie/dexie-helper.js.map +1 -0
  812. package/dist/esm/plugins/storage-dexie/dexie-query.js +169 -0
  813. package/dist/esm/plugins/storage-dexie/dexie-query.js.map +1 -0
  814. package/dist/esm/plugins/storage-dexie/index.js +5 -0
  815. package/dist/esm/plugins/storage-dexie/index.js.map +1 -0
  816. package/dist/esm/plugins/storage-dexie/rx-storage-dexie.js +39 -0
  817. package/dist/esm/plugins/storage-dexie/rx-storage-dexie.js.map +1 -0
  818. package/dist/esm/plugins/storage-dexie/rx-storage-instance-dexie.js +222 -0
  819. package/dist/esm/plugins/storage-dexie/rx-storage-instance-dexie.js.map +1 -0
  820. package/dist/esm/plugins/storage-foundationdb/foundationdb-helpers.js +6 -0
  821. package/dist/esm/plugins/storage-foundationdb/foundationdb-helpers.js.map +1 -0
  822. package/dist/esm/plugins/storage-foundationdb/foundationdb-query.js +90 -0
  823. package/dist/esm/plugins/storage-foundationdb/foundationdb-query.js.map +1 -0
  824. package/dist/esm/plugins/storage-foundationdb/foundationdb-types.js +3 -0
  825. package/dist/esm/plugins/storage-foundationdb/foundationdb-types.js.map +1 -0
  826. package/dist/esm/plugins/storage-foundationdb/index.js +31 -0
  827. package/dist/esm/plugins/storage-foundationdb/index.js.map +1 -0
  828. package/dist/esm/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js +302 -0
  829. package/dist/esm/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js.map +1 -0
  830. package/dist/esm/plugins/storage-localstorage/index.js +23 -0
  831. package/dist/esm/plugins/storage-localstorage/index.js.map +1 -0
  832. package/dist/esm/plugins/storage-localstorage/localstorage-mock.js +33 -0
  833. package/dist/esm/plugins/storage-localstorage/localstorage-mock.js.map +1 -0
  834. package/dist/esm/plugins/storage-localstorage/rx-storage-instance-localstorage.js +432 -0
  835. package/dist/esm/plugins/storage-localstorage/rx-storage-instance-localstorage.js.map +1 -0
  836. package/dist/esm/plugins/storage-memory/binary-search-bounds.js +103 -0
  837. package/dist/esm/plugins/storage-memory/binary-search-bounds.js.map +1 -0
  838. package/dist/esm/plugins/storage-memory/index.js +29 -0
  839. package/dist/esm/plugins/storage-memory/index.js.map +1 -0
  840. package/dist/esm/plugins/storage-memory/memory-helper.js +165 -0
  841. package/dist/esm/plugins/storage-memory/memory-helper.js.map +1 -0
  842. package/dist/esm/plugins/storage-memory/memory-indexes.js +21 -0
  843. package/dist/esm/plugins/storage-memory/memory-indexes.js.map +1 -0
  844. package/dist/esm/plugins/storage-memory/memory-types.js +3 -0
  845. package/dist/esm/plugins/storage-memory/memory-types.js.map +1 -0
  846. package/dist/esm/plugins/storage-memory/rx-storage-instance-memory.js +364 -0
  847. package/dist/esm/plugins/storage-memory/rx-storage-instance-memory.js.map +1 -0
  848. package/dist/esm/plugins/storage-mongodb/index.js +5 -0
  849. package/dist/esm/plugins/storage-mongodb/index.js.map +1 -0
  850. package/dist/esm/plugins/storage-mongodb/mongodb-helper.js +85 -0
  851. package/dist/esm/plugins/storage-mongodb/mongodb-helper.js.map +1 -0
  852. package/dist/esm/plugins/storage-mongodb/mongodb-types.js +3 -0
  853. package/dist/esm/plugins/storage-mongodb/mongodb-types.js.map +1 -0
  854. package/dist/esm/plugins/storage-mongodb/rx-storage-instance-mongodb.js +316 -0
  855. package/dist/esm/plugins/storage-mongodb/rx-storage-instance-mongodb.js.map +1 -0
  856. package/dist/esm/plugins/storage-mongodb/rx-storage-mongodb.js +22 -0
  857. package/dist/esm/plugins/storage-mongodb/rx-storage-mongodb.js.map +1 -0
  858. package/dist/esm/plugins/storage-remote/index.js +6 -0
  859. package/dist/esm/plugins/storage-remote/index.js.map +1 -0
  860. package/dist/esm/plugins/storage-remote/message-channel-cache.js +44 -0
  861. package/dist/esm/plugins/storage-remote/message-channel-cache.js.map +1 -0
  862. package/dist/esm/plugins/storage-remote/remote.js +212 -0
  863. package/dist/esm/plugins/storage-remote/remote.js.map +1 -0
  864. package/dist/esm/plugins/storage-remote/rx-storage-remote.js +193 -0
  865. package/dist/esm/plugins/storage-remote/rx-storage-remote.js.map +1 -0
  866. package/dist/esm/plugins/storage-remote/storage-remote-helpers.js +18 -0
  867. package/dist/esm/plugins/storage-remote/storage-remote-helpers.js.map +1 -0
  868. package/dist/esm/plugins/storage-remote/storage-remote-types.js +3 -0
  869. package/dist/esm/plugins/storage-remote/storage-remote-types.js.map +1 -0
  870. package/dist/esm/plugins/storage-remote-websocket/index.js +161 -0
  871. package/dist/esm/plugins/storage-remote-websocket/index.js.map +1 -0
  872. package/dist/esm/plugins/storage-remote-websocket/types.js +3 -0
  873. package/dist/esm/plugins/storage-remote-websocket/types.js.map +1 -0
  874. package/dist/esm/plugins/storage-sqlite/index.js +31 -0
  875. package/dist/esm/plugins/storage-sqlite/index.js.map +1 -0
  876. package/dist/esm/plugins/storage-sqlite/sqlite-basics-helpers.js +510 -0
  877. package/dist/esm/plugins/storage-sqlite/sqlite-basics-helpers.js.map +1 -0
  878. package/dist/esm/plugins/storage-sqlite/sqlite-helpers.js +187 -0
  879. package/dist/esm/plugins/storage-sqlite/sqlite-helpers.js.map +1 -0
  880. package/dist/esm/plugins/storage-sqlite/sqlite-storage-instance.js +283 -0
  881. package/dist/esm/plugins/storage-sqlite/sqlite-storage-instance.js.map +1 -0
  882. package/dist/esm/plugins/storage-sqlite/sqlite-types.js +3 -0
  883. package/dist/esm/plugins/storage-sqlite/sqlite-types.js.map +1 -0
  884. package/dist/esm/plugins/test-utils/config.js +104 -0
  885. package/dist/esm/plugins/test-utils/config.js.map +1 -0
  886. package/dist/esm/plugins/test-utils/humans-collection.js +397 -0
  887. package/dist/esm/plugins/test-utils/humans-collection.js.map +1 -0
  888. package/dist/esm/plugins/test-utils/index.js +22 -0
  889. package/dist/esm/plugins/test-utils/index.js.map +1 -0
  890. package/dist/esm/plugins/test-utils/performance.js +267 -0
  891. package/dist/esm/plugins/test-utils/performance.js.map +1 -0
  892. package/dist/esm/plugins/test-utils/replication-base-test-suite.js +170 -0
  893. package/dist/esm/plugins/test-utils/replication-base-test-suite.js.map +1 -0
  894. package/dist/esm/plugins/test-utils/replication.js +46 -0
  895. package/dist/esm/plugins/test-utils/replication.js.map +1 -0
  896. package/dist/esm/plugins/test-utils/revisions.js +5 -0
  897. package/dist/esm/plugins/test-utils/revisions.js.map +1 -0
  898. package/dist/esm/plugins/test-utils/schema-objects.js +283 -0
  899. package/dist/esm/plugins/test-utils/schema-objects.js.map +1 -0
  900. package/dist/esm/plugins/test-utils/schemas.js +1244 -0
  901. package/dist/esm/plugins/test-utils/schemas.js.map +1 -0
  902. package/dist/esm/plugins/test-utils/test-util.js +62 -0
  903. package/dist/esm/plugins/test-utils/test-util.js.map +1 -0
  904. package/dist/esm/plugins/update/index.js +35 -0
  905. package/dist/esm/plugins/update/index.js.map +1 -0
  906. package/dist/esm/plugins/update/mingo-updater.js +13 -0
  907. package/dist/esm/plugins/update/mingo-updater.js.map +1 -0
  908. package/dist/esm/plugins/utils/index.js +21 -0
  909. package/dist/esm/plugins/utils/index.js.map +1 -0
  910. package/dist/esm/plugins/utils/utils-array.js +130 -0
  911. package/dist/esm/plugins/utils/utils-array.js.map +1 -0
  912. package/dist/esm/plugins/utils/utils-base64.js +48 -0
  913. package/dist/esm/plugins/utils/utils-base64.js.map +1 -0
  914. package/dist/esm/plugins/utils/utils-blob.js +54 -0
  915. package/dist/esm/plugins/utils/utils-blob.js.map +1 -0
  916. package/dist/esm/plugins/utils/utils-document.js +87 -0
  917. package/dist/esm/plugins/utils/utils-document.js.map +1 -0
  918. package/dist/esm/plugins/utils/utils-error.js +36 -0
  919. package/dist/esm/plugins/utils/utils-error.js.map +1 -0
  920. package/dist/esm/plugins/utils/utils-global.js +6 -0
  921. package/dist/esm/plugins/utils/utils-global.js.map +1 -0
  922. package/dist/esm/plugins/utils/utils-hash.js +51 -0
  923. package/dist/esm/plugins/utils/utils-hash.js.map +1 -0
  924. package/dist/esm/plugins/utils/utils-map.js +18 -0
  925. package/dist/esm/plugins/utils/utils-map.js.map +1 -0
  926. package/dist/esm/plugins/utils/utils-number.js +10 -0
  927. package/dist/esm/plugins/utils/utils-number.js.map +1 -0
  928. package/dist/esm/plugins/utils/utils-object-deep-equal.js +36 -0
  929. package/dist/esm/plugins/utils/utils-object-deep-equal.js.map +1 -0
  930. package/dist/esm/plugins/utils/utils-object-dot-prop.js +296 -0
  931. package/dist/esm/plugins/utils/utils-object-dot-prop.js.map +1 -0
  932. package/dist/esm/plugins/utils/utils-object.js +228 -0
  933. package/dist/esm/plugins/utils/utils-object.js.map +1 -0
  934. package/dist/esm/plugins/utils/utils-other.js +58 -0
  935. package/dist/esm/plugins/utils/utils-other.js.map +1 -0
  936. package/dist/esm/plugins/utils/utils-premium.js +30 -0
  937. package/dist/esm/plugins/utils/utils-premium.js.map +1 -0
  938. package/dist/esm/plugins/utils/utils-promise.js +134 -0
  939. package/dist/esm/plugins/utils/utils-promise.js.map +1 -0
  940. package/dist/esm/plugins/utils/utils-regex.js +3 -0
  941. package/dist/esm/plugins/utils/utils-regex.js.map +1 -0
  942. package/dist/esm/plugins/utils/utils-revision.js +53 -0
  943. package/dist/esm/plugins/utils/utils-revision.js.map +1 -0
  944. package/dist/esm/plugins/utils/utils-rxdb-version.js +5 -0
  945. package/dist/esm/plugins/utils/utils-rxdb-version.js.map +1 -0
  946. package/dist/esm/plugins/utils/utils-rxdb-version.template.js +5 -0
  947. package/dist/esm/plugins/utils/utils-rxdb-version.template.js.map +1 -0
  948. package/dist/esm/plugins/utils/utils-string.js +83 -0
  949. package/dist/esm/plugins/utils/utils-string.js.map +1 -0
  950. package/dist/esm/plugins/utils/utils-time.js +36 -0
  951. package/dist/esm/plugins/utils/utils-time.js.map +1 -0
  952. package/dist/esm/plugins/validate-ajv/index.js +43 -0
  953. package/dist/esm/plugins/validate-ajv/index.js.map +1 -0
  954. package/dist/esm/plugins/validate-is-my-json-valid/index.js +20 -0
  955. package/dist/esm/plugins/validate-is-my-json-valid/index.js.map +1 -0
  956. package/dist/esm/plugins/validate-z-schema/index.js +47 -0
  957. package/dist/esm/plugins/validate-z-schema/index.js.map +1 -0
  958. package/dist/esm/plugins/vector/helper.js +2 -0
  959. package/dist/esm/plugins/vector/helper.js.map +1 -0
  960. package/dist/esm/plugins/vector/index.js +2 -0
  961. package/dist/esm/plugins/vector/index.js.map +1 -0
  962. package/dist/esm/plugins/vector/types.js +3 -0
  963. package/dist/esm/plugins/vector/types.js.map +1 -0
  964. package/dist/esm/plugins/vector/vector-distance.js +29 -0
  965. package/dist/esm/plugins/vector/vector-distance.js.map +1 -0
  966. package/dist/esm/plugins/webmcp/index.js +3 -0
  967. package/dist/esm/plugins/webmcp/index.js.map +1 -0
  968. package/dist/esm/plugins/webmcp/nosql-query-schema.js +354 -0
  969. package/dist/esm/plugins/webmcp/nosql-query-schema.js.map +1 -0
  970. package/dist/esm/plugins/webmcp/webmcp.js +307 -0
  971. package/dist/esm/plugins/webmcp/webmcp.js.map +1 -0
  972. package/dist/esm/query-cache.js +99 -0
  973. package/dist/esm/query-cache.js.map +1 -0
  974. package/dist/esm/query-planner.js +297 -0
  975. package/dist/esm/query-planner.js.map +1 -0
  976. package/dist/esm/replication-protocol/checkpoint.js +95 -0
  977. package/dist/esm/replication-protocol/checkpoint.js.map +1 -0
  978. package/dist/esm/replication-protocol/conflicts.js +31 -0
  979. package/dist/esm/replication-protocol/conflicts.js.map +1 -0
  980. package/dist/esm/replication-protocol/default-conflict-handler.js +33 -0
  981. package/dist/esm/replication-protocol/default-conflict-handler.js.map +1 -0
  982. package/dist/esm/replication-protocol/downstream.js +334 -0
  983. package/dist/esm/replication-protocol/downstream.js.map +1 -0
  984. package/dist/esm/replication-protocol/helper.js +49 -0
  985. package/dist/esm/replication-protocol/helper.js.map +1 -0
  986. package/dist/esm/replication-protocol/index.js +221 -0
  987. package/dist/esm/replication-protocol/index.js.map +1 -0
  988. package/dist/esm/replication-protocol/meta-instance.js +121 -0
  989. package/dist/esm/replication-protocol/meta-instance.js.map +1 -0
  990. package/dist/esm/replication-protocol/upstream.js +379 -0
  991. package/dist/esm/replication-protocol/upstream.js.map +1 -0
  992. package/dist/esm/rx-change-event.js +103 -0
  993. package/dist/esm/rx-change-event.js.map +1 -0
  994. package/dist/esm/rx-collection-helper.js +196 -0
  995. package/dist/esm/rx-collection-helper.js.map +1 -0
  996. package/dist/esm/rx-collection.js +923 -0
  997. package/dist/esm/rx-collection.js.map +1 -0
  998. package/dist/esm/rx-database-internal-store.js +270 -0
  999. package/dist/esm/rx-database-internal-store.js.map +1 -0
  1000. package/dist/esm/rx-database.js +670 -0
  1001. package/dist/esm/rx-database.js.map +1 -0
  1002. package/dist/esm/rx-document-prototype-merge.js +78 -0
  1003. package/dist/esm/rx-document-prototype-merge.js.map +1 -0
  1004. package/dist/esm/rx-document.js +394 -0
  1005. package/dist/esm/rx-document.js.map +1 -0
  1006. package/dist/esm/rx-error.js +153 -0
  1007. package/dist/esm/rx-error.js.map +1 -0
  1008. package/dist/esm/rx-query-helper.js +268 -0
  1009. package/dist/esm/rx-query-helper.js.map +1 -0
  1010. package/dist/esm/rx-query-mingo.js +54 -0
  1011. package/dist/esm/rx-query-mingo.js.map +1 -0
  1012. package/dist/esm/rx-query-single-result.js +98 -0
  1013. package/dist/esm/rx-query-single-result.js.map +1 -0
  1014. package/dist/esm/rx-query.js +690 -0
  1015. package/dist/esm/rx-query.js.map +1 -0
  1016. package/dist/esm/rx-schema-helper.js +316 -0
  1017. package/dist/esm/rx-schema-helper.js.map +1 -0
  1018. package/dist/esm/rx-schema.js +177 -0
  1019. package/dist/esm/rx-schema.js.map +1 -0
  1020. package/dist/esm/rx-storage-helper.js +785 -0
  1021. package/dist/esm/rx-storage-helper.js.map +1 -0
  1022. package/dist/esm/rx-storage-multiinstance.js +113 -0
  1023. package/dist/esm/rx-storage-multiinstance.js.map +1 -0
  1024. package/dist/esm/types/conflict-handling.d.js +3 -0
  1025. package/dist/esm/types/conflict-handling.d.js.map +1 -0
  1026. package/dist/esm/types/couchdb.d.js +3 -0
  1027. package/dist/esm/types/couchdb.d.js.map +1 -0
  1028. package/dist/esm/types/index.d.js +2 -0
  1029. package/dist/esm/types/index.d.js.map +1 -0
  1030. package/dist/esm/types/modules/index.d.js +2 -0
  1031. package/dist/esm/types/modules/index.d.js.map +1 -0
  1032. package/dist/esm/types/modules/mocha.parallel.d.js +2 -0
  1033. package/dist/esm/types/modules/mocha.parallel.d.js.map +1 -0
  1034. package/dist/esm/types/plugins/backup.d.js +3 -0
  1035. package/dist/esm/types/plugins/backup.d.js.map +1 -0
  1036. package/dist/esm/types/plugins/cleanup.d.js +3 -0
  1037. package/dist/esm/types/plugins/cleanup.d.js.map +1 -0
  1038. package/dist/esm/types/plugins/crdt.d.js +3 -0
  1039. package/dist/esm/types/plugins/crdt.d.js.map +1 -0
  1040. package/dist/esm/types/plugins/dexie.d.js +3 -0
  1041. package/dist/esm/types/plugins/dexie.d.js.map +1 -0
  1042. package/dist/esm/types/plugins/local-documents.d.js +3 -0
  1043. package/dist/esm/types/plugins/local-documents.d.js.map +1 -0
  1044. package/dist/esm/types/plugins/migration.d.js +3 -0
  1045. package/dist/esm/types/plugins/migration.d.js.map +1 -0
  1046. package/dist/esm/types/plugins/reactivity.d.js +3 -0
  1047. package/dist/esm/types/plugins/reactivity.d.js.map +1 -0
  1048. package/dist/esm/types/plugins/replication-graphql.d.js +3 -0
  1049. package/dist/esm/types/plugins/replication-graphql.d.js.map +1 -0
  1050. package/dist/esm/types/plugins/replication.d.js +3 -0
  1051. package/dist/esm/types/plugins/replication.d.js.map +1 -0
  1052. package/dist/esm/types/plugins/state.d.js +3 -0
  1053. package/dist/esm/types/plugins/state.d.js.map +1 -0
  1054. package/dist/esm/types/plugins/update.d.js +3 -0
  1055. package/dist/esm/types/plugins/update.d.js.map +1 -0
  1056. package/dist/esm/types/plugins/webmcp.d.js +3 -0
  1057. package/dist/esm/types/plugins/webmcp.d.js.map +1 -0
  1058. package/dist/esm/types/query-planner.d.js +3 -0
  1059. package/dist/esm/types/query-planner.d.js.map +1 -0
  1060. package/dist/esm/types/replication-protocol.d.js +3 -0
  1061. package/dist/esm/types/replication-protocol.d.js.map +1 -0
  1062. package/dist/esm/types/rx-attachment.d.js +3 -0
  1063. package/dist/esm/types/rx-attachment.d.js.map +1 -0
  1064. package/dist/esm/types/rx-change-event.d.js +3 -0
  1065. package/dist/esm/types/rx-change-event.d.js.map +1 -0
  1066. package/dist/esm/types/rx-collection.d.js +3 -0
  1067. package/dist/esm/types/rx-collection.d.js.map +1 -0
  1068. package/dist/esm/types/rx-database-internal-store.d.js +3 -0
  1069. package/dist/esm/types/rx-database-internal-store.d.js.map +1 -0
  1070. package/dist/esm/types/rx-database.d.js +3 -0
  1071. package/dist/esm/types/rx-database.d.js.map +1 -0
  1072. package/dist/esm/types/rx-document.d.js +3 -0
  1073. package/dist/esm/types/rx-document.d.js.map +1 -0
  1074. package/dist/esm/types/rx-error.d.js +3 -0
  1075. package/dist/esm/types/rx-error.d.js.map +1 -0
  1076. package/dist/esm/types/rx-plugin.d.js +3 -0
  1077. package/dist/esm/types/rx-plugin.d.js.map +1 -0
  1078. package/dist/esm/types/rx-query.d.js +3 -0
  1079. package/dist/esm/types/rx-query.d.js.map +1 -0
  1080. package/dist/esm/types/rx-schema.d.js +3 -0
  1081. package/dist/esm/types/rx-schema.d.js.map +1 -0
  1082. package/dist/esm/types/rx-storage.d.js +3 -0
  1083. package/dist/esm/types/rx-storage.d.js.map +1 -0
  1084. package/dist/esm/types/rx-storage.interface.d.js +3 -0
  1085. package/dist/esm/types/rx-storage.interface.d.js.map +1 -0
  1086. package/dist/esm/types/util.d.js +3 -0
  1087. package/dist/esm/types/util.d.js.map +1 -0
  1088. package/dist/types/change-event-buffer.d.ts +50 -0
  1089. package/dist/types/custom-index.d.ts +58 -0
  1090. package/dist/types/doc-cache.d.ts +96 -0
  1091. package/dist/types/event-reduce.d.ts +15 -0
  1092. package/dist/types/hooks.d.ts +109 -0
  1093. package/dist/types/incremental-write.d.ts +29 -0
  1094. package/dist/types/index.d.ts +30 -0
  1095. package/dist/types/overwritable.d.ts +26 -0
  1096. package/dist/types/plugin-helpers.d.ts +30 -0
  1097. package/dist/types/plugin.d.ts +6 -0
  1098. package/dist/types/plugins/attachments/attachments-utils.d.ts +10 -0
  1099. package/dist/types/plugins/attachments/index.d.ts +42 -0
  1100. package/dist/types/plugins/attachments-compression/index.d.ts +38 -0
  1101. package/dist/types/plugins/backup/file-util.d.ts +17 -0
  1102. package/dist/types/plugins/backup/index.d.ts +37 -0
  1103. package/dist/types/plugins/cleanup/cleanup-helper.d.ts +2 -0
  1104. package/dist/types/plugins/cleanup/cleanup-state.d.ts +7 -0
  1105. package/dist/types/plugins/cleanup/cleanup.d.ts +8 -0
  1106. package/dist/types/plugins/cleanup/index.d.ts +4 -0
  1107. package/dist/types/plugins/crdt/index.d.ts +12 -0
  1108. package/dist/types/plugins/dev-mode/check-document.d.ts +9 -0
  1109. package/dist/types/plugins/dev-mode/check-migration-strategies.d.ts +6 -0
  1110. package/dist/types/plugins/dev-mode/check-orm.d.ts +7 -0
  1111. package/dist/types/plugins/dev-mode/check-query.d.ts +21 -0
  1112. package/dist/types/plugins/dev-mode/check-schema.d.ts +18 -0
  1113. package/dist/types/plugins/dev-mode/dev-mode-tracking.d.ts +4 -0
  1114. package/dist/types/plugins/dev-mode/entity-properties.d.ts +3 -0
  1115. package/dist/types/plugins/dev-mode/error-messages.d.ts +1230 -0
  1116. package/dist/types/plugins/dev-mode/index.d.ts +19 -0
  1117. package/dist/types/plugins/dev-mode/unallowed-properties.d.ts +20 -0
  1118. package/dist/types/plugins/electron/electron-helper.d.ts +2 -0
  1119. package/dist/types/plugins/electron/index.d.ts +3 -0
  1120. package/dist/types/plugins/electron/rx-storage-ipc-main.d.ts +10 -0
  1121. package/dist/types/plugins/electron/rx-storage-ipc-renderer.d.ts +13 -0
  1122. package/dist/types/plugins/encryption-crypto-js/index.d.ts +10 -0
  1123. package/dist/types/plugins/flutter/index.d.ts +11 -0
  1124. package/dist/types/plugins/json-dump/index.d.ts +2 -0
  1125. package/dist/types/plugins/key-compression/index.d.ts +18 -0
  1126. package/dist/types/plugins/leader-election/index.d.ts +25 -0
  1127. package/dist/types/plugins/local-documents/index.d.ts +6 -0
  1128. package/dist/types/plugins/local-documents/local-documents-helper.d.ts +9 -0
  1129. package/dist/types/plugins/local-documents/local-documents.d.ts +14 -0
  1130. package/dist/types/plugins/local-documents/rx-local-document.d.ts +11 -0
  1131. package/dist/types/plugins/migration-schema/index.d.ts +8 -0
  1132. package/dist/types/plugins/migration-schema/migration-helpers.d.ts +29 -0
  1133. package/dist/types/plugins/migration-schema/migration-types.d.ts +33 -0
  1134. package/dist/types/plugins/migration-schema/rx-migration-state.d.ts +50 -0
  1135. package/dist/types/plugins/migration-storage/index.d.ts +32 -0
  1136. package/dist/types/plugins/pipeline/flagged-functions.d.ts +69 -0
  1137. package/dist/types/plugins/pipeline/index.d.ts +5 -0
  1138. package/dist/types/plugins/pipeline/rx-pipeline.d.ts +37 -0
  1139. package/dist/types/plugins/pipeline/types.d.ts +17 -0
  1140. package/dist/types/plugins/query-builder/index.d.ts +5 -0
  1141. package/dist/types/plugins/query-builder/mquery/mquery-utils.d.ts +12 -0
  1142. package/dist/types/plugins/query-builder/mquery/nosql-query-builder.d.ts +165 -0
  1143. package/dist/types/plugins/react/database-context.d.ts +4 -0
  1144. package/dist/types/plugins/react/database-provider.d.ts +24 -0
  1145. package/dist/types/plugins/react/hooks/index.d.ts +4 -0
  1146. package/dist/types/plugins/react/hooks/use-live-rx-query.d.ts +11 -0
  1147. package/dist/types/plugins/react/hooks/use-rx-collection.d.ts +10 -0
  1148. package/dist/types/plugins/react/hooks/use-rx-database.d.ts +9 -0
  1149. package/dist/types/plugins/react/hooks/use-rx-query.d.ts +24 -0
  1150. package/dist/types/plugins/react/index.d.ts +2 -0
  1151. package/dist/types/plugins/reactivity-angular/index.d.ts +16 -0
  1152. package/dist/types/plugins/reactivity-preact-signals/index.d.ts +27 -0
  1153. package/dist/types/plugins/reactivity-vue/index.d.ts +17 -0
  1154. package/dist/types/plugins/replication/index.d.ts +84 -0
  1155. package/dist/types/plugins/replication/replication-helper.d.ts +23 -0
  1156. package/dist/types/plugins/replication-appwrite/appwrite-helpers.d.ts +3 -0
  1157. package/dist/types/plugins/replication-appwrite/appwrite-types.d.ts +16 -0
  1158. package/dist/types/plugins/replication-appwrite/index.d.ts +14 -0
  1159. package/dist/types/plugins/replication-couchdb/couchdb-helper.d.ts +19 -0
  1160. package/dist/types/plugins/replication-couchdb/couchdb-types.d.ts +22 -0
  1161. package/dist/types/plugins/replication-couchdb/index.d.ts +18 -0
  1162. package/dist/types/plugins/replication-firestore/firestore-helper.d.ts +10 -0
  1163. package/dist/types/plugins/replication-firestore/firestore-types.d.ts +46 -0
  1164. package/dist/types/plugins/replication-firestore/index.d.ts +17 -0
  1165. package/dist/types/plugins/replication-google-drive/document-handling.d.ts +13 -0
  1166. package/dist/types/plugins/replication-google-drive/downstream.d.ts +10 -0
  1167. package/dist/types/plugins/replication-google-drive/google-drive-helper.d.ts +35 -0
  1168. package/dist/types/plugins/replication-google-drive/google-drive-types.d.ts +67 -0
  1169. package/dist/types/plugins/replication-google-drive/index.d.ts +39 -0
  1170. package/dist/types/plugins/replication-google-drive/init.d.ts +29 -0
  1171. package/dist/types/plugins/replication-google-drive/multipart.d.ts +10 -0
  1172. package/dist/types/plugins/replication-google-drive/signaling.d.ts +41 -0
  1173. package/dist/types/plugins/replication-google-drive/transaction.d.ts +22 -0
  1174. package/dist/types/plugins/replication-google-drive/upstream.d.ts +24 -0
  1175. package/dist/types/plugins/replication-graphql/graphql-schema-from-rx-schema.d.ts +51 -0
  1176. package/dist/types/plugins/replication-graphql/graphql-websocket.d.ts +12 -0
  1177. package/dist/types/plugins/replication-graphql/helper.d.ts +15 -0
  1178. package/dist/types/plugins/replication-graphql/index.d.ts +26 -0
  1179. package/dist/types/plugins/replication-graphql/query-builder-from-rx-schema.d.ts +5 -0
  1180. package/dist/types/plugins/replication-microsoft-onedrive/document-handling.d.ts +14 -0
  1181. package/dist/types/plugins/replication-microsoft-onedrive/downstream.d.ts +10 -0
  1182. package/dist/types/plugins/replication-microsoft-onedrive/index.d.ts +38 -0
  1183. package/dist/types/plugins/replication-microsoft-onedrive/init.d.ts +29 -0
  1184. package/dist/types/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.d.ts +30 -0
  1185. package/dist/types/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.d.ts +71 -0
  1186. package/dist/types/plugins/replication-microsoft-onedrive/signaling.d.ts +41 -0
  1187. package/dist/types/plugins/replication-microsoft-onedrive/transaction.d.ts +22 -0
  1188. package/dist/types/plugins/replication-microsoft-onedrive/upstream.d.ts +25 -0
  1189. package/dist/types/plugins/replication-mongodb/index.d.ts +22 -0
  1190. package/dist/types/plugins/replication-mongodb/mongodb-checkpoint.d.ts +15 -0
  1191. package/dist/types/plugins/replication-mongodb/mongodb-helper.d.ts +13 -0
  1192. package/dist/types/plugins/replication-mongodb/mongodb-types.d.ts +33 -0
  1193. package/dist/types/plugins/replication-nats/index.d.ts +16 -0
  1194. package/dist/types/plugins/replication-nats/nats-helper.d.ts +2 -0
  1195. package/dist/types/plugins/replication-nats/nats-types.d.ts +21 -0
  1196. package/dist/types/plugins/replication-supabase/helper.d.ts +5 -0
  1197. package/dist/types/plugins/replication-supabase/index.d.ts +14 -0
  1198. package/dist/types/plugins/replication-supabase/types.d.ts +28 -0
  1199. package/dist/types/plugins/replication-webrtc/connection-handler-p2pcf.d.ts +0 -0
  1200. package/dist/types/plugins/replication-webrtc/connection-handler-simple-peer.d.ts +57 -0
  1201. package/dist/types/plugins/replication-webrtc/connection-handler-webtorrent.d.ts +0 -0
  1202. package/dist/types/plugins/replication-webrtc/index.d.ts +27 -0
  1203. package/dist/types/plugins/replication-webrtc/signaling-server.d.ts +17 -0
  1204. package/dist/types/plugins/replication-webrtc/webrtc-helper.d.ts +16 -0
  1205. package/dist/types/plugins/replication-webrtc/webrtc-types.d.ts +51 -0
  1206. package/dist/types/plugins/replication-websocket/index.d.ts +3 -0
  1207. package/dist/types/plugins/replication-websocket/websocket-client.d.ts +13 -0
  1208. package/dist/types/plugins/replication-websocket/websocket-server.d.ts +6 -0
  1209. package/dist/types/plugins/replication-websocket/websocket-types.d.ts +32 -0
  1210. package/dist/types/plugins/state/helpers.d.ts +10 -0
  1211. package/dist/types/plugins/state/index.d.ts +4 -0
  1212. package/dist/types/plugins/state/rx-state.d.ts +46 -0
  1213. package/dist/types/plugins/state/types.d.ts +28 -0
  1214. package/dist/types/plugins/storage-denokv/denokv-helper.d.ts +16 -0
  1215. package/dist/types/plugins/storage-denokv/denokv-query.d.ts +3 -0
  1216. package/dist/types/plugins/storage-denokv/denokv-types.d.ts +17 -0
  1217. package/dist/types/plugins/storage-denokv/index.d.ts +11 -0
  1218. package/dist/types/plugins/storage-denokv/rx-storage-instance-denokv.d.ts +41 -0
  1219. package/dist/types/plugins/storage-dexie/dexie-helper.d.ts +40 -0
  1220. package/dist/types/plugins/storage-dexie/dexie-query.d.ts +9 -0
  1221. package/dist/types/plugins/storage-dexie/index.d.ts +4 -0
  1222. package/dist/types/plugins/storage-dexie/rx-storage-dexie.d.ts +11 -0
  1223. package/dist/types/plugins/storage-dexie/rx-storage-instance-dexie.d.ts +29 -0
  1224. package/dist/types/plugins/storage-foundationdb/foundationdb-helpers.d.ts +3 -0
  1225. package/dist/types/plugins/storage-foundationdb/foundationdb-query.d.ts +3 -0
  1226. package/dist/types/plugins/storage-foundationdb/foundationdb-types.d.ts +46 -0
  1227. package/dist/types/plugins/storage-foundationdb/index.d.ts +4 -0
  1228. package/dist/types/plugins/storage-foundationdb/rx-storage-instance-foundationdb.d.ts +26 -0
  1229. package/dist/types/plugins/storage-localstorage/index.d.ts +11 -0
  1230. package/dist/types/plugins/storage-localstorage/localstorage-mock.d.ts +1 -0
  1231. package/dist/types/plugins/storage-localstorage/rx-storage-instance-localstorage.d.ts +84 -0
  1232. package/dist/types/plugins/storage-memory/binary-search-bounds.d.ts +14 -0
  1233. package/dist/types/plugins/storage-memory/index.d.ts +7 -0
  1234. package/dist/types/plugins/storage-memory/memory-helper.d.ts +22 -0
  1235. package/dist/types/plugins/storage-memory/memory-indexes.d.ts +4 -0
  1236. package/dist/types/plugins/storage-memory/memory-types.d.ts +72 -0
  1237. package/dist/types/plugins/storage-memory/rx-storage-instance-memory.d.ts +47 -0
  1238. package/dist/types/plugins/storage-mongodb/index.d.ts +4 -0
  1239. package/dist/types/plugins/storage-mongodb/mongodb-helper.d.ts +22 -0
  1240. package/dist/types/plugins/storage-mongodb/mongodb-types.d.ts +21 -0
  1241. package/dist/types/plugins/storage-mongodb/rx-storage-instance-mongodb.d.ts +52 -0
  1242. package/dist/types/plugins/storage-mongodb/rx-storage-mongodb.d.ts +11 -0
  1243. package/dist/types/plugins/storage-remote/index.d.ts +5 -0
  1244. package/dist/types/plugins/storage-remote/message-channel-cache.d.ts +13 -0
  1245. package/dist/types/plugins/storage-remote/remote.d.ts +6 -0
  1246. package/dist/types/plugins/storage-remote/rx-storage-remote.d.ts +43 -0
  1247. package/dist/types/plugins/storage-remote/storage-remote-helpers.d.ts +4 -0
  1248. package/dist/types/plugins/storage-remote/storage-remote-types.d.ts +88 -0
  1249. package/dist/types/plugins/storage-remote-websocket/index.d.ts +4 -0
  1250. package/dist/types/plugins/storage-remote-websocket/types.d.ts +24 -0
  1251. package/dist/types/plugins/storage-sqlite/index.d.ts +15 -0
  1252. package/dist/types/plugins/storage-sqlite/sqlite-basics-helpers.d.ts +53 -0
  1253. package/dist/types/plugins/storage-sqlite/sqlite-helpers.d.ts +48 -0
  1254. package/dist/types/plugins/storage-sqlite/sqlite-storage-instance.d.ts +38 -0
  1255. package/dist/types/plugins/storage-sqlite/sqlite-types.d.ts +116 -0
  1256. package/dist/types/plugins/test-utils/config.d.ts +16 -0
  1257. package/dist/types/plugins/test-utils/humans-collection.d.ts +26 -0
  1258. package/dist/types/plugins/test-utils/index.d.ts +20 -0
  1259. package/dist/types/plugins/test-utils/performance.d.ts +68 -0
  1260. package/dist/types/plugins/test-utils/replication-base-test-suite.d.ts +66 -0
  1261. package/dist/types/plugins/test-utils/replication.d.ts +10 -0
  1262. package/dist/types/plugins/test-utils/revisions.d.ts +4 -0
  1263. package/dist/types/plugins/test-utils/schema-objects.d.ts +219 -0
  1264. package/dist/types/plugins/test-utils/schemas.d.ts +356 -0
  1265. package/dist/types/plugins/test-utils/test-util.d.ts +10 -0
  1266. package/dist/types/plugins/update/index.d.ts +5 -0
  1267. package/dist/types/plugins/update/mingo-updater.d.ts +2 -0
  1268. package/dist/types/plugins/utils/index.d.ts +20 -0
  1269. package/dist/types/plugins/utils/utils-array.d.ts +40 -0
  1270. package/dist/types/plugins/utils/utils-base64.d.ts +15 -0
  1271. package/dist/types/plugins/utils/utils-blob.d.ts +12 -0
  1272. package/dist/types/plugins/utils/utils-document.d.ts +26 -0
  1273. package/dist/types/plugins/utils/utils-error.d.ts +8 -0
  1274. package/dist/types/plugins/utils/utils-global.d.ts +5 -0
  1275. package/dist/types/plugins/utils/utils-hash.d.ts +4 -0
  1276. package/dist/types/plugins/utils/utils-map.d.ts +2 -0
  1277. package/dist/types/plugins/utils/utils-number.d.ts +7 -0
  1278. package/dist/types/plugins/utils/utils-object-deep-equal.d.ts +7 -0
  1279. package/dist/types/plugins/utils/utils-object-dot-prop.d.ts +14 -0
  1280. package/dist/types/plugins/utils/utils-object.d.ts +61 -0
  1281. package/dist/types/plugins/utils/utils-other.d.ts +20 -0
  1282. package/dist/types/plugins/utils/utils-premium.d.ts +10 -0
  1283. package/dist/types/plugins/utils/utils-promise.d.ts +43 -0
  1284. package/dist/types/plugins/utils/utils-regex.d.ts +2 -0
  1285. package/dist/types/plugins/utils/utils-revision.d.ts +22 -0
  1286. package/dist/types/plugins/utils/utils-rxdb-version.d.ts +4 -0
  1287. package/dist/types/plugins/utils/utils-rxdb-version.template.d.ts +4 -0
  1288. package/dist/types/plugins/utils/utils-string.d.ts +35 -0
  1289. package/dist/types/plugins/utils/utils-time.d.ts +5 -0
  1290. package/dist/types/plugins/validate-ajv/index.d.ts +13 -0
  1291. package/dist/types/plugins/validate-is-my-json-valid/index.d.ts +5 -0
  1292. package/dist/types/plugins/validate-z-schema/index.d.ts +13 -0
  1293. package/dist/types/plugins/vector/helper.d.ts +0 -0
  1294. package/dist/types/plugins/vector/index.d.ts +2 -0
  1295. package/dist/types/plugins/vector/types.d.ts +1 -0
  1296. package/dist/types/plugins/vector/vector-distance.d.ts +13 -0
  1297. package/dist/types/plugins/webmcp/index.d.ts +2 -0
  1298. package/dist/types/plugins/webmcp/nosql-query-schema.d.ts +549 -0
  1299. package/dist/types/plugins/webmcp/webmcp.d.ts +12 -0
  1300. package/dist/types/query-cache.d.ts +35 -0
  1301. package/dist/types/query-planner.d.ts +30 -0
  1302. package/dist/types/replication-protocol/checkpoint.d.ts +8 -0
  1303. package/dist/types/replication-protocol/conflicts.d.ts +10 -0
  1304. package/dist/types/replication-protocol/default-conflict-handler.d.ts +2 -0
  1305. package/dist/types/replication-protocol/downstream.d.ts +10 -0
  1306. package/dist/types/replication-protocol/helper.d.ts +5 -0
  1307. package/dist/types/replication-protocol/index.d.ts +30 -0
  1308. package/dist/types/replication-protocol/meta-instance.d.ts +12 -0
  1309. package/dist/types/replication-protocol/upstream.d.ts +10 -0
  1310. package/dist/types/rx-change-event.d.ts +20 -0
  1311. package/dist/types/rx-collection-helper.d.ts +41 -0
  1312. package/dist/types/rx-collection.d.ts +185 -0
  1313. package/dist/types/rx-database-internal-store.d.ts +37 -0
  1314. package/dist/types/rx-database.d.ts +213 -0
  1315. package/dist/types/rx-document-prototype-merge.d.ts +24 -0
  1316. package/dist/types/rx-document.d.ts +274 -0
  1317. package/dist/types/rx-error.d.ts +37 -0
  1318. package/dist/types/rx-query-helper.d.ts +31 -0
  1319. package/dist/types/rx-query-mingo.d.ts +10 -0
  1320. package/dist/types/rx-query-single-result.d.ts +31 -0
  1321. package/dist/types/rx-query.d.ts +153 -0
  1322. package/dist/types/rx-schema-helper.d.ts +57 -0
  1323. package/dist/types/rx-schema.d.ts +43 -0
  1324. package/dist/types/rx-storage-helper.d.ts +111 -0
  1325. package/dist/types/rx-storage-multiinstance.d.ts +51 -0
  1326. package/dist/types/types/conflict-handling.d.ts +48 -0
  1327. package/dist/types/types/couchdb.d.ts +293 -0
  1328. package/dist/types/types/index.d.ts +32 -0
  1329. package/dist/types/types/modules/index.d.ts +0 -0
  1330. package/dist/types/types/modules/mocha.parallel.d.ts +1 -0
  1331. package/dist/types/types/plugins/backup.d.ts +35 -0
  1332. package/dist/types/types/plugins/cleanup.d.ts +38 -0
  1333. package/dist/types/types/plugins/crdt.d.ts +76 -0
  1334. package/dist/types/types/plugins/dexie.d.ts +30 -0
  1335. package/dist/types/types/plugins/local-documents.d.ts +49 -0
  1336. package/dist/types/types/plugins/migration.d.ts +14 -0
  1337. package/dist/types/types/plugins/reactivity.d.ts +40 -0
  1338. package/dist/types/types/plugins/replication-graphql.d.ts +98 -0
  1339. package/dist/types/types/plugins/replication.d.ts +175 -0
  1340. package/dist/types/types/plugins/state.d.ts +4 -0
  1341. package/dist/types/types/plugins/update.d.ts +23 -0
  1342. package/dist/types/types/plugins/webmcp.d.ts +40 -0
  1343. package/dist/types/types/query-planner.d.ts +47 -0
  1344. package/dist/types/types/replication-protocol.d.ts +296 -0
  1345. package/dist/types/types/rx-attachment.d.ts +46 -0
  1346. package/dist/types/types/rx-change-event.d.ts +85 -0
  1347. package/dist/types/types/rx-collection.d.ts +117 -0
  1348. package/dist/types/types/rx-database-internal-store.d.ts +54 -0
  1349. package/dist/types/types/rx-database.d.ts +124 -0
  1350. package/dist/types/types/rx-document.d.ts +160 -0
  1351. package/dist/types/types/rx-error.d.ts +222 -0
  1352. package/dist/types/types/rx-plugin.d.ts +167 -0
  1353. package/dist/types/types/rx-query.d.ts +144 -0
  1354. package/dist/types/types/rx-schema.d.ts +209 -0
  1355. package/dist/types/types/rx-storage.d.ts +347 -0
  1356. package/dist/types/types/rx-storage.interface.d.ts +312 -0
  1357. package/dist/types/types/util.d.ts +180 -0
  1358. package/eslint.config.mjs +514 -0
  1359. package/package.json +729 -0
  1360. package/plugins/attachments/index.cjs +2 -0
  1361. package/plugins/attachments/index.d.cts +1 -0
  1362. package/plugins/attachments/index.d.mts +1 -0
  1363. package/plugins/attachments/index.mjs +1 -0
  1364. package/plugins/attachments/index.ts +1 -0
  1365. package/plugins/attachments/package.json +18 -0
  1366. package/plugins/attachments-compression/index.cjs +2 -0
  1367. package/plugins/attachments-compression/index.d.cts +1 -0
  1368. package/plugins/attachments-compression/index.d.mts +1 -0
  1369. package/plugins/attachments-compression/index.mjs +1 -0
  1370. package/plugins/attachments-compression/index.ts +1 -0
  1371. package/plugins/attachments-compression/package.json +18 -0
  1372. package/plugins/backup/index.cjs +2 -0
  1373. package/plugins/backup/index.d.cts +1 -0
  1374. package/plugins/backup/index.d.mts +1 -0
  1375. package/plugins/backup/index.mjs +1 -0
  1376. package/plugins/backup/index.ts +1 -0
  1377. package/plugins/backup/package.json +18 -0
  1378. package/plugins/cleanup/index.cjs +2 -0
  1379. package/plugins/cleanup/index.d.cts +1 -0
  1380. package/plugins/cleanup/index.d.mts +1 -0
  1381. package/plugins/cleanup/index.mjs +1 -0
  1382. package/plugins/cleanup/index.ts +1 -0
  1383. package/plugins/cleanup/package.json +18 -0
  1384. package/plugins/core/index.cjs +2 -0
  1385. package/plugins/core/index.d.cts +1 -0
  1386. package/plugins/core/index.d.mts +1 -0
  1387. package/plugins/core/index.mjs +1 -0
  1388. package/plugins/core/index.ts +1 -0
  1389. package/plugins/core/package.json +18 -0
  1390. package/plugins/crdt/index.cjs +2 -0
  1391. package/plugins/crdt/index.d.cts +1 -0
  1392. package/plugins/crdt/index.d.mts +1 -0
  1393. package/plugins/crdt/index.mjs +1 -0
  1394. package/plugins/crdt/index.ts +1 -0
  1395. package/plugins/crdt/package.json +18 -0
  1396. package/plugins/dev-mode/index.cjs +2 -0
  1397. package/plugins/dev-mode/index.d.cts +1 -0
  1398. package/plugins/dev-mode/index.d.mts +1 -0
  1399. package/plugins/dev-mode/index.mjs +1 -0
  1400. package/plugins/dev-mode/index.ts +1 -0
  1401. package/plugins/dev-mode/package.json +18 -0
  1402. package/plugins/electron/index.cjs +2 -0
  1403. package/plugins/electron/index.d.cts +1 -0
  1404. package/plugins/electron/index.d.mts +1 -0
  1405. package/plugins/electron/index.mjs +1 -0
  1406. package/plugins/electron/index.ts +1 -0
  1407. package/plugins/electron/package.json +18 -0
  1408. package/plugins/encryption-crypto-js/index.cjs +2 -0
  1409. package/plugins/encryption-crypto-js/index.d.cts +1 -0
  1410. package/plugins/encryption-crypto-js/index.d.mts +1 -0
  1411. package/plugins/encryption-crypto-js/index.mjs +1 -0
  1412. package/plugins/encryption-crypto-js/index.ts +1 -0
  1413. package/plugins/encryption-crypto-js/package.json +18 -0
  1414. package/plugins/flutter/index.cjs +2 -0
  1415. package/plugins/flutter/index.d.cts +1 -0
  1416. package/plugins/flutter/index.d.mts +1 -0
  1417. package/plugins/flutter/index.mjs +1 -0
  1418. package/plugins/flutter/index.ts +1 -0
  1419. package/plugins/flutter/package.json +18 -0
  1420. package/plugins/json-dump/index.cjs +2 -0
  1421. package/plugins/json-dump/index.d.cts +1 -0
  1422. package/plugins/json-dump/index.d.mts +1 -0
  1423. package/plugins/json-dump/index.mjs +1 -0
  1424. package/plugins/json-dump/index.ts +1 -0
  1425. package/plugins/json-dump/package.json +18 -0
  1426. package/plugins/key-compression/index.cjs +2 -0
  1427. package/plugins/key-compression/index.d.cts +1 -0
  1428. package/plugins/key-compression/index.d.mts +1 -0
  1429. package/plugins/key-compression/index.mjs +1 -0
  1430. package/plugins/key-compression/index.ts +1 -0
  1431. package/plugins/key-compression/package.json +18 -0
  1432. package/plugins/leader-election/index.cjs +2 -0
  1433. package/plugins/leader-election/index.d.cts +1 -0
  1434. package/plugins/leader-election/index.d.mts +1 -0
  1435. package/plugins/leader-election/index.mjs +1 -0
  1436. package/plugins/leader-election/index.ts +1 -0
  1437. package/plugins/leader-election/package.json +18 -0
  1438. package/plugins/local-documents/index.cjs +2 -0
  1439. package/plugins/local-documents/index.d.cts +1 -0
  1440. package/plugins/local-documents/index.d.mts +1 -0
  1441. package/plugins/local-documents/index.mjs +1 -0
  1442. package/plugins/local-documents/index.ts +1 -0
  1443. package/plugins/local-documents/package.json +18 -0
  1444. package/plugins/migration-schema/index.cjs +2 -0
  1445. package/plugins/migration-schema/index.d.cts +1 -0
  1446. package/plugins/migration-schema/index.d.mts +1 -0
  1447. package/plugins/migration-schema/index.mjs +1 -0
  1448. package/plugins/migration-schema/index.ts +1 -0
  1449. package/plugins/migration-schema/package.json +18 -0
  1450. package/plugins/migration-storage/index.cjs +2 -0
  1451. package/plugins/migration-storage/index.d.cts +1 -0
  1452. package/plugins/migration-storage/index.d.mts +1 -0
  1453. package/plugins/migration-storage/index.mjs +1 -0
  1454. package/plugins/migration-storage/index.ts +1 -0
  1455. package/plugins/migration-storage/package.json +18 -0
  1456. package/plugins/pipeline/index.cjs +2 -0
  1457. package/plugins/pipeline/index.d.cts +1 -0
  1458. package/plugins/pipeline/index.d.mts +1 -0
  1459. package/plugins/pipeline/index.mjs +1 -0
  1460. package/plugins/pipeline/index.ts +1 -0
  1461. package/plugins/pipeline/package.json +18 -0
  1462. package/plugins/query-builder/index.cjs +2 -0
  1463. package/plugins/query-builder/index.d.cts +1 -0
  1464. package/plugins/query-builder/index.d.mts +1 -0
  1465. package/plugins/query-builder/index.mjs +1 -0
  1466. package/plugins/query-builder/index.ts +1 -0
  1467. package/plugins/query-builder/package.json +18 -0
  1468. package/plugins/react/index.cjs +2 -0
  1469. package/plugins/react/index.d.cts +1 -0
  1470. package/plugins/react/index.d.mts +1 -0
  1471. package/plugins/react/index.mjs +1 -0
  1472. package/plugins/react/index.ts +1 -0
  1473. package/plugins/react/package.json +18 -0
  1474. package/plugins/reactivity-angular/index.cjs +2 -0
  1475. package/plugins/reactivity-angular/index.d.cts +1 -0
  1476. package/plugins/reactivity-angular/index.d.mts +1 -0
  1477. package/plugins/reactivity-angular/index.mjs +1 -0
  1478. package/plugins/reactivity-angular/index.ts +1 -0
  1479. package/plugins/reactivity-angular/package.json +18 -0
  1480. package/plugins/reactivity-preact-signals/index.cjs +2 -0
  1481. package/plugins/reactivity-preact-signals/index.d.cts +1 -0
  1482. package/plugins/reactivity-preact-signals/index.d.mts +1 -0
  1483. package/plugins/reactivity-preact-signals/index.mjs +1 -0
  1484. package/plugins/reactivity-preact-signals/index.ts +1 -0
  1485. package/plugins/reactivity-preact-signals/package.json +18 -0
  1486. package/plugins/reactivity-vue/index.cjs +2 -0
  1487. package/plugins/reactivity-vue/index.d.cts +1 -0
  1488. package/plugins/reactivity-vue/index.d.mts +1 -0
  1489. package/plugins/reactivity-vue/index.mjs +1 -0
  1490. package/plugins/reactivity-vue/index.ts +1 -0
  1491. package/plugins/reactivity-vue/package.json +18 -0
  1492. package/plugins/replication/index.cjs +2 -0
  1493. package/plugins/replication/index.d.cts +1 -0
  1494. package/plugins/replication/index.d.mts +1 -0
  1495. package/plugins/replication/index.mjs +1 -0
  1496. package/plugins/replication/index.ts +1 -0
  1497. package/plugins/replication/package.json +18 -0
  1498. package/plugins/replication-appwrite/index.cjs +2 -0
  1499. package/plugins/replication-appwrite/index.d.cts +1 -0
  1500. package/plugins/replication-appwrite/index.d.mts +1 -0
  1501. package/plugins/replication-appwrite/index.mjs +1 -0
  1502. package/plugins/replication-appwrite/index.ts +1 -0
  1503. package/plugins/replication-appwrite/package.json +18 -0
  1504. package/plugins/replication-couchdb/index.cjs +2 -0
  1505. package/plugins/replication-couchdb/index.d.cts +1 -0
  1506. package/plugins/replication-couchdb/index.d.mts +1 -0
  1507. package/plugins/replication-couchdb/index.mjs +1 -0
  1508. package/plugins/replication-couchdb/index.ts +1 -0
  1509. package/plugins/replication-couchdb/package.json +18 -0
  1510. package/plugins/replication-firestore/index.cjs +2 -0
  1511. package/plugins/replication-firestore/index.d.cts +1 -0
  1512. package/plugins/replication-firestore/index.d.mts +1 -0
  1513. package/plugins/replication-firestore/index.mjs +1 -0
  1514. package/plugins/replication-firestore/index.ts +1 -0
  1515. package/plugins/replication-firestore/package.json +18 -0
  1516. package/plugins/replication-google-drive/index.cjs +2 -0
  1517. package/plugins/replication-google-drive/index.d.cts +1 -0
  1518. package/plugins/replication-google-drive/index.d.mts +1 -0
  1519. package/plugins/replication-google-drive/index.mjs +1 -0
  1520. package/plugins/replication-google-drive/index.ts +1 -0
  1521. package/plugins/replication-google-drive/package.json +18 -0
  1522. package/plugins/replication-graphql/index.cjs +2 -0
  1523. package/plugins/replication-graphql/index.d.cts +1 -0
  1524. package/plugins/replication-graphql/index.d.mts +1 -0
  1525. package/plugins/replication-graphql/index.mjs +1 -0
  1526. package/plugins/replication-graphql/index.ts +1 -0
  1527. package/plugins/replication-graphql/package.json +18 -0
  1528. package/plugins/replication-microsoft-onedrive/index.cjs +2 -0
  1529. package/plugins/replication-microsoft-onedrive/index.d.cts +1 -0
  1530. package/plugins/replication-microsoft-onedrive/index.d.mts +1 -0
  1531. package/plugins/replication-microsoft-onedrive/index.mjs +1 -0
  1532. package/plugins/replication-microsoft-onedrive/index.ts +1 -0
  1533. package/plugins/replication-microsoft-onedrive/package.json +18 -0
  1534. package/plugins/replication-mongodb/index.cjs +2 -0
  1535. package/plugins/replication-mongodb/index.d.cts +1 -0
  1536. package/plugins/replication-mongodb/index.d.mts +1 -0
  1537. package/plugins/replication-mongodb/index.mjs +1 -0
  1538. package/plugins/replication-mongodb/index.ts +1 -0
  1539. package/plugins/replication-mongodb/package.json +18 -0
  1540. package/plugins/replication-nats/index.cjs +2 -0
  1541. package/plugins/replication-nats/index.d.cts +1 -0
  1542. package/plugins/replication-nats/index.d.mts +1 -0
  1543. package/plugins/replication-nats/index.mjs +1 -0
  1544. package/plugins/replication-nats/index.ts +1 -0
  1545. package/plugins/replication-nats/package.json +18 -0
  1546. package/plugins/replication-supabase/index.cjs +2 -0
  1547. package/plugins/replication-supabase/index.d.cts +1 -0
  1548. package/plugins/replication-supabase/index.d.mts +1 -0
  1549. package/plugins/replication-supabase/index.mjs +1 -0
  1550. package/plugins/replication-supabase/index.ts +1 -0
  1551. package/plugins/replication-supabase/package.json +18 -0
  1552. package/plugins/replication-webrtc/index.cjs +2 -0
  1553. package/plugins/replication-webrtc/index.d.cts +1 -0
  1554. package/plugins/replication-webrtc/index.d.mts +1 -0
  1555. package/plugins/replication-webrtc/index.mjs +1 -0
  1556. package/plugins/replication-webrtc/index.ts +1 -0
  1557. package/plugins/replication-webrtc/package.json +18 -0
  1558. package/plugins/replication-websocket/index.cjs +2 -0
  1559. package/plugins/replication-websocket/index.d.cts +1 -0
  1560. package/plugins/replication-websocket/index.d.mts +1 -0
  1561. package/plugins/replication-websocket/index.mjs +1 -0
  1562. package/plugins/replication-websocket/index.ts +1 -0
  1563. package/plugins/replication-websocket/package.json +18 -0
  1564. package/plugins/state/index.cjs +2 -0
  1565. package/plugins/state/index.d.cts +1 -0
  1566. package/plugins/state/index.d.mts +1 -0
  1567. package/plugins/state/index.mjs +1 -0
  1568. package/plugins/state/index.ts +1 -0
  1569. package/plugins/state/package.json +18 -0
  1570. package/plugins/storage-denokv/index.cjs +2 -0
  1571. package/plugins/storage-denokv/index.d.cts +1 -0
  1572. package/plugins/storage-denokv/index.d.mts +1 -0
  1573. package/plugins/storage-denokv/index.mjs +1 -0
  1574. package/plugins/storage-denokv/index.ts +1 -0
  1575. package/plugins/storage-denokv/package.json +18 -0
  1576. package/plugins/storage-dexie/index.cjs +2 -0
  1577. package/plugins/storage-dexie/index.d.cts +1 -0
  1578. package/plugins/storage-dexie/index.d.mts +1 -0
  1579. package/plugins/storage-dexie/index.mjs +1 -0
  1580. package/plugins/storage-dexie/index.ts +1 -0
  1581. package/plugins/storage-dexie/package.json +18 -0
  1582. package/plugins/storage-foundationdb/index.cjs +2 -0
  1583. package/plugins/storage-foundationdb/index.d.cts +1 -0
  1584. package/plugins/storage-foundationdb/index.d.mts +1 -0
  1585. package/plugins/storage-foundationdb/index.mjs +1 -0
  1586. package/plugins/storage-foundationdb/index.ts +1 -0
  1587. package/plugins/storage-foundationdb/package.json +18 -0
  1588. package/plugins/storage-localstorage/index.cjs +2 -0
  1589. package/plugins/storage-localstorage/index.d.cts +1 -0
  1590. package/plugins/storage-localstorage/index.d.mts +1 -0
  1591. package/plugins/storage-localstorage/index.mjs +1 -0
  1592. package/plugins/storage-localstorage/index.ts +1 -0
  1593. package/plugins/storage-localstorage/package.json +18 -0
  1594. package/plugins/storage-memory/index.cjs +2 -0
  1595. package/plugins/storage-memory/index.d.cts +1 -0
  1596. package/plugins/storage-memory/index.d.mts +1 -0
  1597. package/plugins/storage-memory/index.mjs +1 -0
  1598. package/plugins/storage-memory/index.ts +1 -0
  1599. package/plugins/storage-memory/package.json +18 -0
  1600. package/plugins/storage-mongodb/index.cjs +2 -0
  1601. package/plugins/storage-mongodb/index.d.cts +1 -0
  1602. package/plugins/storage-mongodb/index.d.mts +1 -0
  1603. package/plugins/storage-mongodb/index.mjs +1 -0
  1604. package/plugins/storage-mongodb/index.ts +1 -0
  1605. package/plugins/storage-mongodb/package.json +18 -0
  1606. package/plugins/storage-remote/index.cjs +2 -0
  1607. package/plugins/storage-remote/index.d.cts +1 -0
  1608. package/plugins/storage-remote/index.d.mts +1 -0
  1609. package/plugins/storage-remote/index.mjs +1 -0
  1610. package/plugins/storage-remote/index.ts +1 -0
  1611. package/plugins/storage-remote/package.json +18 -0
  1612. package/plugins/storage-remote-websocket/index.cjs +2 -0
  1613. package/plugins/storage-remote-websocket/index.d.cts +1 -0
  1614. package/plugins/storage-remote-websocket/index.d.mts +1 -0
  1615. package/plugins/storage-remote-websocket/index.mjs +1 -0
  1616. package/plugins/storage-remote-websocket/index.ts +1 -0
  1617. package/plugins/storage-remote-websocket/package.json +18 -0
  1618. package/plugins/storage-sqlite/index.cjs +2 -0
  1619. package/plugins/storage-sqlite/index.d.cts +1 -0
  1620. package/plugins/storage-sqlite/index.d.mts +1 -0
  1621. package/plugins/storage-sqlite/index.mjs +1 -0
  1622. package/plugins/storage-sqlite/index.ts +1 -0
  1623. package/plugins/storage-sqlite/package.json +18 -0
  1624. package/plugins/test-utils/index.cjs +2 -0
  1625. package/plugins/test-utils/index.d.cts +1 -0
  1626. package/plugins/test-utils/index.d.mts +1 -0
  1627. package/plugins/test-utils/index.mjs +1 -0
  1628. package/plugins/test-utils/index.ts +1 -0
  1629. package/plugins/test-utils/package.json +18 -0
  1630. package/plugins/update/index.cjs +2 -0
  1631. package/plugins/update/index.d.cts +1 -0
  1632. package/plugins/update/index.d.mts +1 -0
  1633. package/plugins/update/index.mjs +1 -0
  1634. package/plugins/update/index.ts +1 -0
  1635. package/plugins/update/package.json +18 -0
  1636. package/plugins/utils/index.cjs +2 -0
  1637. package/plugins/utils/index.d.cts +1 -0
  1638. package/plugins/utils/index.d.mts +1 -0
  1639. package/plugins/utils/index.mjs +1 -0
  1640. package/plugins/utils/index.ts +1 -0
  1641. package/plugins/utils/package.json +18 -0
  1642. package/plugins/validate-ajv/index.cjs +2 -0
  1643. package/plugins/validate-ajv/index.d.cts +1 -0
  1644. package/plugins/validate-ajv/index.d.mts +1 -0
  1645. package/plugins/validate-ajv/index.mjs +1 -0
  1646. package/plugins/validate-ajv/index.ts +1 -0
  1647. package/plugins/validate-ajv/package.json +18 -0
  1648. package/plugins/validate-is-my-json-valid/index.cjs +2 -0
  1649. package/plugins/validate-is-my-json-valid/index.d.cts +1 -0
  1650. package/plugins/validate-is-my-json-valid/index.d.mts +1 -0
  1651. package/plugins/validate-is-my-json-valid/index.mjs +1 -0
  1652. package/plugins/validate-is-my-json-valid/index.ts +1 -0
  1653. package/plugins/validate-is-my-json-valid/package.json +18 -0
  1654. package/plugins/validate-z-schema/index.cjs +2 -0
  1655. package/plugins/validate-z-schema/index.d.cts +1 -0
  1656. package/plugins/validate-z-schema/index.d.mts +1 -0
  1657. package/plugins/validate-z-schema/index.mjs +1 -0
  1658. package/plugins/validate-z-schema/index.ts +1 -0
  1659. package/plugins/validate-z-schema/package.json +18 -0
  1660. package/plugins/vector/index.cjs +2 -0
  1661. package/plugins/vector/index.d.cts +1 -0
  1662. package/plugins/vector/index.d.mts +1 -0
  1663. package/plugins/vector/index.mjs +1 -0
  1664. package/plugins/vector/index.ts +1 -0
  1665. package/plugins/vector/package.json +18 -0
  1666. package/plugins/webmcp/index.cjs +2 -0
  1667. package/plugins/webmcp/index.d.cts +1 -0
  1668. package/plugins/webmcp/index.d.mts +1 -0
  1669. package/plugins/webmcp/index.mjs +1 -0
  1670. package/plugins/webmcp/index.ts +1 -0
  1671. package/plugins/webmcp/package.json +18 -0
  1672. package/scripts/acme-challenge/.gittouch +0 -0
  1673. package/scripts/ai-context-generator.mjs +63 -0
  1674. package/scripts/cloud-signaling-script.sh +6 -0
  1675. package/scripts/docs-remove-time.mjs +55 -0
  1676. package/scripts/fix-types.mjs +23 -0
  1677. package/scripts/generate-all-headers.ts +102 -0
  1678. package/scripts/generate-error-messages.mjs +41 -0
  1679. package/scripts/generate-header.ts +226 -0
  1680. package/scripts/generate-plugins-package-json.mjs +133 -0
  1681. package/scripts/install-foundationdb.sh +14 -0
  1682. package/scripts/module_package.json +1 -0
  1683. package/scripts/module_package_no_side.json +1 -0
  1684. package/scripts/postinstall.js +33 -0
  1685. package/scripts/profile.mjs +31 -0
  1686. package/scripts/set-version.mjs +162 -0
  1687. package/scripts/start-cloud-signaling-server.mjs +120 -0
  1688. package/scripts/transpile.mjs +229 -0
  1689. package/scripts/update-version-variable.mjs +49 -0
  1690. package/src/change-event-buffer.ts +171 -0
  1691. package/src/custom-index.ts +376 -0
  1692. package/src/doc-cache.ts +294 -0
  1693. package/src/event-reduce.ts +159 -0
  1694. package/src/hooks.ts +128 -0
  1695. package/src/incremental-write.ts +227 -0
  1696. package/src/index.ts +30 -0
  1697. package/src/overwritable.ts +41 -0
  1698. package/src/plugin-helpers.ts +319 -0
  1699. package/src/plugin.ts +113 -0
  1700. package/src/plugins/attachments/attachments-utils.ts +84 -0
  1701. package/src/plugins/attachments/index.ts +316 -0
  1702. package/src/plugins/attachments-compression/index.ts +221 -0
  1703. package/src/plugins/backup/file-util.ts +132 -0
  1704. package/src/plugins/backup/index.ts +281 -0
  1705. package/src/plugins/cleanup/cleanup-helper.ts +11 -0
  1706. package/src/plugins/cleanup/cleanup-state.ts +92 -0
  1707. package/src/plugins/cleanup/cleanup.ts +140 -0
  1708. package/src/plugins/cleanup/index.ts +45 -0
  1709. package/src/plugins/crdt/index.ts +505 -0
  1710. package/src/plugins/dev-mode/check-document.ts +176 -0
  1711. package/src/plugins/dev-mode/check-migration-strategies.ts +53 -0
  1712. package/src/plugins/dev-mode/check-orm.ts +65 -0
  1713. package/src/plugins/dev-mode/check-query.ts +231 -0
  1714. package/src/plugins/dev-mode/check-schema.ts +564 -0
  1715. package/src/plugins/dev-mode/dev-mode-tracking.ts +125 -0
  1716. package/src/plugins/dev-mode/entity-properties.ts +56 -0
  1717. package/src/plugins/dev-mode/error-messages.ts +1331 -0
  1718. package/src/plugins/dev-mode/index.ts +203 -0
  1719. package/src/plugins/dev-mode/unallowed-properties.ts +96 -0
  1720. package/src/plugins/electron/electron-helper.ts +2 -0
  1721. package/src/plugins/electron/index.ts +3 -0
  1722. package/src/plugins/electron/rx-storage-ipc-main.ts +58 -0
  1723. package/src/plugins/electron/rx-storage-ipc-renderer.ts +62 -0
  1724. package/src/plugins/encryption-crypto-js/index.ts +220 -0
  1725. package/src/plugins/flutter/dart/analysis_options.yaml +30 -0
  1726. package/src/plugins/flutter/dart/example/rxdb_example.dart +6 -0
  1727. package/src/plugins/flutter/dart/lib/rxdb.dart +7 -0
  1728. package/src/plugins/flutter/dart/lib/src/rxdb_base.dart +332 -0
  1729. package/src/plugins/flutter/dart/pubspec.yaml +15 -0
  1730. package/src/plugins/flutter/index.ts +65 -0
  1731. package/src/plugins/json-dump/index.ts +146 -0
  1732. package/src/plugins/key-compression/index.ts +238 -0
  1733. package/src/plugins/leader-election/index.ts +129 -0
  1734. package/src/plugins/local-documents/index.ts +95 -0
  1735. package/src/plugins/local-documents/local-documents-helper.ts +103 -0
  1736. package/src/plugins/local-documents/local-documents.ts +146 -0
  1737. package/src/plugins/local-documents/rx-local-document.ts +388 -0
  1738. package/src/plugins/migration-schema/index.ts +75 -0
  1739. package/src/plugins/migration-schema/migration-helpers.ts +162 -0
  1740. package/src/plugins/migration-schema/migration-types.ts +42 -0
  1741. package/src/plugins/migration-schema/rx-migration-state.ts +632 -0
  1742. package/src/plugins/migration-storage/index.ts +255 -0
  1743. package/src/plugins/pipeline/flagged-functions.ts +131 -0
  1744. package/src/plugins/pipeline/index.ts +18 -0
  1745. package/src/plugins/pipeline/rx-pipeline.ts +303 -0
  1746. package/src/plugins/pipeline/types.ts +28 -0
  1747. package/src/plugins/query-builder/index.ts +81 -0
  1748. package/src/plugins/query-builder/mquery/README.md +5 -0
  1749. package/src/plugins/query-builder/mquery/mquery-utils.ts +37 -0
  1750. package/src/plugins/query-builder/mquery/nosql-query-builder.ts +578 -0
  1751. package/src/plugins/react/database-context.ts +10 -0
  1752. package/src/plugins/react/database-provider.tsx +38 -0
  1753. package/src/plugins/react/hooks/index.ts +4 -0
  1754. package/src/plugins/react/hooks/use-live-rx-query.ts +34 -0
  1755. package/src/plugins/react/hooks/use-rx-collection.ts +73 -0
  1756. package/src/plugins/react/hooks/use-rx-database.ts +35 -0
  1757. package/src/plugins/react/hooks/use-rx-query.ts +168 -0
  1758. package/src/plugins/react/index.ts +2 -0
  1759. package/src/plugins/reactivity-angular/index.ts +32 -0
  1760. package/src/plugins/reactivity-preact-signals/index.ts +85 -0
  1761. package/src/plugins/reactivity-vue/index.ts +43 -0
  1762. package/src/plugins/replication/index.ts +668 -0
  1763. package/src/plugins/replication/replication-helper.ts +122 -0
  1764. package/src/plugins/replication-appwrite/appwrite-helpers.ts +38 -0
  1765. package/src/plugins/replication-appwrite/appwrite-types.ts +31 -0
  1766. package/src/plugins/replication-appwrite/index.ts +269 -0
  1767. package/src/plugins/replication-couchdb/couchdb-helper.ts +100 -0
  1768. package/src/plugins/replication-couchdb/couchdb-types.ts +34 -0
  1769. package/src/plugins/replication-couchdb/index.ts +341 -0
  1770. package/src/plugins/replication-firestore/firestore-helper.ts +79 -0
  1771. package/src/plugins/replication-firestore/firestore-types.ts +72 -0
  1772. package/src/plugins/replication-firestore/index.ts +387 -0
  1773. package/src/plugins/replication-google-drive/AGENTS.md +5 -0
  1774. package/src/plugins/replication-google-drive/document-handling.ts +203 -0
  1775. package/src/plugins/replication-google-drive/download-specs.sh +49 -0
  1776. package/src/plugins/replication-google-drive/downstream.ts +118 -0
  1777. package/src/plugins/replication-google-drive/google-drive-helper.ts +467 -0
  1778. package/src/plugins/replication-google-drive/google-drive-types.ts +84 -0
  1779. package/src/plugins/replication-google-drive/index.ts +221 -0
  1780. package/src/plugins/replication-google-drive/init.ts +108 -0
  1781. package/src/plugins/replication-google-drive/multipart.ts +86 -0
  1782. package/src/plugins/replication-google-drive/signaling.ts +399 -0
  1783. package/src/plugins/replication-google-drive/transaction.ts +222 -0
  1784. package/src/plugins/replication-google-drive/upstream.ts +279 -0
  1785. package/src/plugins/replication-graphql/graphql-schema-from-rx-schema.ts +337 -0
  1786. package/src/plugins/replication-graphql/graphql-websocket.ts +56 -0
  1787. package/src/plugins/replication-graphql/helper.ts +52 -0
  1788. package/src/plugins/replication-graphql/index.ts +255 -0
  1789. package/src/plugins/replication-graphql/query-builder-from-rx-schema.ts +195 -0
  1790. package/src/plugins/replication-microsoft-onedrive/document-handling.ts +216 -0
  1791. package/src/plugins/replication-microsoft-onedrive/downstream.ts +121 -0
  1792. package/src/plugins/replication-microsoft-onedrive/index.ts +220 -0
  1793. package/src/plugins/replication-microsoft-onedrive/init.ts +107 -0
  1794. package/src/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.ts +355 -0
  1795. package/src/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.ts +88 -0
  1796. package/src/plugins/replication-microsoft-onedrive/signaling.ts +333 -0
  1797. package/src/plugins/replication-microsoft-onedrive/transaction.ts +220 -0
  1798. package/src/plugins/replication-microsoft-onedrive/upstream.ts +282 -0
  1799. package/src/plugins/replication-mongodb/index.ts +275 -0
  1800. package/src/plugins/replication-mongodb/mongodb-checkpoint.ts +184 -0
  1801. package/src/plugins/replication-mongodb/mongodb-helper.ts +69 -0
  1802. package/src/plugins/replication-mongodb/mongodb-types.ts +50 -0
  1803. package/src/plugins/replication-nats/index.ts +289 -0
  1804. package/src/plugins/replication-nats/nats-helper.ts +15 -0
  1805. package/src/plugins/replication-nats/nats-types.ts +43 -0
  1806. package/src/plugins/replication-supabase/helper.ts +63 -0
  1807. package/src/plugins/replication-supabase/index.ts +308 -0
  1808. package/src/plugins/replication-supabase/types.ts +47 -0
  1809. package/src/plugins/replication-webrtc/connection-handler-p2pcf.ts +77 -0
  1810. package/src/plugins/replication-webrtc/connection-handler-simple-peer.ts +302 -0
  1811. package/src/plugins/replication-webrtc/connection-handler-webtorrent.ts +137 -0
  1812. package/src/plugins/replication-webrtc/index.ts +307 -0
  1813. package/src/plugins/replication-webrtc/signaling-server.ts +193 -0
  1814. package/src/plugins/replication-webrtc/webrtc-helper.ts +55 -0
  1815. package/src/plugins/replication-webrtc/webrtc-types.ts +91 -0
  1816. package/src/plugins/replication-websocket/index.ts +3 -0
  1817. package/src/plugins/replication-websocket/websocket-client.ts +187 -0
  1818. package/src/plugins/replication-websocket/websocket-server.ts +135 -0
  1819. package/src/plugins/replication-websocket/websocket-types.ts +47 -0
  1820. package/src/plugins/state/helpers.ts +86 -0
  1821. package/src/plugins/state/index.ts +40 -0
  1822. package/src/plugins/state/rx-state.ts +386 -0
  1823. package/src/plugins/state/types.ts +32 -0
  1824. package/src/plugins/storage-denokv/denokv-helper.ts +46 -0
  1825. package/src/plugins/storage-denokv/denokv-query.ts +135 -0
  1826. package/src/plugins/storage-denokv/denokv-types.ts +19 -0
  1827. package/src/plugins/storage-denokv/index.ts +37 -0
  1828. package/src/plugins/storage-denokv/rx-storage-instance-denokv.ts +426 -0
  1829. package/src/plugins/storage-dexie/dexie-helper.ts +302 -0
  1830. package/src/plugins/storage-dexie/dexie-query.ts +252 -0
  1831. package/src/plugins/storage-dexie/index.ts +4 -0
  1832. package/src/plugins/storage-dexie/rx-storage-dexie.ts +62 -0
  1833. package/src/plugins/storage-dexie/rx-storage-instance-dexie.ts +378 -0
  1834. package/src/plugins/storage-foundationdb/foundationdb-helpers.ts +6 -0
  1835. package/src/plugins/storage-foundationdb/foundationdb-query.ts +140 -0
  1836. package/src/plugins/storage-foundationdb/foundationdb-types.ts +64 -0
  1837. package/src/plugins/storage-foundationdb/index.ts +57 -0
  1838. package/src/plugins/storage-foundationdb/rx-storage-instance-foundationdb.ts +449 -0
  1839. package/src/plugins/storage-localstorage/index.ts +44 -0
  1840. package/src/plugins/storage-localstorage/localstorage-mock.ts +32 -0
  1841. package/src/plugins/storage-localstorage/rx-storage-instance-localstorage.ts +686 -0
  1842. package/src/plugins/storage-memory/binary-search-bounds.ts +106 -0
  1843. package/src/plugins/storage-memory/index.ts +52 -0
  1844. package/src/plugins/storage-memory/memory-helper.ts +259 -0
  1845. package/src/plugins/storage-memory/memory-indexes.ts +34 -0
  1846. package/src/plugins/storage-memory/memory-types.ts +90 -0
  1847. package/src/plugins/storage-memory/rx-storage-instance-memory.ts +609 -0
  1848. package/src/plugins/storage-mongodb/index.ts +4 -0
  1849. package/src/plugins/storage-mongodb/mongodb-helper.ts +119 -0
  1850. package/src/plugins/storage-mongodb/mongodb-types.ts +32 -0
  1851. package/src/plugins/storage-mongodb/rx-storage-instance-mongodb.ts +464 -0
  1852. package/src/plugins/storage-mongodb/rx-storage-mongodb.ts +33 -0
  1853. package/src/plugins/storage-remote/index.ts +5 -0
  1854. package/src/plugins/storage-remote/message-channel-cache.ts +88 -0
  1855. package/src/plugins/storage-remote/remote.ts +285 -0
  1856. package/src/plugins/storage-remote/rx-storage-remote.ts +286 -0
  1857. package/src/plugins/storage-remote/storage-remote-helpers.ts +33 -0
  1858. package/src/plugins/storage-remote/storage-remote-types.ts +118 -0
  1859. package/src/plugins/storage-remote-websocket/index.ts +218 -0
  1860. package/src/plugins/storage-remote-websocket/types.ts +34 -0
  1861. package/src/plugins/storage-sqlite/index.ts +64 -0
  1862. package/src/plugins/storage-sqlite/sqlite-basics-helpers.ts +656 -0
  1863. package/src/plugins/storage-sqlite/sqlite-helpers.ts +287 -0
  1864. package/src/plugins/storage-sqlite/sqlite-storage-instance.ts +507 -0
  1865. package/src/plugins/storage-sqlite/sqlite-types.ts +151 -0
  1866. package/src/plugins/test-utils/config.ts +135 -0
  1867. package/src/plugins/test-utils/humans-collection.ts +557 -0
  1868. package/src/plugins/test-utils/index.ts +24 -0
  1869. package/src/plugins/test-utils/performance.ts +344 -0
  1870. package/src/plugins/test-utils/replication-base-test-suite.ts +236 -0
  1871. package/src/plugins/test-utils/replication.ts +95 -0
  1872. package/src/plugins/test-utils/revisions.ts +4 -0
  1873. package/src/plugins/test-utils/schema-objects.ts +527 -0
  1874. package/src/plugins/test-utils/schemas.ts +1391 -0
  1875. package/src/plugins/test-utils/test-util.ts +85 -0
  1876. package/src/plugins/update/index.ts +57 -0
  1877. package/src/plugins/update/mingo-updater.ts +26 -0
  1878. package/src/plugins/utils/index.ts +20 -0
  1879. package/src/plugins/utils/utils-array.ts +152 -0
  1880. package/src/plugins/utils/utils-base64.ts +49 -0
  1881. package/src/plugins/utils/utils-blob.ts +65 -0
  1882. package/src/plugins/utils/utils-document.ts +117 -0
  1883. package/src/plugins/utils/utils-error.ts +53 -0
  1884. package/src/plugins/utils/utils-global.ts +5 -0
  1885. package/src/plugins/utils/utils-hash.ts +62 -0
  1886. package/src/plugins/utils/utils-map.ts +23 -0
  1887. package/src/plugins/utils/utils-number.ts +9 -0
  1888. package/src/plugins/utils/utils-object-deep-equal.ts +46 -0
  1889. package/src/plugins/utils/utils-object-dot-prop.ts +365 -0
  1890. package/src/plugins/utils/utils-object.ts +272 -0
  1891. package/src/plugins/utils/utils-other.ts +58 -0
  1892. package/src/plugins/utils/utils-premium.ts +37 -0
  1893. package/src/plugins/utils/utils-promise.ts +171 -0
  1894. package/src/plugins/utils/utils-regex.ts +2 -0
  1895. package/src/plugins/utils/utils-revision.ts +55 -0
  1896. package/src/plugins/utils/utils-rxdb-version.template.ts +4 -0
  1897. package/src/plugins/utils/utils-rxdb-version.ts +4 -0
  1898. package/src/plugins/utils/utils-string.ts +91 -0
  1899. package/src/plugins/utils/utils-time.ts +37 -0
  1900. package/src/plugins/validate-ajv/index.ts +61 -0
  1901. package/src/plugins/validate-is-my-json-valid/index.ts +30 -0
  1902. package/src/plugins/validate-z-schema/index.ts +58 -0
  1903. package/src/plugins/vector/helper.ts +0 -0
  1904. package/src/plugins/vector/index.ts +2 -0
  1905. package/src/plugins/vector/types.ts +1 -0
  1906. package/src/plugins/vector/vector-distance.ts +34 -0
  1907. package/src/plugins/webmcp/index.ts +2 -0
  1908. package/src/plugins/webmcp/nosql-query-schema.ts +299 -0
  1909. package/src/plugins/webmcp/webmcp.ts +319 -0
  1910. package/src/query-cache.ts +139 -0
  1911. package/src/query-planner.ts +386 -0
  1912. package/src/replication-protocol/checkpoint.ts +154 -0
  1913. package/src/replication-protocol/conflicts.ts +53 -0
  1914. package/src/replication-protocol/default-conflict-handler.ts +43 -0
  1915. package/src/replication-protocol/downstream.ts +550 -0
  1916. package/src/replication-protocol/helper.ts +96 -0
  1917. package/src/replication-protocol/index.ts +348 -0
  1918. package/src/replication-protocol/meta-instance.ts +195 -0
  1919. package/src/replication-protocol/upstream.ts +560 -0
  1920. package/src/rx-change-event.ts +137 -0
  1921. package/src/rx-collection-helper.ts +262 -0
  1922. package/src/rx-collection.ts +1306 -0
  1923. package/src/rx-database-internal-store.ts +402 -0
  1924. package/src/rx-database.ts +919 -0
  1925. package/src/rx-document-prototype-merge.ts +124 -0
  1926. package/src/rx-document.ts +557 -0
  1927. package/src/rx-error.ts +190 -0
  1928. package/src/rx-query-helper.ts +317 -0
  1929. package/src/rx-query-mingo.ts +87 -0
  1930. package/src/rx-query-single-result.ts +110 -0
  1931. package/src/rx-query.ts +887 -0
  1932. package/src/rx-schema-helper.ts +391 -0
  1933. package/src/rx-schema.ts +247 -0
  1934. package/src/rx-storage-helper.ts +1050 -0
  1935. package/src/rx-storage-multiinstance.ts +188 -0
  1936. package/src/types/conflict-handling.d.ts +48 -0
  1937. package/src/types/couchdb.d.ts +293 -0
  1938. package/src/types/index.d.ts +32 -0
  1939. package/src/types/modules/index.d.ts +0 -0
  1940. package/src/types/modules/mocha.parallel.d.ts +1 -0
  1941. package/src/types/plugins/backup.d.ts +35 -0
  1942. package/src/types/plugins/cleanup.d.ts +38 -0
  1943. package/src/types/plugins/crdt.d.ts +76 -0
  1944. package/src/types/plugins/dexie.d.ts +30 -0
  1945. package/src/types/plugins/local-documents.d.ts +49 -0
  1946. package/src/types/plugins/migration.d.ts +14 -0
  1947. package/src/types/plugins/reactivity.d.ts +40 -0
  1948. package/src/types/plugins/replication-graphql.d.ts +98 -0
  1949. package/src/types/plugins/replication.d.ts +175 -0
  1950. package/src/types/plugins/state.d.ts +4 -0
  1951. package/src/types/plugins/update.d.ts +23 -0
  1952. package/src/types/plugins/webmcp.d.ts +40 -0
  1953. package/src/types/query-planner.d.ts +47 -0
  1954. package/src/types/replication-protocol.d.ts +296 -0
  1955. package/src/types/rx-attachment.d.ts +46 -0
  1956. package/src/types/rx-change-event.d.ts +85 -0
  1957. package/src/types/rx-collection.d.ts +117 -0
  1958. package/src/types/rx-database-internal-store.d.ts +54 -0
  1959. package/src/types/rx-database.d.ts +124 -0
  1960. package/src/types/rx-document.d.ts +160 -0
  1961. package/src/types/rx-error.d.ts +222 -0
  1962. package/src/types/rx-plugin.d.ts +167 -0
  1963. package/src/types/rx-query.d.ts +144 -0
  1964. package/src/types/rx-schema.d.ts +209 -0
  1965. package/src/types/rx-storage.d.ts +347 -0
  1966. package/src/types/rx-storage.interface.d.ts +312 -0
  1967. package/src/types/util.d.ts +180 -0
  1968. package/tsconfig.json +54 -0
  1969. package/tsconfig.lint.json +18 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rx-storage-helper.js","names":["_overwritable","require","_rxError","_rxSchemaHelper","_index3","_rxjs","_rxQueryHelper","_hooks","INTERNAL_STORAGE_NAME","exports","RX_DATABASE_LOCAL_DOCS_STORAGE_NAME","getSingleDocument","storageInstance","documentId","results","findDocumentsById","doc","undefined","writeSingle","instance","writeRow","context","writeResult","bulkWrite","error","length","primaryPath","getPrimaryFieldOfPrimaryKey","schema","primaryKey","success","getWrittenDocumentsFromBulkWriteResponse","ret","observeSingle","firstFindPromise","changeStream","pipe","map","evBulk","events","find","ev","filter","Promise","resolve","ensureNotFalsy","documentData","startWith","switchMap","v","stackCheckpoints","checkpoints","Object","assign","x","throwIfIsStorageWriteError","collection","writeData","status","newRxError","name","id","writeError","data","EVENT_BULK_ID_PREFIX","randomToken","eventBulkCounter","nextEventBulkId","categorizeBulkWriteRows","docsInDb","bulkWriteRows","onInsert","onUpdate","hasAttachments","attachments","bulkInsertDocs","bulkUpdateDocs","errors","eventBulkId","eventBulk","checkpoint","eventBulkEvents","attachmentsAdd","attachmentsRemove","attachmentsUpdate","hasDocsInDb","size","newestRow","rowAmount","_loop","rowId","document","previous","docId","documentDeleted","_deleted","previousDeleted","documentInDb","get","attachmentError","insertedIsDeleted","entries","_attachments","forEach","attachmentId","attachmentData","isError","push","digest","stripAttachmentsDataFromRow","event","operation","stripAttachmentsDataFromDocument","previousDocumentData","revInDb","_rev","err","updatedRow","keys","previousAttachmentData","newDigest","eventDocumentData","previousEventDocumentData","args","attachmentWriteDataToNormalData","type","atts","hasAnyAttachment","key","prototype","hasOwnProperty","call","useDoc","flatClone","flatCloneDocWithMeta","_meta","getWrappedStorageInstance","database","rxJsonSchema","overwritable","deepFreezeWhenDevMode","originalStorageInstance","internals","collectionName","databaseName","options","rows","databaseToken","token","toStorageWriteRows","Array","time","now","firstRevision","index","lwt","createRevision","HOOKS","preStorageWrite","runPluginHooks","lockedRun","BULK_WRITE_ROWS_BY_RESPONSE","set","useWriteResult","reInsertErrors","reInsertIds","Set","reInserts","add","subResult","concat","successArray","subSuccess","query","preparedQuery","count","ids","deleted","getAttachmentData","getChangedDocumentsSince","limit","cleanup","minDeletedTime","remove","storageInstances","delete","close","ensureRxStorageInstanceParamsAreCorrect","params","keyCompression","hasEncryption","compression","jsonSchema","encrypted","getChangedDocumentsSinceQuery","sinceLwt","RX_META_LWT_MINIMUM","sinceId","normalizeMangoQuery","selector","$or","$gt","$eq","$gte","sort","skip","prepareQuery","result","documents","lastDoc","lastOfArray","WeakMap","BULK_WRITE_SUCCESS_MAP","writeRows","response","getFromMapOrCreate","realWriteRows","errorIds","has","randomDelayStorage","input","randomDelayStorageWriteQueue","PROMISE_RESOLVE_TRUE","retStorage","storage","rxdbVersion","RXDB_VERSION","createStorageInstance","promiseWait","delayTimeBefore","delayTimeAfter","a","b","then","c"],"sources":["../../src/rx-storage-helper.ts"],"sourcesContent":["/**\r\n * Helper functions for accessing the RxStorage instances.\r\n */\r\n\r\nimport { overwritable } from './overwritable.ts';\r\nimport { newRxError } from './rx-error.ts';\r\nimport {\r\n getPrimaryFieldOfPrimaryKey\r\n} from './rx-schema-helper.ts';\r\nimport type {\r\n BulkWriteRow,\r\n BulkWriteRowProcessed,\r\n CategorizeBulkWriteRowsOutput,\r\n EventBulk,\r\n RxAttachmentData,\r\n RxAttachmentWriteData,\r\n RxCollection,\r\n RxDatabase,\r\n RxDocumentData,\r\n RxDocumentWriteData,\r\n RxJsonSchema,\r\n RxStorageWriteError,\r\n RxStorageChangeEvent,\r\n RxStorageInstance,\r\n RxStorageInstanceCreationParams,\r\n StringKeys,\r\n RxStorageWriteErrorConflict,\r\n RxStorageWriteErrorAttachment,\r\n RxStorage,\r\n RxStorageDefaultCheckpoint,\r\n FilledMangoQuery,\r\n RxStorageBulkWriteResponse\r\n} from './types/index.d.ts';\r\nimport {\r\n PROMISE_RESOLVE_TRUE,\r\n RXDB_VERSION,\r\n RX_META_LWT_MINIMUM,\r\n createRevision,\r\n ensureNotFalsy,\r\n flatClone,\r\n getFromMapOrCreate,\r\n lastOfArray,\r\n now,\r\n promiseWait,\r\n randomToken\r\n} from './plugins/utils/index.ts';\r\nimport { Observable, filter, map, startWith, switchMap } from 'rxjs';\r\nimport { normalizeMangoQuery, prepareQuery } from './rx-query-helper.ts';\r\nimport { HOOKS, runPluginHooks } from './hooks.ts';\r\n\r\nexport const INTERNAL_STORAGE_NAME = '_rxdb_internal';\r\nexport const RX_DATABASE_LOCAL_DOCS_STORAGE_NAME = 'rxdatabase_storage_local';\r\n\r\nexport async function getSingleDocument<RxDocType>(\r\n storageInstance: RxStorageInstance<RxDocType, any, any>,\r\n documentId: string\r\n): Promise<RxDocumentData<RxDocType> | undefined> {\r\n const results = await storageInstance.findDocumentsById([documentId], false);\r\n const doc = results[0];\r\n if (doc) {\r\n return doc;\r\n } else {\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * Writes a single document,\r\n * throws RxStorageBulkWriteError on failure\r\n */\r\nexport async function writeSingle<RxDocType>(\r\n instance: RxStorageInstance<RxDocType, any, any>,\r\n writeRow: BulkWriteRow<RxDocType>,\r\n context: string\r\n): Promise<RxDocumentData<RxDocType>> {\r\n const writeResult = await instance.bulkWrite(\r\n [writeRow],\r\n context\r\n );\r\n if (writeResult.error.length > 0) {\r\n const error = writeResult.error[0];\r\n throw error;\r\n } else {\r\n const primaryPath = getPrimaryFieldOfPrimaryKey(instance.schema.primaryKey);\r\n const success = getWrittenDocumentsFromBulkWriteResponse(primaryPath, [writeRow], writeResult);\r\n const ret = success[0];\r\n return ret;\r\n }\r\n}\r\n\r\n/**\r\n * Observe the plain document data of a single document.\r\n * Do not forget to unsubscribe.\r\n */\r\nexport function observeSingle<RxDocType>(\r\n storageInstance: RxStorageInstance<RxDocType, any, any>,\r\n documentId: string\r\n): Observable<RxDocumentData<RxDocType>> {\r\n const firstFindPromise = getSingleDocument(storageInstance, documentId);\r\n const ret = storageInstance\r\n .changeStream()\r\n .pipe(\r\n map((evBulk: any) => evBulk.events.find((ev: any) => ev.documentId === documentId)),\r\n filter((ev: any) => !!ev),\r\n map((ev: any) => Promise.resolve(ensureNotFalsy(ev).documentData)),\r\n startWith(firstFindPromise),\r\n switchMap((v: any) => v),\r\n filter((v: any) => !!v)\r\n ) as any;\r\n return ret;\r\n}\r\n\r\n/**\r\n * Checkpoints must be stackable over another.\r\n * This is required form some RxStorage implementations\r\n * like the sharding plugin, where a checkpoint only represents\r\n * the document state from some, but not all shards.\r\n */\r\nexport function stackCheckpoints<CheckpointType>(\r\n checkpoints: (CheckpointType | undefined)[]\r\n): CheckpointType {\r\n return Object.assign(\r\n {},\r\n ...checkpoints.filter(x => !!x)\r\n );\r\n}\r\n\r\nexport function throwIfIsStorageWriteError<RxDocType>(\r\n collection: RxCollection<RxDocType, any, any>,\r\n documentId: string,\r\n writeData: RxDocumentWriteData<RxDocType> | RxDocType,\r\n error: RxStorageWriteError<RxDocType> | undefined\r\n) {\r\n if (error) {\r\n if (error.status === 409) {\r\n throw newRxError('CONFLICT', {\r\n collection: collection.name,\r\n id: documentId,\r\n writeError: error,\r\n data: writeData\r\n });\r\n } else if (error.status === 422) {\r\n throw newRxError('VD2', {\r\n collection: collection.name,\r\n id: documentId,\r\n writeError: error,\r\n data: writeData\r\n });\r\n } else {\r\n throw error;\r\n }\r\n }\r\n}\r\n\r\n\r\n/**\r\n * Use a counter-based event bulk ID instead of randomToken()\r\n * for better performance. The prefix ensures uniqueness across instances.\r\n */\r\nconst EVENT_BULK_ID_PREFIX = randomToken(10);\r\nlet eventBulkCounter = 0;\r\nfunction nextEventBulkId(): string {\r\n return EVENT_BULK_ID_PREFIX + (++eventBulkCounter);\r\n}\r\n\r\n/**\r\n * Analyzes a list of BulkWriteRows and determines\r\n * which documents must be inserted, updated or deleted\r\n * and which events must be emitted and which documents cause a conflict\r\n * and must not be written.\r\n * Used as helper inside of some RxStorage implementations.\r\n * @hotPath The performance of this function is critical\r\n */\r\nexport function categorizeBulkWriteRows<RxDocType>(\r\n storageInstance: RxStorageInstance<any, any, any>,\r\n primaryPath: StringKeys<RxDocType>,\r\n /**\r\n * Current state of the documents\r\n * inside of the storage. Used to determine\r\n * which writes cause conflicts.\r\n * This must be a Map for better performance.\r\n */\r\n docsInDb: Map<RxDocumentData<RxDocType>[StringKeys<RxDocType>] | string, RxDocumentData<RxDocType>>,\r\n /**\r\n * The write rows that are passed to\r\n * RxStorageInstance().bulkWrite().\r\n */\r\n bulkWriteRows: BulkWriteRow<RxDocType>[],\r\n context: string,\r\n /**\r\n * Used by some storages for better performance.\r\n * For example when get-by-id and insert/update can run in parallel.\r\n */\r\n onInsert?: (docData: RxDocumentData<RxDocType>) => void,\r\n onUpdate?: (docData: RxDocumentData<RxDocType>) => void\r\n): CategorizeBulkWriteRowsOutput<RxDocType> {\r\n const hasAttachments = !!storageInstance.schema.attachments;\r\n const bulkInsertDocs: BulkWriteRowProcessed<RxDocType>[] = [];\r\n const bulkUpdateDocs: BulkWriteRowProcessed<RxDocType>[] = [];\r\n const errors: RxStorageWriteError<RxDocType>[] = [];\r\n const eventBulkId = nextEventBulkId();\r\n const eventBulk: EventBulk<RxStorageChangeEvent<RxDocumentData<RxDocType>>, any> = {\r\n id: eventBulkId,\r\n events: [],\r\n checkpoint: null,\r\n context\r\n };\r\n const eventBulkEvents = eventBulk.events;\r\n\r\n const attachmentsAdd: {\r\n documentId: string;\r\n attachmentId: string;\r\n attachmentData: RxAttachmentWriteData;\r\n digest: string;\r\n }[] = [];\r\n const attachmentsRemove: {\r\n documentId: string;\r\n attachmentId: string;\r\n digest: string;\r\n }[] = [];\r\n const attachmentsUpdate: {\r\n documentId: string;\r\n attachmentId: string;\r\n attachmentData: RxAttachmentWriteData;\r\n digest: string;\r\n }[] = [];\r\n\r\n const hasDocsInDb = docsInDb.size > 0;\r\n let newestRow: BulkWriteRowProcessed<RxDocType> | undefined;\r\n\r\n /**\r\n * @performance is really important in this loop!\r\n */\r\n const rowAmount = bulkWriteRows.length;\r\n for (let rowId = 0; rowId < rowAmount; rowId++) {\r\n const writeRow = bulkWriteRows[rowId];\r\n\r\n // use these variables to have less property accesses\r\n const document = writeRow.document;\r\n const previous = writeRow.previous;\r\n const docId = document[primaryPath] as string;\r\n const documentDeleted = document._deleted;\r\n const previousDeleted = previous && previous._deleted;\r\n\r\n let documentInDb: RxDocumentData<RxDocType> | undefined = undefined as any;\r\n if (hasDocsInDb) {\r\n documentInDb = docsInDb.get(docId);\r\n }\r\n let attachmentError: RxStorageWriteErrorAttachment<RxDocType> | undefined;\r\n\r\n if (!documentInDb) {\r\n /**\r\n * It is possible to insert already deleted documents,\r\n * this can happen on replication.\r\n */\r\n const insertedIsDeleted = documentDeleted ? true : false;\r\n if (hasAttachments) {\r\n Object\r\n .entries(document._attachments)\r\n .forEach(([attachmentId, attachmentData]) => {\r\n if (\r\n !(attachmentData as RxAttachmentWriteData).data\r\n ) {\r\n attachmentError = {\r\n documentId: docId,\r\n isError: true,\r\n status: 510,\r\n writeRow,\r\n attachmentId,\r\n context\r\n };\r\n errors.push(attachmentError);\r\n } else {\r\n attachmentsAdd.push({\r\n documentId: docId,\r\n attachmentId,\r\n attachmentData: attachmentData as any,\r\n digest: attachmentData.digest\r\n });\r\n }\r\n });\r\n }\r\n if (!attachmentError) {\r\n if (hasAttachments) {\r\n bulkInsertDocs.push(stripAttachmentsDataFromRow(writeRow));\r\n if (onInsert) {\r\n onInsert(document);\r\n }\r\n } else {\r\n bulkInsertDocs.push(writeRow as any);\r\n if (onInsert) {\r\n onInsert(document);\r\n }\r\n }\r\n\r\n newestRow = writeRow as any;\r\n }\r\n\r\n if (!insertedIsDeleted) {\r\n const event = {\r\n documentId: docId,\r\n operation: 'INSERT' as const,\r\n documentData: hasAttachments ? stripAttachmentsDataFromDocument(document) : document as any,\r\n previousDocumentData: hasAttachments && previous ? stripAttachmentsDataFromDocument(previous) : previous as any\r\n };\r\n eventBulkEvents.push(event);\r\n }\r\n } else {\r\n // update existing document\r\n const revInDb: string = documentInDb._rev;\r\n\r\n /**\r\n * Check for conflict\r\n */\r\n if (\r\n (\r\n !previous\r\n ) ||\r\n (\r\n !!previous &&\r\n revInDb !== previous._rev\r\n )\r\n ) {\r\n // is conflict error\r\n const err: RxStorageWriteError<RxDocType> = {\r\n isError: true,\r\n status: 409,\r\n documentId: docId,\r\n writeRow: writeRow,\r\n documentInDb,\r\n context\r\n };\r\n errors.push(err);\r\n continue;\r\n }\r\n\r\n // handle attachments data\r\n\r\n const updatedRow: BulkWriteRowProcessed<RxDocType> = hasAttachments ? stripAttachmentsDataFromRow(writeRow) : writeRow as any;\r\n if (hasAttachments) {\r\n if (documentDeleted) {\r\n /**\r\n * Deleted documents must have cleared all their attachments.\r\n */\r\n if (previous) {\r\n Object\r\n .keys(previous._attachments)\r\n .forEach(attachmentId => {\r\n attachmentsRemove.push({\r\n documentId: docId,\r\n attachmentId,\r\n digest: ensureNotFalsy(previous)._attachments[attachmentId].digest\r\n });\r\n });\r\n }\r\n } else {\r\n // first check for errors\r\n Object\r\n .entries(document._attachments)\r\n .find(([attachmentId, attachmentData]) => {\r\n const previousAttachmentData = previous ? previous._attachments[attachmentId] : undefined;\r\n if (\r\n !previousAttachmentData &&\r\n !(attachmentData as RxAttachmentWriteData).data\r\n ) {\r\n attachmentError = {\r\n documentId: docId,\r\n documentInDb: documentInDb as any,\r\n isError: true,\r\n status: 510,\r\n writeRow,\r\n attachmentId,\r\n context\r\n };\r\n }\r\n return true;\r\n });\r\n if (!attachmentError) {\r\n Object\r\n .entries(document._attachments)\r\n .forEach(([attachmentId, attachmentData]) => {\r\n const previousAttachmentData = previous ? previous._attachments[attachmentId] : undefined;\r\n if (!previousAttachmentData) {\r\n attachmentsAdd.push({\r\n documentId: docId,\r\n attachmentId,\r\n attachmentData: attachmentData as any,\r\n digest: attachmentData.digest\r\n });\r\n } else {\r\n const newDigest = updatedRow.document._attachments[attachmentId].digest;\r\n if (\r\n (attachmentData as RxAttachmentWriteData).data &&\r\n /**\r\n * Performance shortcut,\r\n * do not update the attachment data if it did not change.\r\n */\r\n previousAttachmentData.digest !== newDigest\r\n ) {\r\n attachmentsUpdate.push({\r\n documentId: docId,\r\n attachmentId,\r\n attachmentData: attachmentData as RxAttachmentWriteData,\r\n digest: attachmentData.digest\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n if (attachmentError) {\r\n errors.push(attachmentError);\r\n } else {\r\n if (hasAttachments) {\r\n bulkUpdateDocs.push(stripAttachmentsDataFromRow(updatedRow));\r\n if (onUpdate) {\r\n onUpdate(document);\r\n }\r\n } else {\r\n bulkUpdateDocs.push(updatedRow);\r\n if (onUpdate) {\r\n onUpdate(document);\r\n }\r\n }\r\n newestRow = updatedRow as any;\r\n }\r\n\r\n let eventDocumentData: RxDocumentData<RxDocType> | undefined;\r\n let previousEventDocumentData: RxDocumentData<RxDocType> | undefined = null as any;\r\n let operation: 'INSERT' | 'UPDATE' | 'DELETE';\r\n\r\n if (previousDeleted && !documentDeleted) {\r\n operation = 'INSERT';\r\n eventDocumentData = hasAttachments ? stripAttachmentsDataFromDocument(document) : document as any;\r\n } else if (previous && !previousDeleted && !documentDeleted) {\r\n operation = 'UPDATE';\r\n eventDocumentData = hasAttachments ? stripAttachmentsDataFromDocument(document) : document as any;\r\n previousEventDocumentData = previous;\r\n } else if (documentDeleted) {\r\n operation = 'DELETE';\r\n eventDocumentData = ensureNotFalsy(document) as any;\r\n previousEventDocumentData = previous;\r\n } else {\r\n throw newRxError('SNH', { args: { writeRow } });\r\n }\r\n\r\n const event = {\r\n documentId: docId,\r\n documentData: eventDocumentData as RxDocumentData<RxDocType>,\r\n previousDocumentData: previousEventDocumentData,\r\n operation: operation\r\n };\r\n eventBulkEvents.push(event);\r\n }\r\n }\r\n\r\n return {\r\n bulkInsertDocs,\r\n bulkUpdateDocs,\r\n newestRow,\r\n errors,\r\n eventBulk,\r\n attachmentsAdd,\r\n attachmentsRemove,\r\n attachmentsUpdate\r\n };\r\n}\r\n\r\nexport function stripAttachmentsDataFromRow<RxDocType>(writeRow: BulkWriteRow<RxDocType>): BulkWriteRowProcessed<RxDocType> {\r\n return {\r\n previous: writeRow.previous,\r\n document: stripAttachmentsDataFromDocument(writeRow.document)\r\n };\r\n}\r\n\r\n/**\r\n * Used in custom RxStorage implementations.\r\n */\r\nexport function attachmentWriteDataToNormalData(writeData: RxAttachmentData | RxAttachmentWriteData): RxAttachmentData {\r\n const data = (writeData as RxAttachmentWriteData).data;\r\n if (!data) {\r\n return writeData as any;\r\n }\r\n const ret: RxAttachmentData = {\r\n length: data.size,\r\n digest: writeData.digest,\r\n type: writeData.type\r\n };\r\n return ret;\r\n}\r\n\r\nexport function stripAttachmentsDataFromDocument<RxDocType>(doc: RxDocumentWriteData<RxDocType>): RxDocumentData<RxDocType> {\r\n const atts = doc._attachments;\r\n if (!atts) {\r\n return doc;\r\n }\r\n\r\n // Use for..in loop to check for any keys without creating an array via Object.keys()\r\n let hasAnyAttachment = false;\r\n for (const key in atts) {\r\n if (Object.prototype.hasOwnProperty.call(atts, key)) {\r\n hasAnyAttachment = true;\r\n break;\r\n }\r\n }\r\n if (!hasAnyAttachment) {\r\n return doc;\r\n }\r\n\r\n const useDoc: RxDocumentData<RxDocType> = flatClone(doc) as any;\r\n useDoc._attachments = {};\r\n Object\r\n .entries(doc._attachments)\r\n .forEach(([attachmentId, attachmentData]) => {\r\n useDoc._attachments[attachmentId] = attachmentWriteDataToNormalData(attachmentData);\r\n });\r\n return useDoc;\r\n}\r\n\r\n/**\r\n * Flat clone the document data\r\n * and also the _meta field.\r\n * Used many times when we want to change the meta\r\n * during replication etc.\r\n */\r\nexport function flatCloneDocWithMeta<RxDocType>(\r\n doc: RxDocumentData<RxDocType>\r\n): RxDocumentData<RxDocType> {\r\n return Object.assign(\r\n {},\r\n doc,\r\n {\r\n _meta: flatClone(doc._meta)\r\n }\r\n );\r\n}\r\n\r\nexport type WrappedRxStorageInstance<RxDocumentType, Internals, InstanceCreationOptions> = RxStorageInstance<RxDocumentType, any, InstanceCreationOptions> & {\r\n originalStorageInstance: RxStorageInstance<RxDocumentType, Internals, InstanceCreationOptions>;\r\n};\r\n\r\n/**\r\n * Wraps the normal storageInstance of a RxCollection\r\n * to ensure that all access is properly using the hooks\r\n * and other data transformations and also ensure that database.lockedRun()\r\n * is used properly.\r\n */\r\nexport function getWrappedStorageInstance<\r\n RxDocType,\r\n Internals,\r\n InstanceCreationOptions,\r\n CheckpointType\r\n>(\r\n database: RxDatabase<{}, Internals, InstanceCreationOptions, any>,\r\n storageInstance: RxStorageInstance<RxDocType, Internals, InstanceCreationOptions, CheckpointType>,\r\n /**\r\n * The original RxJsonSchema\r\n * before it was mutated by hooks.\r\n */\r\n rxJsonSchema: RxJsonSchema<RxDocumentData<RxDocType>>\r\n): WrappedRxStorageInstance<RxDocType, Internals, InstanceCreationOptions> {\r\n overwritable.deepFreezeWhenDevMode(rxJsonSchema);\r\n\r\n const primaryPath = getPrimaryFieldOfPrimaryKey(storageInstance.schema.primaryKey);\r\n\r\n const ret: WrappedRxStorageInstance<RxDocType, Internals, InstanceCreationOptions> = {\r\n originalStorageInstance: storageInstance,\r\n schema: storageInstance.schema,\r\n internals: storageInstance.internals,\r\n collectionName: storageInstance.collectionName,\r\n databaseName: storageInstance.databaseName,\r\n options: storageInstance.options,\r\n async bulkWrite(\r\n rows: BulkWriteRow<RxDocType>[],\r\n context: string\r\n ) {\r\n const databaseToken = database.token;\r\n const toStorageWriteRows: BulkWriteRow<RxDocType>[] = new Array(rows.length);\r\n /**\r\n * Use the same timestamp for all docs of this rows-set.\r\n * This improves performance because calling Date.now() inside of the now() function\r\n * is too costly.\r\n */\r\n const time = now();\r\n /**\r\n * Pre-compute the first revision string for inserts (no previous document).\r\n * This avoids repeated string concatenation and getHeightOfRevision() calls\r\n * inside the hot loop.\r\n */\r\n const firstRevision = '1-' + databaseToken;\r\n for (let index = 0; index < rows.length; index++) {\r\n const writeRow = rows[index];\r\n const previous = writeRow.previous;\r\n let document;\r\n if (previous) {\r\n document = flatCloneDocWithMeta(writeRow.document);\r\n document._meta.lwt = time;\r\n document._rev = createRevision(\r\n databaseToken,\r\n previous\r\n );\r\n } else {\r\n /**\r\n * Optimized insert path:\r\n * - Skip cloning _meta since we overwrite it entirely with { lwt: time }\r\n * - Use pre-computed firstRevision instead of calling createRevision()\r\n */\r\n document = flatClone(writeRow.document);\r\n document._meta = { lwt: time };\r\n document._rev = firstRevision;\r\n }\r\n toStorageWriteRows[index] = {\r\n document,\r\n previous\r\n };\r\n }\r\n\r\n if (HOOKS.preStorageWrite.length > 0) {\r\n runPluginHooks('preStorageWrite', {\r\n storageInstance: this.originalStorageInstance,\r\n rows: toStorageWriteRows\r\n });\r\n }\r\n\r\n const writeResult = await database.lockedRun(\r\n () => storageInstance.bulkWrite(\r\n toStorageWriteRows,\r\n context\r\n )\r\n );\r\n\r\n /**\r\n * The RxStorageInstance MUST NOT allow to insert already _deleted documents,\r\n * without sending the previous document version.\r\n * But for better developer experience, RxDB does allow to re-insert deleted documents.\r\n * We do this by automatically fixing the conflict errors for that case\r\n * by running another bulkWrite() and merging the results.\r\n * @link https://github.com/pubkey/rxdb/pull/3839\r\n */\r\n\r\n /**\r\n * Fast path: when there are no errors, skip the wrapper object creation\r\n * and error filtering to reduce allocations.\r\n */\r\n if (writeResult.error.length === 0) {\r\n BULK_WRITE_ROWS_BY_RESPONSE.set(writeResult, toStorageWriteRows);\r\n return writeResult;\r\n }\r\n\r\n const useWriteResult: typeof writeResult = {\r\n error: []\r\n };\r\n BULK_WRITE_ROWS_BY_RESPONSE.set(useWriteResult, toStorageWriteRows);\r\n\r\n // No need to check writeResult.error.length === 0 here because\r\n // the fast path above already returns early when there are no errors.\r\n const reInsertErrors: RxStorageWriteErrorConflict<RxDocType>[] = writeResult.error\r\n .filter((error) => {\r\n if (\r\n error.status === 409 &&\r\n !error.writeRow.previous &&\r\n !error.writeRow.document._deleted &&\r\n ensureNotFalsy(error.documentInDb)._deleted\r\n ) {\r\n return true;\r\n }\r\n\r\n // add the \"normal\" errors to the parent error array.\r\n useWriteResult.error.push(error);\r\n return false;\r\n }) as any;\r\n if (reInsertErrors.length > 0) {\r\n const reInsertIds = new Set<string>();\r\n const reInserts: BulkWriteRow<RxDocType>[] = reInsertErrors\r\n .map((error) => {\r\n reInsertIds.add(error.documentId);\r\n return {\r\n previous: error.documentInDb,\r\n document: Object.assign(\r\n {},\r\n error.writeRow.document,\r\n {\r\n _rev: createRevision(\r\n database.token,\r\n error.documentInDb\r\n )\r\n }\r\n )\r\n };\r\n });\r\n\r\n const subResult = await database.lockedRun(\r\n () => storageInstance.bulkWrite(\r\n reInserts,\r\n context\r\n )\r\n );\r\n\r\n\r\n useWriteResult.error = useWriteResult.error.concat(subResult.error);\r\n const successArray = getWrittenDocumentsFromBulkWriteResponse(\r\n primaryPath,\r\n toStorageWriteRows,\r\n useWriteResult,\r\n reInsertIds\r\n );\r\n const subSuccess = getWrittenDocumentsFromBulkWriteResponse(\r\n primaryPath,\r\n reInserts,\r\n subResult\r\n );\r\n successArray.push(...subSuccess);\r\n return useWriteResult;\r\n }\r\n\r\n return useWriteResult;\r\n },\r\n query(preparedQuery) {\r\n return database.lockedRun(\r\n () => storageInstance.query(preparedQuery)\r\n );\r\n },\r\n count(preparedQuery) {\r\n return database.lockedRun(\r\n () => storageInstance.count(preparedQuery)\r\n );\r\n },\r\n findDocumentsById(ids, deleted) {\r\n return database.lockedRun(\r\n () => storageInstance.findDocumentsById(ids, deleted)\r\n );\r\n },\r\n getAttachmentData(\r\n documentId: string,\r\n attachmentId: string,\r\n digest: string\r\n ) {\r\n return database.lockedRun(\r\n () => storageInstance.getAttachmentData(documentId, attachmentId, digest)\r\n );\r\n },\r\n getChangedDocumentsSince: !storageInstance.getChangedDocumentsSince ? undefined : (limit: number, checkpoint?: any) => {\r\n return database.lockedRun(\r\n () => ((storageInstance as any).getChangedDocumentsSince)(ensureNotFalsy(limit), checkpoint)\r\n );\r\n },\r\n cleanup(minDeletedTime: number) {\r\n return database.lockedRun(\r\n () => storageInstance.cleanup(minDeletedTime)\r\n );\r\n },\r\n remove() {\r\n database.storageInstances.delete(ret);\r\n return database.lockedRun(\r\n () => storageInstance.remove()\r\n );\r\n },\r\n close() {\r\n database.storageInstances.delete(ret);\r\n return database.lockedRun(\r\n () => storageInstance.close()\r\n );\r\n },\r\n changeStream() {\r\n return storageInstance.changeStream();\r\n }\r\n };\r\n\r\n database.storageInstances.add(ret);\r\n return ret;\r\n}\r\n\r\n/**\r\n * Each RxStorage implementation should\r\n * run this method at the first step of createStorageInstance()\r\n * to ensure that the configuration is correct.\r\n */\r\nexport function ensureRxStorageInstanceParamsAreCorrect(\r\n params: RxStorageInstanceCreationParams<any, any>\r\n) {\r\n if (params.schema.keyCompression) {\r\n throw newRxError('UT5', { args: { params } });\r\n }\r\n if (hasEncryption(params.schema)) {\r\n throw newRxError('UT6', { args: { params } });\r\n }\r\n if (\r\n params.schema.attachments &&\r\n params.schema.attachments.compression\r\n ) {\r\n throw newRxError('UT7', { args: { params } });\r\n }\r\n}\r\n\r\nexport function hasEncryption(jsonSchema: RxJsonSchema<any>): boolean {\r\n if (\r\n (!!jsonSchema.encrypted && jsonSchema.encrypted.length > 0) ||\r\n (jsonSchema.attachments && jsonSchema.attachments.encrypted)\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function getChangedDocumentsSinceQuery<RxDocType, CheckpointType>(\r\n storageInstance: RxStorageInstance<RxDocType, any, any, CheckpointType>,\r\n limit: number,\r\n checkpoint?: CheckpointType\r\n): FilledMangoQuery<RxDocType> {\r\n const primaryPath = getPrimaryFieldOfPrimaryKey(storageInstance.schema.primaryKey);\r\n const sinceLwt = checkpoint ? (checkpoint as unknown as RxStorageDefaultCheckpoint).lwt : RX_META_LWT_MINIMUM;\r\n const sinceId = checkpoint ? (checkpoint as unknown as RxStorageDefaultCheckpoint).id : '';\r\n return normalizeMangoQuery(storageInstance.schema, {\r\n selector: {\r\n $or: [\r\n {\r\n '_meta.lwt': {\r\n $gt: sinceLwt\r\n }\r\n },\r\n {\r\n '_meta.lwt': {\r\n $eq: sinceLwt\r\n },\r\n [primaryPath]: {\r\n $gt: checkpoint ? sinceId : ''\r\n }\r\n }\r\n ],\r\n // add this hint for better index usage\r\n '_meta.lwt': {\r\n $gte: sinceLwt\r\n }\r\n } as any,\r\n sort: [\r\n { '_meta.lwt': 'asc' },\r\n { [primaryPath]: 'asc' }\r\n ] as any,\r\n skip: 0,\r\n limit,\r\n /**\r\n * DO NOT SET A SPECIFIC INDEX HERE!\r\n * The query might be modified by some plugin\r\n * before sending it to the storage.\r\n * We can be sure that in the end the query planner\r\n * will find the best index.\r\n */\r\n // index: ['_meta.lwt', primaryPath]\r\n });\r\n}\r\n\r\nexport async function getChangedDocumentsSince<RxDocType, CheckpointType>(\r\n storageInstance: RxStorageInstance<RxDocType, any, any, CheckpointType>,\r\n limit: number,\r\n checkpoint?: CheckpointType\r\n): Promise<{\r\n documents: RxDocumentData<RxDocType>[];\r\n /**\r\n * The checkpoint contains data so that another\r\n * call to getChangedDocumentsSince() will continue\r\n * from exactly the last document that was returned before.\r\n */\r\n checkpoint: CheckpointType;\r\n}> {\r\n if (storageInstance.getChangedDocumentsSince) {\r\n return storageInstance.getChangedDocumentsSince(limit, checkpoint);\r\n }\r\n\r\n const primaryPath = getPrimaryFieldOfPrimaryKey(storageInstance.schema.primaryKey);\r\n const query = prepareQuery<RxDocumentData<any>>(\r\n storageInstance.schema,\r\n getChangedDocumentsSinceQuery(\r\n storageInstance,\r\n limit,\r\n checkpoint\r\n )\r\n );\r\n\r\n const result = await storageInstance.query(query);\r\n const documents = result.documents;\r\n const lastDoc = lastOfArray(documents);\r\n\r\n return {\r\n documents: documents,\r\n checkpoint: lastDoc ? {\r\n id: (lastDoc as any)[primaryPath],\r\n lwt: lastDoc._meta.lwt\r\n } as any : checkpoint ? checkpoint : {\r\n id: '',\r\n lwt: 0\r\n }\r\n };\r\n}\r\n\r\n\r\nconst BULK_WRITE_ROWS_BY_RESPONSE = new WeakMap<RxStorageBulkWriteResponse<any>, BulkWriteRow<any>[]>();\r\nconst BULK_WRITE_SUCCESS_MAP = new WeakMap<RxStorageBulkWriteResponse<any>, RxDocumentData<any>[]>();\r\n\r\n/**\r\n * For better performance, this is done only when accessed\r\n * because most of the time we do not need the results, only the errors.\r\n */\r\nexport function getWrittenDocumentsFromBulkWriteResponse<RxDocType>(\r\n primaryPath: string,\r\n writeRows: BulkWriteRow<RxDocType>[],\r\n response: RxStorageBulkWriteResponse<RxDocType>,\r\n reInsertIds?: Set<string>\r\n): RxDocumentData<RxDocType>[] {\r\n return getFromMapOrCreate(\r\n BULK_WRITE_SUCCESS_MAP,\r\n response,\r\n () => {\r\n const ret: RxDocumentData<RxDocType>[] = [];\r\n let realWriteRows = BULK_WRITE_ROWS_BY_RESPONSE.get(response);\r\n if (!realWriteRows) {\r\n realWriteRows = writeRows;\r\n }\r\n if (response.error.length > 0 || reInsertIds) {\r\n const errorIds = reInsertIds ? reInsertIds : new Set<string>();\r\n for (let index = 0; index < response.error.length; index++) {\r\n const error = response.error[index];\r\n errorIds.add(error.documentId);\r\n }\r\n\r\n for (let index = 0; index < realWriteRows.length; index++) {\r\n const doc = realWriteRows[index].document;\r\n if (!errorIds.has((doc as any)[primaryPath])) {\r\n ret.push(stripAttachmentsDataFromDocument(doc));\r\n }\r\n }\r\n } else {\r\n // pre-set array size for better performance\r\n ret.length = writeRows.length - response.error.length;\r\n for (let index = 0; index < realWriteRows.length; index++) {\r\n const doc = realWriteRows[index].document;\r\n ret[index] = stripAttachmentsDataFromDocument(doc);\r\n }\r\n }\r\n return ret;\r\n }\r\n );\r\n}\r\n\r\n\r\n/**\r\n * Wraps the storage and simluates\r\n * delays. Mostly used in tests.\r\n */\r\nexport function randomDelayStorage<Internals, InstanceCreationOptions>(\r\n input: {\r\n storage: RxStorage<Internals, InstanceCreationOptions>;\r\n delayTimeBefore: () => number;\r\n delayTimeAfter: () => number;\r\n }\r\n): RxStorage<Internals, InstanceCreationOptions> {\r\n /**\r\n * Ensure writes to a delay storage\r\n * are still correctly run in order.\r\n */\r\n let randomDelayStorageWriteQueue: Promise<any> = PROMISE_RESOLVE_TRUE;\r\n\r\n const retStorage: RxStorage<Internals, InstanceCreationOptions> = {\r\n name: 'random-delay-' + input.storage.name,\r\n rxdbVersion: RXDB_VERSION,\r\n async createStorageInstance(params) {\r\n await promiseWait(input.delayTimeBefore());\r\n const storageInstance = await input.storage.createStorageInstance(params);\r\n await promiseWait(input.delayTimeAfter());\r\n\r\n return {\r\n databaseName: storageInstance.databaseName,\r\n internals: storageInstance.internals,\r\n options: storageInstance.options,\r\n schema: storageInstance.schema,\r\n collectionName: storageInstance.collectionName,\r\n bulkWrite(a, b) {\r\n randomDelayStorageWriteQueue = randomDelayStorageWriteQueue.then(async () => {\r\n await promiseWait(input.delayTimeBefore());\r\n const response = await storageInstance.bulkWrite(a, b);\r\n await promiseWait(input.delayTimeAfter());\r\n return response;\r\n });\r\n const ret = randomDelayStorageWriteQueue;\r\n return ret;\r\n },\r\n async findDocumentsById(a, b) {\r\n await promiseWait(input.delayTimeBefore());\r\n const ret = await storageInstance.findDocumentsById(a, b);\r\n await promiseWait(input.delayTimeAfter());\r\n return ret;\r\n },\r\n async query(a) {\r\n await promiseWait(input.delayTimeBefore());\r\n const ret = await storageInstance.query(a);\r\n return ret;\r\n },\r\n async count(a) {\r\n await promiseWait(input.delayTimeBefore());\r\n const ret = await storageInstance.count(a);\r\n await promiseWait(input.delayTimeAfter());\r\n return ret;\r\n\r\n },\r\n async getAttachmentData(a, b, c) {\r\n await promiseWait(input.delayTimeBefore());\r\n const ret = await storageInstance.getAttachmentData(a, b, c);\r\n await promiseWait(input.delayTimeAfter());\r\n return ret;\r\n\r\n },\r\n getChangedDocumentsSince: !storageInstance.getChangedDocumentsSince ? undefined : async (a, b) => {\r\n await promiseWait(input.delayTimeBefore());\r\n const ret = await ensureNotFalsy(storageInstance.getChangedDocumentsSince)(a, b);\r\n await promiseWait(input.delayTimeAfter());\r\n return ret;\r\n\r\n },\r\n changeStream() {\r\n return storageInstance.changeStream();\r\n },\r\n async cleanup(a) {\r\n await promiseWait(input.delayTimeBefore());\r\n const ret = await storageInstance.cleanup(a);\r\n await promiseWait(input.delayTimeAfter());\r\n return ret;\r\n\r\n },\r\n async close() {\r\n await promiseWait(input.delayTimeBefore());\r\n const ret = await storageInstance.close();\r\n await promiseWait(input.delayTimeAfter());\r\n return ret;\r\n\r\n },\r\n async remove() {\r\n await promiseWait(input.delayTimeBefore());\r\n const ret = await storageInstance.remove();\r\n await promiseWait(input.delayTimeAfter());\r\n return ret;\r\n },\r\n };\r\n\r\n\r\n }\r\n };\r\n return retStorage;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AA2BA,IAAAG,OAAA,GAAAH,OAAA;AAaA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAhDA;AACA;AACA;;AAgDO,IAAMO,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,gBAAgB;AAC9C,IAAME,mCAAmC,GAAAD,OAAA,CAAAC,mCAAA,GAAG,0BAA0B;AAEtE,eAAeC,iBAAiBA,CACnCC,eAAuD,EACvDC,UAAkB,EAC4B;EAC9C,IAAMC,OAAO,GAAG,MAAMF,eAAe,CAACG,iBAAiB,CAAC,CAACF,UAAU,CAAC,EAAE,KAAK,CAAC;EAC5E,IAAMG,GAAG,GAAGF,OAAO,CAAC,CAAC,CAAC;EACtB,IAAIE,GAAG,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AAC,CAAC;UACzC,OAAOtM,GAAG;QAEd,CAAC;QACD,MAAM0J,KAAKA,CAAA,EAAG;UACV,MAAM,IAAA0C,mBAAW,EAACR,KAAK,CAACS,eAAe,CAAC,CAAC,CAAC;UAC1C,IAAMrM,GAAG,GAAG,MAAMpB,eAAe,CAAC8K,KAAK,CAAC,CAAC;UACzC,MAAM,IAAA0C,mBAAW,EAACR,KAAK,CAACU,cAAc,CAAC,CAAC,CAAC;UACzC,OAAOtM,GAAG;QAEd,CAAC;QACD,MAAMuJ,MAAMA,CAAA,EAAG;UACX,MAAM,IAAA6C,mBAAW,EAACR,KAAK,CAACS,eAAe,CAAC,CAAC,CAAC;UAC1C,IAAMrM,GAAG,GAAG,MAAMpB,eAAe,CAAC2K,MAAM,CAAC,CAAC;UAC1C,MAAM,IAAA6C,mBAAW,EAACR,KAAK,CAACU,cAAc,CAAC,CAAC,CAAC;UACzC,OAAOtM,GAAG;QACd;MACJ,CAAC;IAGL;EACJ,CAAC;EACD,OAAO+L,UAAU;AACrB","ignoreList":[]}
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BROADCAST_CHANNEL_BY_TOKEN = void 0;
7
+ exports.addRxStorageMultiInstanceSupport = addRxStorageMultiInstanceSupport;
8
+ exports.getBroadcastChannelReference = getBroadcastChannelReference;
9
+ exports.removeBroadcastChannelReference = removeBroadcastChannelReference;
10
+ var _rxjs = require("rxjs");
11
+ var _operators = require("rxjs/operators");
12
+ var _broadcastChannel = require("broadcast-channel");
13
+ /**
14
+ * When a persistent RxStorage is used in more the one JavaScript process,
15
+ * the even stream of the changestream() function must be broadcasted to the other
16
+ * RxStorageInstances of the same databaseName+collectionName.
17
+ *
18
+ * In the past this was done by RxDB but it makes more sense to do this
19
+ * at the RxStorage level so that the broadcasting etc can all happen inside of a WebWorker
20
+ * and not on the main thread.
21
+ * Also it makes it less complex to stack up different RxStorages onto each other
22
+ * like what we do with the in-memory plugin.
23
+ *
24
+ * This is intended to be used inside of createStorageInstance() of a storage.
25
+ * Do not use this if the storage anyway broadcasts the events like when using MongoDB
26
+ * or in the future W3C might introduce a way to listen to IndexedDB changes.
27
+ */
28
+
29
+ /**
30
+ * The broadcast-channel is reused by the databaseInstanceToken.
31
+ * This is required so that it is easy to simulate multi-tab usage
32
+ * in the test where different instances of the same RxDatabase must
33
+ * have different broadcast channels.
34
+ * But also it ensures that for each RxDatabase we only create a single
35
+ * broadcast channel that can even be reused in the leader election plugin.
36
+ */
37
+ var BROADCAST_CHANNEL_BY_TOKEN = exports.BROADCAST_CHANNEL_BY_TOKEN = new Map();
38
+ function getBroadcastChannelReference(storageName, databaseInstanceToken, databaseName, refObject) {
39
+ var state = BROADCAST_CHANNEL_BY_TOKEN.get(databaseInstanceToken);
40
+ if (!state) {
41
+ state = {
42
+ /**
43
+ * We have to use the databaseName instead of the databaseInstanceToken
44
+ * in the BroadcastChannel name because different instances must end with the same
45
+ * channel name to be able to broadcast messages between each other.
46
+ */
47
+ bc: new _broadcastChannel.BroadcastChannel(['RxDB:', storageName, databaseName].join('|')),
48
+ refs: new Set()
49
+ };
50
+ BROADCAST_CHANNEL_BY_TOKEN.set(databaseInstanceToken, state);
51
+ }
52
+ state.refs.add(refObject);
53
+ return state.bc;
54
+ }
55
+ function removeBroadcastChannelReference(databaseInstanceToken, refObject) {
56
+ var state = BROADCAST_CHANNEL_BY_TOKEN.get(databaseInstanceToken);
57
+ if (!state) {
58
+ return;
59
+ }
60
+ state.refs.delete(refObject);
61
+ if (state.refs.size === 0) {
62
+ BROADCAST_CHANNEL_BY_TOKEN.delete(databaseInstanceToken);
63
+ return state.bc.close();
64
+ }
65
+ }
66
+ function addRxStorageMultiInstanceSupport(storageName, instanceCreationParams, instance,
67
+ /**
68
+ * If provided, that channel will be used
69
+ * instead of an own one.
70
+ */
71
+ providedBroadcastChannel) {
72
+ if (!instanceCreationParams.multiInstance) {
73
+ return;
74
+ }
75
+ var broadcastChannel = providedBroadcastChannel ? providedBroadcastChannel : getBroadcastChannelReference(storageName, instanceCreationParams.databaseInstanceToken, instance.databaseName, instance);
76
+ var changesFromOtherInstances$ = new _rxjs.Subject();
77
+ var eventListener = msg => {
78
+ if (msg.storageName === storageName && msg.databaseName === instanceCreationParams.databaseName && msg.collectionName === instanceCreationParams.collectionName && msg.version === instanceCreationParams.schema.version) {
79
+ changesFromOtherInstances$.next(msg.eventBulk);
80
+ }
81
+ };
82
+ broadcastChannel.addEventListener('message', eventListener);
83
+ var oldChangestream$ = instance.changeStream();
84
+ var closed = false;
85
+ var sub = oldChangestream$.subscribe(eventBulk => {
86
+ if (closed) {
87
+ return;
88
+ }
89
+ broadcastChannel.postMessage({
90
+ storageName: storageName,
91
+ databaseName: instanceCreationParams.databaseName,
92
+ collectionName: instanceCreationParams.collectionName,
93
+ version: instanceCreationParams.schema.version,
94
+ eventBulk
95
+ });
96
+ });
97
+ instance.changeStream = function () {
98
+ return changesFromOtherInstances$.asObservable().pipe((0, _operators.mergeWith)(oldChangestream$));
99
+ };
100
+ var oldClose = instance.close.bind(instance);
101
+ instance.close = async function () {
102
+ closed = true;
103
+ sub.unsubscribe();
104
+ broadcastChannel.removeEventListener('message', eventListener);
105
+ if (!providedBroadcastChannel) {
106
+ await removeBroadcastChannelReference(instanceCreationParams.databaseInstanceToken, instance);
107
+ }
108
+ return oldClose();
109
+ };
110
+ var oldRemove = instance.remove.bind(instance);
111
+ instance.remove = async function () {
112
+ closed = true;
113
+ sub.unsubscribe();
114
+ broadcastChannel.removeEventListener('message', eventListener);
115
+ if (!providedBroadcastChannel) {
116
+ await removeBroadcastChannelReference(instanceCreationParams.databaseInstanceToken, instance);
117
+ }
118
+ return oldRemove();
119
+ };
120
+ }
121
+ //# sourceMappingURL=rx-storage-multiinstance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rx-storage-multiinstance.js","names":["_rxjs","require","_operators","_broadcastChannel","BROADCAST_CHANNEL_BY_TOKEN","exports","Map","getBroadcastChannelReference","storageName","databaseInstanceToken","databaseName","refObject","state","get","bc","BroadcastChannel","join","refs","Set","set","add","removeBroadcastChannelReference","delete","size","close","addRxStorageMultiInstanceSupport","instanceCreationParams","instance","providedBroadcastChannel","multiInstance","broadcastChannel","changesFromOtherInstances$","Subject","eventListener","msg","collectionName","version","schema","next","eventBulk","addEventListener","oldChangestream$","changeStream","closed","sub","subscribe","postMessage","asObservable","pipe","mergeWith","oldClose","bind","unsubscribe","removeEventListener","oldRemove","remove"],"sources":["../../src/rx-storage-multiinstance.ts"],"sourcesContent":["/**\r\n * When a persistent RxStorage is used in more the one JavaScript process,\r\n * the even stream of the changestream() function must be broadcasted to the other\r\n * RxStorageInstances of the same databaseName+collectionName.\r\n *\r\n * In the past this was done by RxDB but it makes more sense to do this\r\n * at the RxStorage level so that the broadcasting etc can all happen inside of a WebWorker\r\n * and not on the main thread.\r\n * Also it makes it less complex to stack up different RxStorages onto each other\r\n * like what we do with the in-memory plugin.\r\n *\r\n * This is intended to be used inside of createStorageInstance() of a storage.\r\n * Do not use this if the storage anyway broadcasts the events like when using MongoDB\r\n * or in the future W3C might introduce a way to listen to IndexedDB changes.\r\n */\r\n\r\nimport { Observable, Subject } from 'rxjs';\r\nimport { mergeWith } from 'rxjs/operators';\r\nimport type {\r\n EventBulk,\r\n RxStorageChangeEvent,\r\n RxStorageInstance,\r\n RxStorageInstanceCreationParams\r\n} from './types/index.d.ts';\r\n\r\nimport {\r\n BroadcastChannel\r\n} from 'broadcast-channel';\r\n\r\n/**\r\n * The broadcast-channel is reused by the databaseInstanceToken.\r\n * This is required so that it is easy to simulate multi-tab usage\r\n * in the test where different instances of the same RxDatabase must\r\n * have different broadcast channels.\r\n * But also it ensures that for each RxDatabase we only create a single\r\n * broadcast channel that can even be reused in the leader election plugin.\r\n */\r\nexport const BROADCAST_CHANNEL_BY_TOKEN: Map<string, {\r\n bc: BroadcastChannel<RxStorageMultiInstanceBroadcastType>;\r\n /**\r\n * Contains all context objects that currently use the channel.\r\n * If this becomes empty, we can close the channel\r\n */\r\n refs: Set<any>;\r\n}> = new Map();\r\n\r\n\r\nexport type RxStorageMultiInstanceBroadcastType = {\r\n storageName: string;\r\n collectionName: string;\r\n /**\r\n * collection.schema.version\r\n */\r\n version: number;\r\n databaseName: string;\r\n eventBulk: EventBulk<any, any>;\r\n};\r\n\r\nexport function getBroadcastChannelReference(\r\n storageName: string,\r\n databaseInstanceToken: string,\r\n databaseName: string,\r\n refObject: any\r\n): BroadcastChannel<RxStorageMultiInstanceBroadcastType> {\r\n let state = BROADCAST_CHANNEL_BY_TOKEN.get(databaseInstanceToken);\r\n if (!state) {\r\n state = {\r\n /**\r\n * We have to use the databaseName instead of the databaseInstanceToken\r\n * in the BroadcastChannel name because different instances must end with the same\r\n * channel name to be able to broadcast messages between each other.\r\n */\r\n bc: new BroadcastChannel(['RxDB:', storageName, databaseName].join('|')),\r\n refs: new Set<any>()\r\n };\r\n BROADCAST_CHANNEL_BY_TOKEN.set(databaseInstanceToken, state);\r\n }\r\n state.refs.add(refObject);\r\n return state.bc;\r\n}\r\n\r\nexport function removeBroadcastChannelReference(\r\n databaseInstanceToken: string,\r\n refObject: any\r\n) {\r\n const state = BROADCAST_CHANNEL_BY_TOKEN.get(databaseInstanceToken);\r\n if (!state) {\r\n return;\r\n }\r\n state.refs.delete(refObject);\r\n if (state.refs.size === 0) {\r\n BROADCAST_CHANNEL_BY_TOKEN.delete(databaseInstanceToken);\r\n return state.bc.close();\r\n }\r\n}\r\n\r\n\r\nexport function addRxStorageMultiInstanceSupport<RxDocType>(\r\n storageName: string,\r\n instanceCreationParams: RxStorageInstanceCreationParams<RxDocType, any>,\r\n instance: RxStorageInstance<RxDocType, any, any>,\r\n /**\r\n * If provided, that channel will be used\r\n * instead of an own one.\r\n */\r\n providedBroadcastChannel?: BroadcastChannel<any>\r\n) {\r\n if (!instanceCreationParams.multiInstance) {\r\n return;\r\n }\r\n\r\n type Emit = EventBulk<RxStorageChangeEvent<RxDocType>, any>;\r\n\r\n const broadcastChannel = providedBroadcastChannel ?\r\n providedBroadcastChannel :\r\n getBroadcastChannelReference(\r\n storageName,\r\n instanceCreationParams.databaseInstanceToken,\r\n instance.databaseName,\r\n instance\r\n );\r\n\r\n const changesFromOtherInstances$: Subject<Emit> = new Subject();\r\n\r\n\r\n const eventListener = (msg: RxStorageMultiInstanceBroadcastType) => {\r\n if (\r\n msg.storageName === storageName &&\r\n msg.databaseName === instanceCreationParams.databaseName &&\r\n msg.collectionName === instanceCreationParams.collectionName &&\r\n msg.version === instanceCreationParams.schema.version\r\n ) {\r\n changesFromOtherInstances$.next(msg.eventBulk);\r\n }\r\n };\r\n\r\n broadcastChannel.addEventListener('message', eventListener);\r\n\r\n const oldChangestream$ = instance.changeStream();\r\n\r\n let closed = false;\r\n const sub = oldChangestream$.subscribe((eventBulk: any) => {\r\n if (closed) {\r\n return;\r\n }\r\n broadcastChannel.postMessage({\r\n storageName: storageName,\r\n databaseName: instanceCreationParams.databaseName,\r\n collectionName: instanceCreationParams.collectionName,\r\n version: instanceCreationParams.schema.version,\r\n eventBulk\r\n });\r\n });\r\n\r\n instance.changeStream = function (): Observable<Emit> {\r\n return changesFromOtherInstances$.asObservable().pipe(\r\n mergeWith(oldChangestream$)\r\n );\r\n };\r\n\r\n const oldClose = instance.close.bind(instance);\r\n instance.close = async function () {\r\n closed = true;\r\n sub.unsubscribe();\r\n broadcastChannel.removeEventListener('message', eventListener);\r\n if (!providedBroadcastChannel) {\r\n await removeBroadcastChannelReference(\r\n instanceCreationParams.databaseInstanceToken,\r\n instance\r\n );\r\n }\r\n return oldClose();\r\n };\r\n\r\n const oldRemove = instance.remove.bind(instance);\r\n instance.remove = async function () {\r\n closed = true;\r\n sub.unsubscribe();\r\n broadcastChannel.removeEventListener('message', eventListener);\r\n if (!providedBroadcastChannel) {\r\n await removeBroadcastChannelReference(\r\n instanceCreationParams.databaseInstanceToken,\r\n instance\r\n );\r\n }\r\n return oldRemove();\r\n };\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ACD,OAAO;MAC9CG;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;EAEFZ,QAAQ,CAACe,YAAY,GAAG,YAA8B;IAClD,OAAOX,0BAA0B,CAACgB,YAAY,CAAC,CAAC,CAACC,IAAI,CACjD,IAAAC,oBAAS,EAACR,gBAAgB,CAC9B,CAAC;EACL,CAAC;EAED,IAAMS,QAAQ,GAAGvB,QAAQ,CAACH,KAAK,CAAC2B,IAAI,CAACxB,QAAQ,CAAC;EAC9CA,QAAQ,CAACH,KAAK,GAAG,kBAAkB;IAC/BmB,MAAM,GAAG,IAAI;IACbC,GAAG,CAACQ,WAAW,CAAC,CAAC;IACjBtB,gBAAgB,CAACuB,mBAAmB,CAAC,SAAS,EAAEpB,aAAa,CAAC;IAC9D,IAAI,CAACL,wBAAwB,EAAE;MAC3B,MAAMP,+BAA+B,CACjCK,sBAAsB,CAACjB,qBAAqB,EAC5CkB,QACJ,CAAC;IACL;IACA,OAAOuB,QAAQ,CAAC,CAAC;EACrB,CAAC;EAED,IAAMI,SAAS,GAAG3B,QAAQ,CAAC4B,MAAM,CAACJ,IAAI,CAACxB,QAAQ,CAAC;EAChDA,QAAQ,CAAC4B,MAAM,GAAG,kBAAkB;IAChCZ,MAAM,GAAG,IAAI;IACbC,GAAG,CAACQ,WAAW,CAAC,CAAC;IACjBtB,gBAAgB,CAACuB,mBAAmB,CAAC,SAAS,EAAEpB,aAAa,CAAC;IAC9D,IAAI,CAACL,wBAAwB,EAAE;MAC3B,MAAMP,+BAA+B,CACjCK,sBAAsB,CAACjB,qBAAqB,EAC5CkB,QACJ,CAAC;IACL;IACA,OAAO2B,SAAS,CAAC,CAAC;EACtB,CAAC;AACL","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=conflict-handling.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conflict-handling.d.js","names":[],"sources":["../../../src/types/conflict-handling.d.ts"],"sourcesContent":["import type { WithDeleted } from './rx-storage.d.ts';\r\n\r\n/**\r\n * Notice that the conflict handler input/output\r\n * does not work on RxDocumentData<RxDocType>, but only on WithDeleted<RxDocType>.\r\n * This is because the _meta attributes are meant for the local storing of document data, they not replicated\r\n * and therefore cannot be used to resolve conflicts.\r\n */\r\nexport type RxConflictHandlerInput<RxDocType> = {\r\n assumedMasterState?: WithDeleted<RxDocType>;\r\n realMasterState: WithDeleted<RxDocType>;\r\n newDocumentState: WithDeleted<RxDocType>;\r\n};\r\n\r\n/**\r\n * The conflict handler either returns:\r\n * - The resolved new document state\r\n * - A flag to identify the given 'realMasterState' and 'newDocumentState'\r\n * as being exactly equal, so no conflict has to be resolved.\r\n */\r\nexport type RxConflictHandlerOutput<RxDocType> = {\r\n isEqual: false;\r\n documentData: WithDeleted<RxDocType>;\r\n} | {\r\n isEqual: true;\r\n};\r\n\r\nexport type RxConflictHandlerOld<RxDocType> = (\r\n i: RxConflictHandlerInput<RxDocType>,\r\n context: string\r\n) => Promise<RxConflictHandlerOutput<RxDocType>>;\r\n\r\n\r\nexport type RxConflictHandler<RxDocType> = {\r\n /**\r\n * This must be non-async\r\n * because it will be called very often and must be fast.\r\n */\r\n isEqual: (\r\n a: WithDeleted<RxDocType>,\r\n b: WithDeleted<RxDocType>,\r\n context: string\r\n ) => boolean;\r\n resolve: (\r\n i: RxConflictHandlerInput<RxDocType>,\r\n context: string\r\n ) => Promise<WithDeleted<RxDocType>>;\r\n};\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=couchdb.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"couchdb.d.js","names":[],"sources":["../../../src/types/couchdb.d.ts"],"sourcesContent":["import type {\r\n MangoQuery,\r\n MangoQuerySelector,\r\n MangoQuerySortPart\r\n} from './rx-query.d.ts';\r\nimport type { BulkWriteRow } from './rx-storage.d.ts';\r\n\r\n/**\r\n * This file contains types that are CouchDB specific\r\n */\r\n\r\nexport interface CouchReplicationOptions {\r\n live?: boolean;\r\n retry?: boolean;\r\n filter?: Function;\r\n doc_ids?: string[];\r\n query_params?: any;\r\n view?: any;\r\n since?: number | 'now';\r\n heartbeat?: number;\r\n timeout?: number;\r\n batch_size?: number;\r\n batches_limit?: number;\r\n back_off_function?: Function;\r\n checkpoint?: false | 'source' | 'target';\r\n include_docs?: boolean;\r\n limit?: number;\r\n}\r\n\r\nexport interface CouchChangesOptionsBase {\r\n include_docs?: boolean;\r\n conflicts?: boolean;\r\n attachments?: boolean;\r\n binary?: boolean;\r\n descending?: boolean;\r\n since?: any;\r\n limit?: number;\r\n timeout?: any;\r\n heartbeat?: number | boolean;\r\n filter?: any;\r\n doc_ids?: string | string[];\r\n query_param?: any;\r\n view?: any;\r\n return_docs?: boolean;\r\n batch_size?: number;\r\n style?: string;\r\n}\r\n\r\nexport interface CouchChangesOptionsLive extends CouchChangesOptionsBase {\r\n live: true;\r\n}\r\n\r\nexport interface CouchChangesOptionsNonLive extends CouchChangesOptionsBase {\r\n live: false;\r\n}\r\ninterface CouchChangesOnChangeEvent {\r\n on: (eventName: string, handler: Function) => void;\r\n off: (eventName: string, handler: Function) => void;\r\n cancel(): void;\r\n}\r\n\r\nexport type CouchWriteError = {\r\n /**\r\n * status code from couchdb\r\n * 409 for 'conflict'\r\n */\r\n status: number;\r\n error: true;\r\n /**\r\n * primary key value of the errored document\r\n */\r\n id: string;\r\n};\r\n\r\n/**\r\n * possible couch-settings\r\n * @link https://couchdb.com/api.html#create_database\r\n */\r\nexport interface CouchSettings {\r\n auto_compaction?: boolean;\r\n revs_limit?: number;\r\n ajax?: any;\r\n fetch?: any;\r\n auth?: any;\r\n skip_setup?: boolean;\r\n storage?: any;\r\n size?: number;\r\n location?: string;\r\n iosDatabaseLocation?: string;\r\n}\r\n\r\n/**\r\n * options for couch.allDocs()\r\n * @link https://couchdb.com/api.html#batch_fetch\r\n */\r\nexport type CouchAllDocsOptions = {\r\n include_docs?: boolean;\r\n conflicts?: boolean;\r\n attachments?: boolean;\r\n binary?: boolean;\r\n startkey?: string;\r\n endkey?: string;\r\n inclusive_end?: boolean;\r\n limit?: number;\r\n skip?: number;\r\n descending?: boolean;\r\n key?: string;\r\n keys?: string[];\r\n update_seq?: string;\r\n\r\n // undocument but needed\r\n revs?: boolean;\r\n deleted?: 'ok';\r\n};\r\n\r\nexport type CouchSyncHandlerEvents = 'change' | 'paused' | 'active' | 'error' | 'complete';\r\nexport type CouchSyncHandler = {\r\n on(ev: CouchSyncHandlerEvents, fn: (el: any) => void): void;\r\n off(ev: CouchSyncHandlerEvents, fn: any): void;\r\n cancel(): void;\r\n};\r\n\r\nexport type CouchChangeRow = {\r\n id: string;\r\n seq: number;\r\n deleted?: true;\r\n changes: {\r\n rev: 'string';\r\n }[];\r\n /**\r\n * only if include_docs === true\r\n */\r\n doc?: CouchChangeDoc;\r\n};\r\n\r\nexport type CouchAttachmentMeta = {\r\n digest: string;\r\n content_type: string;\r\n length: number;\r\n stub: boolean;\r\n\r\n /**\r\n * 'revpos indicates the generation number (numeric prefix in the revID) at which the attachment was last altered'\r\n * @link https://github.com/couchbase/couchbase-lite-ios/issues/1200#issuecomment-206444554\r\n */\r\n revpos: number;\r\n};\r\n\r\nexport type CouchAttachmentWithData = CouchAttachmentMeta & {\r\n /**\r\n * Base64 string with the data\r\n * or directly a buffer\r\n */\r\n data: Blob;\r\n type: string;\r\n /**\r\n * If set, must be false\r\n * because we have the full data and not only a stub.\r\n */\r\n stub?: false;\r\n};\r\n\r\nexport type CouchChangeDoc = {\r\n _id: string;\r\n _rev: string;\r\n /**\r\n * True if the document is deleted.\r\n */\r\n _deleted?: boolean;\r\n _attachments: {\r\n [attachmentId: string]: CouchAttachmentMeta;\r\n };\r\n};\r\n\r\nexport type WithAttachments<Data> = Data & {\r\n /**\r\n * Intentional optional,\r\n * if the document has no attachments,\r\n * we do NOT have an empty object.\r\n */\r\n _attachments?: {\r\n [attachmentId: string]: CouchAttachmentMeta;\r\n };\r\n};\r\nexport type WithAttachmentsData<Data> = Data & {\r\n /**\r\n * Intentional optional,\r\n * if the document has no attachments,\r\n * we do NOT have an empty object.\r\n */\r\n _attachments?: {\r\n [attachmentId: string]: CouchAttachmentWithData;\r\n };\r\n};\r\n\r\n\r\nexport type WithCouchMeta<Data> = Data & {\r\n _rev: string;\r\n _attachments?: {\r\n [attachmentId: string]: CouchAttachmentMeta;\r\n };\r\n _deleted?: boolean;\r\n};\r\n\r\nexport type CouchdbChangesResult = {\r\n results: CouchChangeRow[];\r\n last_seq: number;\r\n};\r\n\r\ndeclare type Debug = {\r\n enable(what: string): void;\r\n disable(): void;\r\n};\r\n\r\nexport type CouchDbSorting = (string | string[] | { [k: string]: 'asc' | 'desc' | 1 | -1; })[];\r\n\r\n// this is not equal to the standard MangoQuery\r\n// because of different sorting\r\nexport type CouchdbQuery = MangoQuery & {\r\n sort?: CouchDbSorting;\r\n};\r\n\r\nexport type CouchBulkDocResultRow = {\r\n ok: boolean;\r\n id: string;\r\n rev: string;\r\n\r\n error?: 'conflict';\r\n reason?: string;\r\n};\r\n\r\nexport type CouchCheckpoint = {\r\n sequence: number;\r\n};\r\n\r\nexport type CouchBulkDocOptions = {\r\n new_edits?: boolean;\r\n\r\n // custom options for RxDB\r\n isDeeper?: boolean;\r\n custom?: {\r\n primaryPath: string;\r\n writeRowById: Map<string, BulkWriteRow<any>>;\r\n insertDocsById: Map<string, any>;\r\n previousDocsInDb: Map<string, any>;\r\n context: string;\r\n };\r\n};\r\n\r\nexport type CouchMangoQuery<DocType> = MangoQuery<DocType> & {\r\n index: undefined;\r\n use_index?: string;\r\n};\r\n\r\nexport type ExplainedCouchQuery<DocType> = {\r\n dbname: string;\r\n index: {\r\n ddoc: string | null;\r\n name: string; // 'idx-rxdb-index-age,_id'\r\n type: 'json';\r\n def: {\r\n fields: MangoQuerySortPart<DocType>[];\r\n };\r\n };\r\n selector: MangoQuerySelector<DocType>;\r\n range: {\r\n start_key: any[];\r\n end_key: any[];\r\n };\r\n opts: {\r\n use_index: string[];\r\n bookmark: string;\r\n sort: MangoQuerySortPart<DocType>[];\r\n conflicts: boolean;\r\n r: any[];\r\n };\r\n skip: number;\r\n};\r\n\r\nexport type CouchAllDocsResponse = {\r\n offset: number;\r\n rows: {\r\n id: string;\r\n doc: any;\r\n key: string;\r\n value: {\r\n rev: string;\r\n deleted?: boolean;\r\n };\r\n error?: 'not_found' | string;\r\n }[];\r\n total_rows: number;\r\n};\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../../src/types/index.d.ts"],"sourcesContent":["export type * from './couchdb.d.ts';\r\nexport type * from './rx-attachment.d.ts';\r\nexport type * from './rx-collection.d.ts';\r\nexport type * from './rx-database.d.ts';\r\nexport type * from './rx-database-internal-store.d.ts';\r\nexport type * from './rx-document.d.ts';\r\nexport type * from './rx-error.d.ts';\r\nexport type * from './rx-plugin.d.ts';\r\nexport type * from './rx-query.d.ts';\r\nexport type * from './rx-schema.d.ts';\r\nexport type * from './rx-storage.d.ts';\r\nexport type * from './rx-storage.interface.d.ts';\r\nexport type * from './replication-protocol.d.ts';\r\nexport type * from './conflict-handling.d.ts';\r\nexport type * from './rx-change-event.d.ts';\r\nexport type * from './query-planner.d.ts';\r\nexport type * from './util.d.ts';\r\n\r\n// plugins\r\nexport type * from './plugins/replication.d.ts';\r\nexport type * from './plugins/replication-graphql.d.ts';\r\nexport type * from './plugins/replication.d.ts';\r\nexport type * from './plugins/local-documents.d.ts';\r\nexport type * from './plugins/migration.d.ts';\r\nexport type * from './plugins/backup.d.ts';\r\nexport type * from './plugins/cleanup.d.ts';\r\nexport type * from './plugins/dexie.d.ts';\r\nexport type * from './plugins/reactivity.d.ts';\r\nexport type * from './plugins/update.d.ts';\r\nexport type * from './plugins/crdt.d.ts';\r\nexport type * from './plugins/state.d.ts';\r\nexport type * from './plugins/webmcp.d.ts';\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../../../src/types/modules/index.d.ts"],"sourcesContent":[""],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=mocha.parallel.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mocha.parallel.d.js","names":[],"sources":["../../../../src/types/modules/mocha.parallel.d.ts"],"sourcesContent":["declare module 'mocha.parallel';\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=backup.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backup.d.js","names":[],"sources":["../../../../src/types/plugins/backup.d.ts"],"sourcesContent":["export type BackupOptions = {\r\n live: boolean;\r\n directory: string;\r\n /**\r\n * If true,\r\n * attachments will also be saved\r\n */\r\n attachments?: boolean;\r\n /**\r\n * How many documents can be processed in one batch\r\n * [default=10]\r\n */\r\n batchSize?: number;\r\n /**\r\n * If not set, all collections will be backed up.\r\n */\r\n collections?: string[];\r\n};\r\n\r\nexport type BackupMetaFileContent = {\r\n createdAt: number;\r\n updatedAt: number;\r\n collectionStates: {\r\n [collectionName: string]: {\r\n checkpoint?: any;\r\n };\r\n };\r\n};\r\n\r\nexport type RxBackupWriteEvent = {\r\n collectionName: string;\r\n documentId: string;\r\n files: string[];\r\n deleted: boolean;\r\n};\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=cleanup.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.d.js","names":[],"sources":["../../../../src/types/plugins/cleanup.d.ts"],"sourcesContent":["export type RxCleanupPolicy = {\r\n /**\r\n * The minimum time in milliseconds\r\n * of how long a document must have been deleted\r\n * until it is purged by the cleanup.\r\n * This should be higher then the time you expect\r\n * your user to be offline for.\r\n * If this is too low, deleted documents might not\r\n * replicate their deletion state.\r\n */\r\n minimumDeletedTime: number;\r\n /**\r\n * The minimum amount of time that the RxCollection must have existed.\r\n * This ensures that at the initial page load, more important\r\n * tasks are not slowed down because a cleanup process is running.\r\n */\r\n minimumCollectionAge: number;\r\n /**\r\n * After the initial cleanup is done,\r\n * a new cleanup is started after [runEach] milliseconds\r\n */\r\n runEach: number;\r\n /**\r\n * If set to true,\r\n * RxDB will await all running replications\r\n * to not have a replication cycle running.\r\n * This ensures we do not remove deleted documents\r\n * when they might not have already been replicated.\r\n */\r\n awaitReplicationsInSync: boolean;\r\n /**\r\n * If true, it will only start the cleanup\r\n * when the current instance is also the leader.\r\n * This ensures that when RxDB is used in multiInstance mode,\r\n * only one instance will start the cleanup.\r\n */\r\n waitForLeadership: boolean;\r\n};\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=crdt.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crdt.d.js","names":[],"sources":["../../../../src/types/plugins/crdt.d.ts"],"sourcesContent":["import type { MangoQuerySelector } from '../rx-query.d.ts';\r\nimport type { StringKeys } from '../util.d.ts';\r\nimport type { UpdateQuery } from './update.d.ts';\r\n\r\n\r\nexport type CRDTEntry<RxDocType> = {\r\n selector?: MangoQuerySelector<RxDocType>;\r\n ifMatch?: UpdateQuery<RxDocType>;\r\n ifNotMatch?: UpdateQuery<RxDocType>;\r\n};\r\n\r\n/**\r\n * Options for the crdt plugin.\r\n * We set these in the schema because changing them\r\n * is not possible on the fly because it would\r\n * close the document state in an unpredictable way.\r\n */\r\nexport type CRDTSchemaOptions<RxDocType> = {\r\n /**\r\n * Determines which field of the document must be used\r\n * to store the crdt operations.\r\n * The given field must exist with the content of \"CRDT_FIELD_SCHEMA\" in the\r\n * properties part of your schema.\r\n */\r\n field: StringKeys<RxDocType> | string;\r\n\r\n /**\r\n * After BOTH of the limits\r\n * maxOperations/maxTTL is reached,\r\n * the document will clean up the stored operations\r\n * and merged them together to ensure\r\n * that not too many operations are stored which could slow down the\r\n * database operations.\r\n */\r\n // TODO not implemented yet, make a pull request if you need that.\r\n // maxOperations: number;\r\n // maxTTL: number;\r\n};\r\n\r\n\r\nexport type CRDTOperation<RxDocType> = {\r\n body: CRDTEntry<RxDocType>[];\r\n /**\r\n * A string to uniquely represent the creator\r\n * of this operation.\r\n * Mostly you would use the RxDatabase().storageToken().\r\n */\r\n creator: string;\r\n\r\n /**\r\n * Unix time in milliseconds\r\n * that determines when the operation was created.\r\n * Used to properly clean up old operations.\r\n */\r\n time: number;\r\n};\r\n\r\n\r\nexport type CRDTDocumentField<RxDocType> = {\r\n /**\r\n * An array with arrays of CRDT operations.\r\n * The index of the top level array is equal\r\n * to the revision height where the operations\r\n * belong to.\r\n * Sorted by revision height ascending.\r\n * If we have a conflict and we need a rebuild,\r\n * the operations will be run in the revision height\r\n * sort order to make everything deterministic.\r\n */\r\n operations: CRDTOperation<RxDocType>[][];\r\n\r\n /**\r\n * A hash to uniquely define the whole operations state.\r\n */\r\n hash: string;\r\n};\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=dexie.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dexie.d.js","names":[],"sources":["../../../../src/types/plugins/dexie.d.ts"],"sourcesContent":["import type {\r\n Dexie,\r\n DexieOptions,\r\n Table as DexieTable\r\n} from 'dexie';\r\nimport type { MaybePromise } from '../util';\r\n\r\nexport type DexieSettings = DexieOptions & {\r\n onCreate?: (db: Dexie, dbName: string) => MaybePromise<void>;\r\n};\r\n\r\n/**\r\n * The internals is a Promise that resolves\r\n * when the database has fully opened\r\n * and Dexie.on.ready was called\r\n * @link https://dexie.org/docs/Dexie/Dexie.on.ready\r\n *\r\n */\r\nexport type DexieStorageInternals = Promise<{\r\n dexieDb: Dexie;\r\n /**\r\n * Contains all normal documents. Deleted ones and non-deleted ones.\r\n */\r\n dexieTable: DexieTable;\r\n // contains the attachments data\r\n dexieAttachmentsTable: DexieTable;\r\n\r\n // these must be transformed because indexeddb does not allow boolean indexing\r\n booleanIndexes: string[];\r\n}>;\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=local-documents.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-documents.d.js","names":[],"sources":["../../../../src/types/plugins/local-documents.d.ts"],"sourcesContent":["import type { Observable } from 'rxjs';\r\nimport type { DocumentCache } from '../../doc-cache.d.ts';\r\nimport type { IncrementalWriteQueue } from '../../incremental-write.d.ts';\r\nimport type { RxCollection } from '../rx-collection.d.ts';\r\nimport type { RxDatabase } from '../rx-database.d.ts';\r\nimport type { RxDocumentBase } from '../rx-document.d.ts';\r\nimport type { RxStorageInstance } from '../rx-storage.interface.d.ts';\r\nimport type { Override } from '../util.d.ts';\r\n\r\nexport type LocalDocumentParent = RxDatabase | RxCollection;\r\nexport type LocalDocumentState = {\r\n database: RxDatabase;\r\n parent: LocalDocumentParent;\r\n storageInstance: RxStorageInstance<RxLocalDocumentData, any, any>;\r\n docCache: DocumentCache<RxLocalDocumentData, {}>;\r\n incrementalWriteQueue: IncrementalWriteQueue<RxLocalDocumentData>;\r\n};\r\nexport type RxLocalDocumentData<\r\n Data = {\r\n // local documents are schemaless and contain any data\r\n [key: string]: any;\r\n }\r\n> = {\r\n id: string;\r\n data: Data;\r\n};\r\n\r\ndeclare type LocalDocumentModifyFunction<Data> = (\r\n doc: Data,\r\n rxLocalDocument: RxLocalDocument<any, Data>\r\n) => Data | Promise<Data>;\r\n\r\n\r\nexport declare type RxLocalDocument<Parent, Data = any, Reactivity = unknown> = Override<\r\n RxDocumentBase<RxLocalDocumentData<Data>, {}, Reactivity>,\r\n {\r\n readonly parent: Parent;\r\n isLocal(): true;\r\n\r\n /**\r\n * Because local documents store their relevant data inside of the 'data' property,\r\n * the incremental mutation methods are changed a bit to only allow to change parts of the data property.\r\n */\r\n incrementalModify(mutationFunction: LocalDocumentModifyFunction<Data>): Promise<RxLocalDocument<Parent, Data, Reactivity>>;\r\n incrementalPatch(patch: Partial<Data>): Promise<RxLocalDocument<Parent, Data, Reactivity>>;\r\n\r\n $: Observable<RxLocalDocument<Parent, Data, Reactivity>>;\r\n }\r\n>;\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=migration.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.d.js","names":[],"sources":["../../../../src/types/plugins/migration.d.ts"],"sourcesContent":["import type {\r\n WithAttachments\r\n} from '../couchdb.d.ts';\r\nimport type { RxCollection } from '../rx-collection.d.ts';\r\nimport type { MaybePromise } from '../util.d.ts';\r\n\r\nexport type MigrationStrategy<DocData = any> = (\r\n oldDocumentData: WithAttachments<DocData>,\r\n collection: RxCollection\r\n) => MaybePromise<WithAttachments<DocData> | null>;\r\n\r\nexport type MigrationStrategies<DocData = any> = {\r\n [toVersion: number]: MigrationStrategy<DocData>;\r\n};\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=reactivity.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactivity.d.js","names":[],"sources":["../../../../src/types/plugins/reactivity.d.ts"],"sourcesContent":["import type { Observable } from 'rxjs';\r\nimport type { RxDatabase } from '../rx-database';\r\n\r\n/**\r\n * Base interface for encoding Higher Kinded Types (HKT) in TypeScript.\r\n * Reactivity plugins extend this to define a type-level function\r\n * that maps a data type T to a reactive container (e.g. Signal<T>, Ref<T>).\r\n *\r\n * @example\r\n * // Preact signals plugin defines:\r\n * interface PreactSignalReactivityLambda extends ReactivityLambda {\r\n * readonly _result: Signal<this['_data']>;\r\n * }\r\n */\r\nexport interface ReactivityLambda {\r\n readonly _data: unknown;\r\n readonly _result: unknown;\r\n}\r\n\r\n/**\r\n * Applies a reactivity type-level function to a data type.\r\n * Given a ReactivityLambda and a data type T, returns the concrete\r\n * reactive container type (e.g. Signal<T>, Ref<T>).\r\n *\r\n * For backwards compatibility, if the Reactivity parameter is not\r\n * a ReactivityLambda (e.g. it is `Signal<any>` directly), it is\r\n * returned as-is.\r\n */\r\nexport type Reactified<Reactivity, T> =\r\n Reactivity extends ReactivityLambda\r\n ? (Reactivity & { readonly _data: T })['_result']\r\n : Reactivity;\r\n\r\nexport interface RxReactivityFactory<Reactivity> {\r\n fromObservable<Data, InitData>(\r\n obs: Observable<Data>,\r\n initialValue: InitData,\r\n rxDatabase: RxDatabase<any, any, any, Reactivity>\r\n ): Reactified<Reactivity, Data | InitData>;\r\n}\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=replication-graphql.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replication-graphql.d.js","names":[],"sources":["../../../../src/types/plugins/replication-graphql.d.ts"],"sourcesContent":["import { ClientOptions } from 'graphql-ws';\r\nimport { RxReplicationWriteToMasterRow } from '../replication-protocol.ts';\r\nimport { ById, MaybePromise } from '../util.ts';\r\nimport {\r\n ReplicationOptions,\r\n ReplicationPullHandlerResult,\r\n ReplicationPullOptions,\r\n ReplicationPushHandlerResult,\r\n ReplicationPushOptions\r\n} from './replication.ts';\r\n\r\nexport interface RxGraphQLReplicationQueryBuilderResponseObject {\r\n query: string;\r\n operationName?: string;\r\n variables: any;\r\n}\r\n\r\nexport type RxGraphQLReplicationClientState = {\r\n headers: ById<string>;\r\n credentials: RequestCredentials | undefined;\r\n};\r\n\r\nexport type RxGraphQLReplicationQueryBuilderResponse =\r\n RxGraphQLReplicationQueryBuilderResponseObject |\r\n Promise<RxGraphQLReplicationQueryBuilderResponseObject>;\r\nexport type RxGraphQLReplicationPushQueryBuilder = (\r\n // typed 'any' because the data might be modified by the push.modifier.\r\n rows: RxReplicationWriteToMasterRow<any>[]\r\n) => RxGraphQLReplicationQueryBuilderResponse;\r\n\r\nexport type RxGraphQLPullWSOptions = Omit<ClientOptions, 'url' | 'shouldRetry' | 'webSocketImpl'>;\r\n\r\nexport type RxGraphQLReplicationPullQueryBuilder<CheckpointType> = (\r\n latestPulledCheckpoint: CheckpointType | undefined,\r\n limit: number\r\n) => RxGraphQLReplicationQueryBuilderResponse;\r\nexport type GraphQLSyncPullOptions<RxDocType, CheckpointType> = Omit<\r\n ReplicationPullOptions<RxDocType, CheckpointType>,\r\n 'handler' | 'stream$'\r\n> & {\r\n queryBuilder: RxGraphQLReplicationPullQueryBuilder<CheckpointType>;\r\n streamQueryBuilder?: RxGraphQLReplicationPullStreamQueryBuilder;\r\n /**\r\n * The path to the data in the GraphQL response.\r\n * If set, the data will be taken from the response at this path.\r\n * @example ['data', 'foo', 'bar'] or 'data.foo.bar'\r\n */\r\n dataPath?: string | string[];\r\n responseModifier?: RxGraphQLPullResponseModifier<RxDocType, CheckpointType>;\r\n includeWsHeaders?: boolean;\r\n wsOptions?: RxGraphQLPullWSOptions;\r\n};\r\n\r\nexport type RxGraphQLPullResponseModifier<RxDocType, CheckpointType> = (\r\n // the exact response that was returned from the server\r\n plainResponse: ReplicationPullHandlerResult<RxDocType, CheckpointType> | any,\r\n // either 'handler' if it came from the pull.handler, or 'stream' if it came from the pull.stream\r\n origin: 'handler' | 'stream',\r\n requestCheckpoint?: CheckpointType\r\n) => MaybePromise<ReplicationPullHandlerResult<RxDocType, CheckpointType>>;\r\n\r\nexport type RxGraphQLPushResponseModifier<RxDocType> = (\r\n // the exact response that was returned from the server\r\n plainResponse: ReplicationPushHandlerResult<RxDocType> | any,\r\n) => MaybePromise<ReplicationPushHandlerResult<RxDocType>>;\r\n\r\nexport type RxGraphQLReplicationPullStreamQueryBuilder = (headers: { [k: string]: string; }) => RxGraphQLReplicationQueryBuilderResponse;\r\n\r\nexport type GraphQLSyncPushOptions<RxDocType> = Omit<\r\n ReplicationPushOptions<RxDocType>,\r\n 'handler'\r\n> & {\r\n queryBuilder: RxGraphQLReplicationPushQueryBuilder;\r\n /**\r\n * The path to the data in the GraphQL response.\r\n * If set, the data will be taken from the response at this path.\r\n * @example ['data', 'foo', 'bar'] or 'data.foo.bar'\r\n */\r\n dataPath?: string | string[];\r\n responseModifier?: RxGraphQLPushResponseModifier<RxDocType>;\r\n};\r\n\r\nexport type GraphQLServerUrl = {\r\n http?: string;\r\n ws?: string;\r\n};\r\n\r\nexport type SyncOptionsGraphQL<RxDocType, CheckpointType> = Omit<\r\n ReplicationOptions<RxDocType, CheckpointType>,\r\n 'pull' | 'push'\r\n> & {\r\n url: GraphQLServerUrl;\r\n fetch?: WindowOrWorkerGlobalScope['fetch'];\r\n headers?: { [k: string]: string; }; // send with all requests to the endpoint\r\n credentials?: RequestCredentials;\r\n pull?: GraphQLSyncPullOptions<RxDocType, CheckpointType>;\r\n push?: GraphQLSyncPushOptions<RxDocType>;\r\n};\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=replication.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replication.d.js","names":[],"sources":["../../../../src/types/plugins/replication.d.ts"],"sourcesContent":["import { Observable } from 'rxjs';\r\nimport type {\r\n InternalStoreDocType,\r\n MaybePromise,\r\n RxCollection,\r\n RxDocumentData,\r\n RxReplicationPullStreamItem,\r\n RxReplicationWriteToMasterRow,\r\n WithDeleted\r\n} from '../../types/index.d.ts';\r\n\r\n\r\nexport type InternalStoreReplicationPushDocType = InternalStoreDocType<{\r\n checkpoint: any;\r\n}>;\r\nexport type InternalStoreReplicationPullDocType<RxDocType> = InternalStoreDocType<{\r\n lastPulledDoc: RxDocumentData<RxDocType>;\r\n}>;\r\n\r\nexport type ReplicationPullHandlerResult<RxDocType, CheckpointType> = {\r\n checkpoint: CheckpointType | undefined;\r\n documents: WithDeleted<RxDocType>[];\r\n};\r\n\r\nexport type ReplicationPushHandlerResult<RxDocType> = RxDocType[];\r\n\r\nexport type ReplicationPullHandler<RxDocType, CheckpointType> = (\r\n lastPulledCheckpoint: CheckpointType | undefined,\r\n batchSize: number\r\n) => Promise<ReplicationPullHandlerResult<RxDocType, CheckpointType>>;\r\n\r\nexport type ReplicationPullOptions<RxDocType, CheckpointType> = {\r\n /**\r\n * A handler that pulls the new remote changes\r\n * from the remote actor.\r\n */\r\n handler: ReplicationPullHandler<RxDocType, CheckpointType>;\r\n\r\n\r\n /**\r\n * An observable that streams all document changes\r\n * that are happening on the backend.\r\n * Emits an document bulk together with the latest checkpoint of these documents.\r\n * Also can emit a 'RESYNC' event when the client was offline and is online again.\r\n *\r\n * Not required for non-live replication.\r\n */\r\n stream$?: Observable<RxReplicationPullStreamItem<RxDocType, CheckpointType>>;\r\n\r\n /**\r\n * Amount of documents that the remote will send in one request.\r\n * If the response contains less then [batchSize] documents,\r\n * RxDB will assume there are no more changes on the backend\r\n * that are not replicated.\r\n * [default=100]\r\n */\r\n batchSize?: number;\r\n\r\n /**\r\n * A modifier that runs on all documents that are pulled,\r\n * before they are used by RxDB.\r\n * - the ones from the pull handler\r\n * - the ones from the pull stream\r\n */\r\n modifier?: (docData: any) => MaybePromise<WithDeleted<RxDocType>>;\r\n\r\n /**\r\n * If set, the push replication\r\n * will start from the given checkpoint.\r\n */\r\n initialCheckpoint?: any;\r\n};\r\n\r\n/**\r\n * Gets the new write rows.\r\n * Returns the current master state of all conflicting writes,\r\n * so that they can be resolved on the client.\r\n */\r\nexport type ReplicationPushHandler<RxDocType> = (\r\n docs: RxReplicationWriteToMasterRow<RxDocType>[]\r\n) => Promise<WithDeleted<RxDocType>[]>;\r\nexport type ReplicationPushOptions<RxDocType> = {\r\n /**\r\n * A handler that sends the new local changes\r\n * to the remote actor.\r\n * On error, all documents are send again at later time.\r\n */\r\n handler: ReplicationPushHandler<RxDocType>;\r\n\r\n\r\n /**\r\n * A modifier that runs on all pushed documents before\r\n * they are send into the push handler.\r\n */\r\n modifier?: (docData: WithDeleted<RxDocType>) => MaybePromise<any | null>;\r\n\r\n /**\r\n * How many local changes to process at once.\r\n */\r\n batchSize?: number;\r\n\r\n /**\r\n * If set, the push replication\r\n * will start from the given checkpoint.\r\n */\r\n initialCheckpoint?: any;\r\n\r\n /**\r\n * When a local write happens, normally the replication will directly try to persist\r\n * the change upstream.\r\n *\r\n * By providing a function here that returns a promise, the replication will wait until\r\n * that promise resolves before running the next upstream persist cycle. This can be\r\n * used to batch writes across multiple collections into a single push or to defer\r\n * pushing until the CPU is idle (e.g. via requestIdleCallback).\r\n *\r\n * NOTE: The longer you wait here, the higher the risk of losing writes if the\r\n * replication is closed unexpectedly.\r\n */\r\n waitBeforePersist?: () => Promise<any>;\r\n};\r\n\r\n\r\nexport type ReplicationOptions<RxDocType, CheckpointType> = {\r\n /**\r\n * An id for the replication to identify it\r\n * and so that RxDB is able to resume the replication on app reload.\r\n * If you replicate with a remote server, it is recommended to put the\r\n * server url into the replicationIdentifier.\r\n * Like 'my-rest-replication-to-https://example.com/api/sync'\r\n */\r\n replicationIdentifier: string;\r\n collection: RxCollection<RxDocType, unknown, unknown, unknown>;\r\n /**\r\n * Define a custom property that is used\r\n * to flag a document as being deleted.\r\n * @default '_deleted'\r\n */\r\n deletedField?: '_deleted' | string;\r\n pull?: ReplicationPullOptions<RxDocType, CheckpointType>;\r\n push?: ReplicationPushOptions<RxDocType>;\r\n /**\r\n * By default it will do an ongoing realtime replication.\r\n * By settings live: false the replication will run once until the local state\r\n * is in sync with the remote state, then it will cancel itself.\r\n * @default true\r\n */\r\n live?: boolean;\r\n /**\r\n * Time in milliseconds after when a failed backend request\r\n * has to be retried.\r\n * This time will be skipped if a offline->online switch is detected\r\n * via `navigator.onLine`\r\n * @default 5000\r\n */\r\n retryTime?: number;\r\n /**\r\n * When multiInstance is `true`, like when you use RxDB in multiple browser tabs,\r\n * the replication should always run in only one of the open browser tabs.\r\n * If waitForLeadership is `true`, it will wait until the current instance is leader.\r\n * If waitForLeadership is `false`, it will start replicating, even if it is not leader.\r\n * @default true\r\n */\r\n waitForLeadership?: boolean;\r\n\r\n toggleOnDocumentVisible?: boolean;\r\n\r\n /**\r\n * If this is set to `false`,\r\n * the replication will not start automatically\r\n * but will wait for `replicationState.start()` being called.\r\n * @default true\r\n */\r\n autoStart?: boolean;\r\n};\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=state.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.js","names":[],"sources":["../../../../src/types/plugins/state.d.ts"],"sourcesContent":["import type { RxStateBase } from '../../plugins/state/rx-state';\r\nimport type { ExtendObservables, ExtendReactivity } from '../rx-document';\r\n\r\nexport type RxState<T, Reactivity = unknown> = RxStateBase<T, Reactivity> & T & ExtendObservables<Required<T>> & ExtendReactivity<Required<T>, Reactivity>;\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=update.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.js","names":[],"sources":["../../../../src/types/plugins/update.d.ts"],"sourcesContent":["import type { AnyKeys, AnyObject } from '../util.d.ts';\r\n\r\n// import type {\r\n// UpdateExpression\r\n// } from 'mingo/updater';\r\n\r\n/**\r\n * We use an own type here, copied from mongoose\r\n * @link https://github.com/Automattic/mongoose/blob/eb292d2c4cc98ee315f118d6199a83938f06d901/types/index.d.ts#L466\r\n * When the mingo library implements a schema-based type for UpdateExpression, we can use these typings instead.\r\n */\r\nexport type UpdateQuery<TSchema> = {\r\n $min?: AnyKeys<TSchema> & AnyObject;\r\n $max?: AnyKeys<TSchema> & AnyObject;\r\n $inc?: AnyKeys<TSchema> & AnyObject;\r\n $set?: AnyKeys<TSchema> & AnyObject;\r\n $unset?: AnyKeys<TSchema> & AnyObject;\r\n $push?: AnyKeys<TSchema> & AnyObject;\r\n $addToSet?: AnyKeys<TSchema> & AnyObject;\r\n $pop?: AnyKeys<TSchema> & AnyObject;\r\n $pullAll?: AnyKeys<TSchema> & AnyObject;\r\n $rename?: Record<string, string>;\r\n};\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=webmcp.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webmcp.d.js","names":[],"sources":["../../../../src/types/plugins/webmcp.d.ts"],"sourcesContent":["import type {\r\n RxDatabase,\r\n RxCollection\r\n} from '../../index.d.ts';\r\n\r\nimport type { Observable } from 'rxjs';\r\n\r\nexport interface WebMCPOptions {\r\n /**\r\n * If true, modifier tools (insert, upsert, delete) will not be registered\r\n * for this database or collection.\r\n * @default false\r\n */\r\n readOnly?: boolean;\r\n /**\r\n * If true, delays queries until all replication states of the collection\r\n * are in sync.\r\n * @default true\r\n */\r\n awaitReplicationsInSync?: boolean;\r\n}\r\n\r\nexport interface WebMCPLogEvent {\r\n collectionName: string;\r\n databaseName: string;\r\n toolName: string;\r\n args: any;\r\n result?: any;\r\n error?: any;\r\n}\r\n\r\nexport interface RxWebMCPPlugin {\r\n name: 'webmcp';\r\n rxdb: true;\r\n prototypes: {\r\n RxDatabase: (proto: any) => void;\r\n RxCollection: (proto: any) => void;\r\n };\r\n hooks?: any;\r\n}\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=query-planner.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-planner.d.js","names":[],"sources":["../../../src/types/query-planner.d.ts"],"sourcesContent":["export type RxQueryPlanKey = string | number | undefined;\r\n\r\nexport type RxQueryPlanerOpts = {\r\n startKey: RxQueryPlanKey;\r\n endKey: RxQueryPlanKey;\r\n /**\r\n * True if the first matching document\r\n * must also be included into the result set.\r\n */\r\n inclusiveStart: boolean;\r\n /**\r\n * True if the last matching document\r\n * must also be included into the result set.\r\n */\r\n inclusiveEnd: boolean;\r\n};\r\n\r\nexport type RxQueryPlan = {\r\n index: string[];\r\n /**\r\n * If the index does not match the sort params,\r\n * we have to resort the query results manually\r\n * after fetching them from the index.\r\n */\r\n sortSatisfiedByIndex: boolean;\r\n\r\n /**\r\n * If the whole selector matching is satisfied\r\n * by the index, we do not have to run a does-document-data-match-query\r\n * stuff.\r\n */\r\n selectorSatisfiedByIndex: boolean;\r\n\r\n startKeys: RxQueryPlanKey[];\r\n endKeys: RxQueryPlanKey[];\r\n /**\r\n * True if the first matching document\r\n * must also be included into the result set.\r\n */\r\n inclusiveStart: boolean;\r\n /**\r\n * True if the last matching document\r\n * must also be included into the result set.\r\n */\r\n inclusiveEnd: boolean;\r\n\r\n};\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=replication-protocol.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replication-protocol.d.js","names":[],"sources":["../../../src/types/replication-protocol.d.ts"],"sourcesContent":["import { BehaviorSubject, Observable, Subject } from 'rxjs';\r\nimport type {\r\n RxConflictHandler,\r\n RxConflictHandlerInput\r\n} from './conflict-handling.d.ts';\r\nimport type { RxError, RxTypeError } from './rx-error.d.ts';\r\nimport type {\r\n BulkWriteRow,\r\n RxDocumentData,\r\n WithDeleted,\r\n WithDeletedAndAttachments\r\n} from './rx-storage.d.ts';\r\nimport type {\r\n RxStorageInstance\r\n} from './rx-storage.interface.d.ts';\r\nimport type { HashFunction } from './util.d.ts';\r\n\r\nexport type RxStorageReplicationMeta<RxDocType, CheckpointType> = {\r\n\r\n /**\r\n * Combined primary key consisting\r\n * of: [replicationId, itemId, isCheckpoint]\r\n * so that the same RxStorageInstance\r\n * can be used for multiple replication states.\r\n */\r\n id: string;\r\n\r\n /**\r\n * Either the document primaryKey\r\n * or the id of the replication checkpoint.\r\n */\r\n itemId: string;\r\n\r\n /**\r\n * True if the doc data is about a checkpoint,\r\n * False if it is about a document state from the master.\r\n * Stored as a string so it can be used\r\n * in the combined primary key 'id'\r\n */\r\n isCheckpoint: '0' | '1';\r\n checkpointData?: CheckpointType;\r\n\r\n /**\r\n * the document state of the master\r\n * only set if not checkpoint.\r\n */\r\n docData?: RxDocType | RxDocumentData<RxDocType> | any;\r\n /**\r\n * If the current assumed master was written while\r\n * resolving a conflict, this field contains\r\n * the revision of the conflict-solution that\r\n * is stored in the forkInstance.\r\n */\r\n isResolvedConflict?: string;\r\n};\r\n\r\nexport type RxReplicationWriteToMasterRow<RxDocType> = {\r\n assumedMasterState?: WithDeletedAndAttachments<RxDocType>;\r\n newDocumentState: WithDeletedAndAttachments<RxDocType>;\r\n};\r\n\r\n\r\nexport type DocumentsWithCheckpoint<RxDocType, CheckpointType> = {\r\n documents: WithDeletedAndAttachments<RxDocType>[];\r\n checkpoint: CheckpointType;\r\n};\r\n\r\n\r\nexport type RxReplicationPullStreamItem<RxDocType, MasterCheckpointType> = DocumentsWithCheckpoint<RxDocType, MasterCheckpointType> |\r\n /**\r\n * Emit this when the masterChangeStream$ might have missed out\r\n * some events because the fork lost the connection to the master.\r\n * Like when the user went offline and reconnects.\r\n */\r\n 'RESYNC';\r\n\r\n/**\r\n * The replication handler contains all logic\r\n * that is required by the replication protocol\r\n * to interact with the master instance.\r\n * This is an abstraction so that we can use different\r\n * handlers for GraphQL, REST or any other transportation layer.\r\n * Even a RxStorageInstance can be wrapped in a way to represent a replication handler.\r\n *\r\n * The RxStorage instance of the master branch that is\r\n * replicated with the fork branch.\r\n * The replication algorithm is made to make\r\n * as less writes on the master as possible.\r\n * The master instance is always 'the truth' which\r\n * does never contain conflicting document states.\r\n * All conflicts are handled on the fork branch\r\n * before being replicated to the master.\r\n */\r\nexport type RxReplicationHandler<RxDocType, MasterCheckpointType> = {\r\n masterChangeStream$: Observable<RxReplicationPullStreamItem<RxDocType, MasterCheckpointType>>;\r\n masterChangesSince(\r\n checkpoint: MasterCheckpointType | undefined,\r\n batchSize: number\r\n ): Promise<DocumentsWithCheckpoint<RxDocType, MasterCheckpointType | undefined>>;\r\n /**\r\n * Writes the fork changes to the master.\r\n * Only returns the conflicts if there are any.\r\n * (otherwise returns an empty array.)\r\n */\r\n masterWrite(\r\n rows: RxReplicationWriteToMasterRow<RxDocType>[]\r\n ): Promise<WithDeleted<RxDocType>[]>;\r\n};\r\n\r\nexport type RxStorageInstanceReplicationInput<RxDocType> = {\r\n /**\r\n * A string that uniquely identifies\r\n * the replication.\r\n * Ensures that checkpoint are not\r\n * mixed with other replications.\r\n */\r\n identifier: string;\r\n pullBatchSize: number;\r\n pushBatchSize: number;\r\n replicationHandler: RxReplicationHandler<RxDocType, any>;\r\n conflictHandler: RxConflictHandler<RxDocType>;\r\n\r\n // can be set to also replicate the _meta field of the document.\r\n keepMeta?: boolean;\r\n\r\n /**\r\n * The fork is the one that contains the forked chain of document writes.\r\n * All conflicts are solved on the fork and only resolved correct document data\r\n * is written back to the parent.\r\n */\r\n forkInstance: RxStorageInstance<RxDocType, any, any>;\r\n\r\n /**\r\n * The replication needs to store some meta data\r\n * for documents to know which state is at the master\r\n * and how/if it diverges from the fork.\r\n * In the past this was stored in the _meta field of\r\n * the forkInstance documents but that was not a good design decision\r\n * because it required additional writes on the forkInstance\r\n * to know which documents have been upstream replicated\r\n * to not cause conflicts.\r\n * Using the metaInstance instead leads to better overall performance\r\n * because RxDB will not re-emit query results or document state\r\n * when replication meta data is written.\r\n *\r\n * In addition to per-document meta data,\r\n * the replication checkpoints are also stored in this instance.\r\n *\r\n */\r\n metaInstance: RxStorageInstance<RxStorageReplicationMeta<RxDocType, any>, any, any>;\r\n\r\n /**\r\n * When a write happens to the fork,\r\n * normally the replication will directly try to persist.\r\n *\r\n * For many use cases, it is better to await the next event loop tick\r\n * or to wait until the RxDatabase is idle or requestIdleCallback() calls\r\n * to ensure the CPU is idle.\r\n * This can improve performance because the persistence will not affect UI\r\n * renders.\r\n *\r\n * But: The longer you wait here, the higher is the risk of losing fork\r\n * writes when the replication is closed unexpected.\r\n */\r\n waitBeforePersist?: () => Promise<any>;\r\n\r\n hashFunction: HashFunction;\r\n skipStoringPullMeta: boolean;\r\n\r\n initialCheckpoint?: {\r\n upstream?: any;\r\n downstream?: any;\r\n };\r\n};\r\n\r\nexport type RxStorageInstanceReplicationState<RxDocType> = {\r\n // store the primaryPath here for better reuse and performance.\r\n primaryPath: string;\r\n hasAttachments: boolean;\r\n input: RxStorageInstanceReplicationInput<RxDocType>;\r\n events: {\r\n /**\r\n * Streams all document writes that have successfully\r\n * been written in one direction.\r\n */\r\n processed: {\r\n up: Subject<RxReplicationWriteToMasterRow<RxDocType>>;\r\n down: Subject<BulkWriteRow<RxDocType>>;\r\n };\r\n resolvedConflicts: Subject<{\r\n input: RxConflictHandlerInput<RxDocType>;\r\n output: WithDeleted<RxDocType>;\r\n }>;\r\n /**\r\n * Contains the cancel state.\r\n * Emit true here to cancel the replication.\r\n */\r\n canceled: BehaviorSubject<boolean>;\r\n /**\r\n * Contains the pause state.\r\n * Emit true here to pause the replication.\r\n */\r\n paused: BehaviorSubject<boolean>;\r\n /**\r\n * Contains true if the replication is doing something\r\n * at this point in time.\r\n * If this is false, it means that the replication\r\n * is idle AND in sync.\r\n */\r\n active: {\r\n [direction in RxStorageReplicationDirection]: BehaviorSubject<boolean>;\r\n };\r\n /**\r\n * All errors that would otherwise be unhandled,\r\n * get emitted here.\r\n */\r\n error: Subject<RxError | RxTypeError>;\r\n };\r\n\r\n\r\n /**\r\n * Contains counters that can be used in tests\r\n * or to debug problems.\r\n */\r\n stats: {\r\n down: {\r\n addNewTask: number;\r\n downstreamResyncOnce: number;\r\n downstreamProcessChanges: number;\r\n masterChangeStreamEmit: number;\r\n persistFromMaster: number;\r\n };\r\n up: {\r\n upstreamInitialSync: number;\r\n forkChangeStreamEmit: number;\r\n processTasks: number;\r\n persistToMaster: number;\r\n persistToMasterHadConflicts: number;\r\n persistToMasterConflictWrites: number;\r\n };\r\n };\r\n\r\n /**\r\n * Used in checkpoints and ._meta fields\r\n * to ensure we do not mix up meta data of\r\n * different replications.\r\n * We have to use the promise because the key is hashed which runs async.\r\n */\r\n checkpointKey: Promise<string>;\r\n\r\n /**\r\n * Storage.bulkWrites() that are initialized from the\r\n * downstream, get this flag as context-param\r\n * so that the emitted event bulk can be identified\r\n * to be sourced from the downstream and it will not try\r\n * to upstream these documents again.\r\n */\r\n downstreamBulkWriteFlag: Promise<string>;\r\n\r\n /**\r\n * If this is set to true, we do not store the documents\r\n * assumed server state. This is set on pull-only replications\r\n * we because when we do not push anyway, we do not have to store\r\n * the server state of any document.\r\n */\r\n skipStoringPullMeta: boolean;\r\n\r\n /**\r\n * Tracks if the streams have been in sync\r\n * for at least one time.\r\n */\r\n firstSyncDone: {\r\n [direction in RxStorageReplicationDirection]: BehaviorSubject<boolean>;\r\n };\r\n\r\n /**\r\n * Can be used to detect if the replication is doing something\r\n * or if it is in an idle state.\r\n */\r\n streamQueue: {\r\n [direction in RxStorageReplicationDirection]: Promise<any>;\r\n };\r\n\r\n checkpointQueue: Promise<any>;\r\n\r\n /**\r\n * For better performance we store the last known checkpoint\r\n * document so that we can likely do checkpoint storing without\r\n * conflicts.\r\n */\r\n lastCheckpointDoc: {\r\n [direction in RxStorageReplicationDirection]?: RxDocumentData<RxStorageReplicationMeta<RxDocType, any>>;\r\n };\r\n};\r\n\r\nexport type RxStorageReplicationDirection = 'up' | 'down';\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=rx-attachment.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rx-attachment.d.js","names":[],"sources":["../../../src/types/rx-attachment.d.ts"],"sourcesContent":["import type {\r\n RxDocument\r\n} from './rx-document.d.ts';\r\n\r\ndeclare type Buffer = any;\r\n\r\nexport type RxAttachmentCreator = {\r\n id: string;\r\n /**\r\n * Content type like 'plain/text'\r\n */\r\n type: string;\r\n /**\r\n * The data of the attachment.\r\n */\r\n data: Blob;\r\n};\r\n\r\nexport type RxAttachmentCreatorBase64 = {\r\n id: string;\r\n /**\r\n * Content type like 'plain/text'\r\n */\r\n type: string;\r\n /**\r\n * The data of the attachment as base64.\r\n */\r\n data: string;\r\n\r\n // must be set manually\r\n length: number;\r\n};\r\n\r\nexport declare class RxAttachment<RxDocumentType, OrmMethods = {}, Reactivity = unknown> {\r\n readonly doc: RxDocument<RxDocumentType, OrmMethods, Reactivity>;\r\n readonly id: string;\r\n readonly type: string;\r\n readonly length: number;\r\n readonly digest: string;\r\n readonly rev: string;\r\n\r\n remove(): Promise<void>;\r\n getData(): Promise<Blob>;\r\n getDataBase64(): Promise<string>;\r\n getStringData(): Promise<string>;\r\n}\r\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=rx-change-event.d.js.map