@vrtmrz/livesync-commonlib 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/interfaces/StorageAccess.d.ts +8 -2
- package/dist/platform/FilePathIndex.d.ts +110 -0
- package/dist/platform/FilePathIndex.js +146 -0
- package/dist/replication/trystero/LiveSyncTrysteroReplicator.d.ts +3 -3
- package/dist/replication/trystero/P2PAutomationCoordinator.d.ts +1 -1
- package/dist/replication/trystero/P2PReplicationWire.d.ts +1 -1
- package/dist/replication/trystero/TrysteroReplicator/changeRelay.d.ts +133 -0
- package/dist/replication/trystero/TrysteroReplicator/changeRelay.js +176 -0
- package/dist/replication/trystero/TrysteroReplicator/configurationExchange.d.ts +55 -0
- package/dist/replication/trystero/TrysteroReplicator/configurationExchange.js +99 -0
- package/dist/replication/trystero/TrysteroReplicator/configuredTargets.d.ts +83 -0
- package/dist/replication/trystero/TrysteroReplicator/configuredTargets.js +121 -0
- package/dist/replication/trystero/TrysteroReplicator/peerAgreement.d.ts +75 -0
- package/dist/replication/trystero/TrysteroReplicator/peerAgreement.js +131 -0
- package/dist/replication/trystero/TrysteroReplicator/progress.d.ts +57 -0
- package/dist/replication/trystero/TrysteroReplicator/progress.js +84 -0
- package/dist/replication/trystero/TrysteroReplicator/relayControl.d.ts +20 -0
- package/dist/replication/trystero/TrysteroReplicator/relayControl.js +25 -0
- package/dist/replication/trystero/TrysteroReplicator/transfers.d.ts +125 -0
- package/dist/replication/trystero/TrysteroReplicator/transfers.js +278 -0
- package/dist/replication/trystero/TrysteroReplicator.d.ts +65 -483
- package/dist/replication/trystero/TrysteroReplicator.js +240 -673
- package/dist/replication/trystero/TrysteroReplicatorP2PClient.d.ts +19 -6
- package/dist/replication/trystero/TrysteroReplicatorP2PClient.js +29 -25
- package/dist/replication/trystero/TrysteroReplicatorP2PServer/peerAdmission.d.ts +66 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PServer/peerAdmission.js +142 -0
- package/dist/replication/trystero/TrysteroReplicatorP2PServer.d.ts +19 -16
- package/dist/replication/trystero/TrysteroReplicatorP2PServer.js +33 -93
- package/dist/replication/trystero/p2pReplicationDiagnostics.d.ts +1 -1
- package/dist/replication/trystero/p2pReplicationProgress.d.ts +2 -11
- package/dist/replication/trystero/replicationTypes.d.ts +88 -0
- package/dist/replication/trystero/replicationTypes.js +0 -0
- package/dist/replication/trystero/rpcSessionProvider.d.ts +13 -0
- package/dist/replication/trystero/rpcSessionProvider.js +0 -0
- package/dist/rpc/RpcRoom/pendingInvocations.d.ts +141 -0
- package/dist/rpc/RpcRoom/pendingInvocations.js +225 -0
- package/dist/rpc/RpcRoom.d.ts +9 -4
- package/dist/rpc/RpcRoom.js +73 -118
- package/dist/rpc/RpcSession.d.ts +6 -0
- package/dist/rpc/RpcSession.js +11 -0
- package/dist/rpc/types.d.ts +2 -0
- package/dist/serviceFeatures/targetFilter.d.ts +1 -1
- package/dist/serviceFeatures/targetFilter.js +8 -38
- package/dist/serviceModules/FileAccessBase.d.ts +4 -0
- package/dist/serviceModules/FileAccessBase.js +10 -0
- package/dist/serviceModules/Rebuilder.js +1 -1
- package/dist/serviceModules/ServiceFileAccessBase/fileNames.d.ts +54 -0
- package/dist/serviceModules/ServiceFileAccessBase/fileNames.js +57 -0
- package/dist/serviceModules/ServiceFileAccessBase.d.ts +5 -1
- package/dist/serviceModules/ServiceFileAccessBase.js +18 -3
- package/dist/serviceModules/adapters/IFileSystemAdapter.d.ts +3 -0
- package/dist/storage.d.ts +2 -0
- package/dist/storage.js +2 -0
- package/docs/development.md +103 -0
- package/docs/p2p-transport-lifecycle.md +24 -0
- package/docs/platform-storage.md +22 -0
- package/docs/releasing.md +6 -0
- package/docs/settings-lifecycle.md +4 -2
- package/package.json +1 -1
|
@@ -1,91 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { P2PReplicationProgress, P2PReplicationReport, P2PReplicationResult, P2PConfiguredReplicationResult, ProgressAcknowledgement } from "./replicationTypes.js";
|
|
2
|
+
export type { P2PReplicationDirectionProgress, P2PReplicationProgress, P2PReplicationReport, P2PReplicationResult, P2PConfiguredTargetResult, P2PConfiguredReplicationResult, } from "./replicationTypes.js";
|
|
3
|
+
import { type PeerTweakSettings } from "./TrysteroReplicator/peerAgreement.js";
|
|
4
|
+
import { type EntryDoc, type ObsidianLiveSyncSettings } from "../../common/types.js";
|
|
3
5
|
import { type LOG_LEVEL } from "octagonal-wheels/common/logger";
|
|
4
|
-
import { type ProgressInfo
|
|
6
|
+
import { type ProgressInfo } from "../../pouchdb/ReplicatorShim.js";
|
|
5
7
|
import type { Confirm } from "../../interfaces/Confirm.js";
|
|
6
8
|
import { type Advertisement, type ReplicatorHostEnv } from "./types.js";
|
|
7
9
|
import { EVENT_P2P_REPLICATOR_PROGRESS, EVENT_P2P_REPLICATOR_STATUS, P2PHost } from "./TrysteroReplicatorP2PServer.js";
|
|
10
|
+
import { type RelayControl } from "./TrysteroReplicator/relayControl.js";
|
|
8
11
|
import type { P2PFiniteOperationOwner } from "./P2PRoomSession.js";
|
|
9
|
-
import { type P2PReplicationWireResult } from "./P2PReplicationWire.js";
|
|
12
|
+
import { toP2PWireError, type P2PReplicationWireResult } from "./P2PReplicationWire.js";
|
|
10
13
|
export type P2PReplicatorStatus = {
|
|
11
14
|
isBroadcasting: boolean;
|
|
12
15
|
replicatingTo: string[];
|
|
13
16
|
replicatingFrom: string[];
|
|
14
17
|
watchingPeers: string[];
|
|
15
18
|
};
|
|
16
|
-
/** Sequence progress retained for compatibility, with independently observed work counts. */
|
|
17
|
-
export type P2PReplicationDirectionProgress = {
|
|
18
|
-
max: number;
|
|
19
|
-
current: number;
|
|
20
|
-
isActive: boolean;
|
|
21
|
-
statistics?: ReplicationStatistics;
|
|
22
|
-
};
|
|
23
|
-
export type P2PReplicationProgress = {
|
|
24
|
-
peerId: string;
|
|
25
|
-
peerName: string;
|
|
26
|
-
fetching: P2PReplicationDirectionProgress;
|
|
27
|
-
sending: P2PReplicationDirectionProgress;
|
|
28
|
-
};
|
|
29
|
-
export type P2PReplicationReport = {
|
|
30
|
-
peerId: string;
|
|
31
|
-
peerName: string;
|
|
32
|
-
} & ({
|
|
33
|
-
fetching: P2PReplicationDirectionProgress;
|
|
34
|
-
} | {
|
|
35
|
-
sending: P2PReplicationDirectionProgress;
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
* In-process outcome of one P2P replication request.
|
|
39
|
-
*
|
|
40
|
-
* The failed variant deliberately retains an `Error`-compatible value for
|
|
41
|
-
* local callers. RPC handlers must convert it to `P2PReplicationWireResult`,
|
|
42
|
-
* because native `Error` properties do not survive JSON serialisation.
|
|
43
|
-
*/
|
|
44
|
-
export type P2PReplicationResult = {
|
|
45
|
-
readonly status: "completed";
|
|
46
|
-
readonly ok: true;
|
|
47
|
-
readonly error?: never;
|
|
48
|
-
} | {
|
|
49
|
-
readonly status: "cancelled";
|
|
50
|
-
readonly ok?: false;
|
|
51
|
-
readonly error?: never;
|
|
52
|
-
} | {
|
|
53
|
-
readonly status: "failed";
|
|
54
|
-
readonly ok?: false;
|
|
55
|
-
readonly error: unknown;
|
|
56
|
-
};
|
|
57
|
-
export type P2PConfiguredTargetResult = {
|
|
58
|
-
readonly name: string;
|
|
59
|
-
readonly peerId?: string;
|
|
60
|
-
} & ({
|
|
61
|
-
readonly status: "completed";
|
|
62
|
-
} | {
|
|
63
|
-
readonly status: "cancelled";
|
|
64
|
-
} | {
|
|
65
|
-
readonly status: "missing";
|
|
66
|
-
} | {
|
|
67
|
-
readonly status: "rejected";
|
|
68
|
-
} | {
|
|
69
|
-
readonly status: "undecided";
|
|
70
|
-
} | {
|
|
71
|
-
readonly status: "failed";
|
|
72
|
-
readonly error: unknown;
|
|
73
|
-
});
|
|
74
|
-
/** Explicit result of configured, unattended P2P target synchronisation. */
|
|
75
|
-
export type P2PConfiguredReplicationResult = {
|
|
76
|
-
readonly status: "completed";
|
|
77
|
-
readonly targets: readonly P2PConfiguredTargetResult[];
|
|
78
|
-
} | {
|
|
79
|
-
readonly status: "cancelled";
|
|
80
|
-
readonly targets: readonly P2PConfiguredTargetResult[];
|
|
81
|
-
} | {
|
|
82
|
-
readonly status: "blocked";
|
|
83
|
-
readonly reason: "no-targets";
|
|
84
|
-
readonly targets: readonly [];
|
|
85
|
-
} | {
|
|
86
|
-
readonly status: "partial";
|
|
87
|
-
readonly targets: readonly P2PConfiguredTargetResult[];
|
|
88
|
-
};
|
|
89
19
|
declare global {
|
|
90
20
|
interface LSEvents {
|
|
91
21
|
[EVENT_P2P_REPLICATOR_STATUS]: P2PReplicatorStatus;
|
|
@@ -100,18 +30,36 @@ export type AllReplicationClientStatus = {
|
|
|
100
30
|
stats: P2PReplicationProgress;
|
|
101
31
|
};
|
|
102
32
|
};
|
|
33
|
+
/** Optional transport controls preserve the existing finite-operation owner argument. */
|
|
34
|
+
export interface TrysteroReplicatorOptions {
|
|
35
|
+
relayControl?: RelayControl;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Connect room-facing commands and replication policy to the existing host.
|
|
39
|
+
*
|
|
40
|
+
* Change relay, agreement, configuration, progress, target selection, and transfers provide narrower
|
|
41
|
+
* operations. This facade retains public dispatch, session integration, and
|
|
42
|
+
* lifecycle coordination so those owners are not duplicated.
|
|
43
|
+
*/
|
|
103
44
|
export declare class TrysteroReplicator {
|
|
104
45
|
_env: ReplicatorHostEnv;
|
|
105
46
|
private readonly finiteOperationOwner?;
|
|
47
|
+
private readonly relayControl;
|
|
106
48
|
private disposed;
|
|
107
|
-
private readonly acknowledgedAttempts;
|
|
108
49
|
private readonly fallbackAutomationCoordinator;
|
|
109
50
|
server?: P2PHost;
|
|
51
|
+
private readonly replicationProgress;
|
|
52
|
+
private readonly transfers;
|
|
53
|
+
private readonly configuredTargets;
|
|
54
|
+
private readonly peerAgreement;
|
|
55
|
+
private readonly configurationExchange;
|
|
56
|
+
private readonly changeRelay;
|
|
110
57
|
replicationStatus(): {};
|
|
111
58
|
private reportDiagnostic;
|
|
112
|
-
|
|
59
|
+
/** Immutable room settings used for transport binding and shared configuration. */
|
|
60
|
+
get settings(): import("../../common/types.js").P2PSyncSetting;
|
|
113
61
|
/** Latest room-local policy settings supplied by the owning host. */
|
|
114
|
-
get currentSettings(): P2PSyncSetting;
|
|
62
|
+
get currentSettings(): import("../../common/types.js").P2PSyncSetting;
|
|
115
63
|
get db(): PouchDB.Database<EntryDoc>;
|
|
116
64
|
get deviceName(): string;
|
|
117
65
|
get platform(): string;
|
|
@@ -120,7 +68,8 @@ export declare class TrysteroReplicator {
|
|
|
120
68
|
private get automationCoordinator();
|
|
121
69
|
private runFiniteReplicationActivity;
|
|
122
70
|
private canStartOrdinaryReplication;
|
|
123
|
-
constructor(env: ReplicatorHostEnv, server?: P2PHost, finiteOperationOwner?: P2PFiniteOperationOwner);
|
|
71
|
+
constructor(env: ReplicatorHostEnv, server?: P2PHost, finiteOperationOwner?: P2PFiniteOperationOwner, options?: TrysteroReplicatorOptions);
|
|
72
|
+
/** Borrow the session owner's cancellation scope; legacy direct hosts use the caller signal. */
|
|
124
73
|
private runSessionFiniteOperation;
|
|
125
74
|
close(): Promise<void>;
|
|
126
75
|
/** Close the transport and release resources owned for this object's lifetime. */
|
|
@@ -135,443 +84,76 @@ export declare class TrysteroReplicator {
|
|
|
135
84
|
_onSetup: boolean;
|
|
136
85
|
setOnSetup(): void;
|
|
137
86
|
clearOnSetup(): void;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
idDerivationVersion: 0 | 1;
|
|
141
|
-
idDerivationProof: string;
|
|
142
|
-
liveSync?: boolean;
|
|
143
|
-
batchSaveInLiveSync?: boolean;
|
|
144
|
-
syncOnSave?: boolean;
|
|
145
|
-
syncOnStart?: boolean;
|
|
146
|
-
strictContentCheckOnStartup?: boolean;
|
|
147
|
-
syncOnFileOpen?: boolean;
|
|
148
|
-
syncOnEditorSave?: boolean;
|
|
149
|
-
keepReplicationActiveInBackground?: boolean;
|
|
150
|
-
allowSleepDuringSynchronisation?: boolean;
|
|
151
|
-
allowSleepDuringSynchronisationOnDesktop?: boolean;
|
|
152
|
-
syncMinimumInterval?: number;
|
|
153
|
-
showVerboseLog?: boolean;
|
|
154
|
-
lessInformationInLog?: boolean;
|
|
155
|
-
showLongerLogInsideEditor?: boolean;
|
|
156
|
-
showStatusOnEditor?: boolean;
|
|
157
|
-
showStatusOnStatusbar?: boolean;
|
|
158
|
-
showOnlyIconsOnEditor?: boolean;
|
|
159
|
-
hideFileWarningNotice?: boolean;
|
|
160
|
-
networkWarningStyle?: "" | "icon" | "hidden";
|
|
161
|
-
displayLanguage?: import("../../common/models/setting.type.js").I18N_LANGS;
|
|
162
|
-
trashInsteadDelete?: boolean;
|
|
163
|
-
doNotDeleteFolder?: boolean;
|
|
164
|
-
batchSave?: boolean;
|
|
165
|
-
batchSaveMinimumDelay?: number;
|
|
166
|
-
batchSaveMaximumDelay?: number;
|
|
167
|
-
syncMaxSizeInMB?: number;
|
|
168
|
-
useIgnoreFiles?: boolean;
|
|
169
|
-
ignoreFiles?: string;
|
|
170
|
-
processSizeMismatchedFiles?: boolean;
|
|
171
|
-
syncOnlyRegEx?: import("../../common/types.js").CustomRegExpSourceList<"|[]|">;
|
|
172
|
-
syncIgnoreRegEx?: import("../../common/types.js").CustomRegExpSourceList<"|[]|">;
|
|
173
|
-
syncAfterMerge?: boolean;
|
|
174
|
-
resolveConflictsByNewerFile?: boolean;
|
|
175
|
-
writeDocumentsIfConflicted?: boolean;
|
|
176
|
-
disableMarkdownAutoMerge?: boolean;
|
|
177
|
-
configPassphraseStore?: import("../../common/types.js").ConfigPassphraseStore;
|
|
178
|
-
encryptedPassphrase?: string;
|
|
179
|
-
encryptedIdDerivationKey?: string;
|
|
180
|
-
encryptedCouchDBConnection?: string;
|
|
181
|
-
periodicReplication?: boolean;
|
|
182
|
-
periodicReplicationInterval?: number;
|
|
183
|
-
syncInternalFiles?: boolean;
|
|
184
|
-
syncInternalFilesBeforeReplication?: boolean;
|
|
185
|
-
syncInternalFilesInterval?: number;
|
|
186
|
-
syncInternalFilesIgnorePatterns?: import("../../common/types.js").CustomRegExpSourceList<",">;
|
|
187
|
-
syncInternalFilesTargetPatterns?: import("../../common/types.js").CustomRegExpSourceList<",">;
|
|
188
|
-
watchInternalFileChanges?: boolean;
|
|
189
|
-
suppressNotifyHiddenFilesChange?: boolean;
|
|
190
|
-
syncInternalFileOverwritePatterns?: import("../../common/types.js").CustomRegExpSourceList<",">;
|
|
191
|
-
usePluginSync?: boolean;
|
|
192
|
-
usePluginSettings?: boolean;
|
|
193
|
-
showOwnPlugins?: boolean;
|
|
194
|
-
autoSweepPlugins?: boolean;
|
|
195
|
-
autoSweepPluginsPeriodic?: boolean;
|
|
196
|
-
notifyPluginOrSettingUpdated?: boolean;
|
|
197
|
-
deviceAndVaultName?: string;
|
|
198
|
-
usePluginSyncV2?: boolean;
|
|
199
|
-
usePluginEtc?: boolean;
|
|
200
|
-
pluginSyncExtendedSetting?: Record<import("../../common/types.js").PluginSyncSettingEntry["key"], import("../../common/types.js").PluginSyncSettingEntry>;
|
|
201
|
-
useAdvancedMode?: boolean;
|
|
202
|
-
usePowerUserMode?: boolean;
|
|
203
|
-
useEdgeCaseMode?: boolean;
|
|
204
|
-
notifyThresholdOfRemoteStorageSize?: number;
|
|
205
|
-
disableWorkerForGeneratingChunks?: boolean;
|
|
206
|
-
processSmallFilesInUIThread?: boolean;
|
|
207
|
-
savingDelay?: number;
|
|
208
|
-
gcDelay?: number;
|
|
209
|
-
skipOlderFilesOnSync?: boolean;
|
|
210
|
-
useIndexedDBAdapter?: boolean;
|
|
211
|
-
enableDebugTools?: boolean;
|
|
212
|
-
writeLogToTheFile?: boolean;
|
|
213
|
-
settingSyncFile?: string;
|
|
214
|
-
writeCredentialsForSettingSync?: boolean;
|
|
215
|
-
notifyAllSettingSyncFile?: boolean;
|
|
216
|
-
suspendFileWatching?: boolean;
|
|
217
|
-
suspendParseReplicationResult?: boolean;
|
|
218
|
-
doNotSuspendOnFetching?: boolean;
|
|
219
|
-
maxMTimeForReflectEvents?: number;
|
|
220
|
-
versionUpFlash?: string;
|
|
221
|
-
settingVersion?: number;
|
|
222
|
-
isConfigured?: boolean;
|
|
223
|
-
lastReadUpdates?: number;
|
|
224
|
-
doctorProcessedVersion?: string;
|
|
225
|
-
remoteConfigurations?: Record<string, import("../../remoteConfigurations.js").RemoteConfiguration>;
|
|
226
|
-
activeConfigurationId?: string;
|
|
227
|
-
P2P_ActiveRemoteConfigurationId?: string;
|
|
228
|
-
couchDB_URI?: string;
|
|
229
|
-
couchDB_USER?: string;
|
|
230
|
-
couchDB_PASSWORD?: string;
|
|
231
|
-
couchDB_DBNAME?: string;
|
|
232
|
-
couchDB_CustomHeaders?: string;
|
|
233
|
-
useJWT?: boolean;
|
|
234
|
-
jwtAlgorithm?: import("../../common/models/auth.type.js").JWTAlgorithm;
|
|
235
|
-
jwtKey?: string;
|
|
236
|
-
jwtKid?: string;
|
|
237
|
-
jwtSub?: string;
|
|
238
|
-
jwtExpDuration?: number;
|
|
239
|
-
useRequestAPI?: boolean;
|
|
240
|
-
useCouchDBCacheControlHeadersOnly?: boolean;
|
|
241
|
-
accessKey?: string;
|
|
242
|
-
secretKey?: string;
|
|
243
|
-
bucket?: string;
|
|
244
|
-
region?: string;
|
|
245
|
-
endpoint?: string;
|
|
246
|
-
useCustomRequestHandler?: boolean;
|
|
247
|
-
bucketCustomHeaders?: string;
|
|
248
|
-
bucketPrefix?: string;
|
|
249
|
-
forcePathStyle?: boolean;
|
|
250
|
-
remoteType?: import("../../common/types.js").RemoteType;
|
|
251
|
-
encrypt?: boolean;
|
|
252
|
-
acceptUnencryptedContent?: boolean;
|
|
253
|
-
passphrase?: string;
|
|
254
|
-
idDerivationKey?: string;
|
|
255
|
-
usePathObfuscation?: boolean;
|
|
256
|
-
encryptInternalMetadata?: boolean;
|
|
257
|
-
E2EEAlgorithm?: import("../../common/types.js").E2EEAlgorithm;
|
|
258
|
-
hashAlg?: import("../../common/types.js").HashAlgorithm;
|
|
259
|
-
minimumChunkSize?: number;
|
|
260
|
-
customChunkSize?: number;
|
|
261
|
-
longLineThreshold?: number;
|
|
262
|
-
useSegmenter?: boolean;
|
|
263
|
-
enableChunkSplitterV2?: boolean;
|
|
264
|
-
doNotUseFixedRevisionForChunks?: boolean;
|
|
265
|
-
chunkSplitterVersion?: import("../../common/types.js").ChunkSplitterVersion;
|
|
266
|
-
useEden?: boolean;
|
|
267
|
-
maxChunksInEden?: number;
|
|
268
|
-
maxTotalLengthInEden?: number;
|
|
269
|
-
maxAgeInEden?: number;
|
|
270
|
-
tweakModified?: number | undefined;
|
|
271
|
-
checkIntegrityOnSave?: boolean;
|
|
272
|
-
useHistory?: boolean;
|
|
273
|
-
disableRequestURI?: boolean;
|
|
274
|
-
sendChunksBulk?: boolean;
|
|
275
|
-
sendChunksBulkMaxSize?: number;
|
|
276
|
-
useDynamicIterationCount?: boolean;
|
|
277
|
-
doNotPaceReplication?: boolean;
|
|
278
|
-
readChunksOnline?: boolean;
|
|
279
|
-
useOnlyLocalChunk?: boolean;
|
|
280
|
-
concurrencyOfReadChunksOnline?: number;
|
|
281
|
-
minimumIntervalOfReadChunksOnline?: number;
|
|
282
|
-
enableCompression?: boolean;
|
|
283
|
-
batch_size?: number;
|
|
284
|
-
batches_limit?: number;
|
|
285
|
-
ignoreVersionCheck?: boolean;
|
|
286
|
-
disableCheckingConfigMismatch?: boolean;
|
|
287
|
-
autoAcceptCompatibleTweak?: boolean | undefined;
|
|
288
|
-
hashCacheMaxCount?: number;
|
|
289
|
-
hashCacheMaxAmount?: number;
|
|
290
|
-
permitEmptyPassphrase?: boolean;
|
|
291
|
-
handleFilenameCaseSensitive?: boolean;
|
|
292
|
-
checkConflictOnlyOnOpen?: boolean;
|
|
293
|
-
showMergeDialogOnlyOnActive?: boolean;
|
|
294
|
-
additionalSuffixOfDatabaseName?: string | undefined;
|
|
295
|
-
useTimeouts?: boolean;
|
|
296
|
-
deleteMetadataOfDeletedFiles?: boolean;
|
|
297
|
-
automaticallyDeleteMetadataOfDeletedFiles?: number;
|
|
298
|
-
P2P_AutoAccepting?: import("../../common/types.js").AutoAccepting;
|
|
299
|
-
P2P_AutoSyncPeers?: string;
|
|
300
|
-
P2P_AutoWatchPeers?: string;
|
|
301
|
-
P2P_SyncOnReplication?: string;
|
|
302
|
-
P2P_RebuildFrom?: string;
|
|
303
|
-
P2P_AutoAcceptingPeers?: string;
|
|
304
|
-
P2P_AutoDenyingPeers?: string;
|
|
305
|
-
P2P_IsHeadless?: boolean;
|
|
306
|
-
P2P_iceServers?: readonly RTCIceServer[];
|
|
307
|
-
P2P_iceServersExpiresAt?: number;
|
|
308
|
-
P2P_Enabled?: boolean;
|
|
309
|
-
P2P_relays?: string;
|
|
310
|
-
P2P_roomID?: string;
|
|
311
|
-
P2P_passphrase?: string;
|
|
312
|
-
P2P_AppID?: string;
|
|
313
|
-
P2P_AutoStart?: boolean;
|
|
314
|
-
P2P_AutoBroadcast?: boolean;
|
|
315
|
-
P2P_DevicePeerName?: string;
|
|
316
|
-
P2P_turnServers?: string;
|
|
317
|
-
P2P_turnUsername?: string;
|
|
318
|
-
P2P_turnCredential?: string;
|
|
319
|
-
P2P_managedType?: string;
|
|
320
|
-
P2P_managedId?: string;
|
|
321
|
-
P2P_managedToken?: string;
|
|
322
|
-
P2P_maxWirePayloadBytes?: number;
|
|
323
|
-
P2P_connectionPath?: import("../../common/types.js").P2PConnectionPath;
|
|
324
|
-
P2P_useDiagRTC?: boolean;
|
|
325
|
-
}>;
|
|
87
|
+
/** Build challenge-bound compatibility data without exposing local ID keys. */
|
|
88
|
+
getTweakSettings(fromPeerId: string): Promise<PeerTweakSettings>;
|
|
326
89
|
private handleSynchronisationRequest;
|
|
90
|
+
/**
|
|
91
|
+
* Build the existing wire command object against this facade.
|
|
92
|
+
* Public method dispatch stays dynamic for host overrides; RpcRoom owns
|
|
93
|
+
* serialisation, request context, and call-versus-notification responses.
|
|
94
|
+
*/
|
|
327
95
|
getCommands(): {
|
|
328
96
|
reqSync: (fromPeerId: string) => Promise<P2PReplicationWireResult>;
|
|
329
97
|
"!reqAuth": (fromPeerId: string) => Promise<boolean>;
|
|
330
|
-
getTweakSettings: (fromPeerId: string) => Promise<
|
|
331
|
-
pathNormalizationVersion: import("../../settings.js").PathNormalizationVersion;
|
|
332
|
-
idDerivationVersion: 0 | 1;
|
|
333
|
-
idDerivationProof: string;
|
|
334
|
-
liveSync?: boolean;
|
|
335
|
-
batchSaveInLiveSync?: boolean;
|
|
336
|
-
syncOnSave?: boolean;
|
|
337
|
-
syncOnStart?: boolean;
|
|
338
|
-
strictContentCheckOnStartup?: boolean;
|
|
339
|
-
syncOnFileOpen?: boolean;
|
|
340
|
-
syncOnEditorSave?: boolean;
|
|
341
|
-
keepReplicationActiveInBackground?: boolean;
|
|
342
|
-
allowSleepDuringSynchronisation?: boolean;
|
|
343
|
-
allowSleepDuringSynchronisationOnDesktop?: boolean;
|
|
344
|
-
syncMinimumInterval?: number;
|
|
345
|
-
showVerboseLog?: boolean;
|
|
346
|
-
lessInformationInLog?: boolean;
|
|
347
|
-
showLongerLogInsideEditor?: boolean;
|
|
348
|
-
showStatusOnEditor?: boolean;
|
|
349
|
-
showStatusOnStatusbar?: boolean;
|
|
350
|
-
showOnlyIconsOnEditor?: boolean;
|
|
351
|
-
hideFileWarningNotice?: boolean;
|
|
352
|
-
networkWarningStyle?: "" | "icon" | "hidden";
|
|
353
|
-
displayLanguage?: import("../../common/models/setting.type.js").I18N_LANGS;
|
|
354
|
-
trashInsteadDelete?: boolean;
|
|
355
|
-
doNotDeleteFolder?: boolean;
|
|
356
|
-
batchSave?: boolean;
|
|
357
|
-
batchSaveMinimumDelay?: number;
|
|
358
|
-
batchSaveMaximumDelay?: number;
|
|
359
|
-
syncMaxSizeInMB?: number;
|
|
360
|
-
useIgnoreFiles?: boolean;
|
|
361
|
-
ignoreFiles?: string;
|
|
362
|
-
processSizeMismatchedFiles?: boolean;
|
|
363
|
-
syncOnlyRegEx?: import("../../common/types.js").CustomRegExpSourceList<"|[]|">;
|
|
364
|
-
syncIgnoreRegEx?: import("../../common/types.js").CustomRegExpSourceList<"|[]|">;
|
|
365
|
-
syncAfterMerge?: boolean;
|
|
366
|
-
resolveConflictsByNewerFile?: boolean;
|
|
367
|
-
writeDocumentsIfConflicted?: boolean;
|
|
368
|
-
disableMarkdownAutoMerge?: boolean;
|
|
369
|
-
configPassphraseStore?: import("../../common/types.js").ConfigPassphraseStore;
|
|
370
|
-
encryptedPassphrase?: string;
|
|
371
|
-
encryptedIdDerivationKey?: string;
|
|
372
|
-
encryptedCouchDBConnection?: string;
|
|
373
|
-
periodicReplication?: boolean;
|
|
374
|
-
periodicReplicationInterval?: number;
|
|
375
|
-
syncInternalFiles?: boolean;
|
|
376
|
-
syncInternalFilesBeforeReplication?: boolean;
|
|
377
|
-
syncInternalFilesInterval?: number;
|
|
378
|
-
syncInternalFilesIgnorePatterns?: import("../../common/types.js").CustomRegExpSourceList<",">;
|
|
379
|
-
syncInternalFilesTargetPatterns?: import("../../common/types.js").CustomRegExpSourceList<",">;
|
|
380
|
-
watchInternalFileChanges?: boolean;
|
|
381
|
-
suppressNotifyHiddenFilesChange?: boolean;
|
|
382
|
-
syncInternalFileOverwritePatterns?: import("../../common/types.js").CustomRegExpSourceList<",">;
|
|
383
|
-
usePluginSync?: boolean;
|
|
384
|
-
usePluginSettings?: boolean;
|
|
385
|
-
showOwnPlugins?: boolean;
|
|
386
|
-
autoSweepPlugins?: boolean;
|
|
387
|
-
autoSweepPluginsPeriodic?: boolean;
|
|
388
|
-
notifyPluginOrSettingUpdated?: boolean;
|
|
389
|
-
deviceAndVaultName?: string;
|
|
390
|
-
usePluginSyncV2?: boolean;
|
|
391
|
-
usePluginEtc?: boolean;
|
|
392
|
-
pluginSyncExtendedSetting?: Record<import("../../common/types.js").PluginSyncSettingEntry["key"], import("../../common/types.js").PluginSyncSettingEntry>;
|
|
393
|
-
useAdvancedMode?: boolean;
|
|
394
|
-
usePowerUserMode?: boolean;
|
|
395
|
-
useEdgeCaseMode?: boolean;
|
|
396
|
-
notifyThresholdOfRemoteStorageSize?: number;
|
|
397
|
-
disableWorkerForGeneratingChunks?: boolean;
|
|
398
|
-
processSmallFilesInUIThread?: boolean;
|
|
399
|
-
savingDelay?: number;
|
|
400
|
-
gcDelay?: number;
|
|
401
|
-
skipOlderFilesOnSync?: boolean;
|
|
402
|
-
useIndexedDBAdapter?: boolean;
|
|
403
|
-
enableDebugTools?: boolean;
|
|
404
|
-
writeLogToTheFile?: boolean;
|
|
405
|
-
settingSyncFile?: string;
|
|
406
|
-
writeCredentialsForSettingSync?: boolean;
|
|
407
|
-
notifyAllSettingSyncFile?: boolean;
|
|
408
|
-
suspendFileWatching?: boolean;
|
|
409
|
-
suspendParseReplicationResult?: boolean;
|
|
410
|
-
doNotSuspendOnFetching?: boolean;
|
|
411
|
-
maxMTimeForReflectEvents?: number;
|
|
412
|
-
versionUpFlash?: string;
|
|
413
|
-
settingVersion?: number;
|
|
414
|
-
isConfigured?: boolean;
|
|
415
|
-
lastReadUpdates?: number;
|
|
416
|
-
doctorProcessedVersion?: string;
|
|
417
|
-
remoteConfigurations?: Record<string, import("../../remoteConfigurations.js").RemoteConfiguration>;
|
|
418
|
-
activeConfigurationId?: string;
|
|
419
|
-
P2P_ActiveRemoteConfigurationId?: string;
|
|
420
|
-
couchDB_URI?: string;
|
|
421
|
-
couchDB_USER?: string;
|
|
422
|
-
couchDB_PASSWORD?: string;
|
|
423
|
-
couchDB_DBNAME?: string;
|
|
424
|
-
couchDB_CustomHeaders?: string;
|
|
425
|
-
useJWT?: boolean;
|
|
426
|
-
jwtAlgorithm?: import("../../common/models/auth.type.js").JWTAlgorithm;
|
|
427
|
-
jwtKey?: string;
|
|
428
|
-
jwtKid?: string;
|
|
429
|
-
jwtSub?: string;
|
|
430
|
-
jwtExpDuration?: number;
|
|
431
|
-
useRequestAPI?: boolean;
|
|
432
|
-
useCouchDBCacheControlHeadersOnly?: boolean;
|
|
433
|
-
accessKey?: string;
|
|
434
|
-
secretKey?: string;
|
|
435
|
-
bucket?: string;
|
|
436
|
-
region?: string;
|
|
437
|
-
endpoint?: string;
|
|
438
|
-
useCustomRequestHandler?: boolean;
|
|
439
|
-
bucketCustomHeaders?: string;
|
|
440
|
-
bucketPrefix?: string;
|
|
441
|
-
forcePathStyle?: boolean;
|
|
442
|
-
remoteType?: import("../../common/types.js").RemoteType;
|
|
443
|
-
encrypt?: boolean;
|
|
444
|
-
acceptUnencryptedContent?: boolean;
|
|
445
|
-
passphrase?: string;
|
|
446
|
-
idDerivationKey?: string;
|
|
447
|
-
usePathObfuscation?: boolean;
|
|
448
|
-
encryptInternalMetadata?: boolean;
|
|
449
|
-
E2EEAlgorithm?: import("../../common/types.js").E2EEAlgorithm;
|
|
450
|
-
hashAlg?: import("../../common/types.js").HashAlgorithm;
|
|
451
|
-
minimumChunkSize?: number;
|
|
452
|
-
customChunkSize?: number;
|
|
453
|
-
longLineThreshold?: number;
|
|
454
|
-
useSegmenter?: boolean;
|
|
455
|
-
enableChunkSplitterV2?: boolean;
|
|
456
|
-
doNotUseFixedRevisionForChunks?: boolean;
|
|
457
|
-
chunkSplitterVersion?: import("../../common/types.js").ChunkSplitterVersion;
|
|
458
|
-
useEden?: boolean;
|
|
459
|
-
maxChunksInEden?: number;
|
|
460
|
-
maxTotalLengthInEden?: number;
|
|
461
|
-
maxAgeInEden?: number;
|
|
462
|
-
tweakModified?: number | undefined;
|
|
463
|
-
checkIntegrityOnSave?: boolean;
|
|
464
|
-
useHistory?: boolean;
|
|
465
|
-
disableRequestURI?: boolean;
|
|
466
|
-
sendChunksBulk?: boolean;
|
|
467
|
-
sendChunksBulkMaxSize?: number;
|
|
468
|
-
useDynamicIterationCount?: boolean;
|
|
469
|
-
doNotPaceReplication?: boolean;
|
|
470
|
-
readChunksOnline?: boolean;
|
|
471
|
-
useOnlyLocalChunk?: boolean;
|
|
472
|
-
concurrencyOfReadChunksOnline?: number;
|
|
473
|
-
minimumIntervalOfReadChunksOnline?: number;
|
|
474
|
-
enableCompression?: boolean;
|
|
475
|
-
batch_size?: number;
|
|
476
|
-
batches_limit?: number;
|
|
477
|
-
ignoreVersionCheck?: boolean;
|
|
478
|
-
disableCheckingConfigMismatch?: boolean;
|
|
479
|
-
autoAcceptCompatibleTweak?: boolean | undefined;
|
|
480
|
-
hashCacheMaxCount?: number;
|
|
481
|
-
hashCacheMaxAmount?: number;
|
|
482
|
-
permitEmptyPassphrase?: boolean;
|
|
483
|
-
handleFilenameCaseSensitive?: boolean;
|
|
484
|
-
checkConflictOnlyOnOpen?: boolean;
|
|
485
|
-
showMergeDialogOnlyOnActive?: boolean;
|
|
486
|
-
additionalSuffixOfDatabaseName?: string | undefined;
|
|
487
|
-
useTimeouts?: boolean;
|
|
488
|
-
deleteMetadataOfDeletedFiles?: boolean;
|
|
489
|
-
automaticallyDeleteMetadataOfDeletedFiles?: number;
|
|
490
|
-
P2P_AutoAccepting?: import("../../common/types.js").AutoAccepting;
|
|
491
|
-
P2P_AutoSyncPeers?: string;
|
|
492
|
-
P2P_AutoWatchPeers?: string;
|
|
493
|
-
P2P_SyncOnReplication?: string;
|
|
494
|
-
P2P_RebuildFrom?: string;
|
|
495
|
-
P2P_AutoAcceptingPeers?: string;
|
|
496
|
-
P2P_AutoDenyingPeers?: string;
|
|
497
|
-
P2P_IsHeadless?: boolean;
|
|
498
|
-
P2P_iceServers?: readonly RTCIceServer[];
|
|
499
|
-
P2P_iceServersExpiresAt?: number;
|
|
500
|
-
P2P_Enabled?: boolean;
|
|
501
|
-
P2P_relays?: string;
|
|
502
|
-
P2P_roomID?: string;
|
|
503
|
-
P2P_passphrase?: string;
|
|
504
|
-
P2P_AppID?: string;
|
|
505
|
-
P2P_AutoStart?: boolean;
|
|
506
|
-
P2P_AutoBroadcast?: boolean;
|
|
507
|
-
P2P_DevicePeerName?: string;
|
|
508
|
-
P2P_turnServers?: string;
|
|
509
|
-
P2P_turnUsername?: string;
|
|
510
|
-
P2P_turnCredential?: string;
|
|
511
|
-
P2P_managedType?: string;
|
|
512
|
-
P2P_managedId?: string;
|
|
513
|
-
P2P_managedToken?: string;
|
|
514
|
-
P2P_maxWirePayloadBytes?: number;
|
|
515
|
-
P2P_connectionPath?: import("../../common/types.js").P2PConnectionPath;
|
|
516
|
-
P2P_useDiagRTC?: boolean;
|
|
517
|
-
}>;
|
|
98
|
+
getTweakSettings: (fromPeerId: string) => Promise<PeerTweakSettings>;
|
|
518
99
|
onProgress: (fromPeerId: string) => Promise<{
|
|
519
|
-
error: import("../../rpc/
|
|
100
|
+
error: import("../../rpc/index.js").RpcErrorShape;
|
|
520
101
|
}>;
|
|
521
102
|
getAllConfig: (fromPeerId: string) => Promise<string | {
|
|
522
|
-
error:
|
|
103
|
+
error: ReturnType<typeof toP2PWireError>;
|
|
523
104
|
}>;
|
|
524
105
|
onProgressAcknowledged: (fromPeerId: string, info?: ProgressInfo | null, acknowledgement?: ProgressAcknowledgement) => Promise<void>;
|
|
525
106
|
getIsBroadcasting: () => Promise<boolean>;
|
|
526
107
|
requestBroadcasting: (peerId: string) => Promise<true | {
|
|
527
|
-
error: import("../../rpc/
|
|
108
|
+
error: import("../../rpc/index.js").RpcErrorShape;
|
|
528
109
|
}>;
|
|
529
110
|
};
|
|
530
|
-
|
|
531
|
-
|
|
111
|
+
/** Retain the public admission entry point and its caller cancellation signal. */
|
|
112
|
+
requestAuthenticate(peerId: string, signal?: AbortSignal): Promise<boolean | undefined>;
|
|
113
|
+
get lastSeq(): string | number;
|
|
114
|
+
set lastSeq(sequence: string | number);
|
|
532
115
|
requestSynchroniseToPeer(peerId: string, callerSignal?: AbortSignal): Promise<P2PReplicationResult>;
|
|
533
|
-
private requestSynchroniseToPeerWithinSession;
|
|
534
116
|
requestSynchroniseToAllAvailablePeers(): Promise<void>;
|
|
535
117
|
dispatchStatus(): void;
|
|
536
118
|
requestStatus(): void;
|
|
537
|
-
changes
|
|
538
|
-
|
|
119
|
+
get changes(): PouchDB.Core.Changes<EntryDoc> | undefined;
|
|
120
|
+
set changes(changes: PouchDB.Core.Changes<EntryDoc> | undefined);
|
|
121
|
+
get _isBroadcasting(): boolean;
|
|
122
|
+
set _isBroadcasting(enabled: boolean);
|
|
539
123
|
disableBroadcastChanges(): void;
|
|
540
124
|
enableBroadcastChanges(): void;
|
|
541
125
|
/** Apply automatic broadcast policy without restarting this room. */
|
|
542
126
|
reconcileAutoBroadcast(enabled: boolean): void;
|
|
543
127
|
get knownAdvertisements(): Advertisement[];
|
|
544
|
-
availableReplicationPairs: Set<string>;
|
|
128
|
+
get availableReplicationPairs(): Set<string>;
|
|
129
|
+
set availableReplicationPairs(peers: Set<string>);
|
|
545
130
|
sync(remotePeer: string, showNotice?: boolean, callerSignal?: AbortSignal): Promise<P2PReplicationResult>;
|
|
546
|
-
|
|
547
|
-
_replicateToPeers: Set<string>;
|
|
548
|
-
|
|
131
|
+
/** Existing public sets refer to the transfer component's single state owner. */
|
|
132
|
+
get _replicateToPeers(): Set<string>;
|
|
133
|
+
set _replicateToPeers(peers: Set<string>);
|
|
134
|
+
get _replicateFromPeers(): Set<string>;
|
|
135
|
+
set _replicateFromPeers(peers: Set<string>);
|
|
549
136
|
dispatchReplicationProgress(peerId: string, info?: ProgressInfo): void;
|
|
550
137
|
onReplicationProgress(peerId: string, info?: ProgressInfo): boolean;
|
|
551
138
|
onProgressAcknowledged(peerId: string, info?: ProgressInfo | null, acknowledgement?: ProgressAcknowledgement): boolean;
|
|
552
|
-
|
|
139
|
+
/** Report progress without awaiting the reporting RPC's response. */
|
|
140
|
+
acknowledgeProgress(peerId: string, info?: ProgressInfo, acknowledgement?: ProgressAcknowledgement): void;
|
|
553
141
|
replicateFrom(remotePeer: string, showNotice?: boolean, fromStart?: boolean, skipOrdinaryReplicationPolicy?: boolean, callerSignal?: AbortSignal): Promise<P2PReplicationResult>;
|
|
554
|
-
private replicateFromWithinSession;
|
|
555
|
-
private pullFromWithinSession;
|
|
556
|
-
private checkPeerForReplication;
|
|
557
|
-
private transferFromPeer;
|
|
558
142
|
notifyProgress(excludePeerId?: string): Promise<void>;
|
|
559
|
-
private notifyPeerProgress;
|
|
560
143
|
requestBroadcastChanges(peerId: string): Promise<unknown>;
|
|
561
144
|
getRemoteIsBroadcasting(peerId: string): Promise<unknown>;
|
|
562
|
-
_watchingPeers: Set<string>;
|
|
145
|
+
get _watchingPeers(): Set<string>;
|
|
146
|
+
set _watchingPeers(peers: Set<string>);
|
|
563
147
|
watchPeer(peerId: string): void;
|
|
564
148
|
unwatchPeer(peerId: string): void;
|
|
565
149
|
onUpdateDatabase(fromPeerId: string): Promise<false | P2PReplicationResult>;
|
|
566
|
-
|
|
567
|
-
|
|
150
|
+
/** Fetch and validate shared settings; applying them remains the caller's responsibility. */
|
|
151
|
+
getRemoteConfig(peerId: string): Promise<ObsidianLiveSyncSettings | false>;
|
|
152
|
+
/** Compare peer settings without exceeding the initiating call's presentation authority. */
|
|
568
153
|
checkTweakValues(peerId: string, signal?: AbortSignal, logLevel?: LOG_LEVEL): Promise<boolean>;
|
|
569
|
-
|
|
570
|
-
private findAdvertisement;
|
|
571
|
-
private waitForConfiguredAdvertisements;
|
|
572
|
-
private configuredTargetResult;
|
|
573
|
-
/** Synchronise configured peer targets without opening peer-selection UI. */
|
|
154
|
+
/** Synchronise configured targets through their own discovery and aggregation workflow. */
|
|
574
155
|
replicateFromCommand(showResult?: boolean, discoveryTimeoutMs?: number, callerSignal?: AbortSignal): Promise<P2PConfiguredReplicationResult>;
|
|
156
|
+
/** Stop the current relay snapshot and retain the public asynchronous host-stop dispatch. */
|
|
575
157
|
disconnectFromServer(): void;
|
|
576
158
|
pauseServe(): Promise<void>;
|
|
577
159
|
allowReconnection(): void;
|