@vrtmrz/livesync-commonlib 0.1.0-rc.2 → 0.1.0-rc.4

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 (39) hide show
  1. package/dist/API/DirectFileManipulatorV2.d.ts +3 -0
  2. package/dist/common/configForDoc.js +8 -4
  3. package/dist/common/messages/combinedMessages.prod.d.ts +9 -0
  4. package/dist/common/messages/combinedMessages.prod.js +9 -0
  5. package/dist/common/messages/def.d.ts +3 -0
  6. package/dist/common/messagesJson/en.json +3 -0
  7. package/dist/common/models/setting.const.defaults.js +1 -0
  8. package/dist/common/models/setting.const.preferred.js +1 -2
  9. package/dist/common/models/setting.lifecycle.d.ts +1 -0
  10. package/dist/common/models/setting.lifecycle.js +9 -1
  11. package/dist/common/models/setting.type.d.ts +8 -3
  12. package/dist/common/models/shared.definition.configNames.js +2 -2
  13. package/dist/common/models/tweak.definition.js +1 -6
  14. package/dist/common/settingConstants.js +4 -4
  15. package/dist/interfaces/Confirm.d.ts +2 -1
  16. package/dist/replication/LiveSyncAbstractReplicator.d.ts +1 -2
  17. package/dist/replication/couchdb/LiveSyncReplicator.d.ts +0 -1
  18. package/dist/replication/couchdb/LiveSyncReplicator.js +0 -3
  19. package/dist/replication/journal/LiveSyncJournalReplicator.d.ts +0 -1
  20. package/dist/replication/journal/LiveSyncJournalReplicator.js +0 -3
  21. package/dist/replication/trystero/LiveSyncTrysteroReplicator.d.ts +1 -2
  22. package/dist/replication/trystero/LiveSyncTrysteroReplicator.js +1 -4
  23. package/dist/serviceFeatures/checkRemoteSize.d.ts +5 -3
  24. package/dist/serviceFeatures/checkRemoteSize.js +51 -11
  25. package/dist/serviceModules/Rebuilder.d.ts +0 -4
  26. package/dist/serviceModules/Rebuilder.js +2 -10
  27. package/dist/services/base/IService.d.ts +1 -5
  28. package/dist/services/base/ReplicationService.d.ts +1 -1
  29. package/dist/services/base/ReplicationService.js +5 -15
  30. package/dist/services/base/SettingService.d.ts +0 -8
  31. package/dist/services/base/SettingService.js +0 -5
  32. package/dist/services/implements/headless/HeadlessAPIService.d.ts +2 -2
  33. package/dist/services/implements/headless/HeadlessAPIService.js +1 -1
  34. package/dist/worker/bgWorker.js +1 -1
  35. package/docs/development.md +8 -0
  36. package/docs/proven-in-use.md +9 -7
  37. package/docs/releasing.md +3 -1
  38. package/docs/settings-lifecycle.md +5 -3
  39. package/package.json +1 -1
@@ -34,7 +34,10 @@ class ReplicationService extends ServiceBase {
34
34
  this.fileProcessing = dependencies.fileProcessingService;
35
35
  this.databaseService = dependencies.databaseService;
36
36
  this._log = createInstanceLogFunction("ReplicationService", dependencies.APIService);
37
- this._unresolvedErrorManager = new UnresolvedErrorManager(dependencies.appLifecycleService, this.context.events);
37
+ this._unresolvedErrorManager = new UnresolvedErrorManager(
38
+ dependencies.appLifecycleService,
39
+ this.context.events
40
+ );
38
41
  }
39
42
  /**
40
43
  * Process a synchronisation result document.
@@ -183,7 +186,7 @@ class ReplicationService extends ServiceBase {
183
186
  }
184
187
  return activeReplicator;
185
188
  }
186
- async replicateAllToRemote(showingNotice = false, sendChunksInBulkDisabled = false) {
189
+ async replicateAllToRemote(showingNotice = false) {
187
190
  if (!this.appLifecycleService.isReady()) return false;
188
191
  if (!await this.onBeforeReplicate(showingNotice)) {
189
192
  this._log(this.context.translate("Replicator.Message.SomeModuleFailed"), LOG_LEVEL_NOTICE);
@@ -194,19 +197,6 @@ class ReplicationService extends ServiceBase {
194
197
  if (!activeReplicator) {
195
198
  return false;
196
199
  }
197
- if (!sendChunksInBulkDisabled) {
198
- if (activeReplicator?.isChunkSendingSupported) {
199
- if (await this.APIService.confirm.askYesNoDialog(
200
- "Do you want to send all chunks before replication?",
201
- {
202
- defaultOption: "No",
203
- timeout: 20
204
- }
205
- ) == "yes") {
206
- await activeReplicator.sendChunks(currentSettings, void 0, true, 0);
207
- }
208
- }
209
- }
210
200
  const ret = await activeReplicator.replicateAllToServer(currentSettings, showingNotice);
211
201
  if (ret) return true;
212
202
  const checkResult = await this.checkConnectionFailure();
@@ -82,16 +82,8 @@ export declare abstract class SettingService<T extends ServiceContext = ServiceC
82
82
  * Suspend extra synchronisation activities, e.g., hidden files sync.
83
83
  */
84
84
  readonly suspendExtraSync: import("../lib/HandlerUtils.js").BooleanMultipleHandlerFunction<() => Promise<boolean>>;
85
- /**
86
- * Suggest enabling optional features to the user.
87
- */
88
- readonly suggestOptionalFeatures: import("../lib/HandlerUtils.js").BooleanMultipleHandlerFunction<(opt: {
89
- enableFetch?: boolean;
90
- enableOverwrite?: boolean;
91
- }) => Promise<boolean>>;
92
85
  /**
93
86
  * Enable an optional feature and save to the settings.
94
- * It may also raised from `handleSuggestOptionalFeatures` if the user agrees.
95
87
  * @param mode The optional feature to enable.
96
88
  */
97
89
  readonly enableOptionalFeature: import("../lib/HandlerUtils.js").BooleanMultipleHandlerFunction<(mode: keyof OPTIONAL_SYNC_FEATURES) => Promise<boolean>>;
@@ -287,13 +287,8 @@ class SettingService extends ServiceBase {
287
287
  * Suspend extra synchronisation activities, e.g., hidden files sync.
288
288
  */
289
289
  suspendExtraSync = handlers().all("suspendExtraSync");
290
- /**
291
- * Suggest enabling optional features to the user.
292
- */
293
- suggestOptionalFeatures = handlers().all("suggestOptionalFeatures");
294
290
  /**
295
291
  * Enable an optional feature and save to the settings.
296
- * It may also raised from `handleSuggestOptionalFeatures` if the user agrees.
297
292
  * @param mode The optional feature to enable.
298
293
  */
299
294
  enableOptionalFeature = handlers().all("enableOptionalFeature");
@@ -2,7 +2,7 @@ import type { ServiceContext } from "../../base/ServiceBase.js";
2
2
  import { InjectableAPIService } from "../injectable/InjectableAPIService.js";
3
3
  import type { FetchHttpHandler } from "@smithy/fetch-http-handler";
4
4
  import type { ICommandCompat } from "../../base/IService.js";
5
- import type { Confirm } from "../../../interfaces/Confirm.js";
5
+ import type { Confirm, ConfirmActionLayout } from "../../../interfaces/Confirm.js";
6
6
  /**
7
7
  * Headless implementation of Confirm that returns sensible defaults instead
8
8
  * of throwing. Dialogs are logged to stderr so the prompts are visible in
@@ -23,7 +23,7 @@ export declare class HeadlessConfirm implements Confirm {
23
23
  timeout?: number;
24
24
  }): Promise<T[number] | false>;
25
25
  askInPopup(key: string, dialogText: string, anchorCallback: (anchor: HTMLAnchorElement) => void, durationMs?: number): void;
26
- confirmWithMessage(title: string, contentMd: string, buttons: string[], defaultAction: (typeof buttons)[number], timeout?: number): Promise<(typeof buttons)[number] | false>;
26
+ confirmWithMessage(title: string, contentMd: string, buttons: string[], defaultAction: (typeof buttons)[number], timeout?: number, _actionLayout?: ConfirmActionLayout): Promise<(typeof buttons)[number] | false>;
27
27
  }
28
28
  export declare class HeadlessAPIService<T extends ServiceContext> extends InjectableAPIService<T> {
29
29
  private _confirmInstance;
@@ -26,7 +26,7 @@ class HeadlessConfirm {
26
26
  askInPopup(key, dialogText, anchorCallback, durationMs) {
27
27
  console.error(`[Headless] Popup (${key}): ${dialogText}`);
28
28
  }
29
- confirmWithMessage(title, contentMd, buttons, defaultAction, timeout) {
29
+ confirmWithMessage(title, contentMd, buttons, defaultAction, timeout, _actionLayout) {
30
30
  console.error(`[Headless] ${title}: ${contentMd} \u2192 ${defaultAction}`);
31
31
  return Promise.resolve(defaultAction);
32
32
  }