@vrtmrz/livesync-commonlib 0.1.0-rc.0
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/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/API/DirectFileManipulator.d.ts +2 -0
- package/dist/API/DirectFileManipulator.js +4 -0
- package/dist/API/DirectFileManipulatorV2.d.ts +150 -0
- package/dist/API/DirectFileManipulatorV2.js +424 -0
- package/dist/API/processSetting.d.ts +41 -0
- package/dist/API/processSetting.js +140 -0
- package/dist/ContentSplitter/ContentSplitter.d.ts +28 -0
- package/dist/ContentSplitter/ContentSplitter.js +5 -0
- package/dist/ContentSplitter/ContentSplitterBase.d.ts +51 -0
- package/dist/ContentSplitter/ContentSplitterBase.js +83 -0
- package/dist/ContentSplitter/ContentSplitterRabinKarp.d.ts +9 -0
- package/dist/ContentSplitter/ContentSplitterRabinKarp.js +32 -0
- package/dist/ContentSplitter/ContentSplitterV1.d.ts +9 -0
- package/dist/ContentSplitter/ContentSplitterV1.js +34 -0
- package/dist/ContentSplitter/ContentSplitterV2.d.ts +9 -0
- package/dist/ContentSplitter/ContentSplitterV2.js +34 -0
- package/dist/ContentSplitter/ContentSplitters.d.ts +12 -0
- package/dist/ContentSplitter/ContentSplitters.js +29 -0
- package/dist/bureau/bureau.d.ts +7 -0
- package/dist/bureau/bureau.js +5 -0
- package/dist/common/ConnectionString.d.ts +30 -0
- package/dist/common/ConnectionString.js +179 -0
- package/dist/common/LSError.d.ts +48 -0
- package/dist/common/LSError.js +112 -0
- package/dist/common/configForDoc.d.ts +79 -0
- package/dist/common/configForDoc.js +312 -0
- package/dist/common/coreEnvFunctions.d.ts +21 -0
- package/dist/common/coreEnvFunctions.js +22 -0
- package/dist/common/coreEnvVars.d.ts +3 -0
- package/dist/common/coreEnvVars.js +6 -0
- package/dist/common/i18n.d.ts +18 -0
- package/dist/common/i18n.js +7193 -0
- package/dist/common/logger.d.ts +2 -0
- package/dist/common/logger.js +1 -0
- package/dist/common/messages/combinedMessages.dev.d.ts +7 -0
- package/dist/common/messages/combinedMessages.dev.js +44 -0
- package/dist/common/messages/combinedMessages.prod.d.ts +9264 -0
- package/dist/common/messages/combinedMessages.prod.js +9271 -0
- package/dist/common/messages/de.d.ts +297 -0
- package/dist/common/messages/de.js +7 -0
- package/dist/common/messages/def.d.ts +1119 -0
- package/dist/common/messages/def.js +7 -0
- package/dist/common/messages/es.d.ts +689 -0
- package/dist/common/messages/es.js +7 -0
- package/dist/common/messages/fr.d.ts +582 -0
- package/dist/common/messages/fr.js +7 -0
- package/dist/common/messages/he.d.ts +583 -0
- package/dist/common/messages/he.js +7 -0
- package/dist/common/messages/ja.d.ts +838 -0
- package/dist/common/messages/ja.js +7 -0
- package/dist/common/messages/ko.d.ts +800 -0
- package/dist/common/messages/ko.js +7 -0
- package/dist/common/messages/ru.d.ts +858 -0
- package/dist/common/messages/ru.js +7 -0
- package/dist/common/messages/zh-tw.d.ts +384 -0
- package/dist/common/messages/zh-tw.js +7 -0
- package/dist/common/messages/zh.d.ts +1093 -0
- package/dist/common/messages/zh.js +7 -0
- package/dist/common/messagesJson/de.json +295 -0
- package/dist/common/messagesJson/en.json +1117 -0
- package/dist/common/messagesJson/es.json +687 -0
- package/dist/common/messagesJson/fr.json +580 -0
- package/dist/common/messagesJson/he.json +581 -0
- package/dist/common/messagesJson/ja.json +836 -0
- package/dist/common/messagesJson/ko.json +798 -0
- package/dist/common/messagesJson/ru.json +856 -0
- package/dist/common/messagesJson/zh-tw.json +382 -0
- package/dist/common/messagesJson/zh.json +1091 -0
- package/dist/common/models/auth.type.d.ts +41 -0
- package/dist/common/models/auth.type.js +0 -0
- package/dist/common/models/db.const.d.ts +20 -0
- package/dist/common/models/db.const.js +28 -0
- package/dist/common/models/db.definition.d.ts +56 -0
- package/dist/common/models/db.definition.js +6 -0
- package/dist/common/models/db.type.d.ts +142 -0
- package/dist/common/models/db.type.js +0 -0
- package/dist/common/models/diff.definition.d.ts +16 -0
- package/dist/common/models/diff.definition.js +0 -0
- package/dist/common/models/fileaccess.const.d.ts +7 -0
- package/dist/common/models/fileaccess.const.js +16 -0
- package/dist/common/models/fileaccess.type.d.ts +72 -0
- package/dist/common/models/fileaccess.type.js +0 -0
- package/dist/common/models/redflag.const.d.ts +32 -0
- package/dist/common/models/redflag.const.js +27 -0
- package/dist/common/models/setting.const.d.ts +49 -0
- package/dist/common/models/setting.const.defaults.d.ts +3 -0
- package/dist/common/models/setting.const.defaults.js +185 -0
- package/dist/common/models/setting.const.js +68 -0
- package/dist/common/models/setting.const.preferred.d.ts +5 -0
- package/dist/common/models/setting.const.preferred.js +35 -0
- package/dist/common/models/setting.const.qr.d.ts +2 -0
- package/dist/common/models/setting.const.qr.js +174 -0
- package/dist/common/models/setting.type.d.ts +900 -0
- package/dist/common/models/setting.type.js +8 -0
- package/dist/common/models/shared.const.behabiour.d.ts +28 -0
- package/dist/common/models/shared.const.behabiour.js +36 -0
- package/dist/common/models/shared.const.d.ts +5 -0
- package/dist/common/models/shared.const.js +12 -0
- package/dist/common/models/shared.const.symbols.d.ts +9 -0
- package/dist/common/models/shared.const.symbols.js +20 -0
- package/dist/common/models/shared.definition.configNames.d.ts +36 -0
- package/dist/common/models/shared.definition.configNames.js +203 -0
- package/dist/common/models/shared.definition.d.ts +22 -0
- package/dist/common/models/shared.definition.js +24 -0
- package/dist/common/models/shared.type.util.d.ts +8 -0
- package/dist/common/models/shared.type.util.js +0 -0
- package/dist/common/models/sync.definition.d.ts +18 -0
- package/dist/common/models/sync.definition.js +20 -0
- package/dist/common/models/tweak.definition.d.ts +191 -0
- package/dist/common/models/tweak.definition.js +77 -0
- package/dist/common/rosetta.d.ts +42 -0
- package/dist/common/rosetta.js +57 -0
- package/dist/common/settingConstants.d.ts +216 -0
- package/dist/common/settingConstants.js +434 -0
- package/dist/common/typeUtils.d.ts +17 -0
- package/dist/common/typeUtils.js +51 -0
- package/dist/common/types.d.ts +107 -0
- package/dist/common/types.js +212 -0
- package/dist/common/utils.d.ts +129 -0
- package/dist/common/utils.doc.d.ts +11 -0
- package/dist/common/utils.doc.js +35 -0
- package/dist/common/utils.js +583 -0
- package/dist/common/utils.object.d.ts +2 -0
- package/dist/common/utils.object.js +14 -0
- package/dist/common/utils.patch.d.ts +8 -0
- package/dist/common/utils.patch.js +178 -0
- package/dist/common/utils.type.d.ts +1 -0
- package/dist/common/utils.type.js +0 -0
- package/dist/context.d.ts +8 -0
- package/dist/context.js +14 -0
- package/dist/databases/IndexedDBKeyValueDatabase.d.ts +26 -0
- package/dist/databases/IndexedDBKeyValueDatabase.js +130 -0
- package/dist/dataobject/StoredMap.d.ts +12 -0
- package/dist/dataobject/StoredMap.js +47 -0
- package/dist/dev/checks.d.ts +5 -0
- package/dist/dev/checks.js +38 -0
- package/dist/encryption/encryptHKDF.d.ts +3 -0
- package/dist/encryption/encryptHKDF.js +7 -0
- package/dist/encryption/stringEncryption.d.ts +27 -0
- package/dist/encryption/stringEncryption.js +59 -0
- package/dist/events/coreEvents.d.ts +54 -0
- package/dist/events/coreEvents.js +46 -0
- package/dist/hub/hub.d.ts +11 -0
- package/dist/hub/hub.js +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/interfaces/AsyncActivityRunner.d.ts +18 -0
- package/dist/interfaces/AsyncActivityRunner.js +7 -0
- package/dist/interfaces/Confirm.d.ts +17 -0
- package/dist/interfaces/Confirm.js +0 -0
- package/dist/interfaces/DatabaseFileAccess.d.ts +14 -0
- package/dist/interfaces/DatabaseFileAccess.js +0 -0
- package/dist/interfaces/DatabaseRebuilder.d.ts +13 -0
- package/dist/interfaces/DatabaseRebuilder.js +0 -0
- package/dist/interfaces/FileHandler.d.ts +13 -0
- package/dist/interfaces/FileHandler.js +0 -0
- package/dist/interfaces/KeyValueDatabase.d.ts +11 -0
- package/dist/interfaces/KeyValueDatabase.js +0 -0
- package/dist/interfaces/ServiceModule.d.ts +59 -0
- package/dist/interfaces/ServiceModule.js +19 -0
- package/dist/interfaces/StorageAccess.d.ts +44 -0
- package/dist/interfaces/StorageAccess.js +0 -0
- package/dist/interfaces/StorageEventManager.d.ts +16 -0
- package/dist/interfaces/StorageEventManager.js +5 -0
- package/dist/managers/ChangeManager.d.ts +61 -0
- package/dist/managers/ChangeManager.js +104 -0
- package/dist/managers/ChunkDeliveryCoordinator.d.ts +51 -0
- package/dist/managers/ChunkDeliveryCoordinator.js +136 -0
- package/dist/managers/ChunkFetcher.d.ts +44 -0
- package/dist/managers/ChunkFetcher.js +251 -0
- package/dist/managers/ChunkManager.d.ts +2 -0
- package/dist/managers/ChunkManager.js +4 -0
- package/dist/managers/ConflictManager.d.ts +37 -0
- package/dist/managers/ConflictManager.js +322 -0
- package/dist/managers/EntryManager/EntryManager.d.ts +37 -0
- package/dist/managers/EntryManager/EntryManager.js +73 -0
- package/dist/managers/EntryManager/EntryManagerImpls.d.ts +74 -0
- package/dist/managers/EntryManager/EntryManagerImpls.js +499 -0
- package/dist/managers/HashManager/HashManager.d.ts +60 -0
- package/dist/managers/HashManager/HashManager.js +97 -0
- package/dist/managers/HashManager/HashManagerCore.d.ts +114 -0
- package/dist/managers/HashManager/HashManagerCore.js +99 -0
- package/dist/managers/HashManager/PureJSHashManager.d.ts +77 -0
- package/dist/managers/HashManager/PureJSHashManager.js +84 -0
- package/dist/managers/HashManager/XXHashHashManager.d.ts +96 -0
- package/dist/managers/HashManager/XXHashHashManager.js +111 -0
- package/dist/managers/LayeredChunkManager/ArrivalWaitLayer.d.ts +30 -0
- package/dist/managers/LayeredChunkManager/ArrivalWaitLayer.js +115 -0
- package/dist/managers/LayeredChunkManager/CacheLayer.d.ts +59 -0
- package/dist/managers/LayeredChunkManager/CacheLayer.js +161 -0
- package/dist/managers/LayeredChunkManager/ChunkLayerInterfaces.d.ts +37 -0
- package/dist/managers/LayeredChunkManager/ChunkLayerInterfaces.js +0 -0
- package/dist/managers/LayeredChunkManager/DatabaseReadLayer.d.ts +14 -0
- package/dist/managers/LayeredChunkManager/DatabaseReadLayer.js +78 -0
- package/dist/managers/LayeredChunkManager/DatabaseWriteLayer.d.ts +11 -0
- package/dist/managers/LayeredChunkManager/DatabaseWriteLayer.js +43 -0
- package/dist/managers/LayeredChunkManager/HotPackLayer.d.ts +9 -0
- package/dist/managers/LayeredChunkManager/HotPackLayer.js +8 -0
- package/dist/managers/LayeredChunkManager/types.d.ts +39 -0
- package/dist/managers/LayeredChunkManager/types.js +0 -0
- package/dist/managers/LayeredChunkManager.d.ts +53 -0
- package/dist/managers/LayeredChunkManager.js +240 -0
- package/dist/managers/LiveSyncManagers.d.ts +48 -0
- package/dist/managers/LiveSyncManagers.js +136 -0
- package/dist/managers/StorageEventManager.d.ts +135 -0
- package/dist/managers/StorageEventManager.js +564 -0
- package/dist/managers/StorageProcessingManager.d.ts +14 -0
- package/dist/managers/StorageProcessingManager.js +48 -0
- package/dist/managers/adapters/IStorageEventConverterAdapter.d.ts +16 -0
- package/dist/managers/adapters/IStorageEventConverterAdapter.js +0 -0
- package/dist/managers/adapters/IStorageEventManagerAdapter.d.ts +18 -0
- package/dist/managers/adapters/IStorageEventManagerAdapter.js +0 -0
- package/dist/managers/adapters/IStorageEventPersistenceAdapter.d.ts +15 -0
- package/dist/managers/adapters/IStorageEventPersistenceAdapter.js +0 -0
- package/dist/managers/adapters/IStorageEventStatusAdapter.d.ts +13 -0
- package/dist/managers/adapters/IStorageEventStatusAdapter.js +0 -0
- package/dist/managers/adapters/IStorageEventTypeGuardAdapter.d.ts +16 -0
- package/dist/managers/adapters/IStorageEventTypeGuardAdapter.js +0 -0
- package/dist/managers/adapters/IStorageEventWatchAdapter.d.ts +21 -0
- package/dist/managers/adapters/IStorageEventWatchAdapter.js +0 -0
- package/dist/managers/adapters/index.d.ts +6 -0
- package/dist/managers/adapters/index.js +0 -0
- package/dist/mock_and_interop/stores.d.ts +21 -0
- package/dist/mock_and_interop/stores.js +15 -0
- package/dist/mock_and_interop/wrapper.d.ts +7 -0
- package/dist/mock_and_interop/wrapper.js +37 -0
- package/dist/mods.d.ts +1 -0
- package/dist/mods.js +18 -0
- package/dist/platform/browser/index.d.ts +1 -0
- package/dist/platform/browser/index.js +10 -0
- package/dist/platform/browser/storage.d.ts +35 -0
- package/dist/platform/browser/storage.js +139 -0
- package/dist/platform/node/index.d.ts +23 -0
- package/dist/platform/node/index.js +33 -0
- package/dist/platform/node/storage.d.ts +31 -0
- package/dist/platform/node/storage.js +104 -0
- package/dist/platform/storagePath.d.ts +7 -0
- package/dist/platform/storagePath.js +20 -0
- package/dist/pouchdb/LiveSyncDBFunctions.d.ts +14 -0
- package/dist/pouchdb/LiveSyncDBFunctions.js +129 -0
- package/dist/pouchdb/LiveSyncLocalDB.d.ts +196 -0
- package/dist/pouchdb/LiveSyncLocalDB.js +381 -0
- package/dist/pouchdb/PouchDBConstructor.d.ts +3 -0
- package/dist/pouchdb/PouchDBConstructor.js +0 -0
- package/dist/pouchdb/ReplicatorShim.d.ts +51 -0
- package/dist/pouchdb/ReplicatorShim.js +109 -0
- package/dist/pouchdb/StreamingFetch.d.ts +19 -0
- package/dist/pouchdb/StreamingFetch.js +263 -0
- package/dist/pouchdb/chunks.d.ts +38 -0
- package/dist/pouchdb/chunks.js +314 -0
- package/dist/pouchdb/compress.d.ts +11 -0
- package/dist/pouchdb/compress.js +99 -0
- package/dist/pouchdb/encryption.d.ts +20 -0
- package/dist/pouchdb/encryption.js +458 -0
- package/dist/pouchdb/negotiation.d.ts +9 -0
- package/dist/pouchdb/negotiation.js +109 -0
- package/dist/pouchdb/pouchdb-browser.d.ts +2 -0
- package/dist/pouchdb/pouchdb-browser.js +96 -0
- package/dist/pouchdb/pouchdb-http.d.ts +2 -0
- package/dist/pouchdb/pouchdb-http.js +94 -0
- package/dist/pouchdb/pouchdb-test.d.ts +2 -0
- package/dist/pouchdb/pouchdb-test.js +12 -0
- package/dist/pouchdb/utils_couchdb.d.ts +4 -0
- package/dist/pouchdb/utils_couchdb.js +38 -0
- package/dist/replication/LiveSyncAbstractReplicator.d.ts +69 -0
- package/dist/replication/LiveSyncAbstractReplicator.js +92 -0
- package/dist/replication/SyncParamsHandler.d.ts +35 -0
- package/dist/replication/SyncParamsHandler.js +118 -0
- package/dist/replication/couchdb/LiveSyncReplicator.d.ts +85 -0
- package/dist/replication/couchdb/LiveSyncReplicator.js +1132 -0
- package/dist/replication/httplib.d.ts +75 -0
- package/dist/replication/httplib.js +187 -0
- package/dist/replication/journal/JournalSyncCore.d.ts +70 -0
- package/dist/replication/journal/JournalSyncCore.js +737 -0
- package/dist/replication/journal/JournalSyncTypes.d.ts +9 -0
- package/dist/replication/journal/JournalSyncTypes.js +11 -0
- package/dist/replication/journal/LiveSyncJournalReplicator.d.ts +40 -0
- package/dist/replication/journal/LiveSyncJournalReplicator.js +294 -0
- package/dist/replication/journal/LiveSyncJournalReplicatorEnv.d.ts +3 -0
- package/dist/replication/journal/LiveSyncJournalReplicatorEnv.js +0 -0
- package/dist/replication/journal/objectstore/JournalStorageAdapter.d.ts +15 -0
- package/dist/replication/journal/objectstore/JournalStorageAdapter.js +0 -0
- package/dist/replication/journal/objectstore/MinioStorageAdapter.d.ts +21 -0
- package/dist/replication/journal/objectstore/MinioStorageAdapter.js +204 -0
- package/dist/replication/trystero/LiveSyncTrysteroReplicator.d.ts +90 -0
- package/dist/replication/trystero/LiveSyncTrysteroReplicator.js +380 -0
- package/dist/replication/trystero/P2PLogCollector.d.ts +8 -0
- package/dist/replication/trystero/P2PLogCollector.js +91 -0
- package/dist/replication/trystero/P2PReplicatorBase.d.ts +19 -0
- package/dist/replication/trystero/P2PReplicatorBase.js +0 -0
- package/dist/replication/trystero/P2PReplicatorCore.d.ts +12 -0
- package/dist/replication/trystero/P2PReplicatorCore.js +126 -0
- package/dist/replication/trystero/P2PReplicatorPaneCommon.d.ts +41 -0
- package/dist/replication/trystero/P2PReplicatorPaneCommon.js +20 -0
- package/dist/replication/trystero/ProxiedDB.d.ts +13 -0
- package/dist/replication/trystero/ProxiedDB.js +20 -0
- package/dist/replication/trystero/TrysteroReplicator.d.ts +152 -0
- package/dist/replication/trystero/TrysteroReplicator.js +683 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PClient.d.ts +19 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PClient.js +80 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PConnection.d.ts +2 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PConnection.js +4 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PServer.d.ts +117 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PServer.js +540 -0
- package/dist/replication/trystero/UseP2PReplicatorResult.d.ts +11 -0
- package/dist/replication/trystero/UseP2PReplicatorResult.js +0 -0
- package/dist/replication/trystero/addP2PEventHandlers.d.ts +35 -0
- package/dist/replication/trystero/addP2PEventHandlers.js +43 -0
- package/dist/replication/trystero/rpcCompat.d.ts +1 -0
- package/dist/replication/trystero/rpcCompat.js +9 -0
- package/dist/replication/trystero/types.d.ts +95 -0
- package/dist/replication/trystero/types.js +27 -0
- package/dist/replication/trystero/useP2PReplicatorCommands.d.ts +7 -0
- package/dist/replication/trystero/useP2PReplicatorCommands.js +25 -0
- package/dist/replication/trystero/useP2PReplicatorFeature.d.ts +17 -0
- package/dist/replication/trystero/useP2PReplicatorFeature.js +82 -0
- package/dist/rpc/RpcRoom.d.ts +24 -0
- package/dist/rpc/RpcRoom.js +300 -0
- package/dist/rpc/RpcSession.d.ts +9 -0
- package/dist/rpc/RpcSession.js +32 -0
- package/dist/rpc/chunking.d.ts +11 -0
- package/dist/rpc/chunking.js +58 -0
- package/dist/rpc/errors.d.ts +8 -0
- package/dist/rpc/errors.js +26 -0
- package/dist/rpc/index.d.ts +6 -0
- package/dist/rpc/index.js +12 -0
- package/dist/rpc/pouchdb/RpcPouchDBProxy.d.ts +75 -0
- package/dist/rpc/pouchdb/RpcPouchDBProxy.js +115 -0
- package/dist/rpc/pouchdb/RpcPouchDBServer.d.ts +16 -0
- package/dist/rpc/pouchdb/RpcPouchDBServer.js +55 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.d.ts +24 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.js +208 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.types.d.ts +64 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.types.js +12 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.utils.d.ts +33 -0
- package/dist/rpc/transports/DiagRTCPeerConnections.utils.js +217 -0
- package/dist/rpc/transports/TrysteroTransport.d.ts +216 -0
- package/dist/rpc/transports/TrysteroTransport.js +134 -0
- package/dist/rpc/transports/trysteroUtils.d.ts +3 -0
- package/dist/rpc/transports/trysteroUtils.js +37 -0
- package/dist/rpc/types.d.ts +75 -0
- package/dist/rpc/types.js +6 -0
- package/dist/serviceFeatures/checkRemoteSize.d.ts +28 -0
- package/dist/serviceFeatures/checkRemoteSize.js +178 -0
- package/dist/serviceFeatures/offlineScanner.d.ts +128 -0
- package/dist/serviceFeatures/offlineScanner.js +553 -0
- package/dist/serviceFeatures/prepareDatabaseForUse.d.ts +20 -0
- package/dist/serviceFeatures/prepareDatabaseForUse.js +39 -0
- package/dist/serviceFeatures/remoteConfig.d.ts +46 -0
- package/dist/serviceFeatures/remoteConfig.js +247 -0
- package/dist/serviceFeatures/setupObsidian/qrCode.d.ts +4 -0
- package/dist/serviceFeatures/setupObsidian/qrCode.js +67 -0
- package/dist/serviceFeatures/setupObsidian/setupUri.d.ts +7 -0
- package/dist/serviceFeatures/setupObsidian/setupUri.js +70 -0
- package/dist/serviceFeatures/setupObsidian/types.d.ts +2 -0
- package/dist/serviceFeatures/setupObsidian/types.js +0 -0
- package/dist/serviceFeatures/targetFilter.d.ts +24 -0
- package/dist/serviceFeatures/targetFilter.js +178 -0
- package/dist/serviceModules/FileAccessBase.d.ts +93 -0
- package/dist/serviceModules/FileAccessBase.js +219 -0
- package/dist/serviceModules/Rebuilder.d.ts +92 -0
- package/dist/serviceModules/Rebuilder.js +449 -0
- package/dist/serviceModules/ServiceDatabaseFileAccessBase.d.ts +40 -0
- package/dist/serviceModules/ServiceDatabaseFileAccessBase.js +306 -0
- package/dist/serviceModules/ServiceFileAccessBase.d.ts +64 -0
- package/dist/serviceModules/ServiceFileAccessBase.js +312 -0
- package/dist/serviceModules/ServiceFileHandlerBase.d.ts +52 -0
- package/dist/serviceModules/ServiceFileHandlerBase.js +493 -0
- package/dist/serviceModules/ServiceModuleBase.d.ts +10 -0
- package/dist/serviceModules/ServiceModuleBase.js +13 -0
- package/dist/serviceModules/adapters/IConversionAdapter.d.ts +15 -0
- package/dist/serviceModules/adapters/IConversionAdapter.js +0 -0
- package/dist/serviceModules/adapters/IFileSystemAdapter.d.ts +47 -0
- package/dist/serviceModules/adapters/IFileSystemAdapter.js +0 -0
- package/dist/serviceModules/adapters/IPathAdapter.d.ts +15 -0
- package/dist/serviceModules/adapters/IPathAdapter.js +0 -0
- package/dist/serviceModules/adapters/IStorageAdapter.d.ts +56 -0
- package/dist/serviceModules/adapters/IStorageAdapter.js +0 -0
- package/dist/serviceModules/adapters/ITypeGuardAdapter.d.ts +14 -0
- package/dist/serviceModules/adapters/ITypeGuardAdapter.js +0 -0
- package/dist/serviceModules/adapters/IVaultAdapter.d.ts +51 -0
- package/dist/serviceModules/adapters/IVaultAdapter.js +0 -0
- package/dist/serviceModules/adapters/index.d.ts +6 -0
- package/dist/serviceModules/adapters/index.js +0 -0
- package/dist/services/BrowserServices.d.ts +36 -0
- package/dist/services/BrowserServices.js +123 -0
- package/dist/services/HeadlessServices.d.ts +14 -0
- package/dist/services/HeadlessServices.js +144 -0
- package/dist/services/InjectableServices.d.ts +1 -0
- package/dist/services/InjectableServices.js +4 -0
- package/dist/services/ServiceHub.d.ts +82 -0
- package/dist/services/ServiceHub.js +66 -0
- package/dist/services/base/APIService.d.ts +93 -0
- package/dist/services/base/APIService.js +44 -0
- package/dist/services/base/AppLifecycleService.d.ts +132 -0
- package/dist/services/base/AppLifecycleService.js +123 -0
- package/dist/services/base/ConfigService.d.ts +7 -0
- package/dist/services/base/ConfigService.js +6 -0
- package/dist/services/base/ConflictService.d.ts +54 -0
- package/dist/services/base/ConflictService.js +22 -0
- package/dist/services/base/ControlService.d.ts +54 -0
- package/dist/services/base/ControlService.js +103 -0
- package/dist/services/base/DatabaseEventService.d.ts +38 -0
- package/dist/services/base/DatabaseEventService.js +38 -0
- package/dist/services/base/DatabaseService.d.ts +40 -0
- package/dist/services/base/DatabaseService.js +79 -0
- package/dist/services/base/FileProcessingService.d.ts +25 -0
- package/dist/services/base/FileProcessingService.js +28 -0
- package/dist/services/base/IService.d.ts +284 -0
- package/dist/services/base/IService.js +1 -0
- package/dist/services/base/KeyValueDBService.d.ts +42 -0
- package/dist/services/base/KeyValueDBService.js +133 -0
- package/dist/services/base/MessageTranslator.d.ts +6 -0
- package/dist/services/base/MessageTranslator.js +4 -0
- package/dist/services/base/PathService.d.ts +38 -0
- package/dist/services/base/PathService.js +66 -0
- package/dist/services/base/RemoteService.d.ts +61 -0
- package/dist/services/base/RemoteService.js +212 -0
- package/dist/services/base/ReplicationService.d.ts +92 -0
- package/dist/services/base/ReplicationService.js +261 -0
- package/dist/services/base/ReplicatorService.d.ts +66 -0
- package/dist/services/base/ReplicatorService.js +164 -0
- package/dist/services/base/ServiceBase.d.ts +33 -0
- package/dist/services/base/ServiceBase.js +27 -0
- package/dist/services/base/SettingService.d.ts +112 -0
- package/dist/services/base/SettingService.js +543 -0
- package/dist/services/base/TestService.d.ts +28 -0
- package/dist/services/base/TestService.js +19 -0
- package/dist/services/base/TweakValueService.d.ts +40 -0
- package/dist/services/base/TweakValueService.js +6 -0
- package/dist/services/base/UnresolvedErrorManager.d.ts +15 -0
- package/dist/services/base/UnresolvedErrorManager.js +44 -0
- package/dist/services/base/VaultService.d.ts +69 -0
- package/dist/services/base/VaultService.js +70 -0
- package/dist/services/implements/base/SvelteDialog.d.ts +79 -0
- package/dist/services/implements/base/SvelteDialog.js +134 -0
- package/dist/services/implements/base/UIService.d.ts +24 -0
- package/dist/services/implements/base/UIService.js +37 -0
- package/dist/services/implements/browser/BrowserAPIService.d.ts +54 -0
- package/dist/services/implements/browser/BrowserAPIService.js +298 -0
- package/dist/services/implements/browser/BrowserDatabaseService.d.ts +7 -0
- package/dist/services/implements/browser/BrowserDatabaseService.js +10 -0
- package/dist/services/implements/browser/ConfigServiceBrowserCompat.d.ts +16 -0
- package/dist/services/implements/browser/ConfigServiceBrowserCompat.js +23 -0
- package/dist/services/implements/headless/HeadlessAPIService.d.ts +52 -0
- package/dist/services/implements/headless/HeadlessAPIService.js +127 -0
- package/dist/services/implements/headless/HeadlessDatabaseService.d.ts +7 -0
- package/dist/services/implements/headless/HeadlessDatabaseService.js +10 -0
- package/dist/services/implements/injectable/InjectableAPIService.d.ts +7 -0
- package/dist/services/implements/injectable/InjectableAPIService.js +18 -0
- package/dist/services/implements/injectable/InjectableAppLifecycleService.d.ts +11 -0
- package/dist/services/implements/injectable/InjectableAppLifecycleService.js +14 -0
- package/dist/services/implements/injectable/InjectableConflictService.d.ts +11 -0
- package/dist/services/implements/injectable/InjectableConflictService.js +14 -0
- package/dist/services/implements/injectable/InjectableDatabaseEventService.d.ts +4 -0
- package/dist/services/implements/injectable/InjectableDatabaseEventService.js +7 -0
- package/dist/services/implements/injectable/InjectableFileProcessingService.d.ts +4 -0
- package/dist/services/implements/injectable/InjectableFileProcessingService.js +6 -0
- package/dist/services/implements/injectable/InjectablePathService.d.ts +12 -0
- package/dist/services/implements/injectable/InjectablePathService.js +36 -0
- package/dist/services/implements/injectable/InjectableRemoteService.d.ts +4 -0
- package/dist/services/implements/injectable/InjectableRemoteService.js +7 -0
- package/dist/services/implements/injectable/InjectableReplicationService.d.ts +4 -0
- package/dist/services/implements/injectable/InjectableReplicationService.js +6 -0
- package/dist/services/implements/injectable/InjectableReplicatorService.d.ts +4 -0
- package/dist/services/implements/injectable/InjectableReplicatorService.js +7 -0
- package/dist/services/implements/injectable/InjectableServiceHub.d.ts +72 -0
- package/dist/services/implements/injectable/InjectableServiceHub.js +125 -0
- package/dist/services/implements/injectable/InjectableServices.d.ts +36 -0
- package/dist/services/implements/injectable/InjectableServices.js +1 -0
- package/dist/services/implements/injectable/InjectableSettingService.d.ts +11 -0
- package/dist/services/implements/injectable/InjectableSettingService.js +33 -0
- package/dist/services/implements/injectable/InjectableTestService.d.ts +5 -0
- package/dist/services/implements/injectable/InjectableTestService.js +8 -0
- package/dist/services/implements/injectable/InjectableTweakValueService.d.ts +15 -0
- package/dist/services/implements/injectable/InjectableTweakValueService.js +12 -0
- package/dist/services/implements/injectable/InjectableVaultService.d.ts +9 -0
- package/dist/services/implements/injectable/InjectableVaultService.js +20 -0
- package/dist/services/lib/HandlerUtils.d.ts +374 -0
- package/dist/services/lib/HandlerUtils.js +412 -0
- package/dist/services/lib/logUtils.d.ts +13 -0
- package/dist/services/lib/logUtils.js +28 -0
- package/dist/services/lib/remoteActivity.d.ts +13 -0
- package/dist/services/lib/remoteActivity.js +11 -0
- package/dist/string_and_binary/chunks.d.ts +10 -0
- package/dist/string_and_binary/chunks.js +561 -0
- package/dist/string_and_binary/convert.d.ts +8 -0
- package/dist/string_and_binary/convert.js +46 -0
- package/dist/string_and_binary/hash.d.ts +2 -0
- package/dist/string_and_binary/hash.js +1 -0
- package/dist/string_and_binary/path.d.ts +35 -0
- package/dist/string_and_binary/path.js +240 -0
- package/dist/worker/bg.common.d.ts +2 -0
- package/dist/worker/bg.common.js +6 -0
- package/dist/worker/bg.worker.d.ts +1 -0
- package/dist/worker/bg.worker.encryption.d.ts +7 -0
- package/dist/worker/bg.worker.encryption.js +30 -0
- package/dist/worker/bg.worker.js +14 -0
- package/dist/worker/bg.worker.splitting.d.ts +6 -0
- package/dist/worker/bg.worker.splitting.js +36 -0
- package/dist/worker/bgWorker.d.ts +25 -0
- package/dist/worker/bgWorker.direct.d.ts +40 -0
- package/dist/worker/bgWorker.direct.js +65 -0
- package/dist/worker/bgWorker.encryption.d.ts +22 -0
- package/dist/worker/bgWorker.encryption.js +40 -0
- package/dist/worker/bgWorker.js +348 -0
- package/dist/worker/bgWorker.splitting.d.ts +27 -0
- package/dist/worker/bgWorker.splitting.js +123 -0
- package/dist/worker/universalTypes.d.ts +63 -0
- package/dist/worker/universalTypes.js +4 -0
- package/docs/development.md +51 -0
- package/docs/platform-storage.md +60 -0
- package/docs/releasing.md +69 -0
- package/package.json +693 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { ServiceBase } from "./ServiceBase.js";
|
|
2
|
+
import { delay, yieldMicrotask } from "octagonal-wheels/promises";
|
|
3
|
+
import { LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "../../common/logger.js";
|
|
4
|
+
import { createInstanceLogFunction } from "../lib/logUtils.js";
|
|
5
|
+
class KeyValueDBService extends ServiceBase {
|
|
6
|
+
_kvDB;
|
|
7
|
+
_simpleStore;
|
|
8
|
+
get simpleStore() {
|
|
9
|
+
if (!this._simpleStore) {
|
|
10
|
+
throw new Error("SimpleStore is not initialized yet");
|
|
11
|
+
}
|
|
12
|
+
return this._simpleStore;
|
|
13
|
+
}
|
|
14
|
+
get kvDB() {
|
|
15
|
+
if (!this._kvDB) {
|
|
16
|
+
throw new Error("KeyValueDB is not initialized yet");
|
|
17
|
+
}
|
|
18
|
+
return this._kvDB;
|
|
19
|
+
}
|
|
20
|
+
databaseEvents;
|
|
21
|
+
vault;
|
|
22
|
+
appLifecycle;
|
|
23
|
+
openKeyValueDatabase;
|
|
24
|
+
_log = createInstanceLogFunction("KeyValueDBService");
|
|
25
|
+
async _everyOnResetDatabase(any) {
|
|
26
|
+
try {
|
|
27
|
+
const kvDBKey = "queued-files";
|
|
28
|
+
await this._kvDB?.del(kvDBKey);
|
|
29
|
+
await this._kvDB?.destroy();
|
|
30
|
+
await yieldMicrotask();
|
|
31
|
+
this._kvDB = await this.openKeyValueDatabase(this.vault.getVaultName() + "-livesync-kv");
|
|
32
|
+
await delay(100);
|
|
33
|
+
} catch (e) {
|
|
34
|
+
this._kvDB = void 0;
|
|
35
|
+
this._log("Failed to reset KeyValueDB", LOG_LEVEL_NOTICE);
|
|
36
|
+
this._log(e, LOG_LEVEL_VERBOSE);
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
async tryCloseKvDB() {
|
|
42
|
+
try {
|
|
43
|
+
await this._kvDB?.close();
|
|
44
|
+
return true;
|
|
45
|
+
} catch (e) {
|
|
46
|
+
this._log("Failed to close KeyValueDB", LOG_LEVEL_VERBOSE);
|
|
47
|
+
this._log(e);
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async openKeyValueDB() {
|
|
52
|
+
await delay(10);
|
|
53
|
+
try {
|
|
54
|
+
await this.tryCloseKvDB();
|
|
55
|
+
await delay(10);
|
|
56
|
+
await yieldMicrotask();
|
|
57
|
+
this._kvDB = await this.openKeyValueDatabase(this.vault.getVaultName() + "-livesync-kv");
|
|
58
|
+
await yieldMicrotask();
|
|
59
|
+
await delay(100);
|
|
60
|
+
} catch (e) {
|
|
61
|
+
this._kvDB = void 0;
|
|
62
|
+
this._log("Failed to open KeyValueDB", LOG_LEVEL_NOTICE);
|
|
63
|
+
this._log(e, LOG_LEVEL_VERBOSE);
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
// Called when another database; LiveSyncLocalDB, is being unloaded.
|
|
69
|
+
// We need to close our KeyValueDB to avoid IndexedDB locking issues.
|
|
70
|
+
async _onOtherDatabaseUnload() {
|
|
71
|
+
if (this._kvDB) await this.tryCloseKvDB();
|
|
72
|
+
return Promise.resolve(true);
|
|
73
|
+
}
|
|
74
|
+
// Also, Called when another database; LiveSyncLocalDB, is being closed.
|
|
75
|
+
// We need to close our KeyValueDB to avoid IndexedDB locking issues.
|
|
76
|
+
async _onOtherDatabaseClose() {
|
|
77
|
+
if (this._kvDB) await this.tryCloseKvDB();
|
|
78
|
+
return Promise.resolve(true);
|
|
79
|
+
}
|
|
80
|
+
_everyOnInitializeDatabase(any) {
|
|
81
|
+
return this.openKeyValueDB();
|
|
82
|
+
}
|
|
83
|
+
async _everyOnloadAfterLoadSettings() {
|
|
84
|
+
if (!await this.openKeyValueDB()) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
this._simpleStore = this.openSimpleStore("os");
|
|
88
|
+
return Promise.resolve(true);
|
|
89
|
+
}
|
|
90
|
+
constructor(context, dependencies) {
|
|
91
|
+
super(context);
|
|
92
|
+
this.databaseEvents = dependencies.databaseEvents;
|
|
93
|
+
this.vault = dependencies.vault;
|
|
94
|
+
this.appLifecycle = dependencies.appLifecycle;
|
|
95
|
+
this.openKeyValueDatabase = dependencies.openKeyValueDatabase;
|
|
96
|
+
this.databaseEvents.onResetDatabase.addHandler(this._everyOnResetDatabase.bind(this));
|
|
97
|
+
this.appLifecycle.onSettingLoaded.addHandler(this._everyOnloadAfterLoadSettings.bind(this));
|
|
98
|
+
this.databaseEvents.onDatabaseInitialisation.addHandler(this._everyOnInitializeDatabase.bind(this));
|
|
99
|
+
this.databaseEvents.onUnloadDatabase.addHandler(this._onOtherDatabaseUnload.bind(this));
|
|
100
|
+
this.databaseEvents.onCloseDatabase.addHandler(this._onOtherDatabaseClose.bind(this));
|
|
101
|
+
}
|
|
102
|
+
openSimpleStore(kind) {
|
|
103
|
+
const getDB = () => {
|
|
104
|
+
if (!this._kvDB) {
|
|
105
|
+
throw new Error("KeyValueDB is not initialized yet");
|
|
106
|
+
}
|
|
107
|
+
return this._kvDB;
|
|
108
|
+
};
|
|
109
|
+
const prefix = `${kind}-`;
|
|
110
|
+
return {
|
|
111
|
+
get: async (key) => {
|
|
112
|
+
return await getDB().get(`${prefix}${key}`);
|
|
113
|
+
},
|
|
114
|
+
set: async (key, value) => {
|
|
115
|
+
await getDB().set(`${prefix}${key}`, value);
|
|
116
|
+
},
|
|
117
|
+
delete: async (key) => {
|
|
118
|
+
await getDB().del(`${prefix}${key}`);
|
|
119
|
+
},
|
|
120
|
+
keys: async (from, to, count) => {
|
|
121
|
+
const ret = await getDB().keys(
|
|
122
|
+
IDBKeyRange.bound(`${prefix}${from || ""}`, `${prefix}${to || ""}`),
|
|
123
|
+
count
|
|
124
|
+
);
|
|
125
|
+
return ret.map((e) => (typeof e === "string" ? e : JSON.stringify(e)).toString()).filter((e) => e.startsWith(prefix)).map((e) => e.substring(prefix.length));
|
|
126
|
+
},
|
|
127
|
+
db: Promise.resolve(getDB())
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
export {
|
|
132
|
+
KeyValueDBService
|
|
133
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Placeholder values substituted by a host translator. */
|
|
2
|
+
export type TranslationParameters = Readonly<Record<string, string>>;
|
|
3
|
+
/** A message translator supplied by the host for one service context. */
|
|
4
|
+
export type MessageTranslator = <TKey extends string>(key: TKey, params?: TranslationParameters) => string;
|
|
5
|
+
/** Default translator for headless clients which returns the message key unchanged. */
|
|
6
|
+
export declare const passthroughMessageTranslator: MessageTranslator;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DocumentID, EntryHasPath, FilePathWithPrefix, FilePath, AnyEntry, UXFileInfo, UXFileInfoStub } from "../../common/types.js";
|
|
2
|
+
import type { IPathService, ISettingService } from "./IService.js";
|
|
3
|
+
import { ServiceBase, type ServiceContext } from "./ServiceBase.js";
|
|
4
|
+
import type { BASE_IS_NEW, EVEN, TARGET_IS_NEW } from "../../common/models/shared.const.symbols.js";
|
|
5
|
+
export interface PathServiceDependencies {
|
|
6
|
+
settingService: ISettingService;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The PathService provides methods for converting between file paths and document IDs.
|
|
10
|
+
* This class would be migrated to the new logic later.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class PathService<T extends ServiceContext = ServiceContext> extends ServiceBase<T> implements IPathService {
|
|
13
|
+
protected settingService: ISettingService;
|
|
14
|
+
protected abstract normalizePath(path: string): string;
|
|
15
|
+
get settings(): import("../../common/types.js").ObsidianLiveSyncSettings;
|
|
16
|
+
constructor(context: T, dependencies: PathServiceDependencies);
|
|
17
|
+
private _id2path;
|
|
18
|
+
private _path2id;
|
|
19
|
+
/**
|
|
20
|
+
* Convert a document ID or entry to a virtual file path.
|
|
21
|
+
* @param id A document ID. Nowadays, it is mostly not the same as the file path.
|
|
22
|
+
* If the document has `_` prefixed, saved as `/_`.
|
|
23
|
+
* @param entry An entry object. If provided, it can be used to get the path directly.
|
|
24
|
+
* @param stripPrefix Whether to strip the prefix from the path.
|
|
25
|
+
*/
|
|
26
|
+
id2path(id: DocumentID, entry?: EntryHasPath, stripPrefix?: boolean): FilePathWithPrefix;
|
|
27
|
+
/**
|
|
28
|
+
* Convert a virtual file path to a document ID (with prefix if any).
|
|
29
|
+
* @param filename A file path with or without prefix.
|
|
30
|
+
* @param prefix The prefix to use for the document ID.
|
|
31
|
+
*/
|
|
32
|
+
path2id(filename: FilePathWithPrefix | FilePath, prefix?: string): Promise<DocumentID>;
|
|
33
|
+
getPath(entry: AnyEntry): FilePathWithPrefix;
|
|
34
|
+
abstract markChangesAreSame(old: UXFileInfo | AnyEntry | FilePathWithPrefix, newMtime: number, oldMtime: number): boolean | undefined;
|
|
35
|
+
abstract unmarkChanges(file: AnyEntry | FilePathWithPrefix | UXFileInfoStub): void;
|
|
36
|
+
abstract compareFileFreshness(baseFile: UXFileInfoStub | AnyEntry | undefined, checkTarget: UXFileInfo | AnyEntry | undefined): typeof BASE_IS_NEW | typeof TARGET_IS_NEW | typeof EVEN;
|
|
37
|
+
abstract isMarkedAsSameChanges(file: UXFileInfoStub | AnyEntry | FilePathWithPrefix, mtimes: number[]): undefined | typeof EVEN;
|
|
38
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ServiceBase } from "./ServiceBase.js";
|
|
2
|
+
import { addPrefix, id2path_base, path2id_base } from "../../string_and_binary/path.js";
|
|
3
|
+
import { isInternalMetadata, stripInternalMetadataPrefix } from "../../common/typeUtils.js";
|
|
4
|
+
class PathService extends ServiceBase {
|
|
5
|
+
settingService;
|
|
6
|
+
get settings() {
|
|
7
|
+
return this.settingService.currentSettings();
|
|
8
|
+
}
|
|
9
|
+
constructor(context, dependencies) {
|
|
10
|
+
super(context);
|
|
11
|
+
this.settingService = dependencies.settingService;
|
|
12
|
+
}
|
|
13
|
+
_id2path(id, entry) {
|
|
14
|
+
const filename = id2path_base(id, entry);
|
|
15
|
+
const temp = filename.split(":");
|
|
16
|
+
const path = temp.pop();
|
|
17
|
+
const normalizedPath = this.normalizePath(path);
|
|
18
|
+
temp.push(normalizedPath);
|
|
19
|
+
const fixedPath = temp.join(":");
|
|
20
|
+
return fixedPath;
|
|
21
|
+
}
|
|
22
|
+
async _path2id(filename, obfuscatePassphrase, caseInsensitive) {
|
|
23
|
+
const temp = filename.split(":");
|
|
24
|
+
const path = temp.pop();
|
|
25
|
+
const normalizedPath = this.normalizePath(path);
|
|
26
|
+
temp.push(normalizedPath);
|
|
27
|
+
const fixedPath = temp.join(":");
|
|
28
|
+
const out = await path2id_base(fixedPath, obfuscatePassphrase, caseInsensitive);
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Convert a document ID or entry to a virtual file path.
|
|
33
|
+
* @param id A document ID. Nowadays, it is mostly not the same as the file path.
|
|
34
|
+
* If the document has `_` prefixed, saved as `/_`.
|
|
35
|
+
* @param entry An entry object. If provided, it can be used to get the path directly.
|
|
36
|
+
* @param stripPrefix Whether to strip the prefix from the path.
|
|
37
|
+
*/
|
|
38
|
+
id2path(id, entry, stripPrefix) {
|
|
39
|
+
const tempId = this._id2path(id, entry);
|
|
40
|
+
if (stripPrefix && isInternalMetadata(tempId)) {
|
|
41
|
+
const out = stripInternalMetadataPrefix(tempId);
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
return tempId;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Convert a virtual file path to a document ID (with prefix if any).
|
|
48
|
+
* @param filename A file path with or without prefix.
|
|
49
|
+
* @param prefix The prefix to use for the document ID.
|
|
50
|
+
*/
|
|
51
|
+
async path2id(filename, prefix) {
|
|
52
|
+
const destPath = addPrefix(filename, prefix ?? "");
|
|
53
|
+
const setting = this.settings;
|
|
54
|
+
return await this._path2id(
|
|
55
|
+
destPath,
|
|
56
|
+
setting.usePathObfuscation ? setting.passphrase : "",
|
|
57
|
+
!setting.handleFilenameCaseSensitive
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
getPath(entry) {
|
|
61
|
+
return this.id2path(entry._id, entry);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
PathService
|
|
66
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CouchDBCredentials, EntryDoc } from "../../common/types.js";
|
|
2
|
+
import type { IRemoteService } from "./IService.js";
|
|
3
|
+
import { ServiceBase, type ServiceContext } from "./ServiceBase.js";
|
|
4
|
+
import { type LOG_LEVEL } from "../../common/types.js";
|
|
5
|
+
import { AuthorizationHeaderGenerator } from "../../replication/httplib.js";
|
|
6
|
+
import type { APIService } from "./APIService.js";
|
|
7
|
+
import type { AppLifecycleService } from "./AppLifecycleService.js";
|
|
8
|
+
import type { SettingService } from "./SettingService.js";
|
|
9
|
+
import { UnresolvedErrorManager } from "./UnresolvedErrorManager.js";
|
|
10
|
+
import { type LogFunction } from "../lib/logUtils.js";
|
|
11
|
+
import type { PouchDBConstructor } from "../../pouchdb/PouchDBConstructor.js";
|
|
12
|
+
export interface RemoteServiceDependencies {
|
|
13
|
+
/** PouchDB with the HTTP adapter required by the host runtime already registered. */
|
|
14
|
+
pouchDB: PouchDBConstructor;
|
|
15
|
+
APIService: APIService;
|
|
16
|
+
appLifecycle: AppLifecycleService;
|
|
17
|
+
setting: SettingService;
|
|
18
|
+
}
|
|
19
|
+
declare const FetchMethod: {
|
|
20
|
+
readonly webCompat: 0;
|
|
21
|
+
readonly native: 1;
|
|
22
|
+
};
|
|
23
|
+
type FetchMethod = (typeof FetchMethod)[keyof typeof FetchMethod];
|
|
24
|
+
/**
|
|
25
|
+
* The RemoteService provides methods for interacting with the remote database.
|
|
26
|
+
*/
|
|
27
|
+
export declare abstract class RemoteService<T extends ServiceContext = ServiceContext> extends ServiceBase<T> implements IRemoteService {
|
|
28
|
+
/**
|
|
29
|
+
* Connect to the remote database with the provided settings.
|
|
30
|
+
* @param uri The URI of the remote database.
|
|
31
|
+
* @param auth The authentication credentials for the remote database.
|
|
32
|
+
* @param disableRequestURI Whether to disable the request URI.
|
|
33
|
+
* @param passphrase The passphrase for the remote database.
|
|
34
|
+
* @param useDynamicIterationCount Whether to use dynamic iteration count.
|
|
35
|
+
* @param performSetup Whether to perform setup.
|
|
36
|
+
* @param skipInfo Whether to skip information retrieval.
|
|
37
|
+
* @param compression Whether to enable compression.
|
|
38
|
+
* @param customHeaders Custom headers to include in the request.
|
|
39
|
+
* @param useRequestAPI Whether to use the request API.
|
|
40
|
+
* @param getPBKDF2Salt Function to retrieve the PBKDF2 salt.
|
|
41
|
+
* Note that this function is used for CouchDB and compatible only.
|
|
42
|
+
*/
|
|
43
|
+
protected _log: LogFunction;
|
|
44
|
+
protected _authHeader: AuthorizationHeaderGenerator;
|
|
45
|
+
protected _APIService: APIService;
|
|
46
|
+
protected _appLifecycleService: AppLifecycleService;
|
|
47
|
+
protected _settingService: SettingService;
|
|
48
|
+
protected _unresolvedErrors: UnresolvedErrorManager;
|
|
49
|
+
protected _pouchDB: PouchDBConstructor;
|
|
50
|
+
protected last_successful_post: boolean;
|
|
51
|
+
get hadLastPostFailedBySize(): boolean;
|
|
52
|
+
constructor(context: T, dependencies: RemoteServiceDependencies);
|
|
53
|
+
showError(msg: string, max_log_level?: LOG_LEVEL): void;
|
|
54
|
+
clearErrors(): void;
|
|
55
|
+
performFetch(req: string | Request, opts?: RequestInit, fetchMethod?: FetchMethod): Promise<Response>;
|
|
56
|
+
connect(uri: string, auth: CouchDBCredentials, disableRequestURI: boolean, passphrase: string | false, useDynamicIterationCount: boolean, performSetup: boolean, skipInfo: boolean, compression: boolean, customHeaders: Record<string, string>, useRequestAPI: boolean, getPBKDF2Salt: () => Promise<Uint8Array<ArrayBuffer>>): Promise<string | {
|
|
57
|
+
db: PouchDB.Database<EntryDoc>;
|
|
58
|
+
info: PouchDB.Core.DatabaseInfo;
|
|
59
|
+
}>;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { ServiceBase } from "./ServiceBase.js";
|
|
2
|
+
import {
|
|
3
|
+
LOG_LEVEL_DEBUG,
|
|
4
|
+
LOG_LEVEL_INFO,
|
|
5
|
+
LOG_LEVEL_NOTICE,
|
|
6
|
+
LOG_LEVEL_VERBOSE
|
|
7
|
+
} from "../../common/types.js";
|
|
8
|
+
import { replicationFilter } from "../../pouchdb/compress.js";
|
|
9
|
+
import { disableEncryption, enableEncryption } from "../../pouchdb/encryption.js";
|
|
10
|
+
import { isCloudantURI, isValidRemoteCouchDBURI } from "../../pouchdb/utils_couchdb.js";
|
|
11
|
+
import { AuthorizationHeaderGenerator } from "../../replication/httplib.js";
|
|
12
|
+
import { UnresolvedErrorManager } from "./UnresolvedErrorManager.js";
|
|
13
|
+
import { createInstanceLogFunction, MARK_LOG_NETWORK_ERROR } from "../lib/logUtils.js";
|
|
14
|
+
import { runWithTrackedPhysicalRequest } from "../lib/remoteActivity.js";
|
|
15
|
+
import { LiveSyncError } from "../../common/LSError.js";
|
|
16
|
+
const FetchMethod = {
|
|
17
|
+
webCompat: 0,
|
|
18
|
+
native: 1
|
|
19
|
+
};
|
|
20
|
+
class RemoteService extends ServiceBase {
|
|
21
|
+
/**
|
|
22
|
+
* Connect to the remote database with the provided settings.
|
|
23
|
+
* @param uri The URI of the remote database.
|
|
24
|
+
* @param auth The authentication credentials for the remote database.
|
|
25
|
+
* @param disableRequestURI Whether to disable the request URI.
|
|
26
|
+
* @param passphrase The passphrase for the remote database.
|
|
27
|
+
* @param useDynamicIterationCount Whether to use dynamic iteration count.
|
|
28
|
+
* @param performSetup Whether to perform setup.
|
|
29
|
+
* @param skipInfo Whether to skip information retrieval.
|
|
30
|
+
* @param compression Whether to enable compression.
|
|
31
|
+
* @param customHeaders Custom headers to include in the request.
|
|
32
|
+
* @param useRequestAPI Whether to use the request API.
|
|
33
|
+
* @param getPBKDF2Salt Function to retrieve the PBKDF2 salt.
|
|
34
|
+
* Note that this function is used for CouchDB and compatible only.
|
|
35
|
+
*/
|
|
36
|
+
_log;
|
|
37
|
+
_authHeader = new AuthorizationHeaderGenerator();
|
|
38
|
+
_APIService;
|
|
39
|
+
_appLifecycleService;
|
|
40
|
+
_settingService;
|
|
41
|
+
_unresolvedErrors;
|
|
42
|
+
_pouchDB;
|
|
43
|
+
last_successful_post = false;
|
|
44
|
+
get hadLastPostFailedBySize() {
|
|
45
|
+
return !this.last_successful_post;
|
|
46
|
+
}
|
|
47
|
+
constructor(context, dependencies) {
|
|
48
|
+
super(context);
|
|
49
|
+
this._pouchDB = dependencies.pouchDB;
|
|
50
|
+
this._APIService = dependencies.APIService;
|
|
51
|
+
this._appLifecycleService = dependencies.appLifecycle;
|
|
52
|
+
this._settingService = dependencies.setting;
|
|
53
|
+
this._log = createInstanceLogFunction("RemoteService", dependencies.APIService);
|
|
54
|
+
this._unresolvedErrors = new UnresolvedErrorManager(this._appLifecycleService, this.context.events);
|
|
55
|
+
}
|
|
56
|
+
showError(msg, max_log_level = LOG_LEVEL_NOTICE) {
|
|
57
|
+
this._unresolvedErrors.showError(msg, max_log_level);
|
|
58
|
+
}
|
|
59
|
+
clearErrors() {
|
|
60
|
+
this._unresolvedErrors.clearErrors();
|
|
61
|
+
}
|
|
62
|
+
async performFetch(req, opts, fetchMethod = FetchMethod.webCompat) {
|
|
63
|
+
const useNativeFetch = fetchMethod === FetchMethod.native;
|
|
64
|
+
const fetchFunction = useNativeFetch ? this._APIService.nativeFetch.bind(this._APIService) : this._APIService.webCompatFetch.bind(this._APIService);
|
|
65
|
+
return await runWithTrackedPhysicalRequest(this._APIService, async () => {
|
|
66
|
+
const response = await fetchFunction(req, opts);
|
|
67
|
+
const method = opts?.method ?? "GET";
|
|
68
|
+
if (method == "POST" || method == "PUT") {
|
|
69
|
+
this.last_successful_post = response.ok;
|
|
70
|
+
} else {
|
|
71
|
+
this.last_successful_post = true;
|
|
72
|
+
}
|
|
73
|
+
const url = new URL(typeof req === "string" ? req : req.url);
|
|
74
|
+
const localURL = `${url.protocol}//${url.host}${url.pathname}`;
|
|
75
|
+
this._log(`[REQ] (${method}) ${localURL} -> ${response.status}`, LOG_LEVEL_DEBUG);
|
|
76
|
+
if (Math.floor(response.status / 100) !== 2) {
|
|
77
|
+
if (response.status == 404) {
|
|
78
|
+
if (method === "GET" && url.pathname.indexOf("/_local/") === -1) {
|
|
79
|
+
this._log(
|
|
80
|
+
`Just checkpoint or some server information has been missing. The 404 error shown above is not an error.`,
|
|
81
|
+
LOG_LEVEL_VERBOSE
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
const r = response.clone();
|
|
86
|
+
this._log(
|
|
87
|
+
`The request may have failed. The reason sent by the server: ${r.status}: ${r.statusText}`,
|
|
88
|
+
LOG_LEVEL_NOTICE
|
|
89
|
+
);
|
|
90
|
+
try {
|
|
91
|
+
const result = await r.text();
|
|
92
|
+
this._log(result, LOG_LEVEL_VERBOSE);
|
|
93
|
+
} catch (_) {
|
|
94
|
+
this._log("Could not fetch response body", LOG_LEVEL_VERBOSE);
|
|
95
|
+
this._log(_, LOG_LEVEL_VERBOSE);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
this.clearErrors();
|
|
100
|
+
}
|
|
101
|
+
return response;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
async connect(uri, auth, disableRequestURI, passphrase, useDynamicIterationCount, performSetup, skipInfo, compression, customHeaders, useRequestAPI, getPBKDF2Salt) {
|
|
105
|
+
if (!isValidRemoteCouchDBURI(uri)) return "Remote URI is not valid";
|
|
106
|
+
if (uri.toLowerCase() != uri) return "Remote URI and database name could not contain capital letters.";
|
|
107
|
+
if (uri.indexOf(" ") !== -1) return "Remote URI and database name could not contain spaces.";
|
|
108
|
+
if (!this._APIService.isOnline) {
|
|
109
|
+
return "Network is offline";
|
|
110
|
+
}
|
|
111
|
+
const conf = {
|
|
112
|
+
adapter: "http",
|
|
113
|
+
auth: "username" in auth ? auth : void 0,
|
|
114
|
+
skip_setup: !performSetup,
|
|
115
|
+
fetch: async (requestSrc, opts) => {
|
|
116
|
+
const url = new URL(typeof requestSrc === "string" ? requestSrc : requestSrc.url);
|
|
117
|
+
const authHeader = await this._authHeader.getAuthorizationHeader(auth);
|
|
118
|
+
let size = "";
|
|
119
|
+
const localURL = url.toString().substring(uri.length);
|
|
120
|
+
const method = opts?.method ?? "GET";
|
|
121
|
+
if (opts?.body) {
|
|
122
|
+
const bodyLength = typeof opts.body === "string" ? opts.body.length : JSON.stringify(opts.body).length;
|
|
123
|
+
const opts_length = isNaN(bodyLength) ? 0 : bodyLength;
|
|
124
|
+
if (opts_length > 1e3 * 1e3 * 10) {
|
|
125
|
+
if (isCloudantURI(uri)) {
|
|
126
|
+
this.last_successful_post = false;
|
|
127
|
+
this._log("This request should fail on IBM Cloudant.", LOG_LEVEL_VERBOSE);
|
|
128
|
+
throw new Error("This request should fail on IBM Cloudant.");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
size = ` (${opts_length})`;
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
const headers = new Headers(opts?.headers);
|
|
135
|
+
if (customHeaders) {
|
|
136
|
+
for (const [key, value] of Object.entries(customHeaders)) {
|
|
137
|
+
if (key && value) {
|
|
138
|
+
headers.append(key, value);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (!("username" in auth)) {
|
|
143
|
+
headers.append("authorization", authHeader);
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
const response = await this.performFetch(
|
|
147
|
+
requestSrc,
|
|
148
|
+
{ ...opts, headers },
|
|
149
|
+
useRequestAPI ? FetchMethod.native : FetchMethod.webCompat
|
|
150
|
+
);
|
|
151
|
+
return response;
|
|
152
|
+
} catch (ex) {
|
|
153
|
+
if (ex instanceof TypeError) {
|
|
154
|
+
if (useRequestAPI) {
|
|
155
|
+
this._log("Failed to request by API.");
|
|
156
|
+
throw ex;
|
|
157
|
+
}
|
|
158
|
+
this._log(
|
|
159
|
+
"Failed to fetch by native fetch API. Trying to fetch by API to get more information."
|
|
160
|
+
);
|
|
161
|
+
const resp2 = await this.performFetch(requestSrc, { ...opts, headers }, FetchMethod.native);
|
|
162
|
+
if (resp2.status / 100 == 2) {
|
|
163
|
+
this.showError(
|
|
164
|
+
"The request was successful by API. But the native fetch API failed! Please check CORS settings on the remote database!. While this condition, you cannot enable LiveSync",
|
|
165
|
+
LOG_LEVEL_NOTICE
|
|
166
|
+
);
|
|
167
|
+
return resp2;
|
|
168
|
+
}
|
|
169
|
+
const r2 = resp2.clone();
|
|
170
|
+
const msg = await r2.text();
|
|
171
|
+
this.showError(`Failed to fetch by API. ${resp2.status}: ${msg}`, LOG_LEVEL_NOTICE);
|
|
172
|
+
return resp2;
|
|
173
|
+
}
|
|
174
|
+
throw ex;
|
|
175
|
+
}
|
|
176
|
+
} catch (ex) {
|
|
177
|
+
this._log(`HTTP:${method}${size} to:${localURL} -> failed`, LOG_LEVEL_VERBOSE);
|
|
178
|
+
const msg = ex instanceof Error ? `${ex?.name}:${ex?.message}` : ex?.toString();
|
|
179
|
+
this.showError(`${MARK_LOG_NETWORK_ERROR}Network Error: Failed to fetch: ${msg}`, LOG_LEVEL_INFO);
|
|
180
|
+
this._log(ex, LOG_LEVEL_VERBOSE);
|
|
181
|
+
if (url.toString().indexOf("_bulk_docs") !== -1) {
|
|
182
|
+
this.last_successful_post = false;
|
|
183
|
+
}
|
|
184
|
+
this._log(ex);
|
|
185
|
+
throw ex;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const setting = this._settingService.currentSettings();
|
|
190
|
+
const db = new this._pouchDB(uri, conf);
|
|
191
|
+
replicationFilter(db, compression);
|
|
192
|
+
disableEncryption();
|
|
193
|
+
if (passphrase !== "false" && typeof passphrase === "string") {
|
|
194
|
+
enableEncryption(db, passphrase, useDynamicIterationCount, false, getPBKDF2Salt, setting.E2EEAlgorithm);
|
|
195
|
+
}
|
|
196
|
+
if (skipInfo) {
|
|
197
|
+
return { db, info: { db_name: "", doc_count: 0, update_seq: "" } };
|
|
198
|
+
}
|
|
199
|
+
try {
|
|
200
|
+
const info = await db.info();
|
|
201
|
+
return { db, info };
|
|
202
|
+
} catch (ex) {
|
|
203
|
+
const exMsg = ex instanceof Error ? ex : LiveSyncError.fromError(ex);
|
|
204
|
+
const msg = `${exMsg.name}:${exMsg.message}`;
|
|
205
|
+
this._log(ex, LOG_LEVEL_VERBOSE);
|
|
206
|
+
return msg;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
export {
|
|
211
|
+
RemoteService
|
|
212
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type LOG_LEVEL } from "../../common/types.js";
|
|
2
|
+
import type { IAPIService, IDatabaseService, IFileProcessingService, IReplicationService, IReplicatorService, ISettingService } from "./IService.js";
|
|
3
|
+
import { ServiceBase, type ServiceContext } from "./ServiceBase.js";
|
|
4
|
+
import { type LogFunction } from "../lib/logUtils.js";
|
|
5
|
+
import type { LiveSyncAbstractReplicator } from "../../replication/LiveSyncAbstractReplicator.js";
|
|
6
|
+
import type { AppLifecycleService } from "./AppLifecycleService.js";
|
|
7
|
+
export interface ReplicationServiceDependencies {
|
|
8
|
+
APIService: IAPIService;
|
|
9
|
+
settingService: ISettingService;
|
|
10
|
+
appLifecycleService: AppLifecycleService;
|
|
11
|
+
databaseService: IDatabaseService;
|
|
12
|
+
replicatorService: IReplicatorService;
|
|
13
|
+
fileProcessingService: IFileProcessingService;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The ReplicationService provides methods for managing replication processes.
|
|
17
|
+
*/
|
|
18
|
+
export declare abstract class ReplicationService<T extends ServiceContext = ServiceContext> extends ServiceBase<T> implements IReplicationService {
|
|
19
|
+
private _unresolvedErrorManager;
|
|
20
|
+
showError(msg: string, max_log_level?: LOG_LEVEL): void;
|
|
21
|
+
clearErrors(): void;
|
|
22
|
+
_log: LogFunction;
|
|
23
|
+
settingService: ISettingService;
|
|
24
|
+
appLifecycleService: AppLifecycleService;
|
|
25
|
+
replicatorService: IReplicatorService;
|
|
26
|
+
APIService: IAPIService;
|
|
27
|
+
fileProcessing: IFileProcessingService;
|
|
28
|
+
databaseService: IDatabaseService;
|
|
29
|
+
constructor(context: T, dependencies: ReplicationServiceDependencies);
|
|
30
|
+
/**
|
|
31
|
+
* Process a synchronisation result document.
|
|
32
|
+
*/
|
|
33
|
+
readonly processSynchroniseResult: import("../lib/HandlerUtils.js").BooleanMultipleHandlerFunction<(doc: import("../../common/types.js").MetaEntry) => Promise<boolean>>;
|
|
34
|
+
/**
|
|
35
|
+
* Process a synchronisation result document for optional entries i.e., hidden files.
|
|
36
|
+
*/
|
|
37
|
+
readonly processOptionalSynchroniseResult: import("../lib/HandlerUtils.js").BooleanMultipleHandlerFunction<(doc: import("../../common/types.js").LoadedEntry) => Promise<boolean>>;
|
|
38
|
+
/**
|
|
39
|
+
* Process an array of synchronisation result documents.
|
|
40
|
+
* @param docs An array of documents to parse and handle.
|
|
41
|
+
*/
|
|
42
|
+
readonly parseSynchroniseResult: import("../lib/HandlerUtils.js").BooleanMultipleHandlerFunction<(docs: Array<PouchDB.Core.ExistingDocument<import("../../common/types.js").EntryDoc>>) => Promise<boolean>>;
|
|
43
|
+
/**
|
|
44
|
+
* Process a virtual document (e.g., for customisation sync).
|
|
45
|
+
*/
|
|
46
|
+
readonly processVirtualDocument: import("../lib/HandlerUtils.js").BooleanMultipleHandlerFunction<(docs: PouchDB.Core.ExistingDocument<import("../../common/types.js").EntryDoc>) => Promise<boolean>>;
|
|
47
|
+
/**
|
|
48
|
+
* An event triggered before starting replication.
|
|
49
|
+
*/
|
|
50
|
+
readonly onBeforeReplicate: import("../lib/HandlerUtils.js").BooleanMultipleHandlerFunction<(showMessage: boolean) => Promise<boolean>>;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
readonly onCheckReplicationReady: import("../lib/HandlerUtils.js").BooleanMultipleHandlerFunction<(showMessage: boolean) => Promise<boolean>>;
|
|
55
|
+
/**
|
|
56
|
+
* Check if the replication is ready to start.
|
|
57
|
+
* @param showMessage Whether to show messages to the user.
|
|
58
|
+
*/
|
|
59
|
+
isReplicationReady(showMessage?: boolean): Promise<boolean>;
|
|
60
|
+
onReplicationFailed: import("../lib/HandlerUtils.js").BooleanMultipleHandlerFunction<(showMessage?: boolean) => Promise<boolean>>;
|
|
61
|
+
private performReplicationRequest;
|
|
62
|
+
/**
|
|
63
|
+
* Perform replication and handle a failed result.
|
|
64
|
+
* @param showMessage Whether to show replication progress messages.
|
|
65
|
+
*/
|
|
66
|
+
performReplication(showMessage?: boolean): Promise<boolean | void>;
|
|
67
|
+
/**
|
|
68
|
+
* Start the replication process.
|
|
69
|
+
* @param showMessage Whether to show messages to the user.
|
|
70
|
+
*/
|
|
71
|
+
replicate(showMessage?: boolean): Promise<boolean | void>;
|
|
72
|
+
previousReplicated: number;
|
|
73
|
+
/**
|
|
74
|
+
* Start the replication process triggered by an event (e.g., file change).
|
|
75
|
+
* @param showMessage Whether to show messages to the user.
|
|
76
|
+
*/
|
|
77
|
+
replicateByEvent(showMessage?: boolean): Promise<boolean | void>;
|
|
78
|
+
/**
|
|
79
|
+
* Check if there is a connection failure with the remote database.
|
|
80
|
+
*/
|
|
81
|
+
readonly checkConnectionFailure: import("../lib/HandlerUtils.js").MultipleHandlerFunction<() => Promise<boolean | "CHECKAGAIN" | undefined>, unknown>;
|
|
82
|
+
databaseQueueCount: import("octagonal-wheels/dataobject/reactive_v2").ReactiveSource<number>;
|
|
83
|
+
storageApplyingCount: import("octagonal-wheels/dataobject/reactive_v2").ReactiveSource<number>;
|
|
84
|
+
replicationResultCount: import("octagonal-wheels/dataobject/reactive_v2").ReactiveSource<number>;
|
|
85
|
+
getActiveReplicatorFor(usage: string): false | LiveSyncAbstractReplicator;
|
|
86
|
+
replicateAllToRemote(showingNotice?: boolean, sendChunksInBulkDisabled?: boolean): Promise<boolean>;
|
|
87
|
+
replicateAllFromRemote(showingNotice?: boolean): Promise<boolean>;
|
|
88
|
+
private _getReplicatorAndPerform;
|
|
89
|
+
markLocked(lockByClean?: boolean): Promise<void>;
|
|
90
|
+
markUnlocked(): Promise<void>;
|
|
91
|
+
markResolved(): Promise<void>;
|
|
92
|
+
}
|