@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-document.js","names":["distinctUntilChanged","filter","map","shareReplay","startWith","clone","trimDots","pluginMissing","flatClone","PROMISE_RESOLVE_NULL","RXJS_SHARE_REPLAY_DEFAULTS","getProperty","getFromMapOrCreate","ensureNotFalsy","newRxError","runPluginHooks","getDocumentDataOfRxChangeEvent","overwritable","getSchemaByObjectPath","getWrittenDocumentsFromBulkWriteResponse","throwIfIsStorageWriteError","modifierFromPublicToInternal","basePrototype","primaryPath","_this","isInstanceOfRxDocument","undefined","collection","schema","primary","_data","revision","_rev","deleted$","$","pipe","d","_deleted","deleted$$","reactivity","database","getReactivityFactory","fromObservable","getLatest","deleted","latestDocData","_docCache","getLatestDocumentData","getCachedRxDocument","id","eventBulks$","bulk","isLocal","events","find","ev","documentId","event","changeEvent","prev","curr","docData","$$","get$","path","isDevMode","includes","finalFields","schemaObj","jsonSchema","data","get$$","obs","get","populate","value","ref","refCollection","collections","type","findByIds","exec","then","res","valuesIterator","values","Array","from","findOne","objPath","getDocumentProperty","toJSON","withMetaFields","_attachments","_meta","deepFreezeWhenDevMode","toMutableJSON","update","_updateObj","incrementalUpdate","updateCRDT","putAttachment","putAttachmentBase64","getAttachment","allAttachments","allAttachments$","modify","mutationFunction","_context","oldData","newData","_saveData","incrementalModify","incrementalWriteQueue","addWrite","result","patch","Object","entries","forEach","k","v","incrementalPatch","document","beforeDocumentUpdateWrite","writeRows","previous","writeResult","storageInstance","bulkWrite","isError","error","_runHooks","remove","Promise","reject","removeResult","bulkRemove","length","success","incrementalRemove","newDoc","close","createRxDocumentConstructor","proto","constructor","RxDocumentConstructor","_propertyCache","prototype","createWithConstructor","jsonData","doc","isRxDocument","obj","assign","validateChange","Map","valueObj","isArray","proxy","Proxy","target","property","lastChar","charAt","endsWith","key","slice","plainValue"],"sources":["../../src/rx-document.ts"],"sourcesContent":["import {\r\n Observable\r\n} from 'rxjs';\r\nimport {\r\n distinctUntilChanged,\r\n filter,\r\n map,\r\n shareReplay,\r\n startWith\r\n} from 'rxjs/operators';\r\nimport {\r\n clone,\r\n trimDots,\r\n pluginMissing,\r\n flatClone,\r\n PROMISE_RESOLVE_NULL,\r\n RXJS_SHARE_REPLAY_DEFAULTS,\r\n getProperty,\r\n getFromMapOrCreate,\r\n ensureNotFalsy\r\n} from './plugins/utils/index.ts';\r\nimport {\r\n newRxError\r\n} from './rx-error.ts';\r\nimport {\r\n runPluginHooks\r\n} from './hooks.ts';\r\n\r\nimport type {\r\n RxDocument,\r\n RxCollection,\r\n RxDocumentData,\r\n RxDocumentWriteData,\r\n UpdateQuery,\r\n CRDTEntry,\r\n ModifyFunction\r\n} from './types/index.d.ts';\r\nimport { getDocumentDataOfRxChangeEvent } from './rx-change-event.ts';\r\nimport { overwritable } from './overwritable.ts';\r\nimport { getSchemaByObjectPath } from './rx-schema-helper.ts';\r\nimport { getWrittenDocumentsFromBulkWriteResponse, throwIfIsStorageWriteError } from './rx-storage-helper.ts';\r\nimport { modifierFromPublicToInternal } from './incremental-write.ts';\r\n\r\nexport const basePrototype = {\r\n get primaryPath() {\r\n const _this: RxDocument = this as any;\r\n if (!_this.isInstanceOfRxDocument) {\r\n return undefined;\r\n }\r\n return _this.collection.schema.primaryPath;\r\n },\r\n get primary() {\r\n const _this: RxDocument = this as any;\r\n if (!_this.isInstanceOfRxDocument) {\r\n return undefined;\r\n }\r\n return (_this._data as any)[_this.primaryPath];\r\n },\r\n get revision() {\r\n const _this: RxDocument = this as any;\r\n if (!_this.isInstanceOfRxDocument) {\r\n return undefined;\r\n }\r\n return _this._data._rev;\r\n },\r\n get deleted$() {\r\n const _this: RxDocument<any> = this as any;\r\n if (!_this.isInstanceOfRxDocument) {\r\n return undefined;\r\n }\r\n return _this.$.pipe(\r\n map((d: any) => d._data._deleted)\r\n );\r\n },\r\n get deleted$$() {\r\n const _this: RxDocument = this as any;\r\n const reactivity = _this.collection.database.getReactivityFactory();\r\n return reactivity.fromObservable(\r\n _this.deleted$,\r\n _this.getLatest().deleted,\r\n _this.collection.database\r\n );\r\n },\r\n get deleted() {\r\n const _this: RxDocument = this as any;\r\n if (!_this.isInstanceOfRxDocument) {\r\n return undefined;\r\n }\r\n return _this._data._deleted;\r\n },\r\n\r\n getLatest(this: RxDocument): RxDocument {\r\n const latestDocData = this.collection._docCache.getLatestDocumentData(this.primary);\r\n return this.collection._docCache.getCachedRxDocument(latestDocData);\r\n },\r\n\r\n /**\r\n * returns the observable which emits the plain-data of this document\r\n */\r\n get $(): Observable<RxDocumentData<any>> {\r\n const _this: RxDocument<{}, {}, {}> = this as any;\r\n const id = this.primary;\r\n\r\n return _this.collection.eventBulks$.pipe(\r\n filter((bulk: any) => !bulk.isLocal),\r\n map((bulk: any) => bulk.events.find((ev: any) => ev.documentId === id)),\r\n filter((event: any) => !!event),\r\n map((changeEvent: any) => getDocumentDataOfRxChangeEvent(ensureNotFalsy(changeEvent))),\r\n startWith(_this.collection._docCache.getLatestDocumentData(id)),\r\n distinctUntilChanged((prev: RxDocumentData<any>, curr: RxDocumentData<any>) => prev._rev === curr._rev),\r\n map((docData: RxDocumentData<any>) => (this as RxDocument<any>).collection._docCache.getCachedRxDocument(docData)),\r\n shareReplay(RXJS_SHARE_REPLAY_DEFAULTS)\r\n );\r\n },\r\n get $$(): any {\r\n const _this: RxDocument = this as any;\r\n const reactivity = _this.collection.database.getReactivityFactory();\r\n return reactivity.fromObservable(\r\n _this.$,\r\n _this.getLatest()._data,\r\n _this.collection.database\r\n );\r\n },\r\n\r\n /**\r\n * returns observable of the value of the given path\r\n */\r\n get$(this: RxDocument, path: string): Observable<any> {\r\n if (overwritable.isDevMode()) {\r\n if (path.includes('.item.')) {\r\n throw newRxError('DOC1', {\r\n path\r\n });\r\n }\r\n\r\n if (path === this.primaryPath) {\r\n throw newRxError('DOC2');\r\n }\r\n\r\n // final fields cannot be modified and so also not observed\r\n if (this.collection.schema.finalFields.includes(path)) {\r\n throw newRxError('DOC3', {\r\n path\r\n });\r\n }\r\n\r\n const schemaObj = getSchemaByObjectPath(\r\n this.collection.schema.jsonSchema,\r\n path\r\n );\r\n\r\n if (!schemaObj) {\r\n throw newRxError('DOC4', {\r\n path\r\n });\r\n }\r\n }\r\n\r\n return this.$\r\n .pipe(\r\n map((data: any) => getProperty(data, path)),\r\n distinctUntilChanged()\r\n );\r\n },\r\n get$$(this: RxDocument, path: string) {\r\n const obs = this.get$(path);\r\n const reactivity = this.collection.database.getReactivityFactory();\r\n return reactivity.fromObservable(\r\n obs,\r\n this.getLatest().get(path),\r\n this.collection.database\r\n );\r\n },\r\n\r\n /**\r\n * populate the given path\r\n */\r\n populate(this: RxDocument, path: string): Promise<RxDocument | null> {\r\n const schemaObj = getSchemaByObjectPath(\r\n this.collection.schema.jsonSchema,\r\n path\r\n );\r\n const value = this.get(path);\r\n if (!value) {\r\n return PROMISE_RESOLVE_NULL;\r\n }\r\n if (!schemaObj) {\r\n throw newRxError('DOC5', {\r\n path\r\n });\r\n }\r\n if (!schemaObj.ref) {\r\n throw newRxError('DOC6', {\r\n path,\r\n schemaObj\r\n });\r\n }\r\n\r\n const refCollection: RxCollection = this.collection.database.collections[schemaObj.ref];\r\n if (!refCollection) {\r\n throw newRxError('DOC7', {\r\n ref: schemaObj.ref,\r\n path,\r\n schemaObj\r\n });\r\n }\r\n\r\n if (schemaObj.type === 'array') {\r\n return refCollection.findByIds(value).exec().then(res => {\r\n const valuesIterator = res.values();\r\n return Array.from(valuesIterator) as any;\r\n });\r\n } else {\r\n return refCollection.findOne(value).exec();\r\n }\r\n },\r\n /**\r\n * get data by objectPath\r\n * @hotPath Performance here is really important,\r\n * run some tests before changing anything.\r\n */\r\n get(this: RxDocument, objPath: string): any | null {\r\n return getDocumentProperty(this, objPath);\r\n },\r\n\r\n toJSON(this: RxDocument, withMetaFields = false) {\r\n if (!withMetaFields) {\r\n const data = flatClone(this._data);\r\n delete (data as any)._rev;\r\n delete (data as any)._attachments;\r\n delete (data as any)._deleted;\r\n delete (data as any)._meta;\r\n return overwritable.deepFreezeWhenDevMode(data);\r\n } else {\r\n return overwritable.deepFreezeWhenDevMode(this._data);\r\n }\r\n },\r\n toMutableJSON(this: RxDocument, withMetaFields = false) {\r\n return clone(this.toJSON(withMetaFields as any));\r\n },\r\n\r\n /**\r\n * updates document\r\n * @overwritten by plugin (optional)\r\n * @param updateObj mongodb-like syntax\r\n */\r\n update(_updateObj: UpdateQuery<any>) {\r\n throw pluginMissing('update');\r\n },\r\n incrementalUpdate(_updateObj: UpdateQuery<any>) {\r\n throw pluginMissing('update');\r\n },\r\n updateCRDT(_updateObj: CRDTEntry<any> | CRDTEntry<any>[]) {\r\n throw pluginMissing('crdt');\r\n },\r\n putAttachment() {\r\n throw pluginMissing('attachments');\r\n },\r\n putAttachmentBase64() {\r\n throw pluginMissing('attachments');\r\n },\r\n getAttachment() {\r\n throw pluginMissing('attachments');\r\n },\r\n allAttachments() {\r\n throw pluginMissing('attachments');\r\n },\r\n get allAttachments$() {\r\n throw pluginMissing('attachments');\r\n },\r\n\r\n async modify<RxDocType>(\r\n this: RxDocument<RxDocType>,\r\n mutationFunction: ModifyFunction<RxDocType>,\r\n // used by some plugins that wrap the method\r\n _context?: string\r\n ): Promise<RxDocument> {\r\n const oldData = this._data;\r\n const newData: RxDocumentData<RxDocType> = await modifierFromPublicToInternal<RxDocType>(mutationFunction)(oldData) as any;\r\n return this._saveData(newData, oldData) as any;\r\n },\r\n\r\n /**\r\n * runs an incremental update over the document\r\n * @param function that takes the document-data and returns a new data-object\r\n */\r\n incrementalModify(\r\n this: RxDocument,\r\n mutationFunction: ModifyFunction<any>,\r\n // used by some plugins that wrap the method\r\n _context?: string\r\n ): Promise<RxDocument> {\r\n return this.collection.incrementalWriteQueue.addWrite(\r\n this._data,\r\n modifierFromPublicToInternal(mutationFunction)\r\n ).then(result => this.collection._docCache.getCachedRxDocument(result));\r\n },\r\n\r\n patch<RxDocType>(\r\n this: RxDocument<RxDocType>,\r\n patch: Partial<RxDocType>\r\n ) {\r\n const oldData = this._data;\r\n const newData = clone(oldData);\r\n Object\r\n .entries(patch)\r\n .forEach(([k, v]) => {\r\n (newData as any)[k] = v;\r\n });\r\n return this._saveData(newData, oldData);\r\n },\r\n\r\n /**\r\n * patches the given properties\r\n */\r\n incrementalPatch<RxDocumentType = any>(\r\n this: RxDocument<RxDocumentType>,\r\n patch: Partial<RxDocumentType>\r\n ): Promise<RxDocument<RxDocumentType>> {\r\n return this.incrementalModify((docData) => {\r\n Object\r\n .entries(patch)\r\n .forEach(([k, v]) => {\r\n (docData as any)[k] = v;\r\n });\r\n return docData;\r\n });\r\n },\r\n\r\n /**\r\n * saves the new document-data\r\n * and handles the events\r\n */\r\n async _saveData<RxDocType>(\r\n this: RxDocument<RxDocType>,\r\n newData: RxDocumentWriteData<RxDocType>,\r\n oldData: RxDocumentData<RxDocType>\r\n ): Promise<RxDocument<RxDocType>> {\r\n newData = flatClone(newData);\r\n\r\n // deleted documents cannot be changed\r\n if (this._data._deleted) {\r\n throw newRxError('DOC11', {\r\n id: this.primary,\r\n document: this\r\n });\r\n }\r\n await beforeDocumentUpdateWrite(this.collection, newData, oldData);\r\n const writeRows = [{\r\n previous: oldData,\r\n document: newData\r\n }];\r\n const writeResult = await this.collection.storageInstance.bulkWrite(writeRows, 'rx-document-save-data');\r\n\r\n const isError = writeResult.error[0];\r\n throwIfIsStorageWriteError(this.collection, this.primary, newData, isError);\r\n\r\n await this.collection._runHooks('post', 'save', newData, this);\r\n return this.collection._docCache.getCachedRxDocument(\r\n getWrittenDocumentsFromBulkWriteResponse(\r\n this.collection.schema.primaryPath,\r\n writeRows,\r\n writeResult\r\n )[0]\r\n );\r\n },\r\n\r\n /**\r\n * Remove the document.\r\n * Notice that there is no hard delete,\r\n * instead deleted documents get flagged with _deleted=true.\r\n */\r\n async remove(this: RxDocument): Promise<RxDocument> {\r\n if (this.deleted) {\r\n return Promise.reject(newRxError('DOC13', {\r\n document: this,\r\n id: this.primary\r\n }));\r\n }\r\n\r\n const removeResult = await this.collection.bulkRemove([this]);\r\n if (removeResult.error.length > 0) {\r\n const error = removeResult.error[0];\r\n throwIfIsStorageWriteError(\r\n this.collection,\r\n this.primary,\r\n this._data,\r\n error\r\n );\r\n }\r\n return removeResult.success[0];\r\n },\r\n incrementalRemove(this: RxDocument): Promise<RxDocument> {\r\n return this.incrementalModify(async (docData) => {\r\n await this.collection._runHooks('pre', 'remove', docData, this);\r\n docData._deleted = true;\r\n return docData;\r\n }).then(async (newDoc) => {\r\n await this.collection._runHooks('post', 'remove', newDoc._data, newDoc);\r\n return newDoc;\r\n });\r\n },\r\n close() {\r\n throw newRxError('DOC14');\r\n }\r\n};\r\n\r\nexport function createRxDocumentConstructor(proto = basePrototype) {\r\n const constructor = function RxDocumentConstructor(\r\n this: RxDocument,\r\n collection: RxCollection,\r\n docData: RxDocumentData<any>\r\n ) {\r\n this.collection = collection;\r\n\r\n // assume that this is always equal to the doc-data in the database\r\n this._data = docData;\r\n\r\n /**\r\n * @performance\r\n * Lazy-initialize _propertyCache only when first needed\r\n * instead of creating a new Map for every RxDocument,\r\n * since many documents (e.g. from query results) may never\r\n * have their properties accessed via the cache.\r\n */\r\n this._propertyCache = undefined;\r\n\r\n /**\r\n * because of the prototype-merge,\r\n * we can not use the native instanceof operator\r\n */\r\n this.isInstanceOfRxDocument = true;\r\n };\r\n constructor.prototype = proto;\r\n return constructor;\r\n}\r\n\r\nexport function createWithConstructor<RxDocType>(\r\n constructor: any,\r\n collection: RxCollection<RxDocType>,\r\n jsonData: RxDocumentData<RxDocType>\r\n): RxDocument<RxDocType> | null {\r\n const doc = new constructor(collection, jsonData);\r\n runPluginHooks('createRxDocument', doc);\r\n return doc;\r\n}\r\n\r\nexport function isRxDocument(obj: any): boolean {\r\n return typeof obj === 'object' && obj !== null && 'isInstanceOfRxDocument' in obj;\r\n}\r\n\r\n\r\nexport function beforeDocumentUpdateWrite<RxDocType>(\r\n collection: RxCollection<RxDocType>,\r\n newData: RxDocumentWriteData<RxDocType>,\r\n oldData: RxDocumentData<RxDocType>\r\n): Promise<any> {\r\n /**\r\n * Meta values must always be merged\r\n * instead of overwritten.\r\n * This ensures that different plugins do not overwrite\r\n * each others meta properties.\r\n */\r\n newData._meta = Object.assign(\r\n {},\r\n oldData._meta,\r\n newData._meta\r\n );\r\n\r\n // ensure modifications are ok\r\n if (overwritable.isDevMode()) {\r\n collection.schema.validateChange(oldData, newData);\r\n }\r\n return collection._runHooks('pre', 'save', newData, oldData);\r\n}\r\n\r\n\r\n\r\n\r\nfunction getDocumentProperty(doc: RxDocument, objPath: string): any | null {\r\n /**\r\n * @performance Lazy-initialize _propertyCache on first access\r\n * to avoid creating a Map for documents that never use it.\r\n */\r\n if (!doc._propertyCache) {\r\n doc._propertyCache = new Map<string, any>();\r\n }\r\n return getFromMapOrCreate(\r\n doc._propertyCache,\r\n objPath,\r\n () => {\r\n const valueObj = getProperty(doc._data, objPath);\r\n\r\n // direct return if array or non-object\r\n if (\r\n typeof valueObj !== 'object' ||\r\n valueObj === null ||\r\n Array.isArray(valueObj)\r\n ) {\r\n return overwritable.deepFreezeWhenDevMode(valueObj);\r\n }\r\n const proxy = new Proxy(\r\n /**\r\n * In dev-mode, the _data is deep-frozen\r\n * so we have to flat clone here so that\r\n * the proxy can work.\r\n */\r\n flatClone(valueObj),\r\n {\r\n /**\r\n * @performance is really important here\r\n * because people access nested properties very often\r\n * and might not be aware that this is internally using a Proxy\r\n */\r\n get(target, property: any) {\r\n if (typeof property !== 'string') {\r\n return target[property];\r\n }\r\n\r\n\r\n const lastChar = property.charAt(property.length - 1);\r\n if (lastChar === '$') {\r\n if (property.endsWith('$$')) {\r\n const key = property.slice(0, -2);\r\n return doc.get$$(trimDots(objPath + '.' + key));\r\n } else {\r\n const key = property.slice(0, -1);\r\n return doc.get$(trimDots(objPath + '.' + key));\r\n }\r\n } else if (lastChar === '_') {\r\n const key = property.slice(0, -1);\r\n return doc.populate(trimDots(objPath + '.' + key));\r\n } else {\r\n\r\n /**\r\n * Performance shortcut\r\n * In most cases access to nested properties\r\n * will only access simple values which can be directly returned\r\n * without creating a new Proxy or utilizing the cache.\r\n */\r\n const plainValue = target[property];\r\n if (\r\n typeof plainValue === 'number' ||\r\n typeof plainValue === 'string' ||\r\n typeof plainValue === 'boolean'\r\n ) {\r\n return plainValue;\r\n }\r\n\r\n return getDocumentProperty(doc, trimDots(objPath + '.' + property));\r\n }\r\n }\r\n });\r\n return proxy;\r\n }\r\n );\r\n};\r\n"],"mappings":"AAGA,SACIA,oBAAoB,EACpBC,MAAM,EACNC,GAAG,EACHC,WAAW,EACXC,SAAS,QACN,gBAAgB;AACvB,SACIC,KAAK,EACLC,QAAQ,EACRC,aAAa,EACbC,SAAS,EACTC,oBAAoB,EACpBC,0BAA0B,EAC1BC,WAAW,EACXC,kBAAkB,EAClBC,cAAc,QACX,0BAA0B;AACjC,SACIC,UAAU,QACP,eAAe;AACtB,SACIC,cAAc,QACX,YAAY;AAWnB,SAASC,8BAA8B,QAAQ,sBAAsB;AACrE,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,qBAAqB,QAAQ,uBAAuB;AAC7D,SAASC,wCAAwC,EAAEC,0BAA0B,QAAQ,wBAAwB;AAC7G,SAASC,4BAA4B,QAAQ,wBAAwB;AAErE,OAAO,IAAMC,aAAa,GAAG;EACzB,IAAIC,WAAWA,CAAA,EAAG;IACd,IAAMC,KAA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,EAAE;YACzB,IAAMC,GAAG,GAAGJ,QAAQ,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACjC,OAAOhB,GAAG,CAAChF,KAAK,CAACjE,QAAQ,CAACmF,OAAO,GAAG,GAAG,GAAG6E,GAAG,CAAC,CAAC;UACnD,CAAC,MAAM;YACH,IAAMA,IAAG,GAAGJ,QAAQ,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACjC,OAAOhB,GAAG,CAACxF,IAAI,CAACzD,QAAQ,CAACmF,OAAO,GAAG,GAAG,GAAG6E,IAAG,CAAC,CAAC;UAClD;QACJ,CAAC,MAAM,IAAIH,QAAQ,KAAK,GAAG,EAAE;UACzB,IAAMG,KAAG,GAAGJ,QAAQ,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;UACjC,OAAOhB,GAAG,CAAC7E,QAAQ,CAACpE,QAAQ,CAACmF,OAAO,GAAG,GAAG,GAAG6E,KAAG,CAAC,CAAC;QACtD,CAAC,MAAM;UAEH;AAC5B;AACA;AACA;AACA;AACA;UAC4B,IAAME,UAAU,GAAGP,MAAM,CAACC,QAAQ,CAAC;UACnC,IACI,OAAOM,UAAU,KAAK,QAAQ,IAC9B,OAAOA,UAAU,KAAK,QAAQ,IAC9B,OAAOA,UAAU,KAAK,SAAS,EACjC;YACE,OAAOA,UAAU;UACrB;UAEA,OAAO9E,mBAAmB,CAAC6D,GAAG,EAAEjJ,QAAQ,CAACmF,OAAO,GAAG,GAAG,GAAGyE,QAAQ,CAAC,CAAC;QACvE;MACJ;IACJ,CAAC,CAAC;IACN,OAAOH,KAAK;EAChB,CACJ,CAAC;AACL;AAAC","ignoreList":[]}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
2
|
+
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
3
|
+
import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
|
|
4
|
+
/**
|
|
5
|
+
* here we use custom errors with the additional field 'parameters'
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { overwritable } from "./overwritable.js";
|
|
9
|
+
/**
|
|
10
|
+
* transform an object of parameters to a presentable string
|
|
11
|
+
*/
|
|
12
|
+
function parametersToString(parameters) {
|
|
13
|
+
var ret = '';
|
|
14
|
+
if (Object.keys(parameters).length === 0) return ret;
|
|
15
|
+
ret += '-'.repeat(20) + '\n';
|
|
16
|
+
ret += 'Parameters:\n';
|
|
17
|
+
ret += Object.keys(parameters).map(k => {
|
|
18
|
+
var paramStr = '[object Object]';
|
|
19
|
+
try {
|
|
20
|
+
if (k === 'errors') {
|
|
21
|
+
paramStr = parameters[k].map(err => JSON.stringify(err, Object.getOwnPropertyNames(err)));
|
|
22
|
+
} else {
|
|
23
|
+
paramStr = JSON.stringify(parameters[k], function (_k, v) {
|
|
24
|
+
return v === undefined ? null : v;
|
|
25
|
+
}, 2);
|
|
26
|
+
}
|
|
27
|
+
} catch (e) {}
|
|
28
|
+
return k + ': ' + paramStr;
|
|
29
|
+
}).join('\n');
|
|
30
|
+
ret += '\n';
|
|
31
|
+
return ret;
|
|
32
|
+
}
|
|
33
|
+
function messageForError(message, code, parameters) {
|
|
34
|
+
return '' + '\n' + message + '\n' + parametersToString(parameters);
|
|
35
|
+
}
|
|
36
|
+
export var RxError = /*#__PURE__*/function (_Error) {
|
|
37
|
+
// always true, use this to detect if it's an rxdb-error
|
|
38
|
+
|
|
39
|
+
function RxError(code, message, parameters = {}) {
|
|
40
|
+
var _this;
|
|
41
|
+
var mes = messageForError(message, code, parameters);
|
|
42
|
+
_this = _Error.call(this, mes) || this;
|
|
43
|
+
_this.code = code;
|
|
44
|
+
_this.message = mes;
|
|
45
|
+
_this.url = getErrorUrl(code);
|
|
46
|
+
_this.parameters = parameters;
|
|
47
|
+
_this.rxdb = true; // tag them as internal
|
|
48
|
+
return _this;
|
|
49
|
+
}
|
|
50
|
+
_inheritsLoose(RxError, _Error);
|
|
51
|
+
var _proto = RxError.prototype;
|
|
52
|
+
_proto.toString = function toString() {
|
|
53
|
+
return this.message;
|
|
54
|
+
};
|
|
55
|
+
return _createClass(RxError, [{
|
|
56
|
+
key: "name",
|
|
57
|
+
get: function () {
|
|
58
|
+
return 'RxError (' + this.code + ')';
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "typeError",
|
|
62
|
+
get: function () {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}]);
|
|
66
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
67
|
+
export var RxTypeError = /*#__PURE__*/function (_TypeError) {
|
|
68
|
+
// always true, use this to detect if it's an rxdb-error
|
|
69
|
+
|
|
70
|
+
function RxTypeError(code, message, parameters = {}) {
|
|
71
|
+
var _this2;
|
|
72
|
+
var mes = messageForError(message, code, parameters);
|
|
73
|
+
_this2 = _TypeError.call(this, mes) || this;
|
|
74
|
+
_this2.code = code;
|
|
75
|
+
_this2.message = mes;
|
|
76
|
+
_this2.url = getErrorUrl(code);
|
|
77
|
+
_this2.parameters = parameters;
|
|
78
|
+
_this2.rxdb = true; // tag them as internal
|
|
79
|
+
return _this2;
|
|
80
|
+
}
|
|
81
|
+
_inheritsLoose(RxTypeError, _TypeError);
|
|
82
|
+
var _proto2 = RxTypeError.prototype;
|
|
83
|
+
_proto2.toString = function toString() {
|
|
84
|
+
return this.message;
|
|
85
|
+
};
|
|
86
|
+
return _createClass(RxTypeError, [{
|
|
87
|
+
key: "name",
|
|
88
|
+
get: function () {
|
|
89
|
+
return 'RxTypeError (' + this.code + ')';
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
key: "typeError",
|
|
93
|
+
get: function () {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
}]);
|
|
97
|
+
}(/*#__PURE__*/_wrapNativeSuper(TypeError));
|
|
98
|
+
export function getErrorUrl(code) {
|
|
99
|
+
return 'https://rxdb.info/errors.html?console=errors#' + code;
|
|
100
|
+
}
|
|
101
|
+
export function errorUrlHint(code) {
|
|
102
|
+
return '\nFind out more about this error here: ' + getErrorUrl(code) + ' \n';
|
|
103
|
+
}
|
|
104
|
+
export function newRxError(code, parameters) {
|
|
105
|
+
return new RxError(code, overwritable.tunnelErrorMessage(code) + errorUrlHint(code), parameters);
|
|
106
|
+
}
|
|
107
|
+
export function newRxTypeError(code, parameters) {
|
|
108
|
+
return new RxTypeError(code, overwritable.tunnelErrorMessage(code) + errorUrlHint(code), parameters);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Returns the error if it is a 409 conflict,
|
|
113
|
+
* return false if it is another error.
|
|
114
|
+
*/
|
|
115
|
+
export function isBulkWriteConflictError(err) {
|
|
116
|
+
if (err && err.status === 409) {
|
|
117
|
+
return err;
|
|
118
|
+
} else {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
var STORAGE_WRITE_ERROR_CODE_TO_MESSAGE = {
|
|
123
|
+
409: 'document write conflict',
|
|
124
|
+
422: 'schema validation error',
|
|
125
|
+
510: 'attachment data missing'
|
|
126
|
+
};
|
|
127
|
+
export function rxStorageWriteErrorToRxError(err) {
|
|
128
|
+
return newRxError('COL20', {
|
|
129
|
+
name: STORAGE_WRITE_ERROR_CODE_TO_MESSAGE[err.status],
|
|
130
|
+
document: err.documentId,
|
|
131
|
+
writeError: err
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
export async function newRxFetchError(input, additionalParameters) {
|
|
135
|
+
var errorText = await input.text().catch(() => '');
|
|
136
|
+
var parameters = {
|
|
137
|
+
...additionalParameters,
|
|
138
|
+
...(input.url ? {
|
|
139
|
+
url: input.url
|
|
140
|
+
} : {}),
|
|
141
|
+
...(input.status ? {
|
|
142
|
+
status: input.status
|
|
143
|
+
} : {}),
|
|
144
|
+
...(input.statusText ? {
|
|
145
|
+
statusText: input.statusText
|
|
146
|
+
} : {}),
|
|
147
|
+
...(errorText ? {
|
|
148
|
+
errorText
|
|
149
|
+
} : {})
|
|
150
|
+
};
|
|
151
|
+
return newRxError('FETCH', parameters);
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=rx-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rx-error.js","names":["overwritable","parametersToString","parameters","ret","Object","keys","length","repeat","map","k","paramStr","err","JSON","stringify","getOwnPropertyNames","_k","v","undefined","e","join","messageForError","message","code","RxError","_Error","_this","mes","call","url","getErrorUrl","rxdb","_inheritsLoose","_proto","prototype","toString","_createClass","key","get","_wrapNativeSuper","Error","RxTypeError","_TypeError","_this2","_proto2","TypeError","errorUrlHint","newRxError","tunnelErrorMessage","newRxTypeError","isBulkWriteConflictError","status","STORAGE_WRITE_ERROR_CODE_TO_MESSAGE","rxStorageWriteErrorToRxError","name","document","documentId","writeError","newRxFetchError","input","additionalParameters","errorText","text","catch","statusText"],"sources":["../../src/rx-error.ts"],"sourcesContent":["/**\r\n * here we use custom errors with the additional field 'parameters'\r\n */\r\n\r\nimport { overwritable } from './overwritable.ts';\r\nimport type {\r\n RxErrorParameters,\r\n RxErrorKey,\r\n RxStorageWriteError,\r\n RxStorageWriteErrorConflict\r\n} from './types/index.d.ts';\r\n\r\n/**\r\n * transform an object of parameters to a presentable string\r\n */\r\nfunction parametersToString(parameters: any): string {\r\n let ret = '';\r\n if (Object.keys(parameters).length === 0)\r\n return ret;\r\n ret += '-'.repeat(20) + '\\n';\r\n ret += 'Parameters:\\n';\r\n ret += Object.keys(parameters)\r\n .map(k => {\r\n let paramStr = '[object Object]';\r\n try {\r\n if (k === 'errors') {\r\n paramStr = parameters[k].map((err: any) => JSON.stringify(err, Object.getOwnPropertyNames(err)));\r\n } else {\r\n paramStr = JSON.stringify(parameters[k], function (_k, v) {\r\n return v === undefined ? null : v;\r\n }, 2);\r\n }\r\n } catch (e) { }\r\n return k + ': ' + paramStr;\r\n })\r\n .join('\\n');\r\n ret += '\\n';\r\n return ret;\r\n}\r\n\r\nfunction messageForError(\r\n message: string,\r\n code: string,\r\n parameters: any\r\n): string {\r\n return '' + '\\n' +\r\n message + '\\n' +\r\n parametersToString(parameters);\r\n}\r\n\r\nexport class RxError extends Error {\r\n public code: RxErrorKey;\r\n public message: string;\r\n public url: string;\r\n public parameters: RxErrorParameters;\r\n // always true, use this to detect if it's an rxdb-error\r\n public rxdb: true;\r\n constructor(\r\n code: RxErrorKey,\r\n message: string,\r\n parameters: RxErrorParameters = {}\r\n ) {\r\n const mes = messageForError(message, code, parameters);\r\n super(mes);\r\n this.code = code;\r\n this.message = mes;\r\n this.url = getErrorUrl(code);\r\n this.parameters = parameters;\r\n this.rxdb = true; // tag them as internal\r\n }\r\n get name(): string {\r\n return 'RxError (' + this.code + ')';\r\n }\r\n toString(): string {\r\n return this.message;\r\n }\r\n get typeError(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\nexport class RxTypeError extends TypeError {\r\n public code: RxErrorKey;\r\n public message: string;\r\n public url: string;\r\n public parameters: RxErrorParameters;\r\n // always true, use this to detect if it's an rxdb-error\r\n public rxdb: true;\r\n constructor(\r\n code: RxErrorKey,\r\n message: string,\r\n parameters: RxErrorParameters = {}\r\n ) {\r\n const mes = messageForError(message, code, parameters);\r\n super(mes);\r\n this.code = code;\r\n this.message = mes;\r\n this.url = getErrorUrl(code);\r\n this.parameters = parameters;\r\n this.rxdb = true; // tag them as internal\r\n }\r\n get name(): string {\r\n return 'RxTypeError (' + this.code + ')';\r\n }\r\n toString(): string {\r\n return this.message;\r\n }\r\n get typeError(): boolean {\r\n return true;\r\n }\r\n}\r\n\r\n\r\nexport function getErrorUrl(code: RxErrorKey) {\r\n return 'https://rxdb.info/errors.html?console=errors#' + code;\r\n}\r\n\r\nexport function errorUrlHint(code: RxErrorKey) {\r\n return '\\nFind out more about this error here: ' + getErrorUrl(code) + ' \\n';\r\n}\r\n\r\nexport function newRxError(\r\n code: RxErrorKey,\r\n parameters?: RxErrorParameters\r\n): RxError {\r\n return new RxError(\r\n code,\r\n overwritable.tunnelErrorMessage(code) + errorUrlHint(code),\r\n parameters\r\n );\r\n}\r\n\r\nexport function newRxTypeError(\r\n code: RxErrorKey,\r\n parameters?: RxErrorParameters\r\n): RxTypeError {\r\n return new RxTypeError(\r\n code,\r\n overwritable.tunnelErrorMessage(code) + errorUrlHint(code),\r\n parameters\r\n );\r\n}\r\n\r\n\r\n/**\r\n * Returns the error if it is a 409 conflict,\r\n * return false if it is another error.\r\n */\r\nexport function isBulkWriteConflictError<RxDocType>(\r\n err?: RxStorageWriteError<RxDocType> | any\r\n): RxStorageWriteErrorConflict<RxDocType> | false {\r\n if (\r\n err &&\r\n err.status === 409\r\n ) {\r\n return err;\r\n } else {\r\n return false;\r\n }\r\n}\r\n\r\n\r\nconst STORAGE_WRITE_ERROR_CODE_TO_MESSAGE: { [k: number]: string; } = {\r\n 409: 'document write conflict',\r\n 422: 'schema validation error',\r\n 510: 'attachment data missing'\r\n};\r\n\r\nexport function rxStorageWriteErrorToRxError(err: RxStorageWriteError<any>): RxError {\r\n return newRxError('COL20', {\r\n name: STORAGE_WRITE_ERROR_CODE_TO_MESSAGE[err.status],\r\n document: err.documentId,\r\n writeError: err\r\n });\r\n}\r\n\r\nexport async function newRxFetchError(\r\n input: Response,\r\n additionalParameters?: RxErrorParameters\r\n): Promise<RxError> {\r\n const errorText = await input.text().catch(() => '');\r\n const parameters: RxErrorParameters = {\r\n ...additionalParameters,\r\n ...(input.url ? { url: input.url } : {}),\r\n ...(input.status ? { status: input.status } : {}),\r\n ...(input.statusText ? { statusText: input.statusText } : {}),\r\n ...(errorText ? { errorText } : {})\r\n };\r\n return newRxError('FETCH', parameters);\r\n}\r\n"],"mappings":";;;AAAA;AACA;AACA;;AAEA,SAASA,YAAY,QAAQ,mBAAmB;AAQhD;AACA;AACA;AACA,SAASC,kBAAkBA,CAACC,UAAe,EAAU;EACjD,IAAIC,GAAG,GAAG,EAAE;EACZ,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
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { LOGICAL_OPERATORS, getQueryPlan } from "./query-planner.js";
|
|
2
|
+
import { getPrimaryFieldOfPrimaryKey } from "./rx-schema-helper.js";
|
|
3
|
+
import { clone, firstPropertyNameOfObject, toArray, isMaybeReadonlyArray, objectPathMonad } from "./plugins/utils/index.js";
|
|
4
|
+
import { compare as mingoSortComparator } from 'mingo/util';
|
|
5
|
+
import { newRxError } from "./rx-error.js";
|
|
6
|
+
import { getMingoQuery } from "./rx-query-mingo.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Normalize the query to ensure we have all fields set
|
|
10
|
+
* and queries that represent the same query logic are detected as equal by the caching.
|
|
11
|
+
*/
|
|
12
|
+
export function normalizeMangoQuery(schema, mangoQuery,
|
|
13
|
+
/**
|
|
14
|
+
* @performance
|
|
15
|
+
* Count queries do not need sort order.
|
|
16
|
+
* Skipping the sort computation avoids iterating over schema indexes
|
|
17
|
+
* and comparing fields, which improves count query performance.
|
|
18
|
+
*/
|
|
19
|
+
skipSort) {
|
|
20
|
+
var primaryKey = getPrimaryFieldOfPrimaryKey(schema.primaryKey);
|
|
21
|
+
var normalizedMangoQuery = clone(mangoQuery);
|
|
22
|
+
if (typeof normalizedMangoQuery.skip !== 'number') {
|
|
23
|
+
normalizedMangoQuery.skip = 0;
|
|
24
|
+
}
|
|
25
|
+
if (!normalizedMangoQuery.selector) {
|
|
26
|
+
normalizedMangoQuery.selector = {};
|
|
27
|
+
} else {
|
|
28
|
+
normalizedMangoQuery.selector = normalizedMangoQuery.selector;
|
|
29
|
+
/**
|
|
30
|
+
* In mango query, it is possible to have an
|
|
31
|
+
* equals comparison by directly assigning a value
|
|
32
|
+
* to a property, without the '$eq' operator.
|
|
33
|
+
* Like:
|
|
34
|
+
* selector: {
|
|
35
|
+
* foo: 'bar'
|
|
36
|
+
* }
|
|
37
|
+
* For normalization, we have to normalize this
|
|
38
|
+
* so our checks can perform properly.
|
|
39
|
+
*
|
|
40
|
+
*
|
|
41
|
+
* TODO this must work recursive with nested queries that
|
|
42
|
+
* contain multiple selectors via $and or $or etc.
|
|
43
|
+
*/
|
|
44
|
+
Object.entries(normalizedMangoQuery.selector).forEach(([field, matcher]) => {
|
|
45
|
+
if (typeof matcher !== 'object' || matcher === null) {
|
|
46
|
+
normalizedMangoQuery.selector[field] = {
|
|
47
|
+
$eq: matcher
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Ensure that if an index is specified,
|
|
55
|
+
* the primaryKey is inside of it.
|
|
56
|
+
*/
|
|
57
|
+
if (normalizedMangoQuery.index) {
|
|
58
|
+
var indexAr = toArray(normalizedMangoQuery.index);
|
|
59
|
+
if (!indexAr.includes(primaryKey)) {
|
|
60
|
+
indexAr.push(primaryKey);
|
|
61
|
+
}
|
|
62
|
+
normalizedMangoQuery.index = indexAr;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* To ensure a deterministic sorting,
|
|
67
|
+
* we have to ensure the primary key is always part
|
|
68
|
+
* of the sort query.
|
|
69
|
+
* Primary sorting is added as last sort parameter,
|
|
70
|
+
* similar to how we add the primary key to indexes that do not have it.
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
if (skipSort && !normalizedMangoQuery.sort) {
|
|
74
|
+
/**
|
|
75
|
+
* @performance
|
|
76
|
+
* Count queries do not need sorted results.
|
|
77
|
+
* Use a simple primary key sort to avoid the expensive
|
|
78
|
+
* index-matching sort computation.
|
|
79
|
+
*/
|
|
80
|
+
normalizedMangoQuery.sort = [{
|
|
81
|
+
[primaryKey]: 'asc'
|
|
82
|
+
}];
|
|
83
|
+
} else if (!normalizedMangoQuery.sort) {
|
|
84
|
+
/**
|
|
85
|
+
* If no sort is given at all,
|
|
86
|
+
* we can assume that the user does not care about sort order at al.
|
|
87
|
+
*
|
|
88
|
+
* we cannot just use the primary key as sort parameter
|
|
89
|
+
* because it would likely cause the query to run over the primary key index
|
|
90
|
+
* which has a bad performance in most cases.
|
|
91
|
+
*/
|
|
92
|
+
if (normalizedMangoQuery.index) {
|
|
93
|
+
normalizedMangoQuery.sort = normalizedMangoQuery.index.map(field => {
|
|
94
|
+
return {
|
|
95
|
+
[field]: 'asc'
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
} else {
|
|
99
|
+
/**
|
|
100
|
+
* Find the index that best matches the fields with the logical operators
|
|
101
|
+
*/
|
|
102
|
+
if (schema.indexes) {
|
|
103
|
+
var fieldsWithLogicalOperator = new Set();
|
|
104
|
+
Object.entries(normalizedMangoQuery.selector).forEach(([field, matcher]) => {
|
|
105
|
+
var hasLogical;
|
|
106
|
+
if (typeof matcher === 'object' && matcher !== null) {
|
|
107
|
+
hasLogical = !!Object.keys(matcher).find(operator => LOGICAL_OPERATORS.has(operator));
|
|
108
|
+
} else {
|
|
109
|
+
hasLogical = true;
|
|
110
|
+
}
|
|
111
|
+
if (hasLogical) {
|
|
112
|
+
fieldsWithLogicalOperator.add(field);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
var currentFieldsAmount = -1;
|
|
116
|
+
var currentBestIndexForSort;
|
|
117
|
+
schema.indexes.forEach(index => {
|
|
118
|
+
var useIndex = isMaybeReadonlyArray(index) ? index : [index];
|
|
119
|
+
var firstWrongIndex = useIndex.findIndex(indexField => !fieldsWithLogicalOperator.has(indexField));
|
|
120
|
+
if (firstWrongIndex > 0 && firstWrongIndex > currentFieldsAmount) {
|
|
121
|
+
currentFieldsAmount = firstWrongIndex;
|
|
122
|
+
currentBestIndexForSort = useIndex;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
if (currentBestIndexForSort) {
|
|
126
|
+
normalizedMangoQuery.sort = currentBestIndexForSort.map(field => {
|
|
127
|
+
return {
|
|
128
|
+
[field]: 'asc'
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* If no good index was found as default sort-order,
|
|
136
|
+
* just use the first index of the schema.
|
|
137
|
+
* If no index is in the schema, use the default-index which
|
|
138
|
+
* is created by RxDB ONLY if there is no other index defined.
|
|
139
|
+
*/
|
|
140
|
+
if (!normalizedMangoQuery.sort) {
|
|
141
|
+
if (schema.indexes && schema.indexes.length > 0) {
|
|
142
|
+
var firstIndex = schema.indexes[0];
|
|
143
|
+
var useIndex = isMaybeReadonlyArray(firstIndex) ? firstIndex : [firstIndex];
|
|
144
|
+
normalizedMangoQuery.sort = useIndex.map(field => ({
|
|
145
|
+
[field]: 'asc'
|
|
146
|
+
}));
|
|
147
|
+
} else {
|
|
148
|
+
normalizedMangoQuery.sort = [{
|
|
149
|
+
[primaryKey]: 'asc'
|
|
150
|
+
}];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
var isPrimaryInSort = normalizedMangoQuery.sort.find(p => firstPropertyNameOfObject(p) === primaryKey);
|
|
156
|
+
if (!isPrimaryInSort) {
|
|
157
|
+
normalizedMangoQuery.sort = normalizedMangoQuery.sort.slice(0);
|
|
158
|
+
normalizedMangoQuery.sort.push({
|
|
159
|
+
[primaryKey]: 'asc'
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return normalizedMangoQuery;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Returns the sort-comparator,
|
|
168
|
+
* which is able to sort documents in the same way
|
|
169
|
+
* a query over the db would do.
|
|
170
|
+
*/
|
|
171
|
+
export function getSortComparator(schema, query) {
|
|
172
|
+
if (!query.sort) {
|
|
173
|
+
throw newRxError('SNH', {
|
|
174
|
+
query
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
var sortParts = [];
|
|
178
|
+
query.sort.forEach(sortBlock => {
|
|
179
|
+
var key = Object.keys(sortBlock)[0];
|
|
180
|
+
var direction = Object.values(sortBlock)[0];
|
|
181
|
+
sortParts.push({
|
|
182
|
+
key,
|
|
183
|
+
direction,
|
|
184
|
+
getValueFn: objectPathMonad(key)
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
var fun = (a, b) => {
|
|
188
|
+
for (var i = 0; i < sortParts.length; ++i) {
|
|
189
|
+
var sortPart = sortParts[i];
|
|
190
|
+
var valueA = sortPart.getValueFn(a);
|
|
191
|
+
var valueB = sortPart.getValueFn(b);
|
|
192
|
+
if (valueA !== valueB) {
|
|
193
|
+
/**
|
|
194
|
+
* @performance
|
|
195
|
+
* Use a fast inline comparison for common types (string, number)
|
|
196
|
+
* instead of the more general mingoSortComparator.
|
|
197
|
+
* Mingo's compare does extra type checks that are unnecessary
|
|
198
|
+
* when both values share the same primitive type.
|
|
199
|
+
*/
|
|
200
|
+
var dirMultiplier = sortPart.direction === 'asc' ? 1 : -1;
|
|
201
|
+
var typeA = typeof valueA;
|
|
202
|
+
if (typeA === typeof valueB && (typeA === 'string' || typeA === 'number')) {
|
|
203
|
+
return (valueA < valueB ? -1 : 1) * dirMultiplier;
|
|
204
|
+
}
|
|
205
|
+
var ret = sortPart.direction === 'asc' ? mingoSortComparator(valueA, valueB) : mingoSortComparator(valueB, valueA);
|
|
206
|
+
return ret;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
return fun;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Returns a function
|
|
215
|
+
* that can be used to check if a document
|
|
216
|
+
* matches the query.
|
|
217
|
+
*/
|
|
218
|
+
export function getQueryMatcher(_schema, query) {
|
|
219
|
+
if (!query.sort) {
|
|
220
|
+
throw newRxError('SNH', {
|
|
221
|
+
query
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
var mingoQuery = getMingoQuery(query.selector);
|
|
225
|
+
var fun = doc => {
|
|
226
|
+
return mingoQuery.test(doc);
|
|
227
|
+
};
|
|
228
|
+
return fun;
|
|
229
|
+
}
|
|
230
|
+
export async function runQueryUpdateFunction(rxQuery, fn) {
|
|
231
|
+
var docs = await rxQuery.exec();
|
|
232
|
+
if (!docs) {
|
|
233
|
+
// only findOne() queries can return null
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
236
|
+
if (Array.isArray(docs)) {
|
|
237
|
+
return Promise.all(docs.map(doc => fn(doc)));
|
|
238
|
+
} else if (docs instanceof Map) {
|
|
239
|
+
return Promise.all([...docs.values()].map(doc => fn(doc)));
|
|
240
|
+
} else {
|
|
241
|
+
// via findOne()
|
|
242
|
+
var result = await fn(docs);
|
|
243
|
+
return result;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @returns a format of the query that can be used with the storage
|
|
249
|
+
* when calling RxStorageInstance().query()
|
|
250
|
+
*/
|
|
251
|
+
export function prepareQuery(schema, mutateableQuery) {
|
|
252
|
+
if (!mutateableQuery.sort) {
|
|
253
|
+
throw newRxError('SNH', {
|
|
254
|
+
query: mutateableQuery
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Store the query plan together with the
|
|
260
|
+
* prepared query to save performance.
|
|
261
|
+
*/
|
|
262
|
+
var queryPlan = getQueryPlan(schema, mutateableQuery);
|
|
263
|
+
return {
|
|
264
|
+
query: mutateableQuery,
|
|
265
|
+
queryPlan
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=rx-query-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rx-query-helper.js","names":["LOGICAL_OPERATORS","getQueryPlan","getPrimaryFieldOfPrimaryKey","clone","firstPropertyNameOfObject","toArray","isMaybeReadonlyArray","objectPathMonad","compare","mingoSortComparator","newRxError","getMingoQuery","normalizeMangoQuery","schema","mangoQuery","skipSort","primaryKey","normalizedMangoQuery","skip","selector","Object","entries","forEach","field","matcher","$eq","index","indexAr","includes","push","sort","map","indexes","fieldsWithLogicalOperator","Set","hasLogical","keys","find","operator","has","add","currentFieldsAmount","currentBestIndexForSort","useIndex","firstWrongIndex","findIndex","indexField","length","firstIndex","isPrimaryInSort","p","slice","getSortComparator","query","sortParts","sortBlock","key","direction","values","getValueFn","fun","a","b","i","sortPart","valueA","valueB","dirMultiplier","typeA","ret","getQueryMatcher","_schema","mingoQuery","doc","test","runQueryUpdateFunction","rxQuery","fn","docs","exec","Array","isArray","Promise","all","Map","result","prepareQuery","mutateableQuery","queryPlan"],"sources":["../../src/rx-query-helper.ts"],"sourcesContent":["import { LOGICAL_OPERATORS, getQueryPlan } from './query-planner.ts';\r\nimport { getPrimaryFieldOfPrimaryKey } from './rx-schema-helper.ts';\r\nimport type {\r\n DeepReadonly,\r\n DeterministicSortComparator,\r\n FilledMangoQuery,\r\n MangoQuery,\r\n MangoQuerySortDirection,\r\n PreparedQuery,\r\n QueryMatcher,\r\n RxDocument,\r\n RxDocumentData,\r\n RxJsonSchema,\r\n RxQuery\r\n} from './types/index.d.ts';\r\nimport {\r\n clone,\r\n firstPropertyNameOfObject,\r\n toArray,\r\n isMaybeReadonlyArray,\r\n objectPathMonad,\r\n ObjectPathMonadFunction\r\n} from './plugins/utils/index.ts';\r\nimport {\r\n compare as mingoSortComparator\r\n} from 'mingo/util';\r\nimport { newRxError } from './rx-error.ts';\r\nimport { getMingoQuery } from './rx-query-mingo.ts';\r\n\r\n/**\r\n * Normalize the query to ensure we have all fields set\r\n * and queries that represent the same query logic are detected as equal by the caching.\r\n */\r\nexport function normalizeMangoQuery<RxDocType>(\r\n schema: RxJsonSchema<RxDocumentData<RxDocType>>,\r\n mangoQuery: MangoQuery<RxDocType>,\r\n /**\r\n * @performance\r\n * Count queries do not need sort order.\r\n * Skipping the sort computation avoids iterating over schema indexes\r\n * and comparing fields, which improves count query performance.\r\n */\r\n skipSort?: boolean\r\n): FilledMangoQuery<RxDocType> {\r\n const primaryKey: string = getPrimaryFieldOfPrimaryKey(schema.primaryKey);\r\n\r\n const normalizedMangoQuery: FilledMangoQuery<RxDocType> = clone(mangoQuery) as any;\r\n if (typeof normalizedMangoQuery.skip !== 'number') {\r\n normalizedMangoQuery.skip = 0;\r\n }\r\n\r\n if (!normalizedMangoQuery.selector) {\r\n normalizedMangoQuery.selector = {};\r\n } else {\r\n normalizedMangoQuery.selector = normalizedMangoQuery.selector;\r\n /**\r\n * In mango query, it is possible to have an\r\n * equals comparison by directly assigning a value\r\n * to a property, without the '$eq' operator.\r\n * Like:\r\n * selector: {\r\n * foo: 'bar'\r\n * }\r\n * For normalization, we have to normalize this\r\n * so our checks can perform properly.\r\n *\r\n *\r\n * TODO this must work recursive with nested queries that\r\n * contain multiple selectors via $and or $or etc.\r\n */\r\n Object\r\n .entries(normalizedMangoQuery.selector)\r\n .forEach(([field, matcher]) => {\r\n if (typeof matcher !== 'object' || matcher === null) {\r\n (normalizedMangoQuery as any).selector[field] = {\r\n $eq: matcher\r\n };\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Ensure that if an index is specified,\r\n * the primaryKey is inside of it.\r\n */\r\n if (normalizedMangoQuery.index) {\r\n const indexAr = toArray(normalizedMangoQuery.index);\r\n if (!indexAr.includes(primaryKey)) {\r\n indexAr.push(primaryKey);\r\n }\r\n normalizedMangoQuery.index = indexAr;\r\n }\r\n\r\n /**\r\n * To ensure a deterministic sorting,\r\n * we have to ensure the primary key is always part\r\n * of the sort query.\r\n * Primary sorting is added as last sort parameter,\r\n * similar to how we add the primary key to indexes that do not have it.\r\n *\r\n */\r\n if (skipSort && !normalizedMangoQuery.sort) {\r\n /**\r\n * @performance\r\n * Count queries do not need sorted results.\r\n * Use a simple primary key sort to avoid the expensive\r\n * index-matching sort computation.\r\n */\r\n normalizedMangoQuery.sort = [{ [primaryKey]: 'asc' }] as any;\r\n } else if (!normalizedMangoQuery.sort) {\r\n /**\r\n * If no sort is given at all,\r\n * we can assume that the user does not care about sort order at al.\r\n *\r\n * we cannot just use the primary key as sort parameter\r\n * because it would likely cause the query to run over the primary key index\r\n * which has a bad performance in most cases.\r\n */\r\n if (normalizedMangoQuery.index) {\r\n normalizedMangoQuery.sort = normalizedMangoQuery.index.map((field: string) => {\r\n return { [field as any]: 'asc' } as any;\r\n });\r\n } else {\r\n /**\r\n * Find the index that best matches the fields with the logical operators\r\n */\r\n if (schema.indexes) {\r\n const fieldsWithLogicalOperator: Set<string> = new Set();\r\n Object.entries(normalizedMangoQuery.selector).forEach(([field, matcher]) => {\r\n let hasLogical;\r\n if (typeof matcher === 'object' && matcher !== null) {\r\n hasLogical = !!Object.keys(matcher).find(operator => LOGICAL_OPERATORS.has(operator));\r\n } else {\r\n hasLogical = true;\r\n }\r\n if (hasLogical) {\r\n fieldsWithLogicalOperator.add(field);\r\n }\r\n });\r\n\r\n\r\n let currentFieldsAmount = -1;\r\n let currentBestIndexForSort: string[] | readonly string[] | undefined;\r\n schema.indexes.forEach(index => {\r\n const useIndex = isMaybeReadonlyArray(index) ? index : [index];\r\n const firstWrongIndex = useIndex.findIndex(indexField => !fieldsWithLogicalOperator.has(indexField));\r\n if (\r\n firstWrongIndex > 0 &&\r\n firstWrongIndex > currentFieldsAmount\r\n ) {\r\n currentFieldsAmount = firstWrongIndex;\r\n currentBestIndexForSort = useIndex;\r\n }\r\n });\r\n if (currentBestIndexForSort) {\r\n normalizedMangoQuery.sort = currentBestIndexForSort.map((field: string) => {\r\n return { [field as any]: 'asc' } as any;\r\n });\r\n }\r\n\r\n }\r\n\r\n /**\r\n * If no good index was found as default sort-order,\r\n * just use the first index of the schema.\r\n * If no index is in the schema, use the default-index which\r\n * is created by RxDB ONLY if there is no other index defined.\r\n */\r\n if (!normalizedMangoQuery.sort) {\r\n if (schema.indexes && schema.indexes.length > 0) {\r\n const firstIndex = schema.indexes[0];\r\n const useIndex = isMaybeReadonlyArray(firstIndex) ? firstIndex : [firstIndex];\r\n normalizedMangoQuery.sort = useIndex.map(field => ({ [field]: 'asc' })) as any;\r\n } else {\r\n normalizedMangoQuery.sort = [{ [primaryKey]: 'asc' }] as any;\r\n }\r\n }\r\n }\r\n } else {\r\n const isPrimaryInSort = normalizedMangoQuery.sort\r\n .find(p => firstPropertyNameOfObject(p) === primaryKey);\r\n if (!isPrimaryInSort) {\r\n normalizedMangoQuery.sort = normalizedMangoQuery.sort.slice(0);\r\n normalizedMangoQuery.sort.push({ [primaryKey]: 'asc' } as any);\r\n }\r\n }\r\n\r\n return normalizedMangoQuery;\r\n}\r\n\r\n/**\r\n * Returns the sort-comparator,\r\n * which is able to sort documents in the same way\r\n * a query over the db would do.\r\n */\r\nexport function getSortComparator<RxDocType>(\r\n schema: RxJsonSchema<RxDocumentData<RxDocType>>,\r\n query: FilledMangoQuery<RxDocType>\r\n): DeterministicSortComparator<RxDocType> {\r\n if (!query.sort) {\r\n throw newRxError('SNH', { query });\r\n }\r\n const sortParts: {\r\n key: string;\r\n direction: MangoQuerySortDirection;\r\n getValueFn: ObjectPathMonadFunction<RxDocType>;\r\n }[] = [];\r\n query.sort.forEach(sortBlock => {\r\n const key = Object.keys(sortBlock)[0];\r\n const direction = Object.values(sortBlock)[0];\r\n sortParts.push({\r\n key,\r\n direction,\r\n getValueFn: objectPathMonad(key)\r\n });\r\n });\r\n const fun: DeterministicSortComparator<RxDocType> = (a: RxDocType, b: RxDocType) => {\r\n for (let i = 0; i < sortParts.length; ++i) {\r\n const sortPart = sortParts[i];\r\n const valueA = sortPart.getValueFn(a);\r\n const valueB = sortPart.getValueFn(b);\r\n if (valueA !== valueB) {\r\n /**\r\n * @performance\r\n * Use a fast inline comparison for common types (string, number)\r\n * instead of the more general mingoSortComparator.\r\n * Mingo's compare does extra type checks that are unnecessary\r\n * when both values share the same primitive type.\r\n */\r\n const dirMultiplier = sortPart.direction === 'asc' ? 1 : -1;\r\n const typeA = typeof valueA;\r\n if (typeA === typeof valueB && (typeA === 'string' || typeA === 'number')) {\r\n return ((valueA < valueB ? -1 : 1) * dirMultiplier) as any;\r\n }\r\n const ret = sortPart.direction === 'asc' ? mingoSortComparator(valueA, valueB) : mingoSortComparator(valueB, valueA);\r\n return ret as any;\r\n }\r\n }\r\n };\r\n\r\n return fun;\r\n}\r\n\r\n\r\n/**\r\n * Returns a function\r\n * that can be used to check if a document\r\n * matches the query.\r\n */\r\nexport function getQueryMatcher<RxDocType>(\r\n _schema: RxJsonSchema<RxDocType> | RxJsonSchema<RxDocumentData<RxDocType>>,\r\n query: FilledMangoQuery<RxDocType>\r\n): QueryMatcher<RxDocumentData<RxDocType>> {\r\n if (!query.sort) {\r\n throw newRxError('SNH', { query });\r\n }\r\n\r\n const mingoQuery = getMingoQuery(query.selector as any);\r\n const fun: QueryMatcher<RxDocumentData<RxDocType>> = (doc: RxDocumentData<RxDocType> | DeepReadonly<RxDocumentData<RxDocType>>) => {\r\n return mingoQuery.test(doc);\r\n };\r\n return fun;\r\n}\r\n\r\n\r\nexport async function runQueryUpdateFunction<RxDocType, RxQueryResult>(\r\n rxQuery: RxQuery<RxDocType, RxQueryResult>,\r\n fn: (doc: RxDocument<RxDocType>) => Promise<RxDocument<RxDocType>>\r\n): Promise<RxQueryResult> {\r\n const docs = await rxQuery.exec();\r\n if (!docs) {\r\n // only findOne() queries can return null\r\n return null as any;\r\n }\r\n if (Array.isArray(docs)) {\r\n return Promise.all(\r\n docs.map(doc => fn(doc))\r\n ) as any;\r\n } else if (docs instanceof Map) {\r\n return Promise.all(\r\n [...docs.values()].map((doc) => fn(doc))\r\n ) as any;\r\n } else {\r\n // via findOne()\r\n const result = await fn(docs as any);\r\n return result as any;\r\n }\r\n}\r\n\r\n/**\r\n * @returns a format of the query that can be used with the storage\r\n * when calling RxStorageInstance().query()\r\n */\r\nexport function prepareQuery<RxDocType>(\r\n schema: RxJsonSchema<RxDocumentData<RxDocType>>,\r\n mutateableQuery: FilledMangoQuery<RxDocType>\r\n): PreparedQuery<RxDocType> {\r\n if (!mutateableQuery.sort) {\r\n throw newRxError('SNH', {\r\n query: mutateableQuery\r\n });\r\n }\r\n\r\n /**\r\n * Store the query plan together with the\r\n * prepared query to save performance.\r\n */\r\n const queryPlan = getQueryPlan(\r\n schema,\r\n mutateableQuery\r\n );\r\n\r\n return {\r\n query: mutateableQuery,\r\n queryPlan\r\n };\r\n}\r\n"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,YAAY,QAAQ,oBAAoB;AACpE,SAASC,2BAA2B,QAAQ,uBAAuB;AAcnE,SACIC,KAAK,EACLC,yBAAyB,EACzBC,OAAO,EACPC,oBAAoB,EACpBC,eAAe,QAEZ,0BAA0B;AACjC,SACIC,OAAO,IAAIC,mBAAmB,QAC3B,YAAY;AACnB,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,aAAa,QAAQ,qBAAqB;;AAEnD;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAC/BC,MAA+C,EAC/CC,UAAiC;AACjC;AACJ;AACA;AACA;AACA;AACA;AACIC,QAAkB,EACS;EAC3B,IAAMC,UAAkB,GAAGd,2BAA2B,CAACW,MAAM,CAACG,UAAU,CAAC;EAEzE,IAAMC,oBAAiD,GAAGd,KAAK,CAACW,UAAU,CAAQ;EAClF,IAAI,OAAOG,oBAAoB,CAACC,IAAI,KAAK,QAAQ,EAAE;IAC/CD,oBAAoB,CAACC,IAAI,GAAG,CAAC;EACjC;EAEA,IAAI,CAACD,oBAAoB,CAACE,QAAQ,EAAE;IAChCF,oBAAoB,CAACE,QAAQ,GAAG,CAAC,CAAC;EACtC,CAAC,MAAM;IACHF,oBAAoB,CAACE,QAAQ,GAAGF,oBAAoB,CAACE,QAAQ;IAC7D;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACQC,MAAM,CACDC,OAAO,CAACJ,oBAAoB,CAACE,QAAQ,CAAC,CACtCG,OAAO,CAAC,CAAC,CAACC,KAAK,EAAEC,OAAO,CAAC,KAAK;MAC3B,IAAI,OAAOA,OAAO,KAAK,QAAQ,IAAIA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;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Context } from 'mingo/core';
|
|
2
|
+
import { Query } from 'mingo/query';
|
|
3
|
+
import { $project, $sort } from 'mingo/operators/pipeline';
|
|
4
|
+
import 'mingo/operators/expression';
|
|
5
|
+
import 'mingo/operators/projection';
|
|
6
|
+
import { $elemMatch, $eq, $nor, $exists, $regex, $ne, $gte, $lt, $lte, $nin, $in, $gt, $or, $and, $not, $type, $size, $mod } from 'mingo/operators/query';
|
|
7
|
+
import 'mingo/operators/query/evaluation';
|
|
8
|
+
import 'mingo/operators/query/array';
|
|
9
|
+
import 'mingo/operators/query/element';
|
|
10
|
+
var mingoInitDone = false;
|
|
11
|
+
var context;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The MongoDB query library is huge and we do not need all the operators.
|
|
15
|
+
* If you add an operator here, make sure that you properly add a test in
|
|
16
|
+
* the file /test/unit/rx-storage-query-correctness.test.ts
|
|
17
|
+
*
|
|
18
|
+
* @link https://github.com/kofrasa/mingo#es6
|
|
19
|
+
*/
|
|
20
|
+
export function getMingoQuery(selector) {
|
|
21
|
+
if (!mingoInitDone) {
|
|
22
|
+
context = Context.init({
|
|
23
|
+
pipeline: {
|
|
24
|
+
$sort,
|
|
25
|
+
$project
|
|
26
|
+
},
|
|
27
|
+
query: {
|
|
28
|
+
$elemMatch,
|
|
29
|
+
$eq,
|
|
30
|
+
$nor,
|
|
31
|
+
$exists,
|
|
32
|
+
$regex,
|
|
33
|
+
$and,
|
|
34
|
+
$gt,
|
|
35
|
+
$gte,
|
|
36
|
+
$in,
|
|
37
|
+
$lt,
|
|
38
|
+
$lte,
|
|
39
|
+
$ne,
|
|
40
|
+
$nin,
|
|
41
|
+
$mod,
|
|
42
|
+
$not,
|
|
43
|
+
$or,
|
|
44
|
+
$size,
|
|
45
|
+
$type
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
mingoInitDone = true;
|
|
49
|
+
}
|
|
50
|
+
return new Query(selector, {
|
|
51
|
+
context
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=rx-query-mingo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rx-query-mingo.js","names":["Context","Query","$project","$sort","$elemMatch","$eq","$nor","$exists","$regex","$ne","$gte","$lt","$lte","$nin","$in","$gt","$or","$and","$not","$type","$size","$mod","mingoInitDone","context","getMingoQuery","selector","init","pipeline","query"],"sources":["../../src/rx-query-mingo.ts"],"sourcesContent":["import { Context } from 'mingo/core';\r\nimport { Query } from 'mingo/query';\r\nimport type { MangoQuerySelector } from './types/index.d.ts';\r\nimport {\r\n $project,\r\n $sort\r\n} from 'mingo/operators/pipeline';\r\nimport {\r\n\r\n} from 'mingo/operators/expression';\r\nimport {\r\n} from 'mingo/operators/projection';\r\nimport {\r\n $elemMatch,\r\n $eq,\r\n $nor,\r\n $exists,\r\n $regex,\r\n $ne,\r\n $gte,\r\n $lt,\r\n $lte,\r\n $nin,\r\n $in,\r\n $gt,\r\n $or,\r\n $and,\r\n $not,\r\n $type,\r\n $size,\r\n $mod\r\n} from 'mingo/operators/query';\r\nimport {\r\n} from 'mingo/operators/query/evaluation';\r\nimport {\r\n} from 'mingo/operators/query/array';\r\nimport {\r\n} from 'mingo/operators/query/element';\r\n\r\nlet mingoInitDone = false;\r\nlet context: Context;\r\n\r\n\r\n/**\r\n * The MongoDB query library is huge and we do not need all the operators.\r\n * If you add an operator here, make sure that you properly add a test in\r\n * the file /test/unit/rx-storage-query-correctness.test.ts\r\n *\r\n * @link https://github.com/kofrasa/mingo#es6\r\n */\r\nexport function getMingoQuery<RxDocType>(\r\n selector?: MangoQuerySelector<RxDocType>\r\n) {\r\n if (!mingoInitDone) {\r\n context = Context.init({\r\n pipeline: {\r\n $sort,\r\n $project\r\n },\r\n query: {\r\n $elemMatch,\r\n $eq,\r\n $nor,\r\n $exists,\r\n $regex,\r\n $and,\r\n $gt,\r\n $gte,\r\n $in,\r\n $lt,\r\n $lte,\r\n $ne,\r\n $nin,\r\n $mod,\r\n $not,\r\n $or,\r\n $size,\r\n $type,\r\n },\r\n });\r\n mingoInitDone = true;\r\n }\r\n\r\n return new Query(selector as any, {\r\n context\r\n });\r\n}\r\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,KAAK,QAAQ,aAAa;AAEnC,SACIC,QAAQ,EACRC,KAAK,QACF,0BAA0B;AACjC,OAEO,4BAA4B;AACnC,OACO,4BAA4B;AACnC,SACIC,UAAU,EACVC,GAAG,EACHC,IAAI,EACJC,OAAO,EACPC,MAAM,EACNC,GAAG,EACHC,IAAI,EACJC,GAAG,EACHC,IAAI,EACJC,IAAI,EACJC,GAAG,EACHC,GAAG,EACHC,GAAG,EACHC,IAAI,EACJC,IAAI,EACJC,KAAK,EACLC,KAAK,EACLC,IAAI,QACD,uBAAuB;AAC9B,OACO,kCAAkC;AACzC,OACO,6BAA6B;AACpC,OACO,+BAA+B;AAEtC,IAAIC,aAAa,GAAG,KAAK;AACzB,IAAIC,OAAgB;;AAGpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CACzBC,QAAwC,EAC1C;EACE,IAAI,CAACH,aAAa,EAAE;IAChBC,OAAO,GAAGvB,OAAO,CAAC0B,IAAI,CAAC;MACnBC,QAAQ,EAAE;QACNxB,KAAK;QACLD;MACJ,CAAC;MACD0B,KAAK,EAAE;QACHxB,UAAU;QACVC,GAAG;QACHC,IAAI;QACJC,OAAO;QACPC,MAAM;QACNS,IAAI;QACJF,GAAG;QACHL,IAAI;QACJI,GAAG;QACHH,GAAG;QACHC,IAAI;QACJH,GAAG;QACHI,IAAI;QACJQ,IAAI;QACJH,IAAI;QACJF,GAAG;QACHI,KAAK;QACLD;MACJ;IACJ,CAAC,CAAC;IACFG,aAAa,GAAG,IAAI;EACxB;EAEA,OAAO,IAAIrB,KAAK,CAACwB,QAAQ,EAAS;IAC9BF;EACJ,CAAC,CAAC;AACN","ignoreList":[]}
|