@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-query.js","names":["BehaviorSubject","merge","mergeMap","filter","map","startWith","distinctUntilChanged","shareReplay","sortObject","pluginMissing","overwriteGetterForCaching","clone","PROMISE_RESOLVE_FALSE","RXJS_SHARE_REPLAY_DEFAULTS","ensureNotFalsy","areRxDocumentArraysEqual","promiseWait","newRxError","rxStorageWriteErrorToRxError","runPluginHooks","calculateNewResults","triggerCacheReplacement","getQueryMatcher","getSortComparator","normalizeMangoQuery","prepareQuery","runQueryUpdateFunction","RxQuerySingleResult","_queryCount","newQueryID","_ensureEqualCount","RxQueryBase","op","mangoQuery","collection","other","id","_execOverDatabaseCount","_creationTime","Date","now","_lastEnsureEqual","uncached","refCount$","_result","_latestChangeEvent","_ensureEqualQueue","_getDefaultQuery","isFindOneByIdQuery","schema","primaryPath","_proto","prototype","_setResultData","newResultData","database","name","Map","Array","from","values","newQueryResult","length","_execOverDatabase","rerunCount","result","counterBefore","_changeEventBuffer","getCounter","ids","selector","$in","docsData","mustBeQueried","i","docData","_docCache","getLatestDocumentDataIfExists","_deleted","push","docs","storageInstance","findDocumentsById","counter","preparedQuery","getPreparedQuery","countResult","count","mode","allowSlowCount","queryObj","queryResult","queryCollection","exec","throwIfMissing","query","_ensureEqual","useResult","getValue","toString","stringObj","normalizedQuery","value","JSON","stringify","hookInput","rxQuery","$eq","index","unshift","jsonSchema","doesDocumentDataMatch","queryMatcher","remove","isArray","bulkRemove","error","success","incrementalRemove","asRxQuery","doc","update","_updateObj","patch","incrementalPatch","modify","mutationFunction","incrementalModify","where","_queryObj","sort","_params","skip","_amount","limit","_createClass","key","get","_$","results$","eventBulks$","pipe","bulk","isLocal","prev","curr","time","reactivity","getReactivityFactory","fromObservable","$","undefined","tunnelQueryCache","_queryCache","getByQuery","createRxQuery","ret","_isResultsInSync","currentLatestEventNumber","awaitBeforeReads","size","Promise","all","fn","then","__ensureEqual","closed","mustReExec","missedChangeEvents","getFrom","runChangeEvents","reduceByLastOfDoc","previousCount","newCount","forEach","cE","didMatchBefore","previousDocumentData","doesMatchNow","documentData","eventReduceResult","runFullQueryAgain","changed","newResults","resolve","primarySelectorValue","hasExtraOperators","Object","keys","hasOtherSelectors","docIdArray","docIds","Set","cacheMisses","docId","docsFromStorage","concat","sortComparator","slice","limitIsNumber","documents","hasOwnProperty","call","find","r","isRxQuery","obj"],"sources":["../../src/rx-query.ts"],"sourcesContent":["import {\r\n BehaviorSubject,\r\n Observable,\r\n merge\r\n} from 'rxjs';\r\nimport {\r\n mergeMap,\r\n filter,\r\n map,\r\n startWith,\r\n distinctUntilChanged,\r\n shareReplay\r\n} from 'rxjs/operators';\r\nimport {\r\n sortObject,\r\n pluginMissing,\r\n overwriteGetterForCaching,\r\n clone,\r\n PROMISE_RESOLVE_FALSE,\r\n RXJS_SHARE_REPLAY_DEFAULTS,\r\n ensureNotFalsy,\r\n areRxDocumentArraysEqual,\r\n promiseWait\r\n} from './plugins/utils/index.ts';\r\nimport {\r\n newRxError,\r\n rxStorageWriteErrorToRxError\r\n} from './rx-error.ts';\r\nimport {\r\n runPluginHooks\r\n} from './hooks.ts';\r\nimport type {\r\n RxCollection,\r\n RxDocument,\r\n RxQueryOP,\r\n RxQuery,\r\n MangoQuery,\r\n MangoQuerySortPart,\r\n MangoQuerySelector,\r\n PreparedQuery,\r\n FilledMangoQuery,\r\n RxDocumentWriteData,\r\n RxDocumentData,\r\n QueryMatcher,\r\n ModifyFunction,\r\n RxStorageChangeEvent,\r\n Reactified\r\n} from './types/index.d.ts';\r\nimport { calculateNewResults } from './event-reduce.ts';\r\nimport { triggerCacheReplacement } from './query-cache.ts';\r\nimport {\r\n getQueryMatcher,\r\n getSortComparator,\r\n normalizeMangoQuery,\r\n prepareQuery,\r\n runQueryUpdateFunction\r\n\r\n} from './rx-query-helper.ts';\r\nimport { RxQuerySingleResult } from './rx-query-single-result.ts';\r\n\r\nlet _queryCount = 0;\r\nconst newQueryID = function (): number {\r\n return ++_queryCount;\r\n};\r\n\r\n/**\r\n * Counter for _lastEnsureEqual.\r\n * We only need ordering and zero-check for cache replacement,\r\n * so a counter is cheaper than Date.now().\r\n */\r\nlet _ensureEqualCount = 0;\r\n\r\nexport class RxQueryBase<\r\n RxDocType,\r\n RxQueryResult,\r\n OrmMethods = {},\r\n Reactivity = unknown,\r\n> {\r\n\r\n public id: number = newQueryID();\r\n\r\n /**\r\n * Some stats then are used for debugging and cache replacement policies\r\n */\r\n public _execOverDatabaseCount: number = 0;\r\n /**\r\n * @performance\r\n * Use Date.now() instead of now() for creation time.\r\n * The monotonic uniqueness guarantee of now() is not needed here\r\n * since _creationTime is only used by the cache replacement policy\r\n * for rough lifetime comparisons.\r\n */\r\n public _creationTime = Date.now();\r\n\r\n // used in the query-cache to determine if the RxQuery can be cleaned up.\r\n public _lastEnsureEqual = 0;\r\n\r\n public uncached = false;\r\n\r\n // used to count the subscribers to the query\r\n public refCount$ = new BehaviorSubject(null);\r\n\r\n public isFindOneByIdQuery: false | string | string[];\r\n\r\n\r\n /**\r\n * Contains the current result state\r\n * or null if query has not run yet.\r\n */\r\n public _result: RxQuerySingleResult<RxDocType> | null = null;\r\n\r\n\r\n constructor(\r\n public op: RxQueryOP,\r\n public mangoQuery: Readonly<MangoQuery<RxDocType>>,\r\n public collection: RxCollection<RxDocType>,\r\n // used by some plugins\r\n public other: any = {}\r\n ) {\r\n if (!mangoQuery) {\r\n this.mangoQuery = _getDefaultQuery();\r\n }\r\n\r\n /**\r\n * @performance\r\n * isFindOneByIdQuery is only used by queryCollection()\r\n * which is not called for 'count' queries.\r\n * Skip the check for count queries to avoid unnecessary work.\r\n */\r\n if (op === 'count') {\r\n this.isFindOneByIdQuery = false;\r\n } else {\r\n this.isFindOneByIdQuery = isFindOneByIdQuery(\r\n this.collection.schema.primaryPath as string,\r\n mangoQuery\r\n );\r\n }\r\n }\r\n get $(): Observable<RxQueryResult> {\r\n if (!this._$) {\r\n const results$ = this.collection.eventBulks$.pipe(\r\n /**\r\n * Performance shortcut.\r\n * Changes to local documents are not relevant for the query.\r\n */\r\n filter((bulk: any) => !bulk.isLocal),\r\n /**\r\n * Start once to ensure the querying also starts\r\n * when there where no changes.\r\n */\r\n startWith(null),\r\n // ensure query results are up to date.\r\n mergeMap(() => _ensureEqual(this as any)),\r\n // use the current result set, written by _ensureEqual().\r\n map(() => this._result),\r\n // do not run stuff above for each new subscriber, only once.\r\n shareReplay(RXJS_SHARE_REPLAY_DEFAULTS),\r\n // do not proceed if result set has not changed.\r\n distinctUntilChanged((prev: RxQuerySingleResult<RxDocType> | null, curr: RxQuerySingleResult<RxDocType> | null) => {\r\n if (prev && prev.time === ensureNotFalsy(curr).time) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }),\r\n filter((result: RxQuerySingleResult<RxDocType> | null) => !!result),\r\n /**\r\n * Map the result set to a single RxDocument or an array,\r\n * depending on query type\r\n */\r\n map((result: RxQuerySingleResult<RxDocType> | null) => {\r\n return ensureNotFalsy(result).getValue();\r\n })\r\n );\r\n\r\n this._$ = merge<any>(\r\n results$,\r\n /**\r\n * Also add the refCount$ to the query observable\r\n * to allow us to count the amount of subscribers.\r\n */\r\n this.refCount$.pipe(\r\n filter(() => false)\r\n )\r\n );\r\n }\r\n return this._$ as any;\r\n }\r\n\r\n get $$(): Reactified<Reactivity, RxQueryResult> {\r\n const reactivity = this.collection.database.getReactivityFactory();\r\n return reactivity.fromObservable(\r\n this.$,\r\n undefined,\r\n this.collection.database\r\n ) as any;\r\n }\r\n\r\n // stores the changeEvent-number of the last handled change-event\r\n public _latestChangeEvent: -1 | number = -1;\r\n\r\n /**\r\n * ensures that the exec-runs\r\n * are not run in parallel\r\n */\r\n public _ensureEqualQueue: Promise<boolean> = PROMISE_RESOLVE_FALSE;\r\n\r\n /**\r\n * Returns an observable that emits the results\r\n * This should behave like an rxjs-BehaviorSubject which means:\r\n * - Emit the current result-set on subscribe\r\n * - Emit the new result-set when an RxChangeEvent comes in\r\n * - Do not emit anything before the first result-set was created (no null)\r\n */\r\n public _$?: Observable<RxQueryResult>;\r\n\r\n /**\r\n * set the new result-data as result-docs of the query\r\n * @param newResultData json-docs that were received from the storage\r\n */\r\n _setResultData(newResultData: RxDocumentData<RxDocType>[] | number | Map<string, RxDocumentData<RxDocType>>): void {\r\n if (typeof newResultData === 'undefined') {\r\n throw newRxError('QU18', {\r\n database: this.collection.database.name,\r\n collection: this.collection.name\r\n });\r\n }\r\n if (typeof newResultData === 'number') {\r\n this._result = new RxQuerySingleResult<RxDocType>(\r\n this as any,\r\n [],\r\n newResultData\r\n );\r\n return;\r\n } else if (newResultData instanceof Map) {\r\n newResultData = Array.from((newResultData as Map<string, RxDocumentData<RxDocType>>).values());\r\n }\r\n\r\n const newQueryResult = new RxQuerySingleResult<RxDocType>(\r\n this as any,\r\n newResultData,\r\n newResultData.length\r\n );\r\n this._result = newQueryResult;\r\n }\r\n\r\n /**\r\n * executes the query on the database\r\n * @return results-array with document-data\r\n */\r\n async _execOverDatabase(rerunCount = 0): Promise<{\r\n result: RxDocumentData<RxDocType>[] | number;\r\n counter: number;\r\n }> {\r\n this._execOverDatabaseCount = this._execOverDatabaseCount + 1;\r\n let result: {\r\n result: RxDocumentData<RxDocType>[] | number;\r\n counter: number;\r\n };\r\n\r\n /**\r\n * @performance\r\n * Instead of subscribing to eventBulks$ to detect concurrent writes,\r\n * we snapshot the change event counter before and after the query.\r\n * If the counter changed, a write happened during execution and\r\n * we must re-run the query to ensure correct results.\r\n * This avoids the overhead of RxJS Subject subscribe/unsubscribe per query.\r\n *\r\n * @link https://github.com/pubkey/rxdb/issues/7067\r\n */\r\n const counterBefore = this.collection._changeEventBuffer.getCounter();\r\n\r\n if (this.op === 'findByIds') {\r\n const ids: string[] = ensureNotFalsy(this.mangoQuery.selector as any)[this.collection.schema.primaryPath].$in;\r\n const docsData: RxDocumentData<RxDocType>[] = [];\r\n const mustBeQueried: string[] = [];\r\n // first try to fill from docCache\r\n for (let i = 0; i < ids.length; i++) {\r\n const id = ids[i];\r\n const docData = this.collection._docCache.getLatestDocumentDataIfExists(id);\r\n if (docData) {\r\n if (!docData._deleted) {\r\n docsData.push(docData);\r\n }\r\n } else {\r\n mustBeQueried.push(id);\r\n }\r\n }\r\n // everything which was not in docCache must be fetched from the storage\r\n if (mustBeQueried.length > 0) {\r\n const docs = await this.collection.storageInstance.findDocumentsById(mustBeQueried, false);\r\n for (let i = 0; i < docs.length; i++) {\r\n docsData.push(docs[i]);\r\n }\r\n }\r\n result = {\r\n result: docsData,\r\n counter: this.collection._changeEventBuffer.getCounter()\r\n };\r\n } else if (this.op === 'count') {\r\n const preparedQuery = this.getPreparedQuery();\r\n const countResult = await this.collection.storageInstance.count(preparedQuery);\r\n if (countResult.mode === 'slow' && !this.collection.database.allowSlowCount) {\r\n throw newRxError('QU14', {\r\n collection: this.collection,\r\n queryObj: this.mangoQuery\r\n });\r\n } else {\r\n result = {\r\n result: countResult.count,\r\n counter: this.collection._changeEventBuffer.getCounter()\r\n };\r\n }\r\n } else {\r\n const queryResult = await queryCollection<RxDocType>(this as any);\r\n result = {\r\n result: queryResult.docs,\r\n counter: queryResult.counter\r\n };\r\n }\r\n\r\n if (this.collection._changeEventBuffer.getCounter() !== counterBefore) {\r\n await promiseWait(rerunCount * 20);\r\n return this._execOverDatabase(rerunCount + 1);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Execute the query\r\n * To have an easier implementations,\r\n * just subscribe and use the first result\r\n */\r\n public exec(throwIfMissing: true): Promise<RxDocument<RxDocType, OrmMethods, Reactivity>>;\r\n public exec(): Promise<RxQueryResult>;\r\n public async exec(throwIfMissing?: boolean): Promise<any> {\r\n if (throwIfMissing && this.op !== 'findOne') {\r\n throw newRxError('QU9', {\r\n collection: this.collection.name,\r\n query: this.mangoQuery,\r\n op: this.op\r\n });\r\n }\r\n\r\n /**\r\n * run _ensureEqual() here,\r\n * this will make sure that errors in the query which throw inside of the RxStorage,\r\n * will be thrown at this execution context and not in the background.\r\n */\r\n await _ensureEqual(this as any);\r\n const useResult = ensureNotFalsy(this._result);\r\n return useResult.getValue(throwIfMissing);\r\n }\r\n\r\n\r\n\r\n /**\r\n * Returns the normalized query.\r\n * Caches the result so that multiple calls to\r\n * queryMatcher, toString() and getPreparedQuery()\r\n * do not have to run the normalization again.\r\n * @overwrites itself with the actual value.\r\n */\r\n get normalizedQuery(): FilledMangoQuery<RxDocType> {\r\n return overwriteGetterForCaching(\r\n this,\r\n 'normalizedQuery',\r\n normalizeMangoQuery<RxDocType>(\r\n this.collection.schema.jsonSchema,\r\n this.mangoQuery,\r\n this.op === 'count'\r\n )\r\n );\r\n }\r\n\r\n /**\r\n * cached call to get the queryMatcher\r\n * @overwrites itself with the actual value\r\n */\r\n get queryMatcher(): QueryMatcher<RxDocumentWriteData<RxDocType>> {\r\n const schema = this.collection.schema.jsonSchema;\r\n return overwriteGetterForCaching(\r\n this,\r\n 'queryMatcher',\r\n getQueryMatcher(\r\n schema,\r\n this.normalizedQuery\r\n ) as any\r\n );\r\n }\r\n\r\n /**\r\n * returns a string that is used for equal-comparisons\r\n * @overwrites itself with the actual value\r\n */\r\n toString(): string {\r\n const stringObj = sortObject({\r\n op: this.op,\r\n query: this.normalizedQuery,\r\n other: this.other\r\n }, true);\r\n const value = JSON.stringify(stringObj);\r\n this.toString = () => value;\r\n return value;\r\n }\r\n\r\n /**\r\n * returns the prepared query\r\n * which can be sent to the storage instance to query for documents.\r\n * @overwrites itself with the actual value.\r\n */\r\n getPreparedQuery(): PreparedQuery<RxDocType> {\r\n const hookInput = {\r\n rxQuery: this,\r\n // can be mutated by the hooks so we have to deep clone first.\r\n mangoQuery: clone(this.normalizedQuery) as FilledMangoQuery<RxDocType>\r\n };\r\n (hookInput.mangoQuery.selector as any)._deleted = { $eq: false };\r\n if (hookInput.mangoQuery.index) {\r\n hookInput.mangoQuery.index.unshift('_deleted');\r\n }\r\n runPluginHooks('prePrepareQuery', hookInput);\r\n\r\n const value = prepareQuery(\r\n this.collection.schema.jsonSchema,\r\n hookInput.mangoQuery as any\r\n );\r\n\r\n this.getPreparedQuery = () => value;\r\n return value;\r\n }\r\n\r\n /**\r\n * returns true if the document matches the query,\r\n * does not use the 'skip' and 'limit'\r\n */\r\n doesDocumentDataMatch(docData: RxDocType | any): boolean {\r\n // if doc is deleted, it cannot match\r\n if (docData._deleted) {\r\n return false;\r\n }\r\n\r\n return this.queryMatcher(docData);\r\n }\r\n\r\n /**\r\n * deletes all found documents\r\n * @return promise with deleted documents\r\n */\r\n async remove(): Promise<RxQueryResult> {\r\n const docs = await this.exec();\r\n if (Array.isArray(docs)) {\r\n const result = await this.collection.bulkRemove(docs);\r\n if (result.error.length > 0) {\r\n throw rxStorageWriteErrorToRxError(result.error[0]);\r\n } else {\r\n return result.success as any;\r\n }\r\n } else {\r\n return (docs as any).remove();\r\n }\r\n }\r\n incrementalRemove(): Promise<RxQueryResult> {\r\n return runQueryUpdateFunction(\r\n this.asRxQuery,\r\n (doc) => doc.incrementalRemove(),\r\n );\r\n }\r\n\r\n\r\n /**\r\n * helper function to transform RxQueryBase to RxQuery type\r\n */\r\n get asRxQuery(): RxQuery<RxDocType, RxQueryResult> {\r\n return this as any;\r\n }\r\n\r\n /**\r\n * updates all found documents\r\n * @overwritten by plugin (optional)\r\n */\r\n update(_updateObj: any): Promise<RxQueryResult> {\r\n throw pluginMissing('update');\r\n }\r\n\r\n patch(patch: Partial<RxDocType>): Promise<RxQueryResult> {\r\n return runQueryUpdateFunction(\r\n this.asRxQuery,\r\n (doc) => doc.patch(patch),\r\n );\r\n }\r\n incrementalPatch(patch: Partial<RxDocType>): Promise<RxQueryResult> {\r\n return runQueryUpdateFunction(\r\n this.asRxQuery,\r\n (doc) => doc.incrementalPatch(patch),\r\n );\r\n }\r\n modify(mutationFunction: ModifyFunction<RxDocType>): Promise<RxQueryResult> {\r\n return runQueryUpdateFunction(\r\n this.asRxQuery,\r\n (doc) => doc.modify(mutationFunction),\r\n );\r\n }\r\n incrementalModify(mutationFunction: ModifyFunction<RxDocType>): Promise<RxQueryResult> {\r\n return runQueryUpdateFunction(\r\n this.asRxQuery,\r\n (doc) => doc.incrementalModify(mutationFunction),\r\n );\r\n }\r\n\r\n\r\n // we only set some methods of query-builder here\r\n // because the others depend on these ones\r\n where(_queryObj: MangoQuerySelector<RxDocType> | keyof RxDocType | string): RxQuery<RxDocType, RxQueryResult> {\r\n throw pluginMissing('query-builder');\r\n }\r\n sort(_params: string | MangoQuerySortPart<RxDocType>): RxQuery<RxDocType, RxQueryResult> {\r\n throw pluginMissing('query-builder');\r\n }\r\n skip(_amount: number | null): RxQuery<RxDocType, RxQueryResult> {\r\n throw pluginMissing('query-builder');\r\n }\r\n limit(_amount: number | null): RxQuery<RxDocType, RxQueryResult> {\r\n throw pluginMissing('query-builder');\r\n }\r\n}\r\n\r\n\r\nexport function _getDefaultQuery<RxDocType>(): MangoQuery<RxDocType> {\r\n return {\r\n selector: {}\r\n };\r\n}\r\n\r\n/**\r\n * run this query through the QueryCache\r\n */\r\nexport function tunnelQueryCache<RxDocumentType, RxQueryResult>(\r\n rxQuery: RxQueryBase<RxDocumentType, RxQueryResult>\r\n): RxQuery<RxDocumentType, RxQueryResult> {\r\n return rxQuery.collection._queryCache.getByQuery(rxQuery as any);\r\n}\r\n\r\nexport function createRxQuery<RxDocType>(\r\n op: RxQueryOP,\r\n queryObj: MangoQuery<RxDocType>,\r\n collection: RxCollection<RxDocType>,\r\n other?: any\r\n) {\r\n runPluginHooks('preCreateRxQuery', {\r\n op,\r\n queryObj,\r\n collection,\r\n other\r\n });\r\n\r\n let ret = new RxQueryBase<RxDocType, any>(op, queryObj, collection, other);\r\n\r\n // ensure when created with same params, only one is created\r\n ret = tunnelQueryCache(ret);\r\n triggerCacheReplacement(collection);\r\n\r\n return ret;\r\n}\r\n\r\n/**\r\n * Check if the current results-state is in sync with the database\r\n * which means that no write event happened since the last run.\r\n * @return false if not which means it should re-execute\r\n */\r\nfunction _isResultsInSync(rxQuery: RxQueryBase<any, any>): boolean {\r\n const currentLatestEventNumber = rxQuery.asRxQuery.collection._changeEventBuffer.getCounter();\r\n if (rxQuery._latestChangeEvent >= currentLatestEventNumber) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}\r\n\r\n\r\n/**\r\n * wraps __ensureEqual()\r\n * to ensure it does not run in parallel\r\n * @return true if has changed, false if not\r\n *\r\n * @performance\r\n * Avoid async wrapper when awaitBeforeReads is empty (common case).\r\n * This eliminates one unnecessary Promise allocation per query execution.\r\n */\r\nfunction _ensureEqual(rxQuery: RxQueryBase<any, any>): Promise<boolean> {\r\n if (rxQuery.collection.awaitBeforeReads.size > 0) {\r\n return Promise.all(Array.from(rxQuery.collection.awaitBeforeReads).map(fn => fn()))\r\n .then(() => {\r\n rxQuery._ensureEqualQueue = rxQuery._ensureEqualQueue\r\n .then(() => __ensureEqual(rxQuery));\r\n return rxQuery._ensureEqualQueue;\r\n });\r\n }\r\n\r\n rxQuery._ensureEqualQueue = rxQuery._ensureEqualQueue\r\n .then(() => __ensureEqual(rxQuery));\r\n return rxQuery._ensureEqualQueue;\r\n}\r\n\r\n/**\r\n * ensures that the results of this query is equal to the results which a query over the database would give\r\n * @return true if results have changed\r\n */\r\nfunction __ensureEqual<RxDocType>(rxQuery: RxQueryBase<RxDocType, any>): Promise<boolean> {\r\n /**\r\n * @performance\r\n * Use a counter instead of Date.now() since _lastEnsureEqual\r\n * is only used by the cache replacement policy for sorting queries\r\n * by last usage and zero-check, not for time-based comparison.\r\n */\r\n rxQuery._lastEnsureEqual = ++_ensureEqualCount;\r\n\r\n /**\r\n * Optimisation shortcuts\r\n */\r\n if (\r\n // db is closed\r\n rxQuery.collection.database.closed ||\r\n // nothing happened since last run\r\n _isResultsInSync(rxQuery)\r\n ) {\r\n return PROMISE_RESOLVE_FALSE;\r\n }\r\n\r\n let ret = false;\r\n let mustReExec = false; // if this becomes true, a whole execution over the database is made\r\n if (rxQuery._latestChangeEvent === -1) {\r\n // have not executed yet -> must run\r\n mustReExec = true;\r\n }\r\n\r\n /**\r\n * try to use EventReduce to calculate the new results\r\n */\r\n if (!mustReExec) {\r\n const missedChangeEvents = rxQuery.asRxQuery.collection._changeEventBuffer.getFrom(rxQuery._latestChangeEvent + 1);\r\n if (missedChangeEvents === null) {\r\n // changeEventBuffer is of bounds -> we must re-execute over the database\r\n mustReExec = true;\r\n } else {\r\n rxQuery._latestChangeEvent = rxQuery.asRxQuery.collection._changeEventBuffer.getCounter();\r\n const runChangeEvents: RxStorageChangeEvent<RxDocType>[] = rxQuery.asRxQuery.collection\r\n ._changeEventBuffer\r\n .reduceByLastOfDoc(missedChangeEvents);\r\n\r\n if (rxQuery.op === 'count') {\r\n // 'count' query\r\n const previousCount = ensureNotFalsy(rxQuery._result).count;\r\n let newCount = previousCount;\r\n runChangeEvents.forEach(cE => {\r\n const didMatchBefore = cE.previousDocumentData && rxQuery.doesDocumentDataMatch(cE.previousDocumentData);\r\n const doesMatchNow = rxQuery.doesDocumentDataMatch(cE.documentData);\r\n\r\n if (!didMatchBefore && doesMatchNow) {\r\n newCount++;\r\n }\r\n if (didMatchBefore && !doesMatchNow) {\r\n newCount--;\r\n }\r\n });\r\n if (newCount !== previousCount) {\r\n ret = true; // true because results changed\r\n rxQuery._setResultData(newCount as any);\r\n }\r\n } else {\r\n // 'find' or 'findOne' query\r\n const eventReduceResult = calculateNewResults(\r\n rxQuery as any,\r\n runChangeEvents\r\n );\r\n if (eventReduceResult.runFullQueryAgain) {\r\n // could not calculate the new results, execute must be done\r\n mustReExec = true;\r\n } else if (eventReduceResult.changed) {\r\n // we got the new results, we do not have to re-execute, mustReExec stays false\r\n ret = true; // true because results changed\r\n rxQuery._setResultData(eventReduceResult.newResults as any);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // oh no we have to re-execute the whole query over the database\r\n if (mustReExec) {\r\n return rxQuery._execOverDatabase()\r\n .then(result => {\r\n const newResultData = result.result;\r\n\r\n /**\r\n * The RxStorage is defined to always first emit events and then return\r\n * on bulkWrite() calls. So here we have to use the counter AFTER the execOverDatabase()\r\n * has been run, not the one from before.\r\n */\r\n rxQuery._latestChangeEvent = result.counter;\r\n\r\n // A count query needs a different has-changed check.\r\n if (typeof newResultData === 'number') {\r\n if (\r\n !rxQuery._result ||\r\n newResultData !== rxQuery._result.count\r\n ) {\r\n ret = true;\r\n rxQuery._setResultData(newResultData as any);\r\n }\r\n return ret;\r\n }\r\n if (\r\n !rxQuery._result ||\r\n !areRxDocumentArraysEqual(\r\n rxQuery.collection.schema.primaryPath,\r\n newResultData,\r\n rxQuery._result.docsData\r\n )\r\n ) {\r\n ret = true; // true because results changed\r\n rxQuery._setResultData(newResultData as any);\r\n }\r\n return ret;\r\n });\r\n }\r\n return Promise.resolve(ret); // true if results have changed\r\n}\r\n\r\n\r\n/**\r\n * Runs the query over the storage instance\r\n * of the collection.\r\n * Does some optimizations to ensure findById is used\r\n * when specific queries are used.\r\n */\r\nexport async function queryCollection<RxDocType>(\r\n rxQuery: RxQuery<RxDocType> | RxQueryBase<RxDocType, any>\r\n): Promise<{\r\n docs: RxDocumentData<RxDocType>[];\r\n /**\r\n * We need to remember the counter directly here\r\n * because getting if after the returned Promise is resolved,\r\n * can result in a value that no longer matches the result set.\r\n */\r\n counter: number;\r\n}> {\r\n let docs: RxDocumentData<RxDocType>[] = [];\r\n const collection = rxQuery.collection;\r\n\r\n /**\r\n * Optimizations shortcut.\r\n * If query is find-one-document-by-id,\r\n * then we do not have to use the slow query() method\r\n * but instead can use findDocumentsById()\r\n */\r\n if (rxQuery.isFindOneByIdQuery) {\r\n const selector = rxQuery.mangoQuery.selector;\r\n const primaryPath = collection.schema.primaryPath as string;\r\n // isFindOneByIdQuery guarantees the primary key is in the selector\r\n const primarySelectorValue = selector ? (selector as any)[primaryPath] : undefined;\r\n\r\n // Check if there are extra operators on the primary key selector (e.g. $ne alongside $in)\r\n const hasExtraOperators = typeof primarySelectorValue === 'object' &&\r\n primarySelectorValue !== null &&\r\n Object.keys(primarySelectorValue).length > 1;\r\n\r\n // Check if there are selectors OTHER than the primary key\r\n const hasOtherSelectors = selector ? Object.keys(selector).length > 1 : false;\r\n\r\n // Normalize single ID to array and de-duplicate to avoid returning the same document multiple times\r\n const docIdArray = Array.isArray(rxQuery.isFindOneByIdQuery)\r\n ? rxQuery.isFindOneByIdQuery\r\n : [rxQuery.isFindOneByIdQuery];\r\n const docIds = Array.from(new Set(docIdArray));\r\n\r\n // Separate cache hits from storage misses\r\n const cacheMisses: string[] = [];\r\n docIds.forEach(docId => {\r\n const docData = rxQuery.collection._docCache.getLatestDocumentDataIfExists(docId);\r\n if (docData && !docData._deleted) {\r\n docs.push(docData);\r\n } else if (!docData) {\r\n // Only fetch from storage if not in cache\r\n cacheMisses.push(docId);\r\n }\r\n // If found but deleted, skip entirely (no refetch)\r\n });\r\n\r\n // Fetch only cache misses from storage\r\n if (cacheMisses.length > 0) {\r\n const docsFromStorage = await collection.storageInstance.findDocumentsById(cacheMisses, false);\r\n docs = docs.concat(docsFromStorage);\r\n }\r\n\r\n // Apply query matcher if there are extra operators or other selectors\r\n if (hasExtraOperators || hasOtherSelectors) {\r\n docs = docs.filter(doc => rxQuery.queryMatcher(doc));\r\n }\r\n\r\n /**\r\n * The findDocumentsById() fast-path also does not apply `skip`/`limit`/`sort`.\r\n * To keep behavior consistent with storageInstance.query(), we must\r\n * apply them after queryMatcher for both find() and findOne() queries.\r\n */\r\n // Apply sorting for both find and findOne\r\n if (docs.length > 1) {\r\n const preparedQuery = rxQuery.getPreparedQuery();\r\n const sortComparator = getSortComparator(collection.schema.jsonSchema, preparedQuery.query);\r\n docs = docs.sort(sortComparator);\r\n }\r\n\r\n // Apply skip for both find and findOne\r\n const skip = typeof rxQuery.mangoQuery.skip === 'number' && rxQuery.mangoQuery.skip > 0\r\n ? rxQuery.mangoQuery.skip\r\n : 0;\r\n if (skip > 0) {\r\n docs = docs.slice(skip);\r\n }\r\n\r\n // Apply limit for both find and findOne\r\n const limitIsNumber = typeof rxQuery.mangoQuery.limit === 'number' && rxQuery.mangoQuery.limit > 0;\r\n if (limitIsNumber) {\r\n const limit = rxQuery.mangoQuery.limit as number;\r\n docs = docs.slice(0, limit);\r\n }\r\n\r\n } else {\r\n const preparedQuery = rxQuery.getPreparedQuery();\r\n const queryResult = await collection.storageInstance.query(preparedQuery);\r\n docs = queryResult.documents;\r\n }\r\n\r\n return {\r\n docs,\r\n counter: collection._changeEventBuffer.getCounter()\r\n };\r\n\r\n}\r\n\r\n/**\r\n * Returns true if the given query\r\n * selects documents by primary key using $eq or $in.\r\n * Used to optimize performance: these queries use get-by-id\r\n * instead of a full index scan. Additional operators beyond\r\n * $eq/$in are handled via the queryMatcher after fetching.\r\n * Skip, limit, and sort are also applied after fetching.\r\n * Returns false if no such optimization is possible.\r\n * Returns the document id (string) or ids (string[]) otherwise.\r\n */\r\nexport function isFindOneByIdQuery(\r\n primaryPath: string,\r\n query: MangoQuery<any>\r\n): false | string | string[] {\r\n // primary key constraint can coexist with other selectors, skip, limit, and sort\r\n // The optimization will fetch by ID, then apply queryMatcher, sort, skip, and limit\r\n // Use hasOwnProperty to avoid prototype pollution from user-controlled input\r\n if (\r\n query.selector &&\r\n Object.prototype.hasOwnProperty.call(query.selector, primaryPath)\r\n ) {\r\n const value: any = (query.selector as any)[primaryPath];\r\n if (typeof value === 'string') {\r\n return value;\r\n } else if (\r\n typeof value.$eq === 'string'\r\n ) {\r\n return value.$eq;\r\n }\r\n\r\n // same with $in string arrays\r\n if (\r\n Array.isArray(value.$in) &&\r\n // must only contain strings\r\n !(value.$in as any[]).find(r => typeof r !== 'string')\r\n ) {\r\n return value.$in;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n\r\n\r\nexport function isRxQuery(obj: any): boolean {\r\n return obj instanceof RxQueryBase;\r\n}\r\n"],"mappings":";AAAA,SACIA,eAAe,EAEfC,KAAK,QACF,MAAM;AACb,SACIC,QAAQ,EACRC,MAAM,EACNC,GAAG,EACHC,SAAS,EACTC,oBAAoB,EACpBC,WAAW,QACR,gBAAgB;AACvB,SACIC,UAAU,EACVC,aAAa,EACbC,yBAAyB,EACzBC,KAAK,EACLC,qBAAqB,EACrBC,0BAA0B,EAC1BC,cAAc,EACdC,wBAAwB,EACxBC,WAAW,QACR,0BAA0B;AACjC,SACIC,UAAU,EACVC,4BAA4B,QACzB,eAAe;AACtB,SACIC,cAAc,QACX,YAAY;AAkBnB,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SACIC,eAAe,EACfC,iBAAiB,EACjBC,mBAAmB,EACnBC,YAAY,EACZC,sBAAsB,QAEnB,sBAAsB;AAC7B,SAASC,mBAAmB,QAAQ,6BAA6B;AAEjE,IAAIC,WAAW,GAAG,CAAC;AACnB,IAAMC,UAAU,GAAG,SAAAA,CAAA,EAAoB;EACnC,OAAO,EAAED,WAAW;AACxB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,IAAIE,iBAAiB,GAAG,CAAC;AAEzB,WAAaC,WAAW;EASpB;AACJ;AACA;;EAEI;AACJ;AACA;AACA;AACA;AACA;AACA;;EAGI;;EAKA;;EAMA;AACJ;AACA;AACA;;EAII,SAAAA,YACWC,EAAa,EACbC,UAA2C,EAC3CC,UAAmC;EAC1C;EACOC,KAAU,GAAG,CAAC,CAAC,EACxB;IAAA,KAvCKC,EAAE,GAAWP,UAAU,CAAC,CAA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B;;IAEA;IACA,IACIjD,KAAK,CAACwD,OAAO,CAACZ,KAAK,CAAC/B,GAAG,CAAC;IACxB;IACA,CAAE+B,KAAK,CAAC/B,GAAG,CAAWoI,IAAI,CAACC,CAAC,IAAI,OAAOA,CAAC,KAAK,QAAQ,CAAC,EACxD;MACE,OAAOtG,KAAK,CAAC/B,GAAG;IACpB;EACJ;EACA,OAAO,KAAK;AAChB;AAIA,OAAO,SAASsI,SAASA,CAACC,GAAQ,EAAW;EACzC,OAAOA,GAAG,YAAY/K,WAAW;AACrC","ignoreList":[]}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { newRxError } from "./rx-error.js";
|
|
2
|
+
import { ensureNotFalsy, flatClone, getProperty, isMaybeReadonlyArray, REGEX_ALL_DOTS, RX_META_LWT_MINIMUM, sortObject, trimDots } from "./plugins/utils/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Helper function to create a valid RxJsonSchema
|
|
5
|
+
* with a given version.
|
|
6
|
+
*/
|
|
7
|
+
export function getPseudoSchemaForVersion(version, primaryKey) {
|
|
8
|
+
var pseudoSchema = fillWithDefaultSettings({
|
|
9
|
+
version,
|
|
10
|
+
type: 'object',
|
|
11
|
+
primaryKey: primaryKey,
|
|
12
|
+
properties: {
|
|
13
|
+
[primaryKey]: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
maxLength: 100
|
|
16
|
+
},
|
|
17
|
+
value: {
|
|
18
|
+
type: 'string'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
indexes: [[primaryKey]],
|
|
22
|
+
required: [primaryKey]
|
|
23
|
+
});
|
|
24
|
+
return pseudoSchema;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Cache for getSchemaByObjectPath results.
|
|
29
|
+
* Uses a WeakMap keyed by the schema object reference
|
|
30
|
+
* so the cache is automatically cleaned up when schemas are garbage collected.
|
|
31
|
+
*/
|
|
32
|
+
var SCHEMA_PATH_CACHE = new WeakMap();
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Returns the sub-schema for a given path.
|
|
36
|
+
* Results are cached per schema reference and path
|
|
37
|
+
* to avoid redundant string operations and property lookups.
|
|
38
|
+
*/
|
|
39
|
+
export function getSchemaByObjectPath(rxJsonSchema, path) {
|
|
40
|
+
var pathCache = SCHEMA_PATH_CACHE.get(rxJsonSchema);
|
|
41
|
+
var pathStr = path;
|
|
42
|
+
if (pathCache) {
|
|
43
|
+
var cached = pathCache.get(pathStr);
|
|
44
|
+
if (cached) {
|
|
45
|
+
return cached;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
pathCache = new Map();
|
|
49
|
+
SCHEMA_PATH_CACHE.set(rxJsonSchema, pathCache);
|
|
50
|
+
}
|
|
51
|
+
var usePath = pathStr;
|
|
52
|
+
usePath = usePath.replace(REGEX_ALL_DOTS, '.properties.');
|
|
53
|
+
usePath = 'properties.' + usePath;
|
|
54
|
+
usePath = trimDots(usePath);
|
|
55
|
+
var ret = getProperty(rxJsonSchema, usePath);
|
|
56
|
+
pathCache.set(pathStr, ret);
|
|
57
|
+
return ret;
|
|
58
|
+
}
|
|
59
|
+
export function fillPrimaryKey(primaryPath, jsonSchema, documentData) {
|
|
60
|
+
// optimization shortcut.
|
|
61
|
+
if (typeof jsonSchema.primaryKey === 'string') {
|
|
62
|
+
return documentData;
|
|
63
|
+
}
|
|
64
|
+
var newPrimary = getComposedPrimaryKeyOfDocumentData(jsonSchema, documentData);
|
|
65
|
+
var existingPrimary = documentData[primaryPath];
|
|
66
|
+
if (existingPrimary && existingPrimary !== newPrimary) {
|
|
67
|
+
throw newRxError('DOC19', {
|
|
68
|
+
args: {
|
|
69
|
+
documentData,
|
|
70
|
+
existingPrimary,
|
|
71
|
+
newPrimary
|
|
72
|
+
},
|
|
73
|
+
schema: jsonSchema
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
documentData[primaryPath] = newPrimary;
|
|
77
|
+
return documentData;
|
|
78
|
+
}
|
|
79
|
+
export function getPrimaryFieldOfPrimaryKey(primaryKey) {
|
|
80
|
+
if (typeof primaryKey === 'string') {
|
|
81
|
+
return primaryKey;
|
|
82
|
+
} else {
|
|
83
|
+
return primaryKey.key;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export function getLengthOfPrimaryKey(schema) {
|
|
87
|
+
var primaryPath = getPrimaryFieldOfPrimaryKey(schema.primaryKey);
|
|
88
|
+
var schemaPart = getSchemaByObjectPath(schema, primaryPath);
|
|
89
|
+
return ensureNotFalsy(schemaPart.maxLength);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Returns the composed primaryKey of a document by its data.
|
|
94
|
+
*/
|
|
95
|
+
export function getComposedPrimaryKeyOfDocumentData(jsonSchema, documentData) {
|
|
96
|
+
if (typeof jsonSchema.primaryKey === 'string') {
|
|
97
|
+
return documentData[jsonSchema.primaryKey];
|
|
98
|
+
}
|
|
99
|
+
var compositePrimary = jsonSchema.primaryKey;
|
|
100
|
+
return compositePrimary.fields.map(field => {
|
|
101
|
+
var value = getProperty(documentData, field);
|
|
102
|
+
if (typeof value === 'undefined') {
|
|
103
|
+
throw newRxError('DOC18', {
|
|
104
|
+
args: {
|
|
105
|
+
field,
|
|
106
|
+
documentData
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
}).join(compositePrimary.separator);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Normalize the RxJsonSchema.
|
|
116
|
+
* We need this to ensure everything is set up properly
|
|
117
|
+
* and we have the same hash on schemas that represent the same value but
|
|
118
|
+
* have different json.
|
|
119
|
+
*
|
|
120
|
+
* - Orders the schemas attributes by alphabetical order
|
|
121
|
+
* - Adds the primaryKey to all indexes that do not contain the primaryKey
|
|
122
|
+
* - We need this for deterministic sort order on all queries, which is required for event-reduce to work.
|
|
123
|
+
*
|
|
124
|
+
* @return RxJsonSchema - ordered and filled
|
|
125
|
+
*/
|
|
126
|
+
export function normalizeRxJsonSchema(jsonSchema) {
|
|
127
|
+
var normalizedSchema = sortObject(jsonSchema, true);
|
|
128
|
+
return normalizedSchema;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* If the schema does not specify any index,
|
|
133
|
+
* we add this index so we at least can run RxQuery()
|
|
134
|
+
* and only select non-deleted fields.
|
|
135
|
+
*/
|
|
136
|
+
export function getDefaultIndex(primaryPath) {
|
|
137
|
+
return ['_deleted', primaryPath];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* fills the schema-json with default-settings
|
|
142
|
+
* @return cloned schemaObj
|
|
143
|
+
*/
|
|
144
|
+
export function fillWithDefaultSettings(schemaObj) {
|
|
145
|
+
schemaObj = flatClone(schemaObj);
|
|
146
|
+
var primaryPath = getPrimaryFieldOfPrimaryKey(schemaObj.primaryKey);
|
|
147
|
+
schemaObj.properties = flatClone(schemaObj.properties);
|
|
148
|
+
|
|
149
|
+
// additionalProperties is always false
|
|
150
|
+
schemaObj.additionalProperties = false;
|
|
151
|
+
|
|
152
|
+
// fill with key-compression-state ()
|
|
153
|
+
if (!Object.prototype.hasOwnProperty.call(schemaObj, 'keyCompression')) {
|
|
154
|
+
schemaObj.keyCompression = false;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// indexes must be array
|
|
158
|
+
schemaObj.indexes = schemaObj.indexes ? schemaObj.indexes.slice(0) : [];
|
|
159
|
+
|
|
160
|
+
// required must be array
|
|
161
|
+
schemaObj.required = schemaObj.required ? schemaObj.required.slice(0) : [];
|
|
162
|
+
|
|
163
|
+
// encrypted must be array
|
|
164
|
+
schemaObj.encrypted = schemaObj.encrypted ? schemaObj.encrypted.slice(0) : [];
|
|
165
|
+
|
|
166
|
+
// add _rev
|
|
167
|
+
schemaObj.properties._rev = {
|
|
168
|
+
type: 'string',
|
|
169
|
+
minLength: 1
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// add attachments
|
|
173
|
+
schemaObj.properties._attachments = {
|
|
174
|
+
type: 'object'
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
// add deleted flag
|
|
178
|
+
schemaObj.properties._deleted = {
|
|
179
|
+
type: 'boolean'
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// add meta property
|
|
183
|
+
schemaObj.properties._meta = RX_META_SCHEMA;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* meta fields are all required
|
|
187
|
+
*/
|
|
188
|
+
schemaObj.required = schemaObj.required ? schemaObj.required.slice(0) : [];
|
|
189
|
+
schemaObj.required.push('_deleted');
|
|
190
|
+
schemaObj.required.push('_rev');
|
|
191
|
+
schemaObj.required.push('_meta');
|
|
192
|
+
schemaObj.required.push('_attachments');
|
|
193
|
+
|
|
194
|
+
// primaryKey is always required
|
|
195
|
+
schemaObj.required.push(primaryPath);
|
|
196
|
+
schemaObj.required = schemaObj.required.filter(field => !field.includes('.')).filter((elem, pos, arr) => arr.indexOf(elem) === pos); // unique;
|
|
197
|
+
|
|
198
|
+
// version is 0 by default
|
|
199
|
+
schemaObj.version = schemaObj.version || 0;
|
|
200
|
+
var useIndexes = schemaObj.indexes.map(index => {
|
|
201
|
+
var arIndex = isMaybeReadonlyArray(index) ? index.slice(0) : [index];
|
|
202
|
+
/**
|
|
203
|
+
* Append primary key to indexes that do not contain the primaryKey.
|
|
204
|
+
* All indexes must have the primaryKey to ensure a deterministic sort order.
|
|
205
|
+
*/
|
|
206
|
+
if (!arIndex.includes(primaryPath)) {
|
|
207
|
+
arIndex.push(primaryPath);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// add _deleted flag to all indexes so we can query only non-deleted fields
|
|
211
|
+
// in RxDB itself
|
|
212
|
+
if (arIndex[0] !== '_deleted') {
|
|
213
|
+
arIndex.unshift('_deleted');
|
|
214
|
+
}
|
|
215
|
+
return arIndex;
|
|
216
|
+
});
|
|
217
|
+
if (useIndexes.length === 0) {
|
|
218
|
+
useIndexes.push(getDefaultIndex(primaryPath));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// we need this index for the getChangedDocumentsSince() method
|
|
222
|
+
useIndexes.push(['_meta.lwt', primaryPath]);
|
|
223
|
+
|
|
224
|
+
// also add the internalIndexes
|
|
225
|
+
if (schemaObj.internalIndexes) {
|
|
226
|
+
schemaObj.internalIndexes.map(idx => {
|
|
227
|
+
useIndexes.push(idx);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// make indexes unique
|
|
232
|
+
var hasIndex = new Set();
|
|
233
|
+
useIndexes.filter(index => {
|
|
234
|
+
var indexStr = index.join(',');
|
|
235
|
+
if (hasIndex.has(indexStr)) {
|
|
236
|
+
return false;
|
|
237
|
+
} else {
|
|
238
|
+
hasIndex.add(indexStr);
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
schemaObj.indexes = useIndexes;
|
|
243
|
+
return schemaObj;
|
|
244
|
+
}
|
|
245
|
+
export var META_LWT_UNIX_TIME_MAX = 1000000000000000;
|
|
246
|
+
export var RX_META_SCHEMA = {
|
|
247
|
+
type: 'object',
|
|
248
|
+
properties: {
|
|
249
|
+
/**
|
|
250
|
+
* The last-write time.
|
|
251
|
+
* Unix time in milliseconds.
|
|
252
|
+
*/
|
|
253
|
+
lwt: {
|
|
254
|
+
type: 'number',
|
|
255
|
+
/**
|
|
256
|
+
* We use 1 as minimum so that the value is never falsy.
|
|
257
|
+
*/
|
|
258
|
+
minimum: RX_META_LWT_MINIMUM,
|
|
259
|
+
maximum: META_LWT_UNIX_TIME_MAX,
|
|
260
|
+
multipleOf: 0.01
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
/**
|
|
264
|
+
* Additional properties are allowed
|
|
265
|
+
* and can be used by plugins to set various flags.
|
|
266
|
+
*/
|
|
267
|
+
additionalProperties: true,
|
|
268
|
+
required: ['lwt']
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* returns the final-fields of the schema
|
|
273
|
+
* @return field-names of the final-fields
|
|
274
|
+
*/
|
|
275
|
+
export function getFinalFields(jsonSchema) {
|
|
276
|
+
var ret = Object.keys(jsonSchema.properties).filter(key => jsonSchema.properties[key].final);
|
|
277
|
+
|
|
278
|
+
// primary is also final
|
|
279
|
+
var primaryPath = getPrimaryFieldOfPrimaryKey(jsonSchema.primaryKey);
|
|
280
|
+
ret.push(primaryPath);
|
|
281
|
+
|
|
282
|
+
// fields of composite primary are final
|
|
283
|
+
if (typeof jsonSchema.primaryKey !== 'string') {
|
|
284
|
+
jsonSchema.primaryKey.fields.forEach(field => ret.push(field));
|
|
285
|
+
}
|
|
286
|
+
return ret;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* fills all unset fields with default-values if set
|
|
291
|
+
* @hotPath
|
|
292
|
+
*/
|
|
293
|
+
export function fillObjectWithDefaults(rxSchema, obj) {
|
|
294
|
+
var defaultKeys = Object.keys(rxSchema.defaultValues);
|
|
295
|
+
for (var i = 0; i < defaultKeys.length; ++i) {
|
|
296
|
+
var key = defaultKeys[i];
|
|
297
|
+
if (obj[key] === undefined) {
|
|
298
|
+
obj[key] = rxSchema.defaultValues[key];
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return obj;
|
|
302
|
+
}
|
|
303
|
+
export var DEFAULT_CHECKPOINT_SCHEMA = {
|
|
304
|
+
type: 'object',
|
|
305
|
+
properties: {
|
|
306
|
+
id: {
|
|
307
|
+
type: 'string'
|
|
308
|
+
},
|
|
309
|
+
lwt: {
|
|
310
|
+
type: 'number'
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
required: ['id', 'lwt'],
|
|
314
|
+
additionalProperties: false
|
|
315
|
+
};
|
|
316
|
+
//# sourceMappingURL=rx-schema-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rx-schema-helper.js","names":["newRxError","ensureNotFalsy","flatClone","getProperty","isMaybeReadonlyArray","REGEX_ALL_DOTS","RX_META_LWT_MINIMUM","sortObject","trimDots","getPseudoSchemaForVersion","version","primaryKey","pseudoSchema","fillWithDefaultSettings","type","properties","maxLength","value","indexes","required","SCHEMA_PATH_CACHE","WeakMap","getSchemaByObjectPath","rxJsonSchema","path","pathCache","get","pathStr","cached","Map","set","usePath","replace","ret","fillPrimaryKey","primaryPath","jsonSchema","documentData","newPrimary","getComposedPrimaryKeyOfDocumentData","existingPrimary","args","schema","getPrimaryFieldOfPrimaryKey","key","getLengthOfPrimaryKey","schemaPart","compositePrimary","fields","map","field","join","separator","normalizeRxJsonSchema","normalizedSchema","getDefaultIndex","schemaObj","additionalProperties","Object","prototype","hasOwnProperty","call","keyCompression","slice","encrypted","_rev","minLength","_attachments","_deleted","_meta","RX_META_SCHEMA","push","filter","includes","elem","pos","arr","indexOf","useIndexes","index","arIndex","unshift","length","internalIndexes","idx","hasIndex","Set","indexStr","has","add","META_LWT_UNIX_TIME_MAX","lwt","minimum","maximum","multipleOf","getFinalFields","keys","final","forEach","fillObjectWithDefaults","rxSchema","obj","defaultKeys","defaultValues","i","undefined","DEFAULT_CHECKPOINT_SCHEMA","id"],"sources":["../../src/rx-schema-helper.ts"],"sourcesContent":["import { newRxError } from './rx-error.ts';\r\nimport type {\r\n CompositePrimaryKey,\r\n DeepReadonly,\r\n JsonSchema,\r\n PrimaryKey,\r\n RxDocumentData,\r\n RxJsonSchema,\r\n RxStorageDefaultCheckpoint,\r\n StringKeys\r\n} from './types/index.d.ts';\r\nimport {\r\n ensureNotFalsy,\r\n flatClone,\r\n getProperty,\r\n isMaybeReadonlyArray,\r\n REGEX_ALL_DOTS,\r\n RX_META_LWT_MINIMUM,\r\n sortObject,\r\n trimDots\r\n} from './plugins/utils/index.ts';\r\nimport type { RxSchema } from './rx-schema.ts';\r\n\r\n/**\r\n * Helper function to create a valid RxJsonSchema\r\n * with a given version.\r\n */\r\nexport function getPseudoSchemaForVersion<T = any>(\r\n version: number,\r\n primaryKey: StringKeys<T>\r\n): RxJsonSchema<RxDocumentData<T>> {\r\n const pseudoSchema: RxJsonSchema<RxDocumentData<T>> = fillWithDefaultSettings({\r\n version,\r\n type: 'object',\r\n primaryKey: primaryKey as any,\r\n properties: {\r\n [primaryKey]: {\r\n type: 'string',\r\n maxLength: 100\r\n },\r\n value: {\r\n type: 'string'\r\n }\r\n } as any,\r\n indexes: [\r\n [primaryKey]\r\n ],\r\n required: [primaryKey]\r\n });\r\n return pseudoSchema;\r\n}\r\n\r\n/**\r\n * Cache for getSchemaByObjectPath results.\r\n * Uses a WeakMap keyed by the schema object reference\r\n * so the cache is automatically cleaned up when schemas are garbage collected.\r\n */\r\nconst SCHEMA_PATH_CACHE = new WeakMap<object, Map<string, JsonSchema>>();\r\n\r\n/**\r\n * Returns the sub-schema for a given path.\r\n * Results are cached per schema reference and path\r\n * to avoid redundant string operations and property lookups.\r\n */\r\nexport function getSchemaByObjectPath<T = any>(\r\n rxJsonSchema: RxJsonSchema<T>,\r\n path: keyof T | string\r\n): JsonSchema {\r\n let pathCache = SCHEMA_PATH_CACHE.get(rxJsonSchema as any);\r\n const pathStr = path as string;\r\n if (pathCache) {\r\n const cached = pathCache.get(pathStr);\r\n if (cached) {\r\n return cached;\r\n }\r\n } else {\r\n pathCache = new Map();\r\n SCHEMA_PATH_CACHE.set(rxJsonSchema as any, pathCache);\r\n }\r\n\r\n let usePath: string = pathStr;\r\n usePath = usePath.replace(REGEX_ALL_DOTS, '.properties.');\r\n usePath = 'properties.' + usePath;\r\n usePath = trimDots(usePath);\r\n\r\n const ret = getProperty(rxJsonSchema, usePath);\r\n pathCache.set(pathStr, ret);\r\n return ret;\r\n}\r\n\r\nexport function fillPrimaryKey<T>(\r\n primaryPath: keyof T,\r\n jsonSchema: RxJsonSchema<T>,\r\n documentData: RxDocumentData<T>\r\n): RxDocumentData<T> {\r\n // optimization shortcut.\r\n if (typeof jsonSchema.primaryKey === 'string') {\r\n return documentData;\r\n }\r\n\r\n const newPrimary = getComposedPrimaryKeyOfDocumentData<T>(\r\n jsonSchema,\r\n documentData\r\n );\r\n const existingPrimary: string | undefined = documentData[primaryPath] as any;\r\n if (\r\n existingPrimary &&\r\n existingPrimary !== newPrimary\r\n ) {\r\n throw newRxError(\r\n 'DOC19',\r\n {\r\n args: {\r\n documentData,\r\n existingPrimary,\r\n newPrimary,\r\n },\r\n schema: jsonSchema\r\n });\r\n }\r\n\r\n (documentData as any)[primaryPath] = newPrimary;\r\n return documentData;\r\n}\r\n\r\nexport function getPrimaryFieldOfPrimaryKey<RxDocType>(\r\n primaryKey: PrimaryKey<RxDocType>\r\n): StringKeys<RxDocType> {\r\n if (typeof primaryKey === 'string') {\r\n return primaryKey as any;\r\n } else {\r\n return (primaryKey as CompositePrimaryKey<RxDocType>).key;\r\n }\r\n}\r\n\r\nexport function getLengthOfPrimaryKey<RxDocType>(\r\n schema: RxJsonSchema<RxDocumentData<RxDocType>>\r\n): number {\r\n const primaryPath = getPrimaryFieldOfPrimaryKey(schema.primaryKey);\r\n const schemaPart = getSchemaByObjectPath(schema, primaryPath);\r\n return ensureNotFalsy(schemaPart.maxLength);\r\n}\r\n\r\n/**\r\n * Returns the composed primaryKey of a document by its data.\r\n */\r\nexport function getComposedPrimaryKeyOfDocumentData<RxDocType>(\r\n jsonSchema: RxJsonSchema<RxDocType> | RxJsonSchema<RxDocumentData<RxDocType>>,\r\n documentData: Partial<RxDocType>\r\n): string {\r\n if (typeof jsonSchema.primaryKey === 'string') {\r\n return (documentData as any)[jsonSchema.primaryKey];\r\n }\r\n\r\n const compositePrimary: CompositePrimaryKey<RxDocType> = jsonSchema.primaryKey as any;\r\n return compositePrimary.fields.map(field => {\r\n const value = getProperty(documentData as any, field as string);\r\n if (typeof value === 'undefined') {\r\n throw newRxError('DOC18', { args: { field, documentData } });\r\n }\r\n return value;\r\n }).join(compositePrimary.separator);\r\n}\r\n\r\n\r\n/**\r\n * Normalize the RxJsonSchema.\r\n * We need this to ensure everything is set up properly\r\n * and we have the same hash on schemas that represent the same value but\r\n * have different json.\r\n *\r\n * - Orders the schemas attributes by alphabetical order\r\n * - Adds the primaryKey to all indexes that do not contain the primaryKey\r\n * - We need this for deterministic sort order on all queries, which is required for event-reduce to work.\r\n *\r\n * @return RxJsonSchema - ordered and filled\r\n */\r\nexport function normalizeRxJsonSchema<T>(jsonSchema: RxJsonSchema<T>): RxJsonSchema<T> {\r\n const normalizedSchema: RxJsonSchema<T> = sortObject(jsonSchema, true);\r\n return normalizedSchema;\r\n}\r\n\r\n/**\r\n * If the schema does not specify any index,\r\n * we add this index so we at least can run RxQuery()\r\n * and only select non-deleted fields.\r\n */\r\nexport function getDefaultIndex(primaryPath: string) {\r\n return ['_deleted', primaryPath];\r\n}\r\n\r\n/**\r\n * fills the schema-json with default-settings\r\n * @return cloned schemaObj\r\n */\r\nexport function fillWithDefaultSettings<T = any>(\r\n schemaObj: RxJsonSchema<T>\r\n): RxJsonSchema<RxDocumentData<T>> {\r\n schemaObj = flatClone(schemaObj);\r\n const primaryPath: string = getPrimaryFieldOfPrimaryKey(schemaObj.primaryKey);\r\n schemaObj.properties = flatClone(schemaObj.properties);\r\n\r\n // additionalProperties is always false\r\n schemaObj.additionalProperties = false;\r\n\r\n // fill with key-compression-state ()\r\n if (!Object.prototype.hasOwnProperty.call(schemaObj, 'keyCompression')) {\r\n schemaObj.keyCompression = false;\r\n }\r\n\r\n // indexes must be array\r\n schemaObj.indexes = schemaObj.indexes ? schemaObj.indexes.slice(0) : [];\r\n\r\n // required must be array\r\n schemaObj.required = schemaObj.required ? schemaObj.required.slice(0) : [];\r\n\r\n // encrypted must be array\r\n schemaObj.encrypted = schemaObj.encrypted ? schemaObj.encrypted.slice(0) : [];\r\n\r\n // add _rev\r\n (schemaObj.properties as any)._rev = {\r\n type: 'string',\r\n minLength: 1\r\n };\r\n\r\n // add attachments\r\n (schemaObj.properties as any)._attachments = {\r\n type: 'object'\r\n };\r\n\r\n // add deleted flag\r\n (schemaObj.properties as any)._deleted = {\r\n type: 'boolean'\r\n };\r\n\r\n // add meta property\r\n (schemaObj.properties as any)._meta = RX_META_SCHEMA;\r\n\r\n /**\r\n * meta fields are all required\r\n */\r\n schemaObj.required = schemaObj.required ? schemaObj.required.slice(0) : [];\r\n (schemaObj.required as string[]).push('_deleted');\r\n (schemaObj.required as string[]).push('_rev');\r\n (schemaObj.required as string[]).push('_meta');\r\n (schemaObj.required as string[]).push('_attachments');\r\n\r\n // primaryKey is always required\r\n (schemaObj.required as any).push(primaryPath);\r\n\r\n schemaObj.required = schemaObj.required\r\n .filter((field: string) => !field.includes('.'))\r\n .filter((elem: any, pos: any, arr: any) => arr.indexOf(elem) === pos); // unique;\r\n\r\n\r\n // version is 0 by default\r\n schemaObj.version = schemaObj.version || 0;\r\n\r\n const useIndexes: string[][] = schemaObj.indexes.map(index => {\r\n const arIndex = isMaybeReadonlyArray(index) ? index.slice(0) : [index];\r\n /**\r\n * Append primary key to indexes that do not contain the primaryKey.\r\n * All indexes must have the primaryKey to ensure a deterministic sort order.\r\n */\r\n if (!arIndex.includes(primaryPath)) {\r\n arIndex.push(primaryPath);\r\n }\r\n\r\n // add _deleted flag to all indexes so we can query only non-deleted fields\r\n // in RxDB itself\r\n if (arIndex[0] !== '_deleted') {\r\n arIndex.unshift('_deleted');\r\n }\r\n\r\n return arIndex;\r\n });\r\n\r\n if (useIndexes.length === 0) {\r\n useIndexes.push(getDefaultIndex(primaryPath));\r\n }\r\n\r\n // we need this index for the getChangedDocumentsSince() method\r\n useIndexes.push(['_meta.lwt', primaryPath]);\r\n\r\n // also add the internalIndexes\r\n if (schemaObj.internalIndexes) {\r\n schemaObj.internalIndexes.map(idx => {\r\n useIndexes.push(idx);\r\n });\r\n }\r\n\r\n // make indexes unique\r\n const hasIndex = new Set<string>();\r\n useIndexes.filter(index => {\r\n const indexStr = index.join(',');\r\n if (hasIndex.has(indexStr)) {\r\n return false;\r\n } else {\r\n hasIndex.add(indexStr);\r\n return true;\r\n }\r\n });\r\n\r\n schemaObj.indexes = useIndexes;\r\n\r\n return schemaObj as any;\r\n}\r\n\r\nexport const META_LWT_UNIX_TIME_MAX = 1000000000000000;\r\nexport const RX_META_SCHEMA: JsonSchema = {\r\n type: 'object',\r\n properties: {\r\n /**\r\n * The last-write time.\r\n * Unix time in milliseconds.\r\n */\r\n lwt: {\r\n type: 'number',\r\n /**\r\n * We use 1 as minimum so that the value is never falsy.\r\n */\r\n minimum: RX_META_LWT_MINIMUM,\r\n maximum: META_LWT_UNIX_TIME_MAX,\r\n multipleOf: 0.01\r\n }\r\n },\r\n /**\r\n * Additional properties are allowed\r\n * and can be used by plugins to set various flags.\r\n */\r\n additionalProperties: true as any,\r\n required: [\r\n 'lwt'\r\n ]\r\n};\r\n\r\n\r\n/**\r\n * returns the final-fields of the schema\r\n * @return field-names of the final-fields\r\n */\r\nexport function getFinalFields<T = any>(\r\n jsonSchema: RxJsonSchema<T>\r\n): string[] {\r\n const ret = Object.keys(jsonSchema.properties)\r\n .filter(key => (jsonSchema as any).properties[key].final);\r\n\r\n // primary is also final\r\n const primaryPath = getPrimaryFieldOfPrimaryKey(jsonSchema.primaryKey);\r\n ret.push(primaryPath);\r\n\r\n // fields of composite primary are final\r\n if (typeof jsonSchema.primaryKey !== 'string') {\r\n (jsonSchema.primaryKey as CompositePrimaryKey<T>).fields\r\n .forEach(field => ret.push(field as string));\r\n }\r\n\r\n return ret;\r\n}\r\n\r\n/**\r\n * fills all unset fields with default-values if set\r\n * @hotPath\r\n */\r\nexport function fillObjectWithDefaults(rxSchema: RxSchema<any>, obj: any): any {\r\n const defaultKeys = Object.keys(rxSchema.defaultValues);\r\n for (let i = 0; i < defaultKeys.length; ++i) {\r\n const key = defaultKeys[i];\r\n if (obj[key] === undefined) {\r\n obj[key] = rxSchema.defaultValues[key];\r\n }\r\n }\r\n return obj;\r\n}\r\n\r\nexport const DEFAULT_CHECKPOINT_SCHEMA: DeepReadonly<JsonSchema<RxStorageDefaultCheckpoint>> = {\r\n type: 'object',\r\n properties: {\r\n id: {\r\n type: 'string'\r\n },\r\n lwt: {\r\n type: 'number'\r\n }\r\n },\r\n required: [\r\n 'id',\r\n 'lwt'\r\n ],\r\n additionalProperties: false\r\n} as const;\r\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,eAAe;AAW1C,SACIC,cAAc,EACdC,SAAS,EACTC,WAAW,EACXC,oBAAoB,EACpBC,cAAc,EACdC,mBAAmB,EACnBC,UAAU,EACVC,QAAQ,QACL,0BAA0B;AAGjC;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CACrCC,OAAe,EACfC,UAAyB,EACM;EAC/B,IAAMC,YAA6C,GAAGC,uBAAuB,CAAC;IAC1EH,OAAO;IACPI,IAAI,EAAE,QAAQ;IACdH,UAAU,EAAEA,UAAiB;IAC7BI,UAAU,EAAE;MACR,CAACJ,UAAU,GAAG;QACVG,IAAI,EAAE,QAAQ;QACdE,SAAS,EAAE;MACf,CAAC;MACDC,KAAK,EAAE;QACHH,IAAI,EAAE;MACV;IACJ,CAAQ;IACRI,OAAO,EAAE,CACL,CAACP,UAAU,CAAC,CACf;IACDQ,QAAQ,EAAE,CAACR,UAAU;EACzB,CAAC,CAAC;EACF,OAAOC,YAAY;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAMQ,iBAAiB,GAAG,IAAIC,OAAO,CAAkC,CAAC;;AAExE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CACjCC,YAA6B,EAC7BC,IAAsB,EACZ;EACV,IAAIC,SAAS,GAAGL,iBAAiB,CAACM,GAAG,CAACH,YAAmB,CAAC;EAC1D,IAAMI,OAAO,GAAGH,IAAc;EAC9B,IAAIC,SAAS,EAAE;IACX,IAAMG,MAAM,GAAGH,SAAS,CAACC,GAAG,CAACC,OAAO,CAAC;IACrC,IAAIC,MAAM,EAAE;MACR,OAAOA,MAAM;IACjB;EACJ,C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