@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.
Files changed (516) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -0
  3. package/dist/API/DirectFileManipulator.d.ts +2 -0
  4. package/dist/API/DirectFileManipulator.js +4 -0
  5. package/dist/API/DirectFileManipulatorV2.d.ts +150 -0
  6. package/dist/API/DirectFileManipulatorV2.js +424 -0
  7. package/dist/API/processSetting.d.ts +41 -0
  8. package/dist/API/processSetting.js +140 -0
  9. package/dist/ContentSplitter/ContentSplitter.d.ts +28 -0
  10. package/dist/ContentSplitter/ContentSplitter.js +5 -0
  11. package/dist/ContentSplitter/ContentSplitterBase.d.ts +51 -0
  12. package/dist/ContentSplitter/ContentSplitterBase.js +83 -0
  13. package/dist/ContentSplitter/ContentSplitterRabinKarp.d.ts +9 -0
  14. package/dist/ContentSplitter/ContentSplitterRabinKarp.js +32 -0
  15. package/dist/ContentSplitter/ContentSplitterV1.d.ts +9 -0
  16. package/dist/ContentSplitter/ContentSplitterV1.js +34 -0
  17. package/dist/ContentSplitter/ContentSplitterV2.d.ts +9 -0
  18. package/dist/ContentSplitter/ContentSplitterV2.js +34 -0
  19. package/dist/ContentSplitter/ContentSplitters.d.ts +12 -0
  20. package/dist/ContentSplitter/ContentSplitters.js +29 -0
  21. package/dist/bureau/bureau.d.ts +7 -0
  22. package/dist/bureau/bureau.js +5 -0
  23. package/dist/common/ConnectionString.d.ts +30 -0
  24. package/dist/common/ConnectionString.js +179 -0
  25. package/dist/common/LSError.d.ts +48 -0
  26. package/dist/common/LSError.js +112 -0
  27. package/dist/common/configForDoc.d.ts +79 -0
  28. package/dist/common/configForDoc.js +312 -0
  29. package/dist/common/coreEnvFunctions.d.ts +21 -0
  30. package/dist/common/coreEnvFunctions.js +22 -0
  31. package/dist/common/coreEnvVars.d.ts +3 -0
  32. package/dist/common/coreEnvVars.js +6 -0
  33. package/dist/common/i18n.d.ts +18 -0
  34. package/dist/common/i18n.js +7193 -0
  35. package/dist/common/logger.d.ts +2 -0
  36. package/dist/common/logger.js +1 -0
  37. package/dist/common/messages/combinedMessages.dev.d.ts +7 -0
  38. package/dist/common/messages/combinedMessages.dev.js +44 -0
  39. package/dist/common/messages/combinedMessages.prod.d.ts +9264 -0
  40. package/dist/common/messages/combinedMessages.prod.js +9271 -0
  41. package/dist/common/messages/de.d.ts +297 -0
  42. package/dist/common/messages/de.js +7 -0
  43. package/dist/common/messages/def.d.ts +1119 -0
  44. package/dist/common/messages/def.js +7 -0
  45. package/dist/common/messages/es.d.ts +689 -0
  46. package/dist/common/messages/es.js +7 -0
  47. package/dist/common/messages/fr.d.ts +582 -0
  48. package/dist/common/messages/fr.js +7 -0
  49. package/dist/common/messages/he.d.ts +583 -0
  50. package/dist/common/messages/he.js +7 -0
  51. package/dist/common/messages/ja.d.ts +838 -0
  52. package/dist/common/messages/ja.js +7 -0
  53. package/dist/common/messages/ko.d.ts +800 -0
  54. package/dist/common/messages/ko.js +7 -0
  55. package/dist/common/messages/ru.d.ts +858 -0
  56. package/dist/common/messages/ru.js +7 -0
  57. package/dist/common/messages/zh-tw.d.ts +384 -0
  58. package/dist/common/messages/zh-tw.js +7 -0
  59. package/dist/common/messages/zh.d.ts +1093 -0
  60. package/dist/common/messages/zh.js +7 -0
  61. package/dist/common/messagesJson/de.json +295 -0
  62. package/dist/common/messagesJson/en.json +1117 -0
  63. package/dist/common/messagesJson/es.json +687 -0
  64. package/dist/common/messagesJson/fr.json +580 -0
  65. package/dist/common/messagesJson/he.json +581 -0
  66. package/dist/common/messagesJson/ja.json +836 -0
  67. package/dist/common/messagesJson/ko.json +798 -0
  68. package/dist/common/messagesJson/ru.json +856 -0
  69. package/dist/common/messagesJson/zh-tw.json +382 -0
  70. package/dist/common/messagesJson/zh.json +1091 -0
  71. package/dist/common/models/auth.type.d.ts +41 -0
  72. package/dist/common/models/auth.type.js +0 -0
  73. package/dist/common/models/db.const.d.ts +20 -0
  74. package/dist/common/models/db.const.js +28 -0
  75. package/dist/common/models/db.definition.d.ts +56 -0
  76. package/dist/common/models/db.definition.js +6 -0
  77. package/dist/common/models/db.type.d.ts +142 -0
  78. package/dist/common/models/db.type.js +0 -0
  79. package/dist/common/models/diff.definition.d.ts +16 -0
  80. package/dist/common/models/diff.definition.js +0 -0
  81. package/dist/common/models/fileaccess.const.d.ts +7 -0
  82. package/dist/common/models/fileaccess.const.js +16 -0
  83. package/dist/common/models/fileaccess.type.d.ts +72 -0
  84. package/dist/common/models/fileaccess.type.js +0 -0
  85. package/dist/common/models/redflag.const.d.ts +32 -0
  86. package/dist/common/models/redflag.const.js +27 -0
  87. package/dist/common/models/setting.const.d.ts +49 -0
  88. package/dist/common/models/setting.const.defaults.d.ts +3 -0
  89. package/dist/common/models/setting.const.defaults.js +185 -0
  90. package/dist/common/models/setting.const.js +68 -0
  91. package/dist/common/models/setting.const.preferred.d.ts +5 -0
  92. package/dist/common/models/setting.const.preferred.js +35 -0
  93. package/dist/common/models/setting.const.qr.d.ts +2 -0
  94. package/dist/common/models/setting.const.qr.js +174 -0
  95. package/dist/common/models/setting.type.d.ts +900 -0
  96. package/dist/common/models/setting.type.js +8 -0
  97. package/dist/common/models/shared.const.behabiour.d.ts +28 -0
  98. package/dist/common/models/shared.const.behabiour.js +36 -0
  99. package/dist/common/models/shared.const.d.ts +5 -0
  100. package/dist/common/models/shared.const.js +12 -0
  101. package/dist/common/models/shared.const.symbols.d.ts +9 -0
  102. package/dist/common/models/shared.const.symbols.js +20 -0
  103. package/dist/common/models/shared.definition.configNames.d.ts +36 -0
  104. package/dist/common/models/shared.definition.configNames.js +203 -0
  105. package/dist/common/models/shared.definition.d.ts +22 -0
  106. package/dist/common/models/shared.definition.js +24 -0
  107. package/dist/common/models/shared.type.util.d.ts +8 -0
  108. package/dist/common/models/shared.type.util.js +0 -0
  109. package/dist/common/models/sync.definition.d.ts +18 -0
  110. package/dist/common/models/sync.definition.js +20 -0
  111. package/dist/common/models/tweak.definition.d.ts +191 -0
  112. package/dist/common/models/tweak.definition.js +77 -0
  113. package/dist/common/rosetta.d.ts +42 -0
  114. package/dist/common/rosetta.js +57 -0
  115. package/dist/common/settingConstants.d.ts +216 -0
  116. package/dist/common/settingConstants.js +434 -0
  117. package/dist/common/typeUtils.d.ts +17 -0
  118. package/dist/common/typeUtils.js +51 -0
  119. package/dist/common/types.d.ts +107 -0
  120. package/dist/common/types.js +212 -0
  121. package/dist/common/utils.d.ts +129 -0
  122. package/dist/common/utils.doc.d.ts +11 -0
  123. package/dist/common/utils.doc.js +35 -0
  124. package/dist/common/utils.js +583 -0
  125. package/dist/common/utils.object.d.ts +2 -0
  126. package/dist/common/utils.object.js +14 -0
  127. package/dist/common/utils.patch.d.ts +8 -0
  128. package/dist/common/utils.patch.js +178 -0
  129. package/dist/common/utils.type.d.ts +1 -0
  130. package/dist/common/utils.type.js +0 -0
  131. package/dist/context.d.ts +8 -0
  132. package/dist/context.js +14 -0
  133. package/dist/databases/IndexedDBKeyValueDatabase.d.ts +26 -0
  134. package/dist/databases/IndexedDBKeyValueDatabase.js +130 -0
  135. package/dist/dataobject/StoredMap.d.ts +12 -0
  136. package/dist/dataobject/StoredMap.js +47 -0
  137. package/dist/dev/checks.d.ts +5 -0
  138. package/dist/dev/checks.js +38 -0
  139. package/dist/encryption/encryptHKDF.d.ts +3 -0
  140. package/dist/encryption/encryptHKDF.js +7 -0
  141. package/dist/encryption/stringEncryption.d.ts +27 -0
  142. package/dist/encryption/stringEncryption.js +59 -0
  143. package/dist/events/coreEvents.d.ts +54 -0
  144. package/dist/events/coreEvents.js +46 -0
  145. package/dist/hub/hub.d.ts +11 -0
  146. package/dist/hub/hub.js +7 -0
  147. package/dist/index.d.ts +1 -0
  148. package/dist/index.js +4 -0
  149. package/dist/interfaces/AsyncActivityRunner.d.ts +18 -0
  150. package/dist/interfaces/AsyncActivityRunner.js +7 -0
  151. package/dist/interfaces/Confirm.d.ts +17 -0
  152. package/dist/interfaces/Confirm.js +0 -0
  153. package/dist/interfaces/DatabaseFileAccess.d.ts +14 -0
  154. package/dist/interfaces/DatabaseFileAccess.js +0 -0
  155. package/dist/interfaces/DatabaseRebuilder.d.ts +13 -0
  156. package/dist/interfaces/DatabaseRebuilder.js +0 -0
  157. package/dist/interfaces/FileHandler.d.ts +13 -0
  158. package/dist/interfaces/FileHandler.js +0 -0
  159. package/dist/interfaces/KeyValueDatabase.d.ts +11 -0
  160. package/dist/interfaces/KeyValueDatabase.js +0 -0
  161. package/dist/interfaces/ServiceModule.d.ts +59 -0
  162. package/dist/interfaces/ServiceModule.js +19 -0
  163. package/dist/interfaces/StorageAccess.d.ts +44 -0
  164. package/dist/interfaces/StorageAccess.js +0 -0
  165. package/dist/interfaces/StorageEventManager.d.ts +16 -0
  166. package/dist/interfaces/StorageEventManager.js +5 -0
  167. package/dist/managers/ChangeManager.d.ts +61 -0
  168. package/dist/managers/ChangeManager.js +104 -0
  169. package/dist/managers/ChunkDeliveryCoordinator.d.ts +51 -0
  170. package/dist/managers/ChunkDeliveryCoordinator.js +136 -0
  171. package/dist/managers/ChunkFetcher.d.ts +44 -0
  172. package/dist/managers/ChunkFetcher.js +251 -0
  173. package/dist/managers/ChunkManager.d.ts +2 -0
  174. package/dist/managers/ChunkManager.js +4 -0
  175. package/dist/managers/ConflictManager.d.ts +37 -0
  176. package/dist/managers/ConflictManager.js +322 -0
  177. package/dist/managers/EntryManager/EntryManager.d.ts +37 -0
  178. package/dist/managers/EntryManager/EntryManager.js +73 -0
  179. package/dist/managers/EntryManager/EntryManagerImpls.d.ts +74 -0
  180. package/dist/managers/EntryManager/EntryManagerImpls.js +499 -0
  181. package/dist/managers/HashManager/HashManager.d.ts +60 -0
  182. package/dist/managers/HashManager/HashManager.js +97 -0
  183. package/dist/managers/HashManager/HashManagerCore.d.ts +114 -0
  184. package/dist/managers/HashManager/HashManagerCore.js +99 -0
  185. package/dist/managers/HashManager/PureJSHashManager.d.ts +77 -0
  186. package/dist/managers/HashManager/PureJSHashManager.js +84 -0
  187. package/dist/managers/HashManager/XXHashHashManager.d.ts +96 -0
  188. package/dist/managers/HashManager/XXHashHashManager.js +111 -0
  189. package/dist/managers/LayeredChunkManager/ArrivalWaitLayer.d.ts +30 -0
  190. package/dist/managers/LayeredChunkManager/ArrivalWaitLayer.js +115 -0
  191. package/dist/managers/LayeredChunkManager/CacheLayer.d.ts +59 -0
  192. package/dist/managers/LayeredChunkManager/CacheLayer.js +161 -0
  193. package/dist/managers/LayeredChunkManager/ChunkLayerInterfaces.d.ts +37 -0
  194. package/dist/managers/LayeredChunkManager/ChunkLayerInterfaces.js +0 -0
  195. package/dist/managers/LayeredChunkManager/DatabaseReadLayer.d.ts +14 -0
  196. package/dist/managers/LayeredChunkManager/DatabaseReadLayer.js +78 -0
  197. package/dist/managers/LayeredChunkManager/DatabaseWriteLayer.d.ts +11 -0
  198. package/dist/managers/LayeredChunkManager/DatabaseWriteLayer.js +43 -0
  199. package/dist/managers/LayeredChunkManager/HotPackLayer.d.ts +9 -0
  200. package/dist/managers/LayeredChunkManager/HotPackLayer.js +8 -0
  201. package/dist/managers/LayeredChunkManager/types.d.ts +39 -0
  202. package/dist/managers/LayeredChunkManager/types.js +0 -0
  203. package/dist/managers/LayeredChunkManager.d.ts +53 -0
  204. package/dist/managers/LayeredChunkManager.js +240 -0
  205. package/dist/managers/LiveSyncManagers.d.ts +48 -0
  206. package/dist/managers/LiveSyncManagers.js +136 -0
  207. package/dist/managers/StorageEventManager.d.ts +135 -0
  208. package/dist/managers/StorageEventManager.js +564 -0
  209. package/dist/managers/StorageProcessingManager.d.ts +14 -0
  210. package/dist/managers/StorageProcessingManager.js +48 -0
  211. package/dist/managers/adapters/IStorageEventConverterAdapter.d.ts +16 -0
  212. package/dist/managers/adapters/IStorageEventConverterAdapter.js +0 -0
  213. package/dist/managers/adapters/IStorageEventManagerAdapter.d.ts +18 -0
  214. package/dist/managers/adapters/IStorageEventManagerAdapter.js +0 -0
  215. package/dist/managers/adapters/IStorageEventPersistenceAdapter.d.ts +15 -0
  216. package/dist/managers/adapters/IStorageEventPersistenceAdapter.js +0 -0
  217. package/dist/managers/adapters/IStorageEventStatusAdapter.d.ts +13 -0
  218. package/dist/managers/adapters/IStorageEventStatusAdapter.js +0 -0
  219. package/dist/managers/adapters/IStorageEventTypeGuardAdapter.d.ts +16 -0
  220. package/dist/managers/adapters/IStorageEventTypeGuardAdapter.js +0 -0
  221. package/dist/managers/adapters/IStorageEventWatchAdapter.d.ts +21 -0
  222. package/dist/managers/adapters/IStorageEventWatchAdapter.js +0 -0
  223. package/dist/managers/adapters/index.d.ts +6 -0
  224. package/dist/managers/adapters/index.js +0 -0
  225. package/dist/mock_and_interop/stores.d.ts +21 -0
  226. package/dist/mock_and_interop/stores.js +15 -0
  227. package/dist/mock_and_interop/wrapper.d.ts +7 -0
  228. package/dist/mock_and_interop/wrapper.js +37 -0
  229. package/dist/mods.d.ts +1 -0
  230. package/dist/mods.js +18 -0
  231. package/dist/platform/browser/index.d.ts +1 -0
  232. package/dist/platform/browser/index.js +10 -0
  233. package/dist/platform/browser/storage.d.ts +35 -0
  234. package/dist/platform/browser/storage.js +139 -0
  235. package/dist/platform/node/index.d.ts +23 -0
  236. package/dist/platform/node/index.js +33 -0
  237. package/dist/platform/node/storage.d.ts +31 -0
  238. package/dist/platform/node/storage.js +104 -0
  239. package/dist/platform/storagePath.d.ts +7 -0
  240. package/dist/platform/storagePath.js +20 -0
  241. package/dist/pouchdb/LiveSyncDBFunctions.d.ts +14 -0
  242. package/dist/pouchdb/LiveSyncDBFunctions.js +129 -0
  243. package/dist/pouchdb/LiveSyncLocalDB.d.ts +196 -0
  244. package/dist/pouchdb/LiveSyncLocalDB.js +381 -0
  245. package/dist/pouchdb/PouchDBConstructor.d.ts +3 -0
  246. package/dist/pouchdb/PouchDBConstructor.js +0 -0
  247. package/dist/pouchdb/ReplicatorShim.d.ts +51 -0
  248. package/dist/pouchdb/ReplicatorShim.js +109 -0
  249. package/dist/pouchdb/StreamingFetch.d.ts +19 -0
  250. package/dist/pouchdb/StreamingFetch.js +263 -0
  251. package/dist/pouchdb/chunks.d.ts +38 -0
  252. package/dist/pouchdb/chunks.js +314 -0
  253. package/dist/pouchdb/compress.d.ts +11 -0
  254. package/dist/pouchdb/compress.js +99 -0
  255. package/dist/pouchdb/encryption.d.ts +20 -0
  256. package/dist/pouchdb/encryption.js +458 -0
  257. package/dist/pouchdb/negotiation.d.ts +9 -0
  258. package/dist/pouchdb/negotiation.js +109 -0
  259. package/dist/pouchdb/pouchdb-browser.d.ts +2 -0
  260. package/dist/pouchdb/pouchdb-browser.js +96 -0
  261. package/dist/pouchdb/pouchdb-http.d.ts +2 -0
  262. package/dist/pouchdb/pouchdb-http.js +94 -0
  263. package/dist/pouchdb/pouchdb-test.d.ts +2 -0
  264. package/dist/pouchdb/pouchdb-test.js +12 -0
  265. package/dist/pouchdb/utils_couchdb.d.ts +4 -0
  266. package/dist/pouchdb/utils_couchdb.js +38 -0
  267. package/dist/replication/LiveSyncAbstractReplicator.d.ts +69 -0
  268. package/dist/replication/LiveSyncAbstractReplicator.js +92 -0
  269. package/dist/replication/SyncParamsHandler.d.ts +35 -0
  270. package/dist/replication/SyncParamsHandler.js +118 -0
  271. package/dist/replication/couchdb/LiveSyncReplicator.d.ts +85 -0
  272. package/dist/replication/couchdb/LiveSyncReplicator.js +1132 -0
  273. package/dist/replication/httplib.d.ts +75 -0
  274. package/dist/replication/httplib.js +187 -0
  275. package/dist/replication/journal/JournalSyncCore.d.ts +70 -0
  276. package/dist/replication/journal/JournalSyncCore.js +737 -0
  277. package/dist/replication/journal/JournalSyncTypes.d.ts +9 -0
  278. package/dist/replication/journal/JournalSyncTypes.js +11 -0
  279. package/dist/replication/journal/LiveSyncJournalReplicator.d.ts +40 -0
  280. package/dist/replication/journal/LiveSyncJournalReplicator.js +294 -0
  281. package/dist/replication/journal/LiveSyncJournalReplicatorEnv.d.ts +3 -0
  282. package/dist/replication/journal/LiveSyncJournalReplicatorEnv.js +0 -0
  283. package/dist/replication/journal/objectstore/JournalStorageAdapter.d.ts +15 -0
  284. package/dist/replication/journal/objectstore/JournalStorageAdapter.js +0 -0
  285. package/dist/replication/journal/objectstore/MinioStorageAdapter.d.ts +21 -0
  286. package/dist/replication/journal/objectstore/MinioStorageAdapter.js +204 -0
  287. package/dist/replication/trystero/LiveSyncTrysteroReplicator.d.ts +90 -0
  288. package/dist/replication/trystero/LiveSyncTrysteroReplicator.js +380 -0
  289. package/dist/replication/trystero/P2PLogCollector.d.ts +8 -0
  290. package/dist/replication/trystero/P2PLogCollector.js +91 -0
  291. package/dist/replication/trystero/P2PReplicatorBase.d.ts +19 -0
  292. package/dist/replication/trystero/P2PReplicatorBase.js +0 -0
  293. package/dist/replication/trystero/P2PReplicatorCore.d.ts +12 -0
  294. package/dist/replication/trystero/P2PReplicatorCore.js +126 -0
  295. package/dist/replication/trystero/P2PReplicatorPaneCommon.d.ts +41 -0
  296. package/dist/replication/trystero/P2PReplicatorPaneCommon.js +20 -0
  297. package/dist/replication/trystero/ProxiedDB.d.ts +13 -0
  298. package/dist/replication/trystero/ProxiedDB.js +20 -0
  299. package/dist/replication/trystero/TrysteroReplicator.d.ts +152 -0
  300. package/dist/replication/trystero/TrysteroReplicator.js +683 -0
  301. package/dist/replication/trystero/TrysteroReplicatorP2PClient.d.ts +19 -0
  302. package/dist/replication/trystero/TrysteroReplicatorP2PClient.js +80 -0
  303. package/dist/replication/trystero/TrysteroReplicatorP2PConnection.d.ts +2 -0
  304. package/dist/replication/trystero/TrysteroReplicatorP2PConnection.js +4 -0
  305. package/dist/replication/trystero/TrysteroReplicatorP2PServer.d.ts +117 -0
  306. package/dist/replication/trystero/TrysteroReplicatorP2PServer.js +540 -0
  307. package/dist/replication/trystero/UseP2PReplicatorResult.d.ts +11 -0
  308. package/dist/replication/trystero/UseP2PReplicatorResult.js +0 -0
  309. package/dist/replication/trystero/addP2PEventHandlers.d.ts +35 -0
  310. package/dist/replication/trystero/addP2PEventHandlers.js +43 -0
  311. package/dist/replication/trystero/rpcCompat.d.ts +1 -0
  312. package/dist/replication/trystero/rpcCompat.js +9 -0
  313. package/dist/replication/trystero/types.d.ts +95 -0
  314. package/dist/replication/trystero/types.js +27 -0
  315. package/dist/replication/trystero/useP2PReplicatorCommands.d.ts +7 -0
  316. package/dist/replication/trystero/useP2PReplicatorCommands.js +25 -0
  317. package/dist/replication/trystero/useP2PReplicatorFeature.d.ts +17 -0
  318. package/dist/replication/trystero/useP2PReplicatorFeature.js +82 -0
  319. package/dist/rpc/RpcRoom.d.ts +24 -0
  320. package/dist/rpc/RpcRoom.js +300 -0
  321. package/dist/rpc/RpcSession.d.ts +9 -0
  322. package/dist/rpc/RpcSession.js +32 -0
  323. package/dist/rpc/chunking.d.ts +11 -0
  324. package/dist/rpc/chunking.js +58 -0
  325. package/dist/rpc/errors.d.ts +8 -0
  326. package/dist/rpc/errors.js +26 -0
  327. package/dist/rpc/index.d.ts +6 -0
  328. package/dist/rpc/index.js +12 -0
  329. package/dist/rpc/pouchdb/RpcPouchDBProxy.d.ts +75 -0
  330. package/dist/rpc/pouchdb/RpcPouchDBProxy.js +115 -0
  331. package/dist/rpc/pouchdb/RpcPouchDBServer.d.ts +16 -0
  332. package/dist/rpc/pouchdb/RpcPouchDBServer.js +55 -0
  333. package/dist/rpc/transports/DiagRTCPeerConnections.d.ts +24 -0
  334. package/dist/rpc/transports/DiagRTCPeerConnections.js +208 -0
  335. package/dist/rpc/transports/DiagRTCPeerConnections.types.d.ts +64 -0
  336. package/dist/rpc/transports/DiagRTCPeerConnections.types.js +12 -0
  337. package/dist/rpc/transports/DiagRTCPeerConnections.utils.d.ts +33 -0
  338. package/dist/rpc/transports/DiagRTCPeerConnections.utils.js +217 -0
  339. package/dist/rpc/transports/TrysteroTransport.d.ts +216 -0
  340. package/dist/rpc/transports/TrysteroTransport.js +134 -0
  341. package/dist/rpc/transports/trysteroUtils.d.ts +3 -0
  342. package/dist/rpc/transports/trysteroUtils.js +37 -0
  343. package/dist/rpc/types.d.ts +75 -0
  344. package/dist/rpc/types.js +6 -0
  345. package/dist/serviceFeatures/checkRemoteSize.d.ts +28 -0
  346. package/dist/serviceFeatures/checkRemoteSize.js +178 -0
  347. package/dist/serviceFeatures/offlineScanner.d.ts +128 -0
  348. package/dist/serviceFeatures/offlineScanner.js +553 -0
  349. package/dist/serviceFeatures/prepareDatabaseForUse.d.ts +20 -0
  350. package/dist/serviceFeatures/prepareDatabaseForUse.js +39 -0
  351. package/dist/serviceFeatures/remoteConfig.d.ts +46 -0
  352. package/dist/serviceFeatures/remoteConfig.js +247 -0
  353. package/dist/serviceFeatures/setupObsidian/qrCode.d.ts +4 -0
  354. package/dist/serviceFeatures/setupObsidian/qrCode.js +67 -0
  355. package/dist/serviceFeatures/setupObsidian/setupUri.d.ts +7 -0
  356. package/dist/serviceFeatures/setupObsidian/setupUri.js +70 -0
  357. package/dist/serviceFeatures/setupObsidian/types.d.ts +2 -0
  358. package/dist/serviceFeatures/setupObsidian/types.js +0 -0
  359. package/dist/serviceFeatures/targetFilter.d.ts +24 -0
  360. package/dist/serviceFeatures/targetFilter.js +178 -0
  361. package/dist/serviceModules/FileAccessBase.d.ts +93 -0
  362. package/dist/serviceModules/FileAccessBase.js +219 -0
  363. package/dist/serviceModules/Rebuilder.d.ts +92 -0
  364. package/dist/serviceModules/Rebuilder.js +449 -0
  365. package/dist/serviceModules/ServiceDatabaseFileAccessBase.d.ts +40 -0
  366. package/dist/serviceModules/ServiceDatabaseFileAccessBase.js +306 -0
  367. package/dist/serviceModules/ServiceFileAccessBase.d.ts +64 -0
  368. package/dist/serviceModules/ServiceFileAccessBase.js +312 -0
  369. package/dist/serviceModules/ServiceFileHandlerBase.d.ts +52 -0
  370. package/dist/serviceModules/ServiceFileHandlerBase.js +493 -0
  371. package/dist/serviceModules/ServiceModuleBase.d.ts +10 -0
  372. package/dist/serviceModules/ServiceModuleBase.js +13 -0
  373. package/dist/serviceModules/adapters/IConversionAdapter.d.ts +15 -0
  374. package/dist/serviceModules/adapters/IConversionAdapter.js +0 -0
  375. package/dist/serviceModules/adapters/IFileSystemAdapter.d.ts +47 -0
  376. package/dist/serviceModules/adapters/IFileSystemAdapter.js +0 -0
  377. package/dist/serviceModules/adapters/IPathAdapter.d.ts +15 -0
  378. package/dist/serviceModules/adapters/IPathAdapter.js +0 -0
  379. package/dist/serviceModules/adapters/IStorageAdapter.d.ts +56 -0
  380. package/dist/serviceModules/adapters/IStorageAdapter.js +0 -0
  381. package/dist/serviceModules/adapters/ITypeGuardAdapter.d.ts +14 -0
  382. package/dist/serviceModules/adapters/ITypeGuardAdapter.js +0 -0
  383. package/dist/serviceModules/adapters/IVaultAdapter.d.ts +51 -0
  384. package/dist/serviceModules/adapters/IVaultAdapter.js +0 -0
  385. package/dist/serviceModules/adapters/index.d.ts +6 -0
  386. package/dist/serviceModules/adapters/index.js +0 -0
  387. package/dist/services/BrowserServices.d.ts +36 -0
  388. package/dist/services/BrowserServices.js +123 -0
  389. package/dist/services/HeadlessServices.d.ts +14 -0
  390. package/dist/services/HeadlessServices.js +144 -0
  391. package/dist/services/InjectableServices.d.ts +1 -0
  392. package/dist/services/InjectableServices.js +4 -0
  393. package/dist/services/ServiceHub.d.ts +82 -0
  394. package/dist/services/ServiceHub.js +66 -0
  395. package/dist/services/base/APIService.d.ts +93 -0
  396. package/dist/services/base/APIService.js +44 -0
  397. package/dist/services/base/AppLifecycleService.d.ts +132 -0
  398. package/dist/services/base/AppLifecycleService.js +123 -0
  399. package/dist/services/base/ConfigService.d.ts +7 -0
  400. package/dist/services/base/ConfigService.js +6 -0
  401. package/dist/services/base/ConflictService.d.ts +54 -0
  402. package/dist/services/base/ConflictService.js +22 -0
  403. package/dist/services/base/ControlService.d.ts +54 -0
  404. package/dist/services/base/ControlService.js +103 -0
  405. package/dist/services/base/DatabaseEventService.d.ts +38 -0
  406. package/dist/services/base/DatabaseEventService.js +38 -0
  407. package/dist/services/base/DatabaseService.d.ts +40 -0
  408. package/dist/services/base/DatabaseService.js +79 -0
  409. package/dist/services/base/FileProcessingService.d.ts +25 -0
  410. package/dist/services/base/FileProcessingService.js +28 -0
  411. package/dist/services/base/IService.d.ts +284 -0
  412. package/dist/services/base/IService.js +1 -0
  413. package/dist/services/base/KeyValueDBService.d.ts +42 -0
  414. package/dist/services/base/KeyValueDBService.js +133 -0
  415. package/dist/services/base/MessageTranslator.d.ts +6 -0
  416. package/dist/services/base/MessageTranslator.js +4 -0
  417. package/dist/services/base/PathService.d.ts +38 -0
  418. package/dist/services/base/PathService.js +66 -0
  419. package/dist/services/base/RemoteService.d.ts +61 -0
  420. package/dist/services/base/RemoteService.js +212 -0
  421. package/dist/services/base/ReplicationService.d.ts +92 -0
  422. package/dist/services/base/ReplicationService.js +261 -0
  423. package/dist/services/base/ReplicatorService.d.ts +66 -0
  424. package/dist/services/base/ReplicatorService.js +164 -0
  425. package/dist/services/base/ServiceBase.d.ts +33 -0
  426. package/dist/services/base/ServiceBase.js +27 -0
  427. package/dist/services/base/SettingService.d.ts +112 -0
  428. package/dist/services/base/SettingService.js +543 -0
  429. package/dist/services/base/TestService.d.ts +28 -0
  430. package/dist/services/base/TestService.js +19 -0
  431. package/dist/services/base/TweakValueService.d.ts +40 -0
  432. package/dist/services/base/TweakValueService.js +6 -0
  433. package/dist/services/base/UnresolvedErrorManager.d.ts +15 -0
  434. package/dist/services/base/UnresolvedErrorManager.js +44 -0
  435. package/dist/services/base/VaultService.d.ts +69 -0
  436. package/dist/services/base/VaultService.js +70 -0
  437. package/dist/services/implements/base/SvelteDialog.d.ts +79 -0
  438. package/dist/services/implements/base/SvelteDialog.js +134 -0
  439. package/dist/services/implements/base/UIService.d.ts +24 -0
  440. package/dist/services/implements/base/UIService.js +37 -0
  441. package/dist/services/implements/browser/BrowserAPIService.d.ts +54 -0
  442. package/dist/services/implements/browser/BrowserAPIService.js +298 -0
  443. package/dist/services/implements/browser/BrowserDatabaseService.d.ts +7 -0
  444. package/dist/services/implements/browser/BrowserDatabaseService.js +10 -0
  445. package/dist/services/implements/browser/ConfigServiceBrowserCompat.d.ts +16 -0
  446. package/dist/services/implements/browser/ConfigServiceBrowserCompat.js +23 -0
  447. package/dist/services/implements/headless/HeadlessAPIService.d.ts +52 -0
  448. package/dist/services/implements/headless/HeadlessAPIService.js +127 -0
  449. package/dist/services/implements/headless/HeadlessDatabaseService.d.ts +7 -0
  450. package/dist/services/implements/headless/HeadlessDatabaseService.js +10 -0
  451. package/dist/services/implements/injectable/InjectableAPIService.d.ts +7 -0
  452. package/dist/services/implements/injectable/InjectableAPIService.js +18 -0
  453. package/dist/services/implements/injectable/InjectableAppLifecycleService.d.ts +11 -0
  454. package/dist/services/implements/injectable/InjectableAppLifecycleService.js +14 -0
  455. package/dist/services/implements/injectable/InjectableConflictService.d.ts +11 -0
  456. package/dist/services/implements/injectable/InjectableConflictService.js +14 -0
  457. package/dist/services/implements/injectable/InjectableDatabaseEventService.d.ts +4 -0
  458. package/dist/services/implements/injectable/InjectableDatabaseEventService.js +7 -0
  459. package/dist/services/implements/injectable/InjectableFileProcessingService.d.ts +4 -0
  460. package/dist/services/implements/injectable/InjectableFileProcessingService.js +6 -0
  461. package/dist/services/implements/injectable/InjectablePathService.d.ts +12 -0
  462. package/dist/services/implements/injectable/InjectablePathService.js +36 -0
  463. package/dist/services/implements/injectable/InjectableRemoteService.d.ts +4 -0
  464. package/dist/services/implements/injectable/InjectableRemoteService.js +7 -0
  465. package/dist/services/implements/injectable/InjectableReplicationService.d.ts +4 -0
  466. package/dist/services/implements/injectable/InjectableReplicationService.js +6 -0
  467. package/dist/services/implements/injectable/InjectableReplicatorService.d.ts +4 -0
  468. package/dist/services/implements/injectable/InjectableReplicatorService.js +7 -0
  469. package/dist/services/implements/injectable/InjectableServiceHub.d.ts +72 -0
  470. package/dist/services/implements/injectable/InjectableServiceHub.js +125 -0
  471. package/dist/services/implements/injectable/InjectableServices.d.ts +36 -0
  472. package/dist/services/implements/injectable/InjectableServices.js +1 -0
  473. package/dist/services/implements/injectable/InjectableSettingService.d.ts +11 -0
  474. package/dist/services/implements/injectable/InjectableSettingService.js +33 -0
  475. package/dist/services/implements/injectable/InjectableTestService.d.ts +5 -0
  476. package/dist/services/implements/injectable/InjectableTestService.js +8 -0
  477. package/dist/services/implements/injectable/InjectableTweakValueService.d.ts +15 -0
  478. package/dist/services/implements/injectable/InjectableTweakValueService.js +12 -0
  479. package/dist/services/implements/injectable/InjectableVaultService.d.ts +9 -0
  480. package/dist/services/implements/injectable/InjectableVaultService.js +20 -0
  481. package/dist/services/lib/HandlerUtils.d.ts +374 -0
  482. package/dist/services/lib/HandlerUtils.js +412 -0
  483. package/dist/services/lib/logUtils.d.ts +13 -0
  484. package/dist/services/lib/logUtils.js +28 -0
  485. package/dist/services/lib/remoteActivity.d.ts +13 -0
  486. package/dist/services/lib/remoteActivity.js +11 -0
  487. package/dist/string_and_binary/chunks.d.ts +10 -0
  488. package/dist/string_and_binary/chunks.js +561 -0
  489. package/dist/string_and_binary/convert.d.ts +8 -0
  490. package/dist/string_and_binary/convert.js +46 -0
  491. package/dist/string_and_binary/hash.d.ts +2 -0
  492. package/dist/string_and_binary/hash.js +1 -0
  493. package/dist/string_and_binary/path.d.ts +35 -0
  494. package/dist/string_and_binary/path.js +240 -0
  495. package/dist/worker/bg.common.d.ts +2 -0
  496. package/dist/worker/bg.common.js +6 -0
  497. package/dist/worker/bg.worker.d.ts +1 -0
  498. package/dist/worker/bg.worker.encryption.d.ts +7 -0
  499. package/dist/worker/bg.worker.encryption.js +30 -0
  500. package/dist/worker/bg.worker.js +14 -0
  501. package/dist/worker/bg.worker.splitting.d.ts +6 -0
  502. package/dist/worker/bg.worker.splitting.js +36 -0
  503. package/dist/worker/bgWorker.d.ts +25 -0
  504. package/dist/worker/bgWorker.direct.d.ts +40 -0
  505. package/dist/worker/bgWorker.direct.js +65 -0
  506. package/dist/worker/bgWorker.encryption.d.ts +22 -0
  507. package/dist/worker/bgWorker.encryption.js +40 -0
  508. package/dist/worker/bgWorker.js +348 -0
  509. package/dist/worker/bgWorker.splitting.d.ts +27 -0
  510. package/dist/worker/bgWorker.splitting.js +123 -0
  511. package/dist/worker/universalTypes.d.ts +63 -0
  512. package/dist/worker/universalTypes.js +4 -0
  513. package/docs/development.md +51 -0
  514. package/docs/platform-storage.md +60 -0
  515. package/docs/releasing.md +69 -0
  516. package/package.json +693 -0
@@ -0,0 +1,900 @@
1
+ import type { ChunkAlgorithms, E2EEAlgorithms, HashAlgorithms, MODE_AUTOMATIC, MODE_PAUSED, MODE_SELECTIVE, MODE_SHINY, RemoteTypes } from "./setting.const.js";
2
+ import type { I18N_LANGS } from "../rosetta.js";
3
+ import type { CustomRegExpSourceList } from "./shared.type.util.js";
4
+ import type { JWTAlgorithm } from "./auth.type.js";
5
+ /**
6
+ * Represents the connection details required to connect to a CouchDB instance.
7
+ */
8
+ export interface CouchDBConnection {
9
+ /**
10
+ * The URI of the CouchDB instance.
11
+ */
12
+ couchDB_URI: string;
13
+ /**
14
+ * The username to use when connecting to the CouchDB instance.
15
+ */
16
+ couchDB_USER: string;
17
+ /**
18
+ * The password to use when connecting to the CouchDB instance.
19
+ */
20
+ couchDB_PASSWORD: string;
21
+ /**
22
+ * The name of the database to use.
23
+ */
24
+ couchDB_DBNAME: string;
25
+ /**
26
+ * e.g. `x-some-header: some-value\n x-some-header2: some-value2`
27
+ */
28
+ couchDB_CustomHeaders: string;
29
+ useJWT: boolean;
30
+ jwtAlgorithm: JWTAlgorithm;
31
+ jwtKey: string;
32
+ jwtKid: string;
33
+ jwtSub: string;
34
+ jwtExpDuration: number;
35
+ /**
36
+ * Use Request API to avoid `inevitable` CORS problem.
37
+ * Seems stable, so promoted to the normal setting.
38
+ */
39
+ useRequestAPI: boolean;
40
+ }
41
+ /**
42
+ * Interface representing the settings for periodic replication.
43
+ */
44
+ interface PeriodicReplicationSettings {
45
+ /**
46
+ * Indicates whether periodic replication is enabled.
47
+ */
48
+ periodicReplication: boolean;
49
+ /**
50
+ * The interval, in milliseconds, at which periodic replication occurs.
51
+ */
52
+ periodicReplicationInterval: number;
53
+ }
54
+ export type ConfigPassphraseStore = "" | "LOCALSTORAGE" | "ASK_AT_LAUNCH";
55
+ /**
56
+ * Represents the user settings that are encrypted.
57
+ */
58
+ interface EncryptedUserSettings {
59
+ /**
60
+ * The store for the configuration passphrase.
61
+ */
62
+ configPassphraseStore: ConfigPassphraseStore;
63
+ /**
64
+ * The encrypted passphrase used for E2EE.
65
+ */
66
+ encryptedPassphrase: string;
67
+ /**
68
+ * The encrypted connection details for CouchDB.
69
+ */
70
+ encryptedCouchDBConnection: string;
71
+ }
72
+ /**
73
+ * Interface representing the settings for different sync invocation methods.
74
+ */
75
+ interface SyncMethodSettings {
76
+ /**
77
+ * Synchronise in Live. This is an exclusive setting against other sync methods.
78
+ */
79
+ liveSync: boolean;
80
+ /**
81
+ * automatically run sync on save.
82
+ * File modification will trigger the sync, even if the file is not changed on the editor.
83
+ */
84
+ syncOnSave: boolean;
85
+ /**
86
+ * automatically run sync on starting the plug-in.
87
+ */
88
+ syncOnStart: boolean;
89
+ /**
90
+ * automatically run sync on opening a file.
91
+ */
92
+ syncOnFileOpen: boolean;
93
+ /**
94
+ * automatically run sync on editor save.
95
+ * Different from syncOnSave, this is only reacts to the editor save event.
96
+ */
97
+ syncOnEditorSave: boolean;
98
+ /**
99
+ * Desktop only, opt-in. Keep replication running while the window is hidden or minimised,
100
+ * instead of suspending it until the window becomes visible again. The trigger is
101
+ * document.hidden, not window focus. Applies to the background-capable sync modes (LiveSync
102
+ * and Periodic). Ignored on mobile. Default false.
103
+ */
104
+ keepReplicationActiveInBackground: boolean;
105
+ /**
106
+ * The minimum delay between synchronisation operations (in milliseconds).
107
+ * If the operation is triggered before this delay, the operation will be delayed until the delay is over, and executed as a single operation.
108
+ */
109
+ syncMinimumInterval: number;
110
+ }
111
+ /**
112
+ * Interface representing the settings for file handling.
113
+ */
114
+ interface FileHandlingSettings {
115
+ /**
116
+ * Use trash instead of actually delete.
117
+ */
118
+ trashInsteadDelete: boolean;
119
+ /**
120
+ * Do not delete the folder even if it has got empty.
121
+ */
122
+ doNotDeleteFolder: boolean;
123
+ /**
124
+ * Thinning out the changes and make a single change for the same file.
125
+ */
126
+ batchSave: boolean;
127
+ batchSaveMinimumDelay: number;
128
+ batchSaveMaximumDelay: number;
129
+ /**
130
+ * Maximum size of the file to be synchronized (in MB).
131
+ */
132
+ syncMaxSizeInMB: number;
133
+ /**
134
+ * Use ignore files.
135
+ */
136
+ useIgnoreFiles: boolean;
137
+ /**
138
+ * Ignore files pattern, i,e, `.gitignore, .obsidianignore` (This should be separated by comma)
139
+ */
140
+ ignoreFiles: string;
141
+ /**
142
+ * Do not prevent write if the size is mismatched.
143
+ */
144
+ processSizeMismatchedFiles: boolean;
145
+ }
146
+ /**
147
+ * Interface representing the settings for Hidden File Sync.
148
+ */
149
+ interface InternalFileSettings {
150
+ /**
151
+ * Synchronise internal files.
152
+ */
153
+ syncInternalFiles: boolean;
154
+ /**
155
+ * Scan internal files before replication.
156
+ */
157
+ syncInternalFilesBeforeReplication: boolean;
158
+ /**
159
+ * Interval for scanning internal files (in seconds).
160
+ */
161
+ syncInternalFilesInterval: number;
162
+ /**
163
+ * Ignore patterns for internal files.
164
+ * (Comma separated list of regular expressions)
165
+ */
166
+ syncInternalFilesIgnorePatterns: CustomRegExpSourceList<",">;
167
+ /**
168
+ * Limit patterns for internal files.
169
+ */
170
+ syncInternalFilesTargetPatterns: CustomRegExpSourceList<",">;
171
+ /**
172
+ * Enable watch internal file changes (This option uses the unexposed API)
173
+ */
174
+ watchInternalFileChanges: boolean;
175
+ /**
176
+ * Suppress notification of hidden files change.
177
+ */
178
+ suppressNotifyHiddenFilesChange: boolean;
179
+ /**
180
+ * Overwrite instead of merging patterns for internal files.
181
+ */
182
+ syncInternalFileOverwritePatterns: CustomRegExpSourceList<",">;
183
+ }
184
+ export type SYNC_MODE = typeof MODE_SELECTIVE | typeof MODE_AUTOMATIC | typeof MODE_PAUSED | typeof MODE_SHINY;
185
+ export interface PluginSyncSettingEntry {
186
+ key: string;
187
+ mode: SYNC_MODE;
188
+ files: string[];
189
+ }
190
+ /**
191
+ * Interface representing the settings for plugin synchronisation.
192
+ */
193
+ interface PluginSyncSettings {
194
+ /**
195
+ * Indicates whether plugin synchronisation is enabled.
196
+ */
197
+ usePluginSync: boolean;
198
+ /**
199
+ * Indicates whether plugin settings synchronisation is enabled.
200
+ */
201
+ usePluginSettings: boolean;
202
+ /**
203
+ * Indicates whether to show the device's own plugins.
204
+ */
205
+ showOwnPlugins: boolean;
206
+ /**
207
+ * Indicates whether to automatically scan plugins.
208
+ */
209
+ autoSweepPlugins: boolean;
210
+ /**
211
+ * Indicates whether to periodically scan plugins automatically.
212
+ */
213
+ autoSweepPluginsPeriodic: boolean;
214
+ /**
215
+ * Indicates whether to notify when a plugin or setting is updated.
216
+ */
217
+ notifyPluginOrSettingUpdated: boolean;
218
+ /**
219
+ * The name of the device and vault.
220
+ * This is used to identify the device and vault among synchronised devices and vaults.
221
+ * Hence, this should be unique among devices and vaults.
222
+ */
223
+ deviceAndVaultName: string;
224
+ /**
225
+ * Indicates whether the v2 of plugin synchronisation is enabled.
226
+ */
227
+ usePluginSyncV2: boolean;
228
+ /**
229
+ * Indicates whether additional plugin synchronisation settings are enabled.
230
+ * This setting is hidden from the UI.
231
+ */
232
+ usePluginEtc: boolean;
233
+ /**
234
+ * Extended settings for plugin synchronisation.
235
+ */
236
+ pluginSyncExtendedSetting: Record<PluginSyncSettingEntry["key"], PluginSyncSettingEntry>;
237
+ }
238
+ /**
239
+ * Interface representing the user interface settings.
240
+ */
241
+ interface UISettings {
242
+ /**
243
+ * Indicates whether verbose logging has been enabled.
244
+ */
245
+ showVerboseLog: boolean;
246
+ /**
247
+ * Indicates whether less information should be shown in the log.
248
+ */
249
+ lessInformationInLog: boolean;
250
+ /**
251
+ * Indicates whether longer status line should be shown inside the editor.
252
+ */
253
+ showLongerLogInsideEditor: boolean;
254
+ /**
255
+ * Indicates whether the status line should be shown on the editor.
256
+ */
257
+ showStatusOnEditor: boolean;
258
+ /**
259
+ * Indicates whether the status line should be shown on the status bar.
260
+ */
261
+ showStatusOnStatusbar: boolean;
262
+ /**
263
+ * Indicates whether only icons instead of status line should be shown on the editor.
264
+ */
265
+ showOnlyIconsOnEditor: boolean;
266
+ /**
267
+ * Hide File warning notice bar.
268
+ */
269
+ hideFileWarningNotice: boolean;
270
+ /**
271
+ * How to display connection error warnings.
272
+ * "banner" shows the full banner, "icon" shows only an icon, "hidden" suppresses entirely.
273
+ */
274
+ networkWarningStyle: "" | "icon" | "hidden";
275
+ /**
276
+ * The language to be used for display.
277
+ */
278
+ displayLanguage: I18N_LANGS;
279
+ }
280
+ /**
281
+ * Interface representing the settings for mode of exposing advanced things.
282
+ */
283
+ interface ModeSettings {
284
+ /**
285
+ * Indicates whether the advanced mode is enabled.
286
+ */
287
+ useAdvancedMode: boolean;
288
+ /**
289
+ * Indicates whether the power user mode is enabled.
290
+ */
291
+ usePowerUserMode: boolean;
292
+ /**
293
+ * Indicates whether the edge case mode is enabled.
294
+ */
295
+ useEdgeCaseMode: boolean;
296
+ }
297
+ /**
298
+ * Interface representing the settings for debug mode.
299
+ */
300
+ interface DebugModeSettings {
301
+ /**
302
+ * Indicates whether the debug tools of Self-hosted LiveSync are enabled.
303
+ */
304
+ enableDebugTools: boolean;
305
+ /**
306
+ * Indicates whether to write log to the file.
307
+ */
308
+ writeLogToTheFile: boolean;
309
+ }
310
+ /**
311
+ * Interface representing additional tweak settings.
312
+ */
313
+ interface ExtraTweakSettings {
314
+ /**
315
+ * The threshold value for notifying about the size of remote storage.
316
+ * When the size of the remote storage exceeds this threshold, a notification will be triggered.
317
+ */
318
+ notifyThresholdOfRemoteStorageSize: number;
319
+ }
320
+ /**
321
+ * Interface representing the settings for beta tweaks.
322
+ */
323
+ interface BetaTweakSettings {
324
+ /**
325
+ * Indicates whether to disable the WebWorker for generating chunks.
326
+ */
327
+ disableWorkerForGeneratingChunks: boolean;
328
+ /**
329
+ * Indicates whether to process small files in the UI thread.
330
+ */
331
+ processSmallFilesInUIThread: boolean;
332
+ }
333
+ /**
334
+ * Interface representing the settings for synchronising settings via file.
335
+ */
336
+ interface SettingSyncSettings {
337
+ /**
338
+ * The file path where the settings is stored.
339
+ */
340
+ settingSyncFile: string;
341
+ /**
342
+ * Indicates whether to write credentials for settings synchronising.
343
+ */
344
+ writeCredentialsForSettingSync: boolean;
345
+ /**
346
+ * Indicates whether to notify all settings synchronising files events.
347
+ */
348
+ notifyAllSettingSyncFile: boolean;
349
+ }
350
+ /**
351
+ * Represents settings that are considered obsolete and are not configurable from the UI.
352
+ */
353
+ interface ObsoleteSettings {
354
+ /**
355
+ * Saving delay (in milliseconds).
356
+ */
357
+ savingDelay: number;
358
+ /**
359
+ * Garbage collection delay (in milliseconds). Now, no longer GC is implemented.
360
+ */
361
+ gcDelay: number;
362
+ /**
363
+ * Skip older files on sync. No effect now.
364
+ */
365
+ skipOlderFilesOnSync: boolean;
366
+ /**
367
+ * Use the IndexedDB adapter. Now always true. Should be.
368
+ */
369
+ useIndexedDBAdapter: boolean;
370
+ }
371
+ /**
372
+ * Interface representing some data stored in the settings for the plugin.
373
+ */
374
+ interface DataOnSettings {
375
+ /**
376
+ * VersionUp flash message which is shown when some incompatible changes are made during the update.
377
+ */
378
+ versionUpFlash: string;
379
+ /**
380
+ * Setting file version, to migrate the settings.
381
+ */
382
+ settingVersion: number;
383
+ /**
384
+ * Indicates whether the setting of the plug-in is configured once.
385
+ */
386
+ isConfigured?: boolean;
387
+ /**
388
+ * The user-last-read version number.
389
+ */
390
+ lastReadUpdates: number;
391
+ /**
392
+ * The last checked version by the doctor.
393
+ */
394
+ doctorProcessedVersion: string;
395
+ }
396
+ /**
397
+ * Interface representing the settings for a safety valve mechanism.
398
+ */
399
+ interface SafetyValveSettings {
400
+ /**
401
+ * Indicates whether file watching should be suspended.
402
+ */
403
+ suspendFileWatching: boolean;
404
+ /**
405
+ * Indicates whether parsing and reflecting of replication results should be suspended.
406
+ */
407
+ suspendParseReplicationResult: boolean;
408
+ /**
409
+ * Indicates whether suspension should be avoided during fetching operations.
410
+ */
411
+ doNotSuspendOnFetching: boolean;
412
+ /**
413
+ * Maximum file modification time applied to reflected file events
414
+ */
415
+ maxMTimeForReflectEvents: number;
416
+ }
417
+ /**
418
+ * Represents the settings required to synchronise with a bucket.
419
+ */
420
+ export interface BucketSyncSetting {
421
+ /**
422
+ * The access key to use when connecting to the bucket.
423
+ */
424
+ accessKey: string;
425
+ /**
426
+ * The secret to use when connecting to the bucket.
427
+ */
428
+ secretKey: string;
429
+ /**
430
+ * The name of bucket to use.
431
+ */
432
+ bucket: string;
433
+ /**
434
+ * The region of the bucket.
435
+ */
436
+ region: string;
437
+ /**
438
+ * The endpoint of the bucket.
439
+ */
440
+ endpoint: string;
441
+ /**
442
+ * Indicates whether to use a custom request handler.
443
+ * (This is for CORS issue).
444
+ */
445
+ useCustomRequestHandler: boolean;
446
+ bucketCustomHeaders: string;
447
+ /**
448
+ * The prefix to use for the bucket (e.g., "my-bucket/", means mostly like a folder).
449
+ */
450
+ bucketPrefix: string;
451
+ /**
452
+ * Indicates whether to force path style access.
453
+ */
454
+ forcePathStyle: boolean;
455
+ }
456
+ export interface LocalDBSettings {
457
+ /**
458
+ * Indicates whether to use the IndexedDB adapter for the local database.
459
+ * @deprecated
460
+ */
461
+ useIndexedDBAdapter: boolean;
462
+ }
463
+ export type RemoteType = (typeof RemoteTypes)[keyof typeof RemoteTypes];
464
+ export declare enum AutoAccepting {
465
+ NONE = 0,
466
+ ALL = 1
467
+ }
468
+ export interface P2PConnectionInfo {
469
+ /**
470
+ * Indicates whether P2P connection is enabled.
471
+ */
472
+ P2P_Enabled: boolean;
473
+ /**
474
+ * Nostr relay server URL. (Comma separated list)
475
+ * This is only for the channelling server to establish for the P2P connection.
476
+ * No data is transferred through this server.
477
+ */
478
+ P2P_relays: string;
479
+ /**
480
+ * The room ID for `your devices`. This should be unique among the users.
481
+ * (Or, lines will be got mixed up).
482
+ */
483
+ P2P_roomID: string;
484
+ /**
485
+ * The passphrase for your devices.
486
+ * It can be empty, but it will help you if you have a duplicate Room ID.
487
+ */
488
+ P2P_passphrase: string;
489
+ /**
490
+ * The Application ID for the P2P connection.
491
+ * This is used to identify the application using the P2P network.
492
+ * In Self-hosted LiveSync, fixed to "self-hosted-livesync".
493
+ */
494
+ P2P_AppID: string;
495
+ /**
496
+ * Indicates whether to auto-start the P2P connection on launch.
497
+ */
498
+ P2P_AutoStart: boolean;
499
+ /**
500
+ * Indicates whether to automatically broadcast changes to connected peers.
501
+ */
502
+ P2P_AutoBroadcast: boolean;
503
+ /**
504
+ * The name of the device peer (This only for editing-setting purpose, not saved in the actual setting file, due to avoid setting-sync issues).
505
+ */
506
+ P2P_DevicePeerName?: string;
507
+ /**
508
+ * The TURN server URLs for the P2P connection. (Comma separated list)
509
+ */
510
+ P2P_turnServers: string;
511
+ /**
512
+ * The TURN username for the P2P connection.
513
+ */
514
+ P2P_turnUsername: string;
515
+ /**
516
+ * The TURN credential (password, secret, etc...) for the P2P connection.
517
+ */
518
+ P2P_turnCredential: string;
519
+ /**
520
+ * Use Diagnostic Wrapper for RTCPeerConnection to collect statistics.
521
+ */
522
+ P2P_useDiagRTC?: boolean;
523
+ }
524
+ export interface P2PSyncSetting extends P2PConnectionInfo {
525
+ P2P_AutoAccepting: AutoAccepting;
526
+ P2P_AutoSyncPeers: string;
527
+ P2P_AutoWatchPeers: string;
528
+ P2P_SyncOnReplication: string;
529
+ P2P_RebuildFrom: string;
530
+ P2P_AutoAcceptingPeers: string;
531
+ P2P_AutoDenyingPeers: string;
532
+ P2P_IsHeadless?: boolean;
533
+ }
534
+ /**
535
+ * Interface representing the settings for a remote type.
536
+ */
537
+ export interface RemoteTypeSettings {
538
+ /**
539
+ * The type of the remote.
540
+ */
541
+ remoteType: RemoteType;
542
+ }
543
+ export type E2EEAlgorithm = (typeof E2EEAlgorithms)[keyof typeof E2EEAlgorithms] | "";
544
+ /**
545
+ * Represents the settings used for End-to-End encryption.
546
+ */
547
+ export interface EncryptionSettings {
548
+ /**
549
+ * Indicates whether E2EE is enabled.
550
+ */
551
+ encrypt: boolean;
552
+ /**
553
+ * The passphrase used for E2EE.
554
+ */
555
+ passphrase: string;
556
+ /**
557
+ * Indicates whether path obfuscation is used.
558
+ * If not, the path will be stored as it is, as the document ID.
559
+ */
560
+ usePathObfuscation: boolean;
561
+ /**
562
+ * The algorithm used for hashing the passphrase.
563
+ * This is used for E2EE.
564
+ */
565
+ E2EEAlgorithm: E2EEAlgorithm;
566
+ }
567
+ export type HashAlgorithm = (typeof HashAlgorithms)[keyof typeof HashAlgorithms];
568
+ export type ChunkSplitterVersion = (typeof ChunkAlgorithms)[keyof typeof ChunkAlgorithms] | "";
569
+ /**
570
+ * Interface representing the settings for chunk processing.
571
+ */
572
+ interface ChunkSettings {
573
+ /**
574
+ * The algorithm used for hashing chunks.
575
+ */
576
+ hashAlg: HashAlgorithm;
577
+ /**
578
+ * The minimum size of a chunk in chars.
579
+ */
580
+ minimumChunkSize: number;
581
+ /**
582
+ * The custom size of a chunk.
583
+ * Note: This value used as a coefficient for the normal chunk size.
584
+ */
585
+ customChunkSize: number;
586
+ /**
587
+ * The threshold for considering a line as long.
588
+ * (Not respected in v0.24.x).
589
+ */
590
+ longLineThreshold: number;
591
+ /**
592
+ * Flag indicating whether to use a segmenter for chunking.
593
+ * @deprecated use chunkSplitterVersion instead.
594
+ */
595
+ useSegmenter: boolean;
596
+ /**
597
+ * Flag indicating whether to enable version 2 of the chunk splitter.
598
+ * @deprecated use chunkSplitterVersion instead.
599
+ */
600
+ enableChunkSplitterV2: boolean;
601
+ /**
602
+ * Flag indicating whether to avoid using a fixed revision for chunks.
603
+ */
604
+ doNotUseFixedRevisionForChunks: boolean;
605
+ /**
606
+ * The version of the chunk splitter to use.
607
+ */
608
+ chunkSplitterVersion: ChunkSplitterVersion;
609
+ }
610
+ /**
611
+ * Settings for on-demand chunk fetching.
612
+ */
613
+ interface OnDemandChunkSettings {
614
+ /**
615
+ * Indicates whether chunks should be fetch online. (means replication transfers only metadata).
616
+ */
617
+ readChunksOnline: boolean;
618
+ /**
619
+ * Indicates whether to use only local chunks without fetching online.
620
+ */
621
+ useOnlyLocalChunk: boolean;
622
+ /**
623
+ * The number of concurrent chunk reads allowed when fetching online.
624
+ */
625
+ concurrencyOfReadChunksOnline: number;
626
+ /**
627
+ * The minimum interval (in milliseconds) between consecutive online chunk fetching.
628
+ */
629
+ minimumIntervalOfReadChunksOnline: number;
630
+ }
631
+ /**
632
+ * Configuration settings for Eden.
633
+ */
634
+ interface EdenSettings {
635
+ /**
636
+ * Indicates whether Eden is enabled.
637
+ */
638
+ useEden: boolean;
639
+ /**
640
+ * The maximum number of chunks allowed in Eden.
641
+ */
642
+ maxChunksInEden: number;
643
+ /**
644
+ * The maximum total length allowed in Eden.
645
+ */
646
+ maxTotalLengthInEden: number;
647
+ /**
648
+ * The maximum age allowed in Eden.
649
+ */
650
+ maxAgeInEden: number;
651
+ }
652
+ /**
653
+ * Interface representing obsolete settings for an remote database.
654
+ */
655
+ interface ObsoleteRemoteDBSettings {
656
+ /**
657
+ * Indicates whether to check the integrity of the data on save.
658
+ */
659
+ checkIntegrityOnSave: boolean;
660
+ /**
661
+ * Indicates whether to use history tracking.
662
+ * (Now always true)
663
+ */
664
+ useHistory: boolean;
665
+ /**
666
+ * Indicates whether to disable using API of Obsidian.
667
+ * (Now always true: Note: Obsidian cannot handle multiple requests at the same time).
668
+ */
669
+ disableRequestURI: boolean;
670
+ /**
671
+ * Indicates whether to send data in bulk chunks.
672
+ */
673
+ sendChunksBulk: boolean;
674
+ /**
675
+ * The maximum size of the bulk chunks to be sent.
676
+ */
677
+ sendChunksBulkMaxSize: number;
678
+ /**
679
+ * Indicates whether to use a dynamic iteration count.
680
+ */
681
+ useDynamicIterationCount: boolean;
682
+ /**
683
+ * Indicates weather to pace the replication processing interval.
684
+ * Now (v0.24.x) not be respected.
685
+ */
686
+ doNotPaceReplication: boolean;
687
+ }
688
+ /**
689
+ * Interface representing the settings for beta tweaks for the remote database.
690
+ */
691
+ interface BetaRemoteDBSettings {
692
+ /**
693
+ * Indicates whether compression is enabled for the remote database.
694
+ */
695
+ enableCompression: boolean;
696
+ }
697
+ /**
698
+ * Interface representing the some data stored on the settings.
699
+ */
700
+ interface DataOnRemoteDBSettings {
701
+ /**
702
+ * VersionUp flash message which is shown when some incompatible changes are made during the update.
703
+ */
704
+ versionUpFlash: string;
705
+ /**
706
+ * Unix timestamp (ms) of the latest tweak update.
707
+ * Used to determine which side has newer tweak values.
708
+ */
709
+ tweakModified: number | undefined;
710
+ }
711
+ /**
712
+ * Interface representing the settings for replication.
713
+ */
714
+ interface ReplicationSetting {
715
+ /**
716
+ * The maximum number of documents to be processed in a batch.
717
+ */
718
+ batch_size: number;
719
+ /**
720
+ * The maximum number of batches to be processed.
721
+ */
722
+ batches_limit: number;
723
+ }
724
+ /**
725
+ * Interface representing the settings for targetting files.
726
+ */
727
+ interface FileHandlingSettings {
728
+ /**
729
+ * The regular expression for files to be synchronised.
730
+ */
731
+ syncOnlyRegEx: CustomRegExpSourceList<"|[]|">;
732
+ /**
733
+ * The regular expression for files to be ignored during synchronisation.
734
+ */
735
+ syncIgnoreRegEx: CustomRegExpSourceList<"|[]|">;
736
+ }
737
+ /**
738
+ * Interface representing the settings for processing behaviour.
739
+ */
740
+ interface ProcessingBehaviourSettings {
741
+ /**
742
+ * Hash cache maximum count.
743
+ */
744
+ hashCacheMaxCount: number;
745
+ /**
746
+ * Hash cache maximum amount.
747
+ */
748
+ hashCacheMaxAmount: number;
749
+ }
750
+ /**
751
+ * Interface representing the settings for remote database tweaks.
752
+ */
753
+ interface RemoteDBTweakSettings {
754
+ /**
755
+ * Indicates whether to ignore the version check.
756
+ */
757
+ ignoreVersionCheck: boolean;
758
+ /**
759
+ * Indicates whether to ignore and continue syncing even if the configuration-mismatch is detected.
760
+ * (Note: Mismatched settings can lead to inappropriate de-duplication, leading to storage wastage and increased traffic).
761
+ */
762
+ disableCheckingConfigMismatch: boolean;
763
+ /**
764
+ * Automatically accepts compatible-but-lossy tweak mismatches.
765
+ * If undefined, the feature is not configured yet.
766
+ */
767
+ autoAcceptCompatibleTweak: boolean | undefined;
768
+ }
769
+ /**
770
+ * Interface representing the settings for optional and not exposed remote database settings.
771
+ */
772
+ interface OptionalAndNotExposedRemoteDBSettings {
773
+ /**
774
+ * Indicates whether to accept empty passphrase.
775
+ * This not meant to `Not be encrypted`, but `Be encrypted with empty passphrase`.
776
+ */
777
+ permitEmptyPassphrase: boolean;
778
+ }
779
+ /**
780
+ * Interface representing the settings for cross-platform interoperability.
781
+ */
782
+ interface CrossPlatformInteroperabilitySettings {
783
+ /**
784
+ * Indicates whether to handle filename case sensitively.
785
+ */
786
+ handleFilenameCaseSensitive: boolean;
787
+ }
788
+ /**
789
+ * Interface representing the settings for conflict handling.
790
+ */
791
+ interface ConflictHandlingSettings {
792
+ /**
793
+ * Indicates whether to check conflicts only on file open.
794
+ */
795
+ checkConflictOnlyOnOpen: boolean;
796
+ /**
797
+ * Indicates whether to show the merge dialog only on active file.
798
+ */
799
+ showMergeDialogOnlyOnActive: boolean;
800
+ }
801
+ /**
802
+ * Settings that define the behavior of the merge process.
803
+ */
804
+ interface MergeBehaviourSettings {
805
+ /**
806
+ * Indicates whether to synchronise after merging.
807
+ */
808
+ syncAfterMerge: boolean;
809
+ /**
810
+ * Determines if conflicts should be resolved by choosing the newer file.
811
+ */
812
+ resolveConflictsByNewerFile: boolean;
813
+ /**
814
+ * Specifies whether to write documents even if there are conflicts.
815
+ */
816
+ writeDocumentsIfConflicted: boolean;
817
+ /**
818
+ * Disables automatic merging of markdown files.
819
+ */
820
+ disableMarkdownAutoMerge: boolean;
821
+ }
822
+ /**
823
+ * Configuration settings for handling edge cases in the application.
824
+ */
825
+ interface EdgeCaseHandlingSettings {
826
+ /**
827
+ * An optional suffix to append to the database name after the vault name.
828
+ */
829
+ additionalSuffixOfDatabaseName: string | undefined;
830
+ /**
831
+ * Flag to disable the worker thread for generating chunks.
832
+ */
833
+ disableWorkerForGeneratingChunks: boolean;
834
+ /**
835
+ * Flag to process small files in the UI thread instead of a worker thread.
836
+ */
837
+ processSmallFilesInUIThread: boolean;
838
+ /**
839
+ * Indicates whether to use timeout for PouchDB replication.
840
+ */
841
+ useTimeouts: boolean;
842
+ }
843
+ /**
844
+ * Configuration settings for handling deleted files.
845
+ */
846
+ interface DeletedFileMetadataSettings {
847
+ /**
848
+ * Indicates whether to delete metadata of deleted files.
849
+ */
850
+ deleteMetadataOfDeletedFiles: boolean;
851
+ /**
852
+ * The number of days to wait before automatically deleting metadata of deleted files.
853
+ */
854
+ automaticallyDeleteMetadataOfDeletedFiles: number;
855
+ }
856
+ /**
857
+ * Represents a single remote configuration.
858
+ */
859
+ export interface RemoteConfiguration {
860
+ /**
861
+ * Unique identifier for this configuration.
862
+ */
863
+ id: string;
864
+ /**
865
+ * Display name for the configuration.
866
+ */
867
+ name: string;
868
+ /**
869
+ * The connection string (URI) for the remote.
870
+ * This may be an encrypted string if configPassphraseStore is set.
871
+ */
872
+ uri: string;
873
+ /**
874
+ * Indicates whether this configuration is encrypted.
875
+ */
876
+ isEncrypted: boolean;
877
+ }
878
+ export interface RemoteConfigurations {
879
+ /**
880
+ * The list of remote configurations.
881
+ */
882
+ remoteConfigurations: Record<string, RemoteConfiguration>;
883
+ /**
884
+ * The ID of the currently active remote configuration.
885
+ */
886
+ activeConfigurationId: string;
887
+ /**
888
+ * The ID of the active remote configuration dedicated for P2P features.
889
+ * If empty, P2P features should request explicit selection from the user.
890
+ */
891
+ P2P_ActiveRemoteConfigurationId: string;
892
+ }
893
+ interface ObsidianLiveSyncSettings_PluginSetting extends SyncMethodSettings, UISettings, FileHandlingSettings, MergeBehaviourSettings, EncryptedUserSettings, PeriodicReplicationSettings, InternalFileSettings, PluginSyncSettings, ModeSettings, ExtraTweakSettings, BetaTweakSettings, ObsoleteSettings, DebugModeSettings, SettingSyncSettings, SafetyValveSettings, DataOnSettings, RemoteConfigurations {
894
+ }
895
+ export type RemoteDBSettings = CouchDBConnection & BucketSyncSetting & RemoteTypeSettings & EncryptionSettings & ChunkSettings & EdenSettings & DataOnRemoteDBSettings & ObsoleteRemoteDBSettings & OnDemandChunkSettings & BetaRemoteDBSettings & ReplicationSetting & RemoteDBTweakSettings & FileHandlingSettings & ProcessingBehaviourSettings & OptionalAndNotExposedRemoteDBSettings & CrossPlatformInteroperabilitySettings & ConflictHandlingSettings & EdgeCaseHandlingSettings & DeletedFileMetadataSettings & P2PSyncSetting & RemoteConfigurations;
896
+ export type ObsidianLiveSyncSettings = ObsidianLiveSyncSettings_PluginSetting & RemoteDBSettings & LocalDBSettings;
897
+ export interface HasSettings<T extends Partial<ObsidianLiveSyncSettings>> {
898
+ settings: T;
899
+ }
900
+ export {};