@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,434 @@
1
+ import { $t } from "./i18n.js";
2
+ import {
3
+ DEFAULT_SETTINGS,
4
+ configurationNames
5
+ } from "./types.js";
6
+ const OnDialogSettingsDefault = {
7
+ configPassphrase: "",
8
+ preset: "",
9
+ syncMode: "ONEVENTS",
10
+ dummy: 0,
11
+ deviceAndVaultName: ""
12
+ };
13
+ const AllSettingDefault = { ...DEFAULT_SETTINGS, ...OnDialogSettingsDefault };
14
+ const SettingInformation = {
15
+ liveSync: {
16
+ name: "Sync Mode"
17
+ },
18
+ couchDB_URI: {
19
+ name: "Server URI",
20
+ placeHolder: "https://........"
21
+ },
22
+ couchDB_USER: {
23
+ name: "Username",
24
+ desc: "username"
25
+ },
26
+ couchDB_PASSWORD: {
27
+ name: "Password",
28
+ desc: "password",
29
+ isHidden: true
30
+ },
31
+ couchDB_DBNAME: {
32
+ name: "Database Name"
33
+ },
34
+ passphrase: {
35
+ name: "Passphrase",
36
+ desc: "Encryption passphrase. If changed, you should overwrite the server's database with the new (encrypted) files.",
37
+ isHidden: true
38
+ },
39
+ showStatusOnEditor: {
40
+ name: "Show status inside the editor",
41
+ desc: "Requires restart of Obsidian."
42
+ },
43
+ showOnlyIconsOnEditor: {
44
+ name: "Show status as icons only"
45
+ },
46
+ showStatusOnStatusbar: {
47
+ name: "Show status on the status bar",
48
+ desc: "Requires restart of Obsidian."
49
+ },
50
+ lessInformationInLog: {
51
+ name: "Show only notifications",
52
+ desc: "Disables logging, only shows notifications. Please disable if you report an issue."
53
+ },
54
+ showVerboseLog: {
55
+ name: "Verbose Log",
56
+ desc: "Show verbose log. Please enable if you report an issue."
57
+ },
58
+ hashCacheMaxCount: {
59
+ name: "Memory cache size (by total items)"
60
+ },
61
+ hashCacheMaxAmount: {
62
+ name: "Memory cache size (by total characters)",
63
+ desc: "(Mega chars)"
64
+ },
65
+ writeCredentialsForSettingSync: {
66
+ name: "Write credentials in the file",
67
+ desc: "(Not recommended) If set, credentials will be stored in the file."
68
+ },
69
+ notifyAllSettingSyncFile: {
70
+ name: "Notify all setting files"
71
+ },
72
+ configPassphrase: {
73
+ name: "Passphrase of sensitive configuration items",
74
+ desc: "This passphrase will not be copied to another device. It will be set to `Default` until you configure it again."
75
+ },
76
+ configPassphraseStore: {
77
+ name: "Encrypting sensitive configuration items"
78
+ },
79
+ syncOnSave: {
80
+ name: "Sync on Save",
81
+ desc: "Starts synchronisation when a file is saved."
82
+ },
83
+ syncOnEditorSave: {
84
+ name: "Sync on Editor Save",
85
+ desc: "When you save a file in the editor, start a sync automatically"
86
+ },
87
+ keepReplicationActiveInBackground: {
88
+ name: "Keep replication active in the background",
89
+ desc: "Desktop only; uses more battery and network."
90
+ },
91
+ syncOnFileOpen: {
92
+ name: "Sync on File Open",
93
+ desc: "Forces the file to be synced when opened."
94
+ },
95
+ syncOnStart: {
96
+ name: "Sync on Startup",
97
+ desc: "Automatically Sync all files when opening Obsidian."
98
+ },
99
+ syncAfterMerge: {
100
+ name: "Sync after merging file",
101
+ desc: "Sync automatically after merging files"
102
+ },
103
+ trashInsteadDelete: {
104
+ name: "Use the trash bin",
105
+ desc: "Move remotely deleted files to the trash, instead of deleting. (This setting is ineffective from Obsidian v1.7.2 onwards, as deletion always respects your Obsidian preferences.)"
106
+ },
107
+ doNotDeleteFolder: {
108
+ name: "Keep empty folder",
109
+ desc: "Should we keep folders that don't have any files inside?"
110
+ },
111
+ resolveConflictsByNewerFile: {
112
+ name: "(BETA) Always overwrite with a newer file",
113
+ desc: "Testing only - Resolve file conflicts by syncing newer copies of the file, this can overwrite modified files. Be Warned."
114
+ },
115
+ checkConflictOnlyOnOpen: {
116
+ name: "Delay conflict resolution of inactive files",
117
+ desc: "Should we only check for conflicts when a file is opened?"
118
+ },
119
+ showMergeDialogOnlyOnActive: {
120
+ name: "Delay merge conflict prompt for inactive files.",
121
+ desc: "Should we prompt you about conflicting files when a file is opened?"
122
+ },
123
+ disableMarkdownAutoMerge: {
124
+ name: "Always prompt merge conflicts",
125
+ desc: "Should we prompt you for every single merge, even if we can safely merge automatcially?"
126
+ },
127
+ writeDocumentsIfConflicted: {
128
+ name: "Apply Latest Change if Conflicting",
129
+ desc: "Enable this option to automatically apply the most recent change to documents even when it conflicts"
130
+ },
131
+ syncInternalFilesInterval: {
132
+ name: "Scan hidden files periodically",
133
+ desc: "Seconds, 0 to disable"
134
+ },
135
+ batchSave: {
136
+ name: "Batch database update",
137
+ desc: "Reducing the frequency with which on-disk changes are reflected into the DB"
138
+ },
139
+ readChunksOnline: {
140
+ name: "Fetch chunks on demand",
141
+ desc: "(ex. Read chunks online) If this option is enabled, LiveSync reads chunks online directly instead of replicating them locally. Increasing Custom chunk size is recommended."
142
+ },
143
+ syncMaxSizeInMB: {
144
+ name: "Maximum file size",
145
+ desc: "(MB) If this is set, changes to local and remote files that are larger than this will be skipped. If the file becomes smaller again, a newer one will be used."
146
+ },
147
+ useIgnoreFiles: {
148
+ name: "(Beta) Use ignore files",
149
+ desc: "If this is set, changes to local files which are matched by the ignore files will be skipped. Remote changes are determined using local ignore files."
150
+ },
151
+ ignoreFiles: {
152
+ name: "Ignore files",
153
+ desc: "Comma separated `.gitignore, .dockerignore`"
154
+ },
155
+ batch_size: {
156
+ name: "Batch size",
157
+ desc: "Number of changes to sync at a time. Defaults to 50. Minimum is 2."
158
+ },
159
+ batches_limit: {
160
+ name: "Batch limit",
161
+ desc: "Number of batches to process at a time. Defaults to 40. Minimum is 2. This along with batch size controls how many docs are kept in memory at a time."
162
+ },
163
+ useTimeouts: {
164
+ name: "Use timeouts instead of heartbeats",
165
+ desc: "If this option is enabled, PouchDB will hold the connection open for 60 seconds, and if no change arrives in that time, close and reopen the socket, instead of holding it open indefinitely. Useful when a proxy limits request duration but can increase resource usage."
166
+ },
167
+ concurrencyOfReadChunksOnline: {
168
+ name: "Batch size of on-demand fetching"
169
+ },
170
+ minimumIntervalOfReadChunksOnline: {
171
+ name: "The delay for consecutive on-demand fetches"
172
+ },
173
+ suspendFileWatching: {
174
+ name: "Suspend file watching",
175
+ desc: "Stop watching for file changes."
176
+ },
177
+ suspendParseReplicationResult: {
178
+ name: "Suspend database reflecting",
179
+ desc: "Stop reflecting database changes to storage files."
180
+ },
181
+ writeLogToTheFile: {
182
+ name: "Write logs into the file",
183
+ desc: "Warning! This will have a serious impact on performance. And the logs will not be synchronised under the default name. Please be careful with logs; they often contain your confidential information."
184
+ },
185
+ deleteMetadataOfDeletedFiles: {
186
+ name: "Do not keep metadata of deleted files."
187
+ },
188
+ useIndexedDBAdapter: {
189
+ name: "(Obsolete) Use an old adapter for compatibility",
190
+ desc: "Before v0.17.16, we used an old adapter for the local database. Now the new adapter is preferred. However, it needs local database rebuilding. Please disable this toggle when you have enough time. If leave it enabled, also while fetching from the remote database, you will be asked to disable this.",
191
+ obsolete: true
192
+ },
193
+ watchInternalFileChanges: {
194
+ name: "Scan changes on customization sync",
195
+ desc: "Do not use internal API"
196
+ },
197
+ doNotSuspendOnFetching: {
198
+ name: "Fetch database with previous behaviour"
199
+ },
200
+ disableCheckingConfigMismatch: {
201
+ name: "Do not check configuration mismatch before replication"
202
+ },
203
+ usePluginSync: {
204
+ name: "Enable customization sync"
205
+ },
206
+ autoSweepPlugins: {
207
+ name: "Scan customization automatically",
208
+ desc: "Scan customization before replicating."
209
+ },
210
+ autoSweepPluginsPeriodic: {
211
+ name: "Scan customization periodically",
212
+ desc: "Scan customization every 1 minute."
213
+ },
214
+ notifyPluginOrSettingUpdated: {
215
+ name: "Notify customized",
216
+ desc: "Notify when other device has newly customized."
217
+ },
218
+ remoteType: {
219
+ name: "Active Remote Type",
220
+ desc: "Remote server type"
221
+ },
222
+ endpoint: {
223
+ name: "Endpoint URL",
224
+ placeHolder: "https://........"
225
+ },
226
+ accessKey: {
227
+ name: "Access Key"
228
+ },
229
+ secretKey: {
230
+ name: "Secret Key",
231
+ isHidden: true
232
+ },
233
+ region: {
234
+ name: "Region",
235
+ placeHolder: "auto"
236
+ },
237
+ bucket: {
238
+ name: "Bucket Name"
239
+ },
240
+ useCustomRequestHandler: {
241
+ name: "Use Custom HTTP Handler",
242
+ desc: "Enable this if your Object Storage doesn't support CORS"
243
+ },
244
+ maxChunksInEden: {
245
+ name: "Maximum Incubating Chunks",
246
+ desc: "The maximum number of chunks that can be incubated within the document. Chunks exceeding this number will immediately graduate to independent chunks."
247
+ },
248
+ maxTotalLengthInEden: {
249
+ name: "Maximum Incubating Chunk Size",
250
+ desc: "The maximum total size of chunks that can be incubated within the document. Chunks exceeding this size will immediately graduate to independent chunks."
251
+ },
252
+ maxAgeInEden: {
253
+ name: "Maximum Incubation Period",
254
+ desc: "The maximum duration for which chunks can be incubated within the document. Chunks exceeding this period will graduate to independent chunks."
255
+ },
256
+ settingSyncFile: {
257
+ name: "Filename",
258
+ desc: "Save settings to a markdown file. You will be notified when new settings arrive. You can set different files by the platform."
259
+ },
260
+ preset: {
261
+ name: "Presets",
262
+ desc: "Apply preset configuration"
263
+ },
264
+ syncMode: {
265
+ name: "Sync Mode"
266
+ },
267
+ periodicReplicationInterval: {
268
+ name: "Periodic Sync interval",
269
+ desc: "Interval (sec)"
270
+ },
271
+ syncInternalFilesBeforeReplication: {
272
+ name: "Scan for hidden files before replication"
273
+ },
274
+ automaticallyDeleteMetadataOfDeletedFiles: {
275
+ name: "Delete old metadata of deleted files on start-up",
276
+ desc: "(Days passed, 0 to disable automatic-deletion)"
277
+ },
278
+ additionalSuffixOfDatabaseName: {
279
+ name: "Database suffix",
280
+ desc: "LiveSync could not handle multiple vaults which have same name without different prefix, This should be automatically configured."
281
+ },
282
+ hashAlg: {
283
+ name: configurationNames["hashAlg"]?.name || "",
284
+ desc: "xxhash64 is the current default."
285
+ },
286
+ deviceAndVaultName: {
287
+ name: "Device name",
288
+ desc: "Unique name between all synchronized devices. To edit this setting, please disable customization sync once."
289
+ },
290
+ displayLanguage: {
291
+ name: "Display Language",
292
+ desc: 'Not all messages have been translated. And, please revert to "Default" when reporting errors.'
293
+ },
294
+ enableChunkSplitterV2: {
295
+ name: "Use splitting-limit-capped chunk splitter",
296
+ desc: "If enabled, chunks will be split into no more than 100 items. However, dedupe is slightly weaker."
297
+ },
298
+ disableWorkerForGeneratingChunks: {
299
+ name: "Do not split chunks in the background",
300
+ desc: "If disabled(toggled), chunks will be split on the UI thread (Previous behaviour)."
301
+ },
302
+ processSmallFilesInUIThread: {
303
+ name: "Process small files in the foreground",
304
+ desc: "If enabled, the file under 1kb will be processed in the UI thread."
305
+ },
306
+ batchSaveMinimumDelay: {
307
+ name: "Minimum delay for batch database updating",
308
+ desc: "Seconds. Saving to the local database will be delayed until this value after we stop typing or saving."
309
+ },
310
+ batchSaveMaximumDelay: {
311
+ name: "Maximum delay for batch database updating",
312
+ desc: "Saving will be performed forcefully after this number of seconds."
313
+ },
314
+ notifyThresholdOfRemoteStorageSize: {
315
+ name: "Notify when the estimated remote storage size exceeds on start up",
316
+ desc: "MB (0 to disable)."
317
+ },
318
+ usePluginSyncV2: {
319
+ name: "Enable per-file customization sync",
320
+ desc: "If enabled, efficient per-file customization sync will be used. A minor migration is required when enabling this feature, and all devices must be updated to v0.23.18. Enabling this feature will result in losing compatibility with older versions."
321
+ },
322
+ handleFilenameCaseSensitive: {
323
+ name: "Handle files as Case-Sensitive",
324
+ desc: "If this enabled, All files are handled as case-Sensitive (Previous behaviour)."
325
+ },
326
+ doNotUseFixedRevisionForChunks: {
327
+ name: "Compute revisions for chunks",
328
+ desc: "If this enabled, all chunks will be stored with the revision made from its content."
329
+ },
330
+ sendChunksBulkMaxSize: {
331
+ name: "Maximum size of chunks to send in one request",
332
+ desc: "MB"
333
+ },
334
+ useAdvancedMode: {
335
+ name: "Enable advanced features"
336
+ // desc: "Enable advanced mode"
337
+ },
338
+ usePowerUserMode: {
339
+ name: "Enable poweruser features"
340
+ // desc: "Enable power user mode",
341
+ // level: LEVEL_ADVANCED
342
+ },
343
+ useEdgeCaseMode: {
344
+ name: "Enable edge case treatment features"
345
+ },
346
+ enableDebugTools: {
347
+ name: "Enable Developers' Debug Tools (If available).",
348
+ desc: "While enabled, it causes very performance impact but debugging replication testing and other features will be enabled. Please disable this if you have not read the source code. Requires restart of Obsidian. Sometimes there is no implementation."
349
+ },
350
+ suppressNotifyHiddenFilesChange: {
351
+ name: "Suppress notification of hidden files change",
352
+ desc: "If enabled, the notification of hidden files change will be suppressed."
353
+ },
354
+ syncMinimumInterval: {
355
+ name: "Minimum interval for syncing",
356
+ desc: "The minimum interval for automatic synchronisation on event."
357
+ },
358
+ useRequestAPI: {
359
+ name: "Use Request API to avoid `inevitable` CORS problem",
360
+ desc: "If enabled, the request API will be used to avoid `inevitable` CORS problems. This is a workaround and may not work in all cases. PLEASE READ THE DOCUMENTATION BEFORE USING THIS OPTION. This is a less-secure option."
361
+ },
362
+ hideFileWarningNotice: {
363
+ name: "Show status icon instead of file warnings banner",
364
+ desc: "If enabled, the \u26D4 icon will be shown inside the status instead of the file warnings banner. No details will be shown."
365
+ },
366
+ networkWarningStyle: {
367
+ name: "Network warning style",
368
+ desc: "How to display network errors when the sync server is unreachable."
369
+ },
370
+ bucketPrefix: {
371
+ name: "File prefix on the bucket",
372
+ desc: "Effectively a directory. Should end with `/`. e.g., `vault-name/`."
373
+ },
374
+ chunkSplitterVersion: {
375
+ name: "Chunk Splitter",
376
+ desc: "Now we can choose how to split the chunks; V3 is the most efficient. If you have troubled, please make this Default or Legacy."
377
+ },
378
+ processSizeMismatchedFiles: {
379
+ name: "Process files even if seems to be corrupted",
380
+ desc: "You can enable this setting to process the files with size mismatches, these files can be created by some APIs or integrations."
381
+ },
382
+ forcePathStyle: {
383
+ name: "Enable forcePathStyle",
384
+ desc: "If enabled, the forcePathStyle option will be used for bucket operations."
385
+ },
386
+ P2P_AutoBroadcast: {
387
+ name: "Automatically broadcast changes to connected peers",
388
+ desc: "If enabled, changes will be automatically broadcasted to all connected peers. Notified peers will start fetching the changes."
389
+ },
390
+ P2P_AutoStart: {
391
+ name: "Automatically start P2P connection on launch",
392
+ desc: "If enabled, the P2P connection will be automatically started when the application launches."
393
+ },
394
+ P2P_Enabled: {
395
+ name: "Enable P2P Synchronization"
396
+ },
397
+ maxMTimeForReflectEvents: {
398
+ name: "Maximum file modification time for reflected file events",
399
+ desc: "Files with modification times greater than this value (in seconds since the Unix epoch) will not have their events reflected. Set to 0 to disable this limit."
400
+ }
401
+ };
402
+ function translateInfo(infoSrc, translate = (message) => $t(message)) {
403
+ if (!infoSrc) return false;
404
+ const info = { ...infoSrc };
405
+ info.name = translate(info.name);
406
+ if (info.desc) {
407
+ info.desc = translate(info.desc);
408
+ }
409
+ return info;
410
+ }
411
+ function _getConfig(key) {
412
+ if (key in configurationNames) {
413
+ return configurationNames[key];
414
+ }
415
+ if (key in SettingInformation) {
416
+ return SettingInformation[key];
417
+ }
418
+ return false;
419
+ }
420
+ function getConfig(key, translate) {
421
+ return translateInfo(_getConfig(key), translate);
422
+ }
423
+ function getConfName(key, translate) {
424
+ const conf = getConfig(key, translate);
425
+ if (!conf) return `${key} (No info)`;
426
+ return conf.name;
427
+ }
428
+ export {
429
+ AllSettingDefault,
430
+ OnDialogSettingsDefault,
431
+ SettingInformation,
432
+ getConfName,
433
+ getConfig
434
+ };
@@ -0,0 +1,17 @@
1
+ import type { DocumentID, FilePath, FilePathWithPrefix } from "./models/db.type.js";
2
+ import type { UXFileInfoStub } from "./types.js";
3
+ /**
4
+ * returns is internal chunk of file
5
+ * @param id ID
6
+ * @returns
7
+ */
8
+ export declare function isInternalMetadata(id: FilePath | FilePathWithPrefix | DocumentID): boolean;
9
+ export declare function isInternalFile(file: UXFileInfoStub | string | FilePathWithPrefix): boolean;
10
+ export declare function stripInternalMetadataPrefix<T extends FilePath | FilePathWithPrefix | DocumentID>(id: T): T;
11
+ export declare function id2InternalMetadataId(id: DocumentID): DocumentID;
12
+ export declare function isChunk(str: string): boolean;
13
+ export declare function isPluginMetadata(str: string): boolean;
14
+ export declare function isCustomisationSyncMetadata(str: string): boolean;
15
+ export declare function getPathFromUXFileInfo(file: UXFileInfoStub | string | FilePathWithPrefix): FilePathWithPrefix;
16
+ export declare function getStoragePathFromUXFileInfo(file: UXFileInfoStub | string | FilePathWithPrefix): FilePath;
17
+ export declare function getDatabasePathFromUXFileInfo(file: UXFileInfoStub | string | FilePathWithPrefix): FilePathWithPrefix;
@@ -0,0 +1,51 @@
1
+ import { stripAllPrefixes } from "../string_and_binary/path.js";
2
+ import { CHeader, ICHeader, ICHeaderLength, ICXHeader, PSCHeader } from "./models/fileaccess.const.js";
3
+ function isInternalMetadata(id) {
4
+ return id.startsWith(ICHeader);
5
+ }
6
+ function isInternalFile(file) {
7
+ if (typeof file == "string") return isInternalMetadata(file);
8
+ if (file.isInternal) return true;
9
+ return false;
10
+ }
11
+ function stripInternalMetadataPrefix(id) {
12
+ return id.substring(ICHeaderLength);
13
+ }
14
+ function id2InternalMetadataId(id) {
15
+ return ICHeader + id;
16
+ }
17
+ function isChunk(str) {
18
+ return str.startsWith(CHeader);
19
+ }
20
+ function isPluginMetadata(str) {
21
+ return str.startsWith(PSCHeader);
22
+ }
23
+ function isCustomisationSyncMetadata(str) {
24
+ return str.startsWith(ICXHeader);
25
+ }
26
+ function getPathFromUXFileInfo(file) {
27
+ if (typeof file == "string") return file;
28
+ return file.path;
29
+ }
30
+ function getStoragePathFromUXFileInfo(file) {
31
+ if (typeof file == "string") return stripAllPrefixes(file);
32
+ return stripAllPrefixes(file.path);
33
+ }
34
+ function getDatabasePathFromUXFileInfo(file) {
35
+ if (typeof file == "string" && file.startsWith(ICXHeader)) return file;
36
+ const prefix = isInternalFile(file) ? ICHeader : "";
37
+ if (typeof file == "string") return prefix + stripAllPrefixes(file);
38
+ return prefix + stripAllPrefixes(file.path);
39
+ }
40
+ export {
41
+ getDatabasePathFromUXFileInfo,
42
+ getPathFromUXFileInfo,
43
+ getStoragePathFromUXFileInfo,
44
+ id2InternalMetadataId,
45
+ isChunk,
46
+ isCustomisationSyncMetadata,
47
+ isInternalFile,
48
+ isInternalMetadata,
49
+ isPluginMetadata,
50
+ stripInternalMetadataPrefix
51
+ };
@@ -0,0 +1,107 @@
1
+ export type { TaggedType } from "./models/shared.type.util.js";
2
+ export { LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_NOTICE, LOG_LEVEL_URGENT, LOG_LEVEL_VERBOSE, } from "octagonal-wheels/common/logger";
3
+ export type { LOG_LEVEL } from "octagonal-wheels/common/logger";
4
+ import { RESULT_NOT_FOUND, RESULT_TIMED_OUT } from "octagonal-wheels/common/const";
5
+ import type { Credential } from "./models/auth.type.js";
6
+ import type { AnyEntry, ChunkVersionRange, DatabaseEntry, EdenChunk, EntryBase, EntryChunkPack, EntryHasPath, EntryLeaf, EntryType, EntryTypeNotes, EntryTypeNotesWithLegacy, EntryVersionInfo, EntryWithEden, InternalFileEntry, LoadedEntry, MetaEntry, NewEntry, NoteEntry, PlainEntry, SavingEntry, SyncInfo } from "./models/db.type.js";
7
+ import { ChunkTypes, EntryTypes, MILESTONE_DOCID, NODEINFO_DOCID, NoteTypes, SYNCINFO_ID, VERSIONING_DOCID } from "./models/db.const.js";
8
+ import { AUTO_MERGED, CANCELLED, LEAVE_TO_SUBSEQUENT, MISSING_OR_ERROR, NOT_CONFLICTED, TIME_ARGUMENT_INFINITY } from "./models/shared.const.symbols.js";
9
+ import { IDPrefixes, LEAF_WAIT_ONLY_REMOTE, LEAF_WAIT_TIMEOUT, LEAF_WAIT_TIMEOUT_SEQUENTIAL_REPLICATOR, MAX_DOC_SIZE, MAX_DOC_SIZE_BIN, PREFIX_CHUNK, PREFIX_ENCRYPTED_CHUNK, PREFIX_OBFUSCATED, RECENT_MODIFIED_DOCS_QTY, REPLICATION_BUSY_TIMEOUT, SALT_OF_ID, SALT_OF_PASSPHRASE, SEED_MURMURHASH, VER } from "./models/shared.const.behabiour.js";
10
+ import { AutoAccepting, type BucketSyncSetting, type ChunkSplitterVersion, type ConfigPassphraseStore, type CouchDBConnection, type E2EEAlgorithm, type EncryptionSettings, type HashAlgorithm, type HasSettings, type LocalDBSettings, type ObsidianLiveSyncSettings, type P2PConnectionInfo, type P2PSyncSetting, type PluginSyncSettingEntry, type RemoteDBSettings, type RemoteType, type RemoteTypeSettings, type SYNC_MODE } from "./models/setting.type.js";
11
+ import { ChunkAlgorithmNames, ChunkAlgorithms, CURRENT_SETTING_VERSION, E2EEAlgorithmNames, E2EEAlgorithms, HashAlgorithms, REMOTE_COUCHDB, REMOTE_MINIO, REMOTE_P2P, RemoteTypes, SETTING_VERSION_INITIAL, SETTING_VERSION_SUPPORT_CASE_INSENSITIVE, MODE_AUTOMATIC, MODE_PAUSED, MODE_SELECTIVE, MODE_SHINY } from "./models/setting.const.js";
12
+ import { PREFERRED_BASE, PREFERRED_JOURNAL_SYNC, PREFERRED_SETTING_CLOUDANT, PREFERRED_SETTING_SELF_HOSTED } from "./models/setting.const.preferred.js";
13
+ import { P2P_DEFAULT_SETTINGS, DEFAULT_SETTINGS } from "./models/setting.const.defaults.js";
14
+ import { KeyIndexOfSettings } from "./models/setting.const.qr.js";
15
+ import type { DeviceInfo, EntryBody, EntryDoc, EntryDocResponse, EntryMilestoneInfo, EntryNodeInfo, NodeData, NodeKey } from "./models/db.definition.js";
16
+ import { isMetaEntry } from "./models/db.definition.js";
17
+ import type { CouchDBCredentials, BasicCredentials, JWTCredentials, JWTHeader, JWTPayload, JWTParams, PreparedJWT } from "./models/auth.type.js";
18
+ import type { CacheData, FileEventArgs, FileEventItem, FileEventType, UXAbstractInfoStub, UXDataWriteOptions, UXFileInfo, UXFileInfoStub, UXFolderInfo, UXInternalFileInfoStub, UXStat } from "./models/fileaccess.type.js";
19
+ import { SETTING_KEY_P2P_DEVICE_NAME, configURIBase, configURIBaseQR, SuffixDatabaseName, ExtraSuffixIndexedDB } from "./models/shared.const.js";
20
+ import { configurationNames, LEVEL_ADVANCED, LEVEL_POWER_USER, LEVEL_EDGE_CASE, type ConfigLevel, type ConfigurationItem, statusDisplay, confName, confDesc } from "./models/shared.definition.configNames.js";
21
+ import type { CustomRegExpSource, CustomRegExpSourceList, ParsedCustomRegExp, Prettify } from "./models/shared.type.util.js";
22
+ import { ProtocolVersions, type ProtocolVersion, DOCID_SYNC_PARAMETERS, DOCID_JOURNAL_SYNC_PARAMETERS, type SyncParameters, DEFAULT_SYNC_PARAMETERS } from "./models/sync.definition.js";
23
+ import { TweakValuesShouldMatchedTemplate, IncompatibleChanges, CompatibleButLossyChanges, IncompatibleChangesInSpecificPattern, TweakValuesRecommendedTemplate, TweakValuesDefault, TweakValuesTemplate, type TweakValues, DEVICE_ID_PREFERRED } from "./models/tweak.definition.js";
24
+ import type { diff_result_leaf, dmp_result, diff_result, DIFF_CHECK_RESULT_AUTO, diff_check_result } from "./models/diff.definition.js";
25
+ import { PREFIXMD_LOGFILE, PREFIXMD_LOGFILE_UC, FlagFilesOriginal, FlagFilesHumanReadable, FLAGMD_REDFLAG, FLAGMD_REDFLAG2, FLAGMD_REDFLAG2_HR, FLAGMD_REDFLAG3, FLAGMD_REDFLAG3_HR } from "./models/redflag.const.js";
26
+ import { DatabaseConnectingStatuses, type DatabaseConnectingStatus } from "./models/shared.definition.js";
27
+ export { RESULT_NOT_FOUND, RESULT_TIMED_OUT };
28
+ export type { FilePath, FilePathWithPrefixLC, FilePathWithPrefix, DocumentID } from "./models/db.type.js";
29
+ export { MAX_DOC_SIZE, MAX_DOC_SIZE_BIN, VER, RECENT_MODIFIED_DOCS_QTY, LEAF_WAIT_TIMEOUT, LEAF_WAIT_ONLY_REMOTE, LEAF_WAIT_TIMEOUT_SEQUENTIAL_REPLICATOR, REPLICATION_BUSY_TIMEOUT, CANCELLED, AUTO_MERGED, NOT_CONFLICTED, MISSING_OR_ERROR, LEAVE_TO_SUBSEQUENT, TIME_ARGUMENT_INFINITY, VERSIONING_DOCID, MILESTONE_DOCID, NODEINFO_DOCID, };
30
+ export { type CouchDBConnection };
31
+ export type { ConfigPassphraseStore };
32
+ export { MODE_SELECTIVE, MODE_AUTOMATIC, MODE_PAUSED, MODE_SHINY, type SYNC_MODE };
33
+ export { type PluginSyncSettingEntry };
34
+ export { SETTING_VERSION_INITIAL, SETTING_VERSION_SUPPORT_CASE_INSENSITIVE, CURRENT_SETTING_VERSION };
35
+ export type { BucketSyncSetting, LocalDBSettings };
36
+ export { RemoteTypes, REMOTE_COUCHDB, REMOTE_MINIO, REMOTE_P2P, type RemoteType, AutoAccepting };
37
+ export type { P2PConnectionInfo, P2PSyncSetting };
38
+ export { P2P_DEFAULT_SETTINGS };
39
+ export type { RemoteTypeSettings };
40
+ export { E2EEAlgorithmNames, E2EEAlgorithms, type E2EEAlgorithm };
41
+ export type { EncryptionSettings };
42
+ export { HashAlgorithms, type HashAlgorithm, ChunkAlgorithmNames, ChunkAlgorithms, type ChunkSplitterVersion };
43
+ export type { RemoteDBSettings };
44
+ export type { ObsidianLiveSyncSettings };
45
+ export { DEFAULT_SETTINGS };
46
+ export { KeyIndexOfSettings };
47
+ export { type HasSettings };
48
+ export { PREFERRED_BASE, PREFERRED_SETTING_CLOUDANT, PREFERRED_SETTING_SELF_HOSTED, PREFERRED_JOURNAL_SYNC };
49
+ export { EntryTypes, NoteTypes, ChunkTypes, type EntryType, type EntryTypeNotes, type EntryTypeNotesWithLegacy, type DatabaseEntry, type EntryBase, type EdenChunk, type EntryWithEden, type NoteEntry, type NewEntry, type PlainEntry, type InternalFileEntry, type AnyEntry, type LoadedEntry, type SavingEntry, type MetaEntry, isMetaEntry, type EntryLeaf, type EntryChunkPack, type EntryVersionInfo, type EntryHasPath, };
50
+ export type { ChunkVersionRange };
51
+ export { TweakValuesShouldMatchedTemplate };
52
+ export { IncompatibleChanges };
53
+ export { CompatibleButLossyChanges };
54
+ export { IncompatibleChangesInSpecificPattern };
55
+ export { TweakValuesRecommendedTemplate };
56
+ export { TweakValuesDefault };
57
+ export { configurationNames };
58
+ export { LEVEL_ADVANCED };
59
+ export { LEVEL_POWER_USER };
60
+ export { LEVEL_EDGE_CASE };
61
+ export type { ConfigLevel };
62
+ export type { ConfigurationItem };
63
+ export { statusDisplay };
64
+ export { confName };
65
+ export { confDesc };
66
+ export { TweakValuesTemplate };
67
+ export type { TweakValues };
68
+ export { DEVICE_ID_PREFERRED };
69
+ export type { NodeKey };
70
+ export type { DeviceInfo };
71
+ export type { NodeData };
72
+ export type { EntryMilestoneInfo };
73
+ export type { EntryNodeInfo };
74
+ export type { EntryBody };
75
+ export type { EntryDoc };
76
+ export type { diff_result_leaf };
77
+ export type { dmp_result };
78
+ export type { diff_result };
79
+ export type { DIFF_CHECK_RESULT_AUTO };
80
+ export type { diff_check_result };
81
+ export type { Credential };
82
+ export type { EntryDocResponse };
83
+ export { DatabaseConnectingStatuses };
84
+ export type { DatabaseConnectingStatus };
85
+ export { PREFIXMD_LOGFILE, PREFIXMD_LOGFILE_UC, FlagFilesOriginal, FlagFilesHumanReadable, FLAGMD_REDFLAG, FLAGMD_REDFLAG2, FLAGMD_REDFLAG2_HR, FLAGMD_REDFLAG3, FLAGMD_REDFLAG3_HR, };
86
+ export { SYNCINFO_ID };
87
+ export type { SyncInfo };
88
+ export { SALT_OF_PASSPHRASE, SALT_OF_ID, SEED_MURMURHASH, IDPrefixes, PREFIX_OBFUSCATED, PREFIX_CHUNK, PREFIX_ENCRYPTED_CHUNK, };
89
+ export type { UXStat, UXFileInfo, UXAbstractInfoStub, UXFileInfoStub, UXInternalFileInfoStub, UXFolderInfo, UXDataWriteOptions, CacheData, FileEventType, FileEventArgs, FileEventItem, };
90
+ export type { Prettify };
91
+ export type { CouchDBCredentials };
92
+ export type { BasicCredentials };
93
+ export type { JWTCredentials };
94
+ export type { JWTHeader };
95
+ export type { JWTPayload };
96
+ export type { JWTParams };
97
+ export type { PreparedJWT };
98
+ export type { CustomRegExpSource };
99
+ export type { CustomRegExpSourceList };
100
+ export type { ParsedCustomRegExp };
101
+ export { ProtocolVersions };
102
+ export type { ProtocolVersion };
103
+ export { DOCID_SYNC_PARAMETERS };
104
+ export { DOCID_JOURNAL_SYNC_PARAMETERS };
105
+ export type { SyncParameters };
106
+ export { DEFAULT_SYNC_PARAMETERS };
107
+ export { SETTING_KEY_P2P_DEVICE_NAME, configURIBase, configURIBaseQR, SuffixDatabaseName, ExtraSuffixIndexedDB };