@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,12 @@
|
|
|
1
|
+
import type { UXFileInfo, AnyEntry, UXFileInfoStub, FilePathWithPrefix } from "../../../common/types.js";
|
|
2
|
+
import { PathService } from "../../base/PathService.js";
|
|
3
|
+
import type { ServiceContext } from "../../base/ServiceBase.js";
|
|
4
|
+
import { BASE_IS_NEW, EVEN, TARGET_IS_NEW } from "../../../common/models/shared.const.symbols.js";
|
|
5
|
+
export declare function compareFileFreshnessGeneric(baseFile: UXFileInfoStub | AnyEntry | undefined, checkTarget: UXFileInfo | AnyEntry | undefined): typeof BASE_IS_NEW | typeof TARGET_IS_NEW | typeof EVEN;
|
|
6
|
+
export declare class PathServiceCompat<T extends ServiceContext> extends PathService<T> {
|
|
7
|
+
markChangesAreSame(old: UXFileInfo | AnyEntry | FilePathWithPrefix, newMtime: number, oldMtime: number): boolean | undefined;
|
|
8
|
+
unmarkChanges(file: AnyEntry | FilePathWithPrefix | UXFileInfoStub): void;
|
|
9
|
+
compareFileFreshness(baseFile: UXFileInfoStub | AnyEntry | undefined, checkTarget: UXFileInfo | AnyEntry | undefined): typeof BASE_IS_NEW | typeof TARGET_IS_NEW | typeof EVEN;
|
|
10
|
+
isMarkedAsSameChanges(file: UXFileInfoStub | AnyEntry | FilePathWithPrefix, mtimes: number[]): undefined | typeof EVEN;
|
|
11
|
+
normalizePath(path: string): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PathService } from "../../base/PathService.js";
|
|
2
|
+
import { BASE_IS_NEW, EVEN, TARGET_IS_NEW } from "../../../common/models/shared.const.symbols.js";
|
|
3
|
+
import { compareMTime } from "../../../common/utils.js";
|
|
4
|
+
function compareFileFreshnessGeneric(baseFile, checkTarget) {
|
|
5
|
+
if (baseFile === void 0 && checkTarget == void 0) return EVEN;
|
|
6
|
+
if (baseFile == void 0) return TARGET_IS_NEW;
|
|
7
|
+
if (checkTarget == void 0) return BASE_IS_NEW;
|
|
8
|
+
const modifiedBase = "stat" in baseFile ? baseFile?.stat?.mtime ?? 0 : baseFile?.mtime ?? 0;
|
|
9
|
+
const modifiedTarget = "stat" in checkTarget ? checkTarget?.stat?.mtime ?? 0 : checkTarget?.mtime ?? 0;
|
|
10
|
+
if (!modifiedBase && !modifiedTarget) {
|
|
11
|
+
return EVEN;
|
|
12
|
+
}
|
|
13
|
+
return compareMTime(modifiedBase, modifiedTarget);
|
|
14
|
+
}
|
|
15
|
+
class PathServiceCompat extends PathService {
|
|
16
|
+
markChangesAreSame(old, newMtime, oldMtime) {
|
|
17
|
+
return void 0;
|
|
18
|
+
}
|
|
19
|
+
unmarkChanges(file) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
compareFileFreshness(baseFile, checkTarget) {
|
|
23
|
+
return compareFileFreshnessGeneric(baseFile, checkTarget);
|
|
24
|
+
}
|
|
25
|
+
isMarkedAsSameChanges(file, mtimes) {
|
|
26
|
+
return void 0;
|
|
27
|
+
}
|
|
28
|
+
normalizePath(path) {
|
|
29
|
+
const fPath = path.replace(/\\/g, "/").replace(/\/+/g, "/");
|
|
30
|
+
return fPath;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
PathServiceCompat,
|
|
35
|
+
compareFileFreshnessGeneric
|
|
36
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReplicatorService } from "../../base/ReplicatorService.js";
|
|
2
|
+
class InjectableReplicatorService extends ReplicatorService {
|
|
3
|
+
// getActiveReplicator = handlers<IReplicatorService>().binder("getActiveReplicator");
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
InjectableReplicatorService
|
|
7
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ConfigService } from "../../base/ConfigService.js";
|
|
2
|
+
import { ControlService } from "../../base/ControlService.js";
|
|
3
|
+
import type { KeyValueDBService } from "../../base/KeyValueDBService.js";
|
|
4
|
+
import { PathService } from "../../base/PathService.js";
|
|
5
|
+
import type { ServiceContext } from "../../base/ServiceBase.js";
|
|
6
|
+
import type { SettingService } from "../../base/SettingService.js";
|
|
7
|
+
import { ServiceHub } from "../../ServiceHub.js";
|
|
8
|
+
import type { UIService } from "../base/UIService.js";
|
|
9
|
+
import { InjectableAPIService } from "./InjectableAPIService.js";
|
|
10
|
+
import { type AppLifecycleServiceBase } from "./InjectableAppLifecycleService.js";
|
|
11
|
+
import { InjectableConflictService } from "./InjectableConflictService.js";
|
|
12
|
+
import { InjectableDatabaseEventService } from "./InjectableDatabaseEventService.js";
|
|
13
|
+
import { InjectableFileProcessingService } from "./InjectableFileProcessingService.js";
|
|
14
|
+
import type { InjectableRemoteService } from "./InjectableRemoteService.js";
|
|
15
|
+
import { InjectableReplicationService } from "./InjectableReplicationService.js";
|
|
16
|
+
import { InjectableReplicatorService } from "./InjectableReplicatorService.js";
|
|
17
|
+
import type { InjectableServiceInstances } from "./InjectableServices.js";
|
|
18
|
+
import { InjectableTestService } from "./InjectableTestService.js";
|
|
19
|
+
import { InjectableTweakValueService } from "./InjectableTweakValueService.js";
|
|
20
|
+
import { InjectableVaultService } from "./InjectableVaultService.js";
|
|
21
|
+
import type { DatabaseService } from "../../base/DatabaseService.js";
|
|
22
|
+
export declare class InjectableServiceHub<T extends ServiceContext = ServiceContext> extends ServiceHub<T> {
|
|
23
|
+
protected readonly _api: InjectableAPIService<T>;
|
|
24
|
+
protected readonly _path: PathService<T>;
|
|
25
|
+
protected readonly _database: DatabaseService<T>;
|
|
26
|
+
protected readonly _databaseEvents: InjectableDatabaseEventService<T>;
|
|
27
|
+
protected readonly _replicator: InjectableReplicatorService<T>;
|
|
28
|
+
protected readonly _fileProcessing: InjectableFileProcessingService<T>;
|
|
29
|
+
protected readonly _replication: InjectableReplicationService<T>;
|
|
30
|
+
protected readonly _remote: InjectableRemoteService<T>;
|
|
31
|
+
protected readonly _conflict: InjectableConflictService<T>;
|
|
32
|
+
protected readonly _appLifecycle: AppLifecycleServiceBase<T>;
|
|
33
|
+
protected readonly _setting: SettingService<T>;
|
|
34
|
+
protected readonly _tweakValue: InjectableTweakValueService<T>;
|
|
35
|
+
protected readonly _vault: InjectableVaultService<T>;
|
|
36
|
+
protected readonly _test: InjectableTestService<T>;
|
|
37
|
+
protected readonly _ui: UIService<T>;
|
|
38
|
+
protected readonly _config: ConfigService<T>;
|
|
39
|
+
protected readonly _keyValueDB: KeyValueDBService<T>;
|
|
40
|
+
protected readonly _control: ControlService<T>;
|
|
41
|
+
get API(): InjectableAPIService<T>;
|
|
42
|
+
get path(): PathService<T>;
|
|
43
|
+
get database(): DatabaseService<T>;
|
|
44
|
+
get databaseEvents(): InjectableDatabaseEventService<T>;
|
|
45
|
+
get replicator(): InjectableReplicatorService<T>;
|
|
46
|
+
get fileProcessing(): InjectableFileProcessingService<T>;
|
|
47
|
+
get replication(): InjectableReplicationService<T>;
|
|
48
|
+
get remote(): InjectableRemoteService<T>;
|
|
49
|
+
get conflict(): InjectableConflictService<T>;
|
|
50
|
+
get appLifecycle(): AppLifecycleServiceBase<T>;
|
|
51
|
+
get setting(): SettingService<T>;
|
|
52
|
+
get tweakValue(): InjectableTweakValueService<T>;
|
|
53
|
+
get vault(): InjectableVaultService<T>;
|
|
54
|
+
get test(): InjectableTestService<T>;
|
|
55
|
+
get control(): ControlService<T>;
|
|
56
|
+
get keyValueDB(): KeyValueDBService<T>;
|
|
57
|
+
get UI(): UIService<T>;
|
|
58
|
+
get config(): ConfigService<T>;
|
|
59
|
+
constructor(context: T, services: InjectableServiceInstances<T> & {
|
|
60
|
+
setting: SettingService<T>;
|
|
61
|
+
appLifecycle: AppLifecycleServiceBase<T>;
|
|
62
|
+
path: PathService<T>;
|
|
63
|
+
API: InjectableAPIService<T>;
|
|
64
|
+
ui: UIService<T>;
|
|
65
|
+
config: ConfigService<T>;
|
|
66
|
+
database: DatabaseService<T>;
|
|
67
|
+
remote: InjectableRemoteService<T>;
|
|
68
|
+
vault: InjectableVaultService<T>;
|
|
69
|
+
keyValueDB: KeyValueDBService<T>;
|
|
70
|
+
replicator: InjectableReplicatorService<T>;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ControlService } from "../../base/ControlService.js";
|
|
2
|
+
import { PathService } from "../../base/PathService.js";
|
|
3
|
+
import { ServiceHub } from "../../ServiceHub.js";
|
|
4
|
+
import { InjectableAPIService } from "./InjectableAPIService.js";
|
|
5
|
+
import {} from "./InjectableAppLifecycleService.js";
|
|
6
|
+
import { InjectableConflictService } from "./InjectableConflictService.js";
|
|
7
|
+
import { InjectableDatabaseEventService } from "./InjectableDatabaseEventService.js";
|
|
8
|
+
import { InjectableFileProcessingService } from "./InjectableFileProcessingService.js";
|
|
9
|
+
import { InjectableReplicationService } from "./InjectableReplicationService.js";
|
|
10
|
+
import { InjectableReplicatorService } from "./InjectableReplicatorService.js";
|
|
11
|
+
import { InjectableTestService } from "./InjectableTestService.js";
|
|
12
|
+
import { InjectableTweakValueService } from "./InjectableTweakValueService.js";
|
|
13
|
+
import { InjectableVaultService } from "./InjectableVaultService.js";
|
|
14
|
+
class InjectableServiceHub extends ServiceHub {
|
|
15
|
+
_api;
|
|
16
|
+
_path;
|
|
17
|
+
_database;
|
|
18
|
+
_databaseEvents;
|
|
19
|
+
_replicator;
|
|
20
|
+
_fileProcessing;
|
|
21
|
+
_replication;
|
|
22
|
+
_remote;
|
|
23
|
+
_conflict;
|
|
24
|
+
_appLifecycle;
|
|
25
|
+
_setting;
|
|
26
|
+
_tweakValue;
|
|
27
|
+
_vault;
|
|
28
|
+
_test;
|
|
29
|
+
_ui;
|
|
30
|
+
_config;
|
|
31
|
+
_keyValueDB;
|
|
32
|
+
_control;
|
|
33
|
+
get API() {
|
|
34
|
+
return this._api;
|
|
35
|
+
}
|
|
36
|
+
get path() {
|
|
37
|
+
return this._path;
|
|
38
|
+
}
|
|
39
|
+
get database() {
|
|
40
|
+
return this._database;
|
|
41
|
+
}
|
|
42
|
+
get databaseEvents() {
|
|
43
|
+
return this._databaseEvents;
|
|
44
|
+
}
|
|
45
|
+
get replicator() {
|
|
46
|
+
return this._replicator;
|
|
47
|
+
}
|
|
48
|
+
get fileProcessing() {
|
|
49
|
+
return this._fileProcessing;
|
|
50
|
+
}
|
|
51
|
+
get replication() {
|
|
52
|
+
return this._replication;
|
|
53
|
+
}
|
|
54
|
+
get remote() {
|
|
55
|
+
return this._remote;
|
|
56
|
+
}
|
|
57
|
+
get conflict() {
|
|
58
|
+
return this._conflict;
|
|
59
|
+
}
|
|
60
|
+
get appLifecycle() {
|
|
61
|
+
return this._appLifecycle;
|
|
62
|
+
}
|
|
63
|
+
get setting() {
|
|
64
|
+
return this._setting;
|
|
65
|
+
}
|
|
66
|
+
get tweakValue() {
|
|
67
|
+
return this._tweakValue;
|
|
68
|
+
}
|
|
69
|
+
get vault() {
|
|
70
|
+
return this._vault;
|
|
71
|
+
}
|
|
72
|
+
get test() {
|
|
73
|
+
return this._test;
|
|
74
|
+
}
|
|
75
|
+
get control() {
|
|
76
|
+
return this._control;
|
|
77
|
+
}
|
|
78
|
+
get keyValueDB() {
|
|
79
|
+
return this._keyValueDB;
|
|
80
|
+
}
|
|
81
|
+
get UI() {
|
|
82
|
+
return this._ui;
|
|
83
|
+
}
|
|
84
|
+
get config() {
|
|
85
|
+
return this._config;
|
|
86
|
+
}
|
|
87
|
+
constructor(context, services) {
|
|
88
|
+
super(context, services);
|
|
89
|
+
this._api = services.API;
|
|
90
|
+
this._path = services.path;
|
|
91
|
+
this._database = services.database;
|
|
92
|
+
this._databaseEvents = services.databaseEvents ?? new InjectableDatabaseEventService(context);
|
|
93
|
+
this._replicator = services.replicator;
|
|
94
|
+
this._fileProcessing = services.fileProcessing ?? new InjectableFileProcessingService(context);
|
|
95
|
+
this._conflict = services.conflict ?? new InjectableConflictService(context);
|
|
96
|
+
this._appLifecycle = services.appLifecycle;
|
|
97
|
+
this._setting = services.setting;
|
|
98
|
+
this._remote = services.remote;
|
|
99
|
+
this._tweakValue = services.tweakValue ?? new InjectableTweakValueService(context);
|
|
100
|
+
this._replication = services.replication ?? new InjectableReplicationService(context, {
|
|
101
|
+
APIService: this._api,
|
|
102
|
+
appLifecycleService: this._appLifecycle,
|
|
103
|
+
replicatorService: this._replicator,
|
|
104
|
+
settingService: this._setting,
|
|
105
|
+
databaseService: this._database,
|
|
106
|
+
fileProcessingService: this._fileProcessing
|
|
107
|
+
});
|
|
108
|
+
this._vault = services.vault;
|
|
109
|
+
this._test = services.test ?? new InjectableTestService(context);
|
|
110
|
+
this._ui = services.ui;
|
|
111
|
+
this._config = services.config;
|
|
112
|
+
this._keyValueDB = services.keyValueDB;
|
|
113
|
+
this._control = services.control ?? new ControlService(context, {
|
|
114
|
+
appLifecycleService: this._appLifecycle,
|
|
115
|
+
databaseService: this._database,
|
|
116
|
+
fileProcessingService: this._fileProcessing,
|
|
117
|
+
settingService: this._setting,
|
|
118
|
+
APIService: this._api,
|
|
119
|
+
replicatorService: this._replicator
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
InjectableServiceHub
|
|
125
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ServiceInstances } from "../../ServiceHub.js";
|
|
2
|
+
import type { UIService } from "../base/UIService.js";
|
|
3
|
+
import type { ConfigService } from "../../base/ConfigService.js";
|
|
4
|
+
import type { ServiceContext } from "../../base/ServiceBase.js";
|
|
5
|
+
import type { InjectableAPIService } from "./InjectableAPIService.js";
|
|
6
|
+
import type { InjectableDatabaseEventService } from "./InjectableDatabaseEventService.js";
|
|
7
|
+
import type { InjectableReplicatorService } from "./InjectableReplicatorService.js";
|
|
8
|
+
import type { InjectableFileProcessingService } from "./InjectableFileProcessingService.js";
|
|
9
|
+
import type { InjectableReplicationService } from "./InjectableReplicationService.js";
|
|
10
|
+
import type { InjectableRemoteService } from "./InjectableRemoteService.js";
|
|
11
|
+
import type { InjectableConflictService } from "./InjectableConflictService.js";
|
|
12
|
+
import type { AppLifecycleServiceBase } from "./InjectableAppLifecycleService.js";
|
|
13
|
+
import type { InjectableTweakValueService } from "./InjectableTweakValueService.js";
|
|
14
|
+
import type { InjectableVaultService } from "./InjectableVaultService.js";
|
|
15
|
+
import type { InjectableTestService } from "./InjectableTestService.js";
|
|
16
|
+
import type { PathService } from "../../base/PathService.js";
|
|
17
|
+
import type { DatabaseService } from "../../base/DatabaseService.js";
|
|
18
|
+
import type { SettingService } from "../../base/SettingService.js";
|
|
19
|
+
export type InjectableServiceInstances<T extends ServiceContext> = ServiceInstances<T> & {
|
|
20
|
+
API?: InjectableAPIService<T>;
|
|
21
|
+
path?: PathService<T>;
|
|
22
|
+
database?: DatabaseService<T>;
|
|
23
|
+
databaseEvents?: InjectableDatabaseEventService<T>;
|
|
24
|
+
replicator?: InjectableReplicatorService<T>;
|
|
25
|
+
fileProcessing?: InjectableFileProcessingService<T>;
|
|
26
|
+
replication?: InjectableReplicationService<T>;
|
|
27
|
+
remote?: InjectableRemoteService<T>;
|
|
28
|
+
conflict?: InjectableConflictService<T>;
|
|
29
|
+
appLifecycle?: AppLifecycleServiceBase<T>;
|
|
30
|
+
setting?: SettingService<T>;
|
|
31
|
+
tweakValue?: InjectableTweakValueService<T>;
|
|
32
|
+
vault?: InjectableVaultService<T>;
|
|
33
|
+
test?: InjectableTestService<T>;
|
|
34
|
+
ui?: UIService<T>;
|
|
35
|
+
config?: ConfigService<T>;
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {} from "../../ServiceHub.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ServiceContext } from "../../base/ServiceBase.js";
|
|
2
|
+
import { SettingService, type SettingServiceDependencies } from "../../base/SettingService.js";
|
|
3
|
+
import type { ObsidianLiveSyncSettings } from "../../../common/types.js";
|
|
4
|
+
export declare class InjectableSettingService<T extends ServiceContext> extends SettingService<T> {
|
|
5
|
+
constructor(context: T, dependencies: SettingServiceDependencies);
|
|
6
|
+
protected setItem(key: string, value: string): void;
|
|
7
|
+
protected getItem(key: string): string;
|
|
8
|
+
protected deleteItem(key: string): void;
|
|
9
|
+
saveData: import("../../lib/HandlerUtils.js").HandlerFunction<(data: ObsidianLiveSyncSettings) => Promise<void>, unknown>;
|
|
10
|
+
loadData: import("../../lib/HandlerUtils.js").HandlerFunction<() => Promise<ObsidianLiveSyncSettings | undefined>, unknown>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EVENT_SETTING_SAVED } from "../../../events/coreEvents.js";
|
|
2
|
+
import { SettingService } from "../../base/SettingService.js";
|
|
3
|
+
import { EVENT_REQUEST_RELOAD_SETTING_TAB } from "../../../events/coreEvents.js";
|
|
4
|
+
import { handlers } from "../../lib/HandlerUtils.js";
|
|
5
|
+
import { compatGlobal } from "../../../common/coreEnvFunctions.js";
|
|
6
|
+
class InjectableSettingService extends SettingService {
|
|
7
|
+
constructor(context, dependencies) {
|
|
8
|
+
super(context, dependencies);
|
|
9
|
+
this.onSettingSaved.addHandler((settings) => {
|
|
10
|
+
this.context.events.emitEvent(EVENT_SETTING_SAVED, settings);
|
|
11
|
+
return Promise.resolve(true);
|
|
12
|
+
});
|
|
13
|
+
this.onSettingLoaded.addHandler((settings) => {
|
|
14
|
+
this.context.events.emitEvent(EVENT_REQUEST_RELOAD_SETTING_TAB);
|
|
15
|
+
return Promise.resolve(true);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
setItem(key, value) {
|
|
19
|
+
return compatGlobal.localStorage.setItem(key, value);
|
|
20
|
+
}
|
|
21
|
+
getItem(key) {
|
|
22
|
+
return compatGlobal.localStorage.getItem(key) ?? "";
|
|
23
|
+
}
|
|
24
|
+
deleteItem(key) {
|
|
25
|
+
compatGlobal.localStorage.removeItem(key);
|
|
26
|
+
}
|
|
27
|
+
// override currentSettings = handlers<SettingService<T>>().binder("currentSettings");
|
|
28
|
+
saveData = handlers().binder("saveData");
|
|
29
|
+
loadData = handlers().binder("loadData");
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
InjectableSettingService
|
|
33
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ServiceContext } from "../../base/ServiceBase.js";
|
|
2
|
+
import { TestService } from "../../base/TestService.js";
|
|
3
|
+
export declare class InjectableTestService<T extends ServiceContext> extends TestService<T> {
|
|
4
|
+
addTestResult: import("../../lib/HandlerUtils.js").HandlerFunction<(name: string, key: string, result: boolean, summary?: string, message?: string) => void, unknown>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ServiceContext } from "../../base/ServiceBase.js";
|
|
2
|
+
import { TweakValueService } from "../../base/TweakValueService.js";
|
|
3
|
+
export declare class InjectableTweakValueService<T extends ServiceContext> extends TweakValueService<T> {
|
|
4
|
+
fetchRemotePreferred: import("../../lib/HandlerUtils.js").HandlerFunction<(trialSetting: import("../../../common/types.js").RemoteDBSettings) => Promise<import("../../../common/types.js").TweakValues | false>, unknown>;
|
|
5
|
+
checkAndAskResolvingMismatched: import("../../lib/HandlerUtils.js").HandlerFunction<(preferred: Partial<import("../../../common/types.js").TweakValues>) => Promise<[import("../../../common/types.js").TweakValues | boolean, boolean]>, unknown>;
|
|
6
|
+
askResolvingMismatched: import("../../lib/HandlerUtils.js").HandlerFunction<(preferredSource: import("../../../common/types.js").TweakValues) => Promise<"OK" | "CHECKAGAIN" | "IGNORE">, unknown>;
|
|
7
|
+
checkAndAskUseRemoteConfiguration: import("../../lib/HandlerUtils.js").HandlerFunction<(settings: import("../../../common/types.js").RemoteDBSettings) => Promise<{
|
|
8
|
+
result: false | import("../../../common/types.js").TweakValues;
|
|
9
|
+
requireFetch: boolean;
|
|
10
|
+
}>, unknown>;
|
|
11
|
+
askUseRemoteConfiguration: import("../../lib/HandlerUtils.js").HandlerFunction<(trialSetting: import("../../../common/types.js").RemoteDBSettings, preferred: import("../../../common/types.js").TweakValues) => Promise<{
|
|
12
|
+
result: false | import("../../../common/types.js").TweakValues;
|
|
13
|
+
requireFetch: boolean;
|
|
14
|
+
}>, unknown>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TweakValueService } from "../../base/TweakValueService.js";
|
|
2
|
+
import { handlers } from "../../lib/HandlerUtils.js";
|
|
3
|
+
class InjectableTweakValueService extends TweakValueService {
|
|
4
|
+
fetchRemotePreferred = handlers().binder("fetchRemotePreferred");
|
|
5
|
+
checkAndAskResolvingMismatched = handlers().binder("checkAndAskResolvingMismatched");
|
|
6
|
+
askResolvingMismatched = handlers().binder("askResolvingMismatched");
|
|
7
|
+
checkAndAskUseRemoteConfiguration = handlers().binder("checkAndAskUseRemoteConfiguration");
|
|
8
|
+
askUseRemoteConfiguration = handlers().binder("askUseRemoteConfiguration");
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
InjectableTweakValueService
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ServiceContext } from "../../base/ServiceBase.js";
|
|
2
|
+
import { VaultService } from "../../base/VaultService.js";
|
|
3
|
+
export declare abstract class InjectableVaultService<T extends ServiceContext> extends VaultService<T> {
|
|
4
|
+
}
|
|
5
|
+
export declare class InjectableVaultServiceCompat<T extends ServiceContext> extends InjectableVaultService<T> {
|
|
6
|
+
isStorageInsensitive: import("../../lib/HandlerUtils.js").HandlerFunction<() => boolean, unknown>;
|
|
7
|
+
getActiveFilePath: import("../../lib/HandlerUtils.js").HandlerFunction<() => import("../../../common/types.js").FilePath | undefined, unknown>;
|
|
8
|
+
isValidPath(path: string): boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { isValidFilenameInWidows } from "../../../string_and_binary/path.js";
|
|
2
|
+
import { VaultService } from "../../base/VaultService.js";
|
|
3
|
+
import { handlers } from "../../lib/HandlerUtils.js";
|
|
4
|
+
class InjectableVaultService extends VaultService {
|
|
5
|
+
// scanVault = handlers<IVaultService>().binder("scanVault");
|
|
6
|
+
// isIgnoredByIgnoreFile = handlers<IVaultService>().binder("isIgnoredByIgnoreFile");
|
|
7
|
+
// isTargetFile = handlers<IVaultService>().bailFirstFailure("isTargetFile");
|
|
8
|
+
// markFileListPossiblyChanged = handlers<IVaultService>().binder("markFileListPossiblyChanged");
|
|
9
|
+
}
|
|
10
|
+
class InjectableVaultServiceCompat extends InjectableVaultService {
|
|
11
|
+
isStorageInsensitive = handlers().binder("isStorageInsensitive");
|
|
12
|
+
getActiveFilePath = handlers().binder("getActiveFilePath");
|
|
13
|
+
isValidPath(path) {
|
|
14
|
+
return isValidFilenameInWidows(path);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
InjectableVaultService,
|
|
19
|
+
InjectableVaultServiceCompat
|
|
20
|
+
};
|