@vrtmrz/livesync-commonlib 0.1.0-rc.1 → 0.1.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -19
- package/dist/common/configForDoc.js +6 -3
- package/dist/common/i18n.js +7 -7099
- package/dist/common/messages/combinedMessages.prod.d.ts +12 -0
- package/dist/common/messages/combinedMessages.prod.js +12 -0
- package/dist/common/messages/def.d.ts +4 -0
- package/dist/common/messagesJson/en.json +4 -0
- package/dist/common/models/setting.const.defaults.d.ts +19 -0
- package/dist/common/models/setting.const.defaults.js +21 -2
- package/dist/common/models/setting.lifecycle.d.ts +31 -0
- package/dist/common/models/setting.lifecycle.js +109 -0
- package/dist/common/models/setting.type.d.ts +4 -2
- package/dist/common/settingConstants.js +2 -2
- package/dist/common/types.d.ts +4 -2
- package/dist/common/types.js +16 -1
- package/dist/interfaces/Confirm.d.ts +10 -2
- package/dist/interfaces/DatabaseRebuilder.d.ts +12 -2
- package/dist/remoteConfigurations.d.ts +9 -0
- package/dist/remoteConfigurations.js +14 -0
- package/dist/replication/LiveSyncAbstractReplicator.d.ts +1 -2
- package/dist/replication/couchdb/LiveSyncReplicator.d.ts +0 -1
- package/dist/replication/couchdb/LiveSyncReplicator.js +0 -3
- package/dist/replication/journal/LiveSyncJournalReplicator.d.ts +0 -1
- package/dist/replication/journal/LiveSyncJournalReplicator.js +0 -3
- package/dist/replication/trystero/LiveSyncTrysteroReplicator.d.ts +5 -3
- package/dist/replication/trystero/LiveSyncTrysteroReplicator.js +42 -30
- package/dist/replication/trystero/P2PReplicatorCore.d.ts +2 -6
- package/dist/replication/trystero/P2PReplicatorCore.js +16 -86
- package/dist/replication/trystero/TrysteroReplicator.d.ts +2 -1
- package/dist/replication/trystero/TrysteroReplicator.js +10 -4
- package/dist/replication/trystero/TrysteroReplicatorP2PServer.d.ts +4 -5
- package/dist/replication/trystero/TrysteroReplicatorP2PServer.js +22 -30
- package/dist/replication/trystero/UseP2PReplicatorResult.d.ts +10 -2
- package/dist/replication/trystero/addP2PEventHandlers.d.ts +4 -2
- package/dist/replication/trystero/addP2PEventHandlers.js +8 -6
- package/dist/replication/trystero/types.d.ts +2 -0
- package/dist/replication/trystero/useP2PReplicatorCommands.d.ts +1 -1
- package/dist/replication/trystero/useP2PReplicatorCommands.js +3 -1
- package/dist/replication/trystero/useP2PReplicatorFeature.js +1 -1
- package/dist/rpc/RpcRoom.d.ts +1 -1
- package/dist/rpc/RpcRoom.js +22 -16
- package/dist/rpc/transports/TrysteroTransport.d.ts +2 -0
- package/dist/rpc/transports/TrysteroTransport.js +24 -17
- package/dist/rpc/transports/trysteroRoomEvents.d.ts +14 -0
- package/dist/rpc/transports/trysteroRoomEvents.js +34 -0
- package/dist/serviceFeatures/checkRemoteSize.d.ts +5 -3
- package/dist/serviceFeatures/checkRemoteSize.js +51 -11
- package/dist/serviceFeatures/remoteConfig.d.ts +37 -1
- package/dist/serviceFeatures/remoteConfig.js +90 -0
- package/dist/serviceModules/Rebuilder.d.ts +3 -6
- package/dist/serviceModules/Rebuilder.js +23 -19
- package/dist/services/base/IService.d.ts +13 -6
- package/dist/services/base/ReplicationService.d.ts +4 -2
- package/dist/services/base/ReplicationService.js +11 -16
- package/dist/services/base/SettingService.d.ts +14 -9
- package/dist/services/base/SettingService.js +35 -17
- package/dist/services/implements/headless/HeadlessAPIService.d.ts +3 -3
- package/dist/services/implements/headless/HeadlessAPIService.js +2 -2
- package/dist/services/implements/injectable/InjectableTweakValueService.d.ts +3 -3
- package/dist/settings.d.ts +10 -0
- package/dist/settings.js +32 -0
- package/dist/worker/bgWorker.js +1 -1
- package/docs/development.md +83 -1
- package/docs/p2p-transport-lifecycle.md +52 -0
- package/docs/proven-in-use.md +57 -0
- package/docs/releasing.md +12 -6
- package/docs/remote-configurations.md +63 -0
- package/docs/settings-lifecycle.md +60 -0
- package/package.json +12 -2
|
@@ -2597,6 +2597,12 @@ export declare const allMessages: {
|
|
|
2597
2597
|
readonly ru: "Можно установить предупреждение о максимальной ёмкости базы данных.";
|
|
2598
2598
|
readonly zh: "我们可以设置一个最大数据库容量警告,**以便在远程存储空间耗尽前采取行动**。\n您想启用这个功能吗?\n\n> [!MORE]-\n> - 0: 不警告存储大小。\n> 如果您在远程存储(尤其是自托管)上有足够的空间,则推荐此选项。您可以手动检查存储大小并重建。\n> - 800: 如果远程存储大小超过 800MB 则发出警告。\n> 如果您使用的是 fly.io(1GB 限制) 或 IBM Cloudant,则推荐此选项。\n> - 2000: 如果远程存储大小超过 2GB 则发出警告。\n\n如果达到限制,系统会要求我们逐步增大限制\n";
|
|
2599
2599
|
};
|
|
2600
|
+
readonly "moduleCheckRemoteSize.noticeExceeded": {
|
|
2601
|
+
readonly def: "Remote storage size is ${measuredSize}, above the configured ${notifySize} notification threshold. {HERE}";
|
|
2602
|
+
};
|
|
2603
|
+
readonly "moduleCheckRemoteSize.noticeNotConfigured": {
|
|
2604
|
+
readonly def: "Remote storage size notifications are not configured. {HERE}";
|
|
2605
|
+
};
|
|
2600
2606
|
readonly "moduleCheckRemoteSize.option2GB": {
|
|
2601
2607
|
readonly def: "2GB (Standard)";
|
|
2602
2608
|
readonly es: "2GB (Estándar)";
|
|
@@ -2667,6 +2673,9 @@ export declare const allMessages: {
|
|
|
2667
2673
|
readonly ru: "Перестроить всё сейчас";
|
|
2668
2674
|
readonly zh: "立即重建所有内容";
|
|
2669
2675
|
};
|
|
2676
|
+
readonly "moduleCheckRemoteSize.optionReview": {
|
|
2677
|
+
readonly def: "Review options";
|
|
2678
|
+
};
|
|
2670
2679
|
readonly "moduleCheckRemoteSize.titleDatabaseSizeLimitExceeded": {
|
|
2671
2680
|
readonly def: "Remote storage size exceeded the limit";
|
|
2672
2681
|
readonly es: "El tamaño del almacenamiento remoto superó el límite";
|
|
@@ -8631,6 +8640,9 @@ export declare const allMessages: {
|
|
|
8631
8640
|
readonly def: "Welcome to Self-hosted LiveSync";
|
|
8632
8641
|
readonly zh: "欢迎使用 Self-hosted LiveSync";
|
|
8633
8642
|
};
|
|
8643
|
+
readonly "Ui.SetupWizard.Invitation.Start": {
|
|
8644
|
+
readonly def: "Start setup";
|
|
8645
|
+
};
|
|
8634
8646
|
readonly "Ui.SetupWizard.OutroAskUserMode.CompatibleOption": {
|
|
8635
8647
|
readonly def: "The remote is already set up, and the configuration is compatible (or became compatible through this operation).";
|
|
8636
8648
|
readonly zh: "远程端已配置完成,且当前配置兼容(或已通过本次操作变为兼容)。";
|
|
@@ -2597,6 +2597,12 @@ const allMessages = {
|
|
|
2597
2597
|
ru: "\u041C\u043E\u0436\u043D\u043E \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 \u043E \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0439 \u0451\u043C\u043A\u043E\u0441\u0442\u0438 \u0431\u0430\u0437\u044B \u0434\u0430\u043D\u043D\u044B\u0445.",
|
|
2598
2598
|
zh: "\u6211\u4EEC\u53EF\u4EE5\u8BBE\u7F6E\u4E00\u4E2A\u6700\u5927\u6570\u636E\u5E93\u5BB9\u91CF\u8B66\u544A,**\u4EE5\u4FBF\u5728\u8FDC\u7A0B\u5B58\u50A8\u7A7A\u95F4\u8017\u5C3D\u524D\u91C7\u53D6\u884C\u52A8**\u3002\n\u60A8\u60F3\u542F\u7528\u8FD9\u4E2A\u529F\u80FD\u5417?\n\n> [!MORE]-\n> - 0: \u4E0D\u8B66\u544A\u5B58\u50A8\u5927\u5C0F\u3002\n> \u5982\u679C\u60A8\u5728\u8FDC\u7A0B\u5B58\u50A8(\u5C24\u5176\u662F\u81EA\u6258\u7BA1)\u4E0A\u6709\u8DB3\u591F\u7684\u7A7A\u95F4,\u5219\u63A8\u8350\u6B64\u9009\u9879\u3002\u60A8\u53EF\u4EE5\u624B\u52A8\u68C0\u67E5\u5B58\u50A8\u5927\u5C0F\u5E76\u91CD\u5EFA\u3002\n> - 800: \u5982\u679C\u8FDC\u7A0B\u5B58\u50A8\u5927\u5C0F\u8D85\u8FC7 800MB \u5219\u53D1\u51FA\u8B66\u544A\u3002\n> \u5982\u679C\u60A8\u4F7F\u7528\u7684\u662F fly.io(1GB \u9650\u5236) \u6216 IBM Cloudant,\u5219\u63A8\u8350\u6B64\u9009\u9879\u3002\n> - 2000: \u5982\u679C\u8FDC\u7A0B\u5B58\u50A8\u5927\u5C0F\u8D85\u8FC7 2GB \u5219\u53D1\u51FA\u8B66\u544A\u3002\n\n\u5982\u679C\u8FBE\u5230\u9650\u5236,\u7CFB\u7EDF\u4F1A\u8981\u6C42\u6211\u4EEC\u9010\u6B65\u589E\u5927\u9650\u5236\n"
|
|
2599
2599
|
},
|
|
2600
|
+
"moduleCheckRemoteSize.noticeExceeded": {
|
|
2601
|
+
def: "Remote storage size is ${measuredSize}, above the configured ${notifySize} notification threshold. {HERE}"
|
|
2602
|
+
},
|
|
2603
|
+
"moduleCheckRemoteSize.noticeNotConfigured": {
|
|
2604
|
+
def: "Remote storage size notifications are not configured. {HERE}"
|
|
2605
|
+
},
|
|
2600
2606
|
"moduleCheckRemoteSize.option2GB": {
|
|
2601
2607
|
def: "2GB (Standard)",
|
|
2602
2608
|
es: "2GB (Est\xE1ndar)",
|
|
@@ -2667,6 +2673,9 @@ const allMessages = {
|
|
|
2667
2673
|
ru: "\u041F\u0435\u0440\u0435\u0441\u0442\u0440\u043E\u0438\u0442\u044C \u0432\u0441\u0451 \u0441\u0435\u0439\u0447\u0430\u0441",
|
|
2668
2674
|
zh: "\u7ACB\u5373\u91CD\u5EFA\u6240\u6709\u5185\u5BB9"
|
|
2669
2675
|
},
|
|
2676
|
+
"moduleCheckRemoteSize.optionReview": {
|
|
2677
|
+
def: "Review options"
|
|
2678
|
+
},
|
|
2670
2679
|
"moduleCheckRemoteSize.titleDatabaseSizeLimitExceeded": {
|
|
2671
2680
|
def: "Remote storage size exceeded the limit",
|
|
2672
2681
|
es: "El tama\xF1o del almacenamiento remoto super\xF3 el l\xEDmite",
|
|
@@ -8635,6 +8644,9 @@ Note : le QR code n'est pas chiffr\xE9, soyez prudent en l'affichant.
|
|
|
8635
8644
|
def: "Welcome to Self-hosted LiveSync",
|
|
8636
8645
|
zh: "\u6B22\u8FCE\u4F7F\u7528 Self-hosted LiveSync"
|
|
8637
8646
|
},
|
|
8647
|
+
"Ui.SetupWizard.Invitation.Start": {
|
|
8648
|
+
def: "Start setup"
|
|
8649
|
+
},
|
|
8638
8650
|
"Ui.SetupWizard.OutroAskUserMode.CompatibleOption": {
|
|
8639
8651
|
def: "The remote is already set up, and the configuration is compatible (or became compatible through this operation).",
|
|
8640
8652
|
zh: "\u8FDC\u7A0B\u7AEF\u5DF2\u914D\u7F6E\u5B8C\u6210\uFF0C\u4E14\u5F53\u524D\u914D\u7F6E\u517C\u5BB9\uFF08\u6216\u5DF2\u901A\u8FC7\u672C\u6B21\u64CD\u4F5C\u53D8\u4E3A\u517C\u5BB9\uFF09\u3002"
|
|
@@ -278,6 +278,8 @@ export declare const PartialMessages: {
|
|
|
278
278
|
"moduleCheckRemoteSize.msgConfirmRebuild": string;
|
|
279
279
|
"moduleCheckRemoteSize.msgDatabaseGrowing": string;
|
|
280
280
|
"moduleCheckRemoteSize.msgSetDBCapacity": string;
|
|
281
|
+
"moduleCheckRemoteSize.noticeExceeded": string;
|
|
282
|
+
"moduleCheckRemoteSize.noticeNotConfigured": string;
|
|
281
283
|
"moduleCheckRemoteSize.option2GB": string;
|
|
282
284
|
"moduleCheckRemoteSize.option800MB": string;
|
|
283
285
|
"moduleCheckRemoteSize.optionAskMeLater": string;
|
|
@@ -285,6 +287,7 @@ export declare const PartialMessages: {
|
|
|
285
287
|
"moduleCheckRemoteSize.optionIncreaseLimit": string;
|
|
286
288
|
"moduleCheckRemoteSize.optionNoWarn": string;
|
|
287
289
|
"moduleCheckRemoteSize.optionRebuildAll": string;
|
|
290
|
+
"moduleCheckRemoteSize.optionReview": string;
|
|
288
291
|
"moduleCheckRemoteSize.titleDatabaseSizeLimitExceeded": string;
|
|
289
292
|
"moduleCheckRemoteSize.titleDatabaseSizeNotify": string;
|
|
290
293
|
"moduleInputUIObsidian.defaultTitleConfirmation": string;
|
|
@@ -1040,6 +1043,7 @@ export declare const PartialMessages: {
|
|
|
1040
1043
|
"Ui.SetupWizard.Intro.ProceedNew": string;
|
|
1041
1044
|
"Ui.SetupWizard.Intro.Question": string;
|
|
1042
1045
|
"Ui.SetupWizard.Intro.Title": string;
|
|
1046
|
+
"Ui.SetupWizard.Invitation.Start": string;
|
|
1043
1047
|
"Ui.SetupWizard.OutroAskUserMode.CompatibleOption": string;
|
|
1044
1048
|
"Ui.SetupWizard.OutroAskUserMode.CompatibleOptionDesc": string;
|
|
1045
1049
|
"Ui.SetupWizard.OutroAskUserMode.ExistingOption": string;
|
|
@@ -277,6 +277,8 @@
|
|
|
277
277
|
"moduleCheckRemoteSize.msgConfirmRebuild": "This may take a bit of a long time. Do you really want to rebuild everything now?",
|
|
278
278
|
"moduleCheckRemoteSize.msgDatabaseGrowing": "**Your database is getting larger!** But do not worry, we can address it now. The time before running out of space on the remote storage.\n\n| Measured size | Configured size |\n| --- | --- |\n| ${estimatedSize} | ${maxSize} |\n\n> [!MORE]-\n> If you have been using it for many years, there may be unreferenced chunks - that is, garbage - accumulating in the database. Therefore, we recommend rebuilding everything. It will probably become much smaller.\n>\n> If the volume of your vault is simply increasing, it is better to rebuild everything after organizing the files. Self-hosted LiveSync does not delete the actual data even if you delete it to speed up the process. It is roughly [documented](https://github.com/vrtmrz/obsidian-livesync/blob/main/docs/tech_info.md).\n>\n> If you don't mind the increase, you can increase the notification limit by 100MB. This is the case if you are running it on your own server. However, it is better to rebuild everything from time to time.\n>\n\n> [!WARNING]\n> If you perform rebuild everything, make sure all devices are synchronised. The plug-in will merge as much as possible, though.\n",
|
|
279
279
|
"moduleCheckRemoteSize.msgSetDBCapacity": "We can set a maximum database capacity warning, **to take action before running out of space on the remote storage**.\nDo you want to enable this?\n\n> [!MORE]-\n> - 0: Do not warn about storage size.\n> This is recommended if you have enough space on the remote storage especially you have self-hosted. And you can check the storage size and rebuild manually.\n> - 800: Warn if the remote storage size exceeds 800MB.\n> This is recommended if you are using fly.io with 1GB limit or IBM Cloudant.\n> - 2000: Warn if the remote storage size exceeds 2GB.\n\nIf we have reached the limit, we will be asked to enlarge the limit step by step.\n",
|
|
280
|
+
"moduleCheckRemoteSize.noticeExceeded": "Remote storage size is ${measuredSize}, above the configured ${notifySize} notification threshold. {HERE}",
|
|
281
|
+
"moduleCheckRemoteSize.noticeNotConfigured": "Remote storage size notifications are not configured. {HERE}",
|
|
280
282
|
"moduleCheckRemoteSize.option2GB": "2GB (Standard)",
|
|
281
283
|
"moduleCheckRemoteSize.option800MB": "800MB (Cloudant, fly.io)",
|
|
282
284
|
"moduleCheckRemoteSize.optionAskMeLater": "Ask me later",
|
|
@@ -284,6 +286,7 @@
|
|
|
284
286
|
"moduleCheckRemoteSize.optionIncreaseLimit": "increase to ${newMax}MB",
|
|
285
287
|
"moduleCheckRemoteSize.optionNoWarn": "No, never warn please",
|
|
286
288
|
"moduleCheckRemoteSize.optionRebuildAll": "Rebuild Everything Now",
|
|
289
|
+
"moduleCheckRemoteSize.optionReview": "Review options",
|
|
287
290
|
"moduleCheckRemoteSize.titleDatabaseSizeLimitExceeded": "Remote storage size exceeded the limit",
|
|
288
291
|
"moduleCheckRemoteSize.titleDatabaseSizeNotify": "Setting up database size notification",
|
|
289
292
|
"moduleInputUIObsidian.defaultTitleConfirmation": "Confirmation",
|
|
@@ -1039,6 +1042,7 @@
|
|
|
1039
1042
|
"Ui.SetupWizard.Intro.ProceedNew": "Yes, I want to set up a new synchronisation",
|
|
1040
1043
|
"Ui.SetupWizard.Intro.Question": "First, please select the option that best describes your current situation.",
|
|
1041
1044
|
"Ui.SetupWizard.Intro.Title": "Welcome to Self-hosted LiveSync",
|
|
1045
|
+
"Ui.SetupWizard.Invitation.Start": "Start setup",
|
|
1042
1046
|
"Ui.SetupWizard.OutroAskUserMode.CompatibleOption": "The remote is already set up, and the configuration is compatible (or became compatible through this operation).",
|
|
1043
1047
|
"Ui.SetupWizard.OutroAskUserMode.CompatibleOptionDesc": "Unless you are certain, selecting this option is risky. It assumes the server configuration is compatible with this device. If that is not the case, data loss may occur. Please make sure you understand the consequences.",
|
|
1044
1048
|
"Ui.SetupWizard.OutroAskUserMode.ExistingOption": "My remote server is already set up. I want to join this device.",
|
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
import { type ObsidianLiveSyncSettings, type P2PSyncSetting } from "./setting.type.js";
|
|
2
2
|
export declare const P2P_DEFAULT_SETTINGS: P2PSyncSetting;
|
|
3
|
+
/**
|
|
4
|
+
* Conservative fallback values used to complete stored settings.
|
|
5
|
+
*
|
|
6
|
+
* Keep these values compatible with existing installations. Defaults intended
|
|
7
|
+
* only for a newly created Vault belong in {@link NEW_VAULT_SETTINGS}.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SETTINGS_SCHEMA_DEFAULTS: ObsidianLiveSyncSettings;
|
|
10
|
+
/**
|
|
11
|
+
* Initial values for a Vault which has never stored Self-hosted LiveSync settings.
|
|
12
|
+
*
|
|
13
|
+
* This object is deliberately separate from schema fallbacks so that future
|
|
14
|
+
* releases can improve new-user defaults without changing existing choices.
|
|
15
|
+
*/
|
|
16
|
+
export declare const NEW_VAULT_SETTINGS: ObsidianLiveSyncSettings;
|
|
17
|
+
/** Create an independently mutable copy of the current new-Vault settings. */
|
|
18
|
+
export declare function createNewVaultSettings(): ObsidianLiveSyncSettings;
|
|
19
|
+
/**
|
|
20
|
+
* Compatibility name for the conservative setting-schema fallbacks.
|
|
21
|
+
*/
|
|
3
22
|
export declare const DEFAULT_SETTINGS: ObsidianLiveSyncSettings;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChunkAlgorithms, CURRENT_SETTING_VERSION, E2EEAlgorithms, REMOTE_COUCHDB } from "./setting.const.js";
|
|
2
|
+
import { PREFERRED_BASE } from "./setting.const.preferred.js";
|
|
2
3
|
import { AutoAccepting } from "./setting.type.js";
|
|
3
4
|
const P2P_DEFAULT_SETTINGS = {
|
|
4
5
|
P2P_Enabled: false,
|
|
@@ -22,7 +23,7 @@ const P2P_DEFAULT_SETTINGS = {
|
|
|
22
23
|
P2P_turnCredential: "",
|
|
23
24
|
P2P_useDiagRTC: false
|
|
24
25
|
};
|
|
25
|
-
const
|
|
26
|
+
const SETTINGS_SCHEMA_DEFAULTS = {
|
|
26
27
|
remoteType: REMOTE_COUCHDB,
|
|
27
28
|
useCustomRequestHandler: false,
|
|
28
29
|
couchDB_URI: "",
|
|
@@ -145,6 +146,7 @@ const DEFAULT_SETTINGS = {
|
|
|
145
146
|
handleFilenameCaseSensitive: void 0,
|
|
146
147
|
doNotUseFixedRevisionForChunks: true,
|
|
147
148
|
showLongerLogInsideEditor: false,
|
|
149
|
+
/** @deprecated Retained for settings and Setup URI compatibility. */
|
|
148
150
|
sendChunksBulk: false,
|
|
149
151
|
sendChunksBulkMaxSize: 1,
|
|
150
152
|
/**
|
|
@@ -179,7 +181,24 @@ const DEFAULT_SETTINGS = {
|
|
|
179
181
|
maxMTimeForReflectEvents: 0,
|
|
180
182
|
tweakModified: void 0
|
|
181
183
|
};
|
|
184
|
+
const NEW_VAULT_SETTINGS = {
|
|
185
|
+
...SETTINGS_SCHEMA_DEFAULTS,
|
|
186
|
+
...PREFERRED_BASE,
|
|
187
|
+
remoteConfigurations: {},
|
|
188
|
+
pluginSyncExtendedSetting: {}
|
|
189
|
+
};
|
|
190
|
+
function createNewVaultSettings() {
|
|
191
|
+
return {
|
|
192
|
+
...NEW_VAULT_SETTINGS,
|
|
193
|
+
remoteConfigurations: {},
|
|
194
|
+
pluginSyncExtendedSetting: {}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const DEFAULT_SETTINGS = SETTINGS_SCHEMA_DEFAULTS;
|
|
182
198
|
export {
|
|
183
199
|
DEFAULT_SETTINGS,
|
|
184
|
-
|
|
200
|
+
NEW_VAULT_SETTINGS,
|
|
201
|
+
P2P_DEFAULT_SETTINGS,
|
|
202
|
+
SETTINGS_SCHEMA_DEFAULTS,
|
|
203
|
+
createNewVaultSettings
|
|
185
204
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ObsidianLiveSyncSettings } from "./setting.type.js";
|
|
2
|
+
export declare const SettingsMigrationReviewCodes: {
|
|
3
|
+
readonly LegacyUpdatePending: "legacy-update-review-pending";
|
|
4
|
+
readonly FutureSchema: "settings-schema-newer-than-runtime";
|
|
5
|
+
};
|
|
6
|
+
export type SettingsMigrationReviewCode = (typeof SettingsMigrationReviewCodes)[keyof typeof SettingsMigrationReviewCodes];
|
|
7
|
+
export interface SettingsMigrationReviewReason {
|
|
8
|
+
code: SettingsMigrationReviewCode;
|
|
9
|
+
fromVersion: number;
|
|
10
|
+
toVersion: number;
|
|
11
|
+
}
|
|
12
|
+
export interface SettingsMigrationState {
|
|
13
|
+
sourceVersion: number;
|
|
14
|
+
targetVersion: number;
|
|
15
|
+
isNewVault: boolean;
|
|
16
|
+
isFromFutureSchema: boolean;
|
|
17
|
+
changed: boolean;
|
|
18
|
+
requiresSyncReview: boolean;
|
|
19
|
+
reviewReasons: readonly SettingsMigrationReviewReason[];
|
|
20
|
+
}
|
|
21
|
+
export interface PreparedSettings extends SettingsMigrationState {
|
|
22
|
+
settings: ObsidianLiveSyncSettings;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Completes and migrates raw settings before services consume them.
|
|
26
|
+
*
|
|
27
|
+
* Stored settings use conservative schema fallbacks. A blank store uses the
|
|
28
|
+
* independently maintained new-Vault defaults. Explicit stored values always
|
|
29
|
+
* take precedence over both sets of defaults.
|
|
30
|
+
*/
|
|
31
|
+
export declare function prepareSettingsForLoad(storedSettings: Partial<ObsidianLiveSyncSettings> | undefined): PreparedSettings;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { createNewVaultSettings, SETTINGS_SCHEMA_DEFAULTS } from "./setting.const.defaults.js";
|
|
2
|
+
import {
|
|
3
|
+
CURRENT_SETTING_VERSION,
|
|
4
|
+
SETTING_VERSION_INITIAL,
|
|
5
|
+
SETTING_VERSION_SUPPORT_CASE_INSENSITIVE
|
|
6
|
+
} from "./setting.const.js";
|
|
7
|
+
const SettingsMigrationReviewCodes = {
|
|
8
|
+
LegacyUpdatePending: "legacy-update-review-pending",
|
|
9
|
+
FutureSchema: "settings-schema-newer-than-runtime"
|
|
10
|
+
};
|
|
11
|
+
const SETTINGS_MIGRATIONS = [
|
|
12
|
+
{
|
|
13
|
+
toVersion: SETTING_VERSION_SUPPORT_CASE_INSENSITIVE,
|
|
14
|
+
apply: (settings) => settings,
|
|
15
|
+
reviewReason: (settings, fromVersion) => settings.versionUpFlash ? {
|
|
16
|
+
code: SettingsMigrationReviewCodes.LegacyUpdatePending,
|
|
17
|
+
fromVersion,
|
|
18
|
+
toVersion: SETTING_VERSION_SUPPORT_CASE_INSENSITIVE
|
|
19
|
+
} : void 0
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
function cloneSettings(source, fallbacks) {
|
|
23
|
+
return {
|
|
24
|
+
...fallbacks,
|
|
25
|
+
...source,
|
|
26
|
+
remoteConfigurations: Object.fromEntries(
|
|
27
|
+
Object.entries(source.remoteConfigurations ?? fallbacks.remoteConfigurations).map(([id, config]) => [
|
|
28
|
+
id,
|
|
29
|
+
{ ...config }
|
|
30
|
+
])
|
|
31
|
+
),
|
|
32
|
+
pluginSyncExtendedSetting: {
|
|
33
|
+
...fallbacks.pluginSyncExtendedSetting,
|
|
34
|
+
...source.pluginSyncExtendedSetting
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function storedSettingVersion(settings) {
|
|
39
|
+
const version = settings.settingVersion;
|
|
40
|
+
return typeof version === "number" && Number.isSafeInteger(version) && version >= SETTING_VERSION_INITIAL ? version : SETTING_VERSION_INITIAL;
|
|
41
|
+
}
|
|
42
|
+
function isBlankSettings(settings) {
|
|
43
|
+
return settings === void 0 || Object.keys(settings).length === 0;
|
|
44
|
+
}
|
|
45
|
+
function prepareSettingsForLoad(storedSettings) {
|
|
46
|
+
if (isBlankSettings(storedSettings)) {
|
|
47
|
+
return {
|
|
48
|
+
settings: createNewVaultSettings(),
|
|
49
|
+
sourceVersion: CURRENT_SETTING_VERSION,
|
|
50
|
+
targetVersion: CURRENT_SETTING_VERSION,
|
|
51
|
+
isNewVault: true,
|
|
52
|
+
isFromFutureSchema: false,
|
|
53
|
+
changed: false,
|
|
54
|
+
requiresSyncReview: false,
|
|
55
|
+
reviewReasons: []
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const source = { ...storedSettings };
|
|
59
|
+
const sourceVersion = storedSettingVersion(source);
|
|
60
|
+
if (sourceVersion > CURRENT_SETTING_VERSION) {
|
|
61
|
+
const reviewReasons2 = [
|
|
62
|
+
{
|
|
63
|
+
code: SettingsMigrationReviewCodes.FutureSchema,
|
|
64
|
+
fromVersion: sourceVersion,
|
|
65
|
+
toVersion: CURRENT_SETTING_VERSION
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
return {
|
|
69
|
+
settings: cloneSettings(source, SETTINGS_SCHEMA_DEFAULTS),
|
|
70
|
+
sourceVersion,
|
|
71
|
+
targetVersion: sourceVersion,
|
|
72
|
+
isNewVault: false,
|
|
73
|
+
isFromFutureSchema: true,
|
|
74
|
+
changed: false,
|
|
75
|
+
requiresSyncReview: true,
|
|
76
|
+
reviewReasons: reviewReasons2
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
let migrated = source;
|
|
80
|
+
let targetVersion = sourceVersion;
|
|
81
|
+
const reviewReasons = [];
|
|
82
|
+
for (const migration of SETTINGS_MIGRATIONS) {
|
|
83
|
+
if (targetVersion >= migration.toVersion) continue;
|
|
84
|
+
const reason = migration.reviewReason?.(migrated, targetVersion);
|
|
85
|
+
if (reason) reviewReasons.push(reason);
|
|
86
|
+
migrated = migration.apply(migrated);
|
|
87
|
+
targetVersion = migration.toVersion;
|
|
88
|
+
migrated.settingVersion = targetVersion;
|
|
89
|
+
}
|
|
90
|
+
if (targetVersion !== CURRENT_SETTING_VERSION) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
`No setting migration reaches schema ${CURRENT_SETTING_VERSION} from schema ${sourceVersion}.`
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
settings: cloneSettings(migrated, SETTINGS_SCHEMA_DEFAULTS),
|
|
97
|
+
sourceVersion,
|
|
98
|
+
targetVersion,
|
|
99
|
+
isNewVault: false,
|
|
100
|
+
isFromFutureSchema: false,
|
|
101
|
+
changed: sourceVersion !== targetVersion,
|
|
102
|
+
requiresSyncReview: reviewReasons.length > 0,
|
|
103
|
+
reviewReasons
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
SettingsMigrationReviewCodes,
|
|
108
|
+
prepareSettingsForLoad
|
|
109
|
+
};
|
|
@@ -668,11 +668,13 @@ interface ObsoleteRemoteDBSettings {
|
|
|
668
668
|
*/
|
|
669
669
|
disableRequestURI: boolean;
|
|
670
670
|
/**
|
|
671
|
-
*
|
|
671
|
+
* Retained for settings and Setup URI compatibility.
|
|
672
|
+
* Automatic bulk chunk pre-send is no longer supported.
|
|
673
|
+
* @deprecated
|
|
672
674
|
*/
|
|
673
675
|
sendChunksBulk: boolean;
|
|
674
676
|
/**
|
|
675
|
-
* The maximum size
|
|
677
|
+
* The maximum request size used by the explicit manual chunk resend tool, in MB.
|
|
676
678
|
*/
|
|
677
679
|
sendChunksBulkMaxSize: number;
|
|
678
680
|
/**
|
|
@@ -328,8 +328,8 @@ const SettingInformation = {
|
|
|
328
328
|
desc: "If this enabled, all chunks will be stored with the revision made from its content."
|
|
329
329
|
},
|
|
330
330
|
sendChunksBulkMaxSize: {
|
|
331
|
-
name: "Maximum size
|
|
332
|
-
desc: "MB"
|
|
331
|
+
name: "Maximum request size for manually resending chunks",
|
|
332
|
+
desc: "MB per request"
|
|
333
333
|
},
|
|
334
334
|
useAdvancedMode: {
|
|
335
335
|
name: "Enable advanced features"
|
package/dist/common/types.d.ts
CHANGED
|
@@ -10,7 +10,8 @@ import { IDPrefixes, LEAF_WAIT_ONLY_REMOTE, LEAF_WAIT_TIMEOUT, LEAF_WAIT_TIMEOUT
|
|
|
10
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
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
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";
|
|
13
|
+
import { P2P_DEFAULT_SETTINGS, DEFAULT_SETTINGS, NEW_VAULT_SETTINGS, SETTINGS_SCHEMA_DEFAULTS, createNewVaultSettings } from "./models/setting.const.defaults.js";
|
|
14
|
+
import { prepareSettingsForLoad, SettingsMigrationReviewCodes, type PreparedSettings, type SettingsMigrationReviewCode, type SettingsMigrationReviewReason, type SettingsMigrationState } from "./models/setting.lifecycle.js";
|
|
14
15
|
import { KeyIndexOfSettings } from "./models/setting.const.qr.js";
|
|
15
16
|
import type { DeviceInfo, EntryBody, EntryDoc, EntryDocResponse, EntryMilestoneInfo, EntryNodeInfo, NodeData, NodeKey } from "./models/db.definition.js";
|
|
16
17
|
import { isMetaEntry } from "./models/db.definition.js";
|
|
@@ -42,7 +43,8 @@ export type { EncryptionSettings };
|
|
|
42
43
|
export { HashAlgorithms, type HashAlgorithm, ChunkAlgorithmNames, ChunkAlgorithms, type ChunkSplitterVersion };
|
|
43
44
|
export type { RemoteDBSettings };
|
|
44
45
|
export type { ObsidianLiveSyncSettings };
|
|
45
|
-
export { DEFAULT_SETTINGS };
|
|
46
|
+
export { DEFAULT_SETTINGS, NEW_VAULT_SETTINGS, SETTINGS_SCHEMA_DEFAULTS, createNewVaultSettings };
|
|
47
|
+
export { prepareSettingsForLoad, SettingsMigrationReviewCodes, type PreparedSettings, type SettingsMigrationReviewCode, type SettingsMigrationReviewReason, type SettingsMigrationState, };
|
|
46
48
|
export { KeyIndexOfSettings };
|
|
47
49
|
export { type HasSettings };
|
|
48
50
|
export { PREFERRED_BASE, PREFERRED_SETTING_CLOUDANT, PREFERRED_SETTING_SELF_HOSTED, PREFERRED_JOURNAL_SYNC };
|
package/dist/common/types.js
CHANGED
|
@@ -67,7 +67,17 @@ import {
|
|
|
67
67
|
PREFERRED_SETTING_CLOUDANT,
|
|
68
68
|
PREFERRED_SETTING_SELF_HOSTED
|
|
69
69
|
} from "./models/setting.const.preferred.js";
|
|
70
|
-
import {
|
|
70
|
+
import {
|
|
71
|
+
P2P_DEFAULT_SETTINGS,
|
|
72
|
+
DEFAULT_SETTINGS,
|
|
73
|
+
NEW_VAULT_SETTINGS,
|
|
74
|
+
SETTINGS_SCHEMA_DEFAULTS,
|
|
75
|
+
createNewVaultSettings
|
|
76
|
+
} from "./models/setting.const.defaults.js";
|
|
77
|
+
import {
|
|
78
|
+
prepareSettingsForLoad,
|
|
79
|
+
SettingsMigrationReviewCodes
|
|
80
|
+
} from "./models/setting.lifecycle.js";
|
|
71
81
|
import { KeyIndexOfSettings } from "./models/setting.const.qr.js";
|
|
72
82
|
import { isMetaEntry } from "./models/db.definition.js";
|
|
73
83
|
import {
|
|
@@ -165,6 +175,7 @@ export {
|
|
|
165
175
|
MODE_PAUSED,
|
|
166
176
|
MODE_SELECTIVE,
|
|
167
177
|
MODE_SHINY,
|
|
178
|
+
NEW_VAULT_SETTINGS,
|
|
168
179
|
NODEINFO_DOCID,
|
|
169
180
|
NOT_CONFLICTED,
|
|
170
181
|
NoteTypes,
|
|
@@ -190,10 +201,12 @@ export {
|
|
|
190
201
|
SALT_OF_ID,
|
|
191
202
|
SALT_OF_PASSPHRASE,
|
|
192
203
|
SEED_MURMURHASH,
|
|
204
|
+
SETTINGS_SCHEMA_DEFAULTS,
|
|
193
205
|
SETTING_KEY_P2P_DEVICE_NAME,
|
|
194
206
|
SETTING_VERSION_INITIAL,
|
|
195
207
|
SETTING_VERSION_SUPPORT_CASE_INSENSITIVE,
|
|
196
208
|
SYNCINFO_ID,
|
|
209
|
+
SettingsMigrationReviewCodes,
|
|
197
210
|
SuffixDatabaseName,
|
|
198
211
|
TIME_ARGUMENT_INFINITY,
|
|
199
212
|
TweakValuesDefault,
|
|
@@ -207,6 +220,8 @@ export {
|
|
|
207
220
|
configURIBase,
|
|
208
221
|
configURIBaseQR,
|
|
209
222
|
configurationNames,
|
|
223
|
+
createNewVaultSettings,
|
|
210
224
|
isMetaEntry,
|
|
225
|
+
prepareSettingsForLoad,
|
|
211
226
|
statusDisplay
|
|
212
227
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type ConfirmActionLayout = "auto" | "vertical";
|
|
1
2
|
export interface Confirm {
|
|
2
3
|
askYesNo(message: string): Promise<"yes" | "no">;
|
|
3
4
|
askString(title: string, key: string, placeholder: string, isPassword?: boolean): Promise<string | false>;
|
|
@@ -12,6 +13,13 @@ export interface Confirm {
|
|
|
12
13
|
defaultAction: T[number];
|
|
13
14
|
timeout?: number;
|
|
14
15
|
}): Promise<T[number] | false>;
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Shows a non-blocking message containing one host-rendered action link.
|
|
18
|
+
*
|
|
19
|
+
* Hosts which can display transient UI should keep the message visible for
|
|
20
|
+
* `durationMs`. Headless hosts may report the message without presenting an
|
|
21
|
+
* interactive action.
|
|
22
|
+
*/
|
|
23
|
+
askInPopup(key: string, dialogText: string, anchorCallback: (anchor: HTMLAnchorElement) => void, durationMs?: number): void;
|
|
24
|
+
confirmWithMessage(title: string, contentMd: string, buttons: string[], defaultAction: (typeof buttons)[number], timeout?: number, actionLayout?: ConfirmActionLayout): Promise<(typeof buttons)[number] | false>;
|
|
17
25
|
}
|
|
@@ -4,8 +4,18 @@ export interface Rebuilder {
|
|
|
4
4
|
$rebuildEverything(): Promise<void>;
|
|
5
5
|
$fetchLocal(makeLocalChunkBeforeSync?: boolean, preventMakeLocalFilesBeforeSync?: boolean): Promise<void>;
|
|
6
6
|
$fetchLocalDBFast(autoResume: boolean): Promise<void>;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Writes the Rebuild flag, suspends the current runtime, optionally prepares
|
|
9
|
+
* persisted state, and requests a restart, in that order.
|
|
10
|
+
*
|
|
11
|
+
* The preparation callback runs only after the flag exists. If it fails,
|
|
12
|
+
* the flag is removed, the current runtime is resumed, and the error is
|
|
13
|
+
* rethrown. A false result means that the flag could not be written and no
|
|
14
|
+
* restart was requested.
|
|
15
|
+
*/
|
|
16
|
+
scheduleRebuild(prepareBeforeRestart?: () => Promise<void>): Promise<boolean>;
|
|
17
|
+
/** See {@link scheduleRebuild}; this variant writes the Fetch flag. */
|
|
18
|
+
scheduleFetch(prepareBeforeRestart?: () => Promise<void>): Promise<boolean>;
|
|
9
19
|
/**
|
|
10
20
|
* Declares the finish of the rebuild process and unlock remote, resume reflecting the changes.
|
|
11
21
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Focused public primitives for storing and selecting multiple remote connection profiles.
|
|
3
|
+
*
|
|
4
|
+
* The compatibility fields remain available to existing hosts, but new profile-management code
|
|
5
|
+
* should use this entry point instead of importing the wider service feature module.
|
|
6
|
+
*/
|
|
7
|
+
export { activateP2PRemoteConfiguration, activateRemoteConfiguration, createRemoteConfigurationId, suggestRemoteConfigurationName, upsertRemoteConfigurationInPlace, } from "./serviceFeatures/remoteConfig.js";
|
|
8
|
+
export type { SerializableRemoteConfigurationType, UpsertRemoteConfigurationOptions, } from "./serviceFeatures/remoteConfig.js";
|
|
9
|
+
export type { RemoteConfiguration } from "./common/models/setting.type.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
activateP2PRemoteConfiguration,
|
|
3
|
+
activateRemoteConfiguration,
|
|
4
|
+
createRemoteConfigurationId,
|
|
5
|
+
suggestRemoteConfigurationName,
|
|
6
|
+
upsertRemoteConfigurationInPlace
|
|
7
|
+
} from "./serviceFeatures/remoteConfig.js";
|
|
8
|
+
export {
|
|
9
|
+
activateP2PRemoteConfiguration,
|
|
10
|
+
activateRemoteConfiguration,
|
|
11
|
+
createRemoteConfigurationId,
|
|
12
|
+
suggestRemoteConfigurationName,
|
|
13
|
+
upsertRemoteConfigurationInPlace
|
|
14
|
+
};
|
|
@@ -34,7 +34,6 @@ export declare abstract class LiveSyncAbstractReplicator {
|
|
|
34
34
|
remoteLockedAndDeviceNotAccepted: boolean;
|
|
35
35
|
tweakSettingsMismatched: boolean;
|
|
36
36
|
preferredTweakValue?: TweakValues;
|
|
37
|
-
abstract get isChunkSendingSupported(): boolean;
|
|
38
37
|
get database(): import("../pouchdb/LiveSyncLocalDB.js").LiveSyncLocalDB;
|
|
39
38
|
get rawDatabase(): PouchDB.Database<EntryDoc>;
|
|
40
39
|
get currentSettings(): import("../common/types.js").ObsidianLiveSyncSettings;
|
|
@@ -49,7 +48,7 @@ export declare abstract class LiveSyncAbstractReplicator {
|
|
|
49
48
|
abstract openReplication(setting: RemoteDBSettings, keepAlive: boolean, showResult: boolean, ignoreCleanLock: boolean): Promise<void | boolean>;
|
|
50
49
|
updateInfo: () => void;
|
|
51
50
|
abstract tryConnectRemote(setting: RemoteDBSettings, showResult?: boolean): Promise<boolean>;
|
|
52
|
-
abstract replicateAllToServer(setting: RemoteDBSettings, showingNotice?: boolean
|
|
51
|
+
abstract replicateAllToServer(setting: RemoteDBSettings, showingNotice?: boolean): Promise<boolean>;
|
|
53
52
|
abstract replicateAllFromServer(setting: RemoteDBSettings, showingNotice?: boolean): Promise<boolean>;
|
|
54
53
|
abstract closeReplication(): void;
|
|
55
54
|
abstract tryResetRemoteDatabase(setting: RemoteDBSettings): Promise<void>;
|
|
@@ -5,7 +5,6 @@ export interface LiveSyncCouchDBReplicatorEnv extends LiveSyncReplicatorEnv {
|
|
|
5
5
|
services: ServiceHub;
|
|
6
6
|
}
|
|
7
7
|
export declare class LiveSyncCouchDBReplicator extends LiveSyncAbstractReplicator {
|
|
8
|
-
get isChunkSendingSupported(): boolean;
|
|
9
8
|
isMobile(): boolean;
|
|
10
9
|
constructor(env: LiveSyncCouchDBReplicatorEnv);
|
|
11
10
|
getInitialSyncParameters(setting: RemoteDBSettings): Promise<SyncParameters>;
|
|
@@ -7,7 +7,6 @@ import { type SimpleStore } from "../../common/utils.js";
|
|
|
7
7
|
import type { LiveSyncJournalReplicatorEnv } from "./LiveSyncJournalReplicatorEnv.js";
|
|
8
8
|
export declare class LiveSyncJournalReplicator extends LiveSyncAbstractReplicator {
|
|
9
9
|
env: LiveSyncJournalReplicatorEnv;
|
|
10
|
-
get isChunkSendingSupported(): boolean;
|
|
11
10
|
get client(): JournalSyncCore;
|
|
12
11
|
get simpleStore(): SimpleStore<CheckPointInfo>;
|
|
13
12
|
_client: JournalSyncCore;
|
|
@@ -18,13 +18,15 @@ export interface LiveSyncTrysteroReplicatorEnv extends LiveSyncReplicatorEnv {
|
|
|
18
18
|
export declare class LiveSyncTrysteroReplicator extends LiveSyncAbstractReplicator {
|
|
19
19
|
private _p2pHost?;
|
|
20
20
|
private _replicator?;
|
|
21
|
+
private _lifecycleOperation;
|
|
22
|
+
private _shouldBeOpen;
|
|
21
23
|
get openReplicationUI(): (showResult: boolean) => Promise<boolean | void>;
|
|
22
24
|
get rawReplicator(): TrysteroReplicator;
|
|
23
25
|
get rawHost(): P2PHost;
|
|
24
|
-
get isChunkSendingSupported(): boolean;
|
|
25
26
|
getReplicationPBKDF2Salt(_setting: RemoteDBSettings, _refresh?: boolean): Promise<Uint8Array<ArrayBuffer>>;
|
|
26
27
|
terminateSync(): void;
|
|
27
28
|
private _buildEnv;
|
|
29
|
+
private _enqueueLifecycleOperation;
|
|
28
30
|
open(): Promise<void>;
|
|
29
31
|
close(): Promise<void>;
|
|
30
32
|
closeReplication(): void;
|
|
@@ -36,7 +38,7 @@ export declare class LiveSyncTrysteroReplicator extends LiveSyncAbstractReplicat
|
|
|
36
38
|
onNewPeer(peer: Advertisement): Promise<void>;
|
|
37
39
|
onPeerLeaved(peerId: string): void;
|
|
38
40
|
replicateFromCommand(showResult?: boolean): Promise<void>;
|
|
39
|
-
replicateFrom(peerId: string, showNotice?: boolean): Promise<{
|
|
41
|
+
replicateFrom(peerId: string, showNotice?: boolean, skipOrdinaryReplicationPolicy?: boolean): Promise<{
|
|
40
42
|
error: any;
|
|
41
43
|
ok?: undefined;
|
|
42
44
|
} | {
|
|
@@ -67,7 +69,7 @@ export declare class LiveSyncTrysteroReplicator extends LiveSyncAbstractReplicat
|
|
|
67
69
|
makeSureOpened(): Promise<void>;
|
|
68
70
|
openReplication(_setting: RemoteDBSettings, _keepAlive: boolean, showResult: boolean, _ignoreCleanLock: boolean): Promise<void | boolean>;
|
|
69
71
|
tryConnectRemote(_setting: RemoteDBSettings, _showResult?: boolean): Promise<boolean>;
|
|
70
|
-
replicateAllToServer(_setting: RemoteDBSettings, _showingNotice?: boolean
|
|
72
|
+
replicateAllToServer(_setting: RemoteDBSettings, _showingNotice?: boolean): Promise<boolean>;
|
|
71
73
|
selectPeer(settingPeerName: string, r: TrysteroReplicator, logLevel: LOG_LEVEL): Promise<string | false>;
|
|
72
74
|
tryUntilSuccess<T>(func: () => Promise<T | false>, repeat: number, logLevel: LOG_LEVEL): Promise<T | false>;
|
|
73
75
|
replicateAllFromServer(setting: RemoteDBSettings, showingNotice?: boolean): Promise<boolean>;
|