Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
406 changes: 250 additions & 156 deletions bun.lock

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions docs/.vitepress/theme/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ html.dark {
--vp-c-brand-soft: #a661ff20 !important;
}

.vp-doc hr {
background-color: var(--vp-c-divider) !important;
}

.canvas-viewer {
width: 100%;
aspect-ratio: 16 / 9;
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
},
"dependencies": {
"@json-canvas-viewer/vue": "^1.1.1",
"vitepress": "^2.0.0-alpha.17",
"vitepress-theme-trito": "^1.2.2",
"vitepress": "^2.0.0-alpha.20",
"vitepress-theme-trito": "^1.3.0",
"vue": "^3.5.41"
},
"devDependencies": {
"vite-plugin-json-canvas": "^1.0.1",
"vue-tsc": "^3.3.9"
"vue-tsc": "^3.3.11"
}
}
6 changes: 6 additions & 0 deletions docs/src/pages/en/deep-dive/modules/gdrive.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ before selecting Google Drive as the remote file system:

This setting initiates the Google authorization process. Once authorized, the module stores the refresh token securely in Obsidian's secret storage and uses it to obtain short-lived access tokens as needed. The **Disconnect** option revokes the token with Google, removes it from secret storage, clears any cached access tokens, and deletes the stored account identifier.

::: warning

Connecting to a Google Drive account creates a **new secret in Obsidian keychain** named `sync-engine-gdrive-refresh-token`. This secret is managed exclusively by Sync Engine used as the refresh token to trade Google Drive access tokens. Please do not use this secret for other purposes.

:::

### Base directory

This defines the folder in Google Drive that serves as the root directory for this vault. The value is normalized as a directory path. If left empty when the module starts, it defaults to `<vault name>/`. The specified folder is created automatically during the first synchronization.
Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{
"id": "gdrive",
"name": "Google Drive",
"version": "0.0.4",
"version": "0.0.5",
"description": "Google Drive backend support.",
"icon": "server",
"main": "https://sync.consensia.cc/modules/gdrive.js",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
},
"devDependencies": {
"@hesprs/harness": "./harness.tgz",
"@obsidian-typings/obsidian-public-latest": "^6.34.0",
"@tsdown/css": "^0.22.14",
"@types/bun": "^1.4.0",
"@obsidian-typings/obsidian-public-latest": "^6.36.0",
"@tsdown/css": "^0.23.0",
"@types/bun": "^1.4.2",
"obsidian": "^1.13.1",
"oxfmt": "^0.64.0",
"oxlint": "^1.80.0",
"oxfmt": "^0.67.0",
"oxlint": "^1.82.0",
"oxlint-tsgolint": "^7.0.2001",
"tsdown": "^0.22.14",
"tsdown": "^0.23.0",
"turbo": "^2.10.12",
"typescript": "^6.0.3"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/encryption/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"contributors": [
{
"name": "Hēsperus",
"email": "hesprs@outlook.com",
"email": "hesprs@yandex.com",
"github": "hesprs"
}
],
Expand All @@ -20,7 +20,7 @@
},
"devDependencies": {
"@hesprs/sync-engine-sdk": "workspace:*",
"@noble/ciphers": "^2.3.0",
"@noble/ciphers": "^2.4.0",
"@repo/shared": "workspace:*",
"hash-wasm": "^4.12.0",
"uni-kv": "../../uni-kv.tgz"
Expand Down
2 changes: 1 addition & 1 deletion packages/gdrive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"name": "Hēsperus",
"email": "hesprs@outlook.com",
"email": "hesprs@yandex.com",
"github": "hesprs"
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/gdrive/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class Gdrive {
if (digOriginal(fs) instanceof GdriveFs)
return prefixWrapper(fs, this.moduleSettings.baseDirectory);
},
priority: 8308,
priority: 5998,
}),
registerRemoteRequestMiddleware({
apply: (request) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"contributors": [
{
"name": "Hēsperus",
"email": "hesprs@outlook.com",
"email": "hesprs@yandex.com",
"github": "hesprs"
}
],
Expand Down
6 changes: 3 additions & 3 deletions packages/i18n/src/ru/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ const ru: Translations = {
confirmTasksDescription: (frag, { total, conflict, deleteLocal, deleteRemote }) => {
const deleteOr = deleteLocal + deleteRemote !== 0;
frag.appendText(`Всего при синхронизации будет выполнено операций: ${total}`);
if (conflict + deleteLocal + deleteRemote !== 0) frag.appendText('. В том числе');
if (deleteOr || conflict !== 0) frag.appendText('. В том числе');
if (deleteOr) frag.appendText(' удаление');
if (deleteLocal !== 0) frag.appendText(` ${deleteLocal} локальных файл(а/ов)`);
if (deleteLocal !== 0) frag.appendText(` ${deleteLocal} локальных элемент(а/ов)`);
if (deleteLocal !== 0 && deleteRemote !== 0) frag.appendText(' и');
if (deleteRemote !== 0) frag.appendText(` ${deleteRemote} удалённых файл(а/ов)`);
if (deleteRemote !== 0) frag.appendText(` ${deleteRemote} удалённых элемент(а/ов)`);
if (deleteOr && conflict !== 0) frag.appendText(', а также');
if (conflict !== 0) frag.appendText(` разрешение конфликтов: ${conflict}`);
frag.appendText(':');
Expand Down
30 changes: 9 additions & 21 deletions packages/i18n/src/zh-TW/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,21 @@ const zhTW: Translations = {
},
asymmetricStorageMigration: (frag, flag) => {
if (flag === 'enable') {
frag.createEl('p', {
text: '⚠️ 在啟用非對稱儲存前,請務必留意以下幾點:',
});
frag.createEl('p', { text: '⚠️ 在啟用非對稱儲存前,請務必留意以下幾點:' });
const ol = frag.createEl('ol');
ol.createEl('li', {
text: '遠端儲存將不再保留本地的層級結構。所有檔案都會直接上傳至根目錄,並附上隨機字串標記。',
});
ol.createEl('li', {
text: '若您需要讓遠端檔案保持可讀的目錄結構,請勿啟用此功能。',
});
ol.createEl('li', {
text: '啟用後,請確保所有裝置皆已開啟非對稱儲存。',
});
ol.createEl('li', { text: '若您需要讓遠端檔案保持可讀的目錄結構,請勿啟用此功能。' });
ol.createEl('li', { text: '啟用後,請確保所有裝置皆已開啟非對稱儲存。' });
ol.createEl('li', {
text: '若此儲存庫先前未啟用非對稱儲存即進行過上傳,則必須執行遷移。',
});
} else {
frag.createEl('p', {
text: '⚠️ 在停用非對稱儲存前,請務必留意以下幾點:',
});
frag.createEl('p', { text: '⚠️ 在停用非對稱儲存前,請務必留意以下幾點:' });
const ol = frag.createEl('ol');
ol.createEl('li', {
text: '後續的所有上傳將會還原為本地的層級結構。',
});
ol.createEl('li', {
text: '請確保所有裝置皆已停用非對稱儲存。',
});
ol.createEl('li', { text: '後續的所有上傳將會還原為本地的層級結構。' });
ol.createEl('li', { text: '請確保所有裝置皆已停用非對稱儲存。' });
ol.createEl('li', {
text: '若此儲存庫先前是在啟用非對稱儲存的狀態下上傳,則必須執行遷移。',
});
Expand Down Expand Up @@ -79,11 +67,11 @@ const zhTW: Translations = {
confirmTasksDescription: (frag, { total, conflict, deleteLocal, deleteRemote }) => {
const deleteOr = deleteLocal + deleteRemote !== 0;
frag.appendText(`同步總共將執行 ${total} 個操作`);
if (conflict + deleteLocal + deleteRemote !== 0) frag.appendText(',包含');
if (deleteOr || conflict !== 0) frag.appendText(',包含');
if (deleteOr) frag.appendText('刪除');
if (deleteLocal !== 0) frag.appendText(` ${deleteLocal} 個本地檔案`);
if (deleteLocal !== 0) frag.appendText(` ${deleteLocal} 個本地項目`);
if (deleteLocal !== 0 && deleteRemote !== 0) frag.appendText(' 以及');
if (deleteRemote !== 0) frag.appendText(` ${deleteRemote} 個遠端檔案`);
if (deleteRemote !== 0) frag.appendText(` ${deleteRemote} 個遠端項目`);
if (deleteOr && conflict !== 0) frag.appendText(',並');
if (conflict !== 0) frag.appendText(`解決 ${conflict} 個衝突`);
frag.appendText(':');
Expand Down
14 changes: 7 additions & 7 deletions packages/i18n/src/zh/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ const zh: Translations = {
'在自动触发的同步过程中,显示将被删除的本地文件的确认提示。您可以选择删除或重新上传它们。',
confirmTasksDescription: (frag, { total, conflict, deleteLocal, deleteRemote }) => {
const deleteOr = deleteLocal + deleteRemote !== 0;
frag.appendText(`同步总共将执行 ${total} 项操作`);
if (conflict + deleteLocal + deleteRemote !== 0) frag.appendText(',其中包括');
if (deleteOr) frag.appendText('删除');
if (deleteLocal !== 0) frag.appendText(` ${deleteLocal} 个本地文件`);
if (deleteLocal !== 0 && deleteRemote !== 0) frag.appendText('以及');
if (deleteRemote !== 0) frag.appendText(` ${deleteRemote} 个远程文件`);
frag.appendText(`同步将总共执行 ${total} 个操作`);
if (deleteOr || conflict !== 0) frag.appendText('。其中包含');
if (deleteOr) frag.appendText(' 删除');
if (deleteLocal !== 0) frag.appendText(` ${deleteLocal} 个本地项目`);
if (deleteLocal !== 0 && deleteRemote !== 0) frag.appendText(' 以及');
if (deleteRemote !== 0) frag.appendText(` ${deleteRemote} 个远程项目`);
if (deleteOr && conflict !== 0) frag.appendText(',并');
if (conflict !== 0) frag.appendText(`解决 ${conflict} 个冲突`);
if (conflict !== 0) frag.appendText(` 解决 ${conflict} 个冲突`);
frag.appendText(':');
},
confirmTasksInSync: '手动同步时确认操作',
Expand Down
18 changes: 9 additions & 9 deletions packages/plugin/dist/index.spec.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,15 @@ type LabelDefinition = {
color?: string;
textColor?: string;
};
declare function s(parent: (self: SettingTree) => AugmentedSettingDefinitionItem, children?: CallableOrObjectTree): CallableOrObjectTree;
declare function reactivelyValidate<T>({ text, parse, onSave, format, immediate }: {
export declare function s(parent: (self: SettingTree) => AugmentedSettingDefinitionItem, children?: CallableOrObjectTree): CallableOrObjectTree;
export declare function reactivelyValidate<T>({ text, parse, onSave, format, immediate }: {
text: TextComponent;
parse: (value: string) => T | undefined;
format?: (value: T) => string;
onSave: (value: T) => void;
immediate?: boolean;
}): void;
declare function generateEditableList<T>({ memoryDB, items, identifier, saveSettings, rerenderSettingTab, defaultValue, render, translations: { add, empty, heading }, extraButtons }: {
export declare function generateEditableList<T>({ memoryDB, items, identifier, saveSettings, rerenderSettingTab, defaultValue, render, translations: { add, empty, heading }, extraButtons }: {
memoryDB: DatabaseSync<EphemeralEditableListSchema>;
items: Array<T>;
identifier: string;
Expand Down Expand Up @@ -817,17 +817,17 @@ declare function prefixWrapper(original: Fs, prefix: string): WrappedFs;
//#endregion
//#region src/utils/pipe.d.ts
declare const chunkSize: number, concurrency: number;
declare function pipe({ from, to, stat, key }: {
export declare function pipe({ from, to, stat, key }: {
from: Fs;
to: Fs;
key: string;
stat: FileStat;
}): Promise<string | undefined>;
declare function readWithSize(fs: Fs, key: string, stat: FileStat): Promise<Binary | ReadableStream<Binary> | undefined>;
declare function writeWithValue(fs: Fs, key: string, value: Binary | ReadableStream<Binary>, stat: FileStat): MaybePromise<string>;
export declare function readWithSize(fs: Fs, key: string, stat: FileStat): Promise<Binary | ReadableStream<Binary> | undefined>;
export declare function writeWithValue(fs: Fs, key: string, value: Binary | ReadableStream<Binary>, stat: FileStat): MaybePromise<string>;
//#endregion
//#region src/sdk/index.d.ts
declare function digOriginal(wrapped: Fs): RootFs;
type SelectFromContext<O extends object> = Context extends O ? O : never;
export declare function digOriginal(wrapped: Fs): RootFs;
export type SelectFromContext<O extends object> = Context extends O ? O : never;
//#endregion
export { type AddRecord, type AugmentedModuleMeta, type BaseTask, type BatchOptimizer, type Binary, type CallableOrObjectTree, type CheckConnectionResult, type ConflictResolver, type ConflictResolverEntry, type ConflictResolverPayload, type Context, type CreateLocalDir, type CreateRemoteDir, type CustomAtom, type DatabaseAsync, type DatabaseSync, type Decider, type DeciderEntry, type DeciderInput, type DeleteAtom, type Dispatch, type Download, type Events, type ExistingMemoryDB, type FileStat, type FolderStat, type Fragment, type Fs, type FsWrapperEntry, type InputAtom, type LabelDefinition, type ListReporter, type LocalRequestMiddlewareEntry, type MaybePromise, type MkdirAtom, type ModuleMeta, type MoveAtom, type MoveLocal, type MoveRemote, type ObsidianLanguageCode, type On, type OptimizerEntry, type OptimizerInput, type OptimizerOutput, type OutputAtom, type Progress, type RecordStat, type RecordStatsMap, type RecordStore, type RemoteFsEntry, type RemoteLister, type RemoteListerEntry, type RemoteRequestMiddlewareEntry, type RemoveLocal, type RemoveRecord, type RemoveRemote, type Request, type RequestParam, type RequestResponse, type ResolveConflict, type RootFs, SelectFromContext, type SettingEntry, type Settings, type Stat, type StatsMap, type StoreAsync, type StoreOperations, type StoreSync, type SyncTerminateReason, type TaskFactory, type TaskNames, type Translate, type TranslationResource, type Translations, type Upload, type VaultRequest, type WrappedFs, type WriteAtom, chunkSize, concurrency, digOriginal, generateEditableList, pipe, prefixWrapper, reactivelyValidate, readWithSize, s, setNeedMigration, writeWithValue };
export { type AddRecord, type AugmentedModuleMeta, type BaseTask, type BatchOptimizer, type Binary, type CallableOrObjectTree, type CheckConnectionResult, type ConflictResolver, type ConflictResolverEntry, type ConflictResolverPayload, type Context, type CreateLocalDir, type CreateRemoteDir, type CustomAtom, type DatabaseAsync, type DatabaseSync, type Decider, type DeciderEntry, type DeciderInput, type DeleteAtom, type Dispatch, type Download, type Events, type ExistingMemoryDB, type FileStat, type FolderStat, type Fragment, type Fs, type FsWrapperEntry, type InputAtom, type LabelDefinition, type ListReporter, type LocalRequestMiddlewareEntry, type MaybePromise, type MkdirAtom, type ModuleMeta, type MoveAtom, type MoveLocal, type MoveRemote, type ObsidianLanguageCode, type On, type OptimizerEntry, type OptimizerInput, type OptimizerOutput, type OutputAtom, type Progress, type RecordStat, type RecordStatsMap, type RecordStore, type RemoteFsEntry, type RemoteLister, type RemoteListerEntry, type RemoteRequestMiddlewareEntry, type RemoveLocal, type RemoveRecord, type RemoveRemote, type Request, type RequestParam, type RequestResponse, type ResolveConflict, type RootFs, type SettingEntry, type Settings, type Stat, type StatsMap, type StoreAsync, type StoreOperations, type StoreSync, type SyncTerminateReason, type TaskFactory, type TaskNames, type Translate, type TranslationResource, type Translations, type Upload, type VaultRequest, type WrappedFs, type WriteAtom, chunkSize, concurrency, prefixWrapper, setNeedMigration };
5 changes: 2 additions & 3 deletions packages/plugin/dist/tsdown-plugin.spec.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type ModuleMeta = Partial<Record<'name' | 'icon' | 'description' | 'source' | 'v
type ModuleMetaWithId = ModuleMeta & {
id: string;
};
declare function syncEngineModule(meta?: ModuleMeta | Array<ModuleMetaWithId> | Record<string, ModuleMeta>): {
export default function syncEngineModule(meta?: ModuleMeta | Array<ModuleMetaWithId> | Record<string, ModuleMeta>): {
name: string;
renderChunk(code: string, chunk: {
name: string;
Expand All @@ -18,5 +18,4 @@ declare function syncEngineModule(meta?: ModuleMeta | Array<ModuleMetaWithId> |
} | undefined;
tsdownConfig(config: SyncEngineConfig): void;
};
//#endregion
export { syncEngineModule as default };
//#endregion
12 changes: 6 additions & 6 deletions packages/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"license": "MIT",
"author": {
"name": "Hēsperus",
"email": "hesprs@outlook.com"
"email": "hesprs@yandex.com"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -59,13 +59,13 @@
},
"devDependencies": {
"@repo/shared": "workspace:*",
"@unocss/postcss": "^66.7.5",
"postcss-merge-rules": "^8.0.3",
"solid-js": "^1.9.13",
"@unocss/postcss": "^66.10.0",
"postcss-merge-rules": "^9.0.3",
"solid-js": "^1.9.15",
"synthkernel": "./synthkernel.tgz",
"uni-kv": "../../uni-kv.tgz",
"unocss": "^66.7.5",
"unocss": "^66.10.0",
"unplugin-solid": "^2.0.0",
"verkit": "^0.3.2"
"verkit": "^0.4.0"
}
}
4 changes: 2 additions & 2 deletions packages/plugin/src/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ const en: Translations = {
frag.appendText(`Sync will execute ${total} operation(s) in total`);
if (deleteOr || conflict !== 0) frag.appendText('. Including');
if (deleteOr) frag.appendText(' deleting');
if (deleteLocal !== 0) frag.appendText(` ${deleteLocal} local file(s)`);
if (deleteLocal !== 0) frag.appendText(` ${deleteLocal} local item(s)`);
if (deleteLocal !== 0 && deleteRemote !== 0) frag.appendText(' plus');
if (deleteRemote !== 0) frag.appendText(` ${deleteRemote} remote file(s)`);
if (deleteRemote !== 0) frag.appendText(` ${deleteRemote} remote item(s)`);
if (deleteOr && conflict !== 0) frag.appendText(', and');
if (conflict !== 0) frag.appendText(` resolving ${conflict} conflict(s)`);
frag.appendText(':');
Expand Down
2 changes: 1 addition & 1 deletion packages/s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"contributors": [
{
"name": "Hēsperus",
"email": "hesprs@outlook.com",
"email": "hesprs@yandex.com",
"github": "hesprs"
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-merge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"contributors": [
{
"name": "Hēsperus",
"email": "hesprs@outlook.com",
"email": "hesprs@yandex.com",
"github": "hesprs"
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-merge/src/diff3/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2006, 2008 Tony Garnock-Jones <tonyg@lshift.net>
// Copyright (c) 2006, 2008 LShift Ltd. <query@lshift.net>
// Copyright (c) 2016, 2022 Axosoft, LLC (www.gitkraken.com)
// Copyright (c) 2026, Hēsperus (hesprs@outlook.com)
// Copyright (c) 2026, Hēsperus
//
// Permission is hereby granted, free of charge, to any person
// Obtaining a copy of this software and associated documentation files
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-merge/src/diff3/onp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Copyright (c) 2013 Tatsuhiko Kubo <cubicdaiya@gmail.com>
* Copyright (c) 2016, 2022 Axosoft, LLC (www.gitkraken.com)
* Copyright (c) 2026, Hēsperus (hesprs@outlook.com)
* Copyright (c) 2026, Hēsperus
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion packages/webdav/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"contributors": [
{
"name": "Hēsperus",
"email": "hesprs@outlook.com",
"email": "hesprs@yandex.com",
"github": "hesprs"
}
],
Expand Down
Loading