@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":["_rxjs","require","_operators","_index","_rxError","_hooks","_eventReduce","_queryCache","_rxQueryHelper","_rxQuerySingleResult","_queryCount","newQueryID","_ensureEqualCount","RxQueryBase","exports","op","mangoQuery","collection","other","id","_execOverDatabaseCount","_creationTime","Date","now","_lastEnsureEqual","uncached","refCount$","BehaviorSubject","_result","_latestChangeEvent","_ensureEqualQueue","PROMISE_RESOLVE_FALSE","_getDefaultQuery","isFindOneByIdQuery","schema","primaryPath","_proto","prototype","_setResultData","newResultData","newRxError","database","name","RxQuerySingleResult","Map","Array","from","values","newQueryResult","length","_execOverDatabase","rerunCount","result","counterBefore","_changeEventBuffer","getCounter","ids","ensureNotFalsy","selector","$in","docsData","mustBeQueried","i","docData","_docCache","getLatestDocumentDataIfExists","_deleted","push","docs","storageInstance","findDocumentsById","counter","preparedQuery","getPreparedQuery","countResult","count","mode","allowSlowCount","queryObj","queryResult","queryCollection","promiseWait","exec","throwIfMissing","query","_ensureEqual","useResult","getValue","toString","stringObj","sortObject","normalizedQuery","value","JSON","stringify","hookInput","rxQuery","clone","$eq","index","unshift","runPluginHooks","prepareQuery","jsonSchema","doesDocumentDataMatch","queryMatcher","remove","isArray","bulkRemove","error","rxStorageWriteErrorToRxError","success","incrementalRemove","runQueryUpdateFunction","asRxQuery","doc","update","_updateObj","pluginMissing","patch","incrementalPatch","modify","mutationFunction","incrementalModify","where","_queryObj","sort","_params","skip","_amount","limit","_createClass2","default","key","get","_$","results$","eventBulks$","pipe","filter","bulk","isLocal","startWith","mergeMap","map","shareReplay","RXJS_SHARE_REPLAY_DEFAULTS","distinctUntilChanged","prev","curr","time","merge","reactivity","getReactivityFactory","fromObservable","$","undefined","overwriteGetterForCaching","normalizeMangoQuery","getQueryMatcher","tunnelQueryCache","getByQuery","createRxQuery","ret","triggerCacheReplacement","_isResultsInSync","currentLatestEventNumber","awaitBeforeReads","size","Promise","all","fn","then","__ensureEqual","closed","mustReExec","missedChangeEvents","getFrom","runChangeEvents","reduceByLastOfDoc","previousCount","newCount","forEach","cE","didMatchBefore","previousDocumentData","doesMatchNow","documentData","eventReduceResult","calculateNewResults","runFullQueryAgain","changed","newResults","areRxDocumentArraysEqual","resolve","primarySelectorValue","hasExtraOperators","Object","keys","hasOtherSelectors","docIdArray","docIds","Set","cacheMisses","docId","docsFromStorage","concat","sortComparator","getSortComparator","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,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAQA,IAAAE,MAAA,GAAAF,OAAA;AAWA,IAAAG,QAAA,GAAAH,OAAA;AAIA,IAAAI,MAAA,GAAAJ,OAAA;AAoBA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AAQA,IAAAQ,oBAAA,GAAAR,OAAA;AAEA,IAAIS,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;AAAC,IAEbC,WAAW,GAAAC,OAAA,CAAAD,WAAA;EASpB;AACJ;AACA;;EAEI;AACJ;AACA;AACA;AACA;AACA;AACA;;EAGI;;EAKA;;EAMA;AACJ;AACA;AACA;;EAII,SAAAA,YACWE,EAAa,EACbC,UAA2C,EAC3CC,UAAmC;EAC1C;EACOC,KAAU,GAAG,CAAC,CAAC,EACxB;IAAA,KAvCKC,EAAE,GAAWR,UAAU,CAAC,CAAC;IAAA,KAKzBS,sBAAsB,GAAW,CAAC;IAAA,KAQlCC,aAAa,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;IAAA,KAG1BC,gBAAgB,GAAG,CAAC;IAAA,KAEpBC,QAAQ,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MAC3B,OAAOA,KAAK;IAChB,CAAC,MAAM,IACH,OAAOA,KAAK,CAACM,GAAG,KAAK,QAAQ,EAC/B;MACE,OAAON,KAAK,CAACM,GAAG;IACpB;;IAEA;IACA,IACIrD,KAAK,CAAC8D,OAAO,CAACf,KAAK,CAACjC,GAAG,CAAC;IACxB;IACA,CAAEiC,KAAK,CAACjC,GAAG,CAAW2J,IAAI,CAACC,CAAC,IAAI,OAAOA,CAAC,KAAK,QAAQ,CAAC,EACxD;MACE,OAAO3H,KAAK,CAACjC,GAAG;IACpB;EACJ;EACA,OAAO,KAAK;AAChB;AAIO,SAAS6J,SAASA,CAACC,GAAQ,EAAW;EACzC,OAAOA,GAAG,YAAY5M,WAAW;AACrC","ignoreList":[]}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RX_META_SCHEMA = exports.META_LWT_UNIX_TIME_MAX = exports.DEFAULT_CHECKPOINT_SCHEMA = void 0;
|
|
7
|
+
exports.fillObjectWithDefaults = fillObjectWithDefaults;
|
|
8
|
+
exports.fillPrimaryKey = fillPrimaryKey;
|
|
9
|
+
exports.fillWithDefaultSettings = fillWithDefaultSettings;
|
|
10
|
+
exports.getComposedPrimaryKeyOfDocumentData = getComposedPrimaryKeyOfDocumentData;
|
|
11
|
+
exports.getDefaultIndex = getDefaultIndex;
|
|
12
|
+
exports.getFinalFields = getFinalFields;
|
|
13
|
+
exports.getLengthOfPrimaryKey = getLengthOfPrimaryKey;
|
|
14
|
+
exports.getPrimaryFieldOfPrimaryKey = getPrimaryFieldOfPrimaryKey;
|
|
15
|
+
exports.getPseudoSchemaForVersion = getPseudoSchemaForVersion;
|
|
16
|
+
exports.getSchemaByObjectPath = getSchemaByObjectPath;
|
|
17
|
+
exports.normalizeRxJsonSchema = normalizeRxJsonSchema;
|
|
18
|
+
var _rxError = require("./rx-error.js");
|
|
19
|
+
var _index = require("./plugins/utils/index.js");
|
|
20
|
+
/**
|
|
21
|
+
* Helper function to create a valid RxJsonSchema
|
|
22
|
+
* with a given version.
|
|
23
|
+
*/
|
|
24
|
+
function getPseudoSchemaForVersion(version, primaryKey) {
|
|
25
|
+
var pseudoSchema = fillWithDefaultSettings({
|
|
26
|
+
version,
|
|
27
|
+
type: 'object',
|
|
28
|
+
primaryKey: primaryKey,
|
|
29
|
+
properties: {
|
|
30
|
+
[primaryKey]: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
maxLength: 100
|
|
33
|
+
},
|
|
34
|
+
value: {
|
|
35
|
+
type: 'string'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
indexes: [[primaryKey]],
|
|
39
|
+
required: [primaryKey]
|
|
40
|
+
});
|
|
41
|
+
return pseudoSchema;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Cache for getSchemaByObjectPath results.
|
|
46
|
+
* Uses a WeakMap keyed by the schema object reference
|
|
47
|
+
* so the cache is automatically cleaned up when schemas are garbage collected.
|
|
48
|
+
*/
|
|
49
|
+
var SCHEMA_PATH_CACHE = new WeakMap();
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Returns the sub-schema for a given path.
|
|
53
|
+
* Results are cached per schema reference and path
|
|
54
|
+
* to avoid redundant string operations and property lookups.
|
|
55
|
+
*/
|
|
56
|
+
function getSchemaByObjectPath(rxJsonSchema, path) {
|
|
57
|
+
var pathCache = SCHEMA_PATH_CACHE.get(rxJsonSchema);
|
|
58
|
+
var pathStr = path;
|
|
59
|
+
if (pathCache) {
|
|
60
|
+
var cached = pathCache.get(pathStr);
|
|
61
|
+
if (cached) {
|
|
62
|
+
return cached;
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
pathCache = new Map();
|
|
66
|
+
SCHEMA_PATH_CACHE.set(rxJsonSchema, pathCache);
|
|
67
|
+
}
|
|
68
|
+
var usePath = pathStr;
|
|
69
|
+
usePath = usePath.replace(_index.REGEX_ALL_DOTS, '.properties.');
|
|
70
|
+
usePath = 'properties.' + usePath;
|
|
71
|
+
usePath = (0, _index.trimDots)(usePath);
|
|
72
|
+
var ret = (0, _index.getProperty)(rxJsonSchema, usePath);
|
|
73
|
+
pathCache.set(pathStr, ret);
|
|
74
|
+
return ret;
|
|
75
|
+
}
|
|
76
|
+
function fillPrimaryKey(primaryPath, jsonSchema, documentData) {
|
|
77
|
+
// optimization shortcut.
|
|
78
|
+
if (typeof jsonSchema.primaryKey === 'string') {
|
|
79
|
+
return documentData;
|
|
80
|
+
}
|
|
81
|
+
var newPrimary = getComposedPrimaryKeyOfDocumentData(jsonSchema, documentData);
|
|
82
|
+
var existingPrimary = documentData[primaryPath];
|
|
83
|
+
if (existingPrimary && existingPrimary !== newPrimary) {
|
|
84
|
+
throw (0, _rxError.newRxError)('DOC19', {
|
|
85
|
+
args: {
|
|
86
|
+
documentData,
|
|
87
|
+
existingPrimary,
|
|
88
|
+
newPrimary
|
|
89
|
+
},
|
|
90
|
+
schema: jsonSchema
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
documentData[primaryPath] = newPrimary;
|
|
94
|
+
return documentData;
|
|
95
|
+
}
|
|
96
|
+
function getPrimaryFieldOfPrimaryKey(primaryKey) {
|
|
97
|
+
if (typeof primaryKey === 'string') {
|
|
98
|
+
return primaryKey;
|
|
99
|
+
} else {
|
|
100
|
+
return primaryKey.key;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function getLengthOfPrimaryKey(schema) {
|
|
104
|
+
var primaryPath = getPrimaryFieldOfPrimaryKey(schema.primaryKey);
|
|
105
|
+
var schemaPart = getSchemaByObjectPath(schema, primaryPath);
|
|
106
|
+
return (0, _index.ensureNotFalsy)(schemaPart.maxLength);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Returns the composed primaryKey of a document by its data.
|
|
111
|
+
*/
|
|
112
|
+
function getComposedPrimaryKeyOfDocumentData(jsonSchema, documentData) {
|
|
113
|
+
if (typeof jsonSchema.primaryKey === 'string') {
|
|
114
|
+
return documentData[jsonSchema.primaryKey];
|
|
115
|
+
}
|
|
116
|
+
var compositePrimary = jsonSchema.primaryKey;
|
|
117
|
+
return compositePrimary.fields.map(field => {
|
|
118
|
+
var value = (0, _index.getProperty)(documentData, field);
|
|
119
|
+
if (typeof value === 'undefined') {
|
|
120
|
+
throw (0, _rxError.newRxError)('DOC18', {
|
|
121
|
+
args: {
|
|
122
|
+
field,
|
|
123
|
+
documentData
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return value;
|
|
128
|
+
}).join(compositePrimary.separator);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Normalize the RxJsonSchema.
|
|
133
|
+
* We need this to ensure everything is set up properly
|
|
134
|
+
* and we have the same hash on schemas that represent the same value but
|
|
135
|
+
* have different json.
|
|
136
|
+
*
|
|
137
|
+
* - Orders the schemas attributes by alphabetical order
|
|
138
|
+
* - Adds the primaryKey to all indexes that do not contain the primaryKey
|
|
139
|
+
* - We need this for deterministic sort order on all queries, which is required for event-reduce to work.
|
|
140
|
+
*
|
|
141
|
+
* @return RxJsonSchema - ordered and filled
|
|
142
|
+
*/
|
|
143
|
+
function normalizeRxJsonSchema(jsonSchema) {
|
|
144
|
+
var normalizedSchema = (0, _index.sortObject)(jsonSchema, true);
|
|
145
|
+
return normalizedSchema;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* If the schema does not specify any index,
|
|
150
|
+
* we add this index so we at least can run RxQuery()
|
|
151
|
+
* and only select non-deleted fields.
|
|
152
|
+
*/
|
|
153
|
+
function getDefaultIndex(primaryPath) {
|
|
154
|
+
return ['_deleted', primaryPath];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* fills the schema-json with default-settings
|
|
159
|
+
* @return cloned schemaObj
|
|
160
|
+
*/
|
|
161
|
+
function fillWithDefaultSettings(schemaObj) {
|
|
162
|
+
schemaObj = (0, _index.flatClone)(schemaObj);
|
|
163
|
+
var primaryPath = getPrimaryFieldOfPrimaryKey(schemaObj.primaryKey);
|
|
164
|
+
schemaObj.properties = (0, _index.flatClone)(schemaObj.properties);
|
|
165
|
+
|
|
166
|
+
// additionalProperties is always false
|
|
167
|
+
schemaObj.additionalProperties = false;
|
|
168
|
+
|
|
169
|
+
// fill with key-compression-state ()
|
|
170
|
+
if (!Object.prototype.hasOwnProperty.call(schemaObj, 'keyCompression')) {
|
|
171
|
+
schemaObj.keyCompression = false;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// indexes must be array
|
|
175
|
+
schemaObj.indexes = schemaObj.indexes ? schemaObj.indexes.slice(0) : [];
|
|
176
|
+
|
|
177
|
+
// required must be array
|
|
178
|
+
schemaObj.required = schemaObj.required ? schemaObj.required.slice(0) : [];
|
|
179
|
+
|
|
180
|
+
// encrypted must be array
|
|
181
|
+
schemaObj.encrypted = schemaObj.encrypted ? schemaObj.encrypted.slice(0) : [];
|
|
182
|
+
|
|
183
|
+
// add _rev
|
|
184
|
+
schemaObj.properties._rev = {
|
|
185
|
+
type: 'string',
|
|
186
|
+
minLength: 1
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// add attachments
|
|
190
|
+
schemaObj.properties._attachments = {
|
|
191
|
+
type: 'object'
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// add deleted flag
|
|
195
|
+
schemaObj.properties._deleted = {
|
|
196
|
+
type: 'boolean'
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
// add meta property
|
|
200
|
+
schemaObj.properties._meta = RX_META_SCHEMA;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* meta fields are all required
|
|
204
|
+
*/
|
|
205
|
+
schemaObj.required = schemaObj.required ? schemaObj.required.slice(0) : [];
|
|
206
|
+
schemaObj.required.push('_deleted');
|
|
207
|
+
schemaObj.required.push('_rev');
|
|
208
|
+
schemaObj.required.push('_meta');
|
|
209
|
+
schemaObj.required.push('_attachments');
|
|
210
|
+
|
|
211
|
+
// primaryKey is always required
|
|
212
|
+
schemaObj.required.push(primaryPath);
|
|
213
|
+
schemaObj.required = schemaObj.required.filter(field => !field.includes('.')).filter((elem, pos, arr) => arr.indexOf(elem) === pos); // unique;
|
|
214
|
+
|
|
215
|
+
// version is 0 by default
|
|
216
|
+
schemaObj.version = schemaObj.version || 0;
|
|
217
|
+
var useIndexes = schemaObj.indexes.map(index => {
|
|
218
|
+
var arIndex = (0, _index.isMaybeReadonlyArray)(index) ? index.slice(0) : [index];
|
|
219
|
+
/**
|
|
220
|
+
* Append primary key to indexes that do not contain the primaryKey.
|
|
221
|
+
* All indexes must have the primaryKey to ensure a deterministic sort order.
|
|
222
|
+
*/
|
|
223
|
+
if (!arIndex.includes(primaryPath)) {
|
|
224
|
+
arIndex.push(primaryPath);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// add _deleted flag to all indexes so we can query only non-deleted fields
|
|
228
|
+
// in RxDB itself
|
|
229
|
+
if (arIndex[0] !== '_deleted') {
|
|
230
|
+
arIndex.unshift('_deleted');
|
|
231
|
+
}
|
|
232
|
+
return arIndex;
|
|
233
|
+
});
|
|
234
|
+
if (useIndexes.length === 0) {
|
|
235
|
+
useIndexes.push(getDefaultIndex(primaryPath));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// we need this index for the getChangedDocumentsSince() method
|
|
239
|
+
useIndexes.push(['_meta.lwt', primaryPath]);
|
|
240
|
+
|
|
241
|
+
// also add the internalIndexes
|
|
242
|
+
if (schemaObj.internalIndexes) {
|
|
243
|
+
schemaObj.internalIndexes.map(idx => {
|
|
244
|
+
useIndexes.push(idx);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// make indexes unique
|
|
249
|
+
var hasIndex = new Set();
|
|
250
|
+
useIndexes.filter(index => {
|
|
251
|
+
var indexStr = index.join(',');
|
|
252
|
+
if (hasIndex.has(indexStr)) {
|
|
253
|
+
return false;
|
|
254
|
+
} else {
|
|
255
|
+
hasIndex.add(indexStr);
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
schemaObj.indexes = useIndexes;
|
|
260
|
+
return schemaObj;
|
|
261
|
+
}
|
|
262
|
+
var META_LWT_UNIX_TIME_MAX = exports.META_LWT_UNIX_TIME_MAX = 1000000000000000;
|
|
263
|
+
var RX_META_SCHEMA = exports.RX_META_SCHEMA = {
|
|
264
|
+
type: 'object',
|
|
265
|
+
properties: {
|
|
266
|
+
/**
|
|
267
|
+
* The last-write time.
|
|
268
|
+
* Unix time in milliseconds.
|
|
269
|
+
*/
|
|
270
|
+
lwt: {
|
|
271
|
+
type: 'number',
|
|
272
|
+
/**
|
|
273
|
+
* We use 1 as minimum so that the value is never falsy.
|
|
274
|
+
*/
|
|
275
|
+
minimum: _index.RX_META_LWT_MINIMUM,
|
|
276
|
+
maximum: META_LWT_UNIX_TIME_MAX,
|
|
277
|
+
multipleOf: 0.01
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
/**
|
|
281
|
+
* Additional properties are allowed
|
|
282
|
+
* and can be used by plugins to set various flags.
|
|
283
|
+
*/
|
|
284
|
+
additionalProperties: true,
|
|
285
|
+
required: ['lwt']
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* returns the final-fields of the schema
|
|
290
|
+
* @return field-names of the final-fields
|
|
291
|
+
*/
|
|
292
|
+
function getFinalFields(jsonSchema) {
|
|
293
|
+
var ret = Object.keys(jsonSchema.properties).filter(key => jsonSchema.properties[key].final);
|
|
294
|
+
|
|
295
|
+
// primary is also final
|
|
296
|
+
var primaryPath = getPrimaryFieldOfPrimaryKey(jsonSchema.primaryKey);
|
|
297
|
+
ret.push(primaryPath);
|
|
298
|
+
|
|
299
|
+
// fields of composite primary are final
|
|
300
|
+
if (typeof jsonSchema.primaryKey !== 'string') {
|
|
301
|
+
jsonSchema.primaryKey.fields.forEach(field => ret.push(field));
|
|
302
|
+
}
|
|
303
|
+
return ret;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* fills all unset fields with default-values if set
|
|
308
|
+
* @hotPath
|
|
309
|
+
*/
|
|
310
|
+
function fillObjectWithDefaults(rxSchema, obj) {
|
|
311
|
+
var defaultKeys = Object.keys(rxSchema.defaultValues);
|
|
312
|
+
for (var i = 0; i < defaultKeys.length; ++i) {
|
|
313
|
+
var key = defaultKeys[i];
|
|
314
|
+
if (obj[key] === undefined) {
|
|
315
|
+
obj[key] = rxSchema.defaultValues[key];
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return obj;
|
|
319
|
+
}
|
|
320
|
+
var DEFAULT_CHECKPOINT_SCHEMA = exports.DEFAULT_CHECKPOINT_SCHEMA = {
|
|
321
|
+
type: 'object',
|
|
322
|
+
properties: {
|
|
323
|
+
id: {
|
|
324
|
+
type: 'string'
|
|
325
|
+
},
|
|
326
|
+
lwt: {
|
|
327
|
+
type: 'number'
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
required: ['id', 'lwt'],
|
|
331
|
+
additionalProperties: false
|
|
332
|
+
};
|
|
333
|
+
//# sourceMappingURL=rx-schema-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rx-schema-helper.js","names":["_rxError","require","_index","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","REGEX_ALL_DOTS","trimDots","ret","getProperty","fillPrimaryKey","primaryPath","jsonSchema","documentData","newPrimary","getComposedPrimaryKeyOfDocumentData","existingPrimary","newRxError","args","schema","getPrimaryFieldOfPrimaryKey","key","getLengthOfPrimaryKey","schemaPart","ensureNotFalsy","compositePrimary","fields","map","field","join","separator","normalizeRxJsonSchema","normalizedSchema","sortObject","getDefaultIndex","schemaObj","flatClone","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","isMaybeReadonlyArray","unshift","length","internalIndexes","idx","hasIndex","Set","indexStr","has","add","META_LWT_UNIX_TIME_MAX","exports","lwt","minimum","RX_META_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,IAAAA,QAAA,GAAAC,OAAA;AAWA,IAAAC,MAAA,GAAAD,OAAA;AAYA;AACA;AACA;AACA;AACO,SAASE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