mirror of
https://github.com/onlyworlds/obsidian-plugin.git
synced 2026-07-22 11:00:31 +00:00
- All sync paths on /api/v2: Download World = /changes cursor walk (incremental
re-downloads, rewind detection, honest delete reporting); Upload World =
create/update sweep via /bulk + PATCH (server-only elements never deleted);
Save/auto-sync via shared V2Client. Legacy worldsync routes fully retired.
- Filename sanitization: Windows-illegal chars (':' etc.) no longer mangle
notes into NTFS streams; wikilinks use sanitized targets, names stay exact.
- Link safety: unresolvable links skip the whole field (server values kept,
surfaced in a toast); uuid-shaped wikilinks pass through as ids.
- Delete Element command: typed-name confirm -> server DELETE -> note to trash.
- Progress toasts for download/upload; README rewritten (v2 semantics +
ecosystem section).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
40 lines
1 KiB
TypeScript
40 lines
1 KiB
TypeScript
/**
|
|
* Plugin settings persisted in Obsidian's data.json.
|
|
*
|
|
* API key is persisted (masked in the UI). PIN is NEVER persisted —
|
|
* it lives only in plugin memory for the current session (see auth/pin-cache.ts).
|
|
*/
|
|
export interface OnlyWorldsPluginSettings {
|
|
apiKey: string;
|
|
apiPin: string;
|
|
defaultWorld: string;
|
|
defaultEmail: string;
|
|
defaultCategory: string;
|
|
individualElementCommands: boolean;
|
|
|
|
autoSync: boolean;
|
|
debounceMs: number;
|
|
showStatusBar: boolean;
|
|
|
|
/**
|
|
* v2 change-feed watermarks per world id: enables incremental Download World.
|
|
* `cursor` resumes the /changes walk; `head` detects server rewinds
|
|
* (restore-from-backup) — a lower head than stored forces a cold re-walk.
|
|
*/
|
|
syncCursors: Record<string, { cursor: string; head: number }>;
|
|
}
|
|
|
|
export const DEFAULT_SETTINGS: OnlyWorldsPluginSettings = {
|
|
apiKey: "",
|
|
apiPin: "",
|
|
defaultWorld: "",
|
|
defaultEmail: "",
|
|
defaultCategory: "Character",
|
|
individualElementCommands: false,
|
|
|
|
autoSync: false,
|
|
debounceMs: 3000,
|
|
showStatusBar: true,
|
|
|
|
syncCursors: {},
|
|
};
|