@hesprs/sync-engine-sdk 3.0.1 → 3.0.2
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/dist/dev.js +1 -1
- package/dist/dev.spec.d.ts +74 -4
- package/dist/index-3gsR9vHT.spec.d.ts +1336 -0
- package/dist/index.js +1 -1
- package/dist/index.spec.d.ts +1 -34
- package/dist/prefix.js +1 -1
- package/package.json +3 -3
- package/dist/debug-wrapper.spec.d.ts +0 -6
- package/dist/node_modules/.bun/synthkernel@._synthkernel.tgz/node_modules/synthkernel/dist/context.spec.d.ts +0 -29
- package/dist/node_modules/.bun/synthkernel@._synthkernel.tgz/node_modules/synthkernel/dist/reactive.spec.d.ts +0 -14
- package/dist/node_modules/.bun/uni-kv@.._.._uni-kv.tgz/node_modules/uni-kv/dist/interface.spec.d.ts +0 -46
- package/dist/packages/plugin/src/components/FilterEditorModal.spec.d.ts +0 -17
- package/dist/packages/plugin/src/components/HeadersEditorModal.spec.d.ts +0 -18
- package/dist/packages/plugin/src/components/MigrationModal.spec.d.ts +0 -45
- package/dist/packages/plugin/src/components/ModuleEditorModal.spec.d.ts +0 -26
- package/dist/packages/plugin/src/components/SourceEditorModal.spec.d.ts +0 -16
- package/dist/packages/plugin/src/components/UnknownModuleModal.spec.d.ts +0 -19
- package/dist/packages/plugin/src/components/file-tree/index.spec.d.ts +0 -7
- package/dist/packages/plugin/src/components/module-management/index.spec.d.ts +0 -23
- package/dist/packages/plugin/src/fs/hierarchical-optimizer.spec.d.ts +0 -1
- package/dist/packages/plugin/src/fs/index.spec.d.ts +0 -13
- package/dist/packages/plugin/src/fs/interface.spec.d.ts +0 -71
- package/dist/packages/plugin/src/fs/middlewares/custom-headers.spec.d.ts +0 -1
- package/dist/packages/plugin/src/fs/middlewares/rate-limiter.spec.d.ts +0 -1
- package/dist/packages/plugin/src/fs/middlewares/retry.spec.d.ts +0 -1
- package/dist/packages/plugin/src/fs/vault/index.spec.d.ts +0 -3
- package/dist/packages/plugin/src/fs/vault/request.spec.d.ts +0 -71
- package/dist/packages/plugin/src/fs/wrappers/asymmetric-storage.spec.d.ts +0 -2
- package/dist/packages/plugin/src/fs/wrappers/cancellation.spec.d.ts +0 -2
- package/dist/packages/plugin/src/fs/wrappers/context.spec.d.ts +0 -2
- package/dist/packages/plugin/src/fs/wrappers/memory-control.spec.d.ts +0 -1
- package/dist/packages/plugin/src/fs/wrappers/optimization.spec.d.ts +0 -1
- package/dist/packages/plugin/src/index.spec.d.ts +0 -30
- package/dist/packages/plugin/src/modules/Bootstrap.spec.d.ts +0 -85
- package/dist/packages/plugin/src/modules/EventBus.spec.d.ts +0 -35
- package/dist/packages/plugin/src/modules/Extensibility.spec.d.ts +0 -96
- package/dist/packages/plugin/src/modules/I18n.spec.d.ts +0 -22
- package/dist/packages/plugin/src/modules/ModulesModal.spec.d.ts +0 -49
- package/dist/packages/plugin/src/modules/Observability.spec.d.ts +0 -58
- package/dist/packages/plugin/src/modules/ProgressModal.spec.d.ts +0 -66
- package/dist/packages/plugin/src/modules/Registrar.spec.d.ts +0 -147
- package/dist/packages/plugin/src/modules/Scheduler.spec.d.ts +0 -43
- package/dist/packages/plugin/src/modules/Storage.spec.d.ts +0 -54
- package/dist/packages/plugin/src/modules/Sync.spec.d.ts +0 -84
- package/dist/packages/plugin/src/settings/controls.spec.d.ts +0 -21
- package/dist/packages/plugin/src/settings/development.spec.d.ts +0 -17
- package/dist/packages/plugin/src/settings/features.spec.d.ts +0 -24
- package/dist/packages/plugin/src/settings/filter.spec.d.ts +0 -11
- package/dist/packages/plugin/src/settings/head.spec.d.ts +0 -23
- package/dist/packages/plugin/src/settings/miscellaneous.spec.d.ts +0 -21
- package/dist/packages/plugin/src/sync/conflict-resolve/keep-local.spec.d.ts +0 -1
- package/dist/packages/plugin/src/sync/conflict-resolve/keep-remote.spec.d.ts +0 -1
- package/dist/packages/plugin/src/sync/conflict-resolve/latest-survive.spec.d.ts +0 -1
- package/dist/packages/plugin/src/sync/conflict-resolve/rename-and-keep-both.spec.d.ts +0 -1
- package/dist/packages/plugin/src/sync/decision/bidirectional.spec.d.ts +0 -2
- package/dist/packages/plugin/src/sync/decision/interface.spec.d.ts +0 -90
- package/dist/packages/plugin/src/sync/index.spec.d.ts +0 -21
- package/dist/packages/plugin/src/sync/tasks/AddRecord.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/CreateLocalDir.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/CreateRemoteDir.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/Download.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/MoveLocal.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/MoveRemote.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/RemoveLocal.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/RemoveRecord.spec.d.ts +0 -7
- package/dist/packages/plugin/src/sync/tasks/RemoveRemote.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/ResolveConflict.spec.d.ts +0 -11
- package/dist/packages/plugin/src/sync/tasks/Upload.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/interface.spec.d.ts +0 -36
- package/dist/packages/plugin/src/sync/utils/detect-moves.spec.d.ts +0 -2
- package/dist/packages/plugin/src/sync/utils/post-traversal.spec.d.ts +0 -1
- package/dist/packages/plugin/src/types.spec.d.ts +0 -40
- package/dist/packages/plugin/src/utils/glob-match.spec.d.ts +0 -5
- package/dist/packages/plugin/src/utils/pipe.spec.d.ts +0 -14
- package/dist/packages/plugin/src/utils/sha-256.spec.d.ts +0 -4
- package/dist/packages/plugin/test/e2e-utils.spec.d.ts +0 -5
- package/dist/packages/plugin/test/test-kit.spec.d.ts +0 -58
- package/dist/prefix.spec.d.ts +0 -6
- package/dist/transform.spec.d.ts +0 -15
- /package/dist/{packages/plugin → plugin}/src/components/MigrationModal.js +0 -0
- /package/dist/{packages/plugin → plugin}/src/components/render-progress.js +0 -0
- /package/dist/{packages/plugin → plugin}/src/utils/pipe.js +0 -0
- /package/dist/{packages/plugin → plugin}/src/utils/round-percent.js +0 -0
- /package/dist/{packages/plugin → plugin}/src/utils/sha-256.js +0 -0
- /package/dist/{packages/plugin → plugin}/src/utils/to-error-message.js +0 -0
- /package/dist/{packages/plugin → plugin}/test/test-kit.js +0 -0
- /package/dist/{packages/shared → shared}/src/get-status.js +0 -0
- /package/dist/{packages/shared → shared}/src/path.js +0 -0
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { GlobMatchRule, Progress, TogglableValue } from "../types.spec.js";
|
|
2
|
-
import { Ref } from "../../../../node_modules/.bun/synthkernel@._synthkernel.tgz/node_modules/synthkernel/dist/reactive.spec.js";
|
|
3
|
-
import { Dispatch, On } from "./EventBus.spec.js";
|
|
4
|
-
import { Translate } from "./I18n.spec.js";
|
|
5
|
-
import { BaseTask, ConflictResolver, TaskNames } from "../sync/tasks/interface.spec.js";
|
|
6
|
-
import RemoveLocal from "../sync/tasks/RemoveLocal.spec.js";
|
|
7
|
-
import { Decider } from "../sync/decision/interface.spec.js";
|
|
8
|
-
import "../sync/index.spec.js";
|
|
9
|
-
import { Events, Translations } from "../index.spec.js";
|
|
10
|
-
import { Infras, RemoteLister } from "./Registrar.spec.js";
|
|
11
|
-
//#region src/modules/Sync.d.ts
|
|
12
|
-
type SyncTerminateReason = {
|
|
13
|
-
result: 'cancelled';
|
|
14
|
-
} | {
|
|
15
|
-
result: 'completed';
|
|
16
|
-
} | {
|
|
17
|
-
result: 'failed';
|
|
18
|
-
error: string;
|
|
19
|
-
} | {
|
|
20
|
-
result: 'noop';
|
|
21
|
-
};
|
|
22
|
-
type TaskInfo = {
|
|
23
|
-
name: TaskNames;
|
|
24
|
-
key: string;
|
|
25
|
-
prettyName: string;
|
|
26
|
-
isDir: boolean;
|
|
27
|
-
};
|
|
28
|
-
type FailedTaskInfo = TaskInfo & {
|
|
29
|
-
error: string;
|
|
30
|
-
};
|
|
31
|
-
declare class Sync {
|
|
32
|
-
private readonly ctx;
|
|
33
|
-
dispatch: Dispatch<Events>;
|
|
34
|
-
on: On<Events>;
|
|
35
|
-
constructor(ctx: {
|
|
36
|
-
dispatch: Dispatch<Events>;
|
|
37
|
-
initializeSync: () => Infras;
|
|
38
|
-
getDecider: () => Decider;
|
|
39
|
-
on: On<Events>;
|
|
40
|
-
translate: Translate<Translations>;
|
|
41
|
-
listRemote: RemoteLister;
|
|
42
|
-
getConflictResolver: () => ConflictResolver;
|
|
43
|
-
});
|
|
44
|
-
readonly events: {
|
|
45
|
-
syncStarted: {
|
|
46
|
-
isCancelled: Ref<boolean>;
|
|
47
|
-
trigger: string;
|
|
48
|
-
};
|
|
49
|
-
remoteWalkProgress: Progress;
|
|
50
|
-
syncTerminated: SyncTerminateReason;
|
|
51
|
-
requestConfirmDelete: Array<RemoveLocal>;
|
|
52
|
-
requestConfirmTasks: Array<BaseTask>;
|
|
53
|
-
syncCanceled: undefined;
|
|
54
|
-
taskCompleted: TaskInfo;
|
|
55
|
-
taskFailed: FailedTaskInfo;
|
|
56
|
-
executionStarted: Array<BaseTask>;
|
|
57
|
-
};
|
|
58
|
-
readonly settings: {
|
|
59
|
-
maxFileSize: TogglableValue;
|
|
60
|
-
exclusionRules: Array<GlobMatchRule>;
|
|
61
|
-
inclusionRules: Array<GlobMatchRule>;
|
|
62
|
-
confirmDeleteInAutoSync: boolean;
|
|
63
|
-
confirmTasksInSync: boolean;
|
|
64
|
-
};
|
|
65
|
-
private readonly postProcess;
|
|
66
|
-
private readonly confirmTasks;
|
|
67
|
-
private readonly confirmDeletion;
|
|
68
|
-
private readonly executeSync;
|
|
69
|
-
private convertDeleteToUpload;
|
|
70
|
-
root: {
|
|
71
|
-
executeSync: (trigger: string) => Promise<{
|
|
72
|
-
result: 'cancelled';
|
|
73
|
-
} | {
|
|
74
|
-
result: 'completed';
|
|
75
|
-
} | {
|
|
76
|
-
result: 'failed';
|
|
77
|
-
error: string;
|
|
78
|
-
} | {
|
|
79
|
-
result: 'noop';
|
|
80
|
-
}>;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
//#endregion
|
|
84
|
-
export { FailedTaskInfo, SyncTerminateReason, TaskInfo, Sync as default };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "../modules/I18n.spec.js";
|
|
2
|
-
import "../index.spec.js";
|
|
3
|
-
//#region src/settings/controls.d.ts
|
|
4
|
-
type ControlsSettingTranslations = {
|
|
5
|
-
controls: string;
|
|
6
|
-
maxFileSize: string;
|
|
7
|
-
maxFileSizeDescription: string;
|
|
8
|
-
maxFileSizePlaceholder: string;
|
|
9
|
-
maxRequestConcurrency: string;
|
|
10
|
-
minRequestInterval: string;
|
|
11
|
-
minRequestIntervalDescription: string;
|
|
12
|
-
minRequestIntervalPlaceholder: string;
|
|
13
|
-
maxRequestConcurrencyPlaceholder: string;
|
|
14
|
-
maxRequestConcurrencyDescription: string;
|
|
15
|
-
maxMemoryConsumption: string;
|
|
16
|
-
maxMemoryConsumptionDescription: string;
|
|
17
|
-
maxMemoryConsumptionPlaceholder: string;
|
|
18
|
-
invalidValue: string;
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
export { ControlsSettingTranslations };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import "../modules/I18n.spec.js";
|
|
2
|
-
import "../modules/Storage.spec.js";
|
|
3
|
-
//#region src/settings/development.d.ts
|
|
4
|
-
type DevelopmentSettingTranslations = {
|
|
5
|
-
development: string;
|
|
6
|
-
vaultRecordsCleared: string;
|
|
7
|
-
clearVaultRecords: string;
|
|
8
|
-
clearAllRecords: string;
|
|
9
|
-
allRecordsCleared: string;
|
|
10
|
-
clearRecords: string;
|
|
11
|
-
clearRecordsDescription: string;
|
|
12
|
-
export: string;
|
|
13
|
-
exportLogsDescription: string;
|
|
14
|
-
exportLogsToFile: string;
|
|
15
|
-
};
|
|
16
|
-
//#endregion
|
|
17
|
-
export { DevelopmentSettingTranslations };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Fragment } from "../modules/I18n.spec.js";
|
|
2
|
-
import { MigrationModalTranslations } from "../components/MigrationModal.spec.js";
|
|
3
|
-
import "../index.spec.js";
|
|
4
|
-
//#region src/settings/features.d.ts
|
|
5
|
-
type FeaturesSettingTranslations = {
|
|
6
|
-
features: string;
|
|
7
|
-
realtimeSyncFastMode: string;
|
|
8
|
-
realtimeSyncFastModeDescription: string;
|
|
9
|
-
realtimeSync: string;
|
|
10
|
-
realtimeSyncDescription: string;
|
|
11
|
-
realtimeSyncPlaceholder: string;
|
|
12
|
-
startupSync: string;
|
|
13
|
-
startupSyncDescription: string;
|
|
14
|
-
startupSyncPlaceholder: string;
|
|
15
|
-
scheduledSync: string;
|
|
16
|
-
scheduledSyncDescription: string;
|
|
17
|
-
scheduledSyncPlaceholder: string;
|
|
18
|
-
asymmetricStorage: string;
|
|
19
|
-
asymmetricStorageDescription: Fragment;
|
|
20
|
-
asymmetricStorageMigration: Fragment<'enable' | 'disable'>;
|
|
21
|
-
invalidValue: string;
|
|
22
|
-
} & MigrationModalTranslations;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { FeaturesSettingTranslations };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "../modules/I18n.spec.js";
|
|
2
|
-
import { FilterEditorTranslations } from "../components/FilterEditorModal.spec.js";
|
|
3
|
-
import "../index.spec.js";
|
|
4
|
-
import { App } from "obsidian";
|
|
5
|
-
//#region src/settings/filter.d.ts
|
|
6
|
-
type FilterSettingTranslations = {
|
|
7
|
-
filterRules: string;
|
|
8
|
-
edit: string;
|
|
9
|
-
} & FilterEditorTranslations;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { FilterSettingTranslations };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import "../types.spec.js";
|
|
2
|
-
import "../modules/I18n.spec.js";
|
|
3
|
-
import "../index.spec.js";
|
|
4
|
-
import "../modules/Registrar.spec.js";
|
|
5
|
-
//#region src/settings/head.d.ts
|
|
6
|
-
type HeadSettingTranslations = {
|
|
7
|
-
moduleAutoUpdate: string;
|
|
8
|
-
moduleAutoUpdateDescription: string;
|
|
9
|
-
moduleManagement: string;
|
|
10
|
-
moduleManagementDescription: string;
|
|
11
|
-
openPanel: string;
|
|
12
|
-
backend: string;
|
|
13
|
-
backendDescription: string;
|
|
14
|
-
syncStrategy: string;
|
|
15
|
-
syncStrategyDescription: string;
|
|
16
|
-
checkConnectionFailed: string;
|
|
17
|
-
checkConnectionSuccess: string;
|
|
18
|
-
checkConnection: string;
|
|
19
|
-
conflictResolveStrategy: string;
|
|
20
|
-
conflictResolveStrategyDescription: string;
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
export { HeadSettingTranslations };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "../modules/I18n.spec.js";
|
|
2
|
-
import "../index.spec.js";
|
|
3
|
-
//#region src/settings/miscellaneous.d.ts
|
|
4
|
-
type MiscellaneousSettingTranslations = {
|
|
5
|
-
miscellaneous: string;
|
|
6
|
-
diffMatchPatch: string;
|
|
7
|
-
keepLocal: string;
|
|
8
|
-
keepRemote: string;
|
|
9
|
-
skip: string;
|
|
10
|
-
noticeStatusOnMobile: string;
|
|
11
|
-
noticeStatusOnMobileDescription: string;
|
|
12
|
-
confirmTasksInSync: string;
|
|
13
|
-
confirmTasksInSyncDescription: string;
|
|
14
|
-
confirmDeleteInAutoSync: string;
|
|
15
|
-
confirmDeleteInAutoSyncDescription: string;
|
|
16
|
-
customHeaders: string;
|
|
17
|
-
customHeadersDescription: string;
|
|
18
|
-
edit: string;
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
export { MiscellaneousSettingTranslations };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../tasks/interface.spec.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../tasks/interface.spec.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../tasks/interface.spec.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../tasks/interface.spec.js";
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { FileStat, FolderStat, RecordStatsMap, Stat, StatsMap } from "../../types.spec.js";
|
|
2
|
-
import { BaseTask, TaskNames } from "../tasks/interface.spec.js";
|
|
3
|
-
import AddRecord from "../tasks/AddRecord.spec.js";
|
|
4
|
-
import CreateRemoteDir from "../tasks/CreateRemoteDir.spec.js";
|
|
5
|
-
import Download from "../tasks/Download.spec.js";
|
|
6
|
-
import MoveLocal from "../tasks/MoveLocal.spec.js";
|
|
7
|
-
import MoveRemote from "../tasks/MoveRemote.spec.js";
|
|
8
|
-
import RemoveLocal from "../tasks/RemoveLocal.spec.js";
|
|
9
|
-
import RemoveRecord from "../tasks/RemoveRecord.spec.js";
|
|
10
|
-
import RemoveRemote from "../tasks/RemoveRemote.spec.js";
|
|
11
|
-
import ResolveConflict from "../tasks/ResolveConflict.spec.js";
|
|
12
|
-
import Upload from "../tasks/Upload.spec.js";
|
|
13
|
-
import CreateLocalDir from "../tasks/CreateLocalDir.spec.js";
|
|
14
|
-
//#region src/sync/decision/interface.d.ts
|
|
15
|
-
type TaskOptions = {
|
|
16
|
-
key: string;
|
|
17
|
-
remote?: Stat;
|
|
18
|
-
local?: Stat;
|
|
19
|
-
};
|
|
20
|
-
type OptionsWithRemoteFileStat = {
|
|
21
|
-
remote: FileStat;
|
|
22
|
-
} & TaskOptions;
|
|
23
|
-
type OptionsWithLocalFileStat = {
|
|
24
|
-
local: FileStat;
|
|
25
|
-
} & TaskOptions;
|
|
26
|
-
type OptionsWithRemoteFolderStat = {
|
|
27
|
-
remote: FolderStat;
|
|
28
|
-
} & TaskOptions;
|
|
29
|
-
type OptionsWithLocalFolderStat = {
|
|
30
|
-
local: FolderStat;
|
|
31
|
-
} & TaskOptions;
|
|
32
|
-
type OptionsWithLocalStat = {
|
|
33
|
-
local: Stat;
|
|
34
|
-
} & TaskOptions;
|
|
35
|
-
type OptionsWithRemoteStat = {
|
|
36
|
-
remote: Stat;
|
|
37
|
-
} & TaskOptions;
|
|
38
|
-
type OptionsWithBothStats = {
|
|
39
|
-
local: Stat;
|
|
40
|
-
remote: Stat;
|
|
41
|
-
} & TaskOptions;
|
|
42
|
-
type OptionsWithBothFileStats = {
|
|
43
|
-
local: FileStat;
|
|
44
|
-
remote: FileStat;
|
|
45
|
-
} & TaskOptions;
|
|
46
|
-
type OptionsWithLocalStatAndOldKey = {
|
|
47
|
-
local: Stat;
|
|
48
|
-
oldKey: string;
|
|
49
|
-
} & TaskOptions;
|
|
50
|
-
type OptionsWithRemoteStatAndOldKey = {
|
|
51
|
-
remote: Stat;
|
|
52
|
-
oldKey: string;
|
|
53
|
-
} & TaskOptions;
|
|
54
|
-
type TaskOptionsMap = {
|
|
55
|
-
download: OptionsWithRemoteFileStat;
|
|
56
|
-
upload: OptionsWithLocalFileStat;
|
|
57
|
-
resolveConflict: OptionsWithBothFileStats;
|
|
58
|
-
removeLocal: OptionsWithLocalStat;
|
|
59
|
-
removeRemote: OptionsWithRemoteStat;
|
|
60
|
-
createLocalDir: OptionsWithRemoteFolderStat;
|
|
61
|
-
createRemoteDir: OptionsWithLocalFolderStat;
|
|
62
|
-
removeRecord: TaskOptions;
|
|
63
|
-
addRecord: OptionsWithBothStats;
|
|
64
|
-
moveLocal: OptionsWithRemoteStatAndOldKey;
|
|
65
|
-
moveRemote: OptionsWithLocalStatAndOldKey;
|
|
66
|
-
};
|
|
67
|
-
declare const taskMap: {
|
|
68
|
-
readonly addRecord: typeof AddRecord;
|
|
69
|
-
readonly createLocalDir: typeof CreateLocalDir;
|
|
70
|
-
readonly createRemoteDir: typeof CreateRemoteDir;
|
|
71
|
-
readonly download: typeof Download;
|
|
72
|
-
readonly moveLocal: typeof MoveLocal;
|
|
73
|
-
readonly moveRemote: typeof MoveRemote;
|
|
74
|
-
readonly removeLocal: typeof RemoveLocal;
|
|
75
|
-
readonly removeRecord: typeof RemoveRecord;
|
|
76
|
-
readonly removeRemote: typeof RemoveRemote;
|
|
77
|
-
readonly resolveConflict: typeof ResolveConflict;
|
|
78
|
-
readonly upload: typeof Upload;
|
|
79
|
-
};
|
|
80
|
-
type TaskFactory = <N extends TaskNames>(name: N, options: TaskOptionsMap[N]) => InstanceType<(typeof taskMap)[N]>;
|
|
81
|
-
type Decider = (input: DeciderInput) => Array<BaseTask>;
|
|
82
|
-
type DeciderInput = {
|
|
83
|
-
localStats: StatsMap;
|
|
84
|
-
remoteStats: StatsMap;
|
|
85
|
-
records: RecordStatsMap;
|
|
86
|
-
taskFactory: TaskFactory;
|
|
87
|
-
logger: (log: string) => void;
|
|
88
|
-
};
|
|
89
|
-
//#endregion
|
|
90
|
-
export { Decider, DeciderInput, OptionsWithBothFileStats, OptionsWithBothStats, OptionsWithLocalFileStat, OptionsWithLocalFolderStat, OptionsWithLocalStat, OptionsWithLocalStatAndOldKey, OptionsWithRemoteFileStat, OptionsWithRemoteFolderStat, OptionsWithRemoteStat, OptionsWithRemoteStatAndOldKey, TaskFactory, TaskOptions, TaskOptionsMap, taskMap };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BaseTask, BaseTaskOptions, ConflictResolver, ConflictResolverPayload, TaskNames } from "./tasks/interface.spec.js";
|
|
2
|
-
import AddRecord from "./tasks/AddRecord.spec.js";
|
|
3
|
-
import CreateRemoteDir from "./tasks/CreateRemoteDir.spec.js";
|
|
4
|
-
import Download from "./tasks/Download.spec.js";
|
|
5
|
-
import MoveLocal from "./tasks/MoveLocal.spec.js";
|
|
6
|
-
import MoveRemote from "./tasks/MoveRemote.spec.js";
|
|
7
|
-
import RemoveLocal from "./tasks/RemoveLocal.spec.js";
|
|
8
|
-
import RemoveRecord from "./tasks/RemoveRecord.spec.js";
|
|
9
|
-
import RemoveRemote from "./tasks/RemoveRemote.spec.js";
|
|
10
|
-
import ResolveConflict from "./tasks/ResolveConflict.spec.js";
|
|
11
|
-
import Upload from "./tasks/Upload.spec.js";
|
|
12
|
-
import { Decider, DeciderInput, TaskFactory, TaskOptions, TaskOptionsMap, taskMap } from "./decision/interface.spec.js";
|
|
13
|
-
import CreateLocalDir from "./tasks/CreateLocalDir.spec.js";
|
|
14
|
-
import "./utils/post-traversal.spec.js";
|
|
15
|
-
import "./utils/detect-moves.spec.js";
|
|
16
|
-
import "./decision/bidirectional.spec.js";
|
|
17
|
-
import "./conflict-resolve/keep-remote.spec.js";
|
|
18
|
-
import "./conflict-resolve/keep-local.spec.js";
|
|
19
|
-
import "./conflict-resolve/latest-survive.spec.js";
|
|
20
|
-
import "./conflict-resolve/rename-and-keep-both.spec.js";
|
|
21
|
-
export { AddRecord, type BaseTask, type ConflictResolver, type ConflictResolverPayload, CreateLocalDir, CreateRemoteDir, type Decider, type DeciderInput, Download, MoveLocal, MoveRemote, RemoveLocal, RemoveRecord, RemoveRemote, ResolveConflict, type TaskFactory, type TaskNames, Upload };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseTask } from "./interface.spec.js";
|
|
2
|
-
import { OptionsWithBothStats } from "../decision/interface.spec.js";
|
|
3
|
-
//#region src/sync/tasks/AddRecord.d.ts
|
|
4
|
-
declare class AddRecord extends BaseTask<OptionsWithBothStats> {
|
|
5
|
-
exec(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { AddRecord as default };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseTask } from "./interface.spec.js";
|
|
2
|
-
import { OptionsWithRemoteFolderStat } from "../decision/interface.spec.js";
|
|
3
|
-
//#region src/sync/tasks/CreateLocalDir.d.ts
|
|
4
|
-
declare class CreateLocalDir extends BaseTask<OptionsWithRemoteFolderStat> {
|
|
5
|
-
exec(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { CreateLocalDir as default };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseTask } from "./interface.spec.js";
|
|
2
|
-
import { OptionsWithLocalFolderStat } from "../decision/interface.spec.js";
|
|
3
|
-
//#region src/sync/tasks/CreateRemoteDir.d.ts
|
|
4
|
-
declare class CreateRemoteDir extends BaseTask<OptionsWithLocalFolderStat> {
|
|
5
|
-
exec(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { CreateRemoteDir as default };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseTask } from "./interface.spec.js";
|
|
2
|
-
import { OptionsWithRemoteFileStat } from "../decision/interface.spec.js";
|
|
3
|
-
//#region src/sync/tasks/Download.d.ts
|
|
4
|
-
declare class Download extends BaseTask<OptionsWithRemoteFileStat> {
|
|
5
|
-
exec(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { Download as default };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseTask } from "./interface.spec.js";
|
|
2
|
-
import { OptionsWithRemoteStatAndOldKey } from "../decision/interface.spec.js";
|
|
3
|
-
//#region src/sync/tasks/MoveLocal.d.ts
|
|
4
|
-
declare class MoveLocal extends BaseTask<OptionsWithRemoteStatAndOldKey> {
|
|
5
|
-
exec(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { MoveLocal as default };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseTask } from "./interface.spec.js";
|
|
2
|
-
import { OptionsWithLocalStatAndOldKey } from "../decision/interface.spec.js";
|
|
3
|
-
//#region src/sync/tasks/MoveRemote.d.ts
|
|
4
|
-
declare class MoveRemote extends BaseTask<OptionsWithLocalStatAndOldKey> {
|
|
5
|
-
exec(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { MoveRemote as default };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseTask } from "./interface.spec.js";
|
|
2
|
-
import { OptionsWithLocalStat } from "../decision/interface.spec.js";
|
|
3
|
-
//#region src/sync/tasks/RemoveLocal.d.ts
|
|
4
|
-
declare class RemoveLocal extends BaseTask<OptionsWithLocalStat> {
|
|
5
|
-
exec(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { RemoveLocal as default };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseTask } from "./interface.spec.js";
|
|
2
|
-
import { OptionsWithRemoteStat } from "../decision/interface.spec.js";
|
|
3
|
-
//#region src/sync/tasks/RemoveRemote.d.ts
|
|
4
|
-
declare class RemoveRemote extends BaseTask<OptionsWithRemoteStat> {
|
|
5
|
-
exec(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { RemoveRemote as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MaybePromise } from "../../types.spec.js";
|
|
2
|
-
import { BaseTask, ConflictResolver } from "./interface.spec.js";
|
|
3
|
-
import { OptionsWithBothFileStats } from "../decision/interface.spec.js";
|
|
4
|
-
//#region src/sync/tasks/ResolveConflict.d.ts
|
|
5
|
-
declare class ResolveConflict extends BaseTask<OptionsWithBothFileStats & {
|
|
6
|
-
resolver: ConflictResolver;
|
|
7
|
-
}> {
|
|
8
|
-
exec: () => MaybePromise<void>;
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { ResolveConflict as default };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseTask } from "./interface.spec.js";
|
|
2
|
-
import { OptionsWithLocalFileStat } from "../decision/interface.spec.js";
|
|
3
|
-
//#region src/sync/tasks/Upload.d.ts
|
|
4
|
-
declare class Upload extends BaseTask<OptionsWithLocalFileStat> {
|
|
5
|
-
exec(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { Upload as default };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { FileStat, MaybePromise } from "../../types.spec.js";
|
|
2
|
-
import { Fs } from "../../fs/interface.spec.js";
|
|
3
|
-
import { RecordStore } from "../../modules/Storage.spec.js";
|
|
4
|
-
import { TaskOptions } from "../decision/interface.spec.js";
|
|
5
|
-
import "../../fs/index.spec.js";
|
|
6
|
-
//#region src/sync/tasks/interface.d.ts
|
|
7
|
-
type BaseTaskOptions = {
|
|
8
|
-
localFs: Fs;
|
|
9
|
-
remoteFs: Fs;
|
|
10
|
-
record: RecordStore;
|
|
11
|
-
};
|
|
12
|
-
type TaskNames = 'addRecord' | 'removeRecord' | 'createLocalDir' | 'createRemoteDir' | 'download' | 'resolveConflict' | 'removeLocal' | 'removeRemote' | 'upload' | 'moveLocal' | 'moveRemote';
|
|
13
|
-
type ConflictResolverPayload = {
|
|
14
|
-
local: FileStat;
|
|
15
|
-
remote: FileStat;
|
|
16
|
-
key: string;
|
|
17
|
-
localFs: Fs;
|
|
18
|
-
remoteFs: Fs;
|
|
19
|
-
record: RecordStore;
|
|
20
|
-
};
|
|
21
|
-
type ConflictResolver = (payload: ConflictResolverPayload) => MaybePromise<void>;
|
|
22
|
-
declare abstract class BaseTask<T extends TaskOptions = TaskOptions> {
|
|
23
|
-
readonly options: BaseTaskOptions & T;
|
|
24
|
-
constructor(options: BaseTaskOptions & T);
|
|
25
|
-
protected readonly remoteFs: Fs;
|
|
26
|
-
protected readonly localFs: Fs;
|
|
27
|
-
protected readonly record: RecordStore;
|
|
28
|
-
name: TaskNames;
|
|
29
|
-
prettyName: string;
|
|
30
|
-
readonly key: string;
|
|
31
|
-
readonly local: (BaseTaskOptions & T)['local'];
|
|
32
|
-
readonly remote: (BaseTaskOptions & T)['remote'];
|
|
33
|
-
abstract exec(): MaybePromise<void>;
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { BaseTask, BaseTaskOptions, ConflictResolver, ConflictResolverPayload, TaskNames };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../../types.spec.js";
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { General } from "../test/e2e-utils.spec.js";
|
|
2
|
-
//#region src/types.d.ts
|
|
3
|
-
type MaybePromise<T> = Promise<T> | T;
|
|
4
|
-
type TogglableValue<T = number> = {
|
|
5
|
-
enabled: boolean;
|
|
6
|
-
value: T;
|
|
7
|
-
};
|
|
8
|
-
type FileStat = {
|
|
9
|
-
isDir: false;
|
|
10
|
-
key: string;
|
|
11
|
-
mtime: number;
|
|
12
|
-
size: number;
|
|
13
|
-
uid: string;
|
|
14
|
-
};
|
|
15
|
-
type FolderStat = {
|
|
16
|
-
isDir: true;
|
|
17
|
-
key: string;
|
|
18
|
-
};
|
|
19
|
-
type Stat = FileStat | FolderStat;
|
|
20
|
-
type RecordStat = {
|
|
21
|
-
isDir: false;
|
|
22
|
-
local: string;
|
|
23
|
-
remote: string;
|
|
24
|
-
} | {
|
|
25
|
-
isDir: true;
|
|
26
|
-
};
|
|
27
|
-
type StatsMap = Map<string, Stat>;
|
|
28
|
-
type RecordStatsMap = Map<string, RecordStat>;
|
|
29
|
-
type GlobMatchRule = {
|
|
30
|
-
expr: string;
|
|
31
|
-
caseSensitive: boolean;
|
|
32
|
-
};
|
|
33
|
-
type Progress<T = string> = {
|
|
34
|
-
total: number;
|
|
35
|
-
completed: number;
|
|
36
|
-
current?: T;
|
|
37
|
-
};
|
|
38
|
-
type Binary = Uint8Array<ArrayBuffer>;
|
|
39
|
-
//#endregion
|
|
40
|
-
export { Binary, FileStat, FolderStat, type General, GlobMatchRule, MaybePromise, Progress, RecordStat, RecordStatsMap, Stat, StatsMap, TogglableValue };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Binary, FileStat, MaybePromise } from "../types.spec.js";
|
|
2
|
-
import { Fs } from "../fs/interface.spec.js";
|
|
3
|
-
import "../fs/index.spec.js";
|
|
4
|
-
//#region src/utils/pipe.d.ts
|
|
5
|
-
declare function pipe({ from, to, stat, key }: {
|
|
6
|
-
from: Fs;
|
|
7
|
-
to: Fs;
|
|
8
|
-
key: string;
|
|
9
|
-
stat: FileStat;
|
|
10
|
-
}): Promise<string | undefined>;
|
|
11
|
-
declare function readWithSize(fs: Fs, key: string, stat: FileStat): Promise<Binary | ReadableStream<Binary> | undefined>;
|
|
12
|
-
declare function writeWithValue(fs: Fs, key: string, value: Binary | ReadableStream<Binary>, stat: FileStat): MaybePromise<string>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { pipe, readWithSize, writeWithValue };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Binary, FileStat, FolderStat } from "../src/types.spec.js";
|
|
2
|
-
import { Fs, RootFs } from "../src/fs/interface.spec.js";
|
|
3
|
-
import { Request, RequestParam } from "../src/modules/Registrar.spec.js";
|
|
4
|
-
import "../src/fs/index.spec.js";
|
|
5
|
-
//#region test/test-kit.d.ts
|
|
6
|
-
type FsCalls = {
|
|
7
|
-
delete: Array<string>;
|
|
8
|
-
exists: Array<string>;
|
|
9
|
-
list: Array<string>;
|
|
10
|
-
mkdir: Array<string>;
|
|
11
|
-
move: Array<[string, string]>;
|
|
12
|
-
read: Array<[string, FileStat]>;
|
|
13
|
-
readStream: Array<[string, FileStat]>;
|
|
14
|
-
stat: Array<string>;
|
|
15
|
-
write: Array<[string, Binary, FileStat]>;
|
|
16
|
-
writeStream: Array<[string, FileStat]>;
|
|
17
|
-
};
|
|
18
|
-
type FsOptions = {
|
|
19
|
-
control?: Partial<Fs>;
|
|
20
|
-
uid?: string;
|
|
21
|
-
};
|
|
22
|
-
type FsHarness = {
|
|
23
|
-
calls: FsCalls;
|
|
24
|
-
control: Fs;
|
|
25
|
-
fs: RootFs;
|
|
26
|
-
};
|
|
27
|
-
type RequestHarness = {
|
|
28
|
-
calls: Array<RequestParam | string>;
|
|
29
|
-
request: Request;
|
|
30
|
-
};
|
|
31
|
-
declare function bytes(value: string): Binary;
|
|
32
|
-
declare function file(key: string, options?: {
|
|
33
|
-
mtime?: number;
|
|
34
|
-
size?: number;
|
|
35
|
-
uid?: string;
|
|
36
|
-
}): FileStat;
|
|
37
|
-
declare function folder(key: string): FolderStat;
|
|
38
|
-
declare function stream(chunks?: Array<string | Binary>): ReadableStream<Binary>;
|
|
39
|
-
declare function deferred<T>(): {
|
|
40
|
-
promise: Promise<T>;
|
|
41
|
-
reject: (reason?: unknown) => void;
|
|
42
|
-
resolve: (value: T | PromiseLike<T>) => void;
|
|
43
|
-
};
|
|
44
|
-
declare function flush(turns?: number): Promise<void>;
|
|
45
|
-
declare function request(control: Request): RequestHarness;
|
|
46
|
-
declare function fs(options?: FsOptions): FsHarness;
|
|
47
|
-
declare const testKit: {
|
|
48
|
-
bytes: typeof bytes;
|
|
49
|
-
deferred: typeof deferred;
|
|
50
|
-
file: typeof file;
|
|
51
|
-
flush: typeof flush;
|
|
52
|
-
folder: typeof folder;
|
|
53
|
-
fs: typeof fs;
|
|
54
|
-
request: typeof request;
|
|
55
|
-
stream: typeof stream;
|
|
56
|
-
};
|
|
57
|
-
//#endregion
|
|
58
|
-
export { testKit as default };
|
package/dist/prefix.spec.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Fs, WrappedFs } from "./packages/plugin/src/fs/interface.spec.js";
|
|
2
|
-
import "./packages/plugin/src/fs/index.spec.js";
|
|
3
|
-
//#region src/sdk/prefix.d.ts
|
|
4
|
-
declare function prefixWrapper(original: Fs, prefix: string): WrappedFs;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { prefixWrapper as default };
|
package/dist/transform.spec.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//#region src/sdk/transform.d.ts
|
|
2
|
-
type SyncEngineConfig = {
|
|
3
|
-
deps?: {
|
|
4
|
-
neverBundle?: true | string | RegExp | Array<string | RegExp> | ((id: string, parentId: string | undefined, isResolved: boolean) => boolean | null | undefined);
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
declare function syncEngineTransform(): {
|
|
8
|
-
name: string;
|
|
9
|
-
renderChunk(code: string): {
|
|
10
|
-
code: string;
|
|
11
|
-
} | undefined;
|
|
12
|
-
tsdownConfig(config: SyncEngineConfig): void;
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
export { syncEngineTransform as default };
|
|
File without changes
|