@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.
- package/AGENTS.md +54 -0
- package/CHANGELOG.md +2469 -0
- package/CLAUDE.md +63 -0
- package/LICENSE.txt +201 -0
- package/README.md +263 -0
- package/babel.config.js +58 -0
- package/dist/cjs/change-event-buffer.js +146 -0
- package/dist/cjs/change-event-buffer.js.map +1 -0
- package/dist/cjs/custom-index.js +284 -0
- package/dist/cjs/custom-index.js.map +1 -0
- package/dist/cjs/doc-cache.js +231 -0
- package/dist/cjs/doc-cache.js.map +1 -0
- package/dist/cjs/event-reduce.js +102 -0
- package/dist/cjs/event-reduce.js.map +1 -0
- package/dist/cjs/hooks.js +131 -0
- package/dist/cjs/hooks.js.map +1 -0
- package/dist/cjs/incremental-write.js +169 -0
- package/dist/cjs/incremental-write.js.map +1 -0
- package/dist/cjs/index.js +270 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/overwritable.js +39 -0
- package/dist/cjs/overwritable.js.map +1 -0
- package/dist/cjs/plugin-helpers.js +223 -0
- package/dist/cjs/plugin-helpers.js.map +1 -0
- package/dist/cjs/plugin.js +94 -0
- package/dist/cjs/plugin.js.map +1 -0
- package/dist/cjs/plugins/attachments/attachments-utils.js +49 -0
- package/dist/cjs/plugins/attachments/attachments-utils.js.map +1 -0
- package/dist/cjs/plugins/attachments/index.js +237 -0
- package/dist/cjs/plugins/attachments/index.js.map +1 -0
- package/dist/cjs/plugins/attachments-compression/index.js +143 -0
- package/dist/cjs/plugins/attachments-compression/index.js.map +1 -0
- package/dist/cjs/plugins/backup/file-util.js +102 -0
- package/dist/cjs/plugins/backup/file-util.js.map +1 -0
- package/dist/cjs/plugins/backup/index.js +206 -0
- package/dist/cjs/plugins/backup/index.js.map +1 -0
- package/dist/cjs/plugins/cleanup/cleanup-helper.js +17 -0
- package/dist/cjs/plugins/cleanup/cleanup-helper.js.map +1 -0
- package/dist/cjs/plugins/cleanup/cleanup-state.js +83 -0
- package/dist/cjs/plugins/cleanup/cleanup-state.js.map +1 -0
- package/dist/cjs/plugins/cleanup/cleanup.js +116 -0
- package/dist/cjs/plugins/cleanup/cleanup.js.map +1 -0
- package/dist/cjs/plugins/cleanup/index.js +64 -0
- package/dist/cjs/plugins/cleanup/index.js.map +1 -0
- package/dist/cjs/plugins/crdt/index.js +392 -0
- package/dist/cjs/plugins/crdt/index.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/check-document.js +158 -0
- package/dist/cjs/plugins/dev-mode/check-document.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/check-migration-strategies.js +43 -0
- package/dist/cjs/plugins/dev-mode/check-migration-strategies.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/check-orm.js +53 -0
- package/dist/cjs/plugins/dev-mode/check-orm.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/check-query.js +183 -0
- package/dist/cjs/plugins/dev-mode/check-query.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/check-schema.js +487 -0
- package/dist/cjs/plugins/dev-mode/check-schema.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/dev-mode-tracking.js +93 -0
- package/dist/cjs/plugins/dev-mode/dev-mode-tracking.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/entity-properties.js +56 -0
- package/dist/cjs/plugins/dev-mode/entity-properties.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/error-messages.js +1295 -0
- package/dist/cjs/plugins/dev-mode/error-messages.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/index.js +195 -0
- package/dist/cjs/plugins/dev-mode/index.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/unallowed-properties.js +88 -0
- package/dist/cjs/plugins/dev-mode/unallowed-properties.js.map +1 -0
- package/dist/cjs/plugins/electron/electron-helper.js +9 -0
- package/dist/cjs/plugins/electron/electron-helper.js.map +1 -0
- package/dist/cjs/plugins/electron/index.js +39 -0
- package/dist/cjs/plugins/electron/index.js.map +1 -0
- package/dist/cjs/plugins/electron/rx-storage-ipc-main.js +45 -0
- package/dist/cjs/plugins/electron/rx-storage-ipc-main.js.map +1 -0
- package/dist/cjs/plugins/electron/rx-storage-ipc-renderer.js +37 -0
- package/dist/cjs/plugins/electron/rx-storage-ipc-renderer.js.map +1 -0
- package/dist/cjs/plugins/encryption-crypto-js/index.js +165 -0
- package/dist/cjs/plugins/encryption-crypto-js/index.js.map +1 -0
- package/dist/cjs/plugins/flutter/index.js +62 -0
- package/dist/cjs/plugins/flutter/index.js.map +1 -0
- package/dist/cjs/plugins/json-dump/index.js +94 -0
- package/dist/cjs/plugins/json-dump/index.js.map +1 -0
- package/dist/cjs/plugins/key-compression/index.js +136 -0
- package/dist/cjs/plugins/key-compression/index.js.map +1 -0
- package/dist/cjs/plugins/leader-election/index.js +107 -0
- package/dist/cjs/plugins/leader-election/index.js.map +1 -0
- package/dist/cjs/plugins/local-documents/index.js +109 -0
- package/dist/cjs/plugins/local-documents/index.js.map +1 -0
- package/dist/cjs/plugins/local-documents/local-documents-helper.js +78 -0
- package/dist/cjs/plugins/local-documents/local-documents-helper.js.map +1 -0
- package/dist/cjs/plugins/local-documents/local-documents.js +107 -0
- package/dist/cjs/plugins/local-documents/local-documents.js.map +1 -0
- package/dist/cjs/plugins/local-documents/rx-local-document.js +257 -0
- package/dist/cjs/plugins/local-documents/rx-local-document.js.map +1 -0
- package/dist/cjs/plugins/migration-schema/index.js +84 -0
- package/dist/cjs/plugins/migration-schema/index.js.map +1 -0
- package/dist/cjs/plugins/migration-schema/migration-helpers.js +116 -0
- package/dist/cjs/plugins/migration-schema/migration-helpers.js.map +1 -0
- package/dist/cjs/plugins/migration-schema/migration-types.js +2 -0
- package/dist/cjs/plugins/migration-schema/migration-types.js.map +1 -0
- package/dist/cjs/plugins/migration-schema/rx-migration-state.js +410 -0
- package/dist/cjs/plugins/migration-schema/rx-migration-state.js.map +1 -0
- package/dist/cjs/plugins/migration-storage/index.js +173 -0
- package/dist/cjs/plugins/migration-storage/index.js.map +1 -0
- package/dist/cjs/plugins/pipeline/flagged-functions.js +129 -0
- package/dist/cjs/plugins/pipeline/flagged-functions.js.map +1 -0
- package/dist/cjs/plugins/pipeline/index.js +43 -0
- package/dist/cjs/plugins/pipeline/index.js.map +1 -0
- package/dist/cjs/plugins/pipeline/rx-pipeline.js +219 -0
- package/dist/cjs/plugins/pipeline/rx-pipeline.js.map +1 -0
- package/dist/cjs/plugins/pipeline/types.js +2 -0
- package/dist/cjs/plugins/pipeline/types.js.map +1 -0
- package/dist/cjs/plugins/query-builder/index.js +70 -0
- package/dist/cjs/plugins/query-builder/index.js.map +1 -0
- package/dist/cjs/plugins/query-builder/mquery/mquery-utils.js +40 -0
- package/dist/cjs/plugins/query-builder/mquery/mquery-utils.js.map +1 -0
- package/dist/cjs/plugins/query-builder/mquery/nosql-query-builder.js +488 -0
- package/dist/cjs/plugins/query-builder/mquery/nosql-query-builder.js.map +1 -0
- package/dist/cjs/plugins/react/database-context.js +15 -0
- package/dist/cjs/plugins/react/database-context.js.map +1 -0
- package/dist/cjs/plugins/react/database-provider.js +41 -0
- package/dist/cjs/plugins/react/database-provider.js.map +1 -0
- package/dist/cjs/plugins/react/hooks/index.js +50 -0
- package/dist/cjs/plugins/react/hooks/index.js.map +1 -0
- package/dist/cjs/plugins/react/hooks/use-live-rx-query.js +27 -0
- package/dist/cjs/plugins/react/hooks/use-live-rx-query.js.map +1 -0
- package/dist/cjs/plugins/react/hooks/use-rx-collection.js +39 -0
- package/dist/cjs/plugins/react/hooks/use-rx-collection.js.map +1 -0
- package/dist/cjs/plugins/react/hooks/use-rx-database.js +24 -0
- package/dist/cjs/plugins/react/hooks/use-rx-database.js.map +1 -0
- package/dist/cjs/plugins/react/hooks/use-rx-query.js +99 -0
- package/dist/cjs/plugins/react/hooks/use-rx-query.js.map +1 -0
- package/dist/cjs/plugins/react/index.js +28 -0
- package/dist/cjs/plugins/react/index.js.map +1 -0
- package/dist/cjs/plugins/reactivity-angular/index.js +30 -0
- package/dist/cjs/plugins/reactivity-angular/index.js.map +1 -0
- package/dist/cjs/plugins/reactivity-preact-signals/index.js +67 -0
- package/dist/cjs/plugins/reactivity-preact-signals/index.js.map +1 -0
- package/dist/cjs/plugins/reactivity-vue/index.js +32 -0
- package/dist/cjs/plugins/reactivity-vue/index.js.map +1 -0
- package/dist/cjs/plugins/replication/index.js +487 -0
- package/dist/cjs/plugins/replication/index.js.map +1 -0
- package/dist/cjs/plugins/replication/replication-helper.js +97 -0
- package/dist/cjs/plugins/replication/replication-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-appwrite/appwrite-helpers.js +33 -0
- package/dist/cjs/plugins/replication-appwrite/appwrite-helpers.js.map +1 -0
- package/dist/cjs/plugins/replication-appwrite/appwrite-types.js +2 -0
- package/dist/cjs/plugins/replication-appwrite/appwrite-types.js.map +1 -0
- package/dist/cjs/plugins/replication-appwrite/index.js +176 -0
- package/dist/cjs/plugins/replication-appwrite/index.js.map +1 -0
- package/dist/cjs/plugins/replication-couchdb/couchdb-helper.js +77 -0
- package/dist/cjs/plugins/replication-couchdb/couchdb-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-couchdb/couchdb-types.js +2 -0
- package/dist/cjs/plugins/replication-couchdb/couchdb-types.js.map +1 -0
- package/dist/cjs/plugins/replication-couchdb/index.js +287 -0
- package/dist/cjs/plugins/replication-couchdb/index.js.map +1 -0
- package/dist/cjs/plugins/replication-firestore/firestore-helper.js +61 -0
- package/dist/cjs/plugins/replication-firestore/firestore-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-firestore/firestore-types.js +2 -0
- package/dist/cjs/plugins/replication-firestore/firestore-types.js.map +1 -0
- package/dist/cjs/plugins/replication-firestore/index.js +266 -0
- package/dist/cjs/plugins/replication-firestore/index.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/document-handling.js +150 -0
- package/dist/cjs/plugins/replication-google-drive/document-handling.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/downstream.js +73 -0
- package/dist/cjs/plugins/replication-google-drive/downstream.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/google-drive-helper.js +349 -0
- package/dist/cjs/plugins/replication-google-drive/google-drive-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/google-drive-types.js +2 -0
- package/dist/cjs/plugins/replication-google-drive/google-drive-types.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/index.js +233 -0
- package/dist/cjs/plugins/replication-google-drive/index.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/init.js +76 -0
- package/dist/cjs/plugins/replication-google-drive/init.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/multipart.js +74 -0
- package/dist/cjs/plugins/replication-google-drive/multipart.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/signaling.js +262 -0
- package/dist/cjs/plugins/replication-google-drive/signaling.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/transaction.js +134 -0
- package/dist/cjs/plugins/replication-google-drive/transaction.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/upstream.js +182 -0
- package/dist/cjs/plugins/replication-google-drive/upstream.js.map +1 -0
- package/dist/cjs/plugins/replication-graphql/graphql-schema-from-rx-schema.js +235 -0
- package/dist/cjs/plugins/replication-graphql/graphql-schema-from-rx-schema.js.map +1 -0
- package/dist/cjs/plugins/replication-graphql/graphql-websocket.js +43 -0
- package/dist/cjs/plugins/replication-graphql/graphql-websocket.js.map +1 -0
- package/dist/cjs/plugins/replication-graphql/helper.js +29 -0
- package/dist/cjs/plugins/replication-graphql/helper.js.map +1 -0
- package/dist/cjs/plugins/replication-graphql/index.js +215 -0
- package/dist/cjs/plugins/replication-graphql/index.js.map +1 -0
- package/dist/cjs/plugins/replication-graphql/query-builder-from-rx-schema.js +141 -0
- package/dist/cjs/plugins/replication-graphql/query-builder-from-rx-schema.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/document-handling.js +187 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/document-handling.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/downstream.js +78 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/downstream.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/index.js +222 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/index.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/init.js +76 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/init.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js +273 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js +2 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/signaling.js +235 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/signaling.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/transaction.js +138 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/transaction.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/upstream.js +190 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/upstream.js.map +1 -0
- package/dist/cjs/plugins/replication-mongodb/index.js +229 -0
- package/dist/cjs/plugins/replication-mongodb/index.js.map +1 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-checkpoint.js +140 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-checkpoint.js.map +1 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-helper.js +53 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-types.js +2 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-types.js.map +1 -0
- package/dist/cjs/plugins/replication-nats/index.js +232 -0
- package/dist/cjs/plugins/replication-nats/index.js.map +1 -0
- package/dist/cjs/plugins/replication-nats/nats-helper.js +13 -0
- package/dist/cjs/plugins/replication-nats/nats-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-nats/nats-types.js +2 -0
- package/dist/cjs/plugins/replication-nats/nats-types.js.map +1 -0
- package/dist/cjs/plugins/replication-supabase/helper.js +42 -0
- package/dist/cjs/plugins/replication-supabase/helper.js.map +1 -0
- package/dist/cjs/plugins/replication-supabase/index.js +239 -0
- package/dist/cjs/plugins/replication-supabase/index.js.map +1 -0
- package/dist/cjs/plugins/replication-supabase/types.js +2 -0
- package/dist/cjs/plugins/replication-supabase/types.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-p2pcf.js +79 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-p2pcf.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-simple-peer.js +199 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-simple-peer.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-webtorrent.js +137 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-webtorrent.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/index.js +260 -0
- package/dist/cjs/plugins/replication-webrtc/index.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/signaling-server.js +151 -0
- package/dist/cjs/plugins/replication-webrtc/signaling-server.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/webrtc-helper.js +32 -0
- package/dist/cjs/plugins/replication-webrtc/webrtc-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/webrtc-types.js +2 -0
- package/dist/cjs/plugins/replication-webrtc/webrtc-types.js.map +1 -0
- package/dist/cjs/plugins/replication-websocket/index.js +39 -0
- package/dist/cjs/plugins/replication-websocket/index.js.map +1 -0
- package/dist/cjs/plugins/replication-websocket/websocket-client.js +133 -0
- package/dist/cjs/plugins/replication-websocket/websocket-client.js.map +1 -0
- package/dist/cjs/plugins/replication-websocket/websocket-server.js +108 -0
- package/dist/cjs/plugins/replication-websocket/websocket-server.js.map +1 -0
- package/dist/cjs/plugins/replication-websocket/websocket-types.js +2 -0
- package/dist/cjs/plugins/replication-websocket/websocket-types.js.map +1 -0
- package/dist/cjs/plugins/state/helpers.js +81 -0
- package/dist/cjs/plugins/state/helpers.js.map +1 -0
- package/dist/cjs/plugins/state/index.js +42 -0
- package/dist/cjs/plugins/state/index.js.map +1 -0
- package/dist/cjs/plugins/state/rx-state.js +293 -0
- package/dist/cjs/plugins/state/rx-state.js.map +1 -0
- package/dist/cjs/plugins/state/types.js +2 -0
- package/dist/cjs/plugins/state/types.js.map +1 -0
- package/dist/cjs/plugins/storage-denokv/denokv-helper.js +49 -0
- package/dist/cjs/plugins/storage-denokv/denokv-helper.js.map +1 -0
- package/dist/cjs/plugins/storage-denokv/denokv-query.js +99 -0
- package/dist/cjs/plugins/storage-denokv/denokv-query.js.map +1 -0
- package/dist/cjs/plugins/storage-denokv/denokv-types.js +2 -0
- package/dist/cjs/plugins/storage-denokv/denokv-types.js.map +1 -0
- package/dist/cjs/plugins/storage-denokv/index.js +31 -0
- package/dist/cjs/plugins/storage-denokv/index.js.map +1 -0
- package/dist/cjs/plugins/storage-denokv/rx-storage-instance-denokv.js +332 -0
- package/dist/cjs/plugins/storage-denokv/rx-storage-instance-denokv.js.map +1 -0
- package/dist/cjs/plugins/storage-dexie/dexie-helper.js +259 -0
- package/dist/cjs/plugins/storage-dexie/dexie-helper.js.map +1 -0
- package/dist/cjs/plugins/storage-dexie/dexie-query.js +178 -0
- package/dist/cjs/plugins/storage-dexie/dexie-query.js.map +1 -0
- package/dist/cjs/plugins/storage-dexie/index.js +50 -0
- package/dist/cjs/plugins/storage-dexie/index.js.map +1 -0
- package/dist/cjs/plugins/storage-dexie/rx-storage-dexie.js +46 -0
- package/dist/cjs/plugins/storage-dexie/rx-storage-dexie.js.map +1 -0
- package/dist/cjs/plugins/storage-dexie/rx-storage-instance-dexie.js +229 -0
- package/dist/cjs/plugins/storage-dexie/rx-storage-instance-dexie.js.map +1 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-helpers.js +13 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-helpers.js.map +1 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-query.js +96 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-query.js.map +1 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-types.js +2 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-types.js.map +1 -0
- package/dist/cjs/plugins/storage-foundationdb/index.js +62 -0
- package/dist/cjs/plugins/storage-foundationdb/index.js.map +1 -0
- package/dist/cjs/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js +309 -0
- package/dist/cjs/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js.map +1 -0
- package/dist/cjs/plugins/storage-localstorage/index.js +45 -0
- package/dist/cjs/plugins/storage-localstorage/index.js.map +1 -0
- package/dist/cjs/plugins/storage-localstorage/localstorage-mock.js +38 -0
- package/dist/cjs/plugins/storage-localstorage/localstorage-mock.js.map +1 -0
- package/dist/cjs/plugins/storage-localstorage/rx-storage-instance-localstorage.js +443 -0
- package/dist/cjs/plugins/storage-localstorage/rx-storage-instance-localstorage.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/binary-search-bounds.js +113 -0
- package/dist/cjs/plugins/storage-memory/binary-search-bounds.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/index.js +91 -0
- package/dist/cjs/plugins/storage-memory/index.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/memory-helper.js +177 -0
- package/dist/cjs/plugins/storage-memory/memory-helper.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/memory-indexes.js +28 -0
- package/dist/cjs/plugins/storage-memory/memory-indexes.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/memory-types.js +2 -0
- package/dist/cjs/plugins/storage-memory/memory-types.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/rx-storage-instance-memory.js +371 -0
- package/dist/cjs/plugins/storage-memory/rx-storage-instance-memory.js.map +1 -0
- package/dist/cjs/plugins/storage-mongodb/index.js +50 -0
- package/dist/cjs/plugins/storage-mongodb/index.js.map +1 -0
- package/dist/cjs/plugins/storage-mongodb/mongodb-helper.js +97 -0
- package/dist/cjs/plugins/storage-mongodb/mongodb-helper.js.map +1 -0
- package/dist/cjs/plugins/storage-mongodb/mongodb-types.js +2 -0
- package/dist/cjs/plugins/storage-mongodb/mongodb-types.js.map +1 -0
- package/dist/cjs/plugins/storage-mongodb/rx-storage-instance-mongodb.js +324 -0
- package/dist/cjs/plugins/storage-mongodb/rx-storage-instance-mongodb.js.map +1 -0
- package/dist/cjs/plugins/storage-mongodb/rx-storage-mongodb.js +29 -0
- package/dist/cjs/plugins/storage-mongodb/rx-storage-mongodb.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/index.js +61 -0
- package/dist/cjs/plugins/storage-remote/index.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/message-channel-cache.js +52 -0
- package/dist/cjs/plugins/storage-remote/message-channel-cache.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/remote.js +217 -0
- package/dist/cjs/plugins/storage-remote/remote.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/rx-storage-remote.js +199 -0
- package/dist/cjs/plugins/storage-remote/rx-storage-remote.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/storage-remote-helpers.js +25 -0
- package/dist/cjs/plugins/storage-remote/storage-remote-helpers.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/storage-remote-types.js +2 -0
- package/dist/cjs/plugins/storage-remote/storage-remote-types.js.map +1 -0
- package/dist/cjs/plugins/storage-remote-websocket/index.js +183 -0
- package/dist/cjs/plugins/storage-remote-websocket/index.js.map +1 -0
- package/dist/cjs/plugins/storage-remote-websocket/types.js +2 -0
- package/dist/cjs/plugins/storage-remote-websocket/types.js.map +1 -0
- package/dist/cjs/plugins/storage-sqlite/index.js +84 -0
- package/dist/cjs/plugins/storage-sqlite/index.js.map +1 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-basics-helpers.js +530 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-basics-helpers.js.map +1 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-helpers.js +203 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-helpers.js.map +1 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-storage-instance.js +291 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-storage-instance.js.map +1 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-types.js +2 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-types.js.map +1 -0
- package/dist/cjs/plugins/test-utils/config.js +120 -0
- package/dist/cjs/plugins/test-utils/config.js.map +1 -0
- package/dist/cjs/plugins/test-utils/humans-collection.js +420 -0
- package/dist/cjs/plugins/test-utils/humans-collection.js.map +1 -0
- package/dist/cjs/plugins/test-utils/index.js +130 -0
- package/dist/cjs/plugins/test-utils/index.js.map +1 -0
- package/dist/cjs/plugins/test-utils/performance.js +275 -0
- package/dist/cjs/plugins/test-utils/performance.js.map +1 -0
- package/dist/cjs/plugins/test-utils/replication-base-test-suite.js +179 -0
- package/dist/cjs/plugins/test-utils/replication-base-test-suite.js.map +1 -0
- package/dist/cjs/plugins/test-utils/replication.js +54 -0
- package/dist/cjs/plugins/test-utils/replication.js.map +1 -0
- package/dist/cjs/plugins/test-utils/revisions.js +11 -0
- package/dist/cjs/plugins/test-utils/revisions.js.map +1 -0
- package/dist/cjs/plugins/test-utils/schema-objects.js +315 -0
- package/dist/cjs/plugins/test-utils/schema-objects.js.map +1 -0
- package/dist/cjs/plugins/test-utils/schemas.js +1254 -0
- package/dist/cjs/plugins/test-utils/schemas.js.map +1 -0
- package/dist/cjs/plugins/test-utils/test-util.js +72 -0
- package/dist/cjs/plugins/test-utils/test-util.js.map +1 -0
- package/dist/cjs/plugins/update/index.js +45 -0
- package/dist/cjs/plugins/update/index.js.map +1 -0
- package/dist/cjs/plugins/update/mingo-updater.js +20 -0
- package/dist/cjs/plugins/update/mingo-updater.js.map +1 -0
- package/dist/cjs/plugins/utils/index.js +226 -0
- package/dist/cjs/plugins/utils/index.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-array.js +150 -0
- package/dist/cjs/plugins/utils/utils-array.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-base64.js +57 -0
- package/dist/cjs/plugins/utils/utils-base64.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-blob.js +62 -0
- package/dist/cjs/plugins/utils/utils-blob.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-document.js +100 -0
- package/dist/cjs/plugins/utils/utils-document.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-error.js +42 -0
- package/dist/cjs/plugins/utils/utils-error.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-global.js +12 -0
- package/dist/cjs/plugins/utils/utils-global.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-hash.js +59 -0
- package/dist/cjs/plugins/utils/utils-hash.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-map.js +25 -0
- package/dist/cjs/plugins/utils/utils-map.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-number.js +16 -0
- package/dist/cjs/plugins/utils/utils-number.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-object-deep-equal.js +42 -0
- package/dist/cjs/plugins/utils/utils-object-deep-equal.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-object-dot-prop.js +306 -0
- package/dist/cjs/plugins/utils/utils-object-dot-prop.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-object.js +245 -0
- package/dist/cjs/plugins/utils/utils-object.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-other.js +69 -0
- package/dist/cjs/plugins/utils/utils-other.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-premium.js +37 -0
- package/dist/cjs/plugins/utils/utils-premium.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-promise.js +149 -0
- package/dist/cjs/plugins/utils/utils-promise.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-regex.js +9 -0
- package/dist/cjs/plugins/utils/utils-regex.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-revision.js +60 -0
- package/dist/cjs/plugins/utils/utils-revision.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-rxdb-version.js +11 -0
- package/dist/cjs/plugins/utils/utils-rxdb-version.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-rxdb-version.template.js +11 -0
- package/dist/cjs/plugins/utils/utils-rxdb-version.template.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-string.js +97 -0
- package/dist/cjs/plugins/utils/utils-string.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-time.js +42 -0
- package/dist/cjs/plugins/utils/utils-time.js.map +1 -0
- package/dist/cjs/plugins/validate-ajv/index.js +53 -0
- package/dist/cjs/plugins/validate-ajv/index.js.map +1 -0
- package/dist/cjs/plugins/validate-is-my-json-valid/index.js +29 -0
- package/dist/cjs/plugins/validate-is-my-json-valid/index.js.map +1 -0
- package/dist/cjs/plugins/validate-z-schema/index.js +58 -0
- package/dist/cjs/plugins/validate-z-schema/index.js.map +1 -0
- package/dist/cjs/plugins/vector/helper.js +2 -0
- package/dist/cjs/plugins/vector/helper.js.map +1 -0
- package/dist/cjs/plugins/vector/index.js +17 -0
- package/dist/cjs/plugins/vector/index.js.map +1 -0
- package/dist/cjs/plugins/vector/types.js +2 -0
- package/dist/cjs/plugins/vector/types.js.map +1 -0
- package/dist/cjs/plugins/vector/vector-distance.js +38 -0
- package/dist/cjs/plugins/vector/vector-distance.js.map +1 -0
- package/dist/cjs/plugins/webmcp/index.js +28 -0
- package/dist/cjs/plugins/webmcp/index.js.map +1 -0
- package/dist/cjs/plugins/webmcp/nosql-query-schema.js +360 -0
- package/dist/cjs/plugins/webmcp/nosql-query-schema.js.map +1 -0
- package/dist/cjs/plugins/webmcp/webmcp.js +315 -0
- package/dist/cjs/plugins/webmcp/webmcp.js.map +1 -0
- package/dist/cjs/query-cache.js +110 -0
- package/dist/cjs/query-cache.js.map +1 -0
- package/dist/cjs/query-planner.js +307 -0
- package/dist/cjs/query-planner.js.map +1 -0
- package/dist/cjs/replication-protocol/checkpoint.js +103 -0
- package/dist/cjs/replication-protocol/checkpoint.js.map +1 -0
- package/dist/cjs/replication-protocol/conflicts.js +36 -0
- package/dist/cjs/replication-protocol/conflicts.js.map +1 -0
- package/dist/cjs/replication-protocol/default-conflict-handler.js +39 -0
- package/dist/cjs/replication-protocol/default-conflict-handler.js.map +1 -0
- package/dist/cjs/replication-protocol/downstream.js +339 -0
- package/dist/cjs/replication-protocol/downstream.js.map +1 -0
- package/dist/cjs/replication-protocol/helper.js +58 -0
- package/dist/cjs/replication-protocol/helper.js.map +1 -0
- package/dist/cjs/replication-protocol/index.js +314 -0
- package/dist/cjs/replication-protocol/index.js.map +1 -0
- package/dist/cjs/replication-protocol/meta-instance.js +130 -0
- package/dist/cjs/replication-protocol/meta-instance.js.map +1 -0
- package/dist/cjs/replication-protocol/upstream.js +384 -0
- package/dist/cjs/replication-protocol/upstream.js.map +1 -0
- package/dist/cjs/rx-change-event.js +112 -0
- package/dist/cjs/rx-change-event.js.map +1 -0
- package/dist/cjs/rx-collection-helper.js +205 -0
- package/dist/cjs/rx-collection-helper.js.map +1 -0
- package/dist/cjs/rx-collection.js +931 -0
- package/dist/cjs/rx-collection.js.map +1 -0
- package/dist/cjs/rx-database-internal-store.js +283 -0
- package/dist/cjs/rx-database-internal-store.js.map +1 -0
- package/dist/cjs/rx-database.js +682 -0
- package/dist/cjs/rx-database.js.map +1 -0
- package/dist/cjs/rx-document-prototype-merge.js +87 -0
- package/dist/cjs/rx-document-prototype-merge.js.map +1 -0
- package/dist/cjs/rx-document.js +404 -0
- package/dist/cjs/rx-document.js.map +1 -0
- package/dist/cjs/rx-error.js +167 -0
- package/dist/cjs/rx-error.js.map +1 -0
- package/dist/cjs/rx-query-helper.js +277 -0
- package/dist/cjs/rx-query-helper.js.map +1 -0
- package/dist/cjs/rx-query-mingo.js +60 -0
- package/dist/cjs/rx-query-mingo.js.map +1 -0
- package/dist/cjs/rx-query-single-result.js +105 -0
- package/dist/cjs/rx-query-single-result.js.map +1 -0
- package/dist/cjs/rx-query.js +703 -0
- package/dist/cjs/rx-query.js.map +1 -0
- package/dist/cjs/rx-schema-helper.js +333 -0
- package/dist/cjs/rx-schema-helper.js.map +1 -0
- package/dist/cjs/rx-schema.js +189 -0
- package/dist/cjs/rx-schema.js.map +1 -0
- package/dist/cjs/rx-storage-helper.js +808 -0
- package/dist/cjs/rx-storage-helper.js.map +1 -0
- package/dist/cjs/rx-storage-multiinstance.js +121 -0
- package/dist/cjs/rx-storage-multiinstance.js.map +1 -0
- package/dist/cjs/types/conflict-handling.d.js +2 -0
- package/dist/cjs/types/conflict-handling.d.js.map +1 -0
- package/dist/cjs/types/couchdb.d.js +2 -0
- package/dist/cjs/types/couchdb.d.js.map +1 -0
- package/dist/cjs/types/index.d.js +2 -0
- package/dist/cjs/types/index.d.js.map +1 -0
- package/dist/cjs/types/modules/index.d.js +2 -0
- package/dist/cjs/types/modules/index.d.js.map +1 -0
- package/dist/cjs/types/modules/mocha.parallel.d.js +2 -0
- package/dist/cjs/types/modules/mocha.parallel.d.js.map +1 -0
- package/dist/cjs/types/plugins/backup.d.js +2 -0
- package/dist/cjs/types/plugins/backup.d.js.map +1 -0
- package/dist/cjs/types/plugins/cleanup.d.js +2 -0
- package/dist/cjs/types/plugins/cleanup.d.js.map +1 -0
- package/dist/cjs/types/plugins/crdt.d.js +2 -0
- package/dist/cjs/types/plugins/crdt.d.js.map +1 -0
- package/dist/cjs/types/plugins/dexie.d.js +2 -0
- package/dist/cjs/types/plugins/dexie.d.js.map +1 -0
- package/dist/cjs/types/plugins/local-documents.d.js +2 -0
- package/dist/cjs/types/plugins/local-documents.d.js.map +1 -0
- package/dist/cjs/types/plugins/migration.d.js +2 -0
- package/dist/cjs/types/plugins/migration.d.js.map +1 -0
- package/dist/cjs/types/plugins/reactivity.d.js +2 -0
- package/dist/cjs/types/plugins/reactivity.d.js.map +1 -0
- package/dist/cjs/types/plugins/replication-graphql.d.js +2 -0
- package/dist/cjs/types/plugins/replication-graphql.d.js.map +1 -0
- package/dist/cjs/types/plugins/replication.d.js +2 -0
- package/dist/cjs/types/plugins/replication.d.js.map +1 -0
- package/dist/cjs/types/plugins/state.d.js +2 -0
- package/dist/cjs/types/plugins/state.d.js.map +1 -0
- package/dist/cjs/types/plugins/update.d.js +2 -0
- package/dist/cjs/types/plugins/update.d.js.map +1 -0
- package/dist/cjs/types/plugins/webmcp.d.js +2 -0
- package/dist/cjs/types/plugins/webmcp.d.js.map +1 -0
- package/dist/cjs/types/query-planner.d.js +2 -0
- package/dist/cjs/types/query-planner.d.js.map +1 -0
- package/dist/cjs/types/replication-protocol.d.js +2 -0
- package/dist/cjs/types/replication-protocol.d.js.map +1 -0
- package/dist/cjs/types/rx-attachment.d.js +2 -0
- package/dist/cjs/types/rx-attachment.d.js.map +1 -0
- package/dist/cjs/types/rx-change-event.d.js +2 -0
- package/dist/cjs/types/rx-change-event.d.js.map +1 -0
- package/dist/cjs/types/rx-collection.d.js +2 -0
- package/dist/cjs/types/rx-collection.d.js.map +1 -0
- package/dist/cjs/types/rx-database-internal-store.d.js +2 -0
- package/dist/cjs/types/rx-database-internal-store.d.js.map +1 -0
- package/dist/cjs/types/rx-database.d.js +2 -0
- package/dist/cjs/types/rx-database.d.js.map +1 -0
- package/dist/cjs/types/rx-document.d.js +2 -0
- package/dist/cjs/types/rx-document.d.js.map +1 -0
- package/dist/cjs/types/rx-error.d.js +2 -0
- package/dist/cjs/types/rx-error.d.js.map +1 -0
- package/dist/cjs/types/rx-plugin.d.js +2 -0
- package/dist/cjs/types/rx-plugin.d.js.map +1 -0
- package/dist/cjs/types/rx-query.d.js +2 -0
- package/dist/cjs/types/rx-query.d.js.map +1 -0
- package/dist/cjs/types/rx-schema.d.js +2 -0
- package/dist/cjs/types/rx-schema.d.js.map +1 -0
- package/dist/cjs/types/rx-storage.d.js +2 -0
- package/dist/cjs/types/rx-storage.d.js.map +1 -0
- package/dist/cjs/types/rx-storage.interface.d.js +2 -0
- package/dist/cjs/types/rx-storage.interface.d.js.map +1 -0
- package/dist/cjs/types/util.d.js +2 -0
- package/dist/cjs/types/util.d.js.map +1 -0
- package/dist/esm/change-event-buffer.js +141 -0
- package/dist/esm/change-event-buffer.js.map +1 -0
- package/dist/esm/custom-index.js +271 -0
- package/dist/esm/custom-index.js.map +1 -0
- package/dist/esm/doc-cache.js +227 -0
- package/dist/esm/doc-cache.js.map +1 -0
- package/dist/esm/event-reduce.js +93 -0
- package/dist/esm/event-reduce.js.map +1 -0
- package/dist/esm/hooks.js +122 -0
- package/dist/esm/hooks.js.map +1 -0
- package/dist/esm/incremental-write.js +161 -0
- package/dist/esm/incremental-write.js.map +1 -0
- package/dist/esm/index.js +30 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/overwritable.js +33 -0
- package/dist/esm/overwritable.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/plugin-helpers.js +217 -0
- package/dist/esm/plugin-helpers.js.map +1 -0
- package/dist/esm/plugin.js +88 -0
- package/dist/esm/plugin.js.map +1 -0
- package/dist/esm/plugins/attachments/attachments-utils.js +41 -0
- package/dist/esm/plugins/attachments/attachments-utils.js.map +1 -0
- package/dist/esm/plugins/attachments/index.js +202 -0
- package/dist/esm/plugins/attachments/index.js.map +1 -0
- package/dist/esm/plugins/attachments-compression/index.js +134 -0
- package/dist/esm/plugins/attachments-compression/index.js.map +1 -0
- package/dist/esm/plugins/backup/file-util.js +87 -0
- package/dist/esm/plugins/backup/file-util.js.map +1 -0
- package/dist/esm/plugins/backup/index.js +183 -0
- package/dist/esm/plugins/backup/index.js.map +1 -0
- package/dist/esm/plugins/cleanup/cleanup-helper.js +11 -0
- package/dist/esm/plugins/cleanup/cleanup-helper.js.map +1 -0
- package/dist/esm/plugins/cleanup/cleanup-state.js +75 -0
- package/dist/esm/plugins/cleanup/cleanup-state.js.map +1 -0
- package/dist/esm/plugins/cleanup/cleanup.js +108 -0
- package/dist/esm/plugins/cleanup/cleanup.js.map +1 -0
- package/dist/esm/plugins/cleanup/index.js +35 -0
- package/dist/esm/plugins/cleanup/index.js.map +1 -0
- package/dist/esm/plugins/crdt/index.js +378 -0
- package/dist/esm/plugins/crdt/index.js.map +1 -0
- package/dist/esm/plugins/dev-mode/check-document.js +150 -0
- package/dist/esm/plugins/dev-mode/check-document.js.map +1 -0
- package/dist/esm/plugins/dev-mode/check-migration-strategies.js +38 -0
- package/dist/esm/plugins/dev-mode/check-migration-strategies.js.map +1 -0
- package/dist/esm/plugins/dev-mode/check-orm.js +47 -0
- package/dist/esm/plugins/dev-mode/check-orm.js.map +1 -0
- package/dist/esm/plugins/dev-mode/check-query.js +174 -0
- package/dist/esm/plugins/dev-mode/check-query.js.map +1 -0
- package/dist/esm/plugins/dev-mode/check-schema.js +478 -0
- package/dist/esm/plugins/dev-mode/check-schema.js.map +1 -0
- package/dist/esm/plugins/dev-mode/dev-mode-tracking.js +87 -0
- package/dist/esm/plugins/dev-mode/dev-mode-tracking.js.map +1 -0
- package/dist/esm/plugins/dev-mode/entity-properties.js +49 -0
- package/dist/esm/plugins/dev-mode/entity-properties.js.map +1 -0
- package/dist/esm/plugins/dev-mode/error-messages.js +1289 -0
- package/dist/esm/plugins/dev-mode/error-messages.js.map +1 -0
- package/dist/esm/plugins/dev-mode/index.js +151 -0
- package/dist/esm/plugins/dev-mode/index.js.map +1 -0
- package/dist/esm/plugins/dev-mode/unallowed-properties.js +81 -0
- package/dist/esm/plugins/dev-mode/unallowed-properties.js.map +1 -0
- package/dist/esm/plugins/electron/electron-helper.js +3 -0
- package/dist/esm/plugins/electron/electron-helper.js.map +1 -0
- package/dist/esm/plugins/electron/index.js +4 -0
- package/dist/esm/plugins/electron/index.js.map +1 -0
- package/dist/esm/plugins/electron/rx-storage-ipc-main.js +39 -0
- package/dist/esm/plugins/electron/rx-storage-ipc-main.js.map +1 -0
- package/dist/esm/plugins/electron/rx-storage-ipc-renderer.js +31 -0
- package/dist/esm/plugins/electron/rx-storage-ipc-renderer.js.map +1 -0
- package/dist/esm/plugins/encryption-crypto-js/index.js +154 -0
- package/dist/esm/plugins/encryption-crypto-js/index.js.map +1 -0
- package/dist/esm/plugins/flutter/index.js +55 -0
- package/dist/esm/plugins/flutter/index.js.map +1 -0
- package/dist/esm/plugins/json-dump/index.js +87 -0
- package/dist/esm/plugins/json-dump/index.js.map +1 -0
- package/dist/esm/plugins/key-compression/index.js +127 -0
- package/dist/esm/plugins/key-compression/index.js.map +1 -0
- package/dist/esm/plugins/leader-election/index.js +95 -0
- package/dist/esm/plugins/leader-election/index.js.map +1 -0
- package/dist/esm/plugins/local-documents/index.js +70 -0
- package/dist/esm/plugins/local-documents/index.js.map +1 -0
- package/dist/esm/plugins/local-documents/local-documents-helper.js +67 -0
- package/dist/esm/plugins/local-documents/local-documents-helper.js.map +1 -0
- package/dist/esm/plugins/local-documents/local-documents.js +99 -0
- package/dist/esm/plugins/local-documents/local-documents.js.map +1 -0
- package/dist/esm/plugins/local-documents/rx-local-document.js +248 -0
- package/dist/esm/plugins/local-documents/rx-local-document.js.map +1 -0
- package/dist/esm/plugins/migration-schema/index.js +42 -0
- package/dist/esm/plugins/migration-schema/index.js.map +1 -0
- package/dist/esm/plugins/migration-schema/migration-helpers.js +103 -0
- package/dist/esm/plugins/migration-schema/migration-helpers.js.map +1 -0
- package/dist/esm/plugins/migration-schema/migration-types.js +3 -0
- package/dist/esm/plugins/migration-schema/migration-types.js.map +1 -0
- package/dist/esm/plugins/migration-schema/rx-migration-state.js +404 -0
- package/dist/esm/plugins/migration-schema/rx-migration-state.js.map +1 -0
- package/dist/esm/plugins/migration-storage/index.js +166 -0
- package/dist/esm/plugins/migration-storage/index.js.map +1 -0
- package/dist/esm/plugins/pipeline/flagged-functions.js +122 -0
- package/dist/esm/plugins/pipeline/flagged-functions.js.map +1 -0
- package/dist/esm/plugins/pipeline/index.js +13 -0
- package/dist/esm/plugins/pipeline/index.js.map +1 -0
- package/dist/esm/plugins/pipeline/rx-pipeline.js +210 -0
- package/dist/esm/plugins/pipeline/rx-pipeline.js.map +1 -0
- package/dist/esm/plugins/pipeline/types.js +3 -0
- package/dist/esm/plugins/pipeline/types.js.map +1 -0
- package/dist/esm/plugins/query-builder/index.js +48 -0
- package/dist/esm/plugins/query-builder/index.js.map +1 -0
- package/dist/esm/plugins/query-builder/mquery/mquery-utils.js +33 -0
- package/dist/esm/plugins/query-builder/mquery/mquery-utils.js.map +1 -0
- package/dist/esm/plugins/query-builder/mquery/nosql-query-builder.js +478 -0
- package/dist/esm/plugins/query-builder/mquery/nosql-query-builder.js.map +1 -0
- package/dist/esm/plugins/react/database-context.js +8 -0
- package/dist/esm/plugins/react/database-context.js.map +1 -0
- package/dist/esm/plugins/react/database-provider.js +34 -0
- package/dist/esm/plugins/react/database-provider.js.map +1 -0
- package/dist/esm/plugins/react/hooks/index.js +5 -0
- package/dist/esm/plugins/react/hooks/index.js.map +1 -0
- package/dist/esm/plugins/react/hooks/use-live-rx-query.js +22 -0
- package/dist/esm/plugins/react/hooks/use-live-rx-query.js.map +1 -0
- package/dist/esm/plugins/react/hooks/use-rx-collection.js +34 -0
- package/dist/esm/plugins/react/hooks/use-rx-collection.js.map +1 -0
- package/dist/esm/plugins/react/hooks/use-rx-database.js +19 -0
- package/dist/esm/plugins/react/hooks/use-rx-database.js.map +1 -0
- package/dist/esm/plugins/react/hooks/use-rx-query.js +92 -0
- package/dist/esm/plugins/react/hooks/use-rx-query.js.map +1 -0
- package/dist/esm/plugins/react/index.js +3 -0
- package/dist/esm/plugins/react/index.js.map +1 -0
- package/dist/esm/plugins/reactivity-angular/index.js +25 -0
- package/dist/esm/plugins/reactivity-angular/index.js.map +1 -0
- package/dist/esm/plugins/reactivity-preact-signals/index.js +62 -0
- package/dist/esm/plugins/reactivity-preact-signals/index.js.map +1 -0
- package/dist/esm/plugins/reactivity-vue/index.js +27 -0
- package/dist/esm/plugins/reactivity-vue/index.js.map +1 -0
- package/dist/esm/plugins/replication/index.js +479 -0
- package/dist/esm/plugins/replication/index.js.map +1 -0
- package/dist/esm/plugins/replication/replication-helper.js +86 -0
- package/dist/esm/plugins/replication/replication-helper.js.map +1 -0
- package/dist/esm/plugins/replication-appwrite/appwrite-helpers.js +26 -0
- package/dist/esm/plugins/replication-appwrite/appwrite-helpers.js.map +1 -0
- package/dist/esm/plugins/replication-appwrite/appwrite-types.js +3 -0
- package/dist/esm/plugins/replication-appwrite/appwrite-types.js.map +1 -0
- package/dist/esm/plugins/replication-appwrite/index.js +168 -0
- package/dist/esm/plugins/replication-appwrite/index.js.map +1 -0
- package/dist/esm/plugins/replication-couchdb/couchdb-helper.js +65 -0
- package/dist/esm/plugins/replication-couchdb/couchdb-helper.js.map +1 -0
- package/dist/esm/plugins/replication-couchdb/couchdb-types.js +3 -0
- package/dist/esm/plugins/replication-couchdb/couchdb-types.js.map +1 -0
- package/dist/esm/plugins/replication-couchdb/index.js +254 -0
- package/dist/esm/plugins/replication-couchdb/index.js.map +1 -0
- package/dist/esm/plugins/replication-firestore/firestore-helper.js +49 -0
- package/dist/esm/plugins/replication-firestore/firestore-helper.js.map +1 -0
- package/dist/esm/plugins/replication-firestore/firestore-types.js +3 -0
- package/dist/esm/plugins/replication-firestore/firestore-types.js.map +1 -0
- package/dist/esm/plugins/replication-firestore/index.js +233 -0
- package/dist/esm/plugins/replication-firestore/index.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/document-handling.js +140 -0
- package/dist/esm/plugins/replication-google-drive/document-handling.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/downstream.js +66 -0
- package/dist/esm/plugins/replication-google-drive/downstream.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/google-drive-helper.js +331 -0
- package/dist/esm/plugins/replication-google-drive/google-drive-helper.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/google-drive-types.js +3 -0
- package/dist/esm/plugins/replication-google-drive/google-drive-types.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/index.js +126 -0
- package/dist/esm/plugins/replication-google-drive/index.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/init.js +70 -0
- package/dist/esm/plugins/replication-google-drive/init.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/multipart.js +67 -0
- package/dist/esm/plugins/replication-google-drive/multipart.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/signaling.js +253 -0
- package/dist/esm/plugins/replication-google-drive/signaling.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/transaction.js +123 -0
- package/dist/esm/plugins/replication-google-drive/transaction.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/upstream.js +171 -0
- package/dist/esm/plugins/replication-google-drive/upstream.js.map +1 -0
- package/dist/esm/plugins/replication-graphql/graphql-schema-from-rx-schema.js +228 -0
- package/dist/esm/plugins/replication-graphql/graphql-schema-from-rx-schema.js.map +1 -0
- package/dist/esm/plugins/replication-graphql/graphql-websocket.js +35 -0
- package/dist/esm/plugins/replication-graphql/graphql-websocket.js.map +1 -0
- package/dist/esm/plugins/replication-graphql/helper.js +21 -0
- package/dist/esm/plugins/replication-graphql/helper.js.map +1 -0
- package/dist/esm/plugins/replication-graphql/index.js +161 -0
- package/dist/esm/plugins/replication-graphql/index.js.map +1 -0
- package/dist/esm/plugins/replication-graphql/query-builder-from-rx-schema.js +133 -0
- package/dist/esm/plugins/replication-graphql/query-builder-from-rx-schema.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/document-handling.js +178 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/document-handling.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/downstream.js +71 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/downstream.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/index.js +126 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/index.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/init.js +70 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/init.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js +258 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js +3 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/signaling.js +226 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/signaling.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/transaction.js +127 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/transaction.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/upstream.js +179 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/upstream.js.map +1 -0
- package/dist/esm/plugins/replication-mongodb/index.js +197 -0
- package/dist/esm/plugins/replication-mongodb/index.js.map +1 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-checkpoint.js +131 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-checkpoint.js.map +1 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-helper.js +45 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-helper.js.map +1 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-types.js +3 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-types.js.map +1 -0
- package/dist/esm/plugins/replication-nats/index.js +199 -0
- package/dist/esm/plugins/replication-nats/index.js.map +1 -0
- package/dist/esm/plugins/replication-nats/nats-helper.js +7 -0
- package/dist/esm/plugins/replication-nats/nats-helper.js.map +1 -0
- package/dist/esm/plugins/replication-nats/nats-types.js +3 -0
- package/dist/esm/plugins/replication-nats/nats-types.js.map +1 -0
- package/dist/esm/plugins/replication-supabase/helper.js +35 -0
- package/dist/esm/plugins/replication-supabase/helper.js.map +1 -0
- package/dist/esm/plugins/replication-supabase/index.js +231 -0
- package/dist/esm/plugins/replication-supabase/index.js.map +1 -0
- package/dist/esm/plugins/replication-supabase/types.js +3 -0
- package/dist/esm/plugins/replication-supabase/types.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-p2pcf.js +78 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-p2pcf.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-simple-peer.js +192 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-simple-peer.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-webtorrent.js +136 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-webtorrent.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/index.js +207 -0
- package/dist/esm/plugins/replication-webrtc/index.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/signaling-server.js +144 -0
- package/dist/esm/plugins/replication-webrtc/signaling-server.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/webrtc-helper.js +26 -0
- package/dist/esm/plugins/replication-webrtc/webrtc-helper.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/webrtc-types.js +3 -0
- package/dist/esm/plugins/replication-webrtc/webrtc-types.js.map +1 -0
- package/dist/esm/plugins/replication-websocket/index.js +4 -0
- package/dist/esm/plugins/replication-websocket/index.js.map +1 -0
- package/dist/esm/plugins/replication-websocket/websocket-client.js +125 -0
- package/dist/esm/plugins/replication-websocket/websocket-client.js.map +1 -0
- package/dist/esm/plugins/replication-websocket/websocket-server.js +100 -0
- package/dist/esm/plugins/replication-websocket/websocket-server.js.map +1 -0
- package/dist/esm/plugins/replication-websocket/websocket-types.js +3 -0
- package/dist/esm/plugins/replication-websocket/websocket-types.js.map +1 -0
- package/dist/esm/plugins/state/helpers.js +73 -0
- package/dist/esm/plugins/state/helpers.js.map +1 -0
- package/dist/esm/plugins/state/index.js +20 -0
- package/dist/esm/plugins/state/index.js.map +1 -0
- package/dist/esm/plugins/state/rx-state.js +285 -0
- package/dist/esm/plugins/state/rx-state.js.map +1 -0
- package/dist/esm/plugins/state/types.js +3 -0
- package/dist/esm/plugins/state/types.js.map +1 -0
- package/dist/esm/plugins/storage-denokv/denokv-helper.js +40 -0
- package/dist/esm/plugins/storage-denokv/denokv-helper.js.map +1 -0
- package/dist/esm/plugins/storage-denokv/denokv-query.js +93 -0
- package/dist/esm/plugins/storage-denokv/denokv-query.js.map +1 -0
- package/dist/esm/plugins/storage-denokv/denokv-types.js +3 -0
- package/dist/esm/plugins/storage-denokv/denokv-types.js.map +1 -0
- package/dist/esm/plugins/storage-denokv/index.js +24 -0
- package/dist/esm/plugins/storage-denokv/index.js.map +1 -0
- package/dist/esm/plugins/storage-denokv/rx-storage-instance-denokv.js +325 -0
- package/dist/esm/plugins/storage-denokv/rx-storage-instance-denokv.js.map +1 -0
- package/dist/esm/plugins/storage-dexie/dexie-helper.js +241 -0
- package/dist/esm/plugins/storage-dexie/dexie-helper.js.map +1 -0
- package/dist/esm/plugins/storage-dexie/dexie-query.js +169 -0
- package/dist/esm/plugins/storage-dexie/dexie-query.js.map +1 -0
- package/dist/esm/plugins/storage-dexie/index.js +5 -0
- package/dist/esm/plugins/storage-dexie/index.js.map +1 -0
- package/dist/esm/plugins/storage-dexie/rx-storage-dexie.js +39 -0
- package/dist/esm/plugins/storage-dexie/rx-storage-dexie.js.map +1 -0
- package/dist/esm/plugins/storage-dexie/rx-storage-instance-dexie.js +222 -0
- package/dist/esm/plugins/storage-dexie/rx-storage-instance-dexie.js.map +1 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-helpers.js +6 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-helpers.js.map +1 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-query.js +90 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-query.js.map +1 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-types.js +3 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-types.js.map +1 -0
- package/dist/esm/plugins/storage-foundationdb/index.js +31 -0
- package/dist/esm/plugins/storage-foundationdb/index.js.map +1 -0
- package/dist/esm/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js +302 -0
- package/dist/esm/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js.map +1 -0
- package/dist/esm/plugins/storage-localstorage/index.js +23 -0
- package/dist/esm/plugins/storage-localstorage/index.js.map +1 -0
- package/dist/esm/plugins/storage-localstorage/localstorage-mock.js +33 -0
- package/dist/esm/plugins/storage-localstorage/localstorage-mock.js.map +1 -0
- package/dist/esm/plugins/storage-localstorage/rx-storage-instance-localstorage.js +432 -0
- package/dist/esm/plugins/storage-localstorage/rx-storage-instance-localstorage.js.map +1 -0
- package/dist/esm/plugins/storage-memory/binary-search-bounds.js +103 -0
- package/dist/esm/plugins/storage-memory/binary-search-bounds.js.map +1 -0
- package/dist/esm/plugins/storage-memory/index.js +29 -0
- package/dist/esm/plugins/storage-memory/index.js.map +1 -0
- package/dist/esm/plugins/storage-memory/memory-helper.js +165 -0
- package/dist/esm/plugins/storage-memory/memory-helper.js.map +1 -0
- package/dist/esm/plugins/storage-memory/memory-indexes.js +21 -0
- package/dist/esm/plugins/storage-memory/memory-indexes.js.map +1 -0
- package/dist/esm/plugins/storage-memory/memory-types.js +3 -0
- package/dist/esm/plugins/storage-memory/memory-types.js.map +1 -0
- package/dist/esm/plugins/storage-memory/rx-storage-instance-memory.js +364 -0
- package/dist/esm/plugins/storage-memory/rx-storage-instance-memory.js.map +1 -0
- package/dist/esm/plugins/storage-mongodb/index.js +5 -0
- package/dist/esm/plugins/storage-mongodb/index.js.map +1 -0
- package/dist/esm/plugins/storage-mongodb/mongodb-helper.js +85 -0
- package/dist/esm/plugins/storage-mongodb/mongodb-helper.js.map +1 -0
- package/dist/esm/plugins/storage-mongodb/mongodb-types.js +3 -0
- package/dist/esm/plugins/storage-mongodb/mongodb-types.js.map +1 -0
- package/dist/esm/plugins/storage-mongodb/rx-storage-instance-mongodb.js +316 -0
- package/dist/esm/plugins/storage-mongodb/rx-storage-instance-mongodb.js.map +1 -0
- package/dist/esm/plugins/storage-mongodb/rx-storage-mongodb.js +22 -0
- package/dist/esm/plugins/storage-mongodb/rx-storage-mongodb.js.map +1 -0
- package/dist/esm/plugins/storage-remote/index.js +6 -0
- package/dist/esm/plugins/storage-remote/index.js.map +1 -0
- package/dist/esm/plugins/storage-remote/message-channel-cache.js +44 -0
- package/dist/esm/plugins/storage-remote/message-channel-cache.js.map +1 -0
- package/dist/esm/plugins/storage-remote/remote.js +212 -0
- package/dist/esm/plugins/storage-remote/remote.js.map +1 -0
- package/dist/esm/plugins/storage-remote/rx-storage-remote.js +193 -0
- package/dist/esm/plugins/storage-remote/rx-storage-remote.js.map +1 -0
- package/dist/esm/plugins/storage-remote/storage-remote-helpers.js +18 -0
- package/dist/esm/plugins/storage-remote/storage-remote-helpers.js.map +1 -0
- package/dist/esm/plugins/storage-remote/storage-remote-types.js +3 -0
- package/dist/esm/plugins/storage-remote/storage-remote-types.js.map +1 -0
- package/dist/esm/plugins/storage-remote-websocket/index.js +161 -0
- package/dist/esm/plugins/storage-remote-websocket/index.js.map +1 -0
- package/dist/esm/plugins/storage-remote-websocket/types.js +3 -0
- package/dist/esm/plugins/storage-remote-websocket/types.js.map +1 -0
- package/dist/esm/plugins/storage-sqlite/index.js +31 -0
- package/dist/esm/plugins/storage-sqlite/index.js.map +1 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-basics-helpers.js +510 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-basics-helpers.js.map +1 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-helpers.js +187 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-helpers.js.map +1 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-storage-instance.js +283 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-storage-instance.js.map +1 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-types.js +3 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-types.js.map +1 -0
- package/dist/esm/plugins/test-utils/config.js +104 -0
- package/dist/esm/plugins/test-utils/config.js.map +1 -0
- package/dist/esm/plugins/test-utils/humans-collection.js +397 -0
- package/dist/esm/plugins/test-utils/humans-collection.js.map +1 -0
- package/dist/esm/plugins/test-utils/index.js +22 -0
- package/dist/esm/plugins/test-utils/index.js.map +1 -0
- package/dist/esm/plugins/test-utils/performance.js +267 -0
- package/dist/esm/plugins/test-utils/performance.js.map +1 -0
- package/dist/esm/plugins/test-utils/replication-base-test-suite.js +170 -0
- package/dist/esm/plugins/test-utils/replication-base-test-suite.js.map +1 -0
- package/dist/esm/plugins/test-utils/replication.js +46 -0
- package/dist/esm/plugins/test-utils/replication.js.map +1 -0
- package/dist/esm/plugins/test-utils/revisions.js +5 -0
- package/dist/esm/plugins/test-utils/revisions.js.map +1 -0
- package/dist/esm/plugins/test-utils/schema-objects.js +283 -0
- package/dist/esm/plugins/test-utils/schema-objects.js.map +1 -0
- package/dist/esm/plugins/test-utils/schemas.js +1244 -0
- package/dist/esm/plugins/test-utils/schemas.js.map +1 -0
- package/dist/esm/plugins/test-utils/test-util.js +62 -0
- package/dist/esm/plugins/test-utils/test-util.js.map +1 -0
- package/dist/esm/plugins/update/index.js +35 -0
- package/dist/esm/plugins/update/index.js.map +1 -0
- package/dist/esm/plugins/update/mingo-updater.js +13 -0
- package/dist/esm/plugins/update/mingo-updater.js.map +1 -0
- package/dist/esm/plugins/utils/index.js +21 -0
- package/dist/esm/plugins/utils/index.js.map +1 -0
- package/dist/esm/plugins/utils/utils-array.js +130 -0
- package/dist/esm/plugins/utils/utils-array.js.map +1 -0
- package/dist/esm/plugins/utils/utils-base64.js +48 -0
- package/dist/esm/plugins/utils/utils-base64.js.map +1 -0
- package/dist/esm/plugins/utils/utils-blob.js +54 -0
- package/dist/esm/plugins/utils/utils-blob.js.map +1 -0
- package/dist/esm/plugins/utils/utils-document.js +87 -0
- package/dist/esm/plugins/utils/utils-document.js.map +1 -0
- package/dist/esm/plugins/utils/utils-error.js +36 -0
- package/dist/esm/plugins/utils/utils-error.js.map +1 -0
- package/dist/esm/plugins/utils/utils-global.js +6 -0
- package/dist/esm/plugins/utils/utils-global.js.map +1 -0
- package/dist/esm/plugins/utils/utils-hash.js +51 -0
- package/dist/esm/plugins/utils/utils-hash.js.map +1 -0
- package/dist/esm/plugins/utils/utils-map.js +18 -0
- package/dist/esm/plugins/utils/utils-map.js.map +1 -0
- package/dist/esm/plugins/utils/utils-number.js +10 -0
- package/dist/esm/plugins/utils/utils-number.js.map +1 -0
- package/dist/esm/plugins/utils/utils-object-deep-equal.js +36 -0
- package/dist/esm/plugins/utils/utils-object-deep-equal.js.map +1 -0
- package/dist/esm/plugins/utils/utils-object-dot-prop.js +296 -0
- package/dist/esm/plugins/utils/utils-object-dot-prop.js.map +1 -0
- package/dist/esm/plugins/utils/utils-object.js +228 -0
- package/dist/esm/plugins/utils/utils-object.js.map +1 -0
- package/dist/esm/plugins/utils/utils-other.js +58 -0
- package/dist/esm/plugins/utils/utils-other.js.map +1 -0
- package/dist/esm/plugins/utils/utils-premium.js +30 -0
- package/dist/esm/plugins/utils/utils-premium.js.map +1 -0
- package/dist/esm/plugins/utils/utils-promise.js +134 -0
- package/dist/esm/plugins/utils/utils-promise.js.map +1 -0
- package/dist/esm/plugins/utils/utils-regex.js +3 -0
- package/dist/esm/plugins/utils/utils-regex.js.map +1 -0
- package/dist/esm/plugins/utils/utils-revision.js +53 -0
- package/dist/esm/plugins/utils/utils-revision.js.map +1 -0
- package/dist/esm/plugins/utils/utils-rxdb-version.js +5 -0
- package/dist/esm/plugins/utils/utils-rxdb-version.js.map +1 -0
- package/dist/esm/plugins/utils/utils-rxdb-version.template.js +5 -0
- package/dist/esm/plugins/utils/utils-rxdb-version.template.js.map +1 -0
- package/dist/esm/plugins/utils/utils-string.js +83 -0
- package/dist/esm/plugins/utils/utils-string.js.map +1 -0
- package/dist/esm/plugins/utils/utils-time.js +36 -0
- package/dist/esm/plugins/utils/utils-time.js.map +1 -0
- package/dist/esm/plugins/validate-ajv/index.js +43 -0
- package/dist/esm/plugins/validate-ajv/index.js.map +1 -0
- package/dist/esm/plugins/validate-is-my-json-valid/index.js +20 -0
- package/dist/esm/plugins/validate-is-my-json-valid/index.js.map +1 -0
- package/dist/esm/plugins/validate-z-schema/index.js +47 -0
- package/dist/esm/plugins/validate-z-schema/index.js.map +1 -0
- package/dist/esm/plugins/vector/helper.js +2 -0
- package/dist/esm/plugins/vector/helper.js.map +1 -0
- package/dist/esm/plugins/vector/index.js +2 -0
- package/dist/esm/plugins/vector/index.js.map +1 -0
- package/dist/esm/plugins/vector/types.js +3 -0
- package/dist/esm/plugins/vector/types.js.map +1 -0
- package/dist/esm/plugins/vector/vector-distance.js +29 -0
- package/dist/esm/plugins/vector/vector-distance.js.map +1 -0
- package/dist/esm/plugins/webmcp/index.js +3 -0
- package/dist/esm/plugins/webmcp/index.js.map +1 -0
- package/dist/esm/plugins/webmcp/nosql-query-schema.js +354 -0
- package/dist/esm/plugins/webmcp/nosql-query-schema.js.map +1 -0
- package/dist/esm/plugins/webmcp/webmcp.js +307 -0
- package/dist/esm/plugins/webmcp/webmcp.js.map +1 -0
- package/dist/esm/query-cache.js +99 -0
- package/dist/esm/query-cache.js.map +1 -0
- package/dist/esm/query-planner.js +297 -0
- package/dist/esm/query-planner.js.map +1 -0
- package/dist/esm/replication-protocol/checkpoint.js +95 -0
- package/dist/esm/replication-protocol/checkpoint.js.map +1 -0
- package/dist/esm/replication-protocol/conflicts.js +31 -0
- package/dist/esm/replication-protocol/conflicts.js.map +1 -0
- package/dist/esm/replication-protocol/default-conflict-handler.js +33 -0
- package/dist/esm/replication-protocol/default-conflict-handler.js.map +1 -0
- package/dist/esm/replication-protocol/downstream.js +334 -0
- package/dist/esm/replication-protocol/downstream.js.map +1 -0
- package/dist/esm/replication-protocol/helper.js +49 -0
- package/dist/esm/replication-protocol/helper.js.map +1 -0
- package/dist/esm/replication-protocol/index.js +221 -0
- package/dist/esm/replication-protocol/index.js.map +1 -0
- package/dist/esm/replication-protocol/meta-instance.js +121 -0
- package/dist/esm/replication-protocol/meta-instance.js.map +1 -0
- package/dist/esm/replication-protocol/upstream.js +379 -0
- package/dist/esm/replication-protocol/upstream.js.map +1 -0
- package/dist/esm/rx-change-event.js +103 -0
- package/dist/esm/rx-change-event.js.map +1 -0
- package/dist/esm/rx-collection-helper.js +196 -0
- package/dist/esm/rx-collection-helper.js.map +1 -0
- package/dist/esm/rx-collection.js +923 -0
- package/dist/esm/rx-collection.js.map +1 -0
- package/dist/esm/rx-database-internal-store.js +270 -0
- package/dist/esm/rx-database-internal-store.js.map +1 -0
- package/dist/esm/rx-database.js +670 -0
- package/dist/esm/rx-database.js.map +1 -0
- package/dist/esm/rx-document-prototype-merge.js +78 -0
- package/dist/esm/rx-document-prototype-merge.js.map +1 -0
- package/dist/esm/rx-document.js +394 -0
- package/dist/esm/rx-document.js.map +1 -0
- package/dist/esm/rx-error.js +153 -0
- package/dist/esm/rx-error.js.map +1 -0
- package/dist/esm/rx-query-helper.js +268 -0
- package/dist/esm/rx-query-helper.js.map +1 -0
- package/dist/esm/rx-query-mingo.js +54 -0
- package/dist/esm/rx-query-mingo.js.map +1 -0
- package/dist/esm/rx-query-single-result.js +98 -0
- package/dist/esm/rx-query-single-result.js.map +1 -0
- package/dist/esm/rx-query.js +690 -0
- package/dist/esm/rx-query.js.map +1 -0
- package/dist/esm/rx-schema-helper.js +316 -0
- package/dist/esm/rx-schema-helper.js.map +1 -0
- package/dist/esm/rx-schema.js +177 -0
- package/dist/esm/rx-schema.js.map +1 -0
- package/dist/esm/rx-storage-helper.js +785 -0
- package/dist/esm/rx-storage-helper.js.map +1 -0
- package/dist/esm/rx-storage-multiinstance.js +113 -0
- package/dist/esm/rx-storage-multiinstance.js.map +1 -0
- package/dist/esm/types/conflict-handling.d.js +3 -0
- package/dist/esm/types/conflict-handling.d.js.map +1 -0
- package/dist/esm/types/couchdb.d.js +3 -0
- package/dist/esm/types/couchdb.d.js.map +1 -0
- package/dist/esm/types/index.d.js +2 -0
- package/dist/esm/types/index.d.js.map +1 -0
- package/dist/esm/types/modules/index.d.js +2 -0
- package/dist/esm/types/modules/index.d.js.map +1 -0
- package/dist/esm/types/modules/mocha.parallel.d.js +2 -0
- package/dist/esm/types/modules/mocha.parallel.d.js.map +1 -0
- package/dist/esm/types/plugins/backup.d.js +3 -0
- package/dist/esm/types/plugins/backup.d.js.map +1 -0
- package/dist/esm/types/plugins/cleanup.d.js +3 -0
- package/dist/esm/types/plugins/cleanup.d.js.map +1 -0
- package/dist/esm/types/plugins/crdt.d.js +3 -0
- package/dist/esm/types/plugins/crdt.d.js.map +1 -0
- package/dist/esm/types/plugins/dexie.d.js +3 -0
- package/dist/esm/types/plugins/dexie.d.js.map +1 -0
- package/dist/esm/types/plugins/local-documents.d.js +3 -0
- package/dist/esm/types/plugins/local-documents.d.js.map +1 -0
- package/dist/esm/types/plugins/migration.d.js +3 -0
- package/dist/esm/types/plugins/migration.d.js.map +1 -0
- package/dist/esm/types/plugins/reactivity.d.js +3 -0
- package/dist/esm/types/plugins/reactivity.d.js.map +1 -0
- package/dist/esm/types/plugins/replication-graphql.d.js +3 -0
- package/dist/esm/types/plugins/replication-graphql.d.js.map +1 -0
- package/dist/esm/types/plugins/replication.d.js +3 -0
- package/dist/esm/types/plugins/replication.d.js.map +1 -0
- package/dist/esm/types/plugins/state.d.js +3 -0
- package/dist/esm/types/plugins/state.d.js.map +1 -0
- package/dist/esm/types/plugins/update.d.js +3 -0
- package/dist/esm/types/plugins/update.d.js.map +1 -0
- package/dist/esm/types/plugins/webmcp.d.js +3 -0
- package/dist/esm/types/plugins/webmcp.d.js.map +1 -0
- package/dist/esm/types/query-planner.d.js +3 -0
- package/dist/esm/types/query-planner.d.js.map +1 -0
- package/dist/esm/types/replication-protocol.d.js +3 -0
- package/dist/esm/types/replication-protocol.d.js.map +1 -0
- package/dist/esm/types/rx-attachment.d.js +3 -0
- package/dist/esm/types/rx-attachment.d.js.map +1 -0
- package/dist/esm/types/rx-change-event.d.js +3 -0
- package/dist/esm/types/rx-change-event.d.js.map +1 -0
- package/dist/esm/types/rx-collection.d.js +3 -0
- package/dist/esm/types/rx-collection.d.js.map +1 -0
- package/dist/esm/types/rx-database-internal-store.d.js +3 -0
- package/dist/esm/types/rx-database-internal-store.d.js.map +1 -0
- package/dist/esm/types/rx-database.d.js +3 -0
- package/dist/esm/types/rx-database.d.js.map +1 -0
- package/dist/esm/types/rx-document.d.js +3 -0
- package/dist/esm/types/rx-document.d.js.map +1 -0
- package/dist/esm/types/rx-error.d.js +3 -0
- package/dist/esm/types/rx-error.d.js.map +1 -0
- package/dist/esm/types/rx-plugin.d.js +3 -0
- package/dist/esm/types/rx-plugin.d.js.map +1 -0
- package/dist/esm/types/rx-query.d.js +3 -0
- package/dist/esm/types/rx-query.d.js.map +1 -0
- package/dist/esm/types/rx-schema.d.js +3 -0
- package/dist/esm/types/rx-schema.d.js.map +1 -0
- package/dist/esm/types/rx-storage.d.js +3 -0
- package/dist/esm/types/rx-storage.d.js.map +1 -0
- package/dist/esm/types/rx-storage.interface.d.js +3 -0
- package/dist/esm/types/rx-storage.interface.d.js.map +1 -0
- package/dist/esm/types/util.d.js +3 -0
- package/dist/esm/types/util.d.js.map +1 -0
- package/dist/types/change-event-buffer.d.ts +50 -0
- package/dist/types/custom-index.d.ts +58 -0
- package/dist/types/doc-cache.d.ts +96 -0
- package/dist/types/event-reduce.d.ts +15 -0
- package/dist/types/hooks.d.ts +109 -0
- package/dist/types/incremental-write.d.ts +29 -0
- package/dist/types/index.d.ts +30 -0
- package/dist/types/overwritable.d.ts +26 -0
- package/dist/types/plugin-helpers.d.ts +30 -0
- package/dist/types/plugin.d.ts +6 -0
- package/dist/types/plugins/attachments/attachments-utils.d.ts +10 -0
- package/dist/types/plugins/attachments/index.d.ts +42 -0
- package/dist/types/plugins/attachments-compression/index.d.ts +38 -0
- package/dist/types/plugins/backup/file-util.d.ts +17 -0
- package/dist/types/plugins/backup/index.d.ts +37 -0
- package/dist/types/plugins/cleanup/cleanup-helper.d.ts +2 -0
- package/dist/types/plugins/cleanup/cleanup-state.d.ts +7 -0
- package/dist/types/plugins/cleanup/cleanup.d.ts +8 -0
- package/dist/types/plugins/cleanup/index.d.ts +4 -0
- package/dist/types/plugins/crdt/index.d.ts +12 -0
- package/dist/types/plugins/dev-mode/check-document.d.ts +9 -0
- package/dist/types/plugins/dev-mode/check-migration-strategies.d.ts +6 -0
- package/dist/types/plugins/dev-mode/check-orm.d.ts +7 -0
- package/dist/types/plugins/dev-mode/check-query.d.ts +21 -0
- package/dist/types/plugins/dev-mode/check-schema.d.ts +18 -0
- package/dist/types/plugins/dev-mode/dev-mode-tracking.d.ts +4 -0
- package/dist/types/plugins/dev-mode/entity-properties.d.ts +3 -0
- package/dist/types/plugins/dev-mode/error-messages.d.ts +1230 -0
- package/dist/types/plugins/dev-mode/index.d.ts +19 -0
- package/dist/types/plugins/dev-mode/unallowed-properties.d.ts +20 -0
- package/dist/types/plugins/electron/electron-helper.d.ts +2 -0
- package/dist/types/plugins/electron/index.d.ts +3 -0
- package/dist/types/plugins/electron/rx-storage-ipc-main.d.ts +10 -0
- package/dist/types/plugins/electron/rx-storage-ipc-renderer.d.ts +13 -0
- package/dist/types/plugins/encryption-crypto-js/index.d.ts +10 -0
- package/dist/types/plugins/flutter/index.d.ts +11 -0
- package/dist/types/plugins/json-dump/index.d.ts +2 -0
- package/dist/types/plugins/key-compression/index.d.ts +18 -0
- package/dist/types/plugins/leader-election/index.d.ts +25 -0
- package/dist/types/plugins/local-documents/index.d.ts +6 -0
- package/dist/types/plugins/local-documents/local-documents-helper.d.ts +9 -0
- package/dist/types/plugins/local-documents/local-documents.d.ts +14 -0
- package/dist/types/plugins/local-documents/rx-local-document.d.ts +11 -0
- package/dist/types/plugins/migration-schema/index.d.ts +8 -0
- package/dist/types/plugins/migration-schema/migration-helpers.d.ts +29 -0
- package/dist/types/plugins/migration-schema/migration-types.d.ts +33 -0
- package/dist/types/plugins/migration-schema/rx-migration-state.d.ts +50 -0
- package/dist/types/plugins/migration-storage/index.d.ts +32 -0
- package/dist/types/plugins/pipeline/flagged-functions.d.ts +69 -0
- package/dist/types/plugins/pipeline/index.d.ts +5 -0
- package/dist/types/plugins/pipeline/rx-pipeline.d.ts +37 -0
- package/dist/types/plugins/pipeline/types.d.ts +17 -0
- package/dist/types/plugins/query-builder/index.d.ts +5 -0
- package/dist/types/plugins/query-builder/mquery/mquery-utils.d.ts +12 -0
- package/dist/types/plugins/query-builder/mquery/nosql-query-builder.d.ts +165 -0
- package/dist/types/plugins/react/database-context.d.ts +4 -0
- package/dist/types/plugins/react/database-provider.d.ts +24 -0
- package/dist/types/plugins/react/hooks/index.d.ts +4 -0
- package/dist/types/plugins/react/hooks/use-live-rx-query.d.ts +11 -0
- package/dist/types/plugins/react/hooks/use-rx-collection.d.ts +10 -0
- package/dist/types/plugins/react/hooks/use-rx-database.d.ts +9 -0
- package/dist/types/plugins/react/hooks/use-rx-query.d.ts +24 -0
- package/dist/types/plugins/react/index.d.ts +2 -0
- package/dist/types/plugins/reactivity-angular/index.d.ts +16 -0
- package/dist/types/plugins/reactivity-preact-signals/index.d.ts +27 -0
- package/dist/types/plugins/reactivity-vue/index.d.ts +17 -0
- package/dist/types/plugins/replication/index.d.ts +84 -0
- package/dist/types/plugins/replication/replication-helper.d.ts +23 -0
- package/dist/types/plugins/replication-appwrite/appwrite-helpers.d.ts +3 -0
- package/dist/types/plugins/replication-appwrite/appwrite-types.d.ts +16 -0
- package/dist/types/plugins/replication-appwrite/index.d.ts +14 -0
- package/dist/types/plugins/replication-couchdb/couchdb-helper.d.ts +19 -0
- package/dist/types/plugins/replication-couchdb/couchdb-types.d.ts +22 -0
- package/dist/types/plugins/replication-couchdb/index.d.ts +18 -0
- package/dist/types/plugins/replication-firestore/firestore-helper.d.ts +10 -0
- package/dist/types/plugins/replication-firestore/firestore-types.d.ts +46 -0
- package/dist/types/plugins/replication-firestore/index.d.ts +17 -0
- package/dist/types/plugins/replication-google-drive/document-handling.d.ts +13 -0
- package/dist/types/plugins/replication-google-drive/downstream.d.ts +10 -0
- package/dist/types/plugins/replication-google-drive/google-drive-helper.d.ts +35 -0
- package/dist/types/plugins/replication-google-drive/google-drive-types.d.ts +67 -0
- package/dist/types/plugins/replication-google-drive/index.d.ts +39 -0
- package/dist/types/plugins/replication-google-drive/init.d.ts +29 -0
- package/dist/types/plugins/replication-google-drive/multipart.d.ts +10 -0
- package/dist/types/plugins/replication-google-drive/signaling.d.ts +41 -0
- package/dist/types/plugins/replication-google-drive/transaction.d.ts +22 -0
- package/dist/types/plugins/replication-google-drive/upstream.d.ts +24 -0
- package/dist/types/plugins/replication-graphql/graphql-schema-from-rx-schema.d.ts +51 -0
- package/dist/types/plugins/replication-graphql/graphql-websocket.d.ts +12 -0
- package/dist/types/plugins/replication-graphql/helper.d.ts +15 -0
- package/dist/types/plugins/replication-graphql/index.d.ts +26 -0
- package/dist/types/plugins/replication-graphql/query-builder-from-rx-schema.d.ts +5 -0
- package/dist/types/plugins/replication-microsoft-onedrive/document-handling.d.ts +14 -0
- package/dist/types/plugins/replication-microsoft-onedrive/downstream.d.ts +10 -0
- package/dist/types/plugins/replication-microsoft-onedrive/index.d.ts +38 -0
- package/dist/types/plugins/replication-microsoft-onedrive/init.d.ts +29 -0
- package/dist/types/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.d.ts +30 -0
- package/dist/types/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.d.ts +71 -0
- package/dist/types/plugins/replication-microsoft-onedrive/signaling.d.ts +41 -0
- package/dist/types/plugins/replication-microsoft-onedrive/transaction.d.ts +22 -0
- package/dist/types/plugins/replication-microsoft-onedrive/upstream.d.ts +25 -0
- package/dist/types/plugins/replication-mongodb/index.d.ts +22 -0
- package/dist/types/plugins/replication-mongodb/mongodb-checkpoint.d.ts +15 -0
- package/dist/types/plugins/replication-mongodb/mongodb-helper.d.ts +13 -0
- package/dist/types/plugins/replication-mongodb/mongodb-types.d.ts +33 -0
- package/dist/types/plugins/replication-nats/index.d.ts +16 -0
- package/dist/types/plugins/replication-nats/nats-helper.d.ts +2 -0
- package/dist/types/plugins/replication-nats/nats-types.d.ts +21 -0
- package/dist/types/plugins/replication-supabase/helper.d.ts +5 -0
- package/dist/types/plugins/replication-supabase/index.d.ts +14 -0
- package/dist/types/plugins/replication-supabase/types.d.ts +28 -0
- package/dist/types/plugins/replication-webrtc/connection-handler-p2pcf.d.ts +0 -0
- package/dist/types/plugins/replication-webrtc/connection-handler-simple-peer.d.ts +57 -0
- package/dist/types/plugins/replication-webrtc/connection-handler-webtorrent.d.ts +0 -0
- package/dist/types/plugins/replication-webrtc/index.d.ts +27 -0
- package/dist/types/plugins/replication-webrtc/signaling-server.d.ts +17 -0
- package/dist/types/plugins/replication-webrtc/webrtc-helper.d.ts +16 -0
- package/dist/types/plugins/replication-webrtc/webrtc-types.d.ts +51 -0
- package/dist/types/plugins/replication-websocket/index.d.ts +3 -0
- package/dist/types/plugins/replication-websocket/websocket-client.d.ts +13 -0
- package/dist/types/plugins/replication-websocket/websocket-server.d.ts +6 -0
- package/dist/types/plugins/replication-websocket/websocket-types.d.ts +32 -0
- package/dist/types/plugins/state/helpers.d.ts +10 -0
- package/dist/types/plugins/state/index.d.ts +4 -0
- package/dist/types/plugins/state/rx-state.d.ts +46 -0
- package/dist/types/plugins/state/types.d.ts +28 -0
- package/dist/types/plugins/storage-denokv/denokv-helper.d.ts +16 -0
- package/dist/types/plugins/storage-denokv/denokv-query.d.ts +3 -0
- package/dist/types/plugins/storage-denokv/denokv-types.d.ts +17 -0
- package/dist/types/plugins/storage-denokv/index.d.ts +11 -0
- package/dist/types/plugins/storage-denokv/rx-storage-instance-denokv.d.ts +41 -0
- package/dist/types/plugins/storage-dexie/dexie-helper.d.ts +40 -0
- package/dist/types/plugins/storage-dexie/dexie-query.d.ts +9 -0
- package/dist/types/plugins/storage-dexie/index.d.ts +4 -0
- package/dist/types/plugins/storage-dexie/rx-storage-dexie.d.ts +11 -0
- package/dist/types/plugins/storage-dexie/rx-storage-instance-dexie.d.ts +29 -0
- package/dist/types/plugins/storage-foundationdb/foundationdb-helpers.d.ts +3 -0
- package/dist/types/plugins/storage-foundationdb/foundationdb-query.d.ts +3 -0
- package/dist/types/plugins/storage-foundationdb/foundationdb-types.d.ts +46 -0
- package/dist/types/plugins/storage-foundationdb/index.d.ts +4 -0
- package/dist/types/plugins/storage-foundationdb/rx-storage-instance-foundationdb.d.ts +26 -0
- package/dist/types/plugins/storage-localstorage/index.d.ts +11 -0
- package/dist/types/plugins/storage-localstorage/localstorage-mock.d.ts +1 -0
- package/dist/types/plugins/storage-localstorage/rx-storage-instance-localstorage.d.ts +84 -0
- package/dist/types/plugins/storage-memory/binary-search-bounds.d.ts +14 -0
- package/dist/types/plugins/storage-memory/index.d.ts +7 -0
- package/dist/types/plugins/storage-memory/memory-helper.d.ts +22 -0
- package/dist/types/plugins/storage-memory/memory-indexes.d.ts +4 -0
- package/dist/types/plugins/storage-memory/memory-types.d.ts +72 -0
- package/dist/types/plugins/storage-memory/rx-storage-instance-memory.d.ts +47 -0
- package/dist/types/plugins/storage-mongodb/index.d.ts +4 -0
- package/dist/types/plugins/storage-mongodb/mongodb-helper.d.ts +22 -0
- package/dist/types/plugins/storage-mongodb/mongodb-types.d.ts +21 -0
- package/dist/types/plugins/storage-mongodb/rx-storage-instance-mongodb.d.ts +52 -0
- package/dist/types/plugins/storage-mongodb/rx-storage-mongodb.d.ts +11 -0
- package/dist/types/plugins/storage-remote/index.d.ts +5 -0
- package/dist/types/plugins/storage-remote/message-channel-cache.d.ts +13 -0
- package/dist/types/plugins/storage-remote/remote.d.ts +6 -0
- package/dist/types/plugins/storage-remote/rx-storage-remote.d.ts +43 -0
- package/dist/types/plugins/storage-remote/storage-remote-helpers.d.ts +4 -0
- package/dist/types/plugins/storage-remote/storage-remote-types.d.ts +88 -0
- package/dist/types/plugins/storage-remote-websocket/index.d.ts +4 -0
- package/dist/types/plugins/storage-remote-websocket/types.d.ts +24 -0
- package/dist/types/plugins/storage-sqlite/index.d.ts +15 -0
- package/dist/types/plugins/storage-sqlite/sqlite-basics-helpers.d.ts +53 -0
- package/dist/types/plugins/storage-sqlite/sqlite-helpers.d.ts +48 -0
- package/dist/types/plugins/storage-sqlite/sqlite-storage-instance.d.ts +38 -0
- package/dist/types/plugins/storage-sqlite/sqlite-types.d.ts +116 -0
- package/dist/types/plugins/test-utils/config.d.ts +16 -0
- package/dist/types/plugins/test-utils/humans-collection.d.ts +26 -0
- package/dist/types/plugins/test-utils/index.d.ts +20 -0
- package/dist/types/plugins/test-utils/performance.d.ts +68 -0
- package/dist/types/plugins/test-utils/replication-base-test-suite.d.ts +66 -0
- package/dist/types/plugins/test-utils/replication.d.ts +10 -0
- package/dist/types/plugins/test-utils/revisions.d.ts +4 -0
- package/dist/types/plugins/test-utils/schema-objects.d.ts +219 -0
- package/dist/types/plugins/test-utils/schemas.d.ts +356 -0
- package/dist/types/plugins/test-utils/test-util.d.ts +10 -0
- package/dist/types/plugins/update/index.d.ts +5 -0
- package/dist/types/plugins/update/mingo-updater.d.ts +2 -0
- package/dist/types/plugins/utils/index.d.ts +20 -0
- package/dist/types/plugins/utils/utils-array.d.ts +40 -0
- package/dist/types/plugins/utils/utils-base64.d.ts +15 -0
- package/dist/types/plugins/utils/utils-blob.d.ts +12 -0
- package/dist/types/plugins/utils/utils-document.d.ts +26 -0
- package/dist/types/plugins/utils/utils-error.d.ts +8 -0
- package/dist/types/plugins/utils/utils-global.d.ts +5 -0
- package/dist/types/plugins/utils/utils-hash.d.ts +4 -0
- package/dist/types/plugins/utils/utils-map.d.ts +2 -0
- package/dist/types/plugins/utils/utils-number.d.ts +7 -0
- package/dist/types/plugins/utils/utils-object-deep-equal.d.ts +7 -0
- package/dist/types/plugins/utils/utils-object-dot-prop.d.ts +14 -0
- package/dist/types/plugins/utils/utils-object.d.ts +61 -0
- package/dist/types/plugins/utils/utils-other.d.ts +20 -0
- package/dist/types/plugins/utils/utils-premium.d.ts +10 -0
- package/dist/types/plugins/utils/utils-promise.d.ts +43 -0
- package/dist/types/plugins/utils/utils-regex.d.ts +2 -0
- package/dist/types/plugins/utils/utils-revision.d.ts +22 -0
- package/dist/types/plugins/utils/utils-rxdb-version.d.ts +4 -0
- package/dist/types/plugins/utils/utils-rxdb-version.template.d.ts +4 -0
- package/dist/types/plugins/utils/utils-string.d.ts +35 -0
- package/dist/types/plugins/utils/utils-time.d.ts +5 -0
- package/dist/types/plugins/validate-ajv/index.d.ts +13 -0
- package/dist/types/plugins/validate-is-my-json-valid/index.d.ts +5 -0
- package/dist/types/plugins/validate-z-schema/index.d.ts +13 -0
- package/dist/types/plugins/vector/helper.d.ts +0 -0
- package/dist/types/plugins/vector/index.d.ts +2 -0
- package/dist/types/plugins/vector/types.d.ts +1 -0
- package/dist/types/plugins/vector/vector-distance.d.ts +13 -0
- package/dist/types/plugins/webmcp/index.d.ts +2 -0
- package/dist/types/plugins/webmcp/nosql-query-schema.d.ts +549 -0
- package/dist/types/plugins/webmcp/webmcp.d.ts +12 -0
- package/dist/types/query-cache.d.ts +35 -0
- package/dist/types/query-planner.d.ts +30 -0
- package/dist/types/replication-protocol/checkpoint.d.ts +8 -0
- package/dist/types/replication-protocol/conflicts.d.ts +10 -0
- package/dist/types/replication-protocol/default-conflict-handler.d.ts +2 -0
- package/dist/types/replication-protocol/downstream.d.ts +10 -0
- package/dist/types/replication-protocol/helper.d.ts +5 -0
- package/dist/types/replication-protocol/index.d.ts +30 -0
- package/dist/types/replication-protocol/meta-instance.d.ts +12 -0
- package/dist/types/replication-protocol/upstream.d.ts +10 -0
- package/dist/types/rx-change-event.d.ts +20 -0
- package/dist/types/rx-collection-helper.d.ts +41 -0
- package/dist/types/rx-collection.d.ts +185 -0
- package/dist/types/rx-database-internal-store.d.ts +37 -0
- package/dist/types/rx-database.d.ts +213 -0
- package/dist/types/rx-document-prototype-merge.d.ts +24 -0
- package/dist/types/rx-document.d.ts +274 -0
- package/dist/types/rx-error.d.ts +37 -0
- package/dist/types/rx-query-helper.d.ts +31 -0
- package/dist/types/rx-query-mingo.d.ts +10 -0
- package/dist/types/rx-query-single-result.d.ts +31 -0
- package/dist/types/rx-query.d.ts +153 -0
- package/dist/types/rx-schema-helper.d.ts +57 -0
- package/dist/types/rx-schema.d.ts +43 -0
- package/dist/types/rx-storage-helper.d.ts +111 -0
- package/dist/types/rx-storage-multiinstance.d.ts +51 -0
- package/dist/types/types/conflict-handling.d.ts +48 -0
- package/dist/types/types/couchdb.d.ts +293 -0
- package/dist/types/types/index.d.ts +32 -0
- package/dist/types/types/modules/index.d.ts +0 -0
- package/dist/types/types/modules/mocha.parallel.d.ts +1 -0
- package/dist/types/types/plugins/backup.d.ts +35 -0
- package/dist/types/types/plugins/cleanup.d.ts +38 -0
- package/dist/types/types/plugins/crdt.d.ts +76 -0
- package/dist/types/types/plugins/dexie.d.ts +30 -0
- package/dist/types/types/plugins/local-documents.d.ts +49 -0
- package/dist/types/types/plugins/migration.d.ts +14 -0
- package/dist/types/types/plugins/reactivity.d.ts +40 -0
- package/dist/types/types/plugins/replication-graphql.d.ts +98 -0
- package/dist/types/types/plugins/replication.d.ts +175 -0
- package/dist/types/types/plugins/state.d.ts +4 -0
- package/dist/types/types/plugins/update.d.ts +23 -0
- package/dist/types/types/plugins/webmcp.d.ts +40 -0
- package/dist/types/types/query-planner.d.ts +47 -0
- package/dist/types/types/replication-protocol.d.ts +296 -0
- package/dist/types/types/rx-attachment.d.ts +46 -0
- package/dist/types/types/rx-change-event.d.ts +85 -0
- package/dist/types/types/rx-collection.d.ts +117 -0
- package/dist/types/types/rx-database-internal-store.d.ts +54 -0
- package/dist/types/types/rx-database.d.ts +124 -0
- package/dist/types/types/rx-document.d.ts +160 -0
- package/dist/types/types/rx-error.d.ts +222 -0
- package/dist/types/types/rx-plugin.d.ts +167 -0
- package/dist/types/types/rx-query.d.ts +144 -0
- package/dist/types/types/rx-schema.d.ts +209 -0
- package/dist/types/types/rx-storage.d.ts +347 -0
- package/dist/types/types/rx-storage.interface.d.ts +312 -0
- package/dist/types/types/util.d.ts +180 -0
- package/eslint.config.mjs +514 -0
- package/package.json +729 -0
- package/plugins/attachments/index.cjs +2 -0
- package/plugins/attachments/index.d.cts +1 -0
- package/plugins/attachments/index.d.mts +1 -0
- package/plugins/attachments/index.mjs +1 -0
- package/plugins/attachments/index.ts +1 -0
- package/plugins/attachments/package.json +18 -0
- package/plugins/attachments-compression/index.cjs +2 -0
- package/plugins/attachments-compression/index.d.cts +1 -0
- package/plugins/attachments-compression/index.d.mts +1 -0
- package/plugins/attachments-compression/index.mjs +1 -0
- package/plugins/attachments-compression/index.ts +1 -0
- package/plugins/attachments-compression/package.json +18 -0
- package/plugins/backup/index.cjs +2 -0
- package/plugins/backup/index.d.cts +1 -0
- package/plugins/backup/index.d.mts +1 -0
- package/plugins/backup/index.mjs +1 -0
- package/plugins/backup/index.ts +1 -0
- package/plugins/backup/package.json +18 -0
- package/plugins/cleanup/index.cjs +2 -0
- package/plugins/cleanup/index.d.cts +1 -0
- package/plugins/cleanup/index.d.mts +1 -0
- package/plugins/cleanup/index.mjs +1 -0
- package/plugins/cleanup/index.ts +1 -0
- package/plugins/cleanup/package.json +18 -0
- package/plugins/core/index.cjs +2 -0
- package/plugins/core/index.d.cts +1 -0
- package/plugins/core/index.d.mts +1 -0
- package/plugins/core/index.mjs +1 -0
- package/plugins/core/index.ts +1 -0
- package/plugins/core/package.json +18 -0
- package/plugins/crdt/index.cjs +2 -0
- package/plugins/crdt/index.d.cts +1 -0
- package/plugins/crdt/index.d.mts +1 -0
- package/plugins/crdt/index.mjs +1 -0
- package/plugins/crdt/index.ts +1 -0
- package/plugins/crdt/package.json +18 -0
- package/plugins/dev-mode/index.cjs +2 -0
- package/plugins/dev-mode/index.d.cts +1 -0
- package/plugins/dev-mode/index.d.mts +1 -0
- package/plugins/dev-mode/index.mjs +1 -0
- package/plugins/dev-mode/index.ts +1 -0
- package/plugins/dev-mode/package.json +18 -0
- package/plugins/electron/index.cjs +2 -0
- package/plugins/electron/index.d.cts +1 -0
- package/plugins/electron/index.d.mts +1 -0
- package/plugins/electron/index.mjs +1 -0
- package/plugins/electron/index.ts +1 -0
- package/plugins/electron/package.json +18 -0
- package/plugins/encryption-crypto-js/index.cjs +2 -0
- package/plugins/encryption-crypto-js/index.d.cts +1 -0
- package/plugins/encryption-crypto-js/index.d.mts +1 -0
- package/plugins/encryption-crypto-js/index.mjs +1 -0
- package/plugins/encryption-crypto-js/index.ts +1 -0
- package/plugins/encryption-crypto-js/package.json +18 -0
- package/plugins/flutter/index.cjs +2 -0
- package/plugins/flutter/index.d.cts +1 -0
- package/plugins/flutter/index.d.mts +1 -0
- package/plugins/flutter/index.mjs +1 -0
- package/plugins/flutter/index.ts +1 -0
- package/plugins/flutter/package.json +18 -0
- package/plugins/json-dump/index.cjs +2 -0
- package/plugins/json-dump/index.d.cts +1 -0
- package/plugins/json-dump/index.d.mts +1 -0
- package/plugins/json-dump/index.mjs +1 -0
- package/plugins/json-dump/index.ts +1 -0
- package/plugins/json-dump/package.json +18 -0
- package/plugins/key-compression/index.cjs +2 -0
- package/plugins/key-compression/index.d.cts +1 -0
- package/plugins/key-compression/index.d.mts +1 -0
- package/plugins/key-compression/index.mjs +1 -0
- package/plugins/key-compression/index.ts +1 -0
- package/plugins/key-compression/package.json +18 -0
- package/plugins/leader-election/index.cjs +2 -0
- package/plugins/leader-election/index.d.cts +1 -0
- package/plugins/leader-election/index.d.mts +1 -0
- package/plugins/leader-election/index.mjs +1 -0
- package/plugins/leader-election/index.ts +1 -0
- package/plugins/leader-election/package.json +18 -0
- package/plugins/local-documents/index.cjs +2 -0
- package/plugins/local-documents/index.d.cts +1 -0
- package/plugins/local-documents/index.d.mts +1 -0
- package/plugins/local-documents/index.mjs +1 -0
- package/plugins/local-documents/index.ts +1 -0
- package/plugins/local-documents/package.json +18 -0
- package/plugins/migration-schema/index.cjs +2 -0
- package/plugins/migration-schema/index.d.cts +1 -0
- package/plugins/migration-schema/index.d.mts +1 -0
- package/plugins/migration-schema/index.mjs +1 -0
- package/plugins/migration-schema/index.ts +1 -0
- package/plugins/migration-schema/package.json +18 -0
- package/plugins/migration-storage/index.cjs +2 -0
- package/plugins/migration-storage/index.d.cts +1 -0
- package/plugins/migration-storage/index.d.mts +1 -0
- package/plugins/migration-storage/index.mjs +1 -0
- package/plugins/migration-storage/index.ts +1 -0
- package/plugins/migration-storage/package.json +18 -0
- package/plugins/pipeline/index.cjs +2 -0
- package/plugins/pipeline/index.d.cts +1 -0
- package/plugins/pipeline/index.d.mts +1 -0
- package/plugins/pipeline/index.mjs +1 -0
- package/plugins/pipeline/index.ts +1 -0
- package/plugins/pipeline/package.json +18 -0
- package/plugins/query-builder/index.cjs +2 -0
- package/plugins/query-builder/index.d.cts +1 -0
- package/plugins/query-builder/index.d.mts +1 -0
- package/plugins/query-builder/index.mjs +1 -0
- package/plugins/query-builder/index.ts +1 -0
- package/plugins/query-builder/package.json +18 -0
- package/plugins/react/index.cjs +2 -0
- package/plugins/react/index.d.cts +1 -0
- package/plugins/react/index.d.mts +1 -0
- package/plugins/react/index.mjs +1 -0
- package/plugins/react/index.ts +1 -0
- package/plugins/react/package.json +18 -0
- package/plugins/reactivity-angular/index.cjs +2 -0
- package/plugins/reactivity-angular/index.d.cts +1 -0
- package/plugins/reactivity-angular/index.d.mts +1 -0
- package/plugins/reactivity-angular/index.mjs +1 -0
- package/plugins/reactivity-angular/index.ts +1 -0
- package/plugins/reactivity-angular/package.json +18 -0
- package/plugins/reactivity-preact-signals/index.cjs +2 -0
- package/plugins/reactivity-preact-signals/index.d.cts +1 -0
- package/plugins/reactivity-preact-signals/index.d.mts +1 -0
- package/plugins/reactivity-preact-signals/index.mjs +1 -0
- package/plugins/reactivity-preact-signals/index.ts +1 -0
- package/plugins/reactivity-preact-signals/package.json +18 -0
- package/plugins/reactivity-vue/index.cjs +2 -0
- package/plugins/reactivity-vue/index.d.cts +1 -0
- package/plugins/reactivity-vue/index.d.mts +1 -0
- package/plugins/reactivity-vue/index.mjs +1 -0
- package/plugins/reactivity-vue/index.ts +1 -0
- package/plugins/reactivity-vue/package.json +18 -0
- package/plugins/replication/index.cjs +2 -0
- package/plugins/replication/index.d.cts +1 -0
- package/plugins/replication/index.d.mts +1 -0
- package/plugins/replication/index.mjs +1 -0
- package/plugins/replication/index.ts +1 -0
- package/plugins/replication/package.json +18 -0
- package/plugins/replication-appwrite/index.cjs +2 -0
- package/plugins/replication-appwrite/index.d.cts +1 -0
- package/plugins/replication-appwrite/index.d.mts +1 -0
- package/plugins/replication-appwrite/index.mjs +1 -0
- package/plugins/replication-appwrite/index.ts +1 -0
- package/plugins/replication-appwrite/package.json +18 -0
- package/plugins/replication-couchdb/index.cjs +2 -0
- package/plugins/replication-couchdb/index.d.cts +1 -0
- package/plugins/replication-couchdb/index.d.mts +1 -0
- package/plugins/replication-couchdb/index.mjs +1 -0
- package/plugins/replication-couchdb/index.ts +1 -0
- package/plugins/replication-couchdb/package.json +18 -0
- package/plugins/replication-firestore/index.cjs +2 -0
- package/plugins/replication-firestore/index.d.cts +1 -0
- package/plugins/replication-firestore/index.d.mts +1 -0
- package/plugins/replication-firestore/index.mjs +1 -0
- package/plugins/replication-firestore/index.ts +1 -0
- package/plugins/replication-firestore/package.json +18 -0
- package/plugins/replication-google-drive/index.cjs +2 -0
- package/plugins/replication-google-drive/index.d.cts +1 -0
- package/plugins/replication-google-drive/index.d.mts +1 -0
- package/plugins/replication-google-drive/index.mjs +1 -0
- package/plugins/replication-google-drive/index.ts +1 -0
- package/plugins/replication-google-drive/package.json +18 -0
- package/plugins/replication-graphql/index.cjs +2 -0
- package/plugins/replication-graphql/index.d.cts +1 -0
- package/plugins/replication-graphql/index.d.mts +1 -0
- package/plugins/replication-graphql/index.mjs +1 -0
- package/plugins/replication-graphql/index.ts +1 -0
- package/plugins/replication-graphql/package.json +18 -0
- package/plugins/replication-microsoft-onedrive/index.cjs +2 -0
- package/plugins/replication-microsoft-onedrive/index.d.cts +1 -0
- package/plugins/replication-microsoft-onedrive/index.d.mts +1 -0
- package/plugins/replication-microsoft-onedrive/index.mjs +1 -0
- package/plugins/replication-microsoft-onedrive/index.ts +1 -0
- package/plugins/replication-microsoft-onedrive/package.json +18 -0
- package/plugins/replication-mongodb/index.cjs +2 -0
- package/plugins/replication-mongodb/index.d.cts +1 -0
- package/plugins/replication-mongodb/index.d.mts +1 -0
- package/plugins/replication-mongodb/index.mjs +1 -0
- package/plugins/replication-mongodb/index.ts +1 -0
- package/plugins/replication-mongodb/package.json +18 -0
- package/plugins/replication-nats/index.cjs +2 -0
- package/plugins/replication-nats/index.d.cts +1 -0
- package/plugins/replication-nats/index.d.mts +1 -0
- package/plugins/replication-nats/index.mjs +1 -0
- package/plugins/replication-nats/index.ts +1 -0
- package/plugins/replication-nats/package.json +18 -0
- package/plugins/replication-supabase/index.cjs +2 -0
- package/plugins/replication-supabase/index.d.cts +1 -0
- package/plugins/replication-supabase/index.d.mts +1 -0
- package/plugins/replication-supabase/index.mjs +1 -0
- package/plugins/replication-supabase/index.ts +1 -0
- package/plugins/replication-supabase/package.json +18 -0
- package/plugins/replication-webrtc/index.cjs +2 -0
- package/plugins/replication-webrtc/index.d.cts +1 -0
- package/plugins/replication-webrtc/index.d.mts +1 -0
- package/plugins/replication-webrtc/index.mjs +1 -0
- package/plugins/replication-webrtc/index.ts +1 -0
- package/plugins/replication-webrtc/package.json +18 -0
- package/plugins/replication-websocket/index.cjs +2 -0
- package/plugins/replication-websocket/index.d.cts +1 -0
- package/plugins/replication-websocket/index.d.mts +1 -0
- package/plugins/replication-websocket/index.mjs +1 -0
- package/plugins/replication-websocket/index.ts +1 -0
- package/plugins/replication-websocket/package.json +18 -0
- package/plugins/state/index.cjs +2 -0
- package/plugins/state/index.d.cts +1 -0
- package/plugins/state/index.d.mts +1 -0
- package/plugins/state/index.mjs +1 -0
- package/plugins/state/index.ts +1 -0
- package/plugins/state/package.json +18 -0
- package/plugins/storage-denokv/index.cjs +2 -0
- package/plugins/storage-denokv/index.d.cts +1 -0
- package/plugins/storage-denokv/index.d.mts +1 -0
- package/plugins/storage-denokv/index.mjs +1 -0
- package/plugins/storage-denokv/index.ts +1 -0
- package/plugins/storage-denokv/package.json +18 -0
- package/plugins/storage-dexie/index.cjs +2 -0
- package/plugins/storage-dexie/index.d.cts +1 -0
- package/plugins/storage-dexie/index.d.mts +1 -0
- package/plugins/storage-dexie/index.mjs +1 -0
- package/plugins/storage-dexie/index.ts +1 -0
- package/plugins/storage-dexie/package.json +18 -0
- package/plugins/storage-foundationdb/index.cjs +2 -0
- package/plugins/storage-foundationdb/index.d.cts +1 -0
- package/plugins/storage-foundationdb/index.d.mts +1 -0
- package/plugins/storage-foundationdb/index.mjs +1 -0
- package/plugins/storage-foundationdb/index.ts +1 -0
- package/plugins/storage-foundationdb/package.json +18 -0
- package/plugins/storage-localstorage/index.cjs +2 -0
- package/plugins/storage-localstorage/index.d.cts +1 -0
- package/plugins/storage-localstorage/index.d.mts +1 -0
- package/plugins/storage-localstorage/index.mjs +1 -0
- package/plugins/storage-localstorage/index.ts +1 -0
- package/plugins/storage-localstorage/package.json +18 -0
- package/plugins/storage-memory/index.cjs +2 -0
- package/plugins/storage-memory/index.d.cts +1 -0
- package/plugins/storage-memory/index.d.mts +1 -0
- package/plugins/storage-memory/index.mjs +1 -0
- package/plugins/storage-memory/index.ts +1 -0
- package/plugins/storage-memory/package.json +18 -0
- package/plugins/storage-mongodb/index.cjs +2 -0
- package/plugins/storage-mongodb/index.d.cts +1 -0
- package/plugins/storage-mongodb/index.d.mts +1 -0
- package/plugins/storage-mongodb/index.mjs +1 -0
- package/plugins/storage-mongodb/index.ts +1 -0
- package/plugins/storage-mongodb/package.json +18 -0
- package/plugins/storage-remote/index.cjs +2 -0
- package/plugins/storage-remote/index.d.cts +1 -0
- package/plugins/storage-remote/index.d.mts +1 -0
- package/plugins/storage-remote/index.mjs +1 -0
- package/plugins/storage-remote/index.ts +1 -0
- package/plugins/storage-remote/package.json +18 -0
- package/plugins/storage-remote-websocket/index.cjs +2 -0
- package/plugins/storage-remote-websocket/index.d.cts +1 -0
- package/plugins/storage-remote-websocket/index.d.mts +1 -0
- package/plugins/storage-remote-websocket/index.mjs +1 -0
- package/plugins/storage-remote-websocket/index.ts +1 -0
- package/plugins/storage-remote-websocket/package.json +18 -0
- package/plugins/storage-sqlite/index.cjs +2 -0
- package/plugins/storage-sqlite/index.d.cts +1 -0
- package/plugins/storage-sqlite/index.d.mts +1 -0
- package/plugins/storage-sqlite/index.mjs +1 -0
- package/plugins/storage-sqlite/index.ts +1 -0
- package/plugins/storage-sqlite/package.json +18 -0
- package/plugins/test-utils/index.cjs +2 -0
- package/plugins/test-utils/index.d.cts +1 -0
- package/plugins/test-utils/index.d.mts +1 -0
- package/plugins/test-utils/index.mjs +1 -0
- package/plugins/test-utils/index.ts +1 -0
- package/plugins/test-utils/package.json +18 -0
- package/plugins/update/index.cjs +2 -0
- package/plugins/update/index.d.cts +1 -0
- package/plugins/update/index.d.mts +1 -0
- package/plugins/update/index.mjs +1 -0
- package/plugins/update/index.ts +1 -0
- package/plugins/update/package.json +18 -0
- package/plugins/utils/index.cjs +2 -0
- package/plugins/utils/index.d.cts +1 -0
- package/plugins/utils/index.d.mts +1 -0
- package/plugins/utils/index.mjs +1 -0
- package/plugins/utils/index.ts +1 -0
- package/plugins/utils/package.json +18 -0
- package/plugins/validate-ajv/index.cjs +2 -0
- package/plugins/validate-ajv/index.d.cts +1 -0
- package/plugins/validate-ajv/index.d.mts +1 -0
- package/plugins/validate-ajv/index.mjs +1 -0
- package/plugins/validate-ajv/index.ts +1 -0
- package/plugins/validate-ajv/package.json +18 -0
- package/plugins/validate-is-my-json-valid/index.cjs +2 -0
- package/plugins/validate-is-my-json-valid/index.d.cts +1 -0
- package/plugins/validate-is-my-json-valid/index.d.mts +1 -0
- package/plugins/validate-is-my-json-valid/index.mjs +1 -0
- package/plugins/validate-is-my-json-valid/index.ts +1 -0
- package/plugins/validate-is-my-json-valid/package.json +18 -0
- package/plugins/validate-z-schema/index.cjs +2 -0
- package/plugins/validate-z-schema/index.d.cts +1 -0
- package/plugins/validate-z-schema/index.d.mts +1 -0
- package/plugins/validate-z-schema/index.mjs +1 -0
- package/plugins/validate-z-schema/index.ts +1 -0
- package/plugins/validate-z-schema/package.json +18 -0
- package/plugins/vector/index.cjs +2 -0
- package/plugins/vector/index.d.cts +1 -0
- package/plugins/vector/index.d.mts +1 -0
- package/plugins/vector/index.mjs +1 -0
- package/plugins/vector/index.ts +1 -0
- package/plugins/vector/package.json +18 -0
- package/plugins/webmcp/index.cjs +2 -0
- package/plugins/webmcp/index.d.cts +1 -0
- package/plugins/webmcp/index.d.mts +1 -0
- package/plugins/webmcp/index.mjs +1 -0
- package/plugins/webmcp/index.ts +1 -0
- package/plugins/webmcp/package.json +18 -0
- package/scripts/acme-challenge/.gittouch +0 -0
- package/scripts/ai-context-generator.mjs +63 -0
- package/scripts/cloud-signaling-script.sh +6 -0
- package/scripts/docs-remove-time.mjs +55 -0
- package/scripts/fix-types.mjs +23 -0
- package/scripts/generate-all-headers.ts +102 -0
- package/scripts/generate-error-messages.mjs +41 -0
- package/scripts/generate-header.ts +226 -0
- package/scripts/generate-plugins-package-json.mjs +133 -0
- package/scripts/install-foundationdb.sh +14 -0
- package/scripts/module_package.json +1 -0
- package/scripts/module_package_no_side.json +1 -0
- package/scripts/postinstall.js +33 -0
- package/scripts/profile.mjs +31 -0
- package/scripts/set-version.mjs +162 -0
- package/scripts/start-cloud-signaling-server.mjs +120 -0
- package/scripts/transpile.mjs +229 -0
- package/scripts/update-version-variable.mjs +49 -0
- package/src/change-event-buffer.ts +171 -0
- package/src/custom-index.ts +376 -0
- package/src/doc-cache.ts +294 -0
- package/src/event-reduce.ts +159 -0
- package/src/hooks.ts +128 -0
- package/src/incremental-write.ts +227 -0
- package/src/index.ts +30 -0
- package/src/overwritable.ts +41 -0
- package/src/plugin-helpers.ts +319 -0
- package/src/plugin.ts +113 -0
- package/src/plugins/attachments/attachments-utils.ts +84 -0
- package/src/plugins/attachments/index.ts +316 -0
- package/src/plugins/attachments-compression/index.ts +221 -0
- package/src/plugins/backup/file-util.ts +132 -0
- package/src/plugins/backup/index.ts +281 -0
- package/src/plugins/cleanup/cleanup-helper.ts +11 -0
- package/src/plugins/cleanup/cleanup-state.ts +92 -0
- package/src/plugins/cleanup/cleanup.ts +140 -0
- package/src/plugins/cleanup/index.ts +45 -0
- package/src/plugins/crdt/index.ts +505 -0
- package/src/plugins/dev-mode/check-document.ts +176 -0
- package/src/plugins/dev-mode/check-migration-strategies.ts +53 -0
- package/src/plugins/dev-mode/check-orm.ts +65 -0
- package/src/plugins/dev-mode/check-query.ts +231 -0
- package/src/plugins/dev-mode/check-schema.ts +564 -0
- package/src/plugins/dev-mode/dev-mode-tracking.ts +125 -0
- package/src/plugins/dev-mode/entity-properties.ts +56 -0
- package/src/plugins/dev-mode/error-messages.ts +1331 -0
- package/src/plugins/dev-mode/index.ts +203 -0
- package/src/plugins/dev-mode/unallowed-properties.ts +96 -0
- package/src/plugins/electron/electron-helper.ts +2 -0
- package/src/plugins/electron/index.ts +3 -0
- package/src/plugins/electron/rx-storage-ipc-main.ts +58 -0
- package/src/plugins/electron/rx-storage-ipc-renderer.ts +62 -0
- package/src/plugins/encryption-crypto-js/index.ts +220 -0
- package/src/plugins/flutter/dart/analysis_options.yaml +30 -0
- package/src/plugins/flutter/dart/example/rxdb_example.dart +6 -0
- package/src/plugins/flutter/dart/lib/rxdb.dart +7 -0
- package/src/plugins/flutter/dart/lib/src/rxdb_base.dart +332 -0
- package/src/plugins/flutter/dart/pubspec.yaml +15 -0
- package/src/plugins/flutter/index.ts +65 -0
- package/src/plugins/json-dump/index.ts +146 -0
- package/src/plugins/key-compression/index.ts +238 -0
- package/src/plugins/leader-election/index.ts +129 -0
- package/src/plugins/local-documents/index.ts +95 -0
- package/src/plugins/local-documents/local-documents-helper.ts +103 -0
- package/src/plugins/local-documents/local-documents.ts +146 -0
- package/src/plugins/local-documents/rx-local-document.ts +388 -0
- package/src/plugins/migration-schema/index.ts +75 -0
- package/src/plugins/migration-schema/migration-helpers.ts +162 -0
- package/src/plugins/migration-schema/migration-types.ts +42 -0
- package/src/plugins/migration-schema/rx-migration-state.ts +632 -0
- package/src/plugins/migration-storage/index.ts +255 -0
- package/src/plugins/pipeline/flagged-functions.ts +131 -0
- package/src/plugins/pipeline/index.ts +18 -0
- package/src/plugins/pipeline/rx-pipeline.ts +303 -0
- package/src/plugins/pipeline/types.ts +28 -0
- package/src/plugins/query-builder/index.ts +81 -0
- package/src/plugins/query-builder/mquery/README.md +5 -0
- package/src/plugins/query-builder/mquery/mquery-utils.ts +37 -0
- package/src/plugins/query-builder/mquery/nosql-query-builder.ts +578 -0
- package/src/plugins/react/database-context.ts +10 -0
- package/src/plugins/react/database-provider.tsx +38 -0
- package/src/plugins/react/hooks/index.ts +4 -0
- package/src/plugins/react/hooks/use-live-rx-query.ts +34 -0
- package/src/plugins/react/hooks/use-rx-collection.ts +73 -0
- package/src/plugins/react/hooks/use-rx-database.ts +35 -0
- package/src/plugins/react/hooks/use-rx-query.ts +168 -0
- package/src/plugins/react/index.ts +2 -0
- package/src/plugins/reactivity-angular/index.ts +32 -0
- package/src/plugins/reactivity-preact-signals/index.ts +85 -0
- package/src/plugins/reactivity-vue/index.ts +43 -0
- package/src/plugins/replication/index.ts +668 -0
- package/src/plugins/replication/replication-helper.ts +122 -0
- package/src/plugins/replication-appwrite/appwrite-helpers.ts +38 -0
- package/src/plugins/replication-appwrite/appwrite-types.ts +31 -0
- package/src/plugins/replication-appwrite/index.ts +269 -0
- package/src/plugins/replication-couchdb/couchdb-helper.ts +100 -0
- package/src/plugins/replication-couchdb/couchdb-types.ts +34 -0
- package/src/plugins/replication-couchdb/index.ts +341 -0
- package/src/plugins/replication-firestore/firestore-helper.ts +79 -0
- package/src/plugins/replication-firestore/firestore-types.ts +72 -0
- package/src/plugins/replication-firestore/index.ts +387 -0
- package/src/plugins/replication-google-drive/AGENTS.md +5 -0
- package/src/plugins/replication-google-drive/document-handling.ts +203 -0
- package/src/plugins/replication-google-drive/download-specs.sh +49 -0
- package/src/plugins/replication-google-drive/downstream.ts +118 -0
- package/src/plugins/replication-google-drive/google-drive-helper.ts +467 -0
- package/src/plugins/replication-google-drive/google-drive-types.ts +84 -0
- package/src/plugins/replication-google-drive/index.ts +221 -0
- package/src/plugins/replication-google-drive/init.ts +108 -0
- package/src/plugins/replication-google-drive/multipart.ts +86 -0
- package/src/plugins/replication-google-drive/signaling.ts +399 -0
- package/src/plugins/replication-google-drive/transaction.ts +222 -0
- package/src/plugins/replication-google-drive/upstream.ts +279 -0
- package/src/plugins/replication-graphql/graphql-schema-from-rx-schema.ts +337 -0
- package/src/plugins/replication-graphql/graphql-websocket.ts +56 -0
- package/src/plugins/replication-graphql/helper.ts +52 -0
- package/src/plugins/replication-graphql/index.ts +255 -0
- package/src/plugins/replication-graphql/query-builder-from-rx-schema.ts +195 -0
- package/src/plugins/replication-microsoft-onedrive/document-handling.ts +216 -0
- package/src/plugins/replication-microsoft-onedrive/downstream.ts +121 -0
- package/src/plugins/replication-microsoft-onedrive/index.ts +220 -0
- package/src/plugins/replication-microsoft-onedrive/init.ts +107 -0
- package/src/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.ts +355 -0
- package/src/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.ts +88 -0
- package/src/plugins/replication-microsoft-onedrive/signaling.ts +333 -0
- package/src/plugins/replication-microsoft-onedrive/transaction.ts +220 -0
- package/src/plugins/replication-microsoft-onedrive/upstream.ts +282 -0
- package/src/plugins/replication-mongodb/index.ts +275 -0
- package/src/plugins/replication-mongodb/mongodb-checkpoint.ts +184 -0
- package/src/plugins/replication-mongodb/mongodb-helper.ts +69 -0
- package/src/plugins/replication-mongodb/mongodb-types.ts +50 -0
- package/src/plugins/replication-nats/index.ts +289 -0
- package/src/plugins/replication-nats/nats-helper.ts +15 -0
- package/src/plugins/replication-nats/nats-types.ts +43 -0
- package/src/plugins/replication-supabase/helper.ts +63 -0
- package/src/plugins/replication-supabase/index.ts +308 -0
- package/src/plugins/replication-supabase/types.ts +47 -0
- package/src/plugins/replication-webrtc/connection-handler-p2pcf.ts +77 -0
- package/src/plugins/replication-webrtc/connection-handler-simple-peer.ts +302 -0
- package/src/plugins/replication-webrtc/connection-handler-webtorrent.ts +137 -0
- package/src/plugins/replication-webrtc/index.ts +307 -0
- package/src/plugins/replication-webrtc/signaling-server.ts +193 -0
- package/src/plugins/replication-webrtc/webrtc-helper.ts +55 -0
- package/src/plugins/replication-webrtc/webrtc-types.ts +91 -0
- package/src/plugins/replication-websocket/index.ts +3 -0
- package/src/plugins/replication-websocket/websocket-client.ts +187 -0
- package/src/plugins/replication-websocket/websocket-server.ts +135 -0
- package/src/plugins/replication-websocket/websocket-types.ts +47 -0
- package/src/plugins/state/helpers.ts +86 -0
- package/src/plugins/state/index.ts +40 -0
- package/src/plugins/state/rx-state.ts +386 -0
- package/src/plugins/state/types.ts +32 -0
- package/src/plugins/storage-denokv/denokv-helper.ts +46 -0
- package/src/plugins/storage-denokv/denokv-query.ts +135 -0
- package/src/plugins/storage-denokv/denokv-types.ts +19 -0
- package/src/plugins/storage-denokv/index.ts +37 -0
- package/src/plugins/storage-denokv/rx-storage-instance-denokv.ts +426 -0
- package/src/plugins/storage-dexie/dexie-helper.ts +302 -0
- package/src/plugins/storage-dexie/dexie-query.ts +252 -0
- package/src/plugins/storage-dexie/index.ts +4 -0
- package/src/plugins/storage-dexie/rx-storage-dexie.ts +62 -0
- package/src/plugins/storage-dexie/rx-storage-instance-dexie.ts +378 -0
- package/src/plugins/storage-foundationdb/foundationdb-helpers.ts +6 -0
- package/src/plugins/storage-foundationdb/foundationdb-query.ts +140 -0
- package/src/plugins/storage-foundationdb/foundationdb-types.ts +64 -0
- package/src/plugins/storage-foundationdb/index.ts +57 -0
- package/src/plugins/storage-foundationdb/rx-storage-instance-foundationdb.ts +449 -0
- package/src/plugins/storage-localstorage/index.ts +44 -0
- package/src/plugins/storage-localstorage/localstorage-mock.ts +32 -0
- package/src/plugins/storage-localstorage/rx-storage-instance-localstorage.ts +686 -0
- package/src/plugins/storage-memory/binary-search-bounds.ts +106 -0
- package/src/plugins/storage-memory/index.ts +52 -0
- package/src/plugins/storage-memory/memory-helper.ts +259 -0
- package/src/plugins/storage-memory/memory-indexes.ts +34 -0
- package/src/plugins/storage-memory/memory-types.ts +90 -0
- package/src/plugins/storage-memory/rx-storage-instance-memory.ts +609 -0
- package/src/plugins/storage-mongodb/index.ts +4 -0
- package/src/plugins/storage-mongodb/mongodb-helper.ts +119 -0
- package/src/plugins/storage-mongodb/mongodb-types.ts +32 -0
- package/src/plugins/storage-mongodb/rx-storage-instance-mongodb.ts +464 -0
- package/src/plugins/storage-mongodb/rx-storage-mongodb.ts +33 -0
- package/src/plugins/storage-remote/index.ts +5 -0
- package/src/plugins/storage-remote/message-channel-cache.ts +88 -0
- package/src/plugins/storage-remote/remote.ts +285 -0
- package/src/plugins/storage-remote/rx-storage-remote.ts +286 -0
- package/src/plugins/storage-remote/storage-remote-helpers.ts +33 -0
- package/src/plugins/storage-remote/storage-remote-types.ts +118 -0
- package/src/plugins/storage-remote-websocket/index.ts +218 -0
- package/src/plugins/storage-remote-websocket/types.ts +34 -0
- package/src/plugins/storage-sqlite/index.ts +64 -0
- package/src/plugins/storage-sqlite/sqlite-basics-helpers.ts +656 -0
- package/src/plugins/storage-sqlite/sqlite-helpers.ts +287 -0
- package/src/plugins/storage-sqlite/sqlite-storage-instance.ts +507 -0
- package/src/plugins/storage-sqlite/sqlite-types.ts +151 -0
- package/src/plugins/test-utils/config.ts +135 -0
- package/src/plugins/test-utils/humans-collection.ts +557 -0
- package/src/plugins/test-utils/index.ts +24 -0
- package/src/plugins/test-utils/performance.ts +344 -0
- package/src/plugins/test-utils/replication-base-test-suite.ts +236 -0
- package/src/plugins/test-utils/replication.ts +95 -0
- package/src/plugins/test-utils/revisions.ts +4 -0
- package/src/plugins/test-utils/schema-objects.ts +527 -0
- package/src/plugins/test-utils/schemas.ts +1391 -0
- package/src/plugins/test-utils/test-util.ts +85 -0
- package/src/plugins/update/index.ts +57 -0
- package/src/plugins/update/mingo-updater.ts +26 -0
- package/src/plugins/utils/index.ts +20 -0
- package/src/plugins/utils/utils-array.ts +152 -0
- package/src/plugins/utils/utils-base64.ts +49 -0
- package/src/plugins/utils/utils-blob.ts +65 -0
- package/src/plugins/utils/utils-document.ts +117 -0
- package/src/plugins/utils/utils-error.ts +53 -0
- package/src/plugins/utils/utils-global.ts +5 -0
- package/src/plugins/utils/utils-hash.ts +62 -0
- package/src/plugins/utils/utils-map.ts +23 -0
- package/src/plugins/utils/utils-number.ts +9 -0
- package/src/plugins/utils/utils-object-deep-equal.ts +46 -0
- package/src/plugins/utils/utils-object-dot-prop.ts +365 -0
- package/src/plugins/utils/utils-object.ts +272 -0
- package/src/plugins/utils/utils-other.ts +58 -0
- package/src/plugins/utils/utils-premium.ts +37 -0
- package/src/plugins/utils/utils-promise.ts +171 -0
- package/src/plugins/utils/utils-regex.ts +2 -0
- package/src/plugins/utils/utils-revision.ts +55 -0
- package/src/plugins/utils/utils-rxdb-version.template.ts +4 -0
- package/src/plugins/utils/utils-rxdb-version.ts +4 -0
- package/src/plugins/utils/utils-string.ts +91 -0
- package/src/plugins/utils/utils-time.ts +37 -0
- package/src/plugins/validate-ajv/index.ts +61 -0
- package/src/plugins/validate-is-my-json-valid/index.ts +30 -0
- package/src/plugins/validate-z-schema/index.ts +58 -0
- package/src/plugins/vector/helper.ts +0 -0
- package/src/plugins/vector/index.ts +2 -0
- package/src/plugins/vector/types.ts +1 -0
- package/src/plugins/vector/vector-distance.ts +34 -0
- package/src/plugins/webmcp/index.ts +2 -0
- package/src/plugins/webmcp/nosql-query-schema.ts +299 -0
- package/src/plugins/webmcp/webmcp.ts +319 -0
- package/src/query-cache.ts +139 -0
- package/src/query-planner.ts +386 -0
- package/src/replication-protocol/checkpoint.ts +154 -0
- package/src/replication-protocol/conflicts.ts +53 -0
- package/src/replication-protocol/default-conflict-handler.ts +43 -0
- package/src/replication-protocol/downstream.ts +550 -0
- package/src/replication-protocol/helper.ts +96 -0
- package/src/replication-protocol/index.ts +348 -0
- package/src/replication-protocol/meta-instance.ts +195 -0
- package/src/replication-protocol/upstream.ts +560 -0
- package/src/rx-change-event.ts +137 -0
- package/src/rx-collection-helper.ts +262 -0
- package/src/rx-collection.ts +1306 -0
- package/src/rx-database-internal-store.ts +402 -0
- package/src/rx-database.ts +919 -0
- package/src/rx-document-prototype-merge.ts +124 -0
- package/src/rx-document.ts +557 -0
- package/src/rx-error.ts +190 -0
- package/src/rx-query-helper.ts +317 -0
- package/src/rx-query-mingo.ts +87 -0
- package/src/rx-query-single-result.ts +110 -0
- package/src/rx-query.ts +887 -0
- package/src/rx-schema-helper.ts +391 -0
- package/src/rx-schema.ts +247 -0
- package/src/rx-storage-helper.ts +1050 -0
- package/src/rx-storage-multiinstance.ts +188 -0
- package/src/types/conflict-handling.d.ts +48 -0
- package/src/types/couchdb.d.ts +293 -0
- package/src/types/index.d.ts +32 -0
- package/src/types/modules/index.d.ts +0 -0
- package/src/types/modules/mocha.parallel.d.ts +1 -0
- package/src/types/plugins/backup.d.ts +35 -0
- package/src/types/plugins/cleanup.d.ts +38 -0
- package/src/types/plugins/crdt.d.ts +76 -0
- package/src/types/plugins/dexie.d.ts +30 -0
- package/src/types/plugins/local-documents.d.ts +49 -0
- package/src/types/plugins/migration.d.ts +14 -0
- package/src/types/plugins/reactivity.d.ts +40 -0
- package/src/types/plugins/replication-graphql.d.ts +98 -0
- package/src/types/plugins/replication.d.ts +175 -0
- package/src/types/plugins/state.d.ts +4 -0
- package/src/types/plugins/update.d.ts +23 -0
- package/src/types/plugins/webmcp.d.ts +40 -0
- package/src/types/query-planner.d.ts +47 -0
- package/src/types/replication-protocol.d.ts +296 -0
- package/src/types/rx-attachment.d.ts +46 -0
- package/src/types/rx-change-event.d.ts +85 -0
- package/src/types/rx-collection.d.ts +117 -0
- package/src/types/rx-database-internal-store.d.ts +54 -0
- package/src/types/rx-database.d.ts +124 -0
- package/src/types/rx-document.d.ts +160 -0
- package/src/types/rx-error.d.ts +222 -0
- package/src/types/rx-plugin.d.ts +167 -0
- package/src/types/rx-query.d.ts +144 -0
- package/src/types/rx-schema.d.ts +209 -0
- package/src/types/rx-storage.d.ts +347 -0
- package/src/types/rx-storage.interface.d.ts +312 -0
- package/src/types/util.d.ts +180 -0
- package/tsconfig.json +54 -0
- package/tsconfig.lint.json +18 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rx-collection.js","names":["filter","map","mergeMap","ucfirst","flatClone","promiseSeries","pluginMissing","ensureNotFalsy","getFromMapOrThrow","PROMISE_RESOLVE_FALSE","PROMISE_RESOLVE_VOID","NON_PREMIUM_COLLECTION_LIMIT","hasPremiumFlag","fillObjectDataBeforeInsert","normalizeInlineAttachments","createRxCollectionStorageInstance","removeCollectionStorages","ensureRxCollectionIsNotClosed","createRxQuery","_getDefaultQuery","newRxError","newRxTypeError","DocumentCache","mapDocumentsDataToCacheDocs","createQueryCache","defaultCacheReplacementPolicy","createChangeEventBuffer","runAsyncPluginHooks","runPluginHooks","createNewRxDocument","getRxDocumentConstructor","getWrappedStorageInstance","getWrittenDocumentsFromBulkWriteResponse","throwIfIsStorageWriteError","IncrementalWriteQueue","beforeDocumentUpdateWrite","overwritable","defaultConflictHandler","rxChangeEventBulkToRxChangeEvents","HOOKS_WHEN","HOOKS_KEYS","hooksApplied","OPEN_COLLECTIONS","Set","RxCollectionBase","database","name","schema","internalStorageInstance","instanceCreationOptions","migrationStrategies","methods","attachments","options","cacheReplacementPolicy","statics","conflictHandler","storageInstance","timeouts","incrementalWriteQueue","awaitBeforeReads","_incrementalUpsertQueues","Map","synced","hooks","_subs","_docCache","_queryCache","$","checkpoint$","_changeEventBuffer","eventBulks$","onClose","closed","onRemove","_applyHookFunctions","asRxCollection","pipe","changeEventBulk","collectionName","_proto","prototype","prepare","count","size","promiseWait","collection","args","existing","Array","from","values","c","db","add","jsonSchema","primaryPath","newData","oldData","result","_runHooks","checkpoint","documentConstructor","bulk","isLocal","events","docData","listenToRemoveSub","internalStore","changeStream","key","version","found","find","event","documentData","context","operation","subscribe","close","Promise","all","fn","push","databaseStorageToken","storageToken","subDocs","eventBulk","id","internal","databaseToken","token","$emit","cleanup","_minimumDeletedTime","migrationNeeded","getMigrationState","startMigration","batchSize","migratePromise","insert","json","writeResult","bulkInsert","isError","error","insertResult","success","insertIfNotExists","length","status","conflictDocData","documentInDb","docsData","_this","ids","insertRows","hasHooks","useDocData","then","document","index","documents","normalizePromises","_loop","doc","row","atts","_attachments","Object","keys","hashFunction","normalized","results","bulkWrite","rxDocuments","ret","docsMap","forEach","set","get","primary","bulkRemove","idsOrDocs","rxDocumentMap","findByIds","exec","d","rxDocument","data","toMutableJSON","removeDocs","writeDoc","_deleted","previous","deletedRxDocuments","successIds","getCachedRxDocument","bulkUpsert","_this2","insertData","useJsonByDocId","preparedDocs","useJson","_loop2","_useJson","slice","err","documentId","writeData","docDataInDb","newAttachments","deleteExisting","deleteExistingAttachments","newDoc","addWrite","docWriteData","assign","upsert","bulkResult","incrementalUpsert","hasAttachments","queue","normalizedAttachments","_incrementalUpsertEnsureRxDocumentExists","wasInserted","inserted","_data","queryObj","op","query","findOne","selector","limit","mangoQuery","$in","exportJSON","importJSON","_exportedJSON","registerWebMCP","_options","insertCRDT","_updateObj","addPipeline","addHook","when","fun","parallel","includes","boundFun","bind","runName","series","getHooks","instance","tasks","hook","_runHooksSync","time","res","timeout","setTimeout","delete","clearTimeout","requestIdlePromise","sub","unsubscribe","collections","collectionsSubject$","next","type","remove","storage","multiInstance","password","_createClass","cE","colProto","getPrototypeOf","fnName","rxCollection","docDataFromCache","getLatestDocumentDataIfExists","resolve","getCachedRxDocuments","createRxCollection","autoMigrate","localDocuments","storageInstanceCreationParams","databaseInstanceToken","databaseName","devMode","isDevMode","entries","funName","defineProperty","creator","isRxCollection","obj"],"sources":["../../src/rx-collection.ts"],"sourcesContent":["import {\r\n filter,\r\n map,\r\n mergeMap\r\n} from 'rxjs';\r\n\r\nimport {\r\n ucfirst,\r\n flatClone,\r\n promiseSeries,\r\n pluginMissing,\r\n ensureNotFalsy,\r\n getFromMapOrThrow,\r\n PROMISE_RESOLVE_FALSE,\r\n PROMISE_RESOLVE_VOID,\r\n NON_PREMIUM_COLLECTION_LIMIT,\r\n hasPremiumFlag\r\n} from './plugins/utils/index.ts';\r\nimport {\r\n fillObjectDataBeforeInsert,\r\n normalizeInlineAttachments,\r\n createRxCollectionStorageInstance,\r\n removeCollectionStorages,\r\n ensureRxCollectionIsNotClosed\r\n} from './rx-collection-helper.ts';\r\nimport {\r\n createRxQuery,\r\n _getDefaultQuery\r\n} from './rx-query.ts';\r\nimport {\r\n newRxError,\r\n newRxTypeError\r\n} from './rx-error.ts';\r\nimport type {\r\n RxMigrationState\r\n} from './plugins/migration-schema/index.ts';\r\nimport {\r\n DocumentCache,\r\n mapDocumentsDataToCacheDocs\r\n} from './doc-cache.ts';\r\nimport {\r\n QueryCache,\r\n createQueryCache,\r\n defaultCacheReplacementPolicy\r\n} from './query-cache.ts';\r\nimport {\r\n ChangeEventBuffer,\r\n createChangeEventBuffer\r\n} from './change-event-buffer.ts';\r\nimport {\r\n runAsyncPluginHooks,\r\n runPluginHooks\r\n} from './hooks.ts';\r\n\r\nimport {\r\n Subscription,\r\n Observable,\r\n Subject\r\n} from 'rxjs';\r\n\r\nimport type {\r\n KeyFunctionMap,\r\n RxCollection,\r\n RxDatabase,\r\n RxQuery,\r\n RxDocument,\r\n RxDumpCollection,\r\n RxDumpCollectionAny,\r\n MangoQuery,\r\n MangoQueryNoLimit,\r\n RxCacheReplacementPolicy,\r\n RxStorageWriteError,\r\n RxDocumentData,\r\n RxStorageInstanceCreationParams,\r\n BulkWriteRow,\r\n RxChangeEvent,\r\n RxChangeEventInsert,\r\n RxChangeEventUpdate,\r\n RxChangeEventDelete,\r\n RxStorageInstance,\r\n CollectionsOfDatabase,\r\n RxChangeEventBulk,\r\n RxLocalDocumentData,\r\n RxConflictHandler,\r\n MaybePromise,\r\n CRDTEntry,\r\n MangoQuerySelectorAndIndex,\r\n MigrationStrategies,\r\n WebMCPOptions,\r\n WebMCPLogEvent\r\n} from './types/index.d.ts';\r\n\r\nimport {\r\n RxSchema\r\n} from './rx-schema.ts';\r\n\r\nimport {\r\n createNewRxDocument,\r\n getRxDocumentConstructor\r\n} from './rx-document-prototype-merge.ts';\r\nimport {\r\n getWrappedStorageInstance,\r\n getWrittenDocumentsFromBulkWriteResponse,\r\n throwIfIsStorageWriteError,\r\n WrappedRxStorageInstance\r\n} from './rx-storage-helper.ts';\r\nimport { IncrementalWriteQueue } from './incremental-write.ts';\r\nimport { beforeDocumentUpdateWrite } from './rx-document.ts';\r\nimport { overwritable } from './overwritable.ts';\r\nimport type { RxPipeline, RxPipelineOptions } from './plugins/pipeline/index.ts';\r\nimport { defaultConflictHandler } from './replication-protocol/default-conflict-handler.ts';\r\nimport { rxChangeEventBulkToRxChangeEvents } from './rx-change-event.ts';\r\n\r\nconst HOOKS_WHEN = ['pre', 'post'] as const;\r\ntype HookWhenType = typeof HOOKS_WHEN[number];\r\nconst HOOKS_KEYS = ['insert', 'save', 'remove', 'create'] as const;\r\ntype HookKeyType = typeof HOOKS_KEYS[number];\r\n\r\nexport interface UpsertOptions {\r\n /**\r\n * When true, existing attachments not present in the upsert data\r\n * will be removed. Defaults to false (preserve existing attachments).\r\n */\r\n deleteExistingAttachments?: boolean;\r\n}\r\nlet hooksApplied = false;\r\n\r\nexport const OPEN_COLLECTIONS = new Set<RxCollectionBase<any, any, any>>();\r\n\r\nexport class RxCollectionBase<\r\n InstanceCreationOptions,\r\n RxDocumentType = { [prop: string]: any; },\r\n OrmMethods = {},\r\n StaticMethods = { [key: string]: any; },\r\n Reactivity = any\r\n> {\r\n\r\n\r\n /**\r\n * Stores all 'normal' documents\r\n */\r\n public storageInstance: WrappedRxStorageInstance<RxDocumentType, any, InstanceCreationOptions> = {} as any;\r\n public readonly timeouts: Set<ReturnType<typeof setTimeout>> = new Set();\r\n public incrementalWriteQueue: IncrementalWriteQueue<RxDocumentType> = {} as any;\r\n\r\n\r\n /**\r\n * Before reads, all these methods are awaited. Used to \"block\" reads\r\n * depending on other processes, like when the RxPipeline is running.\r\n */\r\n public readonly awaitBeforeReads = new Set<() => MaybePromise<any>>();\r\n\r\n constructor(\r\n public readonly database: RxDatabase<CollectionsOfDatabase, any, InstanceCreationOptions, Reactivity>,\r\n public name: string,\r\n public schema: RxSchema<RxDocumentType>,\r\n public internalStorageInstance: RxStorageInstance<RxDocumentType, any, InstanceCreationOptions>,\r\n public instanceCreationOptions: InstanceCreationOptions = {} as any,\r\n public migrationStrategies: MigrationStrategies = {},\r\n public methods: KeyFunctionMap = {},\r\n public attachments: KeyFunctionMap = {},\r\n public options: any = {},\r\n public cacheReplacementPolicy: RxCacheReplacementPolicy = defaultCacheReplacementPolicy,\r\n public statics: KeyFunctionMap = {},\r\n public conflictHandler: RxConflictHandler<RxDocumentType> = defaultConflictHandler\r\n ) {\r\n _applyHookFunctions(this.asRxCollection);\r\n\r\n\r\n if (database) { // might be falsy on pseudoInstance\r\n this.eventBulks$ = database.eventBulks$.pipe(\r\n filter((changeEventBulk: RxChangeEventBulk<any>) => changeEventBulk.collectionName === this.name)\r\n );\r\n } else { }\r\n }\r\n\r\n get insert$(): Observable<RxChangeEventInsert<RxDocumentType>> {\r\n return this.$.pipe(\r\n filter((cE: RxChangeEvent<RxDocumentType>) => cE.operation === 'INSERT')\r\n ) as any;\r\n }\r\n get update$(): Observable<RxChangeEventUpdate<RxDocumentType>> {\r\n return this.$.pipe(\r\n filter((cE: RxChangeEvent<RxDocumentType>) => cE.operation === 'UPDATE')\r\n ) as any;\r\n }\r\n get remove$(): Observable<RxChangeEventDelete<RxDocumentType>> {\r\n return this.$.pipe(\r\n filter((cE: RxChangeEvent<RxDocumentType>) => cE.operation === 'DELETE')\r\n ) as any;\r\n }\r\n\r\n public _incrementalUpsertQueues: Map<string, Promise<any>> = new Map();\r\n // defaults\r\n public synced: boolean = false;\r\n public hooks: {\r\n [key in HookKeyType]: {\r\n [when in HookWhenType]: {\r\n series: Function[];\r\n parallel: Function[];\r\n };\r\n }\r\n } = {} as any;\r\n public _subs: Subscription[] = [];\r\n\r\n public _docCache: DocumentCache<RxDocumentType, OrmMethods> = {} as any;\r\n\r\n public _queryCache: QueryCache = createQueryCache();\r\n public $: Observable<RxChangeEvent<RxDocumentType>> = {} as any;\r\n public checkpoint$: Observable<any> = {} as any;\r\n public _changeEventBuffer: ChangeEventBuffer<RxDocumentType> = {} as ChangeEventBuffer<RxDocumentType>;\r\n\r\n /**\r\n * Internally only use eventBulks$\r\n * Do not use .$ or .observable$ because that has to transform\r\n * the events which decreases performance.\r\n */\r\n public readonly eventBulks$: Observable<RxChangeEventBulk<any>> = {} as any;\r\n\r\n\r\n /**\r\n * When the collection is closed,\r\n * these functions will be called an awaited.\r\n * Used to automatically clean up stuff that\r\n * belongs to this collection.\r\n */\r\n public onClose: (() => MaybePromise<any>)[] = [];\r\n public closed = false;\r\n\r\n public onRemove: (() => MaybePromise<any>)[] = [];\r\n\r\n public async prepare(): Promise<void> {\r\n\r\n if (!(await hasPremiumFlag())) {\r\n\r\n /**\r\n * When used in a test suite, we often open and close many databases with collections\r\n * while not awaiting the database.close() call to improve the test times.\r\n * So when reopening collections and the OPEN_COLLECTIONS size is full,\r\n * we retry after some times to account for this.\r\n */\r\n let count = 0;\r\n while (count < 25 && OPEN_COLLECTIONS.size >= NON_PREMIUM_COLLECTION_LIMIT) {\r\n await this.promiseWait(30);\r\n count++;\r\n }\r\n if (OPEN_COLLECTIONS.size > NON_PREMIUM_COLLECTION_LIMIT) {\r\n throw newRxError('COL23', {\r\n database: this.database.name,\r\n collection: this.name,\r\n args: {\r\n existing: Array.from(OPEN_COLLECTIONS.values()).map(c => ({\r\n db: c.database ? c.database.name : '',\r\n c: c.name\r\n }))\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Must be after the check because the hooks might throw on dev-mode\r\n * checks and we do not want to have broken collections here.\r\n * RxCollection instances created for testings do not have a database\r\n * so we do not add these to the list.\r\n */\r\n if (this.database) {\r\n OPEN_COLLECTIONS.add(this);\r\n }\r\n\r\n\r\n this.storageInstance = getWrappedStorageInstance(\r\n this.database,\r\n this.internalStorageInstance,\r\n this.schema.jsonSchema\r\n );\r\n this.incrementalWriteQueue = new IncrementalWriteQueue<RxDocumentType>(\r\n this.storageInstance,\r\n this.schema.primaryPath,\r\n (newData, oldData) => beforeDocumentUpdateWrite(this as any, newData, oldData),\r\n result => this._runHooks('post', 'save', result)\r\n );\r\n\r\n this.$ = this.eventBulks$.pipe(\r\n mergeMap((changeEventBulk: RxChangeEventBulk<any>) => rxChangeEventBulkToRxChangeEvents(changeEventBulk)),\r\n );\r\n this.checkpoint$ = this.eventBulks$.pipe(\r\n map((changeEventBulk: RxChangeEventBulk<any>) => changeEventBulk.checkpoint),\r\n );\r\n\r\n this._changeEventBuffer = createChangeEventBuffer<RxDocumentType>(this.asRxCollection);\r\n let documentConstructor: any;\r\n this._docCache = new DocumentCache(\r\n this.schema.primaryPath,\r\n this.eventBulks$.pipe(\r\n filter((bulk: RxChangeEventBulk<any>) => !bulk.isLocal),\r\n map((bulk: RxChangeEventBulk<any>) => bulk.events)\r\n ),\r\n docData => {\r\n if (!documentConstructor) {\r\n documentConstructor = getRxDocumentConstructor(this.asRxCollection);\r\n }\r\n return createNewRxDocument(this.asRxCollection, documentConstructor, docData);\r\n }\r\n );\r\n\r\n\r\n const listenToRemoveSub = this.database.internalStore.changeStream().pipe(\r\n filter((bulk: any) => {\r\n const key = this.name + '-' + this.schema.version;\r\n const found = bulk.events.find((event: any) => {\r\n return (\r\n event.documentData.context === 'collection' &&\r\n event.documentData.key === key &&\r\n event.operation === 'DELETE'\r\n );\r\n });\r\n return !!found;\r\n })\r\n ).subscribe(async () => {\r\n await this.close();\r\n await Promise.all(this.onRemove.map(fn => fn()));\r\n });\r\n this._subs.push(listenToRemoveSub);\r\n\r\n\r\n const databaseStorageToken = await this.database.storageToken;\r\n const subDocs = this.storageInstance.changeStream().subscribe((eventBulk: any) => {\r\n const changeEventBulk: RxChangeEventBulk<RxDocumentType | RxLocalDocumentData> = {\r\n id: eventBulk.id,\r\n isLocal: false,\r\n internal: false,\r\n collectionName: this.name,\r\n storageToken: databaseStorageToken,\r\n events: eventBulk.events,\r\n databaseToken: this.database.token,\r\n checkpoint: eventBulk.checkpoint,\r\n context: eventBulk.context\r\n };\r\n this.database.$emit(changeEventBulk);\r\n });\r\n this._subs.push(subDocs);\r\n\r\n return PROMISE_RESOLVE_VOID;\r\n }\r\n\r\n\r\n /**\r\n * Manually call the cleanup function of the storage.\r\n * @link https://rxdb.info/cleanup.html\r\n */\r\n cleanup(_minimumDeletedTime?: number): Promise<boolean> {\r\n ensureRxCollectionIsNotClosed(this);\r\n throw pluginMissing('cleanup');\r\n }\r\n\r\n // overwritten by migration-plugin\r\n migrationNeeded(): Promise<boolean> {\r\n throw pluginMissing('migration-schema');\r\n }\r\n getMigrationState(): RxMigrationState {\r\n throw pluginMissing('migration-schema');\r\n }\r\n startMigration(batchSize: number = 10): Promise<void> {\r\n ensureRxCollectionIsNotClosed(this);\r\n return this.getMigrationState().startMigration(batchSize);\r\n }\r\n migratePromise(batchSize: number = 10): Promise<any> {\r\n return this.getMigrationState().migratePromise(batchSize);\r\n }\r\n\r\n async insert(\r\n json: RxDocumentType | RxDocument\r\n ): Promise<RxDocument<RxDocumentType, OrmMethods>> {\r\n ensureRxCollectionIsNotClosed(this);\r\n const writeResult = await this.bulkInsert([json as any]);\r\n\r\n const isError = writeResult.error[0];\r\n throwIfIsStorageWriteError(this as any, (json as any)[this.schema.primaryPath] as any, json, isError as any);\r\n const insertResult = ensureNotFalsy(writeResult.success[0]);\r\n return insertResult;\r\n }\r\n\r\n async insertIfNotExists(\r\n json: RxDocumentType | RxDocument\r\n ): Promise<RxDocument<RxDocumentType, OrmMethods>> {\r\n const writeResult = await this.bulkInsert([json as any]);\r\n if (writeResult.error.length > 0) {\r\n const error = writeResult.error[0];\r\n if (error.status === 409) {\r\n const conflictDocData = error.documentInDb;\r\n return mapDocumentsDataToCacheDocs(this._docCache, [conflictDocData])[0];\r\n\r\n } else {\r\n throw error;\r\n }\r\n }\r\n return writeResult.success[0];\r\n }\r\n\r\n async bulkInsert(\r\n docsData: RxDocumentType[]\r\n ): Promise<{\r\n success: RxDocument<RxDocumentType, OrmMethods>[];\r\n error: RxStorageWriteError<RxDocumentType>[];\r\n }> {\r\n ensureRxCollectionIsNotClosed(this);\r\n /**\r\n * Optimization shortcut,\r\n * do nothing when called with an empty array\r\n */\r\n if (docsData.length === 0) {\r\n return {\r\n success: [],\r\n error: []\r\n };\r\n }\r\n\r\n const primaryPath = this.schema.primaryPath;\r\n\r\n const ids = new Set<string>();\r\n\r\n /**\r\n * This code is a bit redundant for better performance.\r\n * Instead of iterating multiple times,\r\n * we directly transform the input to a write-row array.\r\n */\r\n let insertRows: BulkWriteRow<RxDocumentType>[];\r\n if (this.hasHooks('pre', 'insert')) {\r\n insertRows = await Promise.all(\r\n docsData.map(docData => {\r\n const useDocData = fillObjectDataBeforeInsert(this.schema, docData);\r\n return this._runHooks('pre', 'insert', useDocData)\r\n .then(() => {\r\n ids.add((useDocData as any)[primaryPath]);\r\n return { document: useDocData };\r\n });\r\n })\r\n );\r\n } else {\r\n insertRows = new Array(docsData.length);\r\n const schema = this.schema;\r\n for (let index = 0; index < docsData.length; index++) {\r\n const docData = docsData[index];\r\n const useDocData = fillObjectDataBeforeInsert(schema, docData);\r\n ids.add((useDocData as any)[primaryPath]);\r\n insertRows[index] = { document: useDocData };\r\n }\r\n }\r\n\r\n\r\n if (ids.size !== docsData.length) {\r\n throw newRxError('COL22', {\r\n collection: this.name,\r\n args: {\r\n documents: docsData\r\n }\r\n });\r\n }\r\n\r\n // Normalize any inline attachment inputs (compute digest/length from Blob)\r\n // Also converts array format to internal map format.\r\n // Only create promises for rows that actually need normalization to avoid\r\n // expensive await overhead on the hot path.\r\n if (this.schema.jsonSchema.attachments) {\r\n const normalizePromises: Promise<void>[] = [];\r\n for (const row of insertRows) {\r\n const doc: any = row.document;\r\n const atts = doc._attachments;\r\n if (atts == null || Object.keys(atts).length === 0) {\r\n doc._attachments = {};\r\n } else {\r\n normalizePromises.push(\r\n normalizeInlineAttachments(this.database.hashFunction, atts)\r\n .then(normalized => {\r\n doc._attachments = normalized;\r\n })\r\n );\r\n }\r\n }\r\n if (normalizePromises.length > 0) {\r\n await Promise.all(normalizePromises);\r\n }\r\n }\r\n\r\n const results = await this.storageInstance.bulkWrite(\r\n insertRows,\r\n 'rx-collection-bulk-insert'\r\n );\r\n\r\n\r\n /**\r\n * Often the user does not need to access the RxDocuments of the bulkInsert() call.\r\n * So we transform the data to RxDocuments only if needed to use less CPU performance.\r\n */\r\n let rxDocuments: RxDocument<RxDocumentType, OrmMethods>[];\r\n const collection = this;\r\n const ret = {\r\n get success() {\r\n if (!rxDocuments) {\r\n const success = getWrittenDocumentsFromBulkWriteResponse(\r\n collection.schema.primaryPath,\r\n insertRows,\r\n results\r\n );\r\n rxDocuments = mapDocumentsDataToCacheDocs<RxDocumentType, OrmMethods>(collection._docCache, success);\r\n }\r\n return rxDocuments;\r\n },\r\n error: results.error\r\n };\r\n\r\n if (this.hasHooks('post', 'insert')) {\r\n const docsMap: Map<string, RxDocumentType> = new Map();\r\n insertRows.forEach(row => {\r\n const doc = row.document;\r\n docsMap.set((doc as any)[primaryPath] as any, doc);\r\n });\r\n await Promise.all(\r\n ret.success.map(doc => {\r\n return this._runHooks(\r\n 'post',\r\n 'insert',\r\n docsMap.get(doc.primary),\r\n doc\r\n );\r\n })\r\n );\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n async bulkRemove(\r\n /**\r\n * You can either remove the documents by their ids\r\n * or by directly providing the RxDocument instances\r\n * if you have them already. This improves performance a bit.\r\n */\r\n idsOrDocs: string[] | RxDocument<RxDocumentType>[]\r\n ): Promise<{\r\n success: RxDocument<RxDocumentType, OrmMethods>[];\r\n error: RxStorageWriteError<RxDocumentType>[];\r\n }> {\r\n ensureRxCollectionIsNotClosed(this);\r\n const primaryPath = this.schema.primaryPath;\r\n /**\r\n * Optimization shortcut,\r\n * do nothing when called with an empty array\r\n */\r\n if (idsOrDocs.length === 0) {\r\n return {\r\n success: [],\r\n error: []\r\n };\r\n }\r\n\r\n let rxDocumentMap: Map<string, RxDocument<RxDocumentType, OrmMethods>>;\r\n if (typeof idsOrDocs[0] === 'string') {\r\n rxDocumentMap = await this.findByIds(idsOrDocs as string[]).exec();\r\n } else {\r\n rxDocumentMap = new Map();\r\n (idsOrDocs as RxDocument<RxDocumentType, OrmMethods>[]).forEach(d => rxDocumentMap.set(d.primary, d));\r\n }\r\n\r\n const docsData: RxDocumentData<RxDocumentType>[] = [];\r\n const docsMap: Map<string, RxDocumentData<RxDocumentType>> = new Map();\r\n Array.from(rxDocumentMap.values()).forEach(rxDocument => {\r\n const data: RxDocumentData<RxDocumentType> = rxDocument.toMutableJSON(true) as any;\r\n docsData.push(data);\r\n docsMap.set(rxDocument.primary, data);\r\n });\r\n\r\n await Promise.all(\r\n docsData.map(doc => {\r\n const primary = (doc as any)[this.schema.primaryPath];\r\n return this._runHooks('pre', 'remove', doc, rxDocumentMap.get(primary));\r\n })\r\n );\r\n const removeDocs: BulkWriteRow<RxDocumentType>[] = docsData.map(doc => {\r\n const writeDoc = flatClone(doc);\r\n writeDoc._deleted = true;\r\n return {\r\n previous: doc,\r\n document: writeDoc\r\n };\r\n });\r\n const results = await this.storageInstance.bulkWrite(\r\n removeDocs,\r\n 'rx-collection-bulk-remove'\r\n );\r\n\r\n\r\n const success = getWrittenDocumentsFromBulkWriteResponse(\r\n this.schema.primaryPath,\r\n removeDocs,\r\n results\r\n );\r\n\r\n const deletedRxDocuments: RxDocument<RxDocumentType, OrmMethods>[] = [];\r\n const successIds: string[] = success.map(d => {\r\n const id = d[primaryPath] as string;\r\n const doc = this._docCache.getCachedRxDocument(d);\r\n deletedRxDocuments.push(doc);\r\n return id;\r\n });\r\n\r\n // run hooks\r\n await Promise.all(\r\n successIds.map(id => {\r\n return this._runHooks(\r\n 'post',\r\n 'remove',\r\n docsMap.get(id),\r\n rxDocumentMap.get(id)\r\n );\r\n })\r\n );\r\n\r\n\r\n return {\r\n success: deletedRxDocuments,\r\n error: results.error\r\n };\r\n }\r\n\r\n /**\r\n * same as bulkInsert but overwrites existing document with same primary\r\n */\r\n async bulkUpsert(docsData: Partial<RxDocumentType>[], options?: UpsertOptions): Promise<{\r\n success: RxDocument<RxDocumentType, OrmMethods>[];\r\n error: RxStorageWriteError<RxDocumentType>[];\r\n }> {\r\n ensureRxCollectionIsNotClosed(this);\r\n const insertData: RxDocumentType[] = [];\r\n const useJsonByDocId: Map<string, RxDocumentType> = new Map();\r\n\r\n // First pass: synchronous work — schema filling and primary key validation\r\n const preparedDocs: RxDocumentType[] = [];\r\n for (const docData of docsData) {\r\n const useJson = fillObjectDataBeforeInsert(this.schema, docData);\r\n const primary: string = useJson[this.schema.primaryPath] as any;\r\n if (!primary) {\r\n throw newRxError('COL3', {\r\n primaryPath: this.schema.primaryPath as string,\r\n data: useJson,\r\n schema: this.schema.jsonSchema\r\n });\r\n }\r\n preparedDocs.push(useJson);\r\n }\r\n\r\n // Second pass: normalize inline attachments concurrently across all documents.\r\n // Only create promises for docs that actually need normalization to avoid\r\n // expensive await overhead on the hot path.\r\n if (this.schema.jsonSchema.attachments) {\r\n const normalizePromises: Promise<void>[] = [];\r\n for (const useJson of preparedDocs) {\r\n const atts = (useJson as any)._attachments;\r\n if (atts == null || Object.keys(atts).length === 0) {\r\n (useJson as any)._attachments = {};\r\n } else {\r\n normalizePromises.push(\r\n normalizeInlineAttachments(this.database.hashFunction, atts)\r\n .then(normalized => {\r\n (useJson as any)._attachments = normalized;\r\n })\r\n );\r\n }\r\n }\r\n if (normalizePromises.length > 0) {\r\n await Promise.all(normalizePromises);\r\n }\r\n }\r\n for (const useJson of preparedDocs) {\r\n const primary: string = (useJson as any)[this.schema.primaryPath];\r\n useJsonByDocId.set(primary, useJson);\r\n insertData.push(useJson);\r\n }\r\n\r\n const insertResult = await this.bulkInsert(insertData);\r\n const success = insertResult.success.slice(0);\r\n const error: RxStorageWriteError<RxDocumentType>[] = [];\r\n\r\n // update the ones that existed already\r\n await Promise.all(\r\n insertResult.error.map(async (err) => {\r\n if (err.status !== 409) {\r\n error.push(err);\r\n } else {\r\n const id = err.documentId;\r\n const writeData = getFromMapOrThrow(useJsonByDocId, id);\r\n const docDataInDb = ensureNotFalsy(err.documentInDb);\r\n const newAttachments = (writeData as any)._attachments;\r\n const deleteExisting = options?.deleteExistingAttachments === true;\r\n const newDoc = await this.incrementalWriteQueue.addWrite(\r\n docDataInDb,\r\n (docWriteData: any): any => {\r\n return Object.assign({}, writeData, {\r\n _attachments: deleteExisting\r\n ? newAttachments\r\n : Object.assign(\r\n {},\r\n docWriteData._attachments,\r\n newAttachments\r\n )\r\n });\r\n }\r\n ).then(writeResult => this._docCache.getCachedRxDocument(writeResult) as any);\r\n success.push(newDoc as any);\r\n }\r\n })\r\n );\r\n return {\r\n error,\r\n success\r\n };\r\n }\r\n\r\n /**\r\n * same as insert but overwrites existing document with same primary\r\n */\r\n async upsert(json: Partial<RxDocumentType>, options?: UpsertOptions): Promise<RxDocument<RxDocumentType, OrmMethods>> {\r\n ensureRxCollectionIsNotClosed(this);\r\n const bulkResult = await this.bulkUpsert([json], options);\r\n throwIfIsStorageWriteError<RxDocumentType>(\r\n this.asRxCollection,\r\n (json as any)[this.schema.primaryPath],\r\n json as any,\r\n bulkResult.error[0]\r\n );\r\n return bulkResult.success[0];\r\n }\r\n\r\n /**\r\n * upserts to a RxDocument, uses incrementalModify if document already exists\r\n */\r\n incrementalUpsert(json: Partial<RxDocumentType>, options?: UpsertOptions): Promise<RxDocument<RxDocumentType, OrmMethods>> {\r\n ensureRxCollectionIsNotClosed(this);\r\n const useJson = fillObjectDataBeforeInsert(this.schema, json);\r\n const primary: string = useJson[this.schema.primaryPath] as any;\r\n if (!primary) {\r\n throw newRxError('COL4', {\r\n data: json\r\n });\r\n }\r\n\r\n const hasAttachments = !!this.schema.jsonSchema.attachments;\r\n const deleteExisting = options?.deleteExistingAttachments === true;\r\n\r\n // ensure that it won't try 2 parallel runs\r\n let queue = this._incrementalUpsertQueues.get(primary);\r\n if (!queue) {\r\n queue = PROMISE_RESOLVE_VOID;\r\n }\r\n queue = queue\r\n // Normalize array-format attachments to map format\r\n .then(() => {\r\n if (hasAttachments) {\r\n const atts = (useJson as any)._attachments;\r\n if (atts == null || Object.keys(atts).length === 0) {\r\n return {};\r\n } else {\r\n return normalizeInlineAttachments(this.database.hashFunction, atts);\r\n }\r\n }\r\n return (useJson as any)._attachments;\r\n })\r\n .then((normalizedAttachments) => {\r\n (useJson as any)._attachments = normalizedAttachments;\r\n return _incrementalUpsertEnsureRxDocumentExists(this as any, primary as any, useJson);\r\n })\r\n .then((wasInserted) => {\r\n if (!wasInserted.inserted) {\r\n const doc = wasInserted.doc;\r\n const newAttachments = (useJson as any)._attachments;\r\n return this.incrementalWriteQueue.addWrite(\r\n doc._data as RxDocumentData<RxDocumentType>,\r\n (docWriteData: any): any => {\r\n return Object.assign({}, useJson, {\r\n _attachments: deleteExisting\r\n ? newAttachments\r\n : Object.assign(\r\n {},\r\n docWriteData._attachments,\r\n newAttachments\r\n )\r\n });\r\n }\r\n ).then(writeResult => this._docCache.getCachedRxDocument(writeResult) as any);\r\n } else {\r\n return wasInserted.doc;\r\n }\r\n });\r\n this._incrementalUpsertQueues.set(primary, queue);\r\n return queue;\r\n }\r\n\r\n find(queryObj?: MangoQuery<RxDocumentType>): RxQuery<\r\n RxDocumentType,\r\n RxDocument<RxDocumentType, OrmMethods>[],\r\n OrmMethods,\r\n Reactivity\r\n > {\r\n ensureRxCollectionIsNotClosed(this);\r\n\r\n runPluginHooks('prePrepareRxQuery', {\r\n op: 'find',\r\n queryObj,\r\n collection: this\r\n });\r\n\r\n if (!queryObj) {\r\n queryObj = _getDefaultQuery();\r\n }\r\n\r\n const query = createRxQuery('find', queryObj, this as any);\r\n return query as any;\r\n }\r\n\r\n findOne(\r\n queryObj?: MangoQueryNoLimit<RxDocumentType> | string\r\n ): RxQuery<\r\n RxDocumentType,\r\n RxDocument<RxDocumentType, OrmMethods> | null,\r\n OrmMethods,\r\n Reactivity\r\n > {\r\n ensureRxCollectionIsNotClosed(this);\r\n\r\n runPluginHooks('prePrepareRxQuery', {\r\n op: 'findOne',\r\n queryObj,\r\n collection: this\r\n });\r\n\r\n let query;\r\n\r\n if (typeof queryObj === 'string') {\r\n query = createRxQuery('findOne', {\r\n selector: {\r\n [this.schema.primaryPath]: queryObj\r\n },\r\n limit: 1\r\n }, this as any);\r\n } else {\r\n if (!queryObj) {\r\n queryObj = _getDefaultQuery();\r\n }\r\n\r\n // cannot have limit on findOne queries because it will be overwritten\r\n if ((queryObj as MangoQuery).limit) {\r\n throw newRxError('QU6');\r\n }\r\n\r\n queryObj = flatClone(queryObj);\r\n (queryObj as any).limit = 1;\r\n query = createRxQuery<RxDocumentType>('findOne', queryObj, this as any);\r\n }\r\n\r\n\r\n return query as any;\r\n }\r\n\r\n count(queryObj?: MangoQuerySelectorAndIndex<RxDocumentType>): RxQuery<\r\n RxDocumentType,\r\n number,\r\n OrmMethods,\r\n Reactivity\r\n > {\r\n ensureRxCollectionIsNotClosed(this);\r\n if (!queryObj) {\r\n queryObj = _getDefaultQuery();\r\n }\r\n const query = createRxQuery('count', queryObj, this as any);\r\n return query as any;\r\n }\r\n\r\n /**\r\n * find a list documents by their primary key\r\n * has way better performance then running multiple findOne() or a find() with a complex $or-selected\r\n */\r\n findByIds(\r\n ids: string[]\r\n ): RxQuery<\r\n RxDocumentType,\r\n Map<string, RxDocument<RxDocumentType, OrmMethods>>,\r\n OrmMethods,\r\n Reactivity\r\n > {\r\n ensureRxCollectionIsNotClosed(this);\r\n const mangoQuery: MangoQuery<RxDocumentType> = {\r\n selector: {\r\n [this.schema.primaryPath]: {\r\n $in: ids.slice(0)\r\n }\r\n } as any\r\n };\r\n const query = createRxQuery('findByIds', mangoQuery, this as any);\r\n return query as any;\r\n }\r\n\r\n /**\r\n * Export collection to a JSON friendly format.\r\n */\r\n exportJSON(): Promise<RxDumpCollection<RxDocumentType>>;\r\n exportJSON(): Promise<RxDumpCollectionAny<RxDocumentType>>;\r\n exportJSON(): Promise<any> {\r\n throw pluginMissing('json-dump');\r\n }\r\n\r\n /**\r\n * Import the parsed JSON export into the collection.\r\n * @param _exportedJSON The previously exported data from the `<collection>.exportJSON()` method.\r\n */\r\n importJSON(_exportedJSON: RxDumpCollectionAny<RxDocumentType>): Promise<void> {\r\n throw pluginMissing('json-dump');\r\n }\r\n\r\n registerWebMCP(_options?: WebMCPOptions): { error$: Subject<Error>; log$: Subject<WebMCPLogEvent>; } {\r\n throw pluginMissing('webmcp');\r\n }\r\n\r\n insertCRDT(_updateObj: CRDTEntry<any> | CRDTEntry<any>[]): RxDocument<RxDocumentType, OrmMethods> {\r\n throw pluginMissing('crdt');\r\n }\r\n\r\n\r\n addPipeline(_options: RxPipelineOptions<RxDocumentType>): Promise<RxPipeline<RxDocumentType>> {\r\n throw pluginMissing('pipeline');\r\n }\r\n\r\n /**\r\n * HOOKS\r\n */\r\n addHook(when: HookWhenType, key: HookKeyType, fun: any, parallel = false) {\r\n if (typeof fun !== 'function') {\r\n throw newRxTypeError('COL7', {\r\n key,\r\n when\r\n });\r\n }\r\n\r\n if (!HOOKS_WHEN.includes(when)) {\r\n throw newRxTypeError('COL8', {\r\n key,\r\n when\r\n });\r\n }\r\n\r\n if (!HOOKS_KEYS.includes(key)) {\r\n throw newRxError('COL9', {\r\n key\r\n });\r\n }\r\n\r\n if (when === 'post' && key === 'create' && parallel === true) {\r\n throw newRxError('COL10', {\r\n when,\r\n key,\r\n parallel\r\n });\r\n }\r\n\r\n // bind this-scope to hook-function\r\n const boundFun = fun.bind(this);\r\n\r\n const runName = parallel ? 'parallel' : 'series';\r\n\r\n this.hooks[key] = this.hooks[key] || {};\r\n this.hooks[key][when] = this.hooks[key][when] || {\r\n series: [],\r\n parallel: []\r\n };\r\n this.hooks[key][when][runName].push(boundFun);\r\n }\r\n\r\n getHooks(when: HookWhenType, key: HookKeyType) {\r\n if (\r\n !this.hooks[key] ||\r\n !this.hooks[key][when]\r\n ) {\r\n return {\r\n series: [],\r\n parallel: []\r\n };\r\n }\r\n return this.hooks[key][when];\r\n }\r\n\r\n hasHooks(when: HookWhenType, key: HookKeyType) {\r\n /**\r\n * Performance shortcut\r\n * so that we not have to build the empty object.\r\n */\r\n if (\r\n !this.hooks[key] ||\r\n !this.hooks[key][when]\r\n ) {\r\n return false;\r\n }\r\n\r\n const hooks = this.getHooks(when, key);\r\n if (!hooks) {\r\n return false;\r\n }\r\n return hooks.series.length > 0 || hooks.parallel.length > 0;\r\n }\r\n\r\n _runHooks(when: HookWhenType, key: HookKeyType, data: any, instance?: any): Promise<any> {\r\n const hooks = this.getHooks(when, key);\r\n\r\n if (!hooks) {\r\n return PROMISE_RESOLVE_VOID;\r\n }\r\n\r\n // run parallel: false\r\n const tasks = hooks.series.map((hook: any) => () => hook(data, instance));\r\n return promiseSeries(tasks)\r\n // run parallel: true\r\n .then(() => Promise.all(\r\n hooks.parallel\r\n .map((hook: any) => hook(data, instance))\r\n ));\r\n }\r\n\r\n /**\r\n * does the same as ._runHooks() but with non-async-functions\r\n */\r\n _runHooksSync(when: HookWhenType, key: HookKeyType, data: any, instance: any) {\r\n if (!this.hasHooks(when, key)) {\r\n return;\r\n }\r\n const hooks = this.getHooks(when, key);\r\n if (!hooks) return;\r\n hooks.series.forEach((hook: any) => hook(data, instance));\r\n }\r\n\r\n /**\r\n * Returns a promise that resolves after the given time.\r\n * Ensures that is properly cleans up when the collection is closed\r\n * so that no running timeouts prevent the exit of the JavaScript process.\r\n */\r\n promiseWait(time: number): Promise<void> {\r\n const ret = new Promise<void>(res => {\r\n const timeout = setTimeout(() => {\r\n this.timeouts.delete(timeout);\r\n res();\r\n }, time);\r\n this.timeouts.add(timeout);\r\n });\r\n return ret;\r\n }\r\n\r\n async close(): Promise<boolean> {\r\n if (this.closed) {\r\n return PROMISE_RESOLVE_FALSE;\r\n }\r\n\r\n OPEN_COLLECTIONS.delete(this);\r\n\r\n\r\n await Promise.all(this.onClose.map(fn => fn()));\r\n\r\n /**\r\n * Settings closed = true\r\n * must be the first thing to do,\r\n * so for example the replication can directly stop\r\n * instead of sending requests to a closed storage.\r\n */\r\n this.closed = true;\r\n\r\n\r\n Array.from(this.timeouts).forEach(timeout => clearTimeout(timeout));\r\n if (this._changeEventBuffer) {\r\n this._changeEventBuffer.close();\r\n }\r\n /**\r\n * First wait until the whole database is idle.\r\n * This ensures that the storage does not get closed\r\n * while some operation is running.\r\n * It is important that we do not intercept a running call\r\n * because it might lead to undefined behavior like when a doc is written\r\n * but the change is not added to the changes collection.\r\n */\r\n return this.database.requestIdlePromise()\r\n .then(() => this.storageInstance.close())\r\n .then(() => {\r\n /**\r\n * Unsubscribing must be done AFTER the storageInstance.close()\r\n * Because the conflict handling is part of the subscriptions and\r\n * otherwise there might be open conflicts to be resolved which\r\n * will then stuck and never resolve.\r\n */\r\n this._subs.forEach(sub => sub.unsubscribe());\r\n\r\n delete this.database.collections[this.name];\r\n this.database.collectionsSubject$.next({\r\n collection: this.asRxCollection,\r\n type: 'CLOSED'\r\n });\r\n return runAsyncPluginHooks('postCloseRxCollection', this).then(() => true);\r\n });\r\n }\r\n\r\n /**\r\n * remove all data of the collection\r\n */\r\n async remove(): Promise<any> {\r\n await this.close();\r\n await Promise.all(this.onRemove.map(fn => fn()));\r\n /**\r\n * TODO here we should pass the already existing\r\n * storage instances instead of creating new ones.\r\n */\r\n await removeCollectionStorages(\r\n this.database.storage,\r\n this.database.internalStore,\r\n this.database.token,\r\n this.database.name,\r\n this.name,\r\n this.database.multiInstance,\r\n this.database.password,\r\n this.database.hashFunction\r\n );\r\n }\r\n\r\n get asRxCollection(): RxCollection<RxDocumentType, OrmMethods, StaticMethods, any, Reactivity> {\r\n return this as any;\r\n }\r\n}\r\n\r\n/**\r\n * adds the hook-functions to the collections prototype\r\n * this runs only once\r\n */\r\nfunction _applyHookFunctions(\r\n collection: RxCollection<any, any>\r\n) {\r\n if (hooksApplied) return; // already run\r\n hooksApplied = true;\r\n const colProto = Object.getPrototypeOf(collection);\r\n HOOKS_KEYS.forEach(key => {\r\n HOOKS_WHEN.map(when => {\r\n const fnName = when + ucfirst(key);\r\n colProto[fnName] = function (fun: string, parallel: boolean) {\r\n return this.addHook(when, key, fun, parallel);\r\n };\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * ensures that the given document exists\r\n * @return promise that resolves with new doc and flag if inserted\r\n */\r\nfunction _incrementalUpsertEnsureRxDocumentExists<RxDocType>(\r\n rxCollection: RxCollection<RxDocType>,\r\n primary: string,\r\n json: any\r\n): Promise<\r\n {\r\n doc: RxDocument<RxDocType>;\r\n inserted: boolean;\r\n }\r\n> {\r\n /**\r\n * Optimisation shortcut,\r\n * first try to find the document in the doc-cache\r\n */\r\n const docDataFromCache = rxCollection._docCache.getLatestDocumentDataIfExists(primary);\r\n if (docDataFromCache) {\r\n return Promise.resolve({\r\n doc: rxCollection._docCache.getCachedRxDocuments([docDataFromCache])[0],\r\n inserted: false\r\n });\r\n }\r\n return rxCollection.findOne(primary).exec()\r\n .then(doc => {\r\n if (!doc) {\r\n return rxCollection.insert(json).then(newDoc => ({\r\n doc: newDoc,\r\n inserted: true\r\n }));\r\n } else {\r\n return {\r\n doc,\r\n inserted: false\r\n };\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * creates and prepares a new collection\r\n */\r\nexport async function createRxCollection(\r\n {\r\n database,\r\n name,\r\n schema,\r\n instanceCreationOptions = {},\r\n migrationStrategies = {},\r\n autoMigrate = true,\r\n statics = {},\r\n methods = {},\r\n attachments = {},\r\n options = {},\r\n localDocuments = false,\r\n cacheReplacementPolicy = defaultCacheReplacementPolicy,\r\n conflictHandler = defaultConflictHandler,\r\n storageInstance\r\n }: any\r\n): Promise<RxCollection> {\r\n if (!storageInstance) {\r\n const storageInstanceCreationParams: RxStorageInstanceCreationParams<any, any> = {\r\n databaseInstanceToken: database.token,\r\n databaseName: database.name,\r\n collectionName: name,\r\n schema: schema.jsonSchema,\r\n options: instanceCreationOptions,\r\n multiInstance: database.multiInstance,\r\n password: database.password,\r\n devMode: overwritable.isDevMode()\r\n };\r\n\r\n runPluginHooks(\r\n 'preCreateRxStorageInstance',\r\n storageInstanceCreationParams\r\n );\r\n\r\n storageInstance = await createRxCollectionStorageInstance(\r\n database,\r\n storageInstanceCreationParams\r\n );\r\n }\r\n\r\n const collection = new RxCollectionBase(\r\n database,\r\n name,\r\n schema,\r\n storageInstance,\r\n instanceCreationOptions,\r\n migrationStrategies,\r\n methods,\r\n attachments,\r\n options,\r\n cacheReplacementPolicy,\r\n statics,\r\n conflictHandler\r\n );\r\n\r\n try {\r\n await collection.prepare();\r\n\r\n // ORM add statics\r\n Object\r\n .entries(statics)\r\n .forEach(([funName, fun]) => {\r\n Object.defineProperty(collection, funName, {\r\n get: () => (fun as any).bind(collection)\r\n });\r\n });\r\n\r\n runPluginHooks('createRxCollection', {\r\n collection,\r\n creator: {\r\n name,\r\n schema,\r\n storageInstance,\r\n instanceCreationOptions,\r\n migrationStrategies,\r\n methods,\r\n attachments,\r\n options,\r\n cacheReplacementPolicy,\r\n localDocuments,\r\n statics\r\n }\r\n });\r\n\r\n /**\r\n * Migration must run after the hooks so that the\r\n * dev-mode can check up front if the\r\n * migration strategies are correctly set.\r\n */\r\n if (autoMigrate && collection.schema.version !== 0) {\r\n await collection.migratePromise();\r\n }\r\n\r\n } catch (err) {\r\n /**\r\n * If the collection creation fails,\r\n * we yet have to close the storage instances.\r\n */\r\n OPEN_COLLECTIONS.delete(collection);\r\n await storageInstance.close();\r\n throw err;\r\n }\r\n\r\n return collection as any;\r\n}\r\n\r\nexport function isRxCollection(obj: any): boolean {\r\n return obj instanceof RxCollectionBase;\r\n}\r\n"],"mappings":";AAAA,SACIA,MAAM,EACNC,GAAG,EACHC,QAAQ,QACL,MAAM;AAEb,SACIC,OAAO,EACPC,SAAS,EACTC,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,qBAAqB,EACrBC,oBAAoB,EACpBC,4BAA4B,EAC5BC,cAAc,QACX,0BAA0B;AACjC,SACIC,0BAA0B,EAC1BC,0BAA0B,EAC1BC,iCAAiC,EACjCC,wBAAwB,EACxBC,6BAA6B,QAC1B,2BAA2B;AAClC,SACIC,aAAa,EACbC,gBAAgB,QACb,eAAe;AACtB,SACIC,UAAU,EACVC,cAAc,QACX,eAAe;AAItB,SACIC,aAAa,EACbC,2BAA2B,QACxB,gBAAgB;AACvB,SAEIC,gBAAgB,EAChBC,6BAA6B,QAC1B,kBAAkB;AACzB,SAEIC,uBAAuB,QACpB,0BAA0B;AACjC,SACIC,mBAAmB,EACnBC,cAAc,QACX,YAAY;AA4CnB,SACIC,mBAAmB,EACnBC,wBAAwB,QACrB,kCAAkC;AACzC,SACIC,yBAAyB,EACzBC,wCAAwC,EACxCC,0BAA0B,QAEvB,wBAAwB;AAC/B,SAASC,qBAAqB,QAAQ,wBAAwB;AAC9D,SAASC,yBAAyB,QAAQ,kBAAkB;AAC5D,SAASC,YAAY,QAAQ,mBAAmB;AAEhD,SAASC,sBAAsB,QAAQ,oDAAoD;AAC3F,SAASC,iCAAiC,QAAQ,sBAAsB;AAExE,IAAMC,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,CAAU;AAE3C,IAAMC,UAAU,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAU;AAUlE,IAAIC,YAAY,GAAG,KAAK;AAExB,OAAO,IAAMC,gBAAgB,GAAG,IAAIC,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AW,EACXC,OAAO,EACPC,sBAAsB,EACtBC,OAAO,EACPC,eACJ,CAAC;EAED,IAAI;IACA,MAAM8B,UAAU,CAACJ,OAAO,CAAC,CAAC;;IAE1B;IACAuF,MAAM,CACD4H,OAAO,CAAC9O,OAAO,CAAC,CAChB2H,OAAO,CAAC,CAAC,CAACoH,OAAO,EAAEhD,GAAG,CAAC,KAAK;MACzB7E,MAAM,CAAC8H,cAAc,CAACjN,UAAU,EAAEgN,OAAO,EAAE;QACvClH,GAAG,EAAEA,CAAA,KAAOkE,GAAG,CAASI,IAAI,CAACpK,UAAU;MAC3C,CAAC,CAAC;IACN,CAAC,CAAC;IAEN1D,cAAc,CAAC,oBAAoB,EAAE;MACjC0D,UAAU;MACVkN,OAAO,EAAE;QACL1P,IAAI;QACJC,MAAM;QACNU,eAAe;QACfR,uBAAuB;QACvBC,mBAAmB;QACnBC,OAAO;QACPC,WAAW;QACXC,OAAO;QACPC,sBAAsB;QACtByO,cAAc;QACdxO;MACJ;IACJ,CAAC,CAAC;;IAEF;AACR;AACA;AACA;AACA;IACQ,IAAIuO,WAAW,IAAIxM,UAAU,CAACvC,MAAM,CAACgE,OAAO,KAAK,CAAC,EAAE;MAChD,MAAMzB,UAAU,CAACqD,cAAc,CAAC,CAAC;IACrC;EAEJ,CAAC,CAAC,OAAOoE,GAAG,EAAE;IACV;AACR;AACA;AACA;IACQrK,gBAAgB,CAAC4N,MAAM,CAAChL,UAAU,CAAC;IACnC,MAAM7B,eAAe,CAAC8D,KAAK,CAAC,CAAC;IAC7B,MAAMwF,GAAG;EACb;EAEA,OAAOzH,UAAU;AACrB;AAEA,OAAO,SAASmN,cAAcA,CAACC,GAAQ,EAAW;EAC9C,OAAOA,GAAG,YAAY9P,gBAAgB;AAC1C","ignoreList":[]}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { isBulkWriteConflictError, newRxError } from "./rx-error.js";
|
|
2
|
+
import { fillWithDefaultSettings, getComposedPrimaryKeyOfDocumentData } from "./rx-schema-helper.js";
|
|
3
|
+
import { getSingleDocument, getWrittenDocumentsFromBulkWriteResponse, writeSingle } from "./rx-storage-helper.js";
|
|
4
|
+
import { clone, ensureNotFalsy, getDefaultRevision, getDefaultRxDocumentMeta, randomToken } from "./plugins/utils/index.js";
|
|
5
|
+
import { prepareQuery } from "./rx-query-helper.js";
|
|
6
|
+
export var INTERNAL_CONTEXT_COLLECTION = 'collection';
|
|
7
|
+
export var INTERNAL_CONTEXT_STORAGE_TOKEN = 'storage-token';
|
|
8
|
+
export var INTERNAL_CONTEXT_MIGRATION_STATUS = 'rx-migration-status';
|
|
9
|
+
export var INTERNAL_CONTEXT_PIPELINE_CHECKPOINT = 'rx-pipeline-checkpoint';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Do not change the title,
|
|
13
|
+
* we have to flag the internal schema so that
|
|
14
|
+
* some RxStorage implementations are able
|
|
15
|
+
* to detect if the created RxStorageInstance
|
|
16
|
+
* is from the internals or not,
|
|
17
|
+
* to do some optimizations in some cases.
|
|
18
|
+
*/
|
|
19
|
+
export var INTERNAL_STORE_SCHEMA_TITLE = 'RxInternalDocument';
|
|
20
|
+
export var INTERNAL_STORE_SCHEMA = fillWithDefaultSettings({
|
|
21
|
+
version: 0,
|
|
22
|
+
title: INTERNAL_STORE_SCHEMA_TITLE,
|
|
23
|
+
primaryKey: {
|
|
24
|
+
key: 'id',
|
|
25
|
+
fields: ['context', 'key'],
|
|
26
|
+
separator: '|'
|
|
27
|
+
},
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
id: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
maxLength: 200
|
|
33
|
+
},
|
|
34
|
+
key: {
|
|
35
|
+
type: 'string'
|
|
36
|
+
},
|
|
37
|
+
context: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
enum: [INTERNAL_CONTEXT_COLLECTION, INTERNAL_CONTEXT_STORAGE_TOKEN, INTERNAL_CONTEXT_MIGRATION_STATUS, INTERNAL_CONTEXT_PIPELINE_CHECKPOINT, 'OTHER']
|
|
40
|
+
},
|
|
41
|
+
data: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
additionalProperties: true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
indexes: [],
|
|
47
|
+
required: ['key', 'context', 'data'],
|
|
48
|
+
additionalProperties: false,
|
|
49
|
+
/**
|
|
50
|
+
* If the sharding plugin is used,
|
|
51
|
+
* it must not shard on the internal RxStorageInstance
|
|
52
|
+
* because that one anyway has only a small amount of documents
|
|
53
|
+
* and also its creation is in the hot path of the initial page load,
|
|
54
|
+
* so we should spend less time creating multiple RxStorageInstances.
|
|
55
|
+
*/
|
|
56
|
+
sharding: {
|
|
57
|
+
shards: 1,
|
|
58
|
+
mode: 'collection'
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export function getPrimaryKeyOfInternalDocument(key, context) {
|
|
62
|
+
return getComposedPrimaryKeyOfDocumentData(INTERNAL_STORE_SCHEMA, {
|
|
63
|
+
key,
|
|
64
|
+
context
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns all internal documents
|
|
70
|
+
* with context 'collection'
|
|
71
|
+
*/
|
|
72
|
+
export async function getAllCollectionDocuments(storageInstance) {
|
|
73
|
+
var getAllQueryPrepared = prepareQuery(storageInstance.schema, {
|
|
74
|
+
selector: {
|
|
75
|
+
context: INTERNAL_CONTEXT_COLLECTION,
|
|
76
|
+
_deleted: {
|
|
77
|
+
$eq: false
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
sort: [{
|
|
81
|
+
id: 'asc'
|
|
82
|
+
}],
|
|
83
|
+
skip: 0
|
|
84
|
+
});
|
|
85
|
+
var queryResult = await storageInstance.query(getAllQueryPrepared);
|
|
86
|
+
var allDocs = queryResult.documents;
|
|
87
|
+
return allDocs;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* to not confuse multiInstance-messages with other databases that have the same
|
|
92
|
+
* name and adapter, but do not share state with this one (for example in-memory-instances),
|
|
93
|
+
* we set a storage-token and use it in the broadcast-channel
|
|
94
|
+
*/
|
|
95
|
+
export var STORAGE_TOKEN_DOCUMENT_KEY = 'storageToken';
|
|
96
|
+
export var STORAGE_TOKEN_DOCUMENT_ID = getPrimaryKeyOfInternalDocument(STORAGE_TOKEN_DOCUMENT_KEY, INTERNAL_CONTEXT_STORAGE_TOKEN);
|
|
97
|
+
export async function ensureStorageTokenDocumentExists(rxDatabase) {
|
|
98
|
+
/**
|
|
99
|
+
* To have less read-write cycles,
|
|
100
|
+
* we just try to insert a new document
|
|
101
|
+
* and only fetch the existing one if a conflict happened.
|
|
102
|
+
*/
|
|
103
|
+
var storageToken = randomToken(10);
|
|
104
|
+
var passwordHash = rxDatabase.password ? await rxDatabase.hashFunction(JSON.stringify(rxDatabase.password)) : undefined;
|
|
105
|
+
var docData = {
|
|
106
|
+
id: STORAGE_TOKEN_DOCUMENT_ID,
|
|
107
|
+
context: INTERNAL_CONTEXT_STORAGE_TOKEN,
|
|
108
|
+
key: STORAGE_TOKEN_DOCUMENT_KEY,
|
|
109
|
+
data: {
|
|
110
|
+
rxdbVersion: rxDatabase.rxdbVersion,
|
|
111
|
+
token: storageToken,
|
|
112
|
+
/**
|
|
113
|
+
* We add the instance token here
|
|
114
|
+
* to be able to detect if a given RxDatabase instance
|
|
115
|
+
* is the first instance that was ever created
|
|
116
|
+
* or if databases have existed earlier on that storage
|
|
117
|
+
* with the same database name.
|
|
118
|
+
*/
|
|
119
|
+
instanceToken: rxDatabase.token,
|
|
120
|
+
passwordHash
|
|
121
|
+
},
|
|
122
|
+
_deleted: false,
|
|
123
|
+
_meta: getDefaultRxDocumentMeta(),
|
|
124
|
+
_rev: getDefaultRevision(),
|
|
125
|
+
_attachments: {}
|
|
126
|
+
};
|
|
127
|
+
var writeRows = [{
|
|
128
|
+
document: docData
|
|
129
|
+
}];
|
|
130
|
+
var writeResult = await rxDatabase.internalStore.bulkWrite(writeRows, 'internal-add-storage-token');
|
|
131
|
+
if (!writeResult.error[0]) {
|
|
132
|
+
return getWrittenDocumentsFromBulkWriteResponse('id', writeRows, writeResult)[0];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* If we get a 409 error,
|
|
137
|
+
* it means another instance already inserted the storage token.
|
|
138
|
+
* So we get that token from the database and return that one.
|
|
139
|
+
*/
|
|
140
|
+
var error = ensureNotFalsy(writeResult.error[0]);
|
|
141
|
+
if (error.isError && isBulkWriteConflictError(error)) {
|
|
142
|
+
var conflictError = error;
|
|
143
|
+
if (!isDatabaseStateVersionCompatibleWithDatabaseCode(conflictError.documentInDb.data.rxdbVersion, rxDatabase.rxdbVersion)) {
|
|
144
|
+
throw newRxError('DM5', {
|
|
145
|
+
args: {
|
|
146
|
+
database: rxDatabase.name,
|
|
147
|
+
databaseStateVersion: conflictError.documentInDb.data.rxdbVersion,
|
|
148
|
+
codeVersion: rxDatabase.rxdbVersion
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (passwordHash && passwordHash !== conflictError.documentInDb.data.passwordHash) {
|
|
153
|
+
throw newRxError('DB1', {
|
|
154
|
+
passwordHash,
|
|
155
|
+
existingPasswordHash: conflictError.documentInDb.data.passwordHash
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
var storageTokenDocInDb = conflictError.documentInDb;
|
|
159
|
+
return ensureNotFalsy(storageTokenDocInDb);
|
|
160
|
+
}
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
export function isDatabaseStateVersionCompatibleWithDatabaseCode(databaseStateVersion, codeVersion) {
|
|
164
|
+
if (!databaseStateVersion) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
var stateMajor = databaseStateVersion.split('.')[0];
|
|
168
|
+
var codeMajor = codeVersion.split('.')[0];
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Version data must be upwards compatible to next one
|
|
172
|
+
*/
|
|
173
|
+
if (stateMajor === '16' && codeMajor === '17') {
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
if (stateMajor !== codeMajor) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
export async function addConnectedStorageToCollection(collection, storageCollectionName, schema) {
|
|
182
|
+
if (collection.schema.version !== schema.version) {
|
|
183
|
+
throw newRxError('SNH', {
|
|
184
|
+
schema,
|
|
185
|
+
version: collection.schema.version,
|
|
186
|
+
name: collection.name,
|
|
187
|
+
collection,
|
|
188
|
+
args: {
|
|
189
|
+
storageCollectionName
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
var collectionNameWithVersion = _collectionNamePrimary(collection.name, collection.schema.jsonSchema);
|
|
194
|
+
var collectionDocId = getPrimaryKeyOfInternalDocument(collectionNameWithVersion, INTERNAL_CONTEXT_COLLECTION);
|
|
195
|
+
while (true) {
|
|
196
|
+
var collectionDoc = await getSingleDocument(collection.database.internalStore, collectionDocId);
|
|
197
|
+
var saveData = clone(ensureNotFalsy(collectionDoc));
|
|
198
|
+
|
|
199
|
+
// do nothing if already in array
|
|
200
|
+
var alreadyThere = saveData.data.connectedStorages.find(row => row.collectionName === storageCollectionName && row.schema.version === schema.version);
|
|
201
|
+
if (alreadyThere) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// otherwise add to array and save
|
|
206
|
+
saveData.data.connectedStorages.push({
|
|
207
|
+
collectionName: storageCollectionName,
|
|
208
|
+
schema
|
|
209
|
+
});
|
|
210
|
+
try {
|
|
211
|
+
await writeSingle(collection.database.internalStore, {
|
|
212
|
+
previous: ensureNotFalsy(collectionDoc),
|
|
213
|
+
document: saveData
|
|
214
|
+
}, 'add-connected-storage-to-collection');
|
|
215
|
+
} catch (err) {
|
|
216
|
+
if (!isBulkWriteConflictError(err)) {
|
|
217
|
+
throw err;
|
|
218
|
+
}
|
|
219
|
+
// retry on conflict
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
export async function removeConnectedStorageFromCollection(collection, storageCollectionName, schema) {
|
|
224
|
+
if (collection.schema.version !== schema.version) {
|
|
225
|
+
throw newRxError('SNH', {
|
|
226
|
+
schema,
|
|
227
|
+
version: collection.schema.version,
|
|
228
|
+
name: collection.name,
|
|
229
|
+
collection,
|
|
230
|
+
args: {
|
|
231
|
+
storageCollectionName
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
var collectionNameWithVersion = _collectionNamePrimary(collection.name, collection.schema.jsonSchema);
|
|
236
|
+
var collectionDocId = getPrimaryKeyOfInternalDocument(collectionNameWithVersion, INTERNAL_CONTEXT_COLLECTION);
|
|
237
|
+
while (true) {
|
|
238
|
+
var collectionDoc = await getSingleDocument(collection.database.internalStore, collectionDocId);
|
|
239
|
+
var saveData = clone(ensureNotFalsy(collectionDoc));
|
|
240
|
+
|
|
241
|
+
// do nothing if not there
|
|
242
|
+
var isThere = saveData.data.connectedStorages.find(row => row.collectionName === storageCollectionName && row.schema.version === schema.version);
|
|
243
|
+
if (!isThere) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// otherwise remove from array and save
|
|
248
|
+
saveData.data.connectedStorages = saveData.data.connectedStorages.filter(item => item.collectionName !== storageCollectionName);
|
|
249
|
+
try {
|
|
250
|
+
await writeSingle(collection.database.internalStore, {
|
|
251
|
+
previous: ensureNotFalsy(collectionDoc),
|
|
252
|
+
document: saveData
|
|
253
|
+
}, 'remove-connected-storage-from-collection');
|
|
254
|
+
} catch (err) {
|
|
255
|
+
if (!isBulkWriteConflictError(err)) {
|
|
256
|
+
throw err;
|
|
257
|
+
}
|
|
258
|
+
// retry on conflict
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* returns the primary for a given collection-data
|
|
265
|
+
* used in the internal store of a RxDatabase
|
|
266
|
+
*/
|
|
267
|
+
export function _collectionNamePrimary(name, schema) {
|
|
268
|
+
return name + '-' + schema.version;
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=rx-database-internal-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rx-database-internal-store.js","names":["isBulkWriteConflictError","newRxError","fillWithDefaultSettings","getComposedPrimaryKeyOfDocumentData","getSingleDocument","getWrittenDocumentsFromBulkWriteResponse","writeSingle","clone","ensureNotFalsy","getDefaultRevision","getDefaultRxDocumentMeta","randomToken","prepareQuery","INTERNAL_CONTEXT_COLLECTION","INTERNAL_CONTEXT_STORAGE_TOKEN","INTERNAL_CONTEXT_MIGRATION_STATUS","INTERNAL_CONTEXT_PIPELINE_CHECKPOINT","INTERNAL_STORE_SCHEMA_TITLE","INTERNAL_STORE_SCHEMA","version","title","primaryKey","key","fields","separator","type","properties","id","maxLength","context","enum","data","additionalProperties","indexes","required","sharding","shards","mode","getPrimaryKeyOfInternalDocument","getAllCollectionDocuments","storageInstance","getAllQueryPrepared","schema","selector","_deleted","$eq","sort","skip","queryResult","query","allDocs","documents","STORAGE_TOKEN_DOCUMENT_KEY","STORAGE_TOKEN_DOCUMENT_ID","ensureStorageTokenDocumentExists","rxDatabase","storageToken","passwordHash","password","hashFunction","JSON","stringify","undefined","docData","rxdbVersion","token","instanceToken","_meta","_rev","_attachments","writeRows","document","writeResult","internalStore","bulkWrite","error","isError","conflictError","isDatabaseStateVersionCompatibleWithDatabaseCode","documentInDb","args","database","name","databaseStateVersion","codeVersion","existingPasswordHash","storageTokenDocInDb","stateMajor","split","codeMajor","addConnectedStorageToCollection","collection","storageCollectionName","collectionNameWithVersion","_collectionNamePrimary","jsonSchema","collectionDocId","collectionDoc","saveData","alreadyThere","connectedStorages","find","row","collectionName","push","previous","err","removeConnectedStorageFromCollection","isThere","filter","item"],"sources":["../../src/rx-database-internal-store.ts"],"sourcesContent":["import {\r\n isBulkWriteConflictError,\r\n newRxError\r\n} from './rx-error.ts';\r\nimport {\r\n fillWithDefaultSettings,\r\n getComposedPrimaryKeyOfDocumentData\r\n} from './rx-schema-helper.ts';\r\nimport { getSingleDocument, getWrittenDocumentsFromBulkWriteResponse, writeSingle } from './rx-storage-helper.ts';\r\nimport type {\r\n CollectionsOfDatabase,\r\n InternalStoreCollectionDocType,\r\n InternalStoreDocType,\r\n InternalStoreStorageTokenDocType,\r\n RxCollection,\r\n RxDatabase,\r\n RxDocumentData,\r\n RxJsonSchema,\r\n RxStorageInstance,\r\n RxStorageWriteErrorConflict\r\n} from './types/index.d.ts';\r\nimport {\r\n clone,\r\n ensureNotFalsy,\r\n getDefaultRevision,\r\n getDefaultRxDocumentMeta,\r\n randomToken\r\n} from './plugins/utils/index.ts';\r\nimport { prepareQuery } from './rx-query-helper.ts';\r\n\r\nexport const INTERNAL_CONTEXT_COLLECTION = 'collection';\r\nexport const INTERNAL_CONTEXT_STORAGE_TOKEN = 'storage-token';\r\nexport const INTERNAL_CONTEXT_MIGRATION_STATUS = 'rx-migration-status';\r\nexport const INTERNAL_CONTEXT_PIPELINE_CHECKPOINT = 'rx-pipeline-checkpoint';\r\n\r\n/**\r\n * Do not change the title,\r\n * we have to flag the internal schema so that\r\n * some RxStorage implementations are able\r\n * to detect if the created RxStorageInstance\r\n * is from the internals or not,\r\n * to do some optimizations in some cases.\r\n */\r\nexport const INTERNAL_STORE_SCHEMA_TITLE = 'RxInternalDocument';\r\n\r\nexport const INTERNAL_STORE_SCHEMA: RxJsonSchema<RxDocumentData<InternalStoreDocType<any>>> = fillWithDefaultSettings({\r\n version: 0,\r\n title: INTERNAL_STORE_SCHEMA_TITLE,\r\n primaryKey: {\r\n key: 'id',\r\n fields: [\r\n 'context',\r\n 'key'\r\n ],\r\n separator: '|'\r\n },\r\n type: 'object',\r\n properties: {\r\n id: {\r\n type: 'string',\r\n maxLength: 200\r\n },\r\n key: {\r\n type: 'string'\r\n },\r\n context: {\r\n type: 'string',\r\n enum: [\r\n INTERNAL_CONTEXT_COLLECTION,\r\n INTERNAL_CONTEXT_STORAGE_TOKEN,\r\n INTERNAL_CONTEXT_MIGRATION_STATUS,\r\n INTERNAL_CONTEXT_PIPELINE_CHECKPOINT,\r\n 'OTHER'\r\n ]\r\n },\r\n data: {\r\n type: 'object',\r\n additionalProperties: true\r\n }\r\n },\r\n indexes: [],\r\n required: [\r\n 'key',\r\n 'context',\r\n 'data'\r\n ],\r\n additionalProperties: false,\r\n /**\r\n * If the sharding plugin is used,\r\n * it must not shard on the internal RxStorageInstance\r\n * because that one anyway has only a small amount of documents\r\n * and also its creation is in the hot path of the initial page load,\r\n * so we should spend less time creating multiple RxStorageInstances.\r\n */\r\n sharding: {\r\n shards: 1,\r\n mode: 'collection'\r\n }\r\n});\r\n\r\n\r\nexport function getPrimaryKeyOfInternalDocument(\r\n key: string,\r\n context: string\r\n): string {\r\n return getComposedPrimaryKeyOfDocumentData<InternalStoreDocType>(\r\n INTERNAL_STORE_SCHEMA,\r\n {\r\n key,\r\n context\r\n }\r\n );\r\n}\r\n\r\n/**\r\n * Returns all internal documents\r\n * with context 'collection'\r\n */\r\nexport async function getAllCollectionDocuments(\r\n storageInstance: RxStorageInstance<InternalStoreDocType<any>, any, any>\r\n): Promise<RxDocumentData<InternalStoreCollectionDocType>[]> {\r\n const getAllQueryPrepared = prepareQuery<InternalStoreDocType<any>>(\r\n storageInstance.schema,\r\n {\r\n selector: {\r\n context: INTERNAL_CONTEXT_COLLECTION,\r\n _deleted: {\r\n $eq: false\r\n }\r\n },\r\n sort: [{ id: 'asc' }],\r\n skip: 0\r\n }\r\n );\r\n const queryResult = await storageInstance.query(getAllQueryPrepared);\r\n const allDocs = queryResult.documents;\r\n return allDocs;\r\n}\r\n\r\n/**\r\n * to not confuse multiInstance-messages with other databases that have the same\r\n * name and adapter, but do not share state with this one (for example in-memory-instances),\r\n * we set a storage-token and use it in the broadcast-channel\r\n */\r\nexport const STORAGE_TOKEN_DOCUMENT_KEY = 'storageToken';\r\n\r\nexport const STORAGE_TOKEN_DOCUMENT_ID = getPrimaryKeyOfInternalDocument(\r\n STORAGE_TOKEN_DOCUMENT_KEY,\r\n INTERNAL_CONTEXT_STORAGE_TOKEN\r\n);\r\n\r\nexport async function ensureStorageTokenDocumentExists<Collections extends CollectionsOfDatabase = any>(\r\n rxDatabase: RxDatabase<Collections>\r\n): Promise<RxDocumentData<InternalStoreStorageTokenDocType>> {\r\n\r\n /**\r\n * To have less read-write cycles,\r\n * we just try to insert a new document\r\n * and only fetch the existing one if a conflict happened.\r\n */\r\n const storageToken = randomToken(10);\r\n\r\n const passwordHash = rxDatabase.password ?\r\n await rxDatabase.hashFunction(JSON.stringify(rxDatabase.password)) :\r\n undefined;\r\n\r\n const docData: RxDocumentData<InternalStoreStorageTokenDocType> = {\r\n id: STORAGE_TOKEN_DOCUMENT_ID,\r\n context: INTERNAL_CONTEXT_STORAGE_TOKEN,\r\n key: STORAGE_TOKEN_DOCUMENT_KEY,\r\n data: {\r\n rxdbVersion: rxDatabase.rxdbVersion,\r\n token: storageToken,\r\n /**\r\n * We add the instance token here\r\n * to be able to detect if a given RxDatabase instance\r\n * is the first instance that was ever created\r\n * or if databases have existed earlier on that storage\r\n * with the same database name.\r\n */\r\n instanceToken: rxDatabase.token,\r\n passwordHash\r\n },\r\n _deleted: false,\r\n _meta: getDefaultRxDocumentMeta(),\r\n _rev: getDefaultRevision(),\r\n _attachments: {}\r\n };\r\n\r\n const writeRows = [{ document: docData }];\r\n const writeResult = await rxDatabase.internalStore.bulkWrite(\r\n writeRows,\r\n 'internal-add-storage-token'\r\n );\r\n if (!writeResult.error[0]) {\r\n return getWrittenDocumentsFromBulkWriteResponse(\r\n 'id',\r\n writeRows,\r\n writeResult\r\n )[0];\r\n }\r\n\r\n /**\r\n * If we get a 409 error,\r\n * it means another instance already inserted the storage token.\r\n * So we get that token from the database and return that one.\r\n */\r\n const error = ensureNotFalsy(writeResult.error[0]);\r\n if (\r\n error.isError &&\r\n isBulkWriteConflictError(error)\r\n ) {\r\n const conflictError = (error as RxStorageWriteErrorConflict<InternalStoreStorageTokenDocType>);\r\n\r\n if (\r\n !isDatabaseStateVersionCompatibleWithDatabaseCode(\r\n conflictError.documentInDb.data.rxdbVersion,\r\n rxDatabase.rxdbVersion\r\n )\r\n ) {\r\n throw newRxError('DM5', {\r\n args: {\r\n database: rxDatabase.name,\r\n databaseStateVersion: conflictError.documentInDb.data.rxdbVersion,\r\n codeVersion: rxDatabase.rxdbVersion\r\n }\r\n });\r\n }\r\n\r\n if (\r\n passwordHash &&\r\n passwordHash !== conflictError.documentInDb.data.passwordHash\r\n ) {\r\n throw newRxError('DB1', {\r\n passwordHash,\r\n existingPasswordHash: conflictError.documentInDb.data.passwordHash\r\n });\r\n }\r\n\r\n const storageTokenDocInDb = conflictError.documentInDb;\r\n return ensureNotFalsy(storageTokenDocInDb);\r\n }\r\n throw error;\r\n}\r\n\r\n\r\nexport function isDatabaseStateVersionCompatibleWithDatabaseCode(\r\n databaseStateVersion: string,\r\n codeVersion: string\r\n): boolean {\r\n if (!databaseStateVersion) {\r\n return false;\r\n }\r\n\r\n const stateMajor = databaseStateVersion.split('.')[0];\r\n const codeMajor = codeVersion.split('.')[0];\r\n\r\n /**\r\n * Version data must be upwards compatible to next one\r\n */\r\n if (stateMajor === '16' && codeMajor === '17') {\r\n return true;\r\n }\r\n\r\n if (stateMajor !== codeMajor) {\r\n return false;\r\n }\r\n\r\n return true;\r\n}\r\n\r\n\r\n\r\n\r\n\r\nexport async function addConnectedStorageToCollection(\r\n collection: RxCollection<any, unknown, unknown, unknown>,\r\n storageCollectionName: string,\r\n schema: RxJsonSchema<any>\r\n) {\r\n\r\n if (collection.schema.version !== schema.version) {\r\n throw newRxError('SNH', {\r\n schema,\r\n version: collection.schema.version,\r\n name: collection.name,\r\n collection,\r\n args: {\r\n storageCollectionName\r\n }\r\n });\r\n }\r\n\r\n const collectionNameWithVersion = _collectionNamePrimary(collection.name, collection.schema.jsonSchema);\r\n const collectionDocId = getPrimaryKeyOfInternalDocument(\r\n collectionNameWithVersion,\r\n INTERNAL_CONTEXT_COLLECTION\r\n );\r\n\r\n while (true) {\r\n const collectionDoc = await getSingleDocument(\r\n collection.database.internalStore,\r\n collectionDocId\r\n );\r\n const saveData: RxDocumentData<InternalStoreCollectionDocType> = clone(ensureNotFalsy(collectionDoc));\r\n\r\n // do nothing if already in array\r\n const alreadyThere = saveData.data.connectedStorages\r\n .find(row => row.collectionName === storageCollectionName && row.schema.version === schema.version);\r\n if (alreadyThere) {\r\n return;\r\n }\r\n\r\n // otherwise add to array and save\r\n saveData.data.connectedStorages.push({\r\n collectionName: storageCollectionName,\r\n schema\r\n });\r\n try {\r\n await writeSingle(\r\n collection.database.internalStore,\r\n {\r\n previous: ensureNotFalsy(collectionDoc),\r\n document: saveData\r\n },\r\n 'add-connected-storage-to-collection'\r\n );\r\n } catch (err) {\r\n if (!isBulkWriteConflictError(err)) {\r\n throw err;\r\n }\r\n // retry on conflict\r\n }\r\n }\r\n}\r\n\r\nexport async function removeConnectedStorageFromCollection(\r\n collection: RxCollection<any, unknown, unknown, unknown>,\r\n storageCollectionName: string,\r\n schema: RxJsonSchema<any>\r\n) {\r\n if (collection.schema.version !== schema.version) {\r\n throw newRxError('SNH', {\r\n schema,\r\n version: collection.schema.version,\r\n name: collection.name,\r\n collection,\r\n args: {\r\n storageCollectionName\r\n }\r\n });\r\n }\r\n\r\n const collectionNameWithVersion = _collectionNamePrimary(collection.name, collection.schema.jsonSchema);\r\n const collectionDocId = getPrimaryKeyOfInternalDocument(\r\n collectionNameWithVersion,\r\n INTERNAL_CONTEXT_COLLECTION\r\n );\r\n\r\n while (true) {\r\n const collectionDoc = await getSingleDocument(\r\n collection.database.internalStore,\r\n collectionDocId\r\n );\r\n const saveData: RxDocumentData<InternalStoreCollectionDocType> = clone(ensureNotFalsy(collectionDoc));\r\n\r\n // do nothing if not there\r\n const isThere = saveData.data.connectedStorages\r\n .find(row => row.collectionName === storageCollectionName && row.schema.version === schema.version);\r\n if (!isThere) {\r\n return;\r\n }\r\n\r\n // otherwise remove from array and save\r\n saveData.data.connectedStorages = saveData.data.connectedStorages.filter(item => item.collectionName !== storageCollectionName);\r\n try {\r\n await writeSingle(\r\n collection.database.internalStore,\r\n {\r\n previous: ensureNotFalsy(collectionDoc),\r\n document: saveData\r\n },\r\n 'remove-connected-storage-from-collection'\r\n );\r\n } catch (err) {\r\n if (!isBulkWriteConflictError(err)) {\r\n throw err;\r\n }\r\n // retry on conflict\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\n/**\r\n * returns the primary for a given collection-data\r\n * used in the internal store of a RxDatabase\r\n */\r\nexport function _collectionNamePrimary(name: string, schema: RxJsonSchema<any>) {\r\n return name + '-' + schema.version;\r\n}\r\n"],"mappings":"AAAA,SACIA,wBAAwB,EACxBC,UAAU,QACP,eAAe;AACtB,SACIC,uBAAuB,EACvBC,mCAAmC,QAChC,uBAAuB;AAC9B,SAASC,iBAAiB,EAAEC,wCAAwC,EAAEC,WAAW,QAAQ,wBAAwB;AAajH,SACIC,KAAK,EACLC,cAAc,EACdC,kBAAkB,EAClBC,wBAAwB,EACxBC,WAAW,QACR,0BAA0B;AACjC,SAASC,YAAY,QAAQ,sBAAsB;AAEnD,OAAO,IAAMC,2BAA2B,GAAG,YAAY;AACvD,OAAO,IAAMC,8BAA8B,GAAG,eAAe;AAC7D,OAAO,IAAMC,iCAAiC,GAAG,qBAAqB;AACtE,OAAO,IAAMC,oCAAoC,GAAG,wBAAwB;;AAE5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,2BAA2B,GAAG,oBAAoB;AAE/D,OAAO,IAAMC,qBAA8E,GAAGhB,uBAAuB,CAAC;EAClHiB,OAAO,EAAE,CAAC;EACVC,KAAK,EAAEH,2BAA2B;EAClCI,UAAU,EAAE;IACRC,GAAG,EAAE,IAAI;IACT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