@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,392 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RxDBcrdtPlugin = exports.RX_CRDT_CONTEXT = void 0;
|
|
7
|
+
exports.getCRDTConflictHandler = getCRDTConflictHandler;
|
|
8
|
+
exports.getCRDTSchemaPart = getCRDTSchemaPart;
|
|
9
|
+
exports.hashCRDTOperations = hashCRDTOperations;
|
|
10
|
+
exports.insertCRDT = insertCRDT;
|
|
11
|
+
exports.mergeCRDTFields = mergeCRDTFields;
|
|
12
|
+
exports.rebuildFromCRDT = rebuildFromCRDT;
|
|
13
|
+
exports.sortOperationComparator = sortOperationComparator;
|
|
14
|
+
exports.updateCRDT = updateCRDT;
|
|
15
|
+
var _rxError = require("../../rx-error.js");
|
|
16
|
+
var _index = require("../../plugins/utils/index.js");
|
|
17
|
+
var _index2 = require("../../index.js");
|
|
18
|
+
var _mingoUpdater = require("../update/mingo-updater.js");
|
|
19
|
+
async function updateCRDT(entry) {
|
|
20
|
+
entry = _index2.overwritable.deepFreezeWhenDevMode(entry);
|
|
21
|
+
var jsonSchema = this.collection.schema.jsonSchema;
|
|
22
|
+
if (!jsonSchema.crdt) {
|
|
23
|
+
throw (0, _rxError.newRxError)('CRDT1', {
|
|
24
|
+
schema: jsonSchema,
|
|
25
|
+
queryObj: entry
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
var crdtOptions = (0, _index.ensureNotFalsy)(jsonSchema.crdt);
|
|
29
|
+
var storageToken = await this.collection.database.storageToken;
|
|
30
|
+
return this.incrementalModify(async docData => {
|
|
31
|
+
var crdtDocField = (0, _index.clone)((0, _index.getProperty)(docData, crdtOptions.field));
|
|
32
|
+
var operation = {
|
|
33
|
+
body: (0, _index.toArray)(entry),
|
|
34
|
+
creator: storageToken,
|
|
35
|
+
time: (0, _index.now)()
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A new write will ALWAYS be an operation in the last
|
|
40
|
+
* array which was non existing before.
|
|
41
|
+
*/
|
|
42
|
+
var lastAr = [operation];
|
|
43
|
+
crdtDocField.operations.push(lastAr);
|
|
44
|
+
crdtDocField.hash = await hashCRDTOperations(this.collection.database.hashFunction, crdtDocField);
|
|
45
|
+
docData = runOperationOnDocument(this.collection.schema.jsonSchema, docData, operation);
|
|
46
|
+
(0, _index.setProperty)(docData, crdtOptions.field, crdtDocField);
|
|
47
|
+
return docData;
|
|
48
|
+
}, RX_CRDT_CONTEXT);
|
|
49
|
+
}
|
|
50
|
+
async function insertCRDT(entry) {
|
|
51
|
+
entry = _index2.overwritable.deepFreezeWhenDevMode(entry);
|
|
52
|
+
var jsonSchema = this.schema.jsonSchema;
|
|
53
|
+
if (!jsonSchema.crdt) {
|
|
54
|
+
throw (0, _rxError.newRxError)('CRDT1', {
|
|
55
|
+
schema: jsonSchema,
|
|
56
|
+
queryObj: entry
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
var crdtOptions = (0, _index.ensureNotFalsy)(jsonSchema.crdt);
|
|
60
|
+
var storageToken = await this.database.storageToken;
|
|
61
|
+
var operation = {
|
|
62
|
+
body: Array.isArray(entry) ? entry : [entry],
|
|
63
|
+
creator: storageToken,
|
|
64
|
+
time: (0, _index.now)()
|
|
65
|
+
};
|
|
66
|
+
var insertData = {};
|
|
67
|
+
insertData = runOperationOnDocument(this.schema.jsonSchema, insertData, operation);
|
|
68
|
+
var crdtDocField = {
|
|
69
|
+
operations: [],
|
|
70
|
+
hash: ''
|
|
71
|
+
};
|
|
72
|
+
(0, _index.setProperty)(insertData, crdtOptions.field, crdtDocField);
|
|
73
|
+
var lastAr = [operation];
|
|
74
|
+
crdtDocField.operations.push(lastAr);
|
|
75
|
+
crdtDocField.hash = await hashCRDTOperations(this.database.hashFunction, crdtDocField);
|
|
76
|
+
var result = await this.insert(insertData).catch(async err => {
|
|
77
|
+
if (err.code === 'CONFLICT') {
|
|
78
|
+
// was a conflict, update document instead of inserting
|
|
79
|
+
var doc = await this.findOne(err.parameters.id).exec(true);
|
|
80
|
+
return doc.updateCRDT(entry);
|
|
81
|
+
} else {
|
|
82
|
+
throw err;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
function sortOperationComparator(a, b) {
|
|
88
|
+
return a.creator > b.creator ? 1 : -1;
|
|
89
|
+
}
|
|
90
|
+
function runOperationOnDocument(schema, docData, operation) {
|
|
91
|
+
var entryParts = operation.body;
|
|
92
|
+
entryParts.forEach(entryPart => {
|
|
93
|
+
var isMatching;
|
|
94
|
+
if (entryPart.selector) {
|
|
95
|
+
var query = {
|
|
96
|
+
selector: (0, _index.ensureNotFalsy)(entryPart.selector),
|
|
97
|
+
sort: [],
|
|
98
|
+
skip: 0
|
|
99
|
+
};
|
|
100
|
+
var matcher = (0, _index2.getQueryMatcher)(schema, query);
|
|
101
|
+
isMatching = matcher(docData);
|
|
102
|
+
} else {
|
|
103
|
+
isMatching = true;
|
|
104
|
+
}
|
|
105
|
+
if (isMatching) {
|
|
106
|
+
if (entryPart.ifMatch) {
|
|
107
|
+
docData = (0, _mingoUpdater.mingoUpdater)(docData, entryPart.ifMatch);
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
if (entryPart.ifNotMatch) {
|
|
111
|
+
docData = (0, _mingoUpdater.mingoUpdater)(docData, entryPart.ifNotMatch);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return docData;
|
|
116
|
+
}
|
|
117
|
+
async function hashCRDTOperations(hashFunction, crdts) {
|
|
118
|
+
var hashObj = crdts.operations.map(operations => {
|
|
119
|
+
return operations.map(op => op.creator);
|
|
120
|
+
});
|
|
121
|
+
var hash = await hashFunction(JSON.stringify(hashObj));
|
|
122
|
+
return hash;
|
|
123
|
+
}
|
|
124
|
+
function getCRDTSchemaPart() {
|
|
125
|
+
var operationSchema = {
|
|
126
|
+
type: 'object',
|
|
127
|
+
properties: {
|
|
128
|
+
body: {
|
|
129
|
+
type: 'array',
|
|
130
|
+
items: {
|
|
131
|
+
type: 'object',
|
|
132
|
+
properties: {
|
|
133
|
+
selector: {
|
|
134
|
+
type: 'object'
|
|
135
|
+
},
|
|
136
|
+
ifMatch: {
|
|
137
|
+
type: 'object'
|
|
138
|
+
},
|
|
139
|
+
ifNotMatch: {
|
|
140
|
+
type: 'object'
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
additionalProperties: false
|
|
144
|
+
},
|
|
145
|
+
minItems: 1
|
|
146
|
+
},
|
|
147
|
+
creator: {
|
|
148
|
+
type: 'string'
|
|
149
|
+
},
|
|
150
|
+
time: {
|
|
151
|
+
type: 'number',
|
|
152
|
+
minimum: 1,
|
|
153
|
+
maximum: _index2.META_LWT_UNIX_TIME_MAX,
|
|
154
|
+
multipleOf: 0.01
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
additionalProperties: false,
|
|
158
|
+
required: ['body', 'creator', 'time']
|
|
159
|
+
};
|
|
160
|
+
return {
|
|
161
|
+
type: 'object',
|
|
162
|
+
properties: {
|
|
163
|
+
operations: {
|
|
164
|
+
type: 'array',
|
|
165
|
+
items: {
|
|
166
|
+
type: 'array',
|
|
167
|
+
items: operationSchema
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
hash: {
|
|
171
|
+
type: 'string',
|
|
172
|
+
// set a minLength to not accidentally store an empty string
|
|
173
|
+
minLength: 2
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
additionalProperties: false,
|
|
177
|
+
required: ['operations', 'hash']
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
async function mergeCRDTFields(hashFunction, crdtsA, crdtsB) {
|
|
181
|
+
// the value with most operations must be A to
|
|
182
|
+
// ensure we not miss out rows when iterating over both fields.
|
|
183
|
+
if (crdtsA.operations.length < crdtsB.operations.length) {
|
|
184
|
+
[crdtsA, crdtsB] = [crdtsB, crdtsA];
|
|
185
|
+
}
|
|
186
|
+
var ret = {
|
|
187
|
+
operations: [],
|
|
188
|
+
hash: ''
|
|
189
|
+
};
|
|
190
|
+
crdtsA.operations.forEach((row, index) => {
|
|
191
|
+
var mergedOps = [];
|
|
192
|
+
var ids = new Set(); // used to deduplicate
|
|
193
|
+
|
|
194
|
+
row.forEach(op => {
|
|
195
|
+
ids.add(op.creator);
|
|
196
|
+
mergedOps.push(op);
|
|
197
|
+
});
|
|
198
|
+
if (crdtsB.operations[index]) {
|
|
199
|
+
crdtsB.operations[index].forEach(op => {
|
|
200
|
+
if (!ids.has(op.creator)) {
|
|
201
|
+
mergedOps.push(op);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
mergedOps = mergedOps.sort(sortOperationComparator);
|
|
206
|
+
ret.operations[index] = mergedOps;
|
|
207
|
+
});
|
|
208
|
+
ret.hash = await hashCRDTOperations(hashFunction, ret);
|
|
209
|
+
return ret;
|
|
210
|
+
}
|
|
211
|
+
function rebuildFromCRDT(schema, docData, crdts) {
|
|
212
|
+
var base = {
|
|
213
|
+
_deleted: false
|
|
214
|
+
};
|
|
215
|
+
(0, _index.setProperty)(base, (0, _index.ensureNotFalsy)(schema.crdt).field, crdts);
|
|
216
|
+
crdts.operations.forEach(operations => {
|
|
217
|
+
operations.forEach(op => {
|
|
218
|
+
base = runOperationOnDocument(schema, base, op);
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
return base;
|
|
222
|
+
}
|
|
223
|
+
function getCRDTConflictHandler(hashFunction, schema) {
|
|
224
|
+
var crdtOptions = (0, _index.ensureNotFalsy)(schema.crdt);
|
|
225
|
+
var crdtField = crdtOptions.field;
|
|
226
|
+
var getCRDTValue = (0, _index.objectPathMonad)(crdtField);
|
|
227
|
+
var conflictHandler = {
|
|
228
|
+
isEqual(a, b, ctx) {
|
|
229
|
+
return getCRDTValue(a).hash === getCRDTValue(b).hash;
|
|
230
|
+
},
|
|
231
|
+
async resolve(i) {
|
|
232
|
+
var newDocCrdt = getCRDTValue(i.newDocumentState);
|
|
233
|
+
var masterDocCrdt = getCRDTValue(i.realMasterState);
|
|
234
|
+
var mergedCrdt = await mergeCRDTFields(hashFunction, newDocCrdt, masterDocCrdt);
|
|
235
|
+
var mergedDoc = rebuildFromCRDT(schema, i.newDocumentState, mergedCrdt);
|
|
236
|
+
return mergedDoc;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
return conflictHandler;
|
|
240
|
+
}
|
|
241
|
+
var RX_CRDT_CONTEXT = exports.RX_CRDT_CONTEXT = 'rx-crdt';
|
|
242
|
+
var RxDBcrdtPlugin = exports.RxDBcrdtPlugin = {
|
|
243
|
+
name: 'crdt',
|
|
244
|
+
rxdb: true,
|
|
245
|
+
prototypes: {
|
|
246
|
+
RxDocument: proto => {
|
|
247
|
+
proto.updateCRDT = updateCRDT;
|
|
248
|
+
var oldRemove = proto.remove;
|
|
249
|
+
proto.remove = function () {
|
|
250
|
+
if (!this.collection.schema.jsonSchema.crdt) {
|
|
251
|
+
return oldRemove.bind(this)();
|
|
252
|
+
}
|
|
253
|
+
return this.updateCRDT({
|
|
254
|
+
ifMatch: {
|
|
255
|
+
$set: {
|
|
256
|
+
_deleted: true
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
var oldincrementalPatch = proto.incrementalPatch;
|
|
262
|
+
proto.incrementalPatch = function (patch) {
|
|
263
|
+
if (!this.collection.schema.jsonSchema.crdt) {
|
|
264
|
+
return oldincrementalPatch.bind(this)(patch);
|
|
265
|
+
}
|
|
266
|
+
return this.updateCRDT({
|
|
267
|
+
ifMatch: {
|
|
268
|
+
$set: patch
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
var oldincrementalModify = proto.incrementalModify;
|
|
273
|
+
proto.incrementalModify = function (fn, context) {
|
|
274
|
+
if (!this.collection.schema.jsonSchema.crdt) {
|
|
275
|
+
return oldincrementalModify.bind(this)(fn);
|
|
276
|
+
}
|
|
277
|
+
if (context === RX_CRDT_CONTEXT) {
|
|
278
|
+
return oldincrementalModify.bind(this)(fn);
|
|
279
|
+
} else {
|
|
280
|
+
throw (0, _rxError.newRxError)('CRDT2', {
|
|
281
|
+
id: this.primary,
|
|
282
|
+
args: {
|
|
283
|
+
context
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
},
|
|
289
|
+
RxCollection: proto => {
|
|
290
|
+
proto.insertCRDT = insertCRDT;
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
overwritable: {},
|
|
294
|
+
hooks: {
|
|
295
|
+
preCreateRxCollection: {
|
|
296
|
+
after: data => {
|
|
297
|
+
if (!data.schema.crdt) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
if (data.conflictHandler) {
|
|
301
|
+
throw (0, _rxError.newRxError)('CRDT3', {
|
|
302
|
+
collection: data.name,
|
|
303
|
+
schema: data.schema
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
data.conflictHandler = getCRDTConflictHandler(data.database.hashFunction, data.schema);
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
createRxCollection: {
|
|
310
|
+
after: ({
|
|
311
|
+
collection
|
|
312
|
+
}) => {
|
|
313
|
+
if (!collection.schema.jsonSchema.crdt) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
var crdtOptions = (0, _index.ensureNotFalsy)(collection.schema.jsonSchema.crdt);
|
|
317
|
+
var crdtField = crdtOptions.field;
|
|
318
|
+
var getCrdt = (0, _index.objectPathMonad)(crdtOptions.field);
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* In dev-mode we have to ensure that all document writes
|
|
322
|
+
* have the correct crdt state so that nothing is missed out
|
|
323
|
+
* or could accidentally do non-crdt writes to the document.
|
|
324
|
+
*/
|
|
325
|
+
if (_index2.overwritable.isDevMode()) {
|
|
326
|
+
var bulkWriteBefore = collection.storageInstance.bulkWrite.bind(collection.storageInstance);
|
|
327
|
+
collection.storageInstance.bulkWrite = async function (writes, context) {
|
|
328
|
+
await Promise.all(writes.map(async write => {
|
|
329
|
+
var newDocState = (0, _index.clone)(write.document);
|
|
330
|
+
var crdts = getCrdt(newDocState);
|
|
331
|
+
var rebuild = rebuildFromCRDT(collection.schema.jsonSchema, newDocState, crdts);
|
|
332
|
+
function docWithoutMeta(doc) {
|
|
333
|
+
var ret = {};
|
|
334
|
+
Object.entries(doc).forEach(([k, v]) => {
|
|
335
|
+
if (!k.startsWith('_') && typeof v !== 'undefined') {
|
|
336
|
+
ret[k] = v;
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
return ret;
|
|
340
|
+
}
|
|
341
|
+
if (!(0, _index.deepEqual)(docWithoutMeta(newDocState), docWithoutMeta(rebuild))) {
|
|
342
|
+
throw (0, _rxError.newRxError)('SNH', {
|
|
343
|
+
document: newDocState
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
var recalculatedHash = await hashCRDTOperations(collection.database.hashFunction, crdts);
|
|
347
|
+
if (crdts.hash !== recalculatedHash) {
|
|
348
|
+
throw (0, _rxError.newRxError)('SNH', {
|
|
349
|
+
document: newDocState,
|
|
350
|
+
args: {
|
|
351
|
+
hash: crdts.hash,
|
|
352
|
+
recalculatedHash
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}));
|
|
357
|
+
return bulkWriteBefore(writes, context);
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
var bulkInsertBefore = collection.bulkInsert.bind(collection);
|
|
361
|
+
collection.bulkInsert = async function (docsData) {
|
|
362
|
+
var storageToken = await collection.database.storageToken;
|
|
363
|
+
var useDocsData = await Promise.all(docsData.map(async docData => {
|
|
364
|
+
var setMe = {};
|
|
365
|
+
Object.entries(docData).forEach(([key, value]) => {
|
|
366
|
+
if (!key.startsWith('_') && key !== crdtField) {
|
|
367
|
+
setMe[key] = value;
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
var crdtOperations = {
|
|
371
|
+
operations: [[{
|
|
372
|
+
creator: storageToken,
|
|
373
|
+
body: [{
|
|
374
|
+
ifMatch: {
|
|
375
|
+
$set: setMe
|
|
376
|
+
}
|
|
377
|
+
}],
|
|
378
|
+
time: (0, _index.now)()
|
|
379
|
+
}]],
|
|
380
|
+
hash: ''
|
|
381
|
+
};
|
|
382
|
+
crdtOperations.hash = await hashCRDTOperations(collection.database.hashFunction, crdtOperations);
|
|
383
|
+
(0, _index.setProperty)(docData, crdtOptions.field, crdtOperations);
|
|
384
|
+
return docData;
|
|
385
|
+
}));
|
|
386
|
+
return bulkInsertBefore(useDocsData);
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_rxError","require","_index","_index2","_mingoUpdater","updateCRDT","entry","overwritable","deepFreezeWhenDevMode","jsonSchema","collection","schema","crdt","newRxError","queryObj","crdtOptions","ensureNotFalsy","storageToken","database","incrementalModify","docData","crdtDocField","clone","getProperty","field","operation","body","toArray","creator","time","now","lastAr","operations","push","hash","hashCRDTOperations","hashFunction","runOperationOnDocument","setProperty","RX_CRDT_CONTEXT","insertCRDT","Array","isArray","insertData","result","insert","catch","err","code","doc","findOne","parameters","id","exec","sortOperationComparator","a","b","entryParts","forEach","entryPart","isMatching","selector","query","sort","skip","matcher","getQueryMatcher","ifMatch","mingoUpdater","ifNotMatch","crdts","hashObj","map","op","JSON","stringify","getCRDTSchemaPart","operationSchema","type","properties","items","additionalProperties","minItems","minimum","maximum","META_LWT_UNIX_TIME_MAX","multipleOf","required","minLength","mergeCRDTFields","crdtsA","crdtsB","length","ret","row","index","mergedOps","ids","Set","add","has","rebuildFromCRDT","base","_deleted","getCRDTConflictHandler","crdtField","getCRDTValue","objectPathMonad","conflictHandler","isEqual","ctx","resolve","i","newDocCrdt","newDocumentState","masterDocCrdt","realMasterState","mergedCrdt","mergedDoc","exports","RxDBcrdtPlugin","name","rxdb","prototypes","RxDocument","proto","oldRemove","remove","bind","$set","oldincrementalPatch","incrementalPatch","patch","oldincrementalModify","fn","context","primary","args","RxCollection","hooks","preCreateRxCollection","after","data","createRxCollection","getCrdt","isDevMode","bulkWriteBefore","storageInstance","bulkWrite","writes","Promise","all","write","newDocState","document","rebuild","docWithoutMeta","Object","entries","k","v","startsWith","deepEqual","recalculatedHash","bulkInsertBefore","bulkInsert","docsData","useDocsData","setMe","key","value","crdtOperations"],"sources":["../../../../src/plugins/crdt/index.ts"],"sourcesContent":["import { newRxError } from '../../rx-error.ts';\r\nimport type {\r\n CRDTDocumentField,\r\n CRDTEntry,\r\n CRDTOperation,\r\n FilledMangoQuery,\r\n HashFunction,\r\n JsonSchema,\r\n RxConflictHandler,\r\n RxConflictHandlerInput,\r\n RxDocument,\r\n RxDocumentData,\r\n RxJsonSchema,\r\n RxPlugin,\r\n WithDeleted\r\n} from '../../types/index.d.ts';\r\nimport {\r\n clone,\r\n deepEqual,\r\n ensureNotFalsy,\r\n getProperty,\r\n now,\r\n objectPathMonad,\r\n setProperty,\r\n toArray\r\n} from '../../plugins/utils/index.ts';\r\nimport {\r\n getQueryMatcher,\r\n META_LWT_UNIX_TIME_MAX,\r\n overwritable,\r\n RxCollection,\r\n RxDocumentWriteData,\r\n RxError\r\n} from '../../index.ts';\r\nimport { mingoUpdater } from '../update/mingo-updater.ts';\r\n\r\n\r\n\r\nexport async function updateCRDT<RxDocType>(\r\n this: RxDocument<RxDocType>,\r\n entry: CRDTEntry<RxDocType> | CRDTEntry<RxDocType>[]\r\n) {\r\n entry = overwritable.deepFreezeWhenDevMode(entry) as any;\r\n\r\n const jsonSchema = this.collection.schema.jsonSchema;\r\n if (!jsonSchema.crdt) {\r\n throw newRxError('CRDT1', {\r\n schema: jsonSchema,\r\n queryObj: entry\r\n });\r\n }\r\n const crdtOptions = ensureNotFalsy(jsonSchema.crdt);\r\n const storageToken = await this.collection.database.storageToken;\r\n\r\n return this.incrementalModify(async (docData) => {\r\n const crdtDocField: CRDTDocumentField<RxDocType> = clone(getProperty(docData as any, crdtOptions.field));\r\n const operation: CRDTOperation<RxDocType> = {\r\n body: toArray(entry),\r\n creator: storageToken,\r\n time: now()\r\n };\r\n\r\n /**\r\n * A new write will ALWAYS be an operation in the last\r\n * array which was non existing before.\r\n */\r\n const lastAr: CRDTOperation<RxDocType>[] = [operation];\r\n crdtDocField.operations.push(lastAr);\r\n crdtDocField.hash = await hashCRDTOperations(this.collection.database.hashFunction, crdtDocField);\r\n\r\n docData = runOperationOnDocument(\r\n this.collection.schema.jsonSchema,\r\n docData,\r\n operation\r\n );\r\n setProperty(docData, crdtOptions.field, crdtDocField);\r\n return docData;\r\n }, RX_CRDT_CONTEXT);\r\n}\r\n\r\n\r\nexport async function insertCRDT<RxDocType>(\r\n this: RxCollection<RxDocType>,\r\n entry: CRDTEntry<RxDocType> | CRDTEntry<RxDocType>[]\r\n) {\r\n entry = overwritable.deepFreezeWhenDevMode(entry) as any;\r\n\r\n const jsonSchema = this.schema.jsonSchema;\r\n if (!jsonSchema.crdt) {\r\n throw newRxError('CRDT1', {\r\n schema: jsonSchema,\r\n queryObj: entry\r\n });\r\n }\r\n const crdtOptions = ensureNotFalsy(jsonSchema.crdt);\r\n const storageToken = await this.database.storageToken;\r\n const operation: CRDTOperation<RxDocType> = {\r\n body: Array.isArray(entry) ? entry : [entry],\r\n creator: storageToken,\r\n time: now()\r\n };\r\n\r\n let insertData: RxDocumentWriteData<RxDocType> = {} as any;\r\n insertData = runOperationOnDocument(\r\n this.schema.jsonSchema,\r\n insertData as any,\r\n operation\r\n ) as any;\r\n const crdtDocField: CRDTDocumentField<RxDocType> = {\r\n operations: [],\r\n hash: ''\r\n };\r\n setProperty(insertData as any, crdtOptions.field, crdtDocField);\r\n\r\n const lastAr: CRDTOperation<RxDocType>[] = [operation];\r\n crdtDocField.operations.push(lastAr);\r\n crdtDocField.hash = await hashCRDTOperations(this.database.hashFunction, crdtDocField);\r\n\r\n const result = await this.insert(insertData).catch(async (err: RxError) => {\r\n if (err.code === 'CONFLICT') {\r\n // was a conflict, update document instead of inserting\r\n const doc = await this.findOne(err.parameters.id).exec(true);\r\n return doc.updateCRDT(entry);\r\n } else {\r\n throw err;\r\n }\r\n });\r\n return result;\r\n}\r\n\r\n\r\nexport function sortOperationComparator<RxDocType>(a: CRDTOperation<RxDocType>, b: CRDTOperation<RxDocType>) {\r\n return a.creator > b.creator ? 1 : -1;\r\n}\r\n\r\n\r\nfunction runOperationOnDocument<RxDocType>(\r\n schema: RxJsonSchema<RxDocumentData<RxDocType>>,\r\n docData: WithDeleted<RxDocType>,\r\n operation: CRDTOperation<RxDocType>\r\n): WithDeleted<RxDocType> {\r\n const entryParts = operation.body;\r\n entryParts.forEach(entryPart => {\r\n let isMatching: boolean;\r\n if (entryPart.selector) {\r\n const query: FilledMangoQuery<RxDocType> = {\r\n selector: ensureNotFalsy(entryPart.selector as any),\r\n sort: [],\r\n skip: 0\r\n };\r\n const matcher = getQueryMatcher(schema, query);\r\n isMatching = matcher(docData as any);\r\n } else {\r\n isMatching = true;\r\n }\r\n if (isMatching) {\r\n if (entryPart.ifMatch) {\r\n docData = mingoUpdater<WithDeleted<RxDocType>>(docData, entryPart.ifMatch);\r\n }\r\n } else {\r\n if (entryPart.ifNotMatch) {\r\n docData = mingoUpdater<WithDeleted<RxDocType>>(docData, entryPart.ifNotMatch);\r\n }\r\n }\r\n });\r\n return docData;\r\n}\r\n\r\nexport async function hashCRDTOperations(\r\n hashFunction: HashFunction,\r\n crdts: CRDTDocumentField<any>\r\n): Promise<string> {\r\n const hashObj = crdts.operations.map((operations) => {\r\n return operations.map(op => op.creator);\r\n });\r\n const hash = await hashFunction(JSON.stringify(hashObj));\r\n return hash;\r\n}\r\n\r\nexport function getCRDTSchemaPart<RxDocType>(): JsonSchema<CRDTDocumentField<RxDocType>> {\r\n const operationSchema: JsonSchema<CRDTOperation<RxDocType>> = {\r\n type: 'object',\r\n properties: {\r\n body: {\r\n type: 'array',\r\n items: {\r\n type: 'object',\r\n properties: {\r\n selector: {\r\n type: 'object'\r\n },\r\n ifMatch: {\r\n type: 'object'\r\n },\r\n ifNotMatch: {\r\n type: 'object'\r\n }\r\n },\r\n additionalProperties: false\r\n },\r\n minItems: 1\r\n },\r\n creator: {\r\n type: 'string'\r\n },\r\n time: {\r\n type: 'number',\r\n minimum: 1,\r\n maximum: META_LWT_UNIX_TIME_MAX,\r\n multipleOf: 0.01\r\n }\r\n },\r\n additionalProperties: false,\r\n required: [\r\n 'body',\r\n 'creator',\r\n 'time'\r\n ]\r\n };\r\n return {\r\n type: 'object',\r\n properties: {\r\n operations: {\r\n type: 'array',\r\n items: {\r\n type: 'array',\r\n items: operationSchema\r\n }\r\n },\r\n hash: {\r\n type: 'string',\r\n // set a minLength to not accidentally store an empty string\r\n minLength: 2\r\n }\r\n },\r\n additionalProperties: false,\r\n required: ['operations', 'hash']\r\n };\r\n}\r\n\r\n\r\nexport async function mergeCRDTFields<RxDocType>(\r\n hashFunction: HashFunction,\r\n crdtsA: CRDTDocumentField<RxDocType>,\r\n crdtsB: CRDTDocumentField<RxDocType>\r\n): Promise<CRDTDocumentField<RxDocType>> {\r\n\r\n // the value with most operations must be A to\r\n // ensure we not miss out rows when iterating over both fields.\r\n if (crdtsA.operations.length < crdtsB.operations.length) {\r\n [crdtsA, crdtsB] = [crdtsB, crdtsA];\r\n }\r\n\r\n const ret: CRDTDocumentField<RxDocType> = {\r\n operations: [],\r\n hash: ''\r\n };\r\n crdtsA.operations.forEach((row, index) => {\r\n let mergedOps: CRDTOperation<RxDocType>[] = [];\r\n const ids = new Set<string>(); // used to deduplicate\r\n\r\n row.forEach(op => {\r\n ids.add(op.creator);\r\n mergedOps.push(op);\r\n });\r\n if (crdtsB.operations[index]) {\r\n crdtsB.operations[index].forEach(op => {\r\n if (!ids.has(op.creator)) {\r\n mergedOps.push(op);\r\n }\r\n });\r\n }\r\n mergedOps = mergedOps.sort(sortOperationComparator);\r\n ret.operations[index] = mergedOps;\r\n });\r\n\r\n\r\n ret.hash = await hashCRDTOperations(hashFunction, ret);\r\n return ret;\r\n}\r\n\r\nexport function rebuildFromCRDT<RxDocType>(\r\n schema: RxJsonSchema<RxDocumentData<RxDocType>>,\r\n docData: WithDeleted<RxDocType> | RxDocType,\r\n crdts: CRDTDocumentField<RxDocType>\r\n): WithDeleted<RxDocType> {\r\n let base: WithDeleted<RxDocType> = {\r\n _deleted: false\r\n } as any;\r\n setProperty(base, ensureNotFalsy(schema.crdt).field, crdts);\r\n crdts.operations.forEach(operations => {\r\n operations.forEach(op => {\r\n base = runOperationOnDocument(\r\n schema,\r\n base,\r\n op\r\n );\r\n });\r\n });\r\n return base;\r\n}\r\n\r\n\r\nexport function getCRDTConflictHandler<RxDocType>(\r\n hashFunction: HashFunction,\r\n schema: RxJsonSchema<RxDocumentData<RxDocType>>\r\n): RxConflictHandler<RxDocType> {\r\n const crdtOptions = ensureNotFalsy(schema.crdt);\r\n const crdtField = crdtOptions.field;\r\n const getCRDTValue = objectPathMonad<WithDeleted<RxDocType> | RxDocType, CRDTDocumentField<RxDocType>>(crdtField);\r\n\r\n const conflictHandler: RxConflictHandler<RxDocType> = {\r\n isEqual(a, b, ctx) {\r\n return getCRDTValue(a).hash === getCRDTValue(b).hash;\r\n },\r\n async resolve(i) {\r\n const newDocCrdt = getCRDTValue(i.newDocumentState);\r\n const masterDocCrdt = getCRDTValue(i.realMasterState);\r\n const mergedCrdt = await mergeCRDTFields(hashFunction, newDocCrdt, masterDocCrdt);\r\n const mergedDoc = rebuildFromCRDT(\r\n schema,\r\n i.newDocumentState,\r\n mergedCrdt\r\n );\r\n return mergedDoc;\r\n }\r\n }\r\n return conflictHandler;\r\n}\r\n\r\n\r\nexport const RX_CRDT_CONTEXT = 'rx-crdt';\r\n\r\nexport const RxDBcrdtPlugin: RxPlugin = {\r\n name: 'crdt',\r\n rxdb: true,\r\n prototypes: {\r\n RxDocument: (proto: any) => {\r\n proto.updateCRDT = updateCRDT;\r\n\r\n const oldRemove = proto.remove;\r\n proto.remove = function (this: RxDocument) {\r\n if (!this.collection.schema.jsonSchema.crdt) {\r\n return oldRemove.bind(this)();\r\n }\r\n return this.updateCRDT({\r\n ifMatch: {\r\n $set: {\r\n _deleted: true\r\n }\r\n }\r\n });\r\n };\r\n\r\n const oldincrementalPatch = proto.incrementalPatch;\r\n proto.incrementalPatch = function (this: RxDocument, patch: any) {\r\n if (!this.collection.schema.jsonSchema.crdt) {\r\n return oldincrementalPatch.bind(this)(patch);\r\n }\r\n return this.updateCRDT({\r\n ifMatch: {\r\n $set: patch\r\n }\r\n });\r\n };\r\n const oldincrementalModify = proto.incrementalModify;\r\n proto.incrementalModify = function (fn: any, context: string) {\r\n if (!this.collection.schema.jsonSchema.crdt) {\r\n return oldincrementalModify.bind(this)(fn);\r\n }\r\n if (context === RX_CRDT_CONTEXT) {\r\n return oldincrementalModify.bind(this)(fn);\r\n } else {\r\n throw newRxError('CRDT2', {\r\n id: this.primary,\r\n args: { context }\r\n });\r\n }\r\n };\r\n },\r\n RxCollection: (proto: any) => {\r\n proto.insertCRDT = insertCRDT;\r\n }\r\n },\r\n overwritable: {},\r\n hooks: {\r\n preCreateRxCollection: {\r\n after: (data) => {\r\n if (!data.schema.crdt) {\r\n return;\r\n }\r\n if (data.conflictHandler) {\r\n throw newRxError('CRDT3', {\r\n collection: data.name,\r\n schema: data.schema\r\n });\r\n }\r\n data.conflictHandler = getCRDTConflictHandler(\r\n data.database.hashFunction,\r\n data.schema\r\n );\r\n }\r\n },\r\n createRxCollection: {\r\n after: ({ collection }) => {\r\n if (!collection.schema.jsonSchema.crdt) {\r\n return;\r\n }\r\n\r\n const crdtOptions = ensureNotFalsy(collection.schema.jsonSchema.crdt);\r\n const crdtField = crdtOptions.field;\r\n const getCrdt = objectPathMonad<any, CRDTDocumentField<any>>(crdtOptions.field);\r\n\r\n /**\r\n * In dev-mode we have to ensure that all document writes\r\n * have the correct crdt state so that nothing is missed out\r\n * or could accidentally do non-crdt writes to the document.\r\n */\r\n if (overwritable.isDevMode()) {\r\n const bulkWriteBefore = collection.storageInstance.bulkWrite.bind(collection.storageInstance);\r\n collection.storageInstance.bulkWrite = async function (writes, context) {\r\n\r\n await Promise.all(\r\n writes.map(async (write) => {\r\n const newDocState: typeof write.document = clone(write.document);\r\n const crdts = getCrdt(newDocState);\r\n\r\n const rebuild = rebuildFromCRDT(\r\n collection.schema.jsonSchema,\r\n newDocState,\r\n crdts\r\n );\r\n\r\n function docWithoutMeta(doc: any) {\r\n const ret: any = {};\r\n Object.entries(doc).forEach(([k, v]) => {\r\n if (\r\n !k.startsWith('_') &&\r\n typeof v !== 'undefined'\r\n ) {\r\n ret[k] = v;\r\n }\r\n });\r\n return ret;\r\n }\r\n if (!deepEqual(docWithoutMeta(newDocState), docWithoutMeta(rebuild))) {\r\n throw newRxError('SNH', {\r\n document: newDocState\r\n });\r\n }\r\n const recalculatedHash = await hashCRDTOperations(collection.database.hashFunction, crdts);\r\n if (crdts.hash !== recalculatedHash) {\r\n throw newRxError('SNH', {\r\n document: newDocState,\r\n args: { hash: crdts.hash, recalculatedHash }\r\n });\r\n }\r\n })\r\n );\r\n\r\n return bulkWriteBefore(writes, context);\r\n };\r\n }\r\n\r\n\r\n const bulkInsertBefore = collection.bulkInsert.bind(collection);\r\n collection.bulkInsert = async function (docsData: any[]) {\r\n const storageToken = await collection.database.storageToken;\r\n const useDocsData = await Promise.all(\r\n docsData.map(async (docData) => {\r\n const setMe: Partial<RxDocumentData<any>> = {};\r\n Object.entries(docData).forEach(([key, value]) => {\r\n if (\r\n !key.startsWith('_') &&\r\n key !== crdtField\r\n ) {\r\n setMe[key] = value;\r\n }\r\n });\r\n\r\n const crdtOperations: CRDTDocumentField<any> = {\r\n operations: [\r\n [{\r\n creator: storageToken,\r\n body: [{\r\n ifMatch: {\r\n $set: setMe\r\n }\r\n }],\r\n time: now()\r\n }]\r\n ],\r\n hash: ''\r\n };\r\n crdtOperations.hash = await hashCRDTOperations(collection.database.hashFunction, crdtOperations);\r\n setProperty(docData, crdtOptions.field, crdtOperations);\r\n return docData;\r\n })\r\n );\r\n return bulkInsertBefore(useDocsData);\r\n };\r\n }\r\n }\r\n }\r\n};\r\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAgBA,IAAAC,MAAA,GAAAD,OAAA;AAUA,IAAAE,OAAA,GAAAF,OAAA;AAQA,IAAAG,aAAA,GAAAH,OAAA;AAIO,eAAeI,UAAUA,CAE5BC,KAAoD,EACtD;EACEA,KAAK,GAAGC,oBAAY,CAACC,qBAAqB,CAACF,KAAK,CAAQ;EAExD,IAAMG,UAAU,GAAG,IAAI,CAACC,UAAU,CAACC,MAAM,CAACF,UAAU;EACpD,IAAI,CAACA,UAAU,CAACG,IAAI,EAAE;IAClB,MAAM,IAAAC,mBAAU,EAAC,OAAO,EAAE;MACtBF,MAAM,EAAEF,UAAU;MAClBK,QAAQ,EAAER;IACd,CAAC,CAAC;EACN;EACA,IAAMS,WAAW,GAAG,IAAAC,qBAAc,EAACP,UAAU,CAACG,IAAI,CAAC;EACnD,IAAMK,YAAY,GAAG,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X,YAAY;gBACrBS,IAAI,EAAE,CAAC;kBACHyC,OAAO,EAAE;oBACL8D,IAAI,EAAEuC;kBACV;gBACJ,CAAC,CAAC;gBACF3I,IAAI,EAAE,IAAAC,UAAG,EAAC;cACd,CAAC,CAAC,CACL;cACDI,IAAI,EAAE;YACV,CAAC;YACDyI,cAAc,CAACzI,IAAI,GAAG,MAAMC,kBAAkB,CAACzB,UAAU,CAACQ,QAAQ,CAACkB,YAAY,EAAEuI,cAAc,CAAC;YAChG,IAAArI,kBAAW,EAAClB,OAAO,EAAEL,WAAW,CAACS,KAAK,EAAEmJ,cAAc,CAAC;YACvD,OAAOvJ,OAAO;UAClB,CAAC,CACL,CAAC;UACD,OAAOgJ,gBAAgB,CAACG,WAAW,CAAC;QACxC,CAAC;MACL;IACJ;EACJ;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.checkWriteRows = checkWriteRows;
|
|
7
|
+
exports.containsDateInstance = containsDateInstance;
|
|
8
|
+
exports.ensurePrimaryKeyValid = ensurePrimaryKeyValid;
|
|
9
|
+
var _rxError = require("../../rx-error.js");
|
|
10
|
+
var _rxSchemaHelper = require("../../rx-schema-helper.js");
|
|
11
|
+
/**
|
|
12
|
+
* Strip Blob data from _attachments so that
|
|
13
|
+
* the structured-clone / JSON check does not fail on Blob objects.
|
|
14
|
+
*/
|
|
15
|
+
function stripBlobsFromAttachments(attachments) {
|
|
16
|
+
if (!attachments) {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
var ret = {};
|
|
20
|
+
for (var [key, val] of Object.entries(attachments)) {
|
|
21
|
+
var clone = Object.assign({}, val);
|
|
22
|
+
delete clone.data;
|
|
23
|
+
ret[key] = clone;
|
|
24
|
+
}
|
|
25
|
+
return ret;
|
|
26
|
+
}
|
|
27
|
+
function ensurePrimaryKeyValid(primaryKey, docData) {
|
|
28
|
+
if (!primaryKey) {
|
|
29
|
+
throw (0, _rxError.newRxError)('DOC20', {
|
|
30
|
+
primaryKey,
|
|
31
|
+
document: docData
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* This is required so that we can left-pad
|
|
37
|
+
* the primaryKey and we are still able to de-left-pad
|
|
38
|
+
* it to get again the original key.
|
|
39
|
+
*/
|
|
40
|
+
if (primaryKey !== primaryKey.trim()) {
|
|
41
|
+
throw (0, _rxError.newRxError)('DOC21', {
|
|
42
|
+
primaryKey,
|
|
43
|
+
document: docData
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (primaryKey.includes('\r') || primaryKey.includes('\n')) {
|
|
47
|
+
throw (0, _rxError.newRxError)('DOC22', {
|
|
48
|
+
primaryKey,
|
|
49
|
+
document: docData
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (primaryKey.includes('"')) {
|
|
53
|
+
throw (0, _rxError.newRxError)('DOC23', {
|
|
54
|
+
primaryKey,
|
|
55
|
+
document: docData
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Deeply checks if the object contains an
|
|
62
|
+
* instance of the JavaScript Date class.
|
|
63
|
+
* @recursive
|
|
64
|
+
*/
|
|
65
|
+
function containsDateInstance(obj) {
|
|
66
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
for (var key in obj) {
|
|
70
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
71
|
+
if (obj[key] instanceof Date) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
if (typeof obj[key] === 'object' && containsDateInstance(obj[key])) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
function checkWriteRows(storageInstance, rows) {
|
|
82
|
+
var primaryPath = (0, _rxSchemaHelper.getPrimaryFieldOfPrimaryKey)(storageInstance.schema.primaryKey);
|
|
83
|
+
var _loop = function (writeRow) {
|
|
84
|
+
// ensure that the primary key has not been changed
|
|
85
|
+
writeRow.document = (0, _rxSchemaHelper.fillPrimaryKey)(primaryPath, storageInstance.schema, writeRow.document);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Ensure that _meta fields have been merged
|
|
89
|
+
* and not replaced.
|
|
90
|
+
* This is important so that when one plugin A
|
|
91
|
+
* sets a _meta field and another plugin B does a write
|
|
92
|
+
* to the document, it must be ensured that the
|
|
93
|
+
* field of plugin A was not removed.
|
|
94
|
+
*/
|
|
95
|
+
if (writeRow.previous) {
|
|
96
|
+
Object.keys(writeRow.previous._meta).forEach(metaFieldName => {
|
|
97
|
+
if (!Object.prototype.hasOwnProperty.call(writeRow.document._meta, metaFieldName)) {
|
|
98
|
+
throw (0, _rxError.newRxError)('SNH', {
|
|
99
|
+
dataBefore: writeRow.previous,
|
|
100
|
+
dataAfter: writeRow.document,
|
|
101
|
+
args: {
|
|
102
|
+
metaFieldName
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Ensure it can be structured cloned.
|
|
111
|
+
*/
|
|
112
|
+
try {
|
|
113
|
+
/**
|
|
114
|
+
* Notice that structuredClone() is not available
|
|
115
|
+
* in ReactNative, so we test for JSON.stringify() instead
|
|
116
|
+
* @link https://github.com/pubkey/rxdb/issues/5046#issuecomment-1827374498
|
|
117
|
+
*/
|
|
118
|
+
if (typeof structuredClone === 'function') {
|
|
119
|
+
structuredClone(writeRow);
|
|
120
|
+
} else {
|
|
121
|
+
/**
|
|
122
|
+
* JSON.stringify cannot handle Blob objects,
|
|
123
|
+
* so we must strip them from _attachments before checking.
|
|
124
|
+
*/
|
|
125
|
+
var checkRow = Object.assign({}, writeRow, {
|
|
126
|
+
document: Object.assign({}, writeRow.document, {
|
|
127
|
+
_attachments: stripBlobsFromAttachments(writeRow.document._attachments)
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
if (writeRow.previous) {
|
|
131
|
+
checkRow.previous = Object.assign({}, writeRow.previous, {
|
|
132
|
+
_attachments: stripBlobsFromAttachments(writeRow.previous._attachments)
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
JSON.parse(JSON.stringify(checkRow));
|
|
136
|
+
}
|
|
137
|
+
} catch (err) {
|
|
138
|
+
throw (0, _rxError.newRxError)('DOC24', {
|
|
139
|
+
collection: storageInstance.collectionName,
|
|
140
|
+
document: writeRow.document
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Ensure it does not contain a Date() object
|
|
146
|
+
*/
|
|
147
|
+
if (containsDateInstance(writeRow.document)) {
|
|
148
|
+
throw (0, _rxError.newRxError)('DOC24', {
|
|
149
|
+
collection: storageInstance.collectionName,
|
|
150
|
+
document: writeRow.document
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
for (var writeRow of rows) {
|
|
155
|
+
_loop(writeRow);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=check-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-document.js","names":["_rxError","require","_rxSchemaHelper","stripBlobsFromAttachments","attachments","ret","key","val","Object","entries","clone","assign","data","ensurePrimaryKeyValid","primaryKey","docData","newRxError","document","trim","includes","containsDateInstance","obj","prototype","hasOwnProperty","call","Date","checkWriteRows","storageInstance","rows","primaryPath","getPrimaryFieldOfPrimaryKey","schema","_loop","writeRow","fillPrimaryKey","previous","keys","_meta","forEach","metaFieldName","dataBefore","dataAfter","args","structuredClone","checkRow","_attachments","JSON","parse","stringify","err","collection","collectionName"],"sources":["../../../../src/plugins/dev-mode/check-document.ts"],"sourcesContent":["import { newRxError } from '../../rx-error.ts';\r\nimport { fillPrimaryKey, getPrimaryFieldOfPrimaryKey } from '../../rx-schema-helper.ts';\r\nimport type { BulkWriteRow, RxDocumentData, RxStorageInstance } from '../../types/index.d.ts';\r\n\r\n/**\r\n * Strip Blob data from _attachments so that\r\n * the structured-clone / JSON check does not fail on Blob objects.\r\n */\r\nfunction stripBlobsFromAttachments(\r\n attachments: Record<string, any> | undefined\r\n): Record<string, any> {\r\n if (!attachments) {\r\n return {};\r\n }\r\n const ret: Record<string, any> = {};\r\n for (const [key, val] of Object.entries(attachments)) {\r\n const clone = Object.assign({}, val);\r\n delete clone.data;\r\n ret[key] = clone;\r\n }\r\n return ret;\r\n}\r\n\r\nexport function ensurePrimaryKeyValid(\r\n primaryKey: string,\r\n docData: RxDocumentData<any>\r\n) {\r\n if (!primaryKey) {\r\n throw newRxError('DOC20', {\r\n primaryKey,\r\n document: docData\r\n });\r\n }\r\n\r\n\r\n /**\r\n * This is required so that we can left-pad\r\n * the primaryKey and we are still able to de-left-pad\r\n * it to get again the original key.\r\n */\r\n if (\r\n primaryKey !== primaryKey.trim()\r\n ) {\r\n throw newRxError('DOC21', {\r\n primaryKey,\r\n document: docData\r\n });\r\n }\r\n if (\r\n primaryKey.includes('\\r') ||\r\n primaryKey.includes('\\n')\r\n ) {\r\n throw newRxError('DOC22', {\r\n primaryKey,\r\n document: docData\r\n });\r\n }\r\n if (\r\n primaryKey.includes('\"')\r\n ) {\r\n throw newRxError('DOC23', {\r\n primaryKey,\r\n document: docData\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Deeply checks if the object contains an\r\n * instance of the JavaScript Date class.\r\n * @recursive\r\n */\r\nexport function containsDateInstance(obj: any): boolean {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return false;\r\n }\r\n for (let key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n if (obj[key] instanceof Date) {\r\n return true;\r\n }\r\n if (typeof obj[key] === 'object' && containsDateInstance(obj[key])) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n\r\nexport function checkWriteRows<RxDocType>(\r\n storageInstance: RxStorageInstance<RxDocType, any, any, any>,\r\n rows: BulkWriteRow<RxDocType>[]\r\n) {\r\n const primaryPath = getPrimaryFieldOfPrimaryKey(storageInstance.schema.primaryKey);\r\n for (const writeRow of rows) {\r\n // ensure that the primary key has not been changed\r\n writeRow.document = fillPrimaryKey(\r\n primaryPath,\r\n storageInstance.schema,\r\n writeRow.document\r\n );\r\n\r\n\r\n\r\n /**\r\n * Ensure that _meta fields have been merged\r\n * and not replaced.\r\n * This is important so that when one plugin A\r\n * sets a _meta field and another plugin B does a write\r\n * to the document, it must be ensured that the\r\n * field of plugin A was not removed.\r\n */\r\n if (writeRow.previous) {\r\n Object.keys(writeRow.previous._meta)\r\n .forEach(metaFieldName => {\r\n if (!Object.prototype.hasOwnProperty.call(writeRow.document._meta, metaFieldName)) {\r\n throw newRxError('SNH', {\r\n dataBefore: writeRow.previous,\r\n dataAfter: writeRow.document,\r\n args: {\r\n metaFieldName\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Ensure it can be structured cloned.\r\n */\r\n try {\r\n /**\r\n * Notice that structuredClone() is not available\r\n * in ReactNative, so we test for JSON.stringify() instead\r\n * @link https://github.com/pubkey/rxdb/issues/5046#issuecomment-1827374498\r\n */\r\n if (typeof structuredClone === 'function') {\r\n structuredClone(writeRow);\r\n } else {\r\n /**\r\n * JSON.stringify cannot handle Blob objects,\r\n * so we must strip them from _attachments before checking.\r\n */\r\n const checkRow = Object.assign({}, writeRow, {\r\n document: Object.assign({}, writeRow.document, {\r\n _attachments: stripBlobsFromAttachments(writeRow.document._attachments)\r\n })\r\n });\r\n if (writeRow.previous) {\r\n checkRow.previous = Object.assign({}, writeRow.previous, {\r\n _attachments: stripBlobsFromAttachments(writeRow.previous._attachments)\r\n });\r\n }\r\n JSON.parse(JSON.stringify(checkRow));\r\n }\r\n } catch (err) {\r\n throw newRxError('DOC24', {\r\n collection: storageInstance.collectionName,\r\n document: writeRow.document\r\n });\r\n }\r\n\r\n\r\n /**\r\n * Ensure it does not contain a Date() object\r\n */\r\n if (containsDateInstance(writeRow.document)) {\r\n throw newRxError('DOC24', {\r\n collection: storageInstance.collectionName,\r\n document: writeRow.document\r\n });\r\n }\r\n }\r\n\r\n}\r\n"],"mappings":";;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAGA;AACA;AACA;AACA;AACA,SAASE,yBAAyBA,CAC9BC,WAA4C,EACzB;EACnB,IAAI,CAACA,WAAW,EAAE;IACd,OAAO,CAAC,CAAC;EACb;EACA,IAAMC,GAAwB,GAAG,CAAC,CAAC;EACnC,KAAK,IAAM,CAACC,GAAG,EAAEC,GAAG,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,WAAW,CAAC,EAAE;IAClD,IAAMM,KAAK,GAAGF,MAAM,CAACG,MAAM,CAAC,CAAC,CAAC,EAAEJ,GAAG,CAAC;IACpC,OAAOG,KAAK,CAACE,IAAI;IACjBP,GAAG,CAACC,GAAG,CAAC,GAAGI,KAAK;EACpB;EACA,OAAOL,GAAG;AACd;AAEO,SAASQ,qBAAqBA,CACjCC,UAAkB,EAClBC,OAA4B,EAC9B;EACE,IAAI,CAACD,UAAU,EAAE;IACb,MAAM,IAAAE,mBAAU,EAAC,OAAO,EAAE;MACtBF,UAAU;MACVG,QAAQ,EAAEF;IACd,CAAC,CAAC;EACN;;EAGA;AACJ;AACA;AACA;AACA;EACI,IACID,UAAU,KAAKA,UAAU,CAACI,IAAI,CAAC,CAAC,EAClC;IACE,MAAM,IAAAF,mBAAU,EAAC,OAAO,EAAE;MACtBF,UAAU;MACVG,QAAQ,EAAEF;IACd,CAAC,CAAC;EACN;EACA,IACID,UAAU,CAACK,QAAQ,CAAC,IAAI,CAAC,I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