@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":"downstream.js","names":["newRxFetchError","ensureNotFalsy","lastOfArray","fetchDocumentContents","getDriveBaseUrl","fetchChanges","oneDriveState","init","checkpoint","batchSize","filesResult","fetchChangesFiles","contents","files","map","file","id","documents","ordered","baseUrl","OVERFETCH_AMOUNT","url","docsFolderId","params","URLSearchParams","set","toString","lastModifiedDateTime","res","fetch","headers","Authorization","authToken","ok","data","json","value","filter","docId","name","split","docIdsWithSameModifiedTime","includes","slice","first","newCheckpoint","last","lastModified","oldIds","concat"],"sources":["../../../../src/plugins/replication-microsoft-onedrive/downstream.ts"],"sourcesContent":["import { newRxFetchError } from '../../rx-error.ts';\r\nimport { ensureNotFalsy, lastOfArray } from '../utils/index.ts';\r\nimport { fetchDocumentContents } from './document-handling.ts';\r\nimport type {\r\n OneDriveItem,\r\n OneDriveCheckpointType,\r\n OneDriveState\r\n} from './microsoft-onedrive-types.ts';\r\nimport { DriveStructure } from './init.ts';\r\nimport { getDriveBaseUrl } from './microsoft-onedrive-helper.ts';\r\n\r\nexport async function fetchChanges<DocType>(\r\n oneDriveState: OneDriveState,\r\n init: DriveStructure,\r\n checkpoint?: OneDriveCheckpointType,\r\n batchSize: number = 10\r\n): Promise<{\r\n checkpoint: OneDriveCheckpointType | undefined,\r\n documents: DocType[]\r\n}> {\r\n const filesResult = await fetchChangesFiles(\r\n oneDriveState,\r\n init,\r\n checkpoint,\r\n batchSize\r\n );\r\n\r\n const contents = await fetchDocumentContents<DocType>(\r\n oneDriveState,\r\n filesResult.files.map(file => file.id)\r\n );\r\n\r\n return {\r\n checkpoint: filesResult.checkpoint,\r\n documents: contents.ordered\r\n };\r\n}\r\n\r\n\r\nexport async function fetchChangesFiles(\r\n oneDriveState: OneDriveState,\r\n init: DriveStructure,\r\n checkpoint?: OneDriveCheckpointType,\r\n batchSize: number = 10\r\n): Promise<{\r\n checkpoint?: OneDriveCheckpointType,\r\n files: OneDriveItem[]\r\n}> {\r\n\r\n const baseUrl = getDriveBaseUrl(oneDriveState);\r\n\r\n // Intentionally overfetch in case multiple docs have the same lastModifiedDateTime.\r\n const OVERFETCH_AMOUNT = 6;\r\n let url = `${baseUrl}/items/${init.docsFolderId}/children?`;\r\n\r\n const params = new URLSearchParams();\r\n params.set('$top', (batchSize + OVERFETCH_AMOUNT).toString());\r\n params.set('$select', 'id,name,eTag,lastModifiedDateTime,size,file');\r\n params.set('$orderby', 'lastModifiedDateTime asc,name asc');\r\n\r\n if (checkpoint) {\r\n // Warning: MS Graph $filter with string timestamps \r\n params.set('$filter', `lastModifiedDateTime ge '${checkpoint.lastModifiedDateTime}'`);\r\n }\r\n\r\n url += params.toString();\r\n\r\n const res = await fetch(url, {\r\n headers: {\r\n Authorization: `Bearer ${oneDriveState.authToken}`,\r\n },\r\n });\r\n\r\n if (!res.ok) {\r\n throw await newRxFetchError(res);\r\n }\r\n\r\n const data: { value: OneDriveItem[] } = await res.json();\r\n\r\n let files = data.value || [];\r\n if (checkpoint) {\r\n files = files.filter(file => {\r\n if (file.lastModifiedDateTime === checkpoint.lastModifiedDateTime) {\r\n // If it's the exact same time, check if we already processed it\r\n const docId = file.name.split('.')[0];\r\n return !(checkpoint as any).docIdsWithSameModifiedTime?.includes(docId);\r\n }\r\n return true;\r\n });\r\n }\r\n\r\n files = files.slice(0, batchSize);\r\n const first = files[0];\r\n\r\n let newCheckpoint = checkpoint;\r\n const last = lastOfArray(files);\r\n\r\n if (last) {\r\n const lastModified = ensureNotFalsy(last.lastModifiedDateTime);\r\n let docIdsWithSameModifiedTime = files\r\n .filter(file => file.lastModifiedDateTime === lastModified)\r\n .map(file => file.name.split('.')[0]);\r\n\r\n if (checkpoint && first && first.lastModifiedDateTime === checkpoint.lastModifiedDateTime) {\r\n const oldIds = (checkpoint as any).docIdsWithSameModifiedTime || [];\r\n docIdsWithSameModifiedTime = docIdsWithSameModifiedTime.concat(oldIds);\r\n }\r\n\r\n newCheckpoint = {\r\n docIdsWithSameModifiedTime,\r\n lastModifiedDateTime: lastModified\r\n } as any;\r\n // using 'any' to dynamically assign docIdsWithSameModifiedTime, \r\n // as doing it on the type strictly might conflict with standard Checkpoint usage in RxDB.\r\n }\r\n\r\n return {\r\n checkpoint: newCheckpoint,\r\n files\r\n };\r\n}\r\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,cAAc,EAAEC,WAAW,QAAQ,mBAAmB;AAC/D,SAASC,qBAAqB,QAAQ,wBAAwB;AAO9D,SAASC,eAAe,QAAQ,gCAAgC;AAEhE,OAAO,eAAeC,YAAYA,CAC9BC,aAA4B,EAC5BC,IAAoB,EACpBC,UAAmC,EACnCC,SAAiB,GAAG,EAAE,EAIvB;EACC,IAAMC,WAAW,GAAG,MAAMC,iBAAiB,CACvCL,aAAa,EACbC,IAAI,EACJC,UAAU,EACVC,SACJ,CAAC;EAED,IAAMG,QAAQ,GAAG,MAAMT,qBAAqB,CACxCG,aAAa,EACbI,WAAW,CAACG,KAAK,CAACC,GAAG,CAACC,IAAI,IAAIA,IAAI,CAACC,EAAE,CACzC,CAAC;EAED,OAAO;IACHR,UAAU,EAAEE,WAAW,CAACF,UAAU;IAClCS,SAAS,EAAEL,QAAQ,CAACM;EACxB,CAAC;AACL;AAGA,OAAO,eAAeP,iBAAiBA,CACnCL,aAA4B,EAC5BC,IAAoB,EACpBC,UAAm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C,CAAC,CAAC;QACrC,OAAO,CAAEhC,UAAU,CAASiC,0BAA0B,EAAEC,QAAQ,CAACJ,KAAK,CAAC;MAC3E;MACA,OAAO,IAAI;IACf,CAAC,CAAC;EACN;EAEAzB,KAAK,GAAGA,KAAK,CAAC8B,KAAK,CAAC,CAAC,EAAElC,SAAS,CAAC;EACjC,IAAMmC,KAAK,GAAG/B,KAAK,CAAC,CAAC,CAAC;EAEtB,IAAIgC,aAAa,GAAGrC,UAAU;EAC9B,IAAMsC,IAAI,GAAG5C,WAAW,CAACW,KAAK,CAAC;EAE/B,IAAIiC,IAAI,EAAE;IACN,IAAMC,YAAY,GAAG9C,cAAc,CAAC6C,IAAI,CAACnB,oBAAoB,CAAC;IAC9D,IAAIc,0BAA0B,GAAG5B,KAAK,CACjCwB,MAAM,CAACtB,IAAI,IAAIA,IAAI,CAACY,oBAAoB,KAAKoB,YAAY,CAAC,CAC1DjC,GAAG,CAACC,IAAI,IAAIA,IAAI,CAACwB,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,IAAIhC,UAAU,IAAIoC,KAAK,IAAIA,KAAK,CAACjB,oBAAoB,KAAKnB,UAAU,CAACmB,oBAAoB,EAAE;MACvF,IAAMqB,MAAM,GAAIxC,UAAU,CAASiC,0BAA0B,IAAI,EAAE;MACnEA,0BAA0B,GAAGA,0BAA0B,CAACQ,MAAM,CAACD,MAAM,CAAC;IAC1E;IAEAH,aAAa,GAAG;MACZJ,0BAA0B;MAC1Bd,oBAAoB,EAAEoB;IAC1B,CAAQ;IACR;IACA;EACJ;EAEA,OAAO;IACHvC,UAAU,EAAEqC,aAAa;IACzBhC;EACJ,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
2
|
+
import { RxDBLeaderElectionPlugin } from "../leader-election/index.js";
|
|
3
|
+
import { RxReplicationState, startReplicationOnLeaderShip } from "../replication/index.js";
|
|
4
|
+
import { addRxPlugin } from "../../index.js";
|
|
5
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
import { initDriveStructure } from "./init.js";
|
|
7
|
+
import { handleUpstreamBatch } from "./upstream.js";
|
|
8
|
+
import { fetchChanges } from "./downstream.js";
|
|
9
|
+
import { runInTransaction } from "./transaction.js";
|
|
10
|
+
import { ensureProcessNextTickIsSet } from "../replication-webrtc/connection-handler-simple-peer.js";
|
|
11
|
+
import { SignalingState } from "./signaling.js";
|
|
12
|
+
export * from "./microsoft-onedrive-types.js";
|
|
13
|
+
export * from "./microsoft-onedrive-helper.js";
|
|
14
|
+
export * from "./transaction.js";
|
|
15
|
+
export * from "./init.js";
|
|
16
|
+
export * from "./document-handling.js";
|
|
17
|
+
export * from "./downstream.js";
|
|
18
|
+
export * from "./upstream.js";
|
|
19
|
+
export * from "./signaling.js";
|
|
20
|
+
export var DEFAULT_TRANSACTION_TIMEOUT = 60 * 1000;
|
|
21
|
+
export var RxOneDriveReplicationState = /*#__PURE__*/function (_RxReplicationState) {
|
|
22
|
+
/**
|
|
23
|
+
* Only exists on live replication
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
function RxOneDriveReplicationState(oneDrive, driveStructure, replicationIdentifierHash, collection, pull, push, signalingOptions, live = true, retryTime = 1000 * 5, autoStart = true) {
|
|
27
|
+
var _this;
|
|
28
|
+
_this = _RxReplicationState.call(this, replicationIdentifierHash, collection, '_deleted', pull, push, live, retryTime, autoStart) || this;
|
|
29
|
+
_this.oneDrive = oneDrive;
|
|
30
|
+
_this.driveStructure = driveStructure;
|
|
31
|
+
_this.replicationIdentifierHash = replicationIdentifierHash;
|
|
32
|
+
_this.collection = collection;
|
|
33
|
+
_this.pull = pull;
|
|
34
|
+
_this.push = push;
|
|
35
|
+
_this.signalingOptions = signalingOptions;
|
|
36
|
+
_this.live = live;
|
|
37
|
+
_this.retryTime = retryTime;
|
|
38
|
+
_this.autoStart = autoStart;
|
|
39
|
+
return _this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Notify other peers that something
|
|
44
|
+
* has or might have changed so that
|
|
45
|
+
* they can pull from their checkpoints.
|
|
46
|
+
*/
|
|
47
|
+
_inheritsLoose(RxOneDriveReplicationState, _RxReplicationState);
|
|
48
|
+
var _proto = RxOneDriveReplicationState.prototype;
|
|
49
|
+
_proto.notifyPeers = async function notifyPeers() {
|
|
50
|
+
if (this.signalingState) {
|
|
51
|
+
await this.signalingState.pingPeers('RESYNC');
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return RxOneDriveReplicationState;
|
|
55
|
+
}(RxReplicationState);
|
|
56
|
+
export async function replicateMicrosoftOneDrive(options) {
|
|
57
|
+
var collection = options.collection;
|
|
58
|
+
addRxPlugin(RxDBLeaderElectionPlugin);
|
|
59
|
+
var oneDriveState = Object.assign({
|
|
60
|
+
apiEndpoint: 'https://graph.microsoft.com/v1.0',
|
|
61
|
+
driveId: 'me/drive',
|
|
62
|
+
transactionTimeout: DEFAULT_TRANSACTION_TIMEOUT
|
|
63
|
+
}, options.oneDrive);
|
|
64
|
+
var driveStructure = await initDriveStructure(oneDriveState);
|
|
65
|
+
var replicationState;
|
|
66
|
+
var pullStream$ = new Subject();
|
|
67
|
+
var replicationPrimitivesPull;
|
|
68
|
+
options.live = typeof options.live === 'undefined' ? true : options.live;
|
|
69
|
+
options.waitForLeadership = typeof options.waitForLeadership === 'undefined' ? true : options.waitForLeadership;
|
|
70
|
+
if (options.pull) {
|
|
71
|
+
replicationPrimitivesPull = {
|
|
72
|
+
async handler(lastPulledCheckpoint, batchSize) {
|
|
73
|
+
return runInTransaction(oneDriveState, driveStructure, collection.schema.primaryPath, async () => {
|
|
74
|
+
var changes = await fetchChanges(oneDriveState, driveStructure, lastPulledCheckpoint, batchSize);
|
|
75
|
+
return changes;
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
batchSize: options.pull.batchSize,
|
|
79
|
+
modifier: options.pull.modifier,
|
|
80
|
+
stream$: pullStream$.asObservable(),
|
|
81
|
+
initialCheckpoint: options.pull.initialCheckpoint
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
var replicationPrimitivesPush;
|
|
85
|
+
if (options.push) {
|
|
86
|
+
replicationPrimitivesPush = {
|
|
87
|
+
async handler(rows) {
|
|
88
|
+
return runInTransaction(oneDriveState, driveStructure, collection.schema.primaryPath, async () => {
|
|
89
|
+
var conflicts = await handleUpstreamBatch(oneDriveState, driveStructure, options.collection.schema.primaryPath, rows);
|
|
90
|
+
return conflicts;
|
|
91
|
+
}, () => replicationState.notifyPeers().catch(() => {}));
|
|
92
|
+
},
|
|
93
|
+
batchSize: options.push.batchSize,
|
|
94
|
+
modifier: options.push.modifier
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
replicationState = new RxOneDriveReplicationState(oneDriveState, driveStructure, options.replicationIdentifier, collection, replicationPrimitivesPull, replicationPrimitivesPush, options.signalingOptions, options.live, options.retryTime, options.autoStart);
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* OneDrive has no websocket or server-send-events
|
|
101
|
+
* to observe file changes reliably enough for real-time web.
|
|
102
|
+
* Therefore we use WebRTC to connect clients which then can ping each other on changes.
|
|
103
|
+
* Instead of a signaling server, we use OneDrive itself
|
|
104
|
+
* to exchange signaling data.
|
|
105
|
+
*/
|
|
106
|
+
if (options.live && options.pull) {
|
|
107
|
+
ensureProcessNextTickIsSet();
|
|
108
|
+
var startBefore = replicationState.start.bind(replicationState);
|
|
109
|
+
var cancelBefore = replicationState.cancel.bind(replicationState);
|
|
110
|
+
replicationState.start = () => {
|
|
111
|
+
replicationState.signalingState = new SignalingState(replicationState.oneDrive, replicationState.driveStructure, options.signalingOptions ? options.signalingOptions : {});
|
|
112
|
+
var sub = replicationState.signalingState.resync$.subscribe(() => {
|
|
113
|
+
replicationState.reSync();
|
|
114
|
+
});
|
|
115
|
+
replicationState.cancel = () => {
|
|
116
|
+
sub.unsubscribe();
|
|
117
|
+
replicationState.signalingState?.close();
|
|
118
|
+
return cancelBefore();
|
|
119
|
+
};
|
|
120
|
+
return startBefore();
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
startReplicationOnLeaderShip(options.waitForLeadership, replicationState);
|
|
124
|
+
return replicationState;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["RxDBLeaderElectionPlugin","RxReplicationState","startReplicationOnLeaderShip","addRxPlugin","Subject","initDriveStructure","handleUpstreamBatch","fetchChanges","runInTransaction","ensureProcessNextTickIsSet","SignalingState","DEFAULT_TRANSACTION_TIMEOUT","RxOneDriveReplicationState","_RxReplicationState","oneDrive","driveStructure","replicationIdentifierHash","collection","pull","push","signalingOptions","live","retryTime","autoStart","_this","call","_inheritsLoose","_proto","prototype","notifyPeers","signalingState","pingPeers","replicateMicrosoftOneDrive","options","oneDriveState","Object","assign","apiEndpoint","driveId","transactionTimeout","replicationState","pullStream$","replicationPrimitivesPull","waitForLeadership","handler","lastPulledCheckpoint","batchSize","schema","primaryPath","changes","modifier","stream$","asObservable","initialCheckpoint","replicationPrimitivesPush","rows","conflicts","catch","replicationIdentifier","startBefore","start","bind","cancelBefore","cancel","sub","resync$","subscribe","reSync","unsubscribe","close"],"sources":["../../../../src/plugins/replication-microsoft-onedrive/index.ts"],"sourcesContent":["import {\r\n RxDBLeaderElectionPlugin\r\n} from '../leader-election/index.ts';\r\nimport type {\r\n RxCollection,\r\n ReplicationPullOptions,\r\n ReplicationPushOptions,\r\n RxReplicationWriteToMasterRow,\r\n RxReplicationPullStreamItem\r\n} from '../../types/index.d.ts';\r\nimport {\r\n RxReplicationState,\r\n startReplicationOnLeaderShip\r\n} from '../replication/index.ts';\r\nimport {\r\n addRxPlugin\r\n} from '../../index.ts';\r\n\r\nimport type {\r\n OneDriveCheckpointType,\r\n OneDriveState,\r\n SyncOptionsOneDrive\r\n} from './microsoft-onedrive-types.ts';\r\nimport { Subject } from 'rxjs';\r\nimport { DriveStructure, initDriveStructure } from './init.ts';\r\nimport { handleUpstreamBatch } from './upstream.ts';\r\nimport { fetchChanges } from './downstream.ts';\r\nimport { commitTransaction, runInTransaction, startTransaction } from './transaction.ts';\r\nimport {\r\n ensureProcessNextTickIsSet\r\n} from '../replication-webrtc/connection-handler-simple-peer.ts';\r\nimport { SignalingOptions, SignalingState } from './signaling.ts';\r\n\r\nexport * from './microsoft-onedrive-types.ts';\r\nexport * from './microsoft-onedrive-helper.ts';\r\nexport * from './transaction.ts';\r\nexport * from './init.ts';\r\nexport * from './document-handling.ts';\r\nexport * from './downstream.ts';\r\nexport * from './upstream.ts';\r\nexport * from './signaling.ts';\r\n\r\nexport const DEFAULT_TRANSACTION_TIMEOUT = 60 * 1000;\r\n\r\nexport class RxOneDriveReplicationState<RxDocType> extends RxReplicationState<RxDocType, OneDriveCheckpointType> {\r\n\r\n /**\r\n * Only exists on live replication\r\n */\r\n public signalingState?: SignalingState;\r\n\r\n constructor(\r\n public readonly oneDrive: OneDriveState,\r\n public readonly driveStructure: DriveStructure,\r\n public readonly replicationIdentifierHash: string,\r\n public readonly collection: RxCollection<RxDocType, any>,\r\n public readonly pull?: ReplicationPullOptions<RxDocType, OneDriveCheckpointType>,\r\n public readonly push?: ReplicationPushOptions<RxDocType>,\r\n public readonly signalingOptions?: SignalingOptions,\r\n public readonly live: boolean = true,\r\n public retryTime: number = 1000 * 5,\r\n public autoStart: boolean = true\r\n ) {\r\n super(\r\n replicationIdentifierHash,\r\n collection,\r\n '_deleted',\r\n pull,\r\n push,\r\n live,\r\n retryTime,\r\n autoStart\r\n );\r\n }\r\n\r\n\r\n /**\r\n * Notify other peers that something\r\n * has or might have changed so that\r\n * they can pull from their checkpoints.\r\n */\r\n async notifyPeers() {\r\n if (this.signalingState) {\r\n await this.signalingState.pingPeers('RESYNC');\r\n }\r\n }\r\n\r\n}\r\n\r\n\r\n\r\nexport async function replicateMicrosoftOneDrive<RxDocType>(\r\n options: SyncOptionsOneDrive<RxDocType>\r\n): Promise<RxOneDriveReplicationState<RxDocType>> {\r\n const collection: RxCollection<RxDocType, any, any> = options.collection;\r\n addRxPlugin(RxDBLeaderElectionPlugin);\r\n\r\n const oneDriveState: OneDriveState = Object.assign(\r\n {\r\n apiEndpoint: 'https://graph.microsoft.com/v1.0',\r\n driveId: 'me/drive',\r\n transactionTimeout: DEFAULT_TRANSACTION_TIMEOUT\r\n },\r\n options.oneDrive\r\n );\r\n const driveStructure = await initDriveStructure(oneDriveState);\r\n\r\n\r\n let replicationState: RxOneDriveReplicationState<RxDocType>;\r\n\r\n const pullStream$: Subject<RxReplicationPullStreamItem<RxDocType, OneDriveCheckpointType>> = new Subject();\r\n let replicationPrimitivesPull: ReplicationPullOptions<RxDocType, OneDriveCheckpointType> | undefined;\r\n\r\n options.live = typeof options.live === 'undefined' ? true : options.live;\r\n options.waitForLeadership = typeof options.waitForLeadership === 'undefined' ? true : options.waitForLeadership;\r\n\r\n if (options.pull) {\r\n replicationPrimitivesPull = {\r\n async handler(\r\n lastPulledCheckpoint: OneDriveCheckpointType | undefined,\r\n batchSize: number\r\n ) {\r\n return runInTransaction(\r\n oneDriveState,\r\n driveStructure,\r\n collection.schema.primaryPath,\r\n async () => {\r\n const changes = await fetchChanges<RxDocType>(\r\n oneDriveState,\r\n driveStructure,\r\n lastPulledCheckpoint,\r\n batchSize\r\n );\r\n return changes as any;\r\n }\r\n );\r\n },\r\n batchSize: options.pull.batchSize,\r\n modifier: options.pull.modifier,\r\n stream$: pullStream$.asObservable(),\r\n initialCheckpoint: options.pull.initialCheckpoint\r\n };\r\n }\r\n\r\n let replicationPrimitivesPush: ReplicationPushOptions<RxDocType> | undefined;\r\n if (options.push) {\r\n replicationPrimitivesPush = {\r\n async handler(\r\n rows: RxReplicationWriteToMasterRow<RxDocType>[]\r\n ) {\r\n return runInTransaction(\r\n oneDriveState,\r\n driveStructure,\r\n collection.schema.primaryPath,\r\n async () => {\r\n const conflicts = await handleUpstreamBatch(\r\n oneDriveState,\r\n driveStructure,\r\n options.collection.schema.primaryPath as any,\r\n rows\r\n );\r\n return conflicts;\r\n },\r\n () => replicationState.notifyPeers().catch(() => { })\r\n );\r\n },\r\n batchSize: options.push.batchSize,\r\n modifier: options.push.modifier\r\n };\r\n }\r\n\r\n\r\n\r\n replicationState = new RxOneDriveReplicationState<RxDocType>(\r\n oneDriveState,\r\n driveStructure,\r\n options.replicationIdentifier,\r\n collection,\r\n replicationPrimitivesPull,\r\n replicationPrimitivesPush,\r\n options.signalingOptions,\r\n options.live,\r\n options.retryTime,\r\n options.autoStart\r\n );\r\n\r\n /**\r\n * OneDrive has no websocket or server-send-events\r\n * to observe file changes reliably enough for real-time web. \r\n * Therefore we use WebRTC to connect clients which then can ping each other on changes.\r\n * Instead of a signaling server, we use OneDrive itself\r\n * to exchange signaling data.\r\n */\r\n if (options.live && options.pull) {\r\n ensureProcessNextTickIsSet();\r\n const startBefore = replicationState.start.bind(replicationState);\r\n const cancelBefore = replicationState.cancel.bind(replicationState);\r\n replicationState.start = () => {\r\n replicationState.signalingState = new SignalingState(\r\n replicationState.oneDrive,\r\n replicationState.driveStructure,\r\n options.signalingOptions ? options.signalingOptions : {}\r\n );\r\n\r\n const sub = replicationState.signalingState.resync$.subscribe(() => {\r\n replicationState.reSync();\r\n });\r\n\r\n replicationState.cancel = () => {\r\n sub.unsubscribe();\r\n replicationState.signalingState?.close();\r\n return cancelBefore();\r\n };\r\n return startBefore();\r\n };\r\n }\r\n\r\n startReplicationOnLeaderShip(options.waitForLeadership, replicationState);\r\n return replicationState;\r\n}\r\n"],"mappings":";AAAA,SACIA,wBAAwB,QACrB,6BAA6B;AAQpC,SACIC,kBAAkB,EAClBC,4BAA4B,QACzB,yBAAyB;AAChC,SACIC,WAAW,QACR,gBAAgB;AAOvB,SAASC,OAAO,QAAQ,MAAM;AAC9B,SAAyBC,kBAAkB,QAAQ,WA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zBrB,OAAO,CAACb,gBAAgB,EACxBa,OAAO,CAACZ,IAAI,EACZY,OAAO,CAACX,SAAS,EACjBW,OAAO,CAACV,SACZ,CAAC;;EAED;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,IAAIU,OAAO,CAACZ,IAAI,IAAIY,OAAO,CAACf,IAAI,EAAE;IAC9BT,0BAA0B,CAAC,CAAC;IAC5B,IAAMkD,WAAW,GAAGnB,gBAAgB,CAACoB,KAAK,CAACC,IAAI,CAACrB,gBAAgB,CAAC;IACjE,IAAMsB,YAAY,GAAGtB,gBAAgB,CAACuB,MAAM,CAACF,IAAI,CAACrB,gBAAgB,CAAC;IACnEA,gBAAgB,CAACoB,KAAK,GAAG,MAAM;MAC3BpB,gBAAgB,CAACV,cAAc,GAAG,IAAIpB,cAAc,CAChD8B,gBAAgB,CAAC1B,QAAQ,EACzB0B,gBAAgB,CAACzB,cAAc,EAC/BkB,OAAO,CAACb,gBAAgB,GAAGa,OAAO,CAACb,gBAAgB,GAAG,CAAC,CAC3D,CAAC;MAED,IAAM4C,GAAG,GAAGxB,gBAAgB,CAACV,cAAc,CAACmC,OAAO,CAACC,SAAS,CAAC,MAAM;QAChE1B,gBAAgB,CAAC2B,MAAM,CAAC,CAAC;MAC7B,CAAC,CAAC;MAEF3B,gBAAgB,CAACuB,MAAM,GAAG,MAAM;QAC5BC,GAAG,CAACI,WAAW,CAAC,CAAC;QACjB5B,gBAAgB,CAACV,cAAc,EAAEuC,KAAK,CAAC,CAAC;QACxC,OAAOP,YAAY,CAAC,CAAC;MACzB,CAAC;MACD,OAAOH,WAAW,CAAC,CAAC;IACxB,CAAC;EACL;EAEAzD,4BAA4B,CAAC+B,OAAO,CAACU,iBAAiB,EAAEH,gBAAgB,CAAC;EACzE,OAAOA,gBAAgB;AAC3B","ignoreList":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ensureFolderExists, listFilesInFolder, createEmptyFile, fillFileIfEtagMatches, readJsonFileContent } from "./microsoft-onedrive-helper.js";
|
|
2
|
+
import { newRxError } from "../../rx-error.js";
|
|
3
|
+
import { randomToken } from "../utils/utils-string.js";
|
|
4
|
+
import { TRANSACTION_FILE_NAME } from "./transaction.js";
|
|
5
|
+
import { ensureNotFalsy } from "../utils/index.js";
|
|
6
|
+
import { WAL_FILE_NAME } from "./upstream.js";
|
|
7
|
+
var NON_ALLOWED_ROOT_FOLDERS = ['/', '', null, false, undefined, 'root'];
|
|
8
|
+
export async function initDriveStructure(oneDriveState) {
|
|
9
|
+
NON_ALLOWED_ROOT_FOLDERS.forEach(nonAllowed => {
|
|
10
|
+
if (oneDriveState.folderPath === nonAllowed) {
|
|
11
|
+
throw newRxError('ODR1', {
|
|
12
|
+
folderPath: oneDriveState.folderPath
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// root folder
|
|
18
|
+
var rootFolderId = await ensureFolderExists(oneDriveState, oneDriveState.folderPath);
|
|
19
|
+
var rootFolderContent = await listFilesInFolder(oneDriveState, rootFolderId);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Folder must either be empty
|
|
23
|
+
* or already used as a RxDB onedrive sync target.
|
|
24
|
+
*/
|
|
25
|
+
var hasRxDBJson = rootFolderContent.find(file => file.name === 'rxdb.json');
|
|
26
|
+
var hasOther = rootFolderContent.find(file => file.name !== 'rxdb.json');
|
|
27
|
+
if (hasOther && !hasRxDBJson) {
|
|
28
|
+
throw newRxError('ODR9', {
|
|
29
|
+
folderPath: oneDriveState.folderPath
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Create rxdb.json file.
|
|
35
|
+
* This must always be the first step.
|
|
36
|
+
*/
|
|
37
|
+
var rxdbJson = await createEmptyFile(oneDriveState, rootFolderId, 'rxdb.json');
|
|
38
|
+
var replicationIdentifier;
|
|
39
|
+
if (rxdbJson.size === 0) {
|
|
40
|
+
var rxdbJsonData = await fillFileIfEtagMatches(oneDriveState, rxdbJson.fileId, rxdbJson.etag, {
|
|
41
|
+
replicationIdentifier: randomToken(10)
|
|
42
|
+
});
|
|
43
|
+
replicationIdentifier = ensureNotFalsy(rxdbJsonData.content).replicationIdentifier;
|
|
44
|
+
} else {
|
|
45
|
+
var _rxdbJsonData = await readJsonFileContent(oneDriveState, rxdbJson.fileId);
|
|
46
|
+
replicationIdentifier = ensureNotFalsy(_rxdbJsonData.content).replicationIdentifier;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// docs folder
|
|
50
|
+
var docsFolderId = await ensureFolderExists(oneDriveState, oneDriveState.folderPath + '/docs');
|
|
51
|
+
|
|
52
|
+
// signaling folder
|
|
53
|
+
var signalingFolderId = await ensureFolderExists(oneDriveState, oneDriveState.folderPath + '/signaling');
|
|
54
|
+
|
|
55
|
+
// transaction file
|
|
56
|
+
var transactionFile = await createEmptyFile(oneDriveState, rootFolderId, TRANSACTION_FILE_NAME);
|
|
57
|
+
|
|
58
|
+
// WAL file
|
|
59
|
+
var walFile = await createEmptyFile(oneDriveState, rootFolderId, WAL_FILE_NAME);
|
|
60
|
+
return {
|
|
61
|
+
rootFolderId,
|
|
62
|
+
docsFolderId,
|
|
63
|
+
signalingFolderId,
|
|
64
|
+
replicationIdentifier,
|
|
65
|
+
rxdbJson,
|
|
66
|
+
transactionFile,
|
|
67
|
+
walFile
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","names":["ensureFolderExists","listFilesInFolder","createEmptyFile","fillFileIfEtagMatches","readJsonFileContent","newRxError","randomToken","TRANSACTION_FILE_NAME","ensureNotFalsy","WAL_FILE_NAME","NON_ALLOWED_ROOT_FOLDERS","undefined","initDriveStructure","oneDriveState","forEach","nonAllowed","folderPath","rootFolderId","rootFolderContent","hasRxDBJson","find","file","name","hasOther","rxdbJson","replicationIdentifier","size","rxdbJsonData","fileId","etag","content","docsFolderId","signalingFolderId","transactionFile","walFile"],"sources":["../../../../src/plugins/replication-microsoft-onedrive/init.ts"],"sourcesContent":["import type { OneDriveState } from './microsoft-onedrive-types.ts';\r\nimport {\r\n ensureFolderExists,\r\n listFilesInFolder,\r\n createEmptyFile,\r\n fillFileIfEtagMatches,\r\n readJsonFileContent\r\n} from './microsoft-onedrive-helper.ts';\r\nimport { newRxError } from '../../rx-error.ts';\r\nimport { randomToken } from '../utils/utils-string.ts';\r\nimport { TRANSACTION_FILE_NAME } from './transaction.ts';\r\nimport { ensureNotFalsy } from '../utils/index.ts';\r\nimport { WAL_FILE_NAME } from './upstream.ts';\r\n\r\nconst NON_ALLOWED_ROOT_FOLDERS = [\r\n '/',\r\n '',\r\n null,\r\n false,\r\n undefined,\r\n 'root'\r\n];\r\n\r\nexport async function initDriveStructure(\r\n oneDriveState: OneDriveState\r\n) {\r\n\r\n NON_ALLOWED_ROOT_FOLDERS.forEach(nonAllowed => {\r\n if (oneDriveState.folderPath === nonAllowed) {\r\n throw newRxError('ODR1', {\r\n folderPath: oneDriveState.folderPath\r\n });\r\n }\r\n });\r\n\r\n // root folder\r\n const rootFolderId = await ensureFolderExists(oneDriveState, oneDriveState.folderPath);\r\n\r\n const rootFolderContent = await listFilesInFolder(oneDriveState, rootFolderId);\r\n\r\n /**\r\n * Folder must either be empty\r\n * or already used as a RxDB onedrive sync target.\r\n */\r\n const hasRxDBJson = rootFolderContent.find((file: any) => file.name === 'rxdb.json');\r\n const hasOther = rootFolderContent.find((file: any) => file.name !== 'rxdb.json');\r\n if (hasOther && !hasRxDBJson) {\r\n throw newRxError('ODR9', {\r\n folderPath: oneDriveState.folderPath\r\n });\r\n }\r\n\r\n /**\r\n * Create rxdb.json file.\r\n * This must always be the first step.\r\n */\r\n const rxdbJson = await createEmptyFile(oneDriveState, rootFolderId, 'rxdb.json');\r\n let replicationIdentifier: string;\r\n if (rxdbJson.size === 0) {\r\n const rxdbJsonData = await fillFileIfEtagMatches<{ replicationIdentifier: string }>(\r\n oneDriveState,\r\n rxdbJson.fileId,\r\n rxdbJson.etag,\r\n { replicationIdentifier: randomToken(10) }\r\n );\r\n replicationIdentifier = ensureNotFalsy(rxdbJsonData.content).replicationIdentifier;\r\n } else {\r\n const rxdbJsonData = await readJsonFileContent<{ replicationIdentifier: string }>(\r\n oneDriveState,\r\n rxdbJson.fileId\r\n );\r\n replicationIdentifier = ensureNotFalsy(rxdbJsonData.content).replicationIdentifier;\r\n }\r\n\r\n\r\n // docs folder\r\n const docsFolderId = await ensureFolderExists(oneDriveState, oneDriveState.folderPath + '/docs');\r\n\r\n // signaling folder\r\n const signalingFolderId = await ensureFolderExists(oneDriveState, oneDriveState.folderPath + '/signaling');\r\n\r\n // transaction file\r\n const transactionFile = await createEmptyFile(\r\n oneDriveState,\r\n rootFolderId,\r\n TRANSACTION_FILE_NAME\r\n );\r\n\r\n // WAL file\r\n const walFile = await createEmptyFile(\r\n oneDriveState,\r\n rootFolderId,\r\n WAL_FILE_NAME\r\n );\r\n\r\n return {\r\n rootFolderId,\r\n docsFolderId,\r\n signalingFolderId,\r\n replicationIdentifier,\r\n rxdbJson,\r\n transactionFile,\r\n walFile\r\n };\r\n}\r\n\r\nexport type DriveStructure = Awaited<ReturnType<typeof initDriveStructure>>;\r\n"],"mappings":"AACA,SACIA,kBAAkB,EAClBC,iBAAiB,EACjBC,eAAe,EACfC,qBAAqB,EACrBC,mBAAmB,QAChB,gCAAgC;AACvC,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,aAAa,QAAQ,eAAe;AAE7C,IAAMC,wBAAwB,GAAG,CAC7B,GAAG,EACH,EAAE,EACF,IAAI,EACJ,KAAK,EACLC,SAAS,EACT,MAAM,CACT;AAED,OAAO,eAAeC,kBAAkBA,CACpCC,aAA4B,EAC9B;EAE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CAC1CS,aAAa,EACbW,QAAQ,CAACI,MACb,CAAC;IACDH,qBAAqB,GAAGjB,cAAc,CAACmB,aAAY,CAACG,OAAO,CAAC,CAACL,qBAAqB;EACtF;;EAGA;EACA,IAAMM,YAAY,GAAG,MAAM/B,kBAAkB,CAACa,aAAa,EAAEA,aAAa,CAACG,UAAU,GAAG,OAAO,CAAC;;EAEhG;EACA,IAAMgB,iBAAiB,GAAG,MAAMhC,kBAAkB,CAACa,aAAa,EAAEA,aAAa,CAACG,UAAU,GAAG,YAAY,CAAC;;EAE1G;EACA,IAAMiB,eAAe,GAAG,MAAM/B,eAAe,CACzCW,aAAa,EACbI,YAAY,EACZV,qBACJ,CAAC;;EAED;EACA,IAAM2B,OAAO,GAAG,MAAMhC,eAAe,CACjCW,aAAa,EACbI,YAAY,EACZR,aACJ,CAAC;EAED,OAAO;IACHQ,YAAY;IACZc,YAAY;IACZC,iBAAiB;IACjBP,qBAAqB;IACrBD,QAAQ;IACRS,eAAe;IACfC;EACJ,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { newRxError, newRxFetchError } from "../../rx-error.js";
|
|
2
|
+
import { ensureNotFalsy } from "../utils/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Returns the base URL for Graph API calls up to the drive root.
|
|
5
|
+
* Examples:
|
|
6
|
+
* - "https://graph.microsoft.com/v1.0/me/drive" (personal / default)
|
|
7
|
+
* - "https://graph.microsoft.com/v1.0/drives/12345"
|
|
8
|
+
*/
|
|
9
|
+
export function getDriveBaseUrl(oneDriveState) {
|
|
10
|
+
var endpoint = oneDriveState.apiEndpoint || 'https://graph.microsoft.com/v1.0';
|
|
11
|
+
var driveId = oneDriveState.driveId || 'me/drive';
|
|
12
|
+
return endpoint + "/" + driveId;
|
|
13
|
+
}
|
|
14
|
+
export async function createFolder(oneDriveState, parentId = 'root', folderName) {
|
|
15
|
+
var baseUrl = getDriveBaseUrl(oneDriveState);
|
|
16
|
+
var url = baseUrl + "/items/" + parentId + "/children";
|
|
17
|
+
var body = {
|
|
18
|
+
name: folderName,
|
|
19
|
+
folder: {},
|
|
20
|
+
'@microsoft.graph.conflictBehavior': 'fail'
|
|
21
|
+
};
|
|
22
|
+
var response = await fetch(url, {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
headers: {
|
|
25
|
+
Authorization: 'Bearer ' + oneDriveState.authToken,
|
|
26
|
+
'Content-Type': 'application/json'
|
|
27
|
+
},
|
|
28
|
+
body: JSON.stringify(body)
|
|
29
|
+
});
|
|
30
|
+
if (!response.ok) {
|
|
31
|
+
if (response.status === 409) {
|
|
32
|
+
// someone else created the same folder, return that one instead.
|
|
33
|
+
var found = await findFolder(oneDriveState, parentId, folderName);
|
|
34
|
+
return ensureNotFalsy(found);
|
|
35
|
+
}
|
|
36
|
+
throw await newRxFetchError(response, {
|
|
37
|
+
folderName,
|
|
38
|
+
parentId
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
await response.json();
|
|
42
|
+
var foundFolder = await findFolder(oneDriveState, parentId, folderName);
|
|
43
|
+
return ensureNotFalsy(foundFolder);
|
|
44
|
+
}
|
|
45
|
+
export async function findFolder(oneDriveState, parentId = 'root', folderName) {
|
|
46
|
+
var items = await listFilesInFolder(oneDriveState, parentId);
|
|
47
|
+
var matchingItems = items.filter(i => i.name === folderName);
|
|
48
|
+
if (matchingItems.length === 0) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Sort by created time so older folders are picked first
|
|
53
|
+
var item = matchingItems.sort((a, b) => {
|
|
54
|
+
var timeA = a.createdDateTime ? new Date(a.createdDateTime).getTime() : 0;
|
|
55
|
+
var timeB = b.createdDateTime ? new Date(b.createdDateTime).getTime() : 0;
|
|
56
|
+
return timeA - timeB;
|
|
57
|
+
})[0];
|
|
58
|
+
if (!item.folder) {
|
|
59
|
+
throw newRxError('ODR3', {
|
|
60
|
+
folderName,
|
|
61
|
+
args: {
|
|
62
|
+
item
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return item.id;
|
|
67
|
+
}
|
|
68
|
+
export async function ensureFolderExists(oneDriveState, folderPath) {
|
|
69
|
+
var parts = folderPath.split('/').filter(p => p.length > 0);
|
|
70
|
+
var parentId = 'root';
|
|
71
|
+
for (var part of parts) {
|
|
72
|
+
var newParentId = await findFolder(oneDriveState, parentId, part);
|
|
73
|
+
if (newParentId) {
|
|
74
|
+
parentId = newParentId;
|
|
75
|
+
} else {
|
|
76
|
+
parentId = await createFolder(oneDriveState, parentId, part);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return parentId;
|
|
80
|
+
}
|
|
81
|
+
export async function createEmptyFile(oneDriveState, parentId, fileName) {
|
|
82
|
+
var baseUrl = getDriveBaseUrl(oneDriveState);
|
|
83
|
+
var url = baseUrl + "/items/" + parentId + "/children";
|
|
84
|
+
var body = {
|
|
85
|
+
name: fileName,
|
|
86
|
+
file: {},
|
|
87
|
+
'@microsoft.graph.conflictBehavior': 'fail'
|
|
88
|
+
};
|
|
89
|
+
var response = await fetch(url, {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
headers: {
|
|
92
|
+
Authorization: 'Bearer ' + oneDriveState.authToken,
|
|
93
|
+
'Content-Type': 'application/json'
|
|
94
|
+
},
|
|
95
|
+
body: JSON.stringify(body)
|
|
96
|
+
});
|
|
97
|
+
if (!response.ok && response.status !== 409) {
|
|
98
|
+
throw await newRxFetchError(response, {
|
|
99
|
+
folderName: fileName
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// To make idempotent, we always search for the file after creation
|
|
104
|
+
// and take the oldest one in case there are duplicates.
|
|
105
|
+
var items = await listFilesInFolder(oneDriveState, parentId);
|
|
106
|
+
var matchingFiles = items.filter(i => i.name === fileName);
|
|
107
|
+
var file = ensureNotFalsy(matchingFiles.sort((a, b) => (a.createdDateTime ? new Date(a.createdDateTime).getTime() : 0) - (b.createdDateTime ? new Date(b.createdDateTime).getTime() : 0))[0]);
|
|
108
|
+
return {
|
|
109
|
+
status: response.status,
|
|
110
|
+
etag: ensureNotFalsy(file.eTag),
|
|
111
|
+
createdTime: file.lastModifiedDateTime,
|
|
112
|
+
fileId: ensureNotFalsy(file.id),
|
|
113
|
+
size: file.size ? file.size : 0
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export async function fillFileIfEtagMatches(oneDriveState, fileId, etag, jsonContent) {
|
|
117
|
+
var baseUrl = getDriveBaseUrl(oneDriveState);
|
|
118
|
+
var url = baseUrl + "/items/" + encodeURIComponent(fileId) + "/content";
|
|
119
|
+
var writeContent = typeof jsonContent !== 'undefined' ? JSON.stringify(jsonContent) : '';
|
|
120
|
+
var res = await fetch(url, {
|
|
121
|
+
method: "PUT",
|
|
122
|
+
headers: {
|
|
123
|
+
Authorization: "Bearer " + oneDriveState.authToken,
|
|
124
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
125
|
+
"If-Match": etag
|
|
126
|
+
},
|
|
127
|
+
body: writeContent
|
|
128
|
+
});
|
|
129
|
+
if (res.status === 412) {
|
|
130
|
+
return readJsonFileContent(oneDriveState, fileId).then(r => {
|
|
131
|
+
return {
|
|
132
|
+
content: r.content,
|
|
133
|
+
etag: r.etag,
|
|
134
|
+
status: res.status
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (res.status !== 200 && res.status !== 201) {
|
|
139
|
+
throw await newRxFetchError(res);
|
|
140
|
+
}
|
|
141
|
+
var data = await res.json();
|
|
142
|
+
return {
|
|
143
|
+
content: jsonContent,
|
|
144
|
+
etag: ensureNotFalsy(data.eTag),
|
|
145
|
+
status: res.status
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
export async function deleteIfEtagMatches(oneDriveState, fileId, etag) {
|
|
149
|
+
var baseUrl = getDriveBaseUrl(oneDriveState);
|
|
150
|
+
var url = baseUrl + "/items/" + encodeURIComponent(fileId);
|
|
151
|
+
var res = await fetch(url, {
|
|
152
|
+
method: "DELETE",
|
|
153
|
+
headers: {
|
|
154
|
+
Authorization: "Bearer " + oneDriveState.authToken,
|
|
155
|
+
// Not all item deletions in Microsoft Graph honor If-Match, but we send it.
|
|
156
|
+
// As per KI, we might have to relax it for folders, but this is used for files.
|
|
157
|
+
"If-Match": etag
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
if (!res.ok) {
|
|
161
|
+
throw await newRxFetchError(res, {
|
|
162
|
+
args: {
|
|
163
|
+
etag,
|
|
164
|
+
fileId
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
export async function deleteFile(oneDriveState, fileId) {
|
|
170
|
+
var baseUrl = getDriveBaseUrl(oneDriveState);
|
|
171
|
+
var url = baseUrl + "/items/" + encodeURIComponent(fileId);
|
|
172
|
+
var res = await fetch(url, {
|
|
173
|
+
method: "DELETE",
|
|
174
|
+
headers: {
|
|
175
|
+
Authorization: "Bearer " + oneDriveState.authToken
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
if (!res.ok) {
|
|
179
|
+
throw await newRxFetchError(res, {
|
|
180
|
+
args: {
|
|
181
|
+
fileId
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
export async function readJsonFileContent(oneDriveState, fileId) {
|
|
187
|
+
var baseUrl = getDriveBaseUrl(oneDriveState);
|
|
188
|
+
|
|
189
|
+
// Fetch metadata FIRST to reliably get the ETag, preventing race conditions
|
|
190
|
+
// where old content is fetched via /content and arbitrarily paired with a newer ETag fallback.
|
|
191
|
+
var metaResponse = await fetch(baseUrl + "/items/" + encodeURIComponent(fileId) + "?$select=id,eTag,@microsoft.graph.downloadUrl", {
|
|
192
|
+
headers: {
|
|
193
|
+
Authorization: "Bearer " + oneDriveState.authToken
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
if (!metaResponse.ok) {
|
|
197
|
+
if (metaResponse.status === 404) {
|
|
198
|
+
return {
|
|
199
|
+
etag: '',
|
|
200
|
+
content: undefined
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
throw await newRxFetchError(metaResponse, {
|
|
204
|
+
args: {
|
|
205
|
+
fileId
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
var meta = await metaResponse.json();
|
|
210
|
+
var etag = ensureNotFalsy(meta.eTag, 'eTag missing from metadata');
|
|
211
|
+
var contentText = '';
|
|
212
|
+
|
|
213
|
+
// Some mock servers or endpoints may omit the downloadUrl. Fallback to /content if necessary.
|
|
214
|
+
var downloadUrl = meta['@microsoft.graph.downloadUrl'] || baseUrl + "/items/" + encodeURIComponent(fileId) + "/content";
|
|
215
|
+
var contentRes = await fetch(downloadUrl, {
|
|
216
|
+
method: "GET",
|
|
217
|
+
headers: {
|
|
218
|
+
Authorization: "Bearer " + oneDriveState.authToken
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
if (contentRes.status === 200 || contentRes.status === 201) {
|
|
222
|
+
contentText = await contentRes.text();
|
|
223
|
+
} else if (contentRes.status !== 404) {
|
|
224
|
+
throw await newRxFetchError(contentRes, {
|
|
225
|
+
args: {
|
|
226
|
+
fileId,
|
|
227
|
+
downloadUrl
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
var content = contentText.length > 0 ? JSON.parse(contentText) : undefined;
|
|
232
|
+
return {
|
|
233
|
+
etag,
|
|
234
|
+
content: content
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
export async function listFilesInFolder(oneDriveState, folderId) {
|
|
238
|
+
var baseUrl = getDriveBaseUrl(oneDriveState);
|
|
239
|
+
var url = baseUrl + "/items/" + folderId + "/children?$select=id,name,eTag,createdDateTime,lastModifiedDateTime,size,file,folder";
|
|
240
|
+
var items = [];
|
|
241
|
+
while (url) {
|
|
242
|
+
var res = await fetch(url, {
|
|
243
|
+
headers: {
|
|
244
|
+
Authorization: "Bearer " + oneDriveState.authToken
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
if (!res.ok) {
|
|
248
|
+
var text = await res.text().catch(() => "");
|
|
249
|
+
throw new Error("files.list failed: " + res.status + " " + text);
|
|
250
|
+
}
|
|
251
|
+
var data = await res.json();
|
|
252
|
+
var batch = data.value || [];
|
|
253
|
+
items.push(...batch);
|
|
254
|
+
url = data['@odata.nextLink'];
|
|
255
|
+
}
|
|
256
|
+
return items;
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=microsoft-onedrive-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"microsoft-onedrive-helper.js","names":["newRxError","newRxFetchError","ensureNotFalsy","getDriveBaseUrl","oneDriveState","endpoint","apiEndpoint","driveId","createFolder","parentId","folderName","baseUrl","url","body","name","folder","response","fetch","method","headers","Authorization","authToken","JSON","stringify","ok","status","found","findFolder","json","foundFolder","items","listFilesInFolder","matchingItems","filter","i","length","undefined","item","sort","a","b","timeA","createdDateTime","Date","getTime","timeB","args","id","ensureFolderExists","folderPath","parts","split","p","part","newParentId","createEmptyFile","fileName","file","matchingFiles","etag","eTag","createdTime","lastModifiedDateTime","fileId","size","fillFileIfEtagMatches","jsonContent","encodeURIComponent","writeContent","res","readJsonFileContent","then","r","content","data","deleteIfEtagMatches","deleteFile","metaResponse","meta","contentText","downloadUrl","contentRes","text","parse","folderId","catch","Error","batch","value","push"],"sources":["../../../../src/plugins/replication-microsoft-onedrive/microsoft-onedrive-helper.ts"],"sourcesContent":["import { newRxError, newRxFetchError } from '../../rx-error.ts';\r\nimport { ensureNotFalsy } from '../utils/index.ts';\r\nimport type {\r\n OneDriveState,\r\n OneDriveItem\r\n} from './microsoft-onedrive-types.ts';\r\n\r\n/**\r\n * Returns the base URL for Graph API calls up to the drive root.\r\n * Examples: \r\n * - \"https://graph.microsoft.com/v1.0/me/drive\" (personal / default)\r\n * - \"https://graph.microsoft.com/v1.0/drives/12345\" \r\n */\r\nexport function getDriveBaseUrl(oneDriveState: OneDriveState): string {\r\n const endpoint = oneDriveState.apiEndpoint || 'https://graph.microsoft.com/v1.0';\r\n const driveId = oneDriveState.driveId || 'me/drive';\r\n return `${endpoint}/${driveId}`;\r\n}\r\n\r\nexport async function createFolder(\r\n oneDriveState: OneDriveState,\r\n parentId: string = 'root',\r\n folderName: string\r\n): Promise<string> {\r\n const baseUrl = getDriveBaseUrl(oneDriveState);\r\n const url = `${baseUrl}/items/${parentId}/children`;\r\n const body = {\r\n name: folderName,\r\n folder: {},\r\n '@microsoft.graph.conflictBehavior': 'fail'\r\n };\r\n\r\n const response = await fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n Authorization: 'Bearer ' + oneDriveState.authToken,\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(body)\r\n });\r\n\r\n if (!response.ok) {\r\n if (response.status === 409) {\r\n // someone else created the same folder, return that one instead.\r\n const found = await findFolder(oneDriveState, parentId, folderName);\r\n return ensureNotFalsy(found);\r\n }\r\n\r\n throw await newRxFetchError(response, {\r\n folderName,\r\n parentId\r\n });\r\n }\r\n\r\n await response.json();\r\n\r\n const foundFolder = await findFolder(\r\n oneDriveState,\r\n parentId,\r\n folderName\r\n );\r\n\r\n return ensureNotFalsy(foundFolder);\r\n}\r\n\r\n\r\nexport async function findFolder(\r\n oneDriveState: OneDriveState,\r\n parentId: string = 'root',\r\n folderName: string\r\n): Promise<string | undefined> {\r\n const items = await listFilesInFolder(oneDriveState, parentId);\r\n const matchingItems = items.filter(i => i.name === folderName);\r\n\r\n if (matchingItems.length === 0) {\r\n return undefined;\r\n }\r\n\r\n // Sort by created time so older folders are picked first\r\n const item = matchingItems.sort((a, b) => {\r\n const timeA = a.createdDateTime ? new Date(a.createdDateTime).getTime() : 0;\r\n const timeB = b.createdDateTime ? new Date(b.createdDateTime).getTime() : 0;\r\n return timeA - timeB;\r\n })[0];\r\n\r\n if (!item.folder) {\r\n throw newRxError('ODR3', {\r\n folderName,\r\n args: {\r\n item\r\n }\r\n });\r\n }\r\n return item.id;\r\n}\r\n\r\nexport async function ensureFolderExists(\r\n oneDriveState: OneDriveState,\r\n folderPath: string\r\n): Promise<string> {\r\n const parts = folderPath.split('/').filter(p => p.length > 0);\r\n let parentId = 'root';\r\n for (const part of parts) {\r\n const newParentId = await findFolder(oneDriveState, parentId, part);\r\n if (newParentId) {\r\n parentId = newParentId\r\n } else {\r\n parentId = await createFolder(oneDriveState, parentId, part);\r\n }\r\n }\r\n return parentId;\r\n}\r\n\r\nexport async function createEmptyFile(\r\n oneDriveState: OneDriveState,\r\n parentId: string,\r\n fileName: string\r\n) {\r\n const baseUrl = getDriveBaseUrl(oneDriveState);\r\n const url = `${baseUrl}/items/${parentId}/children`;\r\n\r\n const body = {\r\n name: fileName,\r\n file: {},\r\n '@microsoft.graph.conflictBehavior': 'fail'\r\n };\r\n\r\n const response = await fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n Authorization: 'Bearer ' + oneDriveState.authToken,\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(body)\r\n });\r\n\r\n if (!response.ok && response.status !== 409) {\r\n throw await newRxFetchError(response, {\r\n folderName: fileName\r\n });\r\n }\r\n\r\n // To make idempotent, we always search for the file after creation\r\n // and take the oldest one in case there are duplicates.\r\n const items = await listFilesInFolder(oneDriveState, parentId);\r\n const matchingFiles = items.filter(i => i.name === fileName);\r\n const file = ensureNotFalsy(\r\n matchingFiles.sort((a, b) =>\r\n (a.createdDateTime ? new Date(a.createdDateTime).getTime() : 0) -\r\n (b.createdDateTime ? new Date(b.createdDateTime).getTime() : 0)\r\n )[0]\r\n );\r\n\r\n return {\r\n status: response.status,\r\n etag: ensureNotFalsy(file.eTag),\r\n createdTime: file.lastModifiedDateTime,\r\n fileId: ensureNotFalsy(file.id),\r\n size: file.size ? file.size : 0\r\n }\r\n}\r\n\r\n\r\nexport async function fillFileIfEtagMatches<T = any>(\r\n oneDriveState: OneDriveState,\r\n fileId: string,\r\n etag: string,\r\n jsonContent?: any\r\n): Promise<{\r\n status: number;\r\n etag: string;\r\n content: T | undefined;\r\n}> {\r\n const baseUrl = getDriveBaseUrl(oneDriveState);\r\n const url = `${baseUrl}/items/${encodeURIComponent(fileId)}/content`;\r\n\r\n const writeContent = typeof jsonContent !== 'undefined' ? JSON.stringify(jsonContent) : '';\r\n\r\n const res = await fetch(url, {\r\n method: \"PUT\",\r\n headers: {\r\n Authorization: `Bearer ${oneDriveState.authToken}`,\r\n \"Content-Type\": \"application/json; charset=utf-8\",\r\n \"If-Match\": etag,\r\n },\r\n body: writeContent,\r\n });\r\n\r\n if (res.status === 412) {\r\n return readJsonFileContent<T>(\r\n oneDriveState,\r\n fileId\r\n ).then(r => {\r\n return {\r\n content: r.content,\r\n etag: r.etag,\r\n status: res.status\r\n };\r\n });\r\n }\r\n\r\n if (res.status !== 200 && res.status !== 201) {\r\n throw await newRxFetchError(res);\r\n }\r\n\r\n const data = await res.json();\r\n return {\r\n content: jsonContent,\r\n etag: ensureNotFalsy(data.eTag),\r\n status: res.status\r\n };\r\n}\r\n\r\nexport async function deleteIfEtagMatches(\r\n oneDriveState: OneDriveState,\r\n fileId: string,\r\n etag: string\r\n): Promise<void> {\r\n const baseUrl = getDriveBaseUrl(oneDriveState);\r\n const url = `${baseUrl}/items/${encodeURIComponent(fileId)}`;\r\n\r\n const res = await fetch(url, {\r\n method: \"DELETE\",\r\n headers: {\r\n Authorization: `Bearer ${oneDriveState.authToken}`,\r\n // Not all item deletions in Microsoft Graph honor If-Match, but we send it.\r\n // As per KI, we might have to relax it for folders, but this is used for files.\r\n \"If-Match\": etag,\r\n },\r\n });\r\n\r\n if (!res.ok) {\r\n throw await newRxFetchError(res, {\r\n args: {\r\n etag,\r\n fileId\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport async function deleteFile(\r\n oneDriveState: OneDriveState,\r\n fileId: string\r\n): Promise<void> {\r\n const baseUrl = getDriveBaseUrl(oneDriveState);\r\n const url = `${baseUrl}/items/${encodeURIComponent(fileId)}`;\r\n\r\n const res = await fetch(url, {\r\n method: \"DELETE\",\r\n headers: {\r\n Authorization: `Bearer ${oneDriveState.authToken}`,\r\n },\r\n });\r\n\r\n if (!res.ok) {\r\n throw await newRxFetchError(res, {\r\n args: {\r\n fileId\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport async function readJsonFileContent<T>(\r\n oneDriveState: OneDriveState,\r\n fileId: string\r\n): Promise<{\r\n etag: string;\r\n content: T | undefined;\r\n}> {\r\n const baseUrl = getDriveBaseUrl(oneDriveState);\r\n\r\n // Fetch metadata FIRST to reliably get the ETag, preventing race conditions\r\n // where old content is fetched via /content and arbitrarily paired with a newer ETag fallback.\r\n const metaResponse = await fetch(\r\n `${baseUrl}/items/${encodeURIComponent(fileId)}?$select=id,eTag,@microsoft.graph.downloadUrl`,\r\n {\r\n headers: {\r\n Authorization: `Bearer ${oneDriveState.authToken}`,\r\n }\r\n }\r\n );\r\n\r\n if (!metaResponse.ok) {\r\n if (metaResponse.status === 404) {\r\n return {\r\n etag: '',\r\n content: undefined\r\n };\r\n }\r\n throw await newRxFetchError(metaResponse, {\r\n args: { fileId }\r\n });\r\n }\r\n\r\n const meta = await metaResponse.json();\r\n const etag = ensureNotFalsy(meta.eTag, 'eTag missing from metadata');\r\n let contentText = '';\r\n\r\n // Some mock servers or endpoints may omit the downloadUrl. Fallback to /content if necessary.\r\n const downloadUrl = meta['@microsoft.graph.downloadUrl'] || `${baseUrl}/items/${encodeURIComponent(fileId)}/content`;\r\n\r\n const contentRes = await fetch(downloadUrl, {\r\n method: \"GET\",\r\n headers: {\r\n Authorization: `Bearer ${oneDriveState.authToken}`,\r\n }\r\n });\r\n\r\n if (contentRes.status === 200 || contentRes.status === 201) {\r\n contentText = await contentRes.text();\r\n } else if (contentRes.status !== 404) {\r\n throw await newRxFetchError(contentRes, {\r\n args: { fileId, downloadUrl }\r\n });\r\n }\r\n\r\n const content = contentText.length > 0 ? JSON.parse(contentText) : undefined;\r\n\r\n return {\r\n etag,\r\n content: content as T\r\n };\r\n}\r\n\r\nexport async function listFilesInFolder(\r\n oneDriveState: OneDriveState,\r\n folderId: string\r\n): Promise<OneDriveItem[]> {\r\n const baseUrl = getDriveBaseUrl(oneDriveState);\r\n let url: string | undefined = `${baseUrl}/items/${folderId}/children?$select=id,name,eTag,createdDateTime,lastModifiedDateTime,size,file,folder`;\r\n const items: OneDriveItem[] = [];\r\n\r\n while (url) {\r\n const res: Response = await fetch(url, {\r\n headers: {\r\n Authorization: `Bearer ${oneDriveState.authToken}`,\r\n },\r\n });\r\n\r\n if (!res.ok) {\r\n const text = await res.text().catch(() => \"\");\r\n throw new Error(`files.list failed: ${res.status} ${text}`);\r\n }\r\n\r\n const data: any = await res.json();\r\n const batch: OneDriveItem[] = data.value || [];\r\n items.push(...batch);\r\n\r\n url = data['@odata.nextLink'];\r\n }\r\n\r\n return items;\r\n}\r\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,eAAe,QAAQ,mBAAmB;AAC/D,SAASC,cAAc,QAAQ,mBAAmB;AAMlD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAACC,aAA4B,EAAU;EAClE,IAAMC,QAAQ,GAAGD,aAAa,CAACE,WAAW,IAAI,kCAAkC;EAChF,IAAMC,OAAO,GAAGH,aAAa,CAACG,OAAO,IAAI,UAAU;EACnD,OAAUF,QAAQ,SAAIE,OAAO;AACjC;AAEA,OAAO,eAAeC,YAAYA,CAC9BJ,aAA4B,EAC5BK,QAAgB,GAAG,MAAM,EACzBC,UAAkB,EACH;EACf,IAAMC,OAAO,GAAGR,eAAe,CAACC,aAAa,CAAC;EAC9C,IAAMQ,GAAG,GAAMD,OAAO,eAAUF,QAAQ,cAAW;EACnD,IAAMI,IAAI,GAAG;IACTC,IAAI,EAAEJ,UAAU;IAChBK,MAAM,EAAE,CAAC,CAAC;IACV,mCAAmC,EAAE;EACzC,CAAC;EAED,IAAMC,QA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/plugins/replication-microsoft-onedrive/microsoft-onedrive-types.ts"],"sourcesContent":["import type { ReplicationOptions, ReplicationPullOptions, ReplicationPushOptions } from '../../types/index.d.ts';\r\nimport { SignalingOptions } from './signaling.ts';\r\n\r\n/**\r\n * Represents a Microsoft Graph DriveItem.\r\n * https://learn.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0\r\n */\r\nexport interface OneDriveItem {\r\n id: string;\r\n name: string;\r\n eTag: string;\r\n cTag: string;\r\n createdDateTime?: string;\r\n lastModifiedDateTime: string;\r\n folder?: {\r\n childCount: number;\r\n };\r\n file?: {\r\n mimeType: string;\r\n };\r\n '@microsoft.graph.downloadUrl'?: string;\r\n size?: number;\r\n parentReference?: {\r\n driveId: string;\r\n id: string;\r\n };\r\n}\r\n\r\nexport interface OneDriveState {\r\n oauthClientId?: string; // Kept for config compatibility, maybe used if graph API client library is added later\r\n authToken: string;\r\n /**\r\n * Microsoft Graph API Endpoint.\r\n * Default: `https://graph.microsoft.com/v1.0`\r\n */\r\n apiEndpoint?: string;\r\n\r\n /**\r\n * ID of the personal OneDrive root or SharePoint Document Library root.\r\n * 'me/drive' is common for personal.\r\n */\r\n driveId?: string;\r\n\r\n /**\r\n * Provide a folderPath to the app root in the cloud.\r\n * Must not be the root folder.\r\n */\r\n folderPath: string;\r\n\r\n /**\r\n * In ms.\r\n * Default: 10000\r\n */\r\n transactionTimeout?: number;\r\n}\r\n\r\nexport type OneDriveSyncPullOptions<RxDocType> = Omit<ReplicationPullOptions<RxDocType, OneDriveCheckpointType>, 'handler' | 'stream$'>;\r\n\r\nexport type OneDriveSyncPushOptions<RxDocType> = Omit<ReplicationPushOptions<RxDocType>, 'handler'>;\r\n\r\nexport type SyncOptionsOneDrive<RxDocType> = Omit<\r\n ReplicationOptions<RxDocType, any>,\r\n 'pull' | 'push'\r\n> & {\r\n oneDrive: OneDriveState;\r\n signalingOptions?: SignalingOptions;\r\n pull?: OneDriveSyncPullOptions<RxDocType>;\r\n push?: OneDriveSyncPushOptions<RxDocType>;\r\n};\r\n\r\nexport type OneDriveCheckpointType = {\r\n /**\r\n * The last 'lastModifiedDateTime' of a document.\r\n */\r\n lastModifiedDateTime: string;\r\n};\r\n\r\n\r\n\r\nexport type OneDriveTransaction = {\r\n retry: true;\r\n} | OneDriveItem;\r\n\r\n\r\nexport type OneDriveResponse<T> = {\r\n value: T;\r\n '@odata.nextLink'?: string;\r\n};\r\n"],"mappings":"","ignoreList":[]}
|