@connecttomahdi/rxdb 17.0.0-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +54 -0
- package/CHANGELOG.md +2469 -0
- package/CLAUDE.md +63 -0
- package/LICENSE.txt +201 -0
- package/README.md +263 -0
- package/babel.config.js +58 -0
- package/dist/cjs/change-event-buffer.js +146 -0
- package/dist/cjs/change-event-buffer.js.map +1 -0
- package/dist/cjs/custom-index.js +284 -0
- package/dist/cjs/custom-index.js.map +1 -0
- package/dist/cjs/doc-cache.js +231 -0
- package/dist/cjs/doc-cache.js.map +1 -0
- package/dist/cjs/event-reduce.js +102 -0
- package/dist/cjs/event-reduce.js.map +1 -0
- package/dist/cjs/hooks.js +131 -0
- package/dist/cjs/hooks.js.map +1 -0
- package/dist/cjs/incremental-write.js +169 -0
- package/dist/cjs/incremental-write.js.map +1 -0
- package/dist/cjs/index.js +270 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/overwritable.js +39 -0
- package/dist/cjs/overwritable.js.map +1 -0
- package/dist/cjs/plugin-helpers.js +223 -0
- package/dist/cjs/plugin-helpers.js.map +1 -0
- package/dist/cjs/plugin.js +94 -0
- package/dist/cjs/plugin.js.map +1 -0
- package/dist/cjs/plugins/attachments/attachments-utils.js +49 -0
- package/dist/cjs/plugins/attachments/attachments-utils.js.map +1 -0
- package/dist/cjs/plugins/attachments/index.js +237 -0
- package/dist/cjs/plugins/attachments/index.js.map +1 -0
- package/dist/cjs/plugins/attachments-compression/index.js +143 -0
- package/dist/cjs/plugins/attachments-compression/index.js.map +1 -0
- package/dist/cjs/plugins/backup/file-util.js +102 -0
- package/dist/cjs/plugins/backup/file-util.js.map +1 -0
- package/dist/cjs/plugins/backup/index.js +206 -0
- package/dist/cjs/plugins/backup/index.js.map +1 -0
- package/dist/cjs/plugins/cleanup/cleanup-helper.js +17 -0
- package/dist/cjs/plugins/cleanup/cleanup-helper.js.map +1 -0
- package/dist/cjs/plugins/cleanup/cleanup-state.js +83 -0
- package/dist/cjs/plugins/cleanup/cleanup-state.js.map +1 -0
- package/dist/cjs/plugins/cleanup/cleanup.js +116 -0
- package/dist/cjs/plugins/cleanup/cleanup.js.map +1 -0
- package/dist/cjs/plugins/cleanup/index.js +64 -0
- package/dist/cjs/plugins/cleanup/index.js.map +1 -0
- package/dist/cjs/plugins/crdt/index.js +392 -0
- package/dist/cjs/plugins/crdt/index.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/check-document.js +158 -0
- package/dist/cjs/plugins/dev-mode/check-document.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/check-migration-strategies.js +43 -0
- package/dist/cjs/plugins/dev-mode/check-migration-strategies.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/check-orm.js +53 -0
- package/dist/cjs/plugins/dev-mode/check-orm.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/check-query.js +183 -0
- package/dist/cjs/plugins/dev-mode/check-query.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/check-schema.js +487 -0
- package/dist/cjs/plugins/dev-mode/check-schema.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/dev-mode-tracking.js +93 -0
- package/dist/cjs/plugins/dev-mode/dev-mode-tracking.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/entity-properties.js +56 -0
- package/dist/cjs/plugins/dev-mode/entity-properties.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/error-messages.js +1295 -0
- package/dist/cjs/plugins/dev-mode/error-messages.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/index.js +195 -0
- package/dist/cjs/plugins/dev-mode/index.js.map +1 -0
- package/dist/cjs/plugins/dev-mode/unallowed-properties.js +88 -0
- package/dist/cjs/plugins/dev-mode/unallowed-properties.js.map +1 -0
- package/dist/cjs/plugins/electron/electron-helper.js +9 -0
- package/dist/cjs/plugins/electron/electron-helper.js.map +1 -0
- package/dist/cjs/plugins/electron/index.js +39 -0
- package/dist/cjs/plugins/electron/index.js.map +1 -0
- package/dist/cjs/plugins/electron/rx-storage-ipc-main.js +45 -0
- package/dist/cjs/plugins/electron/rx-storage-ipc-main.js.map +1 -0
- package/dist/cjs/plugins/electron/rx-storage-ipc-renderer.js +37 -0
- package/dist/cjs/plugins/electron/rx-storage-ipc-renderer.js.map +1 -0
- package/dist/cjs/plugins/encryption-crypto-js/index.js +165 -0
- package/dist/cjs/plugins/encryption-crypto-js/index.js.map +1 -0
- package/dist/cjs/plugins/flutter/index.js +62 -0
- package/dist/cjs/plugins/flutter/index.js.map +1 -0
- package/dist/cjs/plugins/json-dump/index.js +94 -0
- package/dist/cjs/plugins/json-dump/index.js.map +1 -0
- package/dist/cjs/plugins/key-compression/index.js +136 -0
- package/dist/cjs/plugins/key-compression/index.js.map +1 -0
- package/dist/cjs/plugins/leader-election/index.js +107 -0
- package/dist/cjs/plugins/leader-election/index.js.map +1 -0
- package/dist/cjs/plugins/local-documents/index.js +109 -0
- package/dist/cjs/plugins/local-documents/index.js.map +1 -0
- package/dist/cjs/plugins/local-documents/local-documents-helper.js +78 -0
- package/dist/cjs/plugins/local-documents/local-documents-helper.js.map +1 -0
- package/dist/cjs/plugins/local-documents/local-documents.js +107 -0
- package/dist/cjs/plugins/local-documents/local-documents.js.map +1 -0
- package/dist/cjs/plugins/local-documents/rx-local-document.js +257 -0
- package/dist/cjs/plugins/local-documents/rx-local-document.js.map +1 -0
- package/dist/cjs/plugins/migration-schema/index.js +84 -0
- package/dist/cjs/plugins/migration-schema/index.js.map +1 -0
- package/dist/cjs/plugins/migration-schema/migration-helpers.js +116 -0
- package/dist/cjs/plugins/migration-schema/migration-helpers.js.map +1 -0
- package/dist/cjs/plugins/migration-schema/migration-types.js +2 -0
- package/dist/cjs/plugins/migration-schema/migration-types.js.map +1 -0
- package/dist/cjs/plugins/migration-schema/rx-migration-state.js +410 -0
- package/dist/cjs/plugins/migration-schema/rx-migration-state.js.map +1 -0
- package/dist/cjs/plugins/migration-storage/index.js +173 -0
- package/dist/cjs/plugins/migration-storage/index.js.map +1 -0
- package/dist/cjs/plugins/pipeline/flagged-functions.js +129 -0
- package/dist/cjs/plugins/pipeline/flagged-functions.js.map +1 -0
- package/dist/cjs/plugins/pipeline/index.js +43 -0
- package/dist/cjs/plugins/pipeline/index.js.map +1 -0
- package/dist/cjs/plugins/pipeline/rx-pipeline.js +219 -0
- package/dist/cjs/plugins/pipeline/rx-pipeline.js.map +1 -0
- package/dist/cjs/plugins/pipeline/types.js +2 -0
- package/dist/cjs/plugins/pipeline/types.js.map +1 -0
- package/dist/cjs/plugins/query-builder/index.js +70 -0
- package/dist/cjs/plugins/query-builder/index.js.map +1 -0
- package/dist/cjs/plugins/query-builder/mquery/mquery-utils.js +40 -0
- package/dist/cjs/plugins/query-builder/mquery/mquery-utils.js.map +1 -0
- package/dist/cjs/plugins/query-builder/mquery/nosql-query-builder.js +488 -0
- package/dist/cjs/plugins/query-builder/mquery/nosql-query-builder.js.map +1 -0
- package/dist/cjs/plugins/react/database-context.js +15 -0
- package/dist/cjs/plugins/react/database-context.js.map +1 -0
- package/dist/cjs/plugins/react/database-provider.js +41 -0
- package/dist/cjs/plugins/react/database-provider.js.map +1 -0
- package/dist/cjs/plugins/react/hooks/index.js +50 -0
- package/dist/cjs/plugins/react/hooks/index.js.map +1 -0
- package/dist/cjs/plugins/react/hooks/use-live-rx-query.js +27 -0
- package/dist/cjs/plugins/react/hooks/use-live-rx-query.js.map +1 -0
- package/dist/cjs/plugins/react/hooks/use-rx-collection.js +39 -0
- package/dist/cjs/plugins/react/hooks/use-rx-collection.js.map +1 -0
- package/dist/cjs/plugins/react/hooks/use-rx-database.js +24 -0
- package/dist/cjs/plugins/react/hooks/use-rx-database.js.map +1 -0
- package/dist/cjs/plugins/react/hooks/use-rx-query.js +99 -0
- package/dist/cjs/plugins/react/hooks/use-rx-query.js.map +1 -0
- package/dist/cjs/plugins/react/index.js +28 -0
- package/dist/cjs/plugins/react/index.js.map +1 -0
- package/dist/cjs/plugins/reactivity-angular/index.js +30 -0
- package/dist/cjs/plugins/reactivity-angular/index.js.map +1 -0
- package/dist/cjs/plugins/reactivity-preact-signals/index.js +67 -0
- package/dist/cjs/plugins/reactivity-preact-signals/index.js.map +1 -0
- package/dist/cjs/plugins/reactivity-vue/index.js +32 -0
- package/dist/cjs/plugins/reactivity-vue/index.js.map +1 -0
- package/dist/cjs/plugins/replication/index.js +487 -0
- package/dist/cjs/plugins/replication/index.js.map +1 -0
- package/dist/cjs/plugins/replication/replication-helper.js +97 -0
- package/dist/cjs/plugins/replication/replication-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-appwrite/appwrite-helpers.js +33 -0
- package/dist/cjs/plugins/replication-appwrite/appwrite-helpers.js.map +1 -0
- package/dist/cjs/plugins/replication-appwrite/appwrite-types.js +2 -0
- package/dist/cjs/plugins/replication-appwrite/appwrite-types.js.map +1 -0
- package/dist/cjs/plugins/replication-appwrite/index.js +176 -0
- package/dist/cjs/plugins/replication-appwrite/index.js.map +1 -0
- package/dist/cjs/plugins/replication-couchdb/couchdb-helper.js +77 -0
- package/dist/cjs/plugins/replication-couchdb/couchdb-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-couchdb/couchdb-types.js +2 -0
- package/dist/cjs/plugins/replication-couchdb/couchdb-types.js.map +1 -0
- package/dist/cjs/plugins/replication-couchdb/index.js +287 -0
- package/dist/cjs/plugins/replication-couchdb/index.js.map +1 -0
- package/dist/cjs/plugins/replication-firestore/firestore-helper.js +61 -0
- package/dist/cjs/plugins/replication-firestore/firestore-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-firestore/firestore-types.js +2 -0
- package/dist/cjs/plugins/replication-firestore/firestore-types.js.map +1 -0
- package/dist/cjs/plugins/replication-firestore/index.js +266 -0
- package/dist/cjs/plugins/replication-firestore/index.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/document-handling.js +150 -0
- package/dist/cjs/plugins/replication-google-drive/document-handling.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/downstream.js +73 -0
- package/dist/cjs/plugins/replication-google-drive/downstream.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/google-drive-helper.js +349 -0
- package/dist/cjs/plugins/replication-google-drive/google-drive-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/google-drive-types.js +2 -0
- package/dist/cjs/plugins/replication-google-drive/google-drive-types.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/index.js +233 -0
- package/dist/cjs/plugins/replication-google-drive/index.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/init.js +76 -0
- package/dist/cjs/plugins/replication-google-drive/init.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/multipart.js +74 -0
- package/dist/cjs/plugins/replication-google-drive/multipart.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/signaling.js +262 -0
- package/dist/cjs/plugins/replication-google-drive/signaling.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/transaction.js +134 -0
- package/dist/cjs/plugins/replication-google-drive/transaction.js.map +1 -0
- package/dist/cjs/plugins/replication-google-drive/upstream.js +182 -0
- package/dist/cjs/plugins/replication-google-drive/upstream.js.map +1 -0
- package/dist/cjs/plugins/replication-graphql/graphql-schema-from-rx-schema.js +235 -0
- package/dist/cjs/plugins/replication-graphql/graphql-schema-from-rx-schema.js.map +1 -0
- package/dist/cjs/plugins/replication-graphql/graphql-websocket.js +43 -0
- package/dist/cjs/plugins/replication-graphql/graphql-websocket.js.map +1 -0
- package/dist/cjs/plugins/replication-graphql/helper.js +29 -0
- package/dist/cjs/plugins/replication-graphql/helper.js.map +1 -0
- package/dist/cjs/plugins/replication-graphql/index.js +215 -0
- package/dist/cjs/plugins/replication-graphql/index.js.map +1 -0
- package/dist/cjs/plugins/replication-graphql/query-builder-from-rx-schema.js +141 -0
- package/dist/cjs/plugins/replication-graphql/query-builder-from-rx-schema.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/document-handling.js +187 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/document-handling.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/downstream.js +78 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/downstream.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/index.js +222 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/index.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/init.js +76 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/init.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js +273 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js +2 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/signaling.js +235 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/signaling.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/transaction.js +138 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/transaction.js.map +1 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/upstream.js +190 -0
- package/dist/cjs/plugins/replication-microsoft-onedrive/upstream.js.map +1 -0
- package/dist/cjs/plugins/replication-mongodb/index.js +229 -0
- package/dist/cjs/plugins/replication-mongodb/index.js.map +1 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-checkpoint.js +140 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-checkpoint.js.map +1 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-helper.js +53 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-types.js +2 -0
- package/dist/cjs/plugins/replication-mongodb/mongodb-types.js.map +1 -0
- package/dist/cjs/plugins/replication-nats/index.js +232 -0
- package/dist/cjs/plugins/replication-nats/index.js.map +1 -0
- package/dist/cjs/plugins/replication-nats/nats-helper.js +13 -0
- package/dist/cjs/plugins/replication-nats/nats-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-nats/nats-types.js +2 -0
- package/dist/cjs/plugins/replication-nats/nats-types.js.map +1 -0
- package/dist/cjs/plugins/replication-supabase/helper.js +42 -0
- package/dist/cjs/plugins/replication-supabase/helper.js.map +1 -0
- package/dist/cjs/plugins/replication-supabase/index.js +239 -0
- package/dist/cjs/plugins/replication-supabase/index.js.map +1 -0
- package/dist/cjs/plugins/replication-supabase/types.js +2 -0
- package/dist/cjs/plugins/replication-supabase/types.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-p2pcf.js +79 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-p2pcf.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-simple-peer.js +199 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-simple-peer.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-webtorrent.js +137 -0
- package/dist/cjs/plugins/replication-webrtc/connection-handler-webtorrent.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/index.js +260 -0
- package/dist/cjs/plugins/replication-webrtc/index.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/signaling-server.js +151 -0
- package/dist/cjs/plugins/replication-webrtc/signaling-server.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/webrtc-helper.js +32 -0
- package/dist/cjs/plugins/replication-webrtc/webrtc-helper.js.map +1 -0
- package/dist/cjs/plugins/replication-webrtc/webrtc-types.js +2 -0
- package/dist/cjs/plugins/replication-webrtc/webrtc-types.js.map +1 -0
- package/dist/cjs/plugins/replication-websocket/index.js +39 -0
- package/dist/cjs/plugins/replication-websocket/index.js.map +1 -0
- package/dist/cjs/plugins/replication-websocket/websocket-client.js +133 -0
- package/dist/cjs/plugins/replication-websocket/websocket-client.js.map +1 -0
- package/dist/cjs/plugins/replication-websocket/websocket-server.js +108 -0
- package/dist/cjs/plugins/replication-websocket/websocket-server.js.map +1 -0
- package/dist/cjs/plugins/replication-websocket/websocket-types.js +2 -0
- package/dist/cjs/plugins/replication-websocket/websocket-types.js.map +1 -0
- package/dist/cjs/plugins/state/helpers.js +81 -0
- package/dist/cjs/plugins/state/helpers.js.map +1 -0
- package/dist/cjs/plugins/state/index.js +42 -0
- package/dist/cjs/plugins/state/index.js.map +1 -0
- package/dist/cjs/plugins/state/rx-state.js +293 -0
- package/dist/cjs/plugins/state/rx-state.js.map +1 -0
- package/dist/cjs/plugins/state/types.js +2 -0
- package/dist/cjs/plugins/state/types.js.map +1 -0
- package/dist/cjs/plugins/storage-denokv/denokv-helper.js +49 -0
- package/dist/cjs/plugins/storage-denokv/denokv-helper.js.map +1 -0
- package/dist/cjs/plugins/storage-denokv/denokv-query.js +99 -0
- package/dist/cjs/plugins/storage-denokv/denokv-query.js.map +1 -0
- package/dist/cjs/plugins/storage-denokv/denokv-types.js +2 -0
- package/dist/cjs/plugins/storage-denokv/denokv-types.js.map +1 -0
- package/dist/cjs/plugins/storage-denokv/index.js +31 -0
- package/dist/cjs/plugins/storage-denokv/index.js.map +1 -0
- package/dist/cjs/plugins/storage-denokv/rx-storage-instance-denokv.js +332 -0
- package/dist/cjs/plugins/storage-denokv/rx-storage-instance-denokv.js.map +1 -0
- package/dist/cjs/plugins/storage-dexie/dexie-helper.js +259 -0
- package/dist/cjs/plugins/storage-dexie/dexie-helper.js.map +1 -0
- package/dist/cjs/plugins/storage-dexie/dexie-query.js +178 -0
- package/dist/cjs/plugins/storage-dexie/dexie-query.js.map +1 -0
- package/dist/cjs/plugins/storage-dexie/index.js +50 -0
- package/dist/cjs/plugins/storage-dexie/index.js.map +1 -0
- package/dist/cjs/plugins/storage-dexie/rx-storage-dexie.js +46 -0
- package/dist/cjs/plugins/storage-dexie/rx-storage-dexie.js.map +1 -0
- package/dist/cjs/plugins/storage-dexie/rx-storage-instance-dexie.js +229 -0
- package/dist/cjs/plugins/storage-dexie/rx-storage-instance-dexie.js.map +1 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-helpers.js +13 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-helpers.js.map +1 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-query.js +96 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-query.js.map +1 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-types.js +2 -0
- package/dist/cjs/plugins/storage-foundationdb/foundationdb-types.js.map +1 -0
- package/dist/cjs/plugins/storage-foundationdb/index.js +62 -0
- package/dist/cjs/plugins/storage-foundationdb/index.js.map +1 -0
- package/dist/cjs/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js +309 -0
- package/dist/cjs/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js.map +1 -0
- package/dist/cjs/plugins/storage-localstorage/index.js +45 -0
- package/dist/cjs/plugins/storage-localstorage/index.js.map +1 -0
- package/dist/cjs/plugins/storage-localstorage/localstorage-mock.js +38 -0
- package/dist/cjs/plugins/storage-localstorage/localstorage-mock.js.map +1 -0
- package/dist/cjs/plugins/storage-localstorage/rx-storage-instance-localstorage.js +443 -0
- package/dist/cjs/plugins/storage-localstorage/rx-storage-instance-localstorage.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/binary-search-bounds.js +113 -0
- package/dist/cjs/plugins/storage-memory/binary-search-bounds.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/index.js +91 -0
- package/dist/cjs/plugins/storage-memory/index.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/memory-helper.js +177 -0
- package/dist/cjs/plugins/storage-memory/memory-helper.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/memory-indexes.js +28 -0
- package/dist/cjs/plugins/storage-memory/memory-indexes.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/memory-types.js +2 -0
- package/dist/cjs/plugins/storage-memory/memory-types.js.map +1 -0
- package/dist/cjs/plugins/storage-memory/rx-storage-instance-memory.js +371 -0
- package/dist/cjs/plugins/storage-memory/rx-storage-instance-memory.js.map +1 -0
- package/dist/cjs/plugins/storage-mongodb/index.js +50 -0
- package/dist/cjs/plugins/storage-mongodb/index.js.map +1 -0
- package/dist/cjs/plugins/storage-mongodb/mongodb-helper.js +97 -0
- package/dist/cjs/plugins/storage-mongodb/mongodb-helper.js.map +1 -0
- package/dist/cjs/plugins/storage-mongodb/mongodb-types.js +2 -0
- package/dist/cjs/plugins/storage-mongodb/mongodb-types.js.map +1 -0
- package/dist/cjs/plugins/storage-mongodb/rx-storage-instance-mongodb.js +324 -0
- package/dist/cjs/plugins/storage-mongodb/rx-storage-instance-mongodb.js.map +1 -0
- package/dist/cjs/plugins/storage-mongodb/rx-storage-mongodb.js +29 -0
- package/dist/cjs/plugins/storage-mongodb/rx-storage-mongodb.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/index.js +61 -0
- package/dist/cjs/plugins/storage-remote/index.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/message-channel-cache.js +52 -0
- package/dist/cjs/plugins/storage-remote/message-channel-cache.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/remote.js +217 -0
- package/dist/cjs/plugins/storage-remote/remote.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/rx-storage-remote.js +199 -0
- package/dist/cjs/plugins/storage-remote/rx-storage-remote.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/storage-remote-helpers.js +25 -0
- package/dist/cjs/plugins/storage-remote/storage-remote-helpers.js.map +1 -0
- package/dist/cjs/plugins/storage-remote/storage-remote-types.js +2 -0
- package/dist/cjs/plugins/storage-remote/storage-remote-types.js.map +1 -0
- package/dist/cjs/plugins/storage-remote-websocket/index.js +183 -0
- package/dist/cjs/plugins/storage-remote-websocket/index.js.map +1 -0
- package/dist/cjs/plugins/storage-remote-websocket/types.js +2 -0
- package/dist/cjs/plugins/storage-remote-websocket/types.js.map +1 -0
- package/dist/cjs/plugins/storage-sqlite/index.js +84 -0
- package/dist/cjs/plugins/storage-sqlite/index.js.map +1 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-basics-helpers.js +530 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-basics-helpers.js.map +1 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-helpers.js +203 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-helpers.js.map +1 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-storage-instance.js +291 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-storage-instance.js.map +1 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-types.js +2 -0
- package/dist/cjs/plugins/storage-sqlite/sqlite-types.js.map +1 -0
- package/dist/cjs/plugins/test-utils/config.js +120 -0
- package/dist/cjs/plugins/test-utils/config.js.map +1 -0
- package/dist/cjs/plugins/test-utils/humans-collection.js +420 -0
- package/dist/cjs/plugins/test-utils/humans-collection.js.map +1 -0
- package/dist/cjs/plugins/test-utils/index.js +130 -0
- package/dist/cjs/plugins/test-utils/index.js.map +1 -0
- package/dist/cjs/plugins/test-utils/performance.js +275 -0
- package/dist/cjs/plugins/test-utils/performance.js.map +1 -0
- package/dist/cjs/plugins/test-utils/replication-base-test-suite.js +179 -0
- package/dist/cjs/plugins/test-utils/replication-base-test-suite.js.map +1 -0
- package/dist/cjs/plugins/test-utils/replication.js +54 -0
- package/dist/cjs/plugins/test-utils/replication.js.map +1 -0
- package/dist/cjs/plugins/test-utils/revisions.js +11 -0
- package/dist/cjs/plugins/test-utils/revisions.js.map +1 -0
- package/dist/cjs/plugins/test-utils/schema-objects.js +315 -0
- package/dist/cjs/plugins/test-utils/schema-objects.js.map +1 -0
- package/dist/cjs/plugins/test-utils/schemas.js +1254 -0
- package/dist/cjs/plugins/test-utils/schemas.js.map +1 -0
- package/dist/cjs/plugins/test-utils/test-util.js +72 -0
- package/dist/cjs/plugins/test-utils/test-util.js.map +1 -0
- package/dist/cjs/plugins/update/index.js +45 -0
- package/dist/cjs/plugins/update/index.js.map +1 -0
- package/dist/cjs/plugins/update/mingo-updater.js +20 -0
- package/dist/cjs/plugins/update/mingo-updater.js.map +1 -0
- package/dist/cjs/plugins/utils/index.js +226 -0
- package/dist/cjs/plugins/utils/index.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-array.js +150 -0
- package/dist/cjs/plugins/utils/utils-array.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-base64.js +57 -0
- package/dist/cjs/plugins/utils/utils-base64.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-blob.js +62 -0
- package/dist/cjs/plugins/utils/utils-blob.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-document.js +100 -0
- package/dist/cjs/plugins/utils/utils-document.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-error.js +42 -0
- package/dist/cjs/plugins/utils/utils-error.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-global.js +12 -0
- package/dist/cjs/plugins/utils/utils-global.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-hash.js +59 -0
- package/dist/cjs/plugins/utils/utils-hash.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-map.js +25 -0
- package/dist/cjs/plugins/utils/utils-map.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-number.js +16 -0
- package/dist/cjs/plugins/utils/utils-number.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-object-deep-equal.js +42 -0
- package/dist/cjs/plugins/utils/utils-object-deep-equal.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-object-dot-prop.js +306 -0
- package/dist/cjs/plugins/utils/utils-object-dot-prop.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-object.js +245 -0
- package/dist/cjs/plugins/utils/utils-object.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-other.js +69 -0
- package/dist/cjs/plugins/utils/utils-other.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-premium.js +37 -0
- package/dist/cjs/plugins/utils/utils-premium.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-promise.js +149 -0
- package/dist/cjs/plugins/utils/utils-promise.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-regex.js +9 -0
- package/dist/cjs/plugins/utils/utils-regex.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-revision.js +60 -0
- package/dist/cjs/plugins/utils/utils-revision.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-rxdb-version.js +11 -0
- package/dist/cjs/plugins/utils/utils-rxdb-version.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-rxdb-version.template.js +11 -0
- package/dist/cjs/plugins/utils/utils-rxdb-version.template.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-string.js +97 -0
- package/dist/cjs/plugins/utils/utils-string.js.map +1 -0
- package/dist/cjs/plugins/utils/utils-time.js +42 -0
- package/dist/cjs/plugins/utils/utils-time.js.map +1 -0
- package/dist/cjs/plugins/validate-ajv/index.js +53 -0
- package/dist/cjs/plugins/validate-ajv/index.js.map +1 -0
- package/dist/cjs/plugins/validate-is-my-json-valid/index.js +29 -0
- package/dist/cjs/plugins/validate-is-my-json-valid/index.js.map +1 -0
- package/dist/cjs/plugins/validate-z-schema/index.js +58 -0
- package/dist/cjs/plugins/validate-z-schema/index.js.map +1 -0
- package/dist/cjs/plugins/vector/helper.js +2 -0
- package/dist/cjs/plugins/vector/helper.js.map +1 -0
- package/dist/cjs/plugins/vector/index.js +17 -0
- package/dist/cjs/plugins/vector/index.js.map +1 -0
- package/dist/cjs/plugins/vector/types.js +2 -0
- package/dist/cjs/plugins/vector/types.js.map +1 -0
- package/dist/cjs/plugins/vector/vector-distance.js +38 -0
- package/dist/cjs/plugins/vector/vector-distance.js.map +1 -0
- package/dist/cjs/plugins/webmcp/index.js +28 -0
- package/dist/cjs/plugins/webmcp/index.js.map +1 -0
- package/dist/cjs/plugins/webmcp/nosql-query-schema.js +360 -0
- package/dist/cjs/plugins/webmcp/nosql-query-schema.js.map +1 -0
- package/dist/cjs/plugins/webmcp/webmcp.js +315 -0
- package/dist/cjs/plugins/webmcp/webmcp.js.map +1 -0
- package/dist/cjs/query-cache.js +110 -0
- package/dist/cjs/query-cache.js.map +1 -0
- package/dist/cjs/query-planner.js +307 -0
- package/dist/cjs/query-planner.js.map +1 -0
- package/dist/cjs/replication-protocol/checkpoint.js +103 -0
- package/dist/cjs/replication-protocol/checkpoint.js.map +1 -0
- package/dist/cjs/replication-protocol/conflicts.js +36 -0
- package/dist/cjs/replication-protocol/conflicts.js.map +1 -0
- package/dist/cjs/replication-protocol/default-conflict-handler.js +39 -0
- package/dist/cjs/replication-protocol/default-conflict-handler.js.map +1 -0
- package/dist/cjs/replication-protocol/downstream.js +339 -0
- package/dist/cjs/replication-protocol/downstream.js.map +1 -0
- package/dist/cjs/replication-protocol/helper.js +58 -0
- package/dist/cjs/replication-protocol/helper.js.map +1 -0
- package/dist/cjs/replication-protocol/index.js +314 -0
- package/dist/cjs/replication-protocol/index.js.map +1 -0
- package/dist/cjs/replication-protocol/meta-instance.js +130 -0
- package/dist/cjs/replication-protocol/meta-instance.js.map +1 -0
- package/dist/cjs/replication-protocol/upstream.js +384 -0
- package/dist/cjs/replication-protocol/upstream.js.map +1 -0
- package/dist/cjs/rx-change-event.js +112 -0
- package/dist/cjs/rx-change-event.js.map +1 -0
- package/dist/cjs/rx-collection-helper.js +205 -0
- package/dist/cjs/rx-collection-helper.js.map +1 -0
- package/dist/cjs/rx-collection.js +931 -0
- package/dist/cjs/rx-collection.js.map +1 -0
- package/dist/cjs/rx-database-internal-store.js +283 -0
- package/dist/cjs/rx-database-internal-store.js.map +1 -0
- package/dist/cjs/rx-database.js +682 -0
- package/dist/cjs/rx-database.js.map +1 -0
- package/dist/cjs/rx-document-prototype-merge.js +87 -0
- package/dist/cjs/rx-document-prototype-merge.js.map +1 -0
- package/dist/cjs/rx-document.js +404 -0
- package/dist/cjs/rx-document.js.map +1 -0
- package/dist/cjs/rx-error.js +167 -0
- package/dist/cjs/rx-error.js.map +1 -0
- package/dist/cjs/rx-query-helper.js +277 -0
- package/dist/cjs/rx-query-helper.js.map +1 -0
- package/dist/cjs/rx-query-mingo.js +60 -0
- package/dist/cjs/rx-query-mingo.js.map +1 -0
- package/dist/cjs/rx-query-single-result.js +105 -0
- package/dist/cjs/rx-query-single-result.js.map +1 -0
- package/dist/cjs/rx-query.js +703 -0
- package/dist/cjs/rx-query.js.map +1 -0
- package/dist/cjs/rx-schema-helper.js +333 -0
- package/dist/cjs/rx-schema-helper.js.map +1 -0
- package/dist/cjs/rx-schema.js +189 -0
- package/dist/cjs/rx-schema.js.map +1 -0
- package/dist/cjs/rx-storage-helper.js +808 -0
- package/dist/cjs/rx-storage-helper.js.map +1 -0
- package/dist/cjs/rx-storage-multiinstance.js +121 -0
- package/dist/cjs/rx-storage-multiinstance.js.map +1 -0
- package/dist/cjs/types/conflict-handling.d.js +2 -0
- package/dist/cjs/types/conflict-handling.d.js.map +1 -0
- package/dist/cjs/types/couchdb.d.js +2 -0
- package/dist/cjs/types/couchdb.d.js.map +1 -0
- package/dist/cjs/types/index.d.js +2 -0
- package/dist/cjs/types/index.d.js.map +1 -0
- package/dist/cjs/types/modules/index.d.js +2 -0
- package/dist/cjs/types/modules/index.d.js.map +1 -0
- package/dist/cjs/types/modules/mocha.parallel.d.js +2 -0
- package/dist/cjs/types/modules/mocha.parallel.d.js.map +1 -0
- package/dist/cjs/types/plugins/backup.d.js +2 -0
- package/dist/cjs/types/plugins/backup.d.js.map +1 -0
- package/dist/cjs/types/plugins/cleanup.d.js +2 -0
- package/dist/cjs/types/plugins/cleanup.d.js.map +1 -0
- package/dist/cjs/types/plugins/crdt.d.js +2 -0
- package/dist/cjs/types/plugins/crdt.d.js.map +1 -0
- package/dist/cjs/types/plugins/dexie.d.js +2 -0
- package/dist/cjs/types/plugins/dexie.d.js.map +1 -0
- package/dist/cjs/types/plugins/local-documents.d.js +2 -0
- package/dist/cjs/types/plugins/local-documents.d.js.map +1 -0
- package/dist/cjs/types/plugins/migration.d.js +2 -0
- package/dist/cjs/types/plugins/migration.d.js.map +1 -0
- package/dist/cjs/types/plugins/reactivity.d.js +2 -0
- package/dist/cjs/types/plugins/reactivity.d.js.map +1 -0
- package/dist/cjs/types/plugins/replication-graphql.d.js +2 -0
- package/dist/cjs/types/plugins/replication-graphql.d.js.map +1 -0
- package/dist/cjs/types/plugins/replication.d.js +2 -0
- package/dist/cjs/types/plugins/replication.d.js.map +1 -0
- package/dist/cjs/types/plugins/state.d.js +2 -0
- package/dist/cjs/types/plugins/state.d.js.map +1 -0
- package/dist/cjs/types/plugins/update.d.js +2 -0
- package/dist/cjs/types/plugins/update.d.js.map +1 -0
- package/dist/cjs/types/plugins/webmcp.d.js +2 -0
- package/dist/cjs/types/plugins/webmcp.d.js.map +1 -0
- package/dist/cjs/types/query-planner.d.js +2 -0
- package/dist/cjs/types/query-planner.d.js.map +1 -0
- package/dist/cjs/types/replication-protocol.d.js +2 -0
- package/dist/cjs/types/replication-protocol.d.js.map +1 -0
- package/dist/cjs/types/rx-attachment.d.js +2 -0
- package/dist/cjs/types/rx-attachment.d.js.map +1 -0
- package/dist/cjs/types/rx-change-event.d.js +2 -0
- package/dist/cjs/types/rx-change-event.d.js.map +1 -0
- package/dist/cjs/types/rx-collection.d.js +2 -0
- package/dist/cjs/types/rx-collection.d.js.map +1 -0
- package/dist/cjs/types/rx-database-internal-store.d.js +2 -0
- package/dist/cjs/types/rx-database-internal-store.d.js.map +1 -0
- package/dist/cjs/types/rx-database.d.js +2 -0
- package/dist/cjs/types/rx-database.d.js.map +1 -0
- package/dist/cjs/types/rx-document.d.js +2 -0
- package/dist/cjs/types/rx-document.d.js.map +1 -0
- package/dist/cjs/types/rx-error.d.js +2 -0
- package/dist/cjs/types/rx-error.d.js.map +1 -0
- package/dist/cjs/types/rx-plugin.d.js +2 -0
- package/dist/cjs/types/rx-plugin.d.js.map +1 -0
- package/dist/cjs/types/rx-query.d.js +2 -0
- package/dist/cjs/types/rx-query.d.js.map +1 -0
- package/dist/cjs/types/rx-schema.d.js +2 -0
- package/dist/cjs/types/rx-schema.d.js.map +1 -0
- package/dist/cjs/types/rx-storage.d.js +2 -0
- package/dist/cjs/types/rx-storage.d.js.map +1 -0
- package/dist/cjs/types/rx-storage.interface.d.js +2 -0
- package/dist/cjs/types/rx-storage.interface.d.js.map +1 -0
- package/dist/cjs/types/util.d.js +2 -0
- package/dist/cjs/types/util.d.js.map +1 -0
- package/dist/esm/change-event-buffer.js +141 -0
- package/dist/esm/change-event-buffer.js.map +1 -0
- package/dist/esm/custom-index.js +271 -0
- package/dist/esm/custom-index.js.map +1 -0
- package/dist/esm/doc-cache.js +227 -0
- package/dist/esm/doc-cache.js.map +1 -0
- package/dist/esm/event-reduce.js +93 -0
- package/dist/esm/event-reduce.js.map +1 -0
- package/dist/esm/hooks.js +122 -0
- package/dist/esm/hooks.js.map +1 -0
- package/dist/esm/incremental-write.js +161 -0
- package/dist/esm/incremental-write.js.map +1 -0
- package/dist/esm/index.js +30 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/overwritable.js +33 -0
- package/dist/esm/overwritable.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/plugin-helpers.js +217 -0
- package/dist/esm/plugin-helpers.js.map +1 -0
- package/dist/esm/plugin.js +88 -0
- package/dist/esm/plugin.js.map +1 -0
- package/dist/esm/plugins/attachments/attachments-utils.js +41 -0
- package/dist/esm/plugins/attachments/attachments-utils.js.map +1 -0
- package/dist/esm/plugins/attachments/index.js +202 -0
- package/dist/esm/plugins/attachments/index.js.map +1 -0
- package/dist/esm/plugins/attachments-compression/index.js +134 -0
- package/dist/esm/plugins/attachments-compression/index.js.map +1 -0
- package/dist/esm/plugins/backup/file-util.js +87 -0
- package/dist/esm/plugins/backup/file-util.js.map +1 -0
- package/dist/esm/plugins/backup/index.js +183 -0
- package/dist/esm/plugins/backup/index.js.map +1 -0
- package/dist/esm/plugins/cleanup/cleanup-helper.js +11 -0
- package/dist/esm/plugins/cleanup/cleanup-helper.js.map +1 -0
- package/dist/esm/plugins/cleanup/cleanup-state.js +75 -0
- package/dist/esm/plugins/cleanup/cleanup-state.js.map +1 -0
- package/dist/esm/plugins/cleanup/cleanup.js +108 -0
- package/dist/esm/plugins/cleanup/cleanup.js.map +1 -0
- package/dist/esm/plugins/cleanup/index.js +35 -0
- package/dist/esm/plugins/cleanup/index.js.map +1 -0
- package/dist/esm/plugins/crdt/index.js +378 -0
- package/dist/esm/plugins/crdt/index.js.map +1 -0
- package/dist/esm/plugins/dev-mode/check-document.js +150 -0
- package/dist/esm/plugins/dev-mode/check-document.js.map +1 -0
- package/dist/esm/plugins/dev-mode/check-migration-strategies.js +38 -0
- package/dist/esm/plugins/dev-mode/check-migration-strategies.js.map +1 -0
- package/dist/esm/plugins/dev-mode/check-orm.js +47 -0
- package/dist/esm/plugins/dev-mode/check-orm.js.map +1 -0
- package/dist/esm/plugins/dev-mode/check-query.js +174 -0
- package/dist/esm/plugins/dev-mode/check-query.js.map +1 -0
- package/dist/esm/plugins/dev-mode/check-schema.js +478 -0
- package/dist/esm/plugins/dev-mode/check-schema.js.map +1 -0
- package/dist/esm/plugins/dev-mode/dev-mode-tracking.js +87 -0
- package/dist/esm/plugins/dev-mode/dev-mode-tracking.js.map +1 -0
- package/dist/esm/plugins/dev-mode/entity-properties.js +49 -0
- package/dist/esm/plugins/dev-mode/entity-properties.js.map +1 -0
- package/dist/esm/plugins/dev-mode/error-messages.js +1289 -0
- package/dist/esm/plugins/dev-mode/error-messages.js.map +1 -0
- package/dist/esm/plugins/dev-mode/index.js +151 -0
- package/dist/esm/plugins/dev-mode/index.js.map +1 -0
- package/dist/esm/plugins/dev-mode/unallowed-properties.js +81 -0
- package/dist/esm/plugins/dev-mode/unallowed-properties.js.map +1 -0
- package/dist/esm/plugins/electron/electron-helper.js +3 -0
- package/dist/esm/plugins/electron/electron-helper.js.map +1 -0
- package/dist/esm/plugins/electron/index.js +4 -0
- package/dist/esm/plugins/electron/index.js.map +1 -0
- package/dist/esm/plugins/electron/rx-storage-ipc-main.js +39 -0
- package/dist/esm/plugins/electron/rx-storage-ipc-main.js.map +1 -0
- package/dist/esm/plugins/electron/rx-storage-ipc-renderer.js +31 -0
- package/dist/esm/plugins/electron/rx-storage-ipc-renderer.js.map +1 -0
- package/dist/esm/plugins/encryption-crypto-js/index.js +154 -0
- package/dist/esm/plugins/encryption-crypto-js/index.js.map +1 -0
- package/dist/esm/plugins/flutter/index.js +55 -0
- package/dist/esm/plugins/flutter/index.js.map +1 -0
- package/dist/esm/plugins/json-dump/index.js +87 -0
- package/dist/esm/plugins/json-dump/index.js.map +1 -0
- package/dist/esm/plugins/key-compression/index.js +127 -0
- package/dist/esm/plugins/key-compression/index.js.map +1 -0
- package/dist/esm/plugins/leader-election/index.js +95 -0
- package/dist/esm/plugins/leader-election/index.js.map +1 -0
- package/dist/esm/plugins/local-documents/index.js +70 -0
- package/dist/esm/plugins/local-documents/index.js.map +1 -0
- package/dist/esm/plugins/local-documents/local-documents-helper.js +67 -0
- package/dist/esm/plugins/local-documents/local-documents-helper.js.map +1 -0
- package/dist/esm/plugins/local-documents/local-documents.js +99 -0
- package/dist/esm/plugins/local-documents/local-documents.js.map +1 -0
- package/dist/esm/plugins/local-documents/rx-local-document.js +248 -0
- package/dist/esm/plugins/local-documents/rx-local-document.js.map +1 -0
- package/dist/esm/plugins/migration-schema/index.js +42 -0
- package/dist/esm/plugins/migration-schema/index.js.map +1 -0
- package/dist/esm/plugins/migration-schema/migration-helpers.js +103 -0
- package/dist/esm/plugins/migration-schema/migration-helpers.js.map +1 -0
- package/dist/esm/plugins/migration-schema/migration-types.js +3 -0
- package/dist/esm/plugins/migration-schema/migration-types.js.map +1 -0
- package/dist/esm/plugins/migration-schema/rx-migration-state.js +404 -0
- package/dist/esm/plugins/migration-schema/rx-migration-state.js.map +1 -0
- package/dist/esm/plugins/migration-storage/index.js +166 -0
- package/dist/esm/plugins/migration-storage/index.js.map +1 -0
- package/dist/esm/plugins/pipeline/flagged-functions.js +122 -0
- package/dist/esm/plugins/pipeline/flagged-functions.js.map +1 -0
- package/dist/esm/plugins/pipeline/index.js +13 -0
- package/dist/esm/plugins/pipeline/index.js.map +1 -0
- package/dist/esm/plugins/pipeline/rx-pipeline.js +210 -0
- package/dist/esm/plugins/pipeline/rx-pipeline.js.map +1 -0
- package/dist/esm/plugins/pipeline/types.js +3 -0
- package/dist/esm/plugins/pipeline/types.js.map +1 -0
- package/dist/esm/plugins/query-builder/index.js +48 -0
- package/dist/esm/plugins/query-builder/index.js.map +1 -0
- package/dist/esm/plugins/query-builder/mquery/mquery-utils.js +33 -0
- package/dist/esm/plugins/query-builder/mquery/mquery-utils.js.map +1 -0
- package/dist/esm/plugins/query-builder/mquery/nosql-query-builder.js +478 -0
- package/dist/esm/plugins/query-builder/mquery/nosql-query-builder.js.map +1 -0
- package/dist/esm/plugins/react/database-context.js +8 -0
- package/dist/esm/plugins/react/database-context.js.map +1 -0
- package/dist/esm/plugins/react/database-provider.js +34 -0
- package/dist/esm/plugins/react/database-provider.js.map +1 -0
- package/dist/esm/plugins/react/hooks/index.js +5 -0
- package/dist/esm/plugins/react/hooks/index.js.map +1 -0
- package/dist/esm/plugins/react/hooks/use-live-rx-query.js +22 -0
- package/dist/esm/plugins/react/hooks/use-live-rx-query.js.map +1 -0
- package/dist/esm/plugins/react/hooks/use-rx-collection.js +34 -0
- package/dist/esm/plugins/react/hooks/use-rx-collection.js.map +1 -0
- package/dist/esm/plugins/react/hooks/use-rx-database.js +19 -0
- package/dist/esm/plugins/react/hooks/use-rx-database.js.map +1 -0
- package/dist/esm/plugins/react/hooks/use-rx-query.js +92 -0
- package/dist/esm/plugins/react/hooks/use-rx-query.js.map +1 -0
- package/dist/esm/plugins/react/index.js +3 -0
- package/dist/esm/plugins/react/index.js.map +1 -0
- package/dist/esm/plugins/reactivity-angular/index.js +25 -0
- package/dist/esm/plugins/reactivity-angular/index.js.map +1 -0
- package/dist/esm/plugins/reactivity-preact-signals/index.js +62 -0
- package/dist/esm/plugins/reactivity-preact-signals/index.js.map +1 -0
- package/dist/esm/plugins/reactivity-vue/index.js +27 -0
- package/dist/esm/plugins/reactivity-vue/index.js.map +1 -0
- package/dist/esm/plugins/replication/index.js +479 -0
- package/dist/esm/plugins/replication/index.js.map +1 -0
- package/dist/esm/plugins/replication/replication-helper.js +86 -0
- package/dist/esm/plugins/replication/replication-helper.js.map +1 -0
- package/dist/esm/plugins/replication-appwrite/appwrite-helpers.js +26 -0
- package/dist/esm/plugins/replication-appwrite/appwrite-helpers.js.map +1 -0
- package/dist/esm/plugins/replication-appwrite/appwrite-types.js +3 -0
- package/dist/esm/plugins/replication-appwrite/appwrite-types.js.map +1 -0
- package/dist/esm/plugins/replication-appwrite/index.js +168 -0
- package/dist/esm/plugins/replication-appwrite/index.js.map +1 -0
- package/dist/esm/plugins/replication-couchdb/couchdb-helper.js +65 -0
- package/dist/esm/plugins/replication-couchdb/couchdb-helper.js.map +1 -0
- package/dist/esm/plugins/replication-couchdb/couchdb-types.js +3 -0
- package/dist/esm/plugins/replication-couchdb/couchdb-types.js.map +1 -0
- package/dist/esm/plugins/replication-couchdb/index.js +254 -0
- package/dist/esm/plugins/replication-couchdb/index.js.map +1 -0
- package/dist/esm/plugins/replication-firestore/firestore-helper.js +49 -0
- package/dist/esm/plugins/replication-firestore/firestore-helper.js.map +1 -0
- package/dist/esm/plugins/replication-firestore/firestore-types.js +3 -0
- package/dist/esm/plugins/replication-firestore/firestore-types.js.map +1 -0
- package/dist/esm/plugins/replication-firestore/index.js +233 -0
- package/dist/esm/plugins/replication-firestore/index.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/document-handling.js +140 -0
- package/dist/esm/plugins/replication-google-drive/document-handling.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/downstream.js +66 -0
- package/dist/esm/plugins/replication-google-drive/downstream.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/google-drive-helper.js +331 -0
- package/dist/esm/plugins/replication-google-drive/google-drive-helper.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/google-drive-types.js +3 -0
- package/dist/esm/plugins/replication-google-drive/google-drive-types.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/index.js +126 -0
- package/dist/esm/plugins/replication-google-drive/index.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/init.js +70 -0
- package/dist/esm/plugins/replication-google-drive/init.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/multipart.js +67 -0
- package/dist/esm/plugins/replication-google-drive/multipart.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/signaling.js +253 -0
- package/dist/esm/plugins/replication-google-drive/signaling.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/transaction.js +123 -0
- package/dist/esm/plugins/replication-google-drive/transaction.js.map +1 -0
- package/dist/esm/plugins/replication-google-drive/upstream.js +171 -0
- package/dist/esm/plugins/replication-google-drive/upstream.js.map +1 -0
- package/dist/esm/plugins/replication-graphql/graphql-schema-from-rx-schema.js +228 -0
- package/dist/esm/plugins/replication-graphql/graphql-schema-from-rx-schema.js.map +1 -0
- package/dist/esm/plugins/replication-graphql/graphql-websocket.js +35 -0
- package/dist/esm/plugins/replication-graphql/graphql-websocket.js.map +1 -0
- package/dist/esm/plugins/replication-graphql/helper.js +21 -0
- package/dist/esm/plugins/replication-graphql/helper.js.map +1 -0
- package/dist/esm/plugins/replication-graphql/index.js +161 -0
- package/dist/esm/plugins/replication-graphql/index.js.map +1 -0
- package/dist/esm/plugins/replication-graphql/query-builder-from-rx-schema.js +133 -0
- package/dist/esm/plugins/replication-graphql/query-builder-from-rx-schema.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/document-handling.js +178 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/document-handling.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/downstream.js +71 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/downstream.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/index.js +126 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/index.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/init.js +70 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/init.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js +258 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js +3 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/signaling.js +226 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/signaling.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/transaction.js +127 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/transaction.js.map +1 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/upstream.js +179 -0
- package/dist/esm/plugins/replication-microsoft-onedrive/upstream.js.map +1 -0
- package/dist/esm/plugins/replication-mongodb/index.js +197 -0
- package/dist/esm/plugins/replication-mongodb/index.js.map +1 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-checkpoint.js +131 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-checkpoint.js.map +1 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-helper.js +45 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-helper.js.map +1 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-types.js +3 -0
- package/dist/esm/plugins/replication-mongodb/mongodb-types.js.map +1 -0
- package/dist/esm/plugins/replication-nats/index.js +199 -0
- package/dist/esm/plugins/replication-nats/index.js.map +1 -0
- package/dist/esm/plugins/replication-nats/nats-helper.js +7 -0
- package/dist/esm/plugins/replication-nats/nats-helper.js.map +1 -0
- package/dist/esm/plugins/replication-nats/nats-types.js +3 -0
- package/dist/esm/plugins/replication-nats/nats-types.js.map +1 -0
- package/dist/esm/plugins/replication-supabase/helper.js +35 -0
- package/dist/esm/plugins/replication-supabase/helper.js.map +1 -0
- package/dist/esm/plugins/replication-supabase/index.js +231 -0
- package/dist/esm/plugins/replication-supabase/index.js.map +1 -0
- package/dist/esm/plugins/replication-supabase/types.js +3 -0
- package/dist/esm/plugins/replication-supabase/types.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-p2pcf.js +78 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-p2pcf.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-simple-peer.js +192 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-simple-peer.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-webtorrent.js +136 -0
- package/dist/esm/plugins/replication-webrtc/connection-handler-webtorrent.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/index.js +207 -0
- package/dist/esm/plugins/replication-webrtc/index.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/signaling-server.js +144 -0
- package/dist/esm/plugins/replication-webrtc/signaling-server.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/webrtc-helper.js +26 -0
- package/dist/esm/plugins/replication-webrtc/webrtc-helper.js.map +1 -0
- package/dist/esm/plugins/replication-webrtc/webrtc-types.js +3 -0
- package/dist/esm/plugins/replication-webrtc/webrtc-types.js.map +1 -0
- package/dist/esm/plugins/replication-websocket/index.js +4 -0
- package/dist/esm/plugins/replication-websocket/index.js.map +1 -0
- package/dist/esm/plugins/replication-websocket/websocket-client.js +125 -0
- package/dist/esm/plugins/replication-websocket/websocket-client.js.map +1 -0
- package/dist/esm/plugins/replication-websocket/websocket-server.js +100 -0
- package/dist/esm/plugins/replication-websocket/websocket-server.js.map +1 -0
- package/dist/esm/plugins/replication-websocket/websocket-types.js +3 -0
- package/dist/esm/plugins/replication-websocket/websocket-types.js.map +1 -0
- package/dist/esm/plugins/state/helpers.js +73 -0
- package/dist/esm/plugins/state/helpers.js.map +1 -0
- package/dist/esm/plugins/state/index.js +20 -0
- package/dist/esm/plugins/state/index.js.map +1 -0
- package/dist/esm/plugins/state/rx-state.js +285 -0
- package/dist/esm/plugins/state/rx-state.js.map +1 -0
- package/dist/esm/plugins/state/types.js +3 -0
- package/dist/esm/plugins/state/types.js.map +1 -0
- package/dist/esm/plugins/storage-denokv/denokv-helper.js +40 -0
- package/dist/esm/plugins/storage-denokv/denokv-helper.js.map +1 -0
- package/dist/esm/plugins/storage-denokv/denokv-query.js +93 -0
- package/dist/esm/plugins/storage-denokv/denokv-query.js.map +1 -0
- package/dist/esm/plugins/storage-denokv/denokv-types.js +3 -0
- package/dist/esm/plugins/storage-denokv/denokv-types.js.map +1 -0
- package/dist/esm/plugins/storage-denokv/index.js +24 -0
- package/dist/esm/plugins/storage-denokv/index.js.map +1 -0
- package/dist/esm/plugins/storage-denokv/rx-storage-instance-denokv.js +325 -0
- package/dist/esm/plugins/storage-denokv/rx-storage-instance-denokv.js.map +1 -0
- package/dist/esm/plugins/storage-dexie/dexie-helper.js +241 -0
- package/dist/esm/plugins/storage-dexie/dexie-helper.js.map +1 -0
- package/dist/esm/plugins/storage-dexie/dexie-query.js +169 -0
- package/dist/esm/plugins/storage-dexie/dexie-query.js.map +1 -0
- package/dist/esm/plugins/storage-dexie/index.js +5 -0
- package/dist/esm/plugins/storage-dexie/index.js.map +1 -0
- package/dist/esm/plugins/storage-dexie/rx-storage-dexie.js +39 -0
- package/dist/esm/plugins/storage-dexie/rx-storage-dexie.js.map +1 -0
- package/dist/esm/plugins/storage-dexie/rx-storage-instance-dexie.js +222 -0
- package/dist/esm/plugins/storage-dexie/rx-storage-instance-dexie.js.map +1 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-helpers.js +6 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-helpers.js.map +1 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-query.js +90 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-query.js.map +1 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-types.js +3 -0
- package/dist/esm/plugins/storage-foundationdb/foundationdb-types.js.map +1 -0
- package/dist/esm/plugins/storage-foundationdb/index.js +31 -0
- package/dist/esm/plugins/storage-foundationdb/index.js.map +1 -0
- package/dist/esm/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js +302 -0
- package/dist/esm/plugins/storage-foundationdb/rx-storage-instance-foundationdb.js.map +1 -0
- package/dist/esm/plugins/storage-localstorage/index.js +23 -0
- package/dist/esm/plugins/storage-localstorage/index.js.map +1 -0
- package/dist/esm/plugins/storage-localstorage/localstorage-mock.js +33 -0
- package/dist/esm/plugins/storage-localstorage/localstorage-mock.js.map +1 -0
- package/dist/esm/plugins/storage-localstorage/rx-storage-instance-localstorage.js +432 -0
- package/dist/esm/plugins/storage-localstorage/rx-storage-instance-localstorage.js.map +1 -0
- package/dist/esm/plugins/storage-memory/binary-search-bounds.js +103 -0
- package/dist/esm/plugins/storage-memory/binary-search-bounds.js.map +1 -0
- package/dist/esm/plugins/storage-memory/index.js +29 -0
- package/dist/esm/plugins/storage-memory/index.js.map +1 -0
- package/dist/esm/plugins/storage-memory/memory-helper.js +165 -0
- package/dist/esm/plugins/storage-memory/memory-helper.js.map +1 -0
- package/dist/esm/plugins/storage-memory/memory-indexes.js +21 -0
- package/dist/esm/plugins/storage-memory/memory-indexes.js.map +1 -0
- package/dist/esm/plugins/storage-memory/memory-types.js +3 -0
- package/dist/esm/plugins/storage-memory/memory-types.js.map +1 -0
- package/dist/esm/plugins/storage-memory/rx-storage-instance-memory.js +364 -0
- package/dist/esm/plugins/storage-memory/rx-storage-instance-memory.js.map +1 -0
- package/dist/esm/plugins/storage-mongodb/index.js +5 -0
- package/dist/esm/plugins/storage-mongodb/index.js.map +1 -0
- package/dist/esm/plugins/storage-mongodb/mongodb-helper.js +85 -0
- package/dist/esm/plugins/storage-mongodb/mongodb-helper.js.map +1 -0
- package/dist/esm/plugins/storage-mongodb/mongodb-types.js +3 -0
- package/dist/esm/plugins/storage-mongodb/mongodb-types.js.map +1 -0
- package/dist/esm/plugins/storage-mongodb/rx-storage-instance-mongodb.js +316 -0
- package/dist/esm/plugins/storage-mongodb/rx-storage-instance-mongodb.js.map +1 -0
- package/dist/esm/plugins/storage-mongodb/rx-storage-mongodb.js +22 -0
- package/dist/esm/plugins/storage-mongodb/rx-storage-mongodb.js.map +1 -0
- package/dist/esm/plugins/storage-remote/index.js +6 -0
- package/dist/esm/plugins/storage-remote/index.js.map +1 -0
- package/dist/esm/plugins/storage-remote/message-channel-cache.js +44 -0
- package/dist/esm/plugins/storage-remote/message-channel-cache.js.map +1 -0
- package/dist/esm/plugins/storage-remote/remote.js +212 -0
- package/dist/esm/plugins/storage-remote/remote.js.map +1 -0
- package/dist/esm/plugins/storage-remote/rx-storage-remote.js +193 -0
- package/dist/esm/plugins/storage-remote/rx-storage-remote.js.map +1 -0
- package/dist/esm/plugins/storage-remote/storage-remote-helpers.js +18 -0
- package/dist/esm/plugins/storage-remote/storage-remote-helpers.js.map +1 -0
- package/dist/esm/plugins/storage-remote/storage-remote-types.js +3 -0
- package/dist/esm/plugins/storage-remote/storage-remote-types.js.map +1 -0
- package/dist/esm/plugins/storage-remote-websocket/index.js +161 -0
- package/dist/esm/plugins/storage-remote-websocket/index.js.map +1 -0
- package/dist/esm/plugins/storage-remote-websocket/types.js +3 -0
- package/dist/esm/plugins/storage-remote-websocket/types.js.map +1 -0
- package/dist/esm/plugins/storage-sqlite/index.js +31 -0
- package/dist/esm/plugins/storage-sqlite/index.js.map +1 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-basics-helpers.js +510 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-basics-helpers.js.map +1 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-helpers.js +187 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-helpers.js.map +1 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-storage-instance.js +283 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-storage-instance.js.map +1 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-types.js +3 -0
- package/dist/esm/plugins/storage-sqlite/sqlite-types.js.map +1 -0
- package/dist/esm/plugins/test-utils/config.js +104 -0
- package/dist/esm/plugins/test-utils/config.js.map +1 -0
- package/dist/esm/plugins/test-utils/humans-collection.js +397 -0
- package/dist/esm/plugins/test-utils/humans-collection.js.map +1 -0
- package/dist/esm/plugins/test-utils/index.js +22 -0
- package/dist/esm/plugins/test-utils/index.js.map +1 -0
- package/dist/esm/plugins/test-utils/performance.js +267 -0
- package/dist/esm/plugins/test-utils/performance.js.map +1 -0
- package/dist/esm/plugins/test-utils/replication-base-test-suite.js +170 -0
- package/dist/esm/plugins/test-utils/replication-base-test-suite.js.map +1 -0
- package/dist/esm/plugins/test-utils/replication.js +46 -0
- package/dist/esm/plugins/test-utils/replication.js.map +1 -0
- package/dist/esm/plugins/test-utils/revisions.js +5 -0
- package/dist/esm/plugins/test-utils/revisions.js.map +1 -0
- package/dist/esm/plugins/test-utils/schema-objects.js +283 -0
- package/dist/esm/plugins/test-utils/schema-objects.js.map +1 -0
- package/dist/esm/plugins/test-utils/schemas.js +1244 -0
- package/dist/esm/plugins/test-utils/schemas.js.map +1 -0
- package/dist/esm/plugins/test-utils/test-util.js +62 -0
- package/dist/esm/plugins/test-utils/test-util.js.map +1 -0
- package/dist/esm/plugins/update/index.js +35 -0
- package/dist/esm/plugins/update/index.js.map +1 -0
- package/dist/esm/plugins/update/mingo-updater.js +13 -0
- package/dist/esm/plugins/update/mingo-updater.js.map +1 -0
- package/dist/esm/plugins/utils/index.js +21 -0
- package/dist/esm/plugins/utils/index.js.map +1 -0
- package/dist/esm/plugins/utils/utils-array.js +130 -0
- package/dist/esm/plugins/utils/utils-array.js.map +1 -0
- package/dist/esm/plugins/utils/utils-base64.js +48 -0
- package/dist/esm/plugins/utils/utils-base64.js.map +1 -0
- package/dist/esm/plugins/utils/utils-blob.js +54 -0
- package/dist/esm/plugins/utils/utils-blob.js.map +1 -0
- package/dist/esm/plugins/utils/utils-document.js +87 -0
- package/dist/esm/plugins/utils/utils-document.js.map +1 -0
- package/dist/esm/plugins/utils/utils-error.js +36 -0
- package/dist/esm/plugins/utils/utils-error.js.map +1 -0
- package/dist/esm/plugins/utils/utils-global.js +6 -0
- package/dist/esm/plugins/utils/utils-global.js.map +1 -0
- package/dist/esm/plugins/utils/utils-hash.js +51 -0
- package/dist/esm/plugins/utils/utils-hash.js.map +1 -0
- package/dist/esm/plugins/utils/utils-map.js +18 -0
- package/dist/esm/plugins/utils/utils-map.js.map +1 -0
- package/dist/esm/plugins/utils/utils-number.js +10 -0
- package/dist/esm/plugins/utils/utils-number.js.map +1 -0
- package/dist/esm/plugins/utils/utils-object-deep-equal.js +36 -0
- package/dist/esm/plugins/utils/utils-object-deep-equal.js.map +1 -0
- package/dist/esm/plugins/utils/utils-object-dot-prop.js +296 -0
- package/dist/esm/plugins/utils/utils-object-dot-prop.js.map +1 -0
- package/dist/esm/plugins/utils/utils-object.js +228 -0
- package/dist/esm/plugins/utils/utils-object.js.map +1 -0
- package/dist/esm/plugins/utils/utils-other.js +58 -0
- package/dist/esm/plugins/utils/utils-other.js.map +1 -0
- package/dist/esm/plugins/utils/utils-premium.js +30 -0
- package/dist/esm/plugins/utils/utils-premium.js.map +1 -0
- package/dist/esm/plugins/utils/utils-promise.js +134 -0
- package/dist/esm/plugins/utils/utils-promise.js.map +1 -0
- package/dist/esm/plugins/utils/utils-regex.js +3 -0
- package/dist/esm/plugins/utils/utils-regex.js.map +1 -0
- package/dist/esm/plugins/utils/utils-revision.js +53 -0
- package/dist/esm/plugins/utils/utils-revision.js.map +1 -0
- package/dist/esm/plugins/utils/utils-rxdb-version.js +5 -0
- package/dist/esm/plugins/utils/utils-rxdb-version.js.map +1 -0
- package/dist/esm/plugins/utils/utils-rxdb-version.template.js +5 -0
- package/dist/esm/plugins/utils/utils-rxdb-version.template.js.map +1 -0
- package/dist/esm/plugins/utils/utils-string.js +83 -0
- package/dist/esm/plugins/utils/utils-string.js.map +1 -0
- package/dist/esm/plugins/utils/utils-time.js +36 -0
- package/dist/esm/plugins/utils/utils-time.js.map +1 -0
- package/dist/esm/plugins/validate-ajv/index.js +43 -0
- package/dist/esm/plugins/validate-ajv/index.js.map +1 -0
- package/dist/esm/plugins/validate-is-my-json-valid/index.js +20 -0
- package/dist/esm/plugins/validate-is-my-json-valid/index.js.map +1 -0
- package/dist/esm/plugins/validate-z-schema/index.js +47 -0
- package/dist/esm/plugins/validate-z-schema/index.js.map +1 -0
- package/dist/esm/plugins/vector/helper.js +2 -0
- package/dist/esm/plugins/vector/helper.js.map +1 -0
- package/dist/esm/plugins/vector/index.js +2 -0
- package/dist/esm/plugins/vector/index.js.map +1 -0
- package/dist/esm/plugins/vector/types.js +3 -0
- package/dist/esm/plugins/vector/types.js.map +1 -0
- package/dist/esm/plugins/vector/vector-distance.js +29 -0
- package/dist/esm/plugins/vector/vector-distance.js.map +1 -0
- package/dist/esm/plugins/webmcp/index.js +3 -0
- package/dist/esm/plugins/webmcp/index.js.map +1 -0
- package/dist/esm/plugins/webmcp/nosql-query-schema.js +354 -0
- package/dist/esm/plugins/webmcp/nosql-query-schema.js.map +1 -0
- package/dist/esm/plugins/webmcp/webmcp.js +307 -0
- package/dist/esm/plugins/webmcp/webmcp.js.map +1 -0
- package/dist/esm/query-cache.js +99 -0
- package/dist/esm/query-cache.js.map +1 -0
- package/dist/esm/query-planner.js +297 -0
- package/dist/esm/query-planner.js.map +1 -0
- package/dist/esm/replication-protocol/checkpoint.js +95 -0
- package/dist/esm/replication-protocol/checkpoint.js.map +1 -0
- package/dist/esm/replication-protocol/conflicts.js +31 -0
- package/dist/esm/replication-protocol/conflicts.js.map +1 -0
- package/dist/esm/replication-protocol/default-conflict-handler.js +33 -0
- package/dist/esm/replication-protocol/default-conflict-handler.js.map +1 -0
- package/dist/esm/replication-protocol/downstream.js +334 -0
- package/dist/esm/replication-protocol/downstream.js.map +1 -0
- package/dist/esm/replication-protocol/helper.js +49 -0
- package/dist/esm/replication-protocol/helper.js.map +1 -0
- package/dist/esm/replication-protocol/index.js +221 -0
- package/dist/esm/replication-protocol/index.js.map +1 -0
- package/dist/esm/replication-protocol/meta-instance.js +121 -0
- package/dist/esm/replication-protocol/meta-instance.js.map +1 -0
- package/dist/esm/replication-protocol/upstream.js +379 -0
- package/dist/esm/replication-protocol/upstream.js.map +1 -0
- package/dist/esm/rx-change-event.js +103 -0
- package/dist/esm/rx-change-event.js.map +1 -0
- package/dist/esm/rx-collection-helper.js +196 -0
- package/dist/esm/rx-collection-helper.js.map +1 -0
- package/dist/esm/rx-collection.js +923 -0
- package/dist/esm/rx-collection.js.map +1 -0
- package/dist/esm/rx-database-internal-store.js +270 -0
- package/dist/esm/rx-database-internal-store.js.map +1 -0
- package/dist/esm/rx-database.js +670 -0
- package/dist/esm/rx-database.js.map +1 -0
- package/dist/esm/rx-document-prototype-merge.js +78 -0
- package/dist/esm/rx-document-prototype-merge.js.map +1 -0
- package/dist/esm/rx-document.js +394 -0
- package/dist/esm/rx-document.js.map +1 -0
- package/dist/esm/rx-error.js +153 -0
- package/dist/esm/rx-error.js.map +1 -0
- package/dist/esm/rx-query-helper.js +268 -0
- package/dist/esm/rx-query-helper.js.map +1 -0
- package/dist/esm/rx-query-mingo.js +54 -0
- package/dist/esm/rx-query-mingo.js.map +1 -0
- package/dist/esm/rx-query-single-result.js +98 -0
- package/dist/esm/rx-query-single-result.js.map +1 -0
- package/dist/esm/rx-query.js +690 -0
- package/dist/esm/rx-query.js.map +1 -0
- package/dist/esm/rx-schema-helper.js +316 -0
- package/dist/esm/rx-schema-helper.js.map +1 -0
- package/dist/esm/rx-schema.js +177 -0
- package/dist/esm/rx-schema.js.map +1 -0
- package/dist/esm/rx-storage-helper.js +785 -0
- package/dist/esm/rx-storage-helper.js.map +1 -0
- package/dist/esm/rx-storage-multiinstance.js +113 -0
- package/dist/esm/rx-storage-multiinstance.js.map +1 -0
- package/dist/esm/types/conflict-handling.d.js +3 -0
- package/dist/esm/types/conflict-handling.d.js.map +1 -0
- package/dist/esm/types/couchdb.d.js +3 -0
- package/dist/esm/types/couchdb.d.js.map +1 -0
- package/dist/esm/types/index.d.js +2 -0
- package/dist/esm/types/index.d.js.map +1 -0
- package/dist/esm/types/modules/index.d.js +2 -0
- package/dist/esm/types/modules/index.d.js.map +1 -0
- package/dist/esm/types/modules/mocha.parallel.d.js +2 -0
- package/dist/esm/types/modules/mocha.parallel.d.js.map +1 -0
- package/dist/esm/types/plugins/backup.d.js +3 -0
- package/dist/esm/types/plugins/backup.d.js.map +1 -0
- package/dist/esm/types/plugins/cleanup.d.js +3 -0
- package/dist/esm/types/plugins/cleanup.d.js.map +1 -0
- package/dist/esm/types/plugins/crdt.d.js +3 -0
- package/dist/esm/types/plugins/crdt.d.js.map +1 -0
- package/dist/esm/types/plugins/dexie.d.js +3 -0
- package/dist/esm/types/plugins/dexie.d.js.map +1 -0
- package/dist/esm/types/plugins/local-documents.d.js +3 -0
- package/dist/esm/types/plugins/local-documents.d.js.map +1 -0
- package/dist/esm/types/plugins/migration.d.js +3 -0
- package/dist/esm/types/plugins/migration.d.js.map +1 -0
- package/dist/esm/types/plugins/reactivity.d.js +3 -0
- package/dist/esm/types/plugins/reactivity.d.js.map +1 -0
- package/dist/esm/types/plugins/replication-graphql.d.js +3 -0
- package/dist/esm/types/plugins/replication-graphql.d.js.map +1 -0
- package/dist/esm/types/plugins/replication.d.js +3 -0
- package/dist/esm/types/plugins/replication.d.js.map +1 -0
- package/dist/esm/types/plugins/state.d.js +3 -0
- package/dist/esm/types/plugins/state.d.js.map +1 -0
- package/dist/esm/types/plugins/update.d.js +3 -0
- package/dist/esm/types/plugins/update.d.js.map +1 -0
- package/dist/esm/types/plugins/webmcp.d.js +3 -0
- package/dist/esm/types/plugins/webmcp.d.js.map +1 -0
- package/dist/esm/types/query-planner.d.js +3 -0
- package/dist/esm/types/query-planner.d.js.map +1 -0
- package/dist/esm/types/replication-protocol.d.js +3 -0
- package/dist/esm/types/replication-protocol.d.js.map +1 -0
- package/dist/esm/types/rx-attachment.d.js +3 -0
- package/dist/esm/types/rx-attachment.d.js.map +1 -0
- package/dist/esm/types/rx-change-event.d.js +3 -0
- package/dist/esm/types/rx-change-event.d.js.map +1 -0
- package/dist/esm/types/rx-collection.d.js +3 -0
- package/dist/esm/types/rx-collection.d.js.map +1 -0
- package/dist/esm/types/rx-database-internal-store.d.js +3 -0
- package/dist/esm/types/rx-database-internal-store.d.js.map +1 -0
- package/dist/esm/types/rx-database.d.js +3 -0
- package/dist/esm/types/rx-database.d.js.map +1 -0
- package/dist/esm/types/rx-document.d.js +3 -0
- package/dist/esm/types/rx-document.d.js.map +1 -0
- package/dist/esm/types/rx-error.d.js +3 -0
- package/dist/esm/types/rx-error.d.js.map +1 -0
- package/dist/esm/types/rx-plugin.d.js +3 -0
- package/dist/esm/types/rx-plugin.d.js.map +1 -0
- package/dist/esm/types/rx-query.d.js +3 -0
- package/dist/esm/types/rx-query.d.js.map +1 -0
- package/dist/esm/types/rx-schema.d.js +3 -0
- package/dist/esm/types/rx-schema.d.js.map +1 -0
- package/dist/esm/types/rx-storage.d.js +3 -0
- package/dist/esm/types/rx-storage.d.js.map +1 -0
- package/dist/esm/types/rx-storage.interface.d.js +3 -0
- package/dist/esm/types/rx-storage.interface.d.js.map +1 -0
- package/dist/esm/types/util.d.js +3 -0
- package/dist/esm/types/util.d.js.map +1 -0
- package/dist/types/change-event-buffer.d.ts +50 -0
- package/dist/types/custom-index.d.ts +58 -0
- package/dist/types/doc-cache.d.ts +96 -0
- package/dist/types/event-reduce.d.ts +15 -0
- package/dist/types/hooks.d.ts +109 -0
- package/dist/types/incremental-write.d.ts +29 -0
- package/dist/types/index.d.ts +30 -0
- package/dist/types/overwritable.d.ts +26 -0
- package/dist/types/plugin-helpers.d.ts +30 -0
- package/dist/types/plugin.d.ts +6 -0
- package/dist/types/plugins/attachments/attachments-utils.d.ts +10 -0
- package/dist/types/plugins/attachments/index.d.ts +42 -0
- package/dist/types/plugins/attachments-compression/index.d.ts +38 -0
- package/dist/types/plugins/backup/file-util.d.ts +17 -0
- package/dist/types/plugins/backup/index.d.ts +37 -0
- package/dist/types/plugins/cleanup/cleanup-helper.d.ts +2 -0
- package/dist/types/plugins/cleanup/cleanup-state.d.ts +7 -0
- package/dist/types/plugins/cleanup/cleanup.d.ts +8 -0
- package/dist/types/plugins/cleanup/index.d.ts +4 -0
- package/dist/types/plugins/crdt/index.d.ts +12 -0
- package/dist/types/plugins/dev-mode/check-document.d.ts +9 -0
- package/dist/types/plugins/dev-mode/check-migration-strategies.d.ts +6 -0
- package/dist/types/plugins/dev-mode/check-orm.d.ts +7 -0
- package/dist/types/plugins/dev-mode/check-query.d.ts +21 -0
- package/dist/types/plugins/dev-mode/check-schema.d.ts +18 -0
- package/dist/types/plugins/dev-mode/dev-mode-tracking.d.ts +4 -0
- package/dist/types/plugins/dev-mode/entity-properties.d.ts +3 -0
- package/dist/types/plugins/dev-mode/error-messages.d.ts +1230 -0
- package/dist/types/plugins/dev-mode/index.d.ts +19 -0
- package/dist/types/plugins/dev-mode/unallowed-properties.d.ts +20 -0
- package/dist/types/plugins/electron/electron-helper.d.ts +2 -0
- package/dist/types/plugins/electron/index.d.ts +3 -0
- package/dist/types/plugins/electron/rx-storage-ipc-main.d.ts +10 -0
- package/dist/types/plugins/electron/rx-storage-ipc-renderer.d.ts +13 -0
- package/dist/types/plugins/encryption-crypto-js/index.d.ts +10 -0
- package/dist/types/plugins/flutter/index.d.ts +11 -0
- package/dist/types/plugins/json-dump/index.d.ts +2 -0
- package/dist/types/plugins/key-compression/index.d.ts +18 -0
- package/dist/types/plugins/leader-election/index.d.ts +25 -0
- package/dist/types/plugins/local-documents/index.d.ts +6 -0
- package/dist/types/plugins/local-documents/local-documents-helper.d.ts +9 -0
- package/dist/types/plugins/local-documents/local-documents.d.ts +14 -0
- package/dist/types/plugins/local-documents/rx-local-document.d.ts +11 -0
- package/dist/types/plugins/migration-schema/index.d.ts +8 -0
- package/dist/types/plugins/migration-schema/migration-helpers.d.ts +29 -0
- package/dist/types/plugins/migration-schema/migration-types.d.ts +33 -0
- package/dist/types/plugins/migration-schema/rx-migration-state.d.ts +50 -0
- package/dist/types/plugins/migration-storage/index.d.ts +32 -0
- package/dist/types/plugins/pipeline/flagged-functions.d.ts +69 -0
- package/dist/types/plugins/pipeline/index.d.ts +5 -0
- package/dist/types/plugins/pipeline/rx-pipeline.d.ts +37 -0
- package/dist/types/plugins/pipeline/types.d.ts +17 -0
- package/dist/types/plugins/query-builder/index.d.ts +5 -0
- package/dist/types/plugins/query-builder/mquery/mquery-utils.d.ts +12 -0
- package/dist/types/plugins/query-builder/mquery/nosql-query-builder.d.ts +165 -0
- package/dist/types/plugins/react/database-context.d.ts +4 -0
- package/dist/types/plugins/react/database-provider.d.ts +24 -0
- package/dist/types/plugins/react/hooks/index.d.ts +4 -0
- package/dist/types/plugins/react/hooks/use-live-rx-query.d.ts +11 -0
- package/dist/types/plugins/react/hooks/use-rx-collection.d.ts +10 -0
- package/dist/types/plugins/react/hooks/use-rx-database.d.ts +9 -0
- package/dist/types/plugins/react/hooks/use-rx-query.d.ts +24 -0
- package/dist/types/plugins/react/index.d.ts +2 -0
- package/dist/types/plugins/reactivity-angular/index.d.ts +16 -0
- package/dist/types/plugins/reactivity-preact-signals/index.d.ts +27 -0
- package/dist/types/plugins/reactivity-vue/index.d.ts +17 -0
- package/dist/types/plugins/replication/index.d.ts +84 -0
- package/dist/types/plugins/replication/replication-helper.d.ts +23 -0
- package/dist/types/plugins/replication-appwrite/appwrite-helpers.d.ts +3 -0
- package/dist/types/plugins/replication-appwrite/appwrite-types.d.ts +16 -0
- package/dist/types/plugins/replication-appwrite/index.d.ts +14 -0
- package/dist/types/plugins/replication-couchdb/couchdb-helper.d.ts +19 -0
- package/dist/types/plugins/replication-couchdb/couchdb-types.d.ts +22 -0
- package/dist/types/plugins/replication-couchdb/index.d.ts +18 -0
- package/dist/types/plugins/replication-firestore/firestore-helper.d.ts +10 -0
- package/dist/types/plugins/replication-firestore/firestore-types.d.ts +46 -0
- package/dist/types/plugins/replication-firestore/index.d.ts +17 -0
- package/dist/types/plugins/replication-google-drive/document-handling.d.ts +13 -0
- package/dist/types/plugins/replication-google-drive/downstream.d.ts +10 -0
- package/dist/types/plugins/replication-google-drive/google-drive-helper.d.ts +35 -0
- package/dist/types/plugins/replication-google-drive/google-drive-types.d.ts +67 -0
- package/dist/types/plugins/replication-google-drive/index.d.ts +39 -0
- package/dist/types/plugins/replication-google-drive/init.d.ts +29 -0
- package/dist/types/plugins/replication-google-drive/multipart.d.ts +10 -0
- package/dist/types/plugins/replication-google-drive/signaling.d.ts +41 -0
- package/dist/types/plugins/replication-google-drive/transaction.d.ts +22 -0
- package/dist/types/plugins/replication-google-drive/upstream.d.ts +24 -0
- package/dist/types/plugins/replication-graphql/graphql-schema-from-rx-schema.d.ts +51 -0
- package/dist/types/plugins/replication-graphql/graphql-websocket.d.ts +12 -0
- package/dist/types/plugins/replication-graphql/helper.d.ts +15 -0
- package/dist/types/plugins/replication-graphql/index.d.ts +26 -0
- package/dist/types/plugins/replication-graphql/query-builder-from-rx-schema.d.ts +5 -0
- package/dist/types/plugins/replication-microsoft-onedrive/document-handling.d.ts +14 -0
- package/dist/types/plugins/replication-microsoft-onedrive/downstream.d.ts +10 -0
- package/dist/types/plugins/replication-microsoft-onedrive/index.d.ts +38 -0
- package/dist/types/plugins/replication-microsoft-onedrive/init.d.ts +29 -0
- package/dist/types/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.d.ts +30 -0
- package/dist/types/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.d.ts +71 -0
- package/dist/types/plugins/replication-microsoft-onedrive/signaling.d.ts +41 -0
- package/dist/types/plugins/replication-microsoft-onedrive/transaction.d.ts +22 -0
- package/dist/types/plugins/replication-microsoft-onedrive/upstream.d.ts +25 -0
- package/dist/types/plugins/replication-mongodb/index.d.ts +22 -0
- package/dist/types/plugins/replication-mongodb/mongodb-checkpoint.d.ts +15 -0
- package/dist/types/plugins/replication-mongodb/mongodb-helper.d.ts +13 -0
- package/dist/types/plugins/replication-mongodb/mongodb-types.d.ts +33 -0
- package/dist/types/plugins/replication-nats/index.d.ts +16 -0
- package/dist/types/plugins/replication-nats/nats-helper.d.ts +2 -0
- package/dist/types/plugins/replication-nats/nats-types.d.ts +21 -0
- package/dist/types/plugins/replication-supabase/helper.d.ts +5 -0
- package/dist/types/plugins/replication-supabase/index.d.ts +14 -0
- package/dist/types/plugins/replication-supabase/types.d.ts +28 -0
- package/dist/types/plugins/replication-webrtc/connection-handler-p2pcf.d.ts +0 -0
- package/dist/types/plugins/replication-webrtc/connection-handler-simple-peer.d.ts +57 -0
- package/dist/types/plugins/replication-webrtc/connection-handler-webtorrent.d.ts +0 -0
- package/dist/types/plugins/replication-webrtc/index.d.ts +27 -0
- package/dist/types/plugins/replication-webrtc/signaling-server.d.ts +17 -0
- package/dist/types/plugins/replication-webrtc/webrtc-helper.d.ts +16 -0
- package/dist/types/plugins/replication-webrtc/webrtc-types.d.ts +51 -0
- package/dist/types/plugins/replication-websocket/index.d.ts +3 -0
- package/dist/types/plugins/replication-websocket/websocket-client.d.ts +13 -0
- package/dist/types/plugins/replication-websocket/websocket-server.d.ts +6 -0
- package/dist/types/plugins/replication-websocket/websocket-types.d.ts +32 -0
- package/dist/types/plugins/state/helpers.d.ts +10 -0
- package/dist/types/plugins/state/index.d.ts +4 -0
- package/dist/types/plugins/state/rx-state.d.ts +46 -0
- package/dist/types/plugins/state/types.d.ts +28 -0
- package/dist/types/plugins/storage-denokv/denokv-helper.d.ts +16 -0
- package/dist/types/plugins/storage-denokv/denokv-query.d.ts +3 -0
- package/dist/types/plugins/storage-denokv/denokv-types.d.ts +17 -0
- package/dist/types/plugins/storage-denokv/index.d.ts +11 -0
- package/dist/types/plugins/storage-denokv/rx-storage-instance-denokv.d.ts +41 -0
- package/dist/types/plugins/storage-dexie/dexie-helper.d.ts +40 -0
- package/dist/types/plugins/storage-dexie/dexie-query.d.ts +9 -0
- package/dist/types/plugins/storage-dexie/index.d.ts +4 -0
- package/dist/types/plugins/storage-dexie/rx-storage-dexie.d.ts +11 -0
- package/dist/types/plugins/storage-dexie/rx-storage-instance-dexie.d.ts +29 -0
- package/dist/types/plugins/storage-foundationdb/foundationdb-helpers.d.ts +3 -0
- package/dist/types/plugins/storage-foundationdb/foundationdb-query.d.ts +3 -0
- package/dist/types/plugins/storage-foundationdb/foundationdb-types.d.ts +46 -0
- package/dist/types/plugins/storage-foundationdb/index.d.ts +4 -0
- package/dist/types/plugins/storage-foundationdb/rx-storage-instance-foundationdb.d.ts +26 -0
- package/dist/types/plugins/storage-localstorage/index.d.ts +11 -0
- package/dist/types/plugins/storage-localstorage/localstorage-mock.d.ts +1 -0
- package/dist/types/plugins/storage-localstorage/rx-storage-instance-localstorage.d.ts +84 -0
- package/dist/types/plugins/storage-memory/binary-search-bounds.d.ts +14 -0
- package/dist/types/plugins/storage-memory/index.d.ts +7 -0
- package/dist/types/plugins/storage-memory/memory-helper.d.ts +22 -0
- package/dist/types/plugins/storage-memory/memory-indexes.d.ts +4 -0
- package/dist/types/plugins/storage-memory/memory-types.d.ts +72 -0
- package/dist/types/plugins/storage-memory/rx-storage-instance-memory.d.ts +47 -0
- package/dist/types/plugins/storage-mongodb/index.d.ts +4 -0
- package/dist/types/plugins/storage-mongodb/mongodb-helper.d.ts +22 -0
- package/dist/types/plugins/storage-mongodb/mongodb-types.d.ts +21 -0
- package/dist/types/plugins/storage-mongodb/rx-storage-instance-mongodb.d.ts +52 -0
- package/dist/types/plugins/storage-mongodb/rx-storage-mongodb.d.ts +11 -0
- package/dist/types/plugins/storage-remote/index.d.ts +5 -0
- package/dist/types/plugins/storage-remote/message-channel-cache.d.ts +13 -0
- package/dist/types/plugins/storage-remote/remote.d.ts +6 -0
- package/dist/types/plugins/storage-remote/rx-storage-remote.d.ts +43 -0
- package/dist/types/plugins/storage-remote/storage-remote-helpers.d.ts +4 -0
- package/dist/types/plugins/storage-remote/storage-remote-types.d.ts +88 -0
- package/dist/types/plugins/storage-remote-websocket/index.d.ts +4 -0
- package/dist/types/plugins/storage-remote-websocket/types.d.ts +24 -0
- package/dist/types/plugins/storage-sqlite/index.d.ts +15 -0
- package/dist/types/plugins/storage-sqlite/sqlite-basics-helpers.d.ts +53 -0
- package/dist/types/plugins/storage-sqlite/sqlite-helpers.d.ts +48 -0
- package/dist/types/plugins/storage-sqlite/sqlite-storage-instance.d.ts +38 -0
- package/dist/types/plugins/storage-sqlite/sqlite-types.d.ts +116 -0
- package/dist/types/plugins/test-utils/config.d.ts +16 -0
- package/dist/types/plugins/test-utils/humans-collection.d.ts +26 -0
- package/dist/types/plugins/test-utils/index.d.ts +20 -0
- package/dist/types/plugins/test-utils/performance.d.ts +68 -0
- package/dist/types/plugins/test-utils/replication-base-test-suite.d.ts +66 -0
- package/dist/types/plugins/test-utils/replication.d.ts +10 -0
- package/dist/types/plugins/test-utils/revisions.d.ts +4 -0
- package/dist/types/plugins/test-utils/schema-objects.d.ts +219 -0
- package/dist/types/plugins/test-utils/schemas.d.ts +356 -0
- package/dist/types/plugins/test-utils/test-util.d.ts +10 -0
- package/dist/types/plugins/update/index.d.ts +5 -0
- package/dist/types/plugins/update/mingo-updater.d.ts +2 -0
- package/dist/types/plugins/utils/index.d.ts +20 -0
- package/dist/types/plugins/utils/utils-array.d.ts +40 -0
- package/dist/types/plugins/utils/utils-base64.d.ts +15 -0
- package/dist/types/plugins/utils/utils-blob.d.ts +12 -0
- package/dist/types/plugins/utils/utils-document.d.ts +26 -0
- package/dist/types/plugins/utils/utils-error.d.ts +8 -0
- package/dist/types/plugins/utils/utils-global.d.ts +5 -0
- package/dist/types/plugins/utils/utils-hash.d.ts +4 -0
- package/dist/types/plugins/utils/utils-map.d.ts +2 -0
- package/dist/types/plugins/utils/utils-number.d.ts +7 -0
- package/dist/types/plugins/utils/utils-object-deep-equal.d.ts +7 -0
- package/dist/types/plugins/utils/utils-object-dot-prop.d.ts +14 -0
- package/dist/types/plugins/utils/utils-object.d.ts +61 -0
- package/dist/types/plugins/utils/utils-other.d.ts +20 -0
- package/dist/types/plugins/utils/utils-premium.d.ts +10 -0
- package/dist/types/plugins/utils/utils-promise.d.ts +43 -0
- package/dist/types/plugins/utils/utils-regex.d.ts +2 -0
- package/dist/types/plugins/utils/utils-revision.d.ts +22 -0
- package/dist/types/plugins/utils/utils-rxdb-version.d.ts +4 -0
- package/dist/types/plugins/utils/utils-rxdb-version.template.d.ts +4 -0
- package/dist/types/plugins/utils/utils-string.d.ts +35 -0
- package/dist/types/plugins/utils/utils-time.d.ts +5 -0
- package/dist/types/plugins/validate-ajv/index.d.ts +13 -0
- package/dist/types/plugins/validate-is-my-json-valid/index.d.ts +5 -0
- package/dist/types/plugins/validate-z-schema/index.d.ts +13 -0
- package/dist/types/plugins/vector/helper.d.ts +0 -0
- package/dist/types/plugins/vector/index.d.ts +2 -0
- package/dist/types/plugins/vector/types.d.ts +1 -0
- package/dist/types/plugins/vector/vector-distance.d.ts +13 -0
- package/dist/types/plugins/webmcp/index.d.ts +2 -0
- package/dist/types/plugins/webmcp/nosql-query-schema.d.ts +549 -0
- package/dist/types/plugins/webmcp/webmcp.d.ts +12 -0
- package/dist/types/query-cache.d.ts +35 -0
- package/dist/types/query-planner.d.ts +30 -0
- package/dist/types/replication-protocol/checkpoint.d.ts +8 -0
- package/dist/types/replication-protocol/conflicts.d.ts +10 -0
- package/dist/types/replication-protocol/default-conflict-handler.d.ts +2 -0
- package/dist/types/replication-protocol/downstream.d.ts +10 -0
- package/dist/types/replication-protocol/helper.d.ts +5 -0
- package/dist/types/replication-protocol/index.d.ts +30 -0
- package/dist/types/replication-protocol/meta-instance.d.ts +12 -0
- package/dist/types/replication-protocol/upstream.d.ts +10 -0
- package/dist/types/rx-change-event.d.ts +20 -0
- package/dist/types/rx-collection-helper.d.ts +41 -0
- package/dist/types/rx-collection.d.ts +185 -0
- package/dist/types/rx-database-internal-store.d.ts +37 -0
- package/dist/types/rx-database.d.ts +213 -0
- package/dist/types/rx-document-prototype-merge.d.ts +24 -0
- package/dist/types/rx-document.d.ts +274 -0
- package/dist/types/rx-error.d.ts +37 -0
- package/dist/types/rx-query-helper.d.ts +31 -0
- package/dist/types/rx-query-mingo.d.ts +10 -0
- package/dist/types/rx-query-single-result.d.ts +31 -0
- package/dist/types/rx-query.d.ts +153 -0
- package/dist/types/rx-schema-helper.d.ts +57 -0
- package/dist/types/rx-schema.d.ts +43 -0
- package/dist/types/rx-storage-helper.d.ts +111 -0
- package/dist/types/rx-storage-multiinstance.d.ts +51 -0
- package/dist/types/types/conflict-handling.d.ts +48 -0
- package/dist/types/types/couchdb.d.ts +293 -0
- package/dist/types/types/index.d.ts +32 -0
- package/dist/types/types/modules/index.d.ts +0 -0
- package/dist/types/types/modules/mocha.parallel.d.ts +1 -0
- package/dist/types/types/plugins/backup.d.ts +35 -0
- package/dist/types/types/plugins/cleanup.d.ts +38 -0
- package/dist/types/types/plugins/crdt.d.ts +76 -0
- package/dist/types/types/plugins/dexie.d.ts +30 -0
- package/dist/types/types/plugins/local-documents.d.ts +49 -0
- package/dist/types/types/plugins/migration.d.ts +14 -0
- package/dist/types/types/plugins/reactivity.d.ts +40 -0
- package/dist/types/types/plugins/replication-graphql.d.ts +98 -0
- package/dist/types/types/plugins/replication.d.ts +175 -0
- package/dist/types/types/plugins/state.d.ts +4 -0
- package/dist/types/types/plugins/update.d.ts +23 -0
- package/dist/types/types/plugins/webmcp.d.ts +40 -0
- package/dist/types/types/query-planner.d.ts +47 -0
- package/dist/types/types/replication-protocol.d.ts +296 -0
- package/dist/types/types/rx-attachment.d.ts +46 -0
- package/dist/types/types/rx-change-event.d.ts +85 -0
- package/dist/types/types/rx-collection.d.ts +117 -0
- package/dist/types/types/rx-database-internal-store.d.ts +54 -0
- package/dist/types/types/rx-database.d.ts +124 -0
- package/dist/types/types/rx-document.d.ts +160 -0
- package/dist/types/types/rx-error.d.ts +222 -0
- package/dist/types/types/rx-plugin.d.ts +167 -0
- package/dist/types/types/rx-query.d.ts +144 -0
- package/dist/types/types/rx-schema.d.ts +209 -0
- package/dist/types/types/rx-storage.d.ts +347 -0
- package/dist/types/types/rx-storage.interface.d.ts +312 -0
- package/dist/types/types/util.d.ts +180 -0
- package/eslint.config.mjs +514 -0
- package/package.json +729 -0
- package/plugins/attachments/index.cjs +2 -0
- package/plugins/attachments/index.d.cts +1 -0
- package/plugins/attachments/index.d.mts +1 -0
- package/plugins/attachments/index.mjs +1 -0
- package/plugins/attachments/index.ts +1 -0
- package/plugins/attachments/package.json +18 -0
- package/plugins/attachments-compression/index.cjs +2 -0
- package/plugins/attachments-compression/index.d.cts +1 -0
- package/plugins/attachments-compression/index.d.mts +1 -0
- package/plugins/attachments-compression/index.mjs +1 -0
- package/plugins/attachments-compression/index.ts +1 -0
- package/plugins/attachments-compression/package.json +18 -0
- package/plugins/backup/index.cjs +2 -0
- package/plugins/backup/index.d.cts +1 -0
- package/plugins/backup/index.d.mts +1 -0
- package/plugins/backup/index.mjs +1 -0
- package/plugins/backup/index.ts +1 -0
- package/plugins/backup/package.json +18 -0
- package/plugins/cleanup/index.cjs +2 -0
- package/plugins/cleanup/index.d.cts +1 -0
- package/plugins/cleanup/index.d.mts +1 -0
- package/plugins/cleanup/index.mjs +1 -0
- package/plugins/cleanup/index.ts +1 -0
- package/plugins/cleanup/package.json +18 -0
- package/plugins/core/index.cjs +2 -0
- package/plugins/core/index.d.cts +1 -0
- package/plugins/core/index.d.mts +1 -0
- package/plugins/core/index.mjs +1 -0
- package/plugins/core/index.ts +1 -0
- package/plugins/core/package.json +18 -0
- package/plugins/crdt/index.cjs +2 -0
- package/plugins/crdt/index.d.cts +1 -0
- package/plugins/crdt/index.d.mts +1 -0
- package/plugins/crdt/index.mjs +1 -0
- package/plugins/crdt/index.ts +1 -0
- package/plugins/crdt/package.json +18 -0
- package/plugins/dev-mode/index.cjs +2 -0
- package/plugins/dev-mode/index.d.cts +1 -0
- package/plugins/dev-mode/index.d.mts +1 -0
- package/plugins/dev-mode/index.mjs +1 -0
- package/plugins/dev-mode/index.ts +1 -0
- package/plugins/dev-mode/package.json +18 -0
- package/plugins/electron/index.cjs +2 -0
- package/plugins/electron/index.d.cts +1 -0
- package/plugins/electron/index.d.mts +1 -0
- package/plugins/electron/index.mjs +1 -0
- package/plugins/electron/index.ts +1 -0
- package/plugins/electron/package.json +18 -0
- package/plugins/encryption-crypto-js/index.cjs +2 -0
- package/plugins/encryption-crypto-js/index.d.cts +1 -0
- package/plugins/encryption-crypto-js/index.d.mts +1 -0
- package/plugins/encryption-crypto-js/index.mjs +1 -0
- package/plugins/encryption-crypto-js/index.ts +1 -0
- package/plugins/encryption-crypto-js/package.json +18 -0
- package/plugins/flutter/index.cjs +2 -0
- package/plugins/flutter/index.d.cts +1 -0
- package/plugins/flutter/index.d.mts +1 -0
- package/plugins/flutter/index.mjs +1 -0
- package/plugins/flutter/index.ts +1 -0
- package/plugins/flutter/package.json +18 -0
- package/plugins/json-dump/index.cjs +2 -0
- package/plugins/json-dump/index.d.cts +1 -0
- package/plugins/json-dump/index.d.mts +1 -0
- package/plugins/json-dump/index.mjs +1 -0
- package/plugins/json-dump/index.ts +1 -0
- package/plugins/json-dump/package.json +18 -0
- package/plugins/key-compression/index.cjs +2 -0
- package/plugins/key-compression/index.d.cts +1 -0
- package/plugins/key-compression/index.d.mts +1 -0
- package/plugins/key-compression/index.mjs +1 -0
- package/plugins/key-compression/index.ts +1 -0
- package/plugins/key-compression/package.json +18 -0
- package/plugins/leader-election/index.cjs +2 -0
- package/plugins/leader-election/index.d.cts +1 -0
- package/plugins/leader-election/index.d.mts +1 -0
- package/plugins/leader-election/index.mjs +1 -0
- package/plugins/leader-election/index.ts +1 -0
- package/plugins/leader-election/package.json +18 -0
- package/plugins/local-documents/index.cjs +2 -0
- package/plugins/local-documents/index.d.cts +1 -0
- package/plugins/local-documents/index.d.mts +1 -0
- package/plugins/local-documents/index.mjs +1 -0
- package/plugins/local-documents/index.ts +1 -0
- package/plugins/local-documents/package.json +18 -0
- package/plugins/migration-schema/index.cjs +2 -0
- package/plugins/migration-schema/index.d.cts +1 -0
- package/plugins/migration-schema/index.d.mts +1 -0
- package/plugins/migration-schema/index.mjs +1 -0
- package/plugins/migration-schema/index.ts +1 -0
- package/plugins/migration-schema/package.json +18 -0
- package/plugins/migration-storage/index.cjs +2 -0
- package/plugins/migration-storage/index.d.cts +1 -0
- package/plugins/migration-storage/index.d.mts +1 -0
- package/plugins/migration-storage/index.mjs +1 -0
- package/plugins/migration-storage/index.ts +1 -0
- package/plugins/migration-storage/package.json +18 -0
- package/plugins/pipeline/index.cjs +2 -0
- package/plugins/pipeline/index.d.cts +1 -0
- package/plugins/pipeline/index.d.mts +1 -0
- package/plugins/pipeline/index.mjs +1 -0
- package/plugins/pipeline/index.ts +1 -0
- package/plugins/pipeline/package.json +18 -0
- package/plugins/query-builder/index.cjs +2 -0
- package/plugins/query-builder/index.d.cts +1 -0
- package/plugins/query-builder/index.d.mts +1 -0
- package/plugins/query-builder/index.mjs +1 -0
- package/plugins/query-builder/index.ts +1 -0
- package/plugins/query-builder/package.json +18 -0
- package/plugins/react/index.cjs +2 -0
- package/plugins/react/index.d.cts +1 -0
- package/plugins/react/index.d.mts +1 -0
- package/plugins/react/index.mjs +1 -0
- package/plugins/react/index.ts +1 -0
- package/plugins/react/package.json +18 -0
- package/plugins/reactivity-angular/index.cjs +2 -0
- package/plugins/reactivity-angular/index.d.cts +1 -0
- package/plugins/reactivity-angular/index.d.mts +1 -0
- package/plugins/reactivity-angular/index.mjs +1 -0
- package/plugins/reactivity-angular/index.ts +1 -0
- package/plugins/reactivity-angular/package.json +18 -0
- package/plugins/reactivity-preact-signals/index.cjs +2 -0
- package/plugins/reactivity-preact-signals/index.d.cts +1 -0
- package/plugins/reactivity-preact-signals/index.d.mts +1 -0
- package/plugins/reactivity-preact-signals/index.mjs +1 -0
- package/plugins/reactivity-preact-signals/index.ts +1 -0
- package/plugins/reactivity-preact-signals/package.json +18 -0
- package/plugins/reactivity-vue/index.cjs +2 -0
- package/plugins/reactivity-vue/index.d.cts +1 -0
- package/plugins/reactivity-vue/index.d.mts +1 -0
- package/plugins/reactivity-vue/index.mjs +1 -0
- package/plugins/reactivity-vue/index.ts +1 -0
- package/plugins/reactivity-vue/package.json +18 -0
- package/plugins/replication/index.cjs +2 -0
- package/plugins/replication/index.d.cts +1 -0
- package/plugins/replication/index.d.mts +1 -0
- package/plugins/replication/index.mjs +1 -0
- package/plugins/replication/index.ts +1 -0
- package/plugins/replication/package.json +18 -0
- package/plugins/replication-appwrite/index.cjs +2 -0
- package/plugins/replication-appwrite/index.d.cts +1 -0
- package/plugins/replication-appwrite/index.d.mts +1 -0
- package/plugins/replication-appwrite/index.mjs +1 -0
- package/plugins/replication-appwrite/index.ts +1 -0
- package/plugins/replication-appwrite/package.json +18 -0
- package/plugins/replication-couchdb/index.cjs +2 -0
- package/plugins/replication-couchdb/index.d.cts +1 -0
- package/plugins/replication-couchdb/index.d.mts +1 -0
- package/plugins/replication-couchdb/index.mjs +1 -0
- package/plugins/replication-couchdb/index.ts +1 -0
- package/plugins/replication-couchdb/package.json +18 -0
- package/plugins/replication-firestore/index.cjs +2 -0
- package/plugins/replication-firestore/index.d.cts +1 -0
- package/plugins/replication-firestore/index.d.mts +1 -0
- package/plugins/replication-firestore/index.mjs +1 -0
- package/plugins/replication-firestore/index.ts +1 -0
- package/plugins/replication-firestore/package.json +18 -0
- package/plugins/replication-google-drive/index.cjs +2 -0
- package/plugins/replication-google-drive/index.d.cts +1 -0
- package/plugins/replication-google-drive/index.d.mts +1 -0
- package/plugins/replication-google-drive/index.mjs +1 -0
- package/plugins/replication-google-drive/index.ts +1 -0
- package/plugins/replication-google-drive/package.json +18 -0
- package/plugins/replication-graphql/index.cjs +2 -0
- package/plugins/replication-graphql/index.d.cts +1 -0
- package/plugins/replication-graphql/index.d.mts +1 -0
- package/plugins/replication-graphql/index.mjs +1 -0
- package/plugins/replication-graphql/index.ts +1 -0
- package/plugins/replication-graphql/package.json +18 -0
- package/plugins/replication-microsoft-onedrive/index.cjs +2 -0
- package/plugins/replication-microsoft-onedrive/index.d.cts +1 -0
- package/plugins/replication-microsoft-onedrive/index.d.mts +1 -0
- package/plugins/replication-microsoft-onedrive/index.mjs +1 -0
- package/plugins/replication-microsoft-onedrive/index.ts +1 -0
- package/plugins/replication-microsoft-onedrive/package.json +18 -0
- package/plugins/replication-mongodb/index.cjs +2 -0
- package/plugins/replication-mongodb/index.d.cts +1 -0
- package/plugins/replication-mongodb/index.d.mts +1 -0
- package/plugins/replication-mongodb/index.mjs +1 -0
- package/plugins/replication-mongodb/index.ts +1 -0
- package/plugins/replication-mongodb/package.json +18 -0
- package/plugins/replication-nats/index.cjs +2 -0
- package/plugins/replication-nats/index.d.cts +1 -0
- package/plugins/replication-nats/index.d.mts +1 -0
- package/plugins/replication-nats/index.mjs +1 -0
- package/plugins/replication-nats/index.ts +1 -0
- package/plugins/replication-nats/package.json +18 -0
- package/plugins/replication-supabase/index.cjs +2 -0
- package/plugins/replication-supabase/index.d.cts +1 -0
- package/plugins/replication-supabase/index.d.mts +1 -0
- package/plugins/replication-supabase/index.mjs +1 -0
- package/plugins/replication-supabase/index.ts +1 -0
- package/plugins/replication-supabase/package.json +18 -0
- package/plugins/replication-webrtc/index.cjs +2 -0
- package/plugins/replication-webrtc/index.d.cts +1 -0
- package/plugins/replication-webrtc/index.d.mts +1 -0
- package/plugins/replication-webrtc/index.mjs +1 -0
- package/plugins/replication-webrtc/index.ts +1 -0
- package/plugins/replication-webrtc/package.json +18 -0
- package/plugins/replication-websocket/index.cjs +2 -0
- package/plugins/replication-websocket/index.d.cts +1 -0
- package/plugins/replication-websocket/index.d.mts +1 -0
- package/plugins/replication-websocket/index.mjs +1 -0
- package/plugins/replication-websocket/index.ts +1 -0
- package/plugins/replication-websocket/package.json +18 -0
- package/plugins/state/index.cjs +2 -0
- package/plugins/state/index.d.cts +1 -0
- package/plugins/state/index.d.mts +1 -0
- package/plugins/state/index.mjs +1 -0
- package/plugins/state/index.ts +1 -0
- package/plugins/state/package.json +18 -0
- package/plugins/storage-denokv/index.cjs +2 -0
- package/plugins/storage-denokv/index.d.cts +1 -0
- package/plugins/storage-denokv/index.d.mts +1 -0
- package/plugins/storage-denokv/index.mjs +1 -0
- package/plugins/storage-denokv/index.ts +1 -0
- package/plugins/storage-denokv/package.json +18 -0
- package/plugins/storage-dexie/index.cjs +2 -0
- package/plugins/storage-dexie/index.d.cts +1 -0
- package/plugins/storage-dexie/index.d.mts +1 -0
- package/plugins/storage-dexie/index.mjs +1 -0
- package/plugins/storage-dexie/index.ts +1 -0
- package/plugins/storage-dexie/package.json +18 -0
- package/plugins/storage-foundationdb/index.cjs +2 -0
- package/plugins/storage-foundationdb/index.d.cts +1 -0
- package/plugins/storage-foundationdb/index.d.mts +1 -0
- package/plugins/storage-foundationdb/index.mjs +1 -0
- package/plugins/storage-foundationdb/index.ts +1 -0
- package/plugins/storage-foundationdb/package.json +18 -0
- package/plugins/storage-localstorage/index.cjs +2 -0
- package/plugins/storage-localstorage/index.d.cts +1 -0
- package/plugins/storage-localstorage/index.d.mts +1 -0
- package/plugins/storage-localstorage/index.mjs +1 -0
- package/plugins/storage-localstorage/index.ts +1 -0
- package/plugins/storage-localstorage/package.json +18 -0
- package/plugins/storage-memory/index.cjs +2 -0
- package/plugins/storage-memory/index.d.cts +1 -0
- package/plugins/storage-memory/index.d.mts +1 -0
- package/plugins/storage-memory/index.mjs +1 -0
- package/plugins/storage-memory/index.ts +1 -0
- package/plugins/storage-memory/package.json +18 -0
- package/plugins/storage-mongodb/index.cjs +2 -0
- package/plugins/storage-mongodb/index.d.cts +1 -0
- package/plugins/storage-mongodb/index.d.mts +1 -0
- package/plugins/storage-mongodb/index.mjs +1 -0
- package/plugins/storage-mongodb/index.ts +1 -0
- package/plugins/storage-mongodb/package.json +18 -0
- package/plugins/storage-remote/index.cjs +2 -0
- package/plugins/storage-remote/index.d.cts +1 -0
- package/plugins/storage-remote/index.d.mts +1 -0
- package/plugins/storage-remote/index.mjs +1 -0
- package/plugins/storage-remote/index.ts +1 -0
- package/plugins/storage-remote/package.json +18 -0
- package/plugins/storage-remote-websocket/index.cjs +2 -0
- package/plugins/storage-remote-websocket/index.d.cts +1 -0
- package/plugins/storage-remote-websocket/index.d.mts +1 -0
- package/plugins/storage-remote-websocket/index.mjs +1 -0
- package/plugins/storage-remote-websocket/index.ts +1 -0
- package/plugins/storage-remote-websocket/package.json +18 -0
- package/plugins/storage-sqlite/index.cjs +2 -0
- package/plugins/storage-sqlite/index.d.cts +1 -0
- package/plugins/storage-sqlite/index.d.mts +1 -0
- package/plugins/storage-sqlite/index.mjs +1 -0
- package/plugins/storage-sqlite/index.ts +1 -0
- package/plugins/storage-sqlite/package.json +18 -0
- package/plugins/test-utils/index.cjs +2 -0
- package/plugins/test-utils/index.d.cts +1 -0
- package/plugins/test-utils/index.d.mts +1 -0
- package/plugins/test-utils/index.mjs +1 -0
- package/plugins/test-utils/index.ts +1 -0
- package/plugins/test-utils/package.json +18 -0
- package/plugins/update/index.cjs +2 -0
- package/plugins/update/index.d.cts +1 -0
- package/plugins/update/index.d.mts +1 -0
- package/plugins/update/index.mjs +1 -0
- package/plugins/update/index.ts +1 -0
- package/plugins/update/package.json +18 -0
- package/plugins/utils/index.cjs +2 -0
- package/plugins/utils/index.d.cts +1 -0
- package/plugins/utils/index.d.mts +1 -0
- package/plugins/utils/index.mjs +1 -0
- package/plugins/utils/index.ts +1 -0
- package/plugins/utils/package.json +18 -0
- package/plugins/validate-ajv/index.cjs +2 -0
- package/plugins/validate-ajv/index.d.cts +1 -0
- package/plugins/validate-ajv/index.d.mts +1 -0
- package/plugins/validate-ajv/index.mjs +1 -0
- package/plugins/validate-ajv/index.ts +1 -0
- package/plugins/validate-ajv/package.json +18 -0
- package/plugins/validate-is-my-json-valid/index.cjs +2 -0
- package/plugins/validate-is-my-json-valid/index.d.cts +1 -0
- package/plugins/validate-is-my-json-valid/index.d.mts +1 -0
- package/plugins/validate-is-my-json-valid/index.mjs +1 -0
- package/plugins/validate-is-my-json-valid/index.ts +1 -0
- package/plugins/validate-is-my-json-valid/package.json +18 -0
- package/plugins/validate-z-schema/index.cjs +2 -0
- package/plugins/validate-z-schema/index.d.cts +1 -0
- package/plugins/validate-z-schema/index.d.mts +1 -0
- package/plugins/validate-z-schema/index.mjs +1 -0
- package/plugins/validate-z-schema/index.ts +1 -0
- package/plugins/validate-z-schema/package.json +18 -0
- package/plugins/vector/index.cjs +2 -0
- package/plugins/vector/index.d.cts +1 -0
- package/plugins/vector/index.d.mts +1 -0
- package/plugins/vector/index.mjs +1 -0
- package/plugins/vector/index.ts +1 -0
- package/plugins/vector/package.json +18 -0
- package/plugins/webmcp/index.cjs +2 -0
- package/plugins/webmcp/index.d.cts +1 -0
- package/plugins/webmcp/index.d.mts +1 -0
- package/plugins/webmcp/index.mjs +1 -0
- package/plugins/webmcp/index.ts +1 -0
- package/plugins/webmcp/package.json +18 -0
- package/scripts/acme-challenge/.gittouch +0 -0
- package/scripts/ai-context-generator.mjs +63 -0
- package/scripts/cloud-signaling-script.sh +6 -0
- package/scripts/docs-remove-time.mjs +55 -0
- package/scripts/fix-types.mjs +23 -0
- package/scripts/generate-all-headers.ts +102 -0
- package/scripts/generate-error-messages.mjs +41 -0
- package/scripts/generate-header.ts +226 -0
- package/scripts/generate-plugins-package-json.mjs +133 -0
- package/scripts/install-foundationdb.sh +14 -0
- package/scripts/module_package.json +1 -0
- package/scripts/module_package_no_side.json +1 -0
- package/scripts/postinstall.js +33 -0
- package/scripts/profile.mjs +31 -0
- package/scripts/set-version.mjs +162 -0
- package/scripts/start-cloud-signaling-server.mjs +120 -0
- package/scripts/transpile.mjs +229 -0
- package/scripts/update-version-variable.mjs +49 -0
- package/src/change-event-buffer.ts +171 -0
- package/src/custom-index.ts +376 -0
- package/src/doc-cache.ts +294 -0
- package/src/event-reduce.ts +159 -0
- package/src/hooks.ts +128 -0
- package/src/incremental-write.ts +227 -0
- package/src/index.ts +30 -0
- package/src/overwritable.ts +41 -0
- package/src/plugin-helpers.ts +319 -0
- package/src/plugin.ts +113 -0
- package/src/plugins/attachments/attachments-utils.ts +84 -0
- package/src/plugins/attachments/index.ts +316 -0
- package/src/plugins/attachments-compression/index.ts +221 -0
- package/src/plugins/backup/file-util.ts +132 -0
- package/src/plugins/backup/index.ts +281 -0
- package/src/plugins/cleanup/cleanup-helper.ts +11 -0
- package/src/plugins/cleanup/cleanup-state.ts +92 -0
- package/src/plugins/cleanup/cleanup.ts +140 -0
- package/src/plugins/cleanup/index.ts +45 -0
- package/src/plugins/crdt/index.ts +505 -0
- package/src/plugins/dev-mode/check-document.ts +176 -0
- package/src/plugins/dev-mode/check-migration-strategies.ts +53 -0
- package/src/plugins/dev-mode/check-orm.ts +65 -0
- package/src/plugins/dev-mode/check-query.ts +231 -0
- package/src/plugins/dev-mode/check-schema.ts +564 -0
- package/src/plugins/dev-mode/dev-mode-tracking.ts +125 -0
- package/src/plugins/dev-mode/entity-properties.ts +56 -0
- package/src/plugins/dev-mode/error-messages.ts +1331 -0
- package/src/plugins/dev-mode/index.ts +203 -0
- package/src/plugins/dev-mode/unallowed-properties.ts +96 -0
- package/src/plugins/electron/electron-helper.ts +2 -0
- package/src/plugins/electron/index.ts +3 -0
- package/src/plugins/electron/rx-storage-ipc-main.ts +58 -0
- package/src/plugins/electron/rx-storage-ipc-renderer.ts +62 -0
- package/src/plugins/encryption-crypto-js/index.ts +220 -0
- package/src/plugins/flutter/dart/analysis_options.yaml +30 -0
- package/src/plugins/flutter/dart/example/rxdb_example.dart +6 -0
- package/src/plugins/flutter/dart/lib/rxdb.dart +7 -0
- package/src/plugins/flutter/dart/lib/src/rxdb_base.dart +332 -0
- package/src/plugins/flutter/dart/pubspec.yaml +15 -0
- package/src/plugins/flutter/index.ts +65 -0
- package/src/plugins/json-dump/index.ts +146 -0
- package/src/plugins/key-compression/index.ts +238 -0
- package/src/plugins/leader-election/index.ts +129 -0
- package/src/plugins/local-documents/index.ts +95 -0
- package/src/plugins/local-documents/local-documents-helper.ts +103 -0
- package/src/plugins/local-documents/local-documents.ts +146 -0
- package/src/plugins/local-documents/rx-local-document.ts +388 -0
- package/src/plugins/migration-schema/index.ts +75 -0
- package/src/plugins/migration-schema/migration-helpers.ts +162 -0
- package/src/plugins/migration-schema/migration-types.ts +42 -0
- package/src/plugins/migration-schema/rx-migration-state.ts +632 -0
- package/src/plugins/migration-storage/index.ts +255 -0
- package/src/plugins/pipeline/flagged-functions.ts +131 -0
- package/src/plugins/pipeline/index.ts +18 -0
- package/src/plugins/pipeline/rx-pipeline.ts +303 -0
- package/src/plugins/pipeline/types.ts +28 -0
- package/src/plugins/query-builder/index.ts +81 -0
- package/src/plugins/query-builder/mquery/README.md +5 -0
- package/src/plugins/query-builder/mquery/mquery-utils.ts +37 -0
- package/src/plugins/query-builder/mquery/nosql-query-builder.ts +578 -0
- package/src/plugins/react/database-context.ts +10 -0
- package/src/plugins/react/database-provider.tsx +38 -0
- package/src/plugins/react/hooks/index.ts +4 -0
- package/src/plugins/react/hooks/use-live-rx-query.ts +34 -0
- package/src/plugins/react/hooks/use-rx-collection.ts +73 -0
- package/src/plugins/react/hooks/use-rx-database.ts +35 -0
- package/src/plugins/react/hooks/use-rx-query.ts +168 -0
- package/src/plugins/react/index.ts +2 -0
- package/src/plugins/reactivity-angular/index.ts +32 -0
- package/src/plugins/reactivity-preact-signals/index.ts +85 -0
- package/src/plugins/reactivity-vue/index.ts +43 -0
- package/src/plugins/replication/index.ts +668 -0
- package/src/plugins/replication/replication-helper.ts +122 -0
- package/src/plugins/replication-appwrite/appwrite-helpers.ts +38 -0
- package/src/plugins/replication-appwrite/appwrite-types.ts +31 -0
- package/src/plugins/replication-appwrite/index.ts +269 -0
- package/src/plugins/replication-couchdb/couchdb-helper.ts +100 -0
- package/src/plugins/replication-couchdb/couchdb-types.ts +34 -0
- package/src/plugins/replication-couchdb/index.ts +341 -0
- package/src/plugins/replication-firestore/firestore-helper.ts +79 -0
- package/src/plugins/replication-firestore/firestore-types.ts +72 -0
- package/src/plugins/replication-firestore/index.ts +387 -0
- package/src/plugins/replication-google-drive/AGENTS.md +5 -0
- package/src/plugins/replication-google-drive/document-handling.ts +203 -0
- package/src/plugins/replication-google-drive/download-specs.sh +49 -0
- package/src/plugins/replication-google-drive/downstream.ts +118 -0
- package/src/plugins/replication-google-drive/google-drive-helper.ts +467 -0
- package/src/plugins/replication-google-drive/google-drive-types.ts +84 -0
- package/src/plugins/replication-google-drive/index.ts +221 -0
- package/src/plugins/replication-google-drive/init.ts +108 -0
- package/src/plugins/replication-google-drive/multipart.ts +86 -0
- package/src/plugins/replication-google-drive/signaling.ts +399 -0
- package/src/plugins/replication-google-drive/transaction.ts +222 -0
- package/src/plugins/replication-google-drive/upstream.ts +279 -0
- package/src/plugins/replication-graphql/graphql-schema-from-rx-schema.ts +337 -0
- package/src/plugins/replication-graphql/graphql-websocket.ts +56 -0
- package/src/plugins/replication-graphql/helper.ts +52 -0
- package/src/plugins/replication-graphql/index.ts +255 -0
- package/src/plugins/replication-graphql/query-builder-from-rx-schema.ts +195 -0
- package/src/plugins/replication-microsoft-onedrive/document-handling.ts +216 -0
- package/src/plugins/replication-microsoft-onedrive/downstream.ts +121 -0
- package/src/plugins/replication-microsoft-onedrive/index.ts +220 -0
- package/src/plugins/replication-microsoft-onedrive/init.ts +107 -0
- package/src/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.ts +355 -0
- package/src/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.ts +88 -0
- package/src/plugins/replication-microsoft-onedrive/signaling.ts +333 -0
- package/src/plugins/replication-microsoft-onedrive/transaction.ts +220 -0
- package/src/plugins/replication-microsoft-onedrive/upstream.ts +282 -0
- package/src/plugins/replication-mongodb/index.ts +275 -0
- package/src/plugins/replication-mongodb/mongodb-checkpoint.ts +184 -0
- package/src/plugins/replication-mongodb/mongodb-helper.ts +69 -0
- package/src/plugins/replication-mongodb/mongodb-types.ts +50 -0
- package/src/plugins/replication-nats/index.ts +289 -0
- package/src/plugins/replication-nats/nats-helper.ts +15 -0
- package/src/plugins/replication-nats/nats-types.ts +43 -0
- package/src/plugins/replication-supabase/helper.ts +63 -0
- package/src/plugins/replication-supabase/index.ts +308 -0
- package/src/plugins/replication-supabase/types.ts +47 -0
- package/src/plugins/replication-webrtc/connection-handler-p2pcf.ts +77 -0
- package/src/plugins/replication-webrtc/connection-handler-simple-peer.ts +302 -0
- package/src/plugins/replication-webrtc/connection-handler-webtorrent.ts +137 -0
- package/src/plugins/replication-webrtc/index.ts +307 -0
- package/src/plugins/replication-webrtc/signaling-server.ts +193 -0
- package/src/plugins/replication-webrtc/webrtc-helper.ts +55 -0
- package/src/plugins/replication-webrtc/webrtc-types.ts +91 -0
- package/src/plugins/replication-websocket/index.ts +3 -0
- package/src/plugins/replication-websocket/websocket-client.ts +187 -0
- package/src/plugins/replication-websocket/websocket-server.ts +135 -0
- package/src/plugins/replication-websocket/websocket-types.ts +47 -0
- package/src/plugins/state/helpers.ts +86 -0
- package/src/plugins/state/index.ts +40 -0
- package/src/plugins/state/rx-state.ts +386 -0
- package/src/plugins/state/types.ts +32 -0
- package/src/plugins/storage-denokv/denokv-helper.ts +46 -0
- package/src/plugins/storage-denokv/denokv-query.ts +135 -0
- package/src/plugins/storage-denokv/denokv-types.ts +19 -0
- package/src/plugins/storage-denokv/index.ts +37 -0
- package/src/plugins/storage-denokv/rx-storage-instance-denokv.ts +426 -0
- package/src/plugins/storage-dexie/dexie-helper.ts +302 -0
- package/src/plugins/storage-dexie/dexie-query.ts +252 -0
- package/src/plugins/storage-dexie/index.ts +4 -0
- package/src/plugins/storage-dexie/rx-storage-dexie.ts +62 -0
- package/src/plugins/storage-dexie/rx-storage-instance-dexie.ts +378 -0
- package/src/plugins/storage-foundationdb/foundationdb-helpers.ts +6 -0
- package/src/plugins/storage-foundationdb/foundationdb-query.ts +140 -0
- package/src/plugins/storage-foundationdb/foundationdb-types.ts +64 -0
- package/src/plugins/storage-foundationdb/index.ts +57 -0
- package/src/plugins/storage-foundationdb/rx-storage-instance-foundationdb.ts +449 -0
- package/src/plugins/storage-localstorage/index.ts +44 -0
- package/src/plugins/storage-localstorage/localstorage-mock.ts +32 -0
- package/src/plugins/storage-localstorage/rx-storage-instance-localstorage.ts +686 -0
- package/src/plugins/storage-memory/binary-search-bounds.ts +106 -0
- package/src/plugins/storage-memory/index.ts +52 -0
- package/src/plugins/storage-memory/memory-helper.ts +259 -0
- package/src/plugins/storage-memory/memory-indexes.ts +34 -0
- package/src/plugins/storage-memory/memory-types.ts +90 -0
- package/src/plugins/storage-memory/rx-storage-instance-memory.ts +609 -0
- package/src/plugins/storage-mongodb/index.ts +4 -0
- package/src/plugins/storage-mongodb/mongodb-helper.ts +119 -0
- package/src/plugins/storage-mongodb/mongodb-types.ts +32 -0
- package/src/plugins/storage-mongodb/rx-storage-instance-mongodb.ts +464 -0
- package/src/plugins/storage-mongodb/rx-storage-mongodb.ts +33 -0
- package/src/plugins/storage-remote/index.ts +5 -0
- package/src/plugins/storage-remote/message-channel-cache.ts +88 -0
- package/src/plugins/storage-remote/remote.ts +285 -0
- package/src/plugins/storage-remote/rx-storage-remote.ts +286 -0
- package/src/plugins/storage-remote/storage-remote-helpers.ts +33 -0
- package/src/plugins/storage-remote/storage-remote-types.ts +118 -0
- package/src/plugins/storage-remote-websocket/index.ts +218 -0
- package/src/plugins/storage-remote-websocket/types.ts +34 -0
- package/src/plugins/storage-sqlite/index.ts +64 -0
- package/src/plugins/storage-sqlite/sqlite-basics-helpers.ts +656 -0
- package/src/plugins/storage-sqlite/sqlite-helpers.ts +287 -0
- package/src/plugins/storage-sqlite/sqlite-storage-instance.ts +507 -0
- package/src/plugins/storage-sqlite/sqlite-types.ts +151 -0
- package/src/plugins/test-utils/config.ts +135 -0
- package/src/plugins/test-utils/humans-collection.ts +557 -0
- package/src/plugins/test-utils/index.ts +24 -0
- package/src/plugins/test-utils/performance.ts +344 -0
- package/src/plugins/test-utils/replication-base-test-suite.ts +236 -0
- package/src/plugins/test-utils/replication.ts +95 -0
- package/src/plugins/test-utils/revisions.ts +4 -0
- package/src/plugins/test-utils/schema-objects.ts +527 -0
- package/src/plugins/test-utils/schemas.ts +1391 -0
- package/src/plugins/test-utils/test-util.ts +85 -0
- package/src/plugins/update/index.ts +57 -0
- package/src/plugins/update/mingo-updater.ts +26 -0
- package/src/plugins/utils/index.ts +20 -0
- package/src/plugins/utils/utils-array.ts +152 -0
- package/src/plugins/utils/utils-base64.ts +49 -0
- package/src/plugins/utils/utils-blob.ts +65 -0
- package/src/plugins/utils/utils-document.ts +117 -0
- package/src/plugins/utils/utils-error.ts +53 -0
- package/src/plugins/utils/utils-global.ts +5 -0
- package/src/plugins/utils/utils-hash.ts +62 -0
- package/src/plugins/utils/utils-map.ts +23 -0
- package/src/plugins/utils/utils-number.ts +9 -0
- package/src/plugins/utils/utils-object-deep-equal.ts +46 -0
- package/src/plugins/utils/utils-object-dot-prop.ts +365 -0
- package/src/plugins/utils/utils-object.ts +272 -0
- package/src/plugins/utils/utils-other.ts +58 -0
- package/src/plugins/utils/utils-premium.ts +37 -0
- package/src/plugins/utils/utils-promise.ts +171 -0
- package/src/plugins/utils/utils-regex.ts +2 -0
- package/src/plugins/utils/utils-revision.ts +55 -0
- package/src/plugins/utils/utils-rxdb-version.template.ts +4 -0
- package/src/plugins/utils/utils-rxdb-version.ts +4 -0
- package/src/plugins/utils/utils-string.ts +91 -0
- package/src/plugins/utils/utils-time.ts +37 -0
- package/src/plugins/validate-ajv/index.ts +61 -0
- package/src/plugins/validate-is-my-json-valid/index.ts +30 -0
- package/src/plugins/validate-z-schema/index.ts +58 -0
- package/src/plugins/vector/helper.ts +0 -0
- package/src/plugins/vector/index.ts +2 -0
- package/src/plugins/vector/types.ts +1 -0
- package/src/plugins/vector/vector-distance.ts +34 -0
- package/src/plugins/webmcp/index.ts +2 -0
- package/src/plugins/webmcp/nosql-query-schema.ts +299 -0
- package/src/plugins/webmcp/webmcp.ts +319 -0
- package/src/query-cache.ts +139 -0
- package/src/query-planner.ts +386 -0
- package/src/replication-protocol/checkpoint.ts +154 -0
- package/src/replication-protocol/conflicts.ts +53 -0
- package/src/replication-protocol/default-conflict-handler.ts +43 -0
- package/src/replication-protocol/downstream.ts +550 -0
- package/src/replication-protocol/helper.ts +96 -0
- package/src/replication-protocol/index.ts +348 -0
- package/src/replication-protocol/meta-instance.ts +195 -0
- package/src/replication-protocol/upstream.ts +560 -0
- package/src/rx-change-event.ts +137 -0
- package/src/rx-collection-helper.ts +262 -0
- package/src/rx-collection.ts +1306 -0
- package/src/rx-database-internal-store.ts +402 -0
- package/src/rx-database.ts +919 -0
- package/src/rx-document-prototype-merge.ts +124 -0
- package/src/rx-document.ts +557 -0
- package/src/rx-error.ts +190 -0
- package/src/rx-query-helper.ts +317 -0
- package/src/rx-query-mingo.ts +87 -0
- package/src/rx-query-single-result.ts +110 -0
- package/src/rx-query.ts +887 -0
- package/src/rx-schema-helper.ts +391 -0
- package/src/rx-schema.ts +247 -0
- package/src/rx-storage-helper.ts +1050 -0
- package/src/rx-storage-multiinstance.ts +188 -0
- package/src/types/conflict-handling.d.ts +48 -0
- package/src/types/couchdb.d.ts +293 -0
- package/src/types/index.d.ts +32 -0
- package/src/types/modules/index.d.ts +0 -0
- package/src/types/modules/mocha.parallel.d.ts +1 -0
- package/src/types/plugins/backup.d.ts +35 -0
- package/src/types/plugins/cleanup.d.ts +38 -0
- package/src/types/plugins/crdt.d.ts +76 -0
- package/src/types/plugins/dexie.d.ts +30 -0
- package/src/types/plugins/local-documents.d.ts +49 -0
- package/src/types/plugins/migration.d.ts +14 -0
- package/src/types/plugins/reactivity.d.ts +40 -0
- package/src/types/plugins/replication-graphql.d.ts +98 -0
- package/src/types/plugins/replication.d.ts +175 -0
- package/src/types/plugins/state.d.ts +4 -0
- package/src/types/plugins/update.d.ts +23 -0
- package/src/types/plugins/webmcp.d.ts +40 -0
- package/src/types/query-planner.d.ts +47 -0
- package/src/types/replication-protocol.d.ts +296 -0
- package/src/types/rx-attachment.d.ts +46 -0
- package/src/types/rx-change-event.d.ts +85 -0
- package/src/types/rx-collection.d.ts +117 -0
- package/src/types/rx-database-internal-store.d.ts +54 -0
- package/src/types/rx-database.d.ts +124 -0
- package/src/types/rx-document.d.ts +160 -0
- package/src/types/rx-error.d.ts +222 -0
- package/src/types/rx-plugin.d.ts +167 -0
- package/src/types/rx-query.d.ts +144 -0
- package/src/types/rx-schema.d.ts +209 -0
- package/src/types/rx-storage.d.ts +347 -0
- package/src/types/rx-storage.interface.d.ts +312 -0
- package/src/types/util.d.ts +180 -0
- package/tsconfig.json +54 -0
- package/tsconfig.lint.json +18 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-handler-simple-peer.js","names":["_rxjs","require","_index","_simplepeerMin","_interopRequireDefault","_rxError","Peer","_Peer","sendMessage","ws","msg","send","JSON","stringify","DEFAULT_SIGNALING_SERVER_HOSTNAME","DEFAULT_SIGNALING_SERVER","exports","defaultServerWarningShown","SIMPLE_PEER_PING_INTERVAL","getConnectionHandlerSimplePeer","signalingServerUrl","wrtc","config","webSocketConstructor","WebSocket","ensureProcessNextTickIsSet","includes","console","warn","join","creator","options","connect$","Subject","disconnect$","message$","response$","error$","peers","Map","closed","ownPeerId","socket","undefined","createSocket","promiseWait","type","onclose","onopen","ensureNotFalsy","onmessage","msgEvent","parse","data","yourPeerId","room","topic","createPeerConnection","remotePeerId","disconnected","newSimplePeer","initiator","trickle","id","randomToken","set","on","signal","senderPeerId","receiverPeerId","messageOrResponse","toString","result","next","peer","response","message","error","newRxError","destroy","otherPeerIds","forEach","has","getFromMapOrThrow","handler","close","complete","PROMISE_RESOLVE_VOID","process","nextTick"],"sources":["../../../../src/plugins/replication-webrtc/connection-handler-simple-peer.ts"],"sourcesContent":["import { Subject } from 'rxjs';\r\nimport {\r\n ensureNotFalsy,\r\n getFromMapOrThrow,\r\n PROMISE_RESOLVE_VOID,\r\n promiseWait,\r\n randomToken\r\n} from '../../plugins/utils/index.ts';\r\nimport type {\r\n WebRTCConnectionHandler,\r\n WebRTCConnectionHandlerCreator,\r\n WebRTCMessage,\r\n PeerWithMessage,\r\n PeerWithResponse,\r\n SyncOptionsWebRTC\r\n} from './webrtc-types.ts';\r\n\r\nimport type {\r\n SimplePeer as Peer,\r\n Instance as SimplePeerInstance,\r\n Options as SimplePeerOptions\r\n} from 'simple-peer';\r\nimport {\r\n default as _Peer\r\n // @ts-ignore\r\n} from 'simple-peer/simplepeer.min.js';\r\n\r\nconst Peer = _Peer as Peer\r\n\r\nimport type { RxError, RxTypeError } from '../../types/index.d.ts';\r\nimport { newRxError } from '../../rx-error.ts';\r\n\r\nexport type SimplePeer = SimplePeerInstance & {\r\n // add id to make debugging easier\r\n id: string;\r\n};\r\n\r\nexport type SimplePeerInitMessage = {\r\n type: 'init';\r\n yourPeerId: string;\r\n};\r\nexport type SimplePeerJoinMessage = {\r\n type: 'join';\r\n room: string;\r\n};\r\nexport type SimplePeerJoinedMessage = {\r\n type: 'joined';\r\n otherPeerIds: string[];\r\n};\r\nexport type SimplePeerSignalMessage = {\r\n type: 'signal';\r\n room: string;\r\n senderPeerId: string;\r\n receiverPeerId: string;\r\n data: string;\r\n};\r\nexport type SimplePeerPingMessage = {\r\n type: 'ping';\r\n};\r\n\r\nexport type PeerMessage =\r\n SimplePeerInitMessage |\r\n SimplePeerJoinMessage |\r\n SimplePeerJoinedMessage |\r\n SimplePeerSignalMessage |\r\n SimplePeerPingMessage;\r\n\r\n\r\nfunction sendMessage(ws: WebSocket, msg: PeerMessage) {\r\n ws.send(JSON.stringify(msg));\r\n}\r\n\r\nconst DEFAULT_SIGNALING_SERVER_HOSTNAME = 'signaling.rxdb.info';\r\nexport const DEFAULT_SIGNALING_SERVER = 'wss://' + DEFAULT_SIGNALING_SERVER_HOSTNAME + '/';\r\nlet defaultServerWarningShown = false;\r\n\r\nexport type SimplePeerWrtc = SimplePeerOptions['wrtc'];\r\nexport type SimplePeerConfig = SimplePeerOptions['config'];\r\nexport type SimplePeerWebSocketConstructor = { new(url: string): WebSocket; };\r\n\r\nexport type SimplePeerConnectionHandlerOptions = {\r\n /**\r\n * If no server is specified, the default signaling server\r\n * from signaling.rxdb.info is used.\r\n * This server is not reliable and you should use\r\n * your own signaling server instead.\r\n */\r\n signalingServerUrl?: string;\r\n wrtc?: SimplePeerWrtc;\r\n config?: SimplePeerConfig;\r\n webSocketConstructor?: SimplePeerWebSocketConstructor;\r\n};\r\n\r\nexport const SIMPLE_PEER_PING_INTERVAL = 1000 * 60 * 2;\r\n\r\n/**\r\n * Returns a connection handler that uses simple-peer and the signaling server.\r\n */\r\nexport function getConnectionHandlerSimplePeer({\r\n signalingServerUrl = DEFAULT_SIGNALING_SERVER,\r\n wrtc,\r\n config,\r\n webSocketConstructor = WebSocket\r\n}: SimplePeerConnectionHandlerOptions): WebRTCConnectionHandlerCreator<SimplePeer> {\r\n ensureProcessNextTickIsSet();\r\n\r\n if (\r\n signalingServerUrl.includes(DEFAULT_SIGNALING_SERVER_HOSTNAME) &&\r\n !defaultServerWarningShown\r\n ) {\r\n defaultServerWarningShown = true;\r\n console.warn(\r\n [\r\n 'RxDB Warning: You are using the RxDB WebRTC replication plugin',\r\n 'but you did not specify your own signaling server url.',\r\n 'By default it will use a signaling server provided by RxDB at ' + DEFAULT_SIGNALING_SERVER,\r\n 'This server is made for demonstration purposes and tryouts. It is not reliable and might be offline at any time.',\r\n 'In production you must always use your own signaling server instead.',\r\n 'Learn how to run your own server at https://rxdb.info/replication-webrtc.html',\r\n 'Also leave a ⭐ at the RxDB github repo 🙏 https://github.com/pubkey/rxdb 🙏'\r\n ].join(' ')\r\n );\r\n }\r\n\r\n const creator: WebRTCConnectionHandlerCreator<SimplePeer> = async (options: SyncOptionsWebRTC<any, SimplePeer>) => {\r\n\r\n const connect$ = new Subject<SimplePeer>();\r\n const disconnect$ = new Subject<SimplePeer>();\r\n const message$ = new Subject<PeerWithMessage<SimplePeer>>();\r\n const response$ = new Subject<PeerWithResponse<SimplePeer>>();\r\n const error$ = new Subject<RxError | RxTypeError>();\r\n\r\n const peers = new Map<string, SimplePeer>();\r\n let closed = false;\r\n let ownPeerId: string;\r\n let socket: WebSocket | undefined = undefined;\r\n createSocket();\r\n\r\n\r\n /**\r\n * Send ping signals to the server.\r\n */\r\n (async () => {\r\n while (true) {\r\n await promiseWait(SIMPLE_PEER_PING_INTERVAL / 2);\r\n if (closed) {\r\n break;\r\n }\r\n if (socket) {\r\n sendMessage(socket, { type: 'ping' });\r\n }\r\n }\r\n })();\r\n\r\n\r\n /**\r\n * @recursive calls it self on socket disconnects\r\n * so that when the user goes offline and online\r\n * again, it will recreate the WebSocket connection.\r\n */\r\n function createSocket() {\r\n if (closed) {\r\n return;\r\n }\r\n socket = new webSocketConstructor(signalingServerUrl);\r\n socket.onclose = () => createSocket();\r\n socket.onopen = () => {\r\n ensureNotFalsy(socket).onmessage = (msgEvent: any) => {\r\n const msg: PeerMessage = JSON.parse(msgEvent.data as any);\r\n switch (msg.type) {\r\n case 'init':\r\n ownPeerId = msg.yourPeerId;\r\n sendMessage(ensureNotFalsy(socket), {\r\n type: 'join',\r\n room: options.topic\r\n });\r\n break;\r\n case 'joined':\r\n /**\r\n * PeerId is created by the signaling server\r\n * to prevent spoofing it.\r\n */\r\n function createPeerConnection(remotePeerId: string) {\r\n let disconnected = false;\r\n const newSimplePeer: SimplePeer = new Peer({\r\n initiator: remotePeerId > ownPeerId,\r\n wrtc,\r\n config,\r\n trickle: true\r\n }) as any;\r\n newSimplePeer.id = randomToken(10);\r\n peers.set(remotePeerId, newSimplePeer);\r\n\r\n\r\n newSimplePeer.on('signal', (signal: any) => {\r\n sendMessage(ensureNotFalsy(socket), {\r\n type: 'signal',\r\n senderPeerId: ownPeerId,\r\n receiverPeerId: remotePeerId,\r\n room: options.topic,\r\n data: signal\r\n });\r\n });\r\n\r\n newSimplePeer.on('data', (messageOrResponse: any) => {\r\n messageOrResponse = JSON.parse(messageOrResponse.toString());\r\n if (messageOrResponse.result) {\r\n response$.next({\r\n peer: newSimplePeer,\r\n response: messageOrResponse\r\n });\r\n } else {\r\n message$.next({\r\n peer: newSimplePeer,\r\n message: messageOrResponse\r\n });\r\n }\r\n });\r\n\r\n newSimplePeer.on('error', (error: Error) => {\r\n error$.next(newRxError('RC_WEBRTC_PEER', {\r\n error\r\n }));\r\n newSimplePeer.destroy();\r\n if (!disconnected) {\r\n disconnected = true;\r\n disconnect$.next(newSimplePeer);\r\n }\r\n });\r\n\r\n newSimplePeer.on('connect', () => {\r\n connect$.next(newSimplePeer);\r\n });\r\n\r\n newSimplePeer.on('close', () => {\r\n if (!disconnected) {\r\n disconnected = true;\r\n disconnect$.next(newSimplePeer);\r\n }\r\n createPeerConnection(remotePeerId);\r\n });\r\n }\r\n msg.otherPeerIds.forEach(remotePeerId => {\r\n if (\r\n remotePeerId === ownPeerId ||\r\n peers.has(remotePeerId)\r\n ) {\r\n return;\r\n } else {\r\n createPeerConnection(remotePeerId);\r\n }\r\n\r\n });\r\n break;\r\n case 'signal':\r\n const peer = getFromMapOrThrow(peers, msg.senderPeerId);\r\n peer.signal(msg.data);\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n\r\n const handler: WebRTCConnectionHandler<SimplePeer> = {\r\n error$,\r\n connect$,\r\n disconnect$,\r\n message$,\r\n response$,\r\n async send(peer: SimplePeer, message: WebRTCMessage) {\r\n await peer.send(JSON.stringify(message));\r\n },\r\n close() {\r\n closed = true;\r\n ensureNotFalsy(socket).close();\r\n error$.complete();\r\n connect$.complete();\r\n disconnect$.complete();\r\n message$.complete();\r\n response$.complete();\r\n return PROMISE_RESOLVE_VOID;\r\n }\r\n };\r\n return handler;\r\n };\r\n return creator;\r\n}\r\n\r\n\r\n/**\r\n * Multiple people had problems because it requires to have\r\n * the nextTick() method in the runtime. So we check here and\r\n * throw a helpful error.\r\n */\r\nexport function ensureProcessNextTickIsSet() {\r\n if (\r\n typeof process === 'undefined' ||\r\n typeof process.nextTick !== 'function'\r\n ) {\r\n throw newRxError('RC7');\r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AC/D,IAAI,CAACC,IAAI,CAACC,SAAS,CAAC+D,OAAO,CAAC,CAAC;MAC5C,CAAC;MACDS,KAAKA,CAAA,EAAG;QACJ7C,MAAM,GAAG,IAAI;QACb,IAAAS,qBAAc,EAACP,MAAM,CAAC,CAAC2C,KAAK,CAAC,CAAC;QAC9BhD,MAAM,CAACiD,QAAQ,CAAC,CAAC;QACjBtD,QAAQ,CAACsD,QAAQ,CAAC,CAAC;QACnBpD,WAAW,CAACoD,QAAQ,CAAC,CAAC;QACtBnD,QAAQ,CAACmD,QAAQ,CAAC,CAAC;QACnBlD,SAAS,CAACkD,QAAQ,CAAC,CAAC;QACpB,OAAOC,2BAAoB;MAC/B;IACJ,CAAC;IACD,OAAOH,OAAO;EAClB,CAAC;EACD,OAAOtD,OAAO;AAClB;;AAGA;AACA;AACA;AACA;AACA;AACO,SAASL,0BAA0BA,CAAA,EAAG;EACzC,IACI,OAAO+D,OAAO,KAAK,WAAW,IAC9B,OAAOA,OAAO,CAACC,QAAQ,KAAK,UAAU,EACxC;IACE,MAAM,IAAAX,mBAAU,EAAC,KAAK,CAAC;EAC3B;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// /**
|
|
2
|
+
// * Uses the Webtorrent servers as signaling server, works similar to p2pt.
|
|
3
|
+
// * We could not use p2pt directly because it has so many bugs and behaves wrong in
|
|
4
|
+
// * cases with more than 2 peers.
|
|
5
|
+
// * @link https://github.com/subins2000/p2pt/blob/master/p2pt.js
|
|
6
|
+
// */
|
|
7
|
+
|
|
8
|
+
// import { Subject } from 'rxjs';
|
|
9
|
+
// import { PROMISE_RESOLVE_VOID, randomToken } from '../../util';
|
|
10
|
+
// import { P2PConnectionHandler, P2PConnectionHandlerCreator, P2PMessage, P2PPeer, PeerWithMessage, PeerWithResponse } from './p2p-types';
|
|
11
|
+
// const wrtc = require('wrtc');
|
|
12
|
+
|
|
13
|
+
// const WebSocketTracker = require('bittorrent-tracker/lib/client/websocket-tracker');
|
|
14
|
+
// const Client = require('bittorrent-tracker');
|
|
15
|
+
// const randombytes = require('randombytes');
|
|
16
|
+
// const EventEmitter = require('events');
|
|
17
|
+
// const sha1 = require('simple-sha1');
|
|
18
|
+
// const debug = require('debug')('p2pt');
|
|
19
|
+
|
|
20
|
+
// export const P2PT_DEFAULT_TRACKERS = [
|
|
21
|
+
// 'wss://tracker.files.fm:7073/announce',
|
|
22
|
+
// 'wss://tracker.btorrent.xyz',
|
|
23
|
+
// 'wss://spacetradersapi-chatbox.herokuapp.com:443/announce',
|
|
24
|
+
// 'wss://qot.abiir.top:443/announce'
|
|
25
|
+
// ];
|
|
26
|
+
|
|
27
|
+
// export function getConnectionHandlerWebtorrent(
|
|
28
|
+
// trackers: string[] = P2PT_DEFAULT_TRACKERS,
|
|
29
|
+
// /**
|
|
30
|
+
// * Port is only required in Node.js,
|
|
31
|
+
// * not on browsers.
|
|
32
|
+
// */
|
|
33
|
+
// torrentClientPort = 18669
|
|
34
|
+
// ): P2PConnectionHandlerCreator {
|
|
35
|
+
// const creator: P2PConnectionHandlerCreator = (options) => {
|
|
36
|
+
// /**
|
|
37
|
+
// * @link https://github.com/webtorrent/bittorrent-tracker#client
|
|
38
|
+
// */
|
|
39
|
+
// const requiredOpts = {
|
|
40
|
+
// infoHash: sha1.sync(options.topic).toLowerCase(),
|
|
41
|
+
// peerId: randombytes(20),
|
|
42
|
+
// announce: trackers,
|
|
43
|
+
// port: torrentClientPort,
|
|
44
|
+
// wrtc
|
|
45
|
+
// }
|
|
46
|
+
// const client = new Client(requiredOpts);
|
|
47
|
+
|
|
48
|
+
// const connect$ = new Subject<P2PPeer>();
|
|
49
|
+
// const disconnect$ = new Subject<P2PPeer>();
|
|
50
|
+
// const message$ = new Subject<PeerWithMessage>();
|
|
51
|
+
// const response$ = new Subject<PeerWithResponse>();
|
|
52
|
+
|
|
53
|
+
// client.on('error', function (err) {
|
|
54
|
+
// console.error('fatal client error! ' + requiredOpts.peerId.toString('hex'));
|
|
55
|
+
// console.log(err.message)
|
|
56
|
+
// })
|
|
57
|
+
|
|
58
|
+
// client.on('warning', function (err) {
|
|
59
|
+
// // a tracker was unavailable or sent bad data to the client. you can probably ignore it
|
|
60
|
+
// console.log(err.message)
|
|
61
|
+
// })
|
|
62
|
+
|
|
63
|
+
// client.on('update', function (data) {
|
|
64
|
+
// console.log('got an announce response from tracker: ' + data.announce)
|
|
65
|
+
// console.log('number of seeders in the swarm: ' + data.complete)
|
|
66
|
+
// console.log('number of leechers in the swarm: ' + data.incomplete)
|
|
67
|
+
// });
|
|
68
|
+
|
|
69
|
+
// const knownPeers = new Set<string>();
|
|
70
|
+
// client.on('peer', function (peer: P2PPeer) {
|
|
71
|
+
// console.log('found a peer: ' + peer.id + ' ' + requiredOpts.peerId.toString('hex')) // 85.10.239.191:48623
|
|
72
|
+
// if (knownPeers.has(peer.id)) {
|
|
73
|
+
// return;
|
|
74
|
+
// }
|
|
75
|
+
// knownPeers.add(peer.id);
|
|
76
|
+
// peer.once('connect', () => {
|
|
77
|
+
// connect$.next(peer);
|
|
78
|
+
// });
|
|
79
|
+
// peer.on('data', (data: Buffer) => {
|
|
80
|
+
// console.log('# GOT DATA FROM PEER:');
|
|
81
|
+
// const messageOrResponse = JSON.parse(data as any);
|
|
82
|
+
// console.dir(messageOrResponse);
|
|
83
|
+
// if (messageOrResponse.result) {
|
|
84
|
+
// response$.next({
|
|
85
|
+
// peer: peer as any,
|
|
86
|
+
// response: messageOrResponse
|
|
87
|
+
// });
|
|
88
|
+
// } else {
|
|
89
|
+
// message$.next({
|
|
90
|
+
// peer,
|
|
91
|
+
// message: JSON.parse(data)
|
|
92
|
+
// });
|
|
93
|
+
// }
|
|
94
|
+
// });
|
|
95
|
+
// peer.on('signal', (signal) => {
|
|
96
|
+
// console.log('GOT SIGNAL: ' + requiredOpts.peerId.toString('hex'));
|
|
97
|
+
// console.dir(signal);
|
|
98
|
+
// client.signal(signal);
|
|
99
|
+
// client.update();
|
|
100
|
+
// client.scrape();
|
|
101
|
+
// });
|
|
102
|
+
// });
|
|
103
|
+
|
|
104
|
+
// client.on('scrape', function (data) {
|
|
105
|
+
// console.log('number of leechers in the swarm: ' + data.incomplete)
|
|
106
|
+
// })
|
|
107
|
+
|
|
108
|
+
// const handler: P2PConnectionHandler = {
|
|
109
|
+
// connect$,
|
|
110
|
+
// disconnect$,
|
|
111
|
+
// message$,
|
|
112
|
+
// response$,
|
|
113
|
+
// async send(peer: P2PPeer, message: P2PMessage) {
|
|
114
|
+
// await peer.send(JSON.stringify(message));
|
|
115
|
+
// },
|
|
116
|
+
// close() {
|
|
117
|
+
// client.close();
|
|
118
|
+
// connect$.complete();
|
|
119
|
+
// disconnect$.complete();
|
|
120
|
+
// message$.complete();
|
|
121
|
+
// response$.complete();
|
|
122
|
+
// return PROMISE_RESOLVE_VOID;
|
|
123
|
+
// }
|
|
124
|
+
// }
|
|
125
|
+
// client.start();
|
|
126
|
+
// client.update();
|
|
127
|
+
// client.scrape();
|
|
128
|
+
// setInterval(() => {
|
|
129
|
+
// // client.update();
|
|
130
|
+
// }, 10000);
|
|
131
|
+
// return handler;
|
|
132
|
+
// };
|
|
133
|
+
|
|
134
|
+
// return creator;
|
|
135
|
+
// }
|
|
136
|
+
"use strict";
|
|
137
|
+
//# sourceMappingURL=connection-handler-webtorrent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-handler-webtorrent.js","names":[],"sources":["../../../../src/plugins/replication-webrtc/connection-handler-webtorrent.ts"],"sourcesContent":["// /**\r\n// * Uses the Webtorrent servers as signaling server, works similar to p2pt.\r\n// * We could not use p2pt directly because it has so many bugs and behaves wrong in\r\n// * cases with more than 2 peers.\r\n// * @link https://github.com/subins2000/p2pt/blob/master/p2pt.js\r\n// */\r\n\r\n// import { Subject } from 'rxjs';\r\n// import { PROMISE_RESOLVE_VOID, randomToken } from '../../util';\r\n// import { P2PConnectionHandler, P2PConnectionHandlerCreator, P2PMessage, P2PPeer, PeerWithMessage, PeerWithResponse } from './p2p-types';\r\n// const wrtc = require('wrtc');\r\n\r\n// const WebSocketTracker = require('bittorrent-tracker/lib/client/websocket-tracker');\r\n// const Client = require('bittorrent-tracker');\r\n// const randombytes = require('randombytes');\r\n// const EventEmitter = require('events');\r\n// const sha1 = require('simple-sha1');\r\n// const debug = require('debug')('p2pt');\r\n\r\n\r\n// export const P2PT_DEFAULT_TRACKERS = [\r\n// 'wss://tracker.files.fm:7073/announce',\r\n// 'wss://tracker.btorrent.xyz',\r\n// 'wss://spacetradersapi-chatbox.herokuapp.com:443/announce',\r\n// 'wss://qot.abiir.top:443/announce'\r\n// ];\r\n\r\n// export function getConnectionHandlerWebtorrent(\r\n// trackers: string[] = P2PT_DEFAULT_TRACKERS,\r\n// /**\r\n// * Port is only required in Node.js,\r\n// * not on browsers.\r\n// */\r\n// torrentClientPort = 18669\r\n// ): P2PConnectionHandlerCreator {\r\n// const creator: P2PConnectionHandlerCreator = (options) => {\r\n// /**\r\n// * @link https://github.com/webtorrent/bittorrent-tracker#client\r\n// */\r\n// const requiredOpts = {\r\n// infoHash: sha1.sync(options.topic).toLowerCase(),\r\n// peerId: randombytes(20),\r\n// announce: trackers,\r\n// port: torrentClientPort,\r\n// wrtc\r\n// }\r\n// const client = new Client(requiredOpts);\r\n\r\n// const connect$ = new Subject<P2PPeer>();\r\n// const disconnect$ = new Subject<P2PPeer>();\r\n// const message$ = new Subject<PeerWithMessage>();\r\n// const response$ = new Subject<PeerWithResponse>();\r\n\r\n\r\n// client.on('error', function (err) {\r\n// console.error('fatal client error! ' + requiredOpts.peerId.toString('hex'));\r\n// console.log(err.message)\r\n// })\r\n\r\n// client.on('warning', function (err) {\r\n// // a tracker was unavailable or sent bad data to the client. you can probably ignore it\r\n// console.log(err.message)\r\n// })\r\n\r\n// client.on('update', function (data) {\r\n// console.log('got an announce response from tracker: ' + data.announce)\r\n// console.log('number of seeders in the swarm: ' + data.complete)\r\n// console.log('number of leechers in the swarm: ' + data.incomplete)\r\n// });\r\n\r\n// const knownPeers = new Set<string>();\r\n// client.on('peer', function (peer: P2PPeer) {\r\n// console.log('found a peer: ' + peer.id + ' ' + requiredOpts.peerId.toString('hex')) // 85.10.239.191:48623\r\n// if (knownPeers.has(peer.id)) {\r\n// return;\r\n// }\r\n// knownPeers.add(peer.id);\r\n// peer.once('connect', () => {\r\n// connect$.next(peer);\r\n// });\r\n// peer.on('data', (data: Buffer) => {\r\n// console.log('# GOT DATA FROM PEER:');\r\n// const messageOrResponse = JSON.parse(data as any);\r\n// console.dir(messageOrResponse);\r\n// if (messageOrResponse.result) {\r\n// response$.next({\r\n// peer: peer as any,\r\n// response: messageOrResponse\r\n// });\r\n// } else {\r\n// message$.next({\r\n// peer,\r\n// message: JSON.parse(data)\r\n// });\r\n// }\r\n// });\r\n// peer.on('signal', (signal) => {\r\n// console.log('GOT SIGNAL: ' + requiredOpts.peerId.toString('hex'));\r\n// console.dir(signal);\r\n// client.signal(signal);\r\n// client.update();\r\n// client.scrape();\r\n// });\r\n// });\r\n\r\n// client.on('scrape', function (data) {\r\n// console.log('number of leechers in the swarm: ' + data.incomplete)\r\n// })\r\n\r\n// const handler: P2PConnectionHandler = {\r\n// connect$,\r\n// disconnect$,\r\n// message$,\r\n// response$,\r\n// async send(peer: P2PPeer, message: P2PMessage) {\r\n// await peer.send(JSON.stringify(message));\r\n// },\r\n// close() {\r\n// client.close();\r\n// connect$.complete();\r\n// disconnect$.complete();\r\n// message$.complete();\r\n// response$.complete();\r\n// return PROMISE_RESOLVE_VOID;\r\n// }\r\n// }\r\n// client.start();\r\n// client.update();\r\n// client.scrape();\r\n// setInterval(() => {\r\n// // client.update();\r\n// }, 10000);\r\n// return handler;\r\n// };\r\n\r\n// return creator;\r\n// }\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
replicateWebRTC: true,
|
|
8
|
+
RxWebRTCReplicationPool: true
|
|
9
|
+
};
|
|
10
|
+
exports.RxWebRTCReplicationPool = void 0;
|
|
11
|
+
exports.replicateWebRTC = replicateWebRTC;
|
|
12
|
+
var _rxjs = require("rxjs");
|
|
13
|
+
var _plugin = require("../../plugin.js");
|
|
14
|
+
var _index = require("../../replication-protocol/index.js");
|
|
15
|
+
var _index2 = require("../../plugins/utils/index.js");
|
|
16
|
+
var _index3 = require("../leader-election/index.js");
|
|
17
|
+
var _index4 = require("../replication/index.js");
|
|
18
|
+
var _webrtcHelper = require("./webrtc-helper.js");
|
|
19
|
+
Object.keys(_webrtcHelper).forEach(function (key) {
|
|
20
|
+
if (key === "default" || key === "__esModule") return;
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
22
|
+
if (key in exports && exports[key] === _webrtcHelper[key]) return;
|
|
23
|
+
Object.defineProperty(exports, key, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return _webrtcHelper[key];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
var _rxError = require("../../rx-error.js");
|
|
31
|
+
var _signalingServer = require("./signaling-server.js");
|
|
32
|
+
Object.keys(_signalingServer).forEach(function (key) {
|
|
33
|
+
if (key === "default" || key === "__esModule") return;
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
35
|
+
if (key in exports && exports[key] === _signalingServer[key]) return;
|
|
36
|
+
Object.defineProperty(exports, key, {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _signalingServer[key];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
var _webrtcTypes = require("./webrtc-types.js");
|
|
44
|
+
Object.keys(_webrtcTypes).forEach(function (key) {
|
|
45
|
+
if (key === "default" || key === "__esModule") return;
|
|
46
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
47
|
+
if (key in exports && exports[key] === _webrtcTypes[key]) return;
|
|
48
|
+
Object.defineProperty(exports, key, {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _webrtcTypes[key];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
var _connectionHandlerSimplePeer = require("./connection-handler-simple-peer.js");
|
|
56
|
+
Object.keys(_connectionHandlerSimplePeer).forEach(function (key) {
|
|
57
|
+
if (key === "default" || key === "__esModule") return;
|
|
58
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
59
|
+
if (key in exports && exports[key] === _connectionHandlerSimplePeer[key]) return;
|
|
60
|
+
Object.defineProperty(exports, key, {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _connectionHandlerSimplePeer[key];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
async function replicateWebRTC(options) {
|
|
68
|
+
var collection = options.collection;
|
|
69
|
+
(0, _plugin.addRxPlugin)(_index3.RxDBLeaderElectionPlugin);
|
|
70
|
+
|
|
71
|
+
// fill defaults
|
|
72
|
+
if (options.pull) {
|
|
73
|
+
if (!options.pull.batchSize) {
|
|
74
|
+
options.pull.batchSize = 20;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (options.push) {
|
|
78
|
+
if (!options.push.batchSize) {
|
|
79
|
+
options.push.batchSize = 20;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (collection.database.multiInstance) {
|
|
83
|
+
await collection.database.waitForLeadership();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// used to easier debug stuff
|
|
87
|
+
var requestCounter = 0;
|
|
88
|
+
var requestFlag = (0, _index2.randomToken)(10);
|
|
89
|
+
function getRequestId() {
|
|
90
|
+
var count = requestCounter++;
|
|
91
|
+
return collection.database.token + '|' + requestFlag + '|' + count;
|
|
92
|
+
}
|
|
93
|
+
var storageToken = await collection.database.storageToken;
|
|
94
|
+
var pool = new RxWebRTCReplicationPool(collection, options, await options.connectionHandlerCreator(options));
|
|
95
|
+
pool.subs.push(pool.connectionHandler.error$.subscribe(err => pool.error$.next(err)), pool.connectionHandler.disconnect$.subscribe(peer => pool.removePeer(peer)));
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Answer if someone requests our storage token
|
|
99
|
+
*/
|
|
100
|
+
pool.subs.push(pool.connectionHandler.message$.pipe((0, _rxjs.filter)(data => data.message.method === 'token')).subscribe(data => {
|
|
101
|
+
pool.connectionHandler.send(data.peer, {
|
|
102
|
+
id: data.message.id,
|
|
103
|
+
result: storageToken
|
|
104
|
+
});
|
|
105
|
+
}));
|
|
106
|
+
var connectSub = pool.connectionHandler.connect$.pipe((0, _rxjs.filter)(() => !pool.canceled)).subscribe(async peer => {
|
|
107
|
+
if (options.isPeerValid) {
|
|
108
|
+
var isValid = await options.isPeerValid(peer);
|
|
109
|
+
if (!isValid) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
var peerToken;
|
|
114
|
+
try {
|
|
115
|
+
var tokenResponse = await (0, _webrtcHelper.sendMessageAndAwaitAnswer)(pool.connectionHandler, peer, {
|
|
116
|
+
id: getRequestId(),
|
|
117
|
+
method: 'token',
|
|
118
|
+
params: []
|
|
119
|
+
});
|
|
120
|
+
peerToken = tokenResponse.result;
|
|
121
|
+
} catch (error) {
|
|
122
|
+
/**
|
|
123
|
+
* If could not get the tokenResponse,
|
|
124
|
+
* just ignore that peer.
|
|
125
|
+
*/
|
|
126
|
+
pool.error$.next((0, _rxError.newRxError)('RC_WEBRTC_PEER', {
|
|
127
|
+
error
|
|
128
|
+
}));
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
var isMaster = await (0, _webrtcHelper.isMasterInWebRTCReplication)(collection.database.hashFunction, storageToken, peerToken);
|
|
132
|
+
var replicationState;
|
|
133
|
+
if (isMaster) {
|
|
134
|
+
var masterHandler = pool.masterReplicationHandler;
|
|
135
|
+
var masterChangeStreamSub = masterHandler.masterChangeStream$.subscribe(ev => {
|
|
136
|
+
var streamResponse = {
|
|
137
|
+
id: 'masterChangeStream$',
|
|
138
|
+
result: ev
|
|
139
|
+
};
|
|
140
|
+
pool.connectionHandler.send(peer, streamResponse);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// clean up the subscription
|
|
144
|
+
pool.subs.push(masterChangeStreamSub, pool.connectionHandler.disconnect$.pipe((0, _rxjs.filter)(p => p === peer)).subscribe(() => masterChangeStreamSub.unsubscribe()));
|
|
145
|
+
var messageSub = pool.connectionHandler.message$.pipe((0, _rxjs.filter)(data => data.peer === peer), (0, _rxjs.filter)(data => data.message.method !== 'token')).subscribe(async data => {
|
|
146
|
+
var {
|
|
147
|
+
peer: msgPeer,
|
|
148
|
+
message
|
|
149
|
+
} = data;
|
|
150
|
+
/**
|
|
151
|
+
* If it is not a function,
|
|
152
|
+
* it means that the client requested the masterChangeStream$
|
|
153
|
+
*/
|
|
154
|
+
var method = masterHandler[message.method].bind(masterHandler);
|
|
155
|
+
var result = await method(...message.params);
|
|
156
|
+
var response = {
|
|
157
|
+
id: message.id,
|
|
158
|
+
result
|
|
159
|
+
};
|
|
160
|
+
pool.connectionHandler.send(msgPeer, response);
|
|
161
|
+
});
|
|
162
|
+
pool.subs.push(messageSub);
|
|
163
|
+
} else {
|
|
164
|
+
replicationState = (0, _index4.replicateRxCollection)({
|
|
165
|
+
replicationIdentifier: [collection.name, options.topic, peerToken].join('||'),
|
|
166
|
+
collection: collection,
|
|
167
|
+
autoStart: true,
|
|
168
|
+
deletedField: '_deleted',
|
|
169
|
+
live: true,
|
|
170
|
+
retryTime: options.retryTime,
|
|
171
|
+
waitForLeadership: false,
|
|
172
|
+
pull: options.pull ? Object.assign({}, options.pull, {
|
|
173
|
+
async handler(lastPulledCheckpoint) {
|
|
174
|
+
var answer = await (0, _webrtcHelper.sendMessageAndAwaitAnswer)(pool.connectionHandler, peer, {
|
|
175
|
+
method: 'masterChangesSince',
|
|
176
|
+
params: [lastPulledCheckpoint, (0, _index2.ensureNotFalsy)(options.pull).batchSize],
|
|
177
|
+
id: getRequestId()
|
|
178
|
+
});
|
|
179
|
+
return answer.result;
|
|
180
|
+
},
|
|
181
|
+
stream$: pool.connectionHandler.response$.pipe((0, _rxjs.filter)(m => m.response.id === 'masterChangeStream$'), (0, _rxjs.map)(m => m.response.result))
|
|
182
|
+
}) : undefined,
|
|
183
|
+
push: options.push ? Object.assign({}, options.push, {
|
|
184
|
+
async handler(docs) {
|
|
185
|
+
var answer = await (0, _webrtcHelper.sendMessageAndAwaitAnswer)(pool.connectionHandler, peer, {
|
|
186
|
+
method: 'masterWrite',
|
|
187
|
+
params: [docs],
|
|
188
|
+
id: getRequestId()
|
|
189
|
+
});
|
|
190
|
+
return answer.result;
|
|
191
|
+
}
|
|
192
|
+
}) : undefined
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
pool.addPeer(peer, replicationState);
|
|
196
|
+
});
|
|
197
|
+
pool.subs.push(connectSub);
|
|
198
|
+
return pool;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Because the WebRTC replication runs between many instances,
|
|
203
|
+
* we use a Pool instead of returning a single replication state.
|
|
204
|
+
*/
|
|
205
|
+
var RxWebRTCReplicationPool = exports.RxWebRTCReplicationPool = /*#__PURE__*/function () {
|
|
206
|
+
function RxWebRTCReplicationPool(collection, options, connectionHandler) {
|
|
207
|
+
this.peerStates$ = new _rxjs.BehaviorSubject(new Map());
|
|
208
|
+
this.canceled = false;
|
|
209
|
+
this.subs = [];
|
|
210
|
+
this.error$ = new _rxjs.Subject();
|
|
211
|
+
this.collection = collection;
|
|
212
|
+
this.options = options;
|
|
213
|
+
this.connectionHandler = connectionHandler;
|
|
214
|
+
this.collection.onClose.push(() => this.cancel());
|
|
215
|
+
this.masterReplicationHandler = (0, _index.rxStorageInstanceToReplicationHandler)(collection.storageInstance, collection.conflictHandler, collection.database.token);
|
|
216
|
+
}
|
|
217
|
+
var _proto = RxWebRTCReplicationPool.prototype;
|
|
218
|
+
_proto.addPeer = function addPeer(peer,
|
|
219
|
+
// only if isMaster=false it has a replicationState
|
|
220
|
+
replicationState) {
|
|
221
|
+
var peerState = {
|
|
222
|
+
peer,
|
|
223
|
+
replicationState,
|
|
224
|
+
subs: []
|
|
225
|
+
};
|
|
226
|
+
this.peerStates$.next(this.peerStates$.getValue().set(peer, peerState));
|
|
227
|
+
if (replicationState) {
|
|
228
|
+
peerState.subs.push(replicationState.error$.subscribe(ev => this.error$.next(ev)));
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
_proto.removePeer = function removePeer(peer) {
|
|
232
|
+
var peerState = (0, _index2.getFromMapOrThrow)(this.peerStates$.getValue(), peer);
|
|
233
|
+
this.peerStates$.getValue().delete(peer);
|
|
234
|
+
this.peerStates$.next(this.peerStates$.getValue());
|
|
235
|
+
peerState.subs.forEach(sub => sub.unsubscribe());
|
|
236
|
+
if (peerState.replicationState) {
|
|
237
|
+
peerState.replicationState.cancel();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// often used in unit tests
|
|
242
|
+
;
|
|
243
|
+
_proto.awaitFirstPeer = function awaitFirstPeer() {
|
|
244
|
+
return (0, _rxjs.firstValueFrom)(this.peerStates$.pipe((0, _rxjs.filter)(peerStates => peerStates.size > 0)));
|
|
245
|
+
};
|
|
246
|
+
_proto.cancel = async function cancel() {
|
|
247
|
+
if (this.canceled) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
this.canceled = true;
|
|
251
|
+
this.subs.forEach(sub => sub.unsubscribe());
|
|
252
|
+
Array.from(this.peerStates$.getValue().keys()).forEach(peer => {
|
|
253
|
+
this.removePeer(peer);
|
|
254
|
+
});
|
|
255
|
+
await this.connectionHandler.close();
|
|
256
|
+
};
|
|
257
|
+
return RxWebRTCReplicationPool;
|
|
258
|
+
}(); // export * from './connection-handler-webtorrent';
|
|
259
|
+
// export * from './connection-handler-p2pcf';
|
|
260
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_rxjs","require","_plugin","_index","_index2","_index3","_index4","_webrtcHelper","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_rxError","_signalingServer","_webrtcTypes","_connectionHandlerSimplePeer","replicateWebRTC","options","collection","addRxPlugin","RxDBLeaderElectionPlugin","pull","batchSize","push","database","multiInstance","waitForLeadership","requestCounter","requestFlag","randomToken","getRequestId","count","token","storageToken","pool","RxWebRTCReplicationPool","connectionHandlerCreator","subs","connectionHandler","error$","subscribe","err","next","disconnect$","peer","removePeer","message$","pipe","filter","data","message","method","send","id","result","connectSub","connect$","canceled","isPeerValid","isValid","peerToken","tokenResponse","sendMessageAndAwaitAnswer","params","error","newRxError","isMaster","isMasterInWebRTCReplication","hashFunction","replicationState","masterHandler","masterReplicationHandler","masterChangeStreamSub","masterChangeStream$","ev","streamResponse","p","unsubscribe","messageSub","msgPeer","bind","response","replicateRxCollection","replicationIdentifier","name","topic","join","autoStart","deletedField","live","retryTime","assign","handler","lastPulledCheckpoint","answer","ensureNotFalsy","stream$","response$","m","map","undefined","docs","addPeer","peerStates$","BehaviorSubject","Map","Subject","onClose","cancel","rxStorageInstanceToReplicationHandler","storageInstance","conflictHandler","_proto","peerState","getValue","set","getFromMapOrThrow","delete","sub","awaitFirstPeer","firstValueFrom","peerStates","size","Array","from","close"],"sources":["../../../../src/plugins/replication-webrtc/index.ts"],"sourcesContent":["import {\r\n BehaviorSubject,\r\n filter,\r\n firstValueFrom,\r\n map,\r\n Subject,\r\n Subscription\r\n} from 'rxjs';\r\nimport { addRxPlugin } from '../../plugin.ts';\r\nimport { rxStorageInstanceToReplicationHandler } from '../../replication-protocol/index.ts';\r\nimport type {\r\n RxCollection,\r\n RxError,\r\n RxReplicationHandler,\r\n RxReplicationWriteToMasterRow,\r\n RxTypeError\r\n} from '../../types/index.d.ts';\r\nimport {\r\n ensureNotFalsy,\r\n getFromMapOrThrow,\r\n randomToken\r\n} from '../../plugins/utils/index.ts';\r\nimport { RxDBLeaderElectionPlugin } from '../leader-election/index.ts';\r\nimport { replicateRxCollection } from '../replication/index.ts';\r\nimport {\r\n isMasterInWebRTCReplication,\r\n sendMessageAndAwaitAnswer\r\n} from './webrtc-helper.ts';\r\nimport type {\r\n PeerWithMessage,\r\n PeerWithResponse,\r\n WebRTCConnectionHandler,\r\n WebRTCPeerState,\r\n WebRTCReplicationCheckpoint,\r\n WebRTCResponse,\r\n RxWebRTCReplicationState,\r\n SyncOptionsWebRTC\r\n} from './webrtc-types.ts';\r\nimport { newRxError } from '../../rx-error.ts';\r\n\r\n\r\nexport async function replicateWebRTC<RxDocType, PeerType>(\r\n options: SyncOptionsWebRTC<RxDocType, PeerType>\r\n): Promise<RxWebRTCReplicationPool<RxDocType, PeerType>> {\r\n const collection = options.collection;\r\n addRxPlugin(RxDBLeaderElectionPlugin);\r\n\r\n // fill defaults\r\n if (options.pull) {\r\n if (!options.pull.batchSize) {\r\n options.pull.batchSize = 20;\r\n }\r\n }\r\n if (options.push) {\r\n if (!options.push.batchSize) {\r\n options.push.batchSize = 20;\r\n }\r\n }\r\n\r\n if (collection.database.multiInstance) {\r\n await collection.database.waitForLeadership();\r\n }\r\n\r\n // used to easier debug stuff\r\n let requestCounter = 0;\r\n const requestFlag = randomToken(10);\r\n function getRequestId() {\r\n const count = requestCounter++;\r\n return collection.database.token + '|' + requestFlag + '|' + count;\r\n }\r\n\r\n const storageToken = await collection.database.storageToken;\r\n const pool = new RxWebRTCReplicationPool(\r\n collection,\r\n options,\r\n await options.connectionHandlerCreator(options)\r\n );\r\n\r\n\r\n pool.subs.push(\r\n pool.connectionHandler.error$.subscribe((err: RxError | RxTypeError) => pool.error$.next(err)),\r\n pool.connectionHandler.disconnect$.subscribe((peer: PeerType) => pool.removePeer(peer))\r\n );\r\n\r\n /**\r\n * Answer if someone requests our storage token\r\n */\r\n pool.subs.push(\r\n pool.connectionHandler.message$.pipe(\r\n filter((data: PeerWithMessage<PeerType>) => data.message.method === 'token')\r\n ).subscribe((data: PeerWithMessage<PeerType>) => {\r\n pool.connectionHandler.send(data.peer, {\r\n id: data.message.id,\r\n result: storageToken\r\n });\r\n })\r\n );\r\n\r\n const connectSub = pool.connectionHandler.connect$\r\n .pipe(\r\n filter(() => !pool.canceled)\r\n )\r\n .subscribe(async (peer: PeerType) => {\r\n if (options.isPeerValid) {\r\n const isValid = await options.isPeerValid(peer);\r\n if (!isValid) {\r\n return;\r\n }\r\n }\r\n\r\n let peerToken: string;\r\n try {\r\n const tokenResponse = await sendMessageAndAwaitAnswer(\r\n pool.connectionHandler,\r\n peer,\r\n {\r\n id: getRequestId(),\r\n method: 'token',\r\n params: []\r\n }\r\n );\r\n peerToken = tokenResponse.result;\r\n } catch (error: any) {\r\n /**\r\n * If could not get the tokenResponse,\r\n * just ignore that peer.\r\n */\r\n pool.error$.next(newRxError('RC_WEBRTC_PEER', {\r\n error\r\n }));\r\n return;\r\n }\r\n const isMaster = await isMasterInWebRTCReplication(collection.database.hashFunction, storageToken, peerToken);\r\n\r\n let replicationState: RxWebRTCReplicationState<RxDocType> | undefined;\r\n if (isMaster) {\r\n const masterHandler = pool.masterReplicationHandler;\r\n const masterChangeStreamSub = masterHandler.masterChangeStream$.subscribe((ev: any) => {\r\n const streamResponse: WebRTCResponse = {\r\n id: 'masterChangeStream$',\r\n result: ev\r\n };\r\n pool.connectionHandler.send(peer, streamResponse);\r\n });\r\n\r\n // clean up the subscription\r\n pool.subs.push(\r\n masterChangeStreamSub,\r\n pool.connectionHandler.disconnect$.pipe(\r\n filter((p: PeerType) => p === peer)\r\n ).subscribe(() => masterChangeStreamSub.unsubscribe())\r\n );\r\n\r\n const messageSub = pool.connectionHandler.message$\r\n .pipe(\r\n filter((data: PeerWithMessage<PeerType>) => data.peer === peer),\r\n filter((data: PeerWithMessage<PeerType>) => data.message.method !== 'token')\r\n )\r\n .subscribe(async (data: PeerWithMessage<PeerType>) => {\r\n const { peer: msgPeer, message } = data;\r\n /**\r\n * If it is not a function,\r\n * it means that the client requested the masterChangeStream$\r\n */\r\n const method = (masterHandler as any)[message.method].bind(masterHandler);\r\n const result = await (method as any)(...message.params);\r\n const response: WebRTCResponse = {\r\n id: message.id,\r\n result\r\n };\r\n pool.connectionHandler.send(msgPeer, response);\r\n });\r\n pool.subs.push(messageSub);\r\n } else {\r\n replicationState = replicateRxCollection({\r\n replicationIdentifier: [collection.name, options.topic, peerToken].join('||'),\r\n collection: collection,\r\n autoStart: true,\r\n deletedField: '_deleted',\r\n live: true,\r\n retryTime: options.retryTime,\r\n waitForLeadership: false,\r\n pull: options.pull ? Object.assign({}, options.pull, {\r\n async handler(lastPulledCheckpoint: WebRTCReplicationCheckpoint | undefined) {\r\n const answer = await sendMessageAndAwaitAnswer(\r\n pool.connectionHandler,\r\n peer,\r\n {\r\n method: 'masterChangesSince',\r\n params: [\r\n lastPulledCheckpoint,\r\n ensureNotFalsy(options.pull).batchSize\r\n ],\r\n id: getRequestId()\r\n }\r\n );\r\n return answer.result;\r\n },\r\n stream$: pool.connectionHandler.response$.pipe(\r\n filter((m: PeerWithResponse<PeerType>) => m.response.id === 'masterChangeStream$'),\r\n map((m: PeerWithResponse<PeerType>) => m.response.result)\r\n )\r\n\r\n }) : undefined,\r\n push: options.push ? Object.assign({}, options.push, {\r\n async handler(docs: RxReplicationWriteToMasterRow<RxDocType>[]) {\r\n const answer = await sendMessageAndAwaitAnswer(\r\n pool.connectionHandler,\r\n peer,\r\n {\r\n method: 'masterWrite',\r\n params: [docs],\r\n id: getRequestId()\r\n }\r\n );\r\n return answer.result;\r\n }\r\n }) : undefined\r\n });\r\n }\r\n pool.addPeer(peer, replicationState);\r\n });\r\n pool.subs.push(connectSub);\r\n return pool;\r\n}\r\n\r\n\r\n/**\r\n * Because the WebRTC replication runs between many instances,\r\n * we use a Pool instead of returning a single replication state.\r\n */\r\nexport class RxWebRTCReplicationPool<RxDocType, PeerType> {\r\n peerStates$: BehaviorSubject<Map<PeerType, WebRTCPeerState<RxDocType, PeerType>>> = new BehaviorSubject(new Map());\r\n canceled: boolean = false;\r\n masterReplicationHandler: RxReplicationHandler<RxDocType, WebRTCReplicationCheckpoint>;\r\n subs: Subscription[] = [];\r\n\r\n public error$ = new Subject<RxError | RxTypeError>();\r\n\r\n constructor(\r\n public readonly collection: RxCollection<RxDocType, any, any, any>,\r\n public readonly options: SyncOptionsWebRTC<RxDocType, PeerType>,\r\n public readonly connectionHandler: WebRTCConnectionHandler<PeerType>\r\n ) {\r\n this.collection.onClose.push(() => this.cancel());\r\n this.masterReplicationHandler = rxStorageInstanceToReplicationHandler(\r\n collection.storageInstance,\r\n collection.conflictHandler,\r\n collection.database.token,\r\n );\r\n }\r\n\r\n addPeer(\r\n peer: PeerType,\r\n // only if isMaster=false it has a replicationState\r\n replicationState?: RxWebRTCReplicationState<RxDocType>\r\n ) {\r\n const peerState: WebRTCPeerState<RxDocType, PeerType> = {\r\n peer,\r\n replicationState,\r\n subs: []\r\n };\r\n this.peerStates$.next(this.peerStates$.getValue().set(peer, peerState));\r\n if (replicationState) {\r\n peerState.subs.push(\r\n replicationState.error$.subscribe((ev: RxError | RxTypeError) => this.error$.next(ev))\r\n );\r\n }\r\n }\r\n removePeer(peer: PeerType) {\r\n const peerState: WebRTCPeerState<RxDocType, PeerType> = getFromMapOrThrow(this.peerStates$.getValue(), peer) as WebRTCPeerState<RxDocType, PeerType>;\r\n this.peerStates$.getValue().delete(peer);\r\n this.peerStates$.next(this.peerStates$.getValue());\r\n peerState.subs.forEach((sub: Subscription) => sub.unsubscribe());\r\n if (peerState.replicationState) {\r\n peerState.replicationState.cancel();\r\n }\r\n }\r\n\r\n // often used in unit tests\r\n awaitFirstPeer() {\r\n return firstValueFrom(\r\n this.peerStates$.pipe(\r\n filter((peerStates: Map<PeerType, WebRTCPeerState<RxDocType, PeerType>>) => peerStates.size > 0)\r\n )\r\n );\r\n }\r\n\r\n public async cancel() {\r\n if (this.canceled) {\r\n return;\r\n }\r\n this.canceled = true;\r\n this.subs.forEach((sub: Subscription) => sub.unsubscribe());\r\n (Array.from(this.peerStates$.getValue().keys()) as PeerType[]).forEach((peer: PeerType) => {\r\n this.removePeer(peer);\r\n });\r\n await this.connectionHandler.close();\r\n }\r\n}\r\n\r\nexport * from './webrtc-helper.ts';\r\nexport * from './signaling-server.ts';\r\nexport * from './webrtc-types.ts';\r\n// export * from './connection-handler-webtorrent';\r\n// export * from './connection-handler-p2pcf';\r\nexport * from './connection-handler-simple-peer.ts';\r\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAQA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAQA,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