diff --git a/src/common/types.ts b/src/common/types.ts index 9fe0397..f245eee 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -1,5 +1,6 @@ import { type PluginManifest, TFile } from "@/deps.ts"; -import { type DatabaseEntry, type EntryBody, type FilePath } from "@lib/common/types.ts"; +import type { DatabaseEntry, FilePath } from "@lib/common/models/db.type"; +import type { EntryBody } from "@lib/common/models/db.definition"; export type { CacheData, FileEventItem } from "../lib/src/common/types.ts"; export interface PluginDataEntry extends DatabaseEntry { diff --git a/src/common/utils.ts b/src/common/utils.ts index 1e94e47..55a676f 100644 --- a/src/common/utils.ts +++ b/src/common/utils.ts @@ -10,19 +10,10 @@ import { } from "@lib/string_and_binary/path.ts"; import { Logger } from "@lib/common/logger.ts"; -import { - LOG_LEVEL_INFO, - LOG_LEVEL_NOTICE, - LOG_LEVEL_VERBOSE, - type AnyEntry, - type CouchDBCredentials, - type DocumentID, - type EntryHasPath, - type FilePath, - type FilePathWithPrefix, - type UXFileInfo, - type UXFileInfoStub, -} from "@lib/common/types.ts"; +import type { AnyEntry, DocumentID, EntryHasPath, FilePath, FilePathWithPrefix } from "@lib/common/models/db.type"; +import type { CouchDBCredentials } from "@lib/common/models/auth.type"; +import type { UXFileInfo, UXFileInfoStub } from "@lib/common/models/fileaccess.type"; +import { LOG_LEVEL_INFO, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "@lib/common/logger"; export { ICHeader, ICXHeader } from "./types.ts"; import { writeString } from "@lib/string_and_binary/convert.ts"; import { sameChangePairs } from "./stores.ts"; diff --git a/src/deps.ts b/src/deps.ts index cf8ed5b..b0f866e 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -1,5 +1,4 @@ -import { type FilePath } from "./lib/src/common/types.ts"; - +import type { FilePath } from "@lib/common/models/db.type"; export { addIcon, App, diff --git a/src/features/ConfigSync/CmdConfigSync.ts b/src/features/ConfigSync/CmdConfigSync.ts index 89174ca..b4b112d 100644 --- a/src/features/ConfigSync/CmdConfigSync.ts +++ b/src/features/ConfigSync/CmdConfigSync.ts @@ -9,28 +9,14 @@ import { Platform, addIcon, } from "@/deps.ts"; - -import type { - EntryDoc, - LoadedEntry, - InternalFileEntry, - FilePathWithPrefix, - FilePath, - AnyEntry, - SavingEntry, - diff_result, -} from "@lib/common/types.ts"; -import { - CANCELLED, - LEAVE_TO_SUBSEQUENT, - LOG_LEVEL_DEBUG, - LOG_LEVEL_INFO, - LOG_LEVEL_NOTICE, - LOG_LEVEL_VERBOSE, - MODE_SELECTIVE, - MODE_SHINY, -} from "@lib/common/types.ts"; -import { ICXHeader, PERIODIC_PLUGIN_SWEEP } from "@/common/types.ts"; +import type { EntryDoc } from "@lib/common/models/db.definition"; +import type { LoadedEntry, InternalFileEntry, FilePathWithPrefix, FilePath, AnyEntry, SavingEntry } from "@lib/common/models/db.type"; +import type { diff_result } from "@lib/common/models/diff.definition"; +import { CANCELLED, LEAVE_TO_SUBSEQUENT } from "@lib/common/models/shared.const.symbols"; +import { MODE_SELECTIVE, MODE_SHINY } from "@lib/common/models/setting.const"; +import { LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "@lib/common/logger"; +import { ICXHeader } from "@lib/common/models/fileaccess.const"; +import { PERIODIC_PLUGIN_SWEEP } from "@/common/types.ts"; import { createBlob, createSavingEntryFromLoadedEntry, diff --git a/src/features/HiddenFileCommon/JsonResolveModal.ts b/src/features/HiddenFileCommon/JsonResolveModal.ts index e03b7ff..f8d78d9 100644 --- a/src/features/HiddenFileCommon/JsonResolveModal.ts +++ b/src/features/HiddenFileCommon/JsonResolveModal.ts @@ -1,5 +1,5 @@ import { App, Modal } from "@/deps.ts"; -import { type FilePath, type LoadedEntry } from "@lib/common/types.ts"; +import type { FilePath, LoadedEntry } from "@lib/common/models/db.type"; import JsonResolvePane from "./JsonResolvePane.svelte"; import { waitForSignal } from "@lib/common/utils.ts"; import { mount, unmount } from "svelte"; diff --git a/src/features/HiddenFileSync/CmdHiddenFileSync.ts b/src/features/HiddenFileSync/CmdHiddenFileSync.ts index dce1a3d..ee3f6d5 100644 --- a/src/features/HiddenFileSync/CmdHiddenFileSync.ts +++ b/src/features/HiddenFileSync/CmdHiddenFileSync.ts @@ -1,22 +1,10 @@ import { type PluginManifest, type ListedFiles } from "@/deps.ts"; -import { - type LoadedEntry, - type FilePathWithPrefix, - type FilePath, - LOG_LEVEL_INFO, - LOG_LEVEL_NOTICE, - LOG_LEVEL_VERBOSE, - MODE_SELECTIVE, - MODE_PAUSED, - type SavingEntry, - type DocumentID, - type UXFileInfo, - type UXStat, - LOG_LEVEL_DEBUG, - type MetaEntry, - type UXDataWriteOptions, -} from "@lib/common/types.ts"; -import { type InternalFileInfo, ICHeader, ICHeaderEnd } from "@/common/types.ts"; +import type { LoadedEntry, FilePathWithPrefix, FilePath, SavingEntry, DocumentID, MetaEntry } from "@lib/common/models/db.type"; +import { MODE_SELECTIVE, MODE_PAUSED } from "@lib/common/models/setting.const"; +import type { UXFileInfo, UXStat, UXDataWriteOptions } from "@lib/common/models/fileaccess.type"; +import { LOG_LEVEL_INFO, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE, LOG_LEVEL_DEBUG } from "@lib/common/logger"; +import { ICHeader, ICHeaderEnd } from "@lib/common/models/fileaccess.const"; +import { type InternalFileInfo } from "@/common/types.ts"; import { readAsBlob, isDocContentSame, diff --git a/src/features/LiveSyncCommands.ts b/src/features/LiveSyncCommands.ts index e639d11..9645e57 100644 --- a/src/features/LiveSyncCommands.ts +++ b/src/features/LiveSyncCommands.ts @@ -1,13 +1,7 @@ import { LOG_LEVEL_VERBOSE } from "octagonal-wheels/common/logger"; -import { - LOG_LEVEL_INFO, - LOG_LEVEL_NOTICE, - type AnyEntry, - type DocumentID, - type FilePath, - type FilePathWithPrefix, - type LOG_LEVEL, -} from "@lib/common/types.ts"; +import type { AnyEntry, DocumentID, FilePath, FilePathWithPrefix } from "@lib/common/models/db.type"; +import { LOG_LEVEL_INFO, LOG_LEVEL_NOTICE } from "@lib/common/logger"; +import type { LOG_LEVEL } from "@lib/common/logger"; import type ObsidianLiveSyncPlugin from "@/main.ts"; import { MARK_DONE } from "@/modules/features/ModuleLog.ts"; import type { LiveSyncCore } from "@/main.ts"; diff --git a/src/features/P2PSync/P2PReplicator/P2PReplicatorPaneView.ts b/src/features/P2PSync/P2PReplicator/P2PReplicatorPaneView.ts index 30073ad..5195396 100644 --- a/src/features/P2PSync/P2PReplicator/P2PReplicatorPaneView.ts +++ b/src/features/P2PSync/P2PReplicator/P2PReplicatorPaneView.ts @@ -5,7 +5,8 @@ import { SvelteItemView } from "@/common/SvelteItemView.ts"; import { eventHub } from "@/common/events.ts"; import { unique } from "octagonal-wheels/collection"; -import { LOG_LEVEL_NOTICE, REMOTE_P2P } from "@lib/common/types.ts"; +import { REMOTE_P2P } from "@lib/common/models/setting.const"; +import { LOG_LEVEL_NOTICE } from "@lib/common/logger"; import { Logger } from "@lib/common/logger.ts"; import { EVENT_P2P_PEER_SHOW_EXTRA_MENU, type PeerStatus } from "@lib/replication/trystero/P2PReplicatorPaneCommon.ts"; import type { LiveSyncBaseCore } from "@/LiveSyncBaseCore.ts"; diff --git a/src/lib b/src/lib index ba710b1..0f12b78 160000 --- a/src/lib +++ b/src/lib @@ -1 +1 @@ -Subproject commit ba710b1e1374473944c68095459fd3f26ef09e8a +Subproject commit 0f12b78eb13839c9e9f8dc1824a11bc3e5f684e6 diff --git a/src/modules/coreFeatures/ModuleResolveMismatchedTweaks.ts b/src/modules/coreFeatures/ModuleResolveMismatchedTweaks.ts index 294179d..9b742af 100644 --- a/src/modules/coreFeatures/ModuleResolveMismatchedTweaks.ts +++ b/src/modules/coreFeatures/ModuleResolveMismatchedTweaks.ts @@ -1,16 +1,9 @@ import { Logger, LOG_LEVEL_NOTICE } from "octagonal-wheels/common/logger"; import { extractObject } from "octagonal-wheels/object"; -import { - TweakValuesShouldMatchedTemplate, - TweakValuesTemplate, - IncompatibleChanges, - confName, - type TweakValues, - type ObsidianLiveSyncSettings, - type RemoteDBSettings, - IncompatibleChangesInSpecificPattern, - CompatibleButLossyChanges, -} from "@lib/common/types.ts"; +import type { TweakValues } from "@lib/common/models/tweak.definition"; +import { TweakValuesShouldMatchedTemplate, TweakValuesTemplate, IncompatibleChanges, IncompatibleChangesInSpecificPattern, CompatibleButLossyChanges } from "@lib/common/models/tweak.definition"; +import { confName } from "@lib/common/models/shared.definition.configNames"; +import type { ObsidianLiveSyncSettings, RemoteDBSettings } from "@lib/common/models/setting.type"; import { escapeMarkdownValue } from "@lib/common/utils.ts"; import { AbstractModule } from "@/modules/AbstractModule.ts"; import { $msg } from "@lib/common/i18n.ts"; diff --git a/src/modules/coreObsidian/storageLib/utilObsidian.ts b/src/modules/coreObsidian/storageLib/utilObsidian.ts index a83a4ac..1029f61 100644 --- a/src/modules/coreObsidian/storageLib/utilObsidian.ts +++ b/src/modules/coreObsidian/storageLib/utilObsidian.ts @@ -1,18 +1,12 @@ // Obsidian to LiveSync Utils import { TFile, type TAbstractFile, type TFolder } from "@/deps.ts"; -import { ICHeader } from "@/common/types.ts"; +import { ICHeader } from "@lib/common/models/fileaccess.const"; import { addPrefix, isPlainText } from "@lib/string_and_binary/path.ts"; import { LOG_LEVEL_VERBOSE, Logger } from "octagonal-wheels/common/logger"; import { createBlob } from "@lib/common/utils.ts"; -import type { - FilePath, - FilePathWithPrefix, - UXFileInfo, - UXFileInfoStub, - UXFolderInfo, - UXInternalFileInfoStub, -} from "@lib/common/types.ts"; +import type { FilePath, FilePathWithPrefix } from "@lib/common/models/db.type"; +import type { UXFileInfo, UXFileInfoStub, UXFolderInfo, UXInternalFileInfoStub } from "@lib/common/models/fileaccess.type"; import type { LiveSyncCore } from "@/main.ts"; import type { FileAccessObsidian } from "@/serviceModules/FileAccessObsidian.ts"; diff --git a/src/modules/essential/ModuleMigration.ts b/src/modules/essential/ModuleMigration.ts index 0b1bda1..71136eb 100644 --- a/src/modules/essential/ModuleMigration.ts +++ b/src/modules/essential/ModuleMigration.ts @@ -11,7 +11,7 @@ import { AbstractModule } from "@/modules/AbstractModule.ts"; import { $msg } from "@lib/common/i18n.ts"; import { performDoctorConsultation, RebuildOptions } from "@lib/common/configForDoc.ts"; import { isValidPath } from "@/common/utils.ts"; -import { isMetaEntry } from "@lib/common/types.ts"; +import { isMetaEntry } from "@lib/common/models/db.definition"; import { isDeletedEntry, isDocContentSame, isLoadedEntry, readAsBlob } from "@lib/common/utils.ts"; import { countCompromisedChunks } from "@lib/pouchdb/negotiation.ts"; import type { LiveSyncCore } from "@/main.ts"; diff --git a/src/modules/essentialObsidian/ModuleObsidianEvents.ts b/src/modules/essentialObsidian/ModuleObsidianEvents.ts index 8f5a1b6..381681b 100644 --- a/src/modules/essentialObsidian/ModuleObsidianEvents.ts +++ b/src/modules/essentialObsidian/ModuleObsidianEvents.ts @@ -4,7 +4,7 @@ import { LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "octagonal-wheels/common/log import { scheduleTask } from "octagonal-wheels/concurrency/task"; import { type TFile } from "@/deps.ts"; import { fireAndForget } from "octagonal-wheels/promises"; -import { type FilePathWithPrefix } from "@lib/common/types.ts"; +import type { FilePathWithPrefix } from "@lib/common/models/db.type"; import { reactive, reactiveSource, type ReactiveSource } from "octagonal-wheels/dataobject/reactive"; import { collectingChunks, diff --git a/src/modules/essentialObsidian/ModuleObsidianMenu.ts b/src/modules/essentialObsidian/ModuleObsidianMenu.ts index afc5172..00099b7 100644 --- a/src/modules/essentialObsidian/ModuleObsidianMenu.ts +++ b/src/modules/essentialObsidian/ModuleObsidianMenu.ts @@ -1,6 +1,6 @@ import { type Editor, type MarkdownFileInfo, type MarkdownView } from "@/deps.ts"; import { addIcon } from "@/deps.ts"; -import { type FilePathWithPrefix } from "@lib/common/types.ts"; +import type { FilePathWithPrefix } from "@lib/common/models/db.type"; import { $msg } from "@lib/common/i18n.ts"; import type { LiveSyncCore } from "@/main.ts"; import { AbstractModule } from "@/modules/AbstractModule.ts"; diff --git a/src/modules/extras/ModuleDev.ts b/src/modules/extras/ModuleDev.ts index 16994c4..cf5920f 100644 --- a/src/modules/extras/ModuleDev.ts +++ b/src/modules/extras/ModuleDev.ts @@ -6,7 +6,7 @@ import { eventHub } from "@/common/events"; import { enableTestFunction } from "./devUtil/testUtils.ts"; import { TestPaneView, VIEW_TYPE_TEST } from "./devUtil/TestPaneView.ts"; import { writable } from "svelte/store"; -import type { FilePathWithPrefix } from "@lib/common/types.ts"; +import type { FilePathWithPrefix } from "@lib/common/models/db.type"; import type { LiveSyncCore } from "@/main.ts"; export class ModuleDev extends AbstractObsidianModule { _everyOnloadStart(): Promise { diff --git a/src/modules/features/DocumentHistory/DocumentHistoryModal.ts b/src/modules/features/DocumentHistory/DocumentHistoryModal.ts index 1aadf03..cebde0c 100644 --- a/src/modules/features/DocumentHistory/DocumentHistoryModal.ts +++ b/src/modules/features/DocumentHistory/DocumentHistoryModal.ts @@ -2,14 +2,8 @@ import { TFile, Modal, App, DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, diff_match_pat import { getPathFromTFile, isValidPath } from "@/common/utils.ts"; import { decodeBinary, readString } from "@lib/string_and_binary/convert.ts"; import ObsidianLiveSyncPlugin from "@/main.ts"; -import { - type DocumentID, - type FilePathWithPrefix, - type LoadedEntry, - LOG_LEVEL_INFO, - LOG_LEVEL_NOTICE, - LOG_LEVEL_VERBOSE, -} from "@lib/common/types.ts"; +import type { DocumentID, FilePathWithPrefix, LoadedEntry } from "@lib/common/models/db.type"; +import { LOG_LEVEL_INFO, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "@lib/common/logger"; import { Logger } from "@lib/common/logger.ts"; import { isErrorOfMissingDoc } from "@lib/pouchdb/utils_couchdb.ts"; import { fireAndForget, getDocData, readContent } from "@lib/common/utils.ts"; diff --git a/src/modules/features/InteractiveConflictResolving/ConflictResolveModal.ts b/src/modules/features/InteractiveConflictResolving/ConflictResolveModal.ts index 40bfe1a..831320e 100644 --- a/src/modules/features/InteractiveConflictResolving/ConflictResolveModal.ts +++ b/src/modules/features/InteractiveConflictResolving/ConflictResolveModal.ts @@ -1,6 +1,7 @@ import { App, Modal } from "@/deps.ts"; import { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT } from "diff-match-patch"; -import { CANCELLED, LEAVE_TO_SUBSEQUENT, type diff_result } from "@lib/common/types.ts"; +import { CANCELLED, LEAVE_TO_SUBSEQUENT } from "@lib/common/models/shared.const.symbols"; +import type { diff_result } from "@lib/common/models/diff.definition"; import { delay } from "@lib/common/utils.ts"; import { eventHub } from "@/common/events.ts"; import { globalSlipBoard } from "@lib/bureau/bureau.ts"; diff --git a/src/modules/features/ModuleInteractiveConflictResolver.ts b/src/modules/features/ModuleInteractiveConflictResolver.ts index 2dd3caa..c6f1910 100644 --- a/src/modules/features/ModuleInteractiveConflictResolver.ts +++ b/src/modules/features/ModuleInteractiveConflictResolver.ts @@ -1,14 +1,7 @@ -import { - CANCELLED, - LEAVE_TO_SUBSEQUENT, - LOG_LEVEL_INFO, - LOG_LEVEL_NOTICE, - LOG_LEVEL_VERBOSE, - MISSING_OR_ERROR, - type DocumentID, - type FilePathWithPrefix, - type diff_result, -} from "@lib/common/types.ts"; +import { CANCELLED, LEAVE_TO_SUBSEQUENT, MISSING_OR_ERROR } from "@lib/common/models/shared.const.symbols"; +import type { DocumentID, FilePathWithPrefix } from "@lib/common/models/db.type"; +import type { diff_result } from "@lib/common/models/diff.definition"; +import { LOG_LEVEL_INFO, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "@lib/common/logger"; import { ConflictResolveModal } from "./InteractiveConflictResolving/ConflictResolveModal.ts"; import { AbstractObsidianModule } from "@/modules/AbstractObsidianModule.ts"; import { displayRev } from "@/common/utils.ts"; diff --git a/src/modules/features/ModuleLog.ts b/src/modules/features/ModuleLog.ts index c2f613a..0fd0db5 100644 --- a/src/modules/features/ModuleLog.ts +++ b/src/modules/features/ModuleLog.ts @@ -1,12 +1,8 @@ import { computed, reactive, reactiveSource, type ReactiveValue } from "octagonal-wheels/dataobject/reactive"; -import { - LOG_LEVEL_DEBUG, - LOG_LEVEL_INFO, - LOG_LEVEL_VERBOSE, - PREFIXMD_LOGFILE, - type DatabaseConnectingStatus, - type LOG_LEVEL, -} from "@lib/common/types.ts"; +import { PREFIXMD_LOGFILE } from "@lib/common/models/redflag.const"; +import type { DatabaseConnectingStatus } from "@lib/common/models/shared.definition"; +import { LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_VERBOSE } from "@lib/common/logger"; +import type { LOG_LEVEL } from "@lib/common/logger"; import { cancelTask, scheduleTask } from "octagonal-wheels/concurrency/task"; import { fireAndForget, isDirty, throttle } from "@lib/common/utils.ts"; import { diff --git a/src/modules/features/ModuleObsidianDocumentHistory.ts b/src/modules/features/ModuleObsidianDocumentHistory.ts index cc3b323..6dc4aed 100644 --- a/src/modules/features/ModuleObsidianDocumentHistory.ts +++ b/src/modules/features/ModuleObsidianDocumentHistory.ts @@ -1,7 +1,7 @@ import { type TFile } from "@/deps.ts"; import { eventHub } from "@/common/events.ts"; import { EVENT_REQUEST_SHOW_HISTORY } from "@/common/obsidianEvents.ts"; -import type { FilePathWithPrefix, LoadedEntry, DocumentID } from "@lib/common/types.ts"; +import type { FilePathWithPrefix, LoadedEntry, DocumentID } from "@lib/common/models/db.type"; import { AbstractObsidianModule } from "@/modules/AbstractObsidianModule.ts"; import { DocumentHistoryModal } from "./DocumentHistory/DocumentHistoryModal.ts"; import { fireAndForget } from "octagonal-wheels/promises"; diff --git a/src/modules/features/SettingDialogue/LiveSyncSetting.ts b/src/modules/features/SettingDialogue/LiveSyncSetting.ts index 995e3b2..a4a7fde 100644 --- a/src/modules/features/SettingDialogue/LiveSyncSetting.ts +++ b/src/modules/features/SettingDialogue/LiveSyncSetting.ts @@ -8,7 +8,8 @@ import { type ValueComponent, } from "@/deps.ts"; import { unique } from "octagonal-wheels/collection"; -import { LEVEL_ADVANCED, LEVEL_POWER_USER, statusDisplay, type ConfigurationItem } from "@lib/common/types.ts"; +import type { ConfigurationItem } from "@lib/common/models/shared.definition.configNames"; +import { LEVEL_ADVANCED, LEVEL_POWER_USER, statusDisplay } from "@lib/common/models/shared.definition.configNames"; import { createStub, type ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts"; import { type AllSettingItemKey, diff --git a/src/modules/features/SettingDialogue/ObsidianLiveSyncSettingTab.ts b/src/modules/features/SettingDialogue/ObsidianLiveSyncSettingTab.ts index 6ef6055..132ff65 100644 --- a/src/modules/features/SettingDialogue/ObsidianLiveSyncSettingTab.ts +++ b/src/modules/features/SettingDialogue/ObsidianLiveSyncSettingTab.ts @@ -1,18 +1,10 @@ import { App, PluginSettingTab } from "@/deps.ts"; -import { - type ObsidianLiveSyncSettings, - type RemoteDBSettings, - LOG_LEVEL_NOTICE, - FLAGMD_REDFLAG2_HR, - FLAGMD_REDFLAG3_HR, - REMOTE_COUCHDB, - REMOTE_MINIO, - type ConfigLevel, - LEVEL_POWER_USER, - LEVEL_ADVANCED, - LEVEL_EDGE_CASE, - REMOTE_P2P, -} from "@lib/common/types.ts"; +import type { ObsidianLiveSyncSettings, RemoteDBSettings } from "@lib/common/models/setting.type"; +import { FLAGMD_REDFLAG2_HR, FLAGMD_REDFLAG3_HR } from "@lib/common/models/redflag.const"; +import { REMOTE_COUCHDB, REMOTE_MINIO, REMOTE_P2P } from "@lib/common/models/setting.const"; +import type { ConfigLevel } from "@lib/common/models/shared.definition.configNames"; +import { LEVEL_POWER_USER, LEVEL_ADVANCED, LEVEL_EDGE_CASE } from "@lib/common/models/shared.definition.configNames"; +import { LOG_LEVEL_NOTICE } from "@lib/common/logger"; import { delay, isObjectDifferent, sizeToHumanReadable } from "@lib/common/utils.ts"; import { versionNumberString2Number } from "@lib/string_and_binary/convert.ts"; import { Logger } from "@lib/common/logger.ts"; diff --git a/src/modules/features/SettingDialogue/PaneAdvanced.ts b/src/modules/features/SettingDialogue/PaneAdvanced.ts index 0a4a73c..38d90e4 100644 --- a/src/modules/features/SettingDialogue/PaneAdvanced.ts +++ b/src/modules/features/SettingDialogue/PaneAdvanced.ts @@ -1,4 +1,4 @@ -import { ChunkAlgorithmNames } from "@lib/common/types.ts"; +import { ChunkAlgorithmNames } from "@lib/common/models/setting.const"; import { LiveSyncSetting as Setting } from "./LiveSyncSetting.ts"; import type { ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts"; import type { PageFunctions } from "./SettingPane.ts"; diff --git a/src/modules/features/SettingDialogue/PaneHatch.ts b/src/modules/features/SettingDialogue/PaneHatch.ts index 816f9b8..f843502 100644 --- a/src/modules/features/SettingDialogue/PaneHatch.ts +++ b/src/modules/features/SettingDialogue/PaneHatch.ts @@ -1,12 +1,5 @@ -import { - type FilePathWithPrefix, - type DocumentID, - LOG_LEVEL_NOTICE, - LOG_LEVEL_VERBOSE, - type LoadedEntry, - type MetaEntry, - type FilePath, -} from "@lib/common/types.ts"; +import type { FilePathWithPrefix, DocumentID, LoadedEntry, MetaEntry, FilePath } from "@lib/common/models/db.type"; +import { LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "@lib/common/logger"; import { createBlob, getFileRegExp, isDocContentSame, readAsBlob } from "@lib/common/utils.ts"; import { Logger } from "@lib/common/logger.ts"; import { addPrefix, shouldBeIgnored, stripAllPrefixes } from "@lib/string_and_binary/path.ts"; @@ -20,7 +13,7 @@ import { EVENT_REQUEST_RUN_FIX_INCOMPLETE, eventHub, } from "@/common/events.ts"; -import { ICHeader, ICXHeader, PSCHeader } from "@/common/types.ts"; +import { ICHeader, ICXHeader, PSCHeader } from "@lib/common/models/fileaccess.const"; import { HiddenFileSync } from "@/features/HiddenFileSync/CmdHiddenFileSync.ts"; import { EVENT_REQUEST_SHOW_HISTORY } from "@/common/obsidianEvents.ts"; import type { ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts"; diff --git a/src/modules/features/SettingDialogue/PaneMaintenance.ts b/src/modules/features/SettingDialogue/PaneMaintenance.ts index 457760d..23ce36a 100644 --- a/src/modules/features/SettingDialogue/PaneMaintenance.ts +++ b/src/modules/features/SettingDialogue/PaneMaintenance.ts @@ -1,6 +1,6 @@ import { EVENT_REQUEST_PERFORM_GC_V3, eventHub } from "@/common/events.ts"; import { LOG_LEVEL_NOTICE, Logger } from "@lib/common/logger.ts"; -import { FlagFilesHumanReadable, FLAGMD_REDFLAG } from "@lib/common/types.ts"; +import { FlagFilesHumanReadable, FLAGMD_REDFLAG } from "@lib/common/models/redflag.const"; import { fireAndForget } from "@lib/common/utils.ts"; import { LiveSyncCouchDBReplicator } from "@lib/replication/couchdb/LiveSyncReplicator.ts"; import { LiveSyncSetting as Setting } from "./LiveSyncSetting.ts"; diff --git a/src/modules/features/SettingDialogue/PanePatches.ts b/src/modules/features/SettingDialogue/PanePatches.ts index c83e7d8..027e5ca 100644 --- a/src/modules/features/SettingDialogue/PanePatches.ts +++ b/src/modules/features/SettingDialogue/PanePatches.ts @@ -1,17 +1,14 @@ -import { - E2EEAlgorithmNames, - E2EEAlgorithms, - type HashAlgorithm, - LOG_LEVEL_NOTICE, - SuffixDatabaseName, -} from "@lib/common/types.ts"; +import { E2EEAlgorithmNames, E2EEAlgorithms } from "@lib/common/models/setting.const"; +import type { HashAlgorithm } from "@lib/common/models/setting.type"; +import { SuffixDatabaseName } from "@lib/common/models/shared.const"; +import { LOG_LEVEL_NOTICE } from "@lib/common/logger"; import { Logger } from "@lib/common/logger.ts"; import { LiveSyncSetting as Setting } from "./LiveSyncSetting.ts"; import type { ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts"; import type { PageFunctions } from "./SettingPane.ts"; import { visibleOnly } from "./SettingPane.ts"; import { PouchDB } from "@lib/pouchdb/pouchdb-browser"; -import { ExtraSuffixIndexedDB } from "@lib/common/types.ts"; +import { ExtraSuffixIndexedDB } from "@lib/common/models/shared.const"; import { migrateDatabases } from "./settingUtils.ts"; export function panePatches(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, { addPanel }: PageFunctions): void { diff --git a/src/modules/features/SettingDialogue/PanePowerUsers.ts b/src/modules/features/SettingDialogue/PanePowerUsers.ts index 7bec258..4c359f2 100644 --- a/src/modules/features/SettingDialogue/PanePowerUsers.ts +++ b/src/modules/features/SettingDialogue/PanePowerUsers.ts @@ -1,4 +1,4 @@ -import { type ConfigPassphraseStore } from "@lib/common/types.ts"; +import type { ConfigPassphraseStore } from "@lib/common/models/setting.type"; import { LiveSyncSetting as Setting } from "./LiveSyncSetting.ts"; import type { ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts"; import type { PageFunctions } from "./SettingPane.ts"; diff --git a/src/modules/features/SettingDialogue/PaneRemoteConfig.ts b/src/modules/features/SettingDialogue/PaneRemoteConfig.ts index 4b29789..d58d0f7 100644 --- a/src/modules/features/SettingDialogue/PaneRemoteConfig.ts +++ b/src/modules/features/SettingDialogue/PaneRemoteConfig.ts @@ -1,12 +1,7 @@ -import { - REMOTE_COUCHDB, - REMOTE_MINIO, - REMOTE_P2P, - DEFAULT_SETTINGS, - LOG_LEVEL_NOTICE, - type ObsidianLiveSyncSettings, - LOG_LEVEL_VERBOSE, -} from "@lib/common/types.ts"; +import { REMOTE_COUCHDB, REMOTE_MINIO, REMOTE_P2P } from "@lib/common/models/setting.const"; +import { DEFAULT_SETTINGS } from "@lib/common/models/setting.const.defaults"; +import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type"; +import { LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "@lib/common/logger"; import { Menu, ButtonComponent } from "@/deps.ts"; import { $msg } from "@lib/common/i18n.ts"; import { LiveSyncSetting as Setting } from "./LiveSyncSetting.ts"; @@ -22,7 +17,7 @@ import { getCouchDBConfigSummary, getE2EEConfigSummary, } from "./settingUtils.ts"; -import { SETTING_KEY_P2P_DEVICE_NAME } from "@lib/common/types.ts"; +import { SETTING_KEY_P2P_DEVICE_NAME } from "@lib/common/models/shared.const"; import { SetupManager, UserMode } from "@/modules/features/SetupManager.ts"; import { OnDialogSettingsDefault, type AllSettings } from "./settingConstants.ts"; import { activateRemoteConfiguration } from "@lib/serviceFeatures/remoteConfig.ts"; diff --git a/src/modules/features/SettingDialogue/PaneSelector.ts b/src/modules/features/SettingDialogue/PaneSelector.ts index 4f00c68..f74242d 100644 --- a/src/modules/features/SettingDialogue/PaneSelector.ts +++ b/src/modules/features/SettingDialogue/PaneSelector.ts @@ -1,4 +1,5 @@ -import { LEVEL_ADVANCED, type CustomRegExpSource } from "@lib/common/types.ts"; +import { LEVEL_ADVANCED } from "@lib/common/models/shared.definition.configNames"; +import type { CustomRegExpSource } from "@lib/common/models/shared.type.util"; import { constructCustomRegExpList, splitCustomRegExpList } from "@lib/common/utils.ts"; import MultipleRegExpControl from "./MultipleRegExpControl.svelte"; import { LiveSyncSetting as Setting } from "./LiveSyncSetting.ts"; diff --git a/src/modules/features/SettingDialogue/PaneSetup.ts b/src/modules/features/SettingDialogue/PaneSetup.ts index c55f8f3..786d85e 100644 --- a/src/modules/features/SettingDialogue/PaneSetup.ts +++ b/src/modules/features/SettingDialogue/PaneSetup.ts @@ -11,7 +11,7 @@ import { import type { ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts"; import type { PageFunctions } from "./SettingPane.ts"; import { visibleOnly } from "./SettingPane.ts"; -import { DEFAULT_SETTINGS } from "@lib/common/types.ts"; +import { DEFAULT_SETTINGS } from "@lib/common/models/setting.const.defaults"; import { request } from "@/deps.ts"; import { SetupManager, UserMode } from "@/modules/features/SetupManager.ts"; export function paneSetup( diff --git a/src/modules/features/SettingDialogue/PaneSyncSettings.ts b/src/modules/features/SettingDialogue/PaneSyncSettings.ts index a1d593f..afca528 100644 --- a/src/modules/features/SettingDialogue/PaneSyncSettings.ts +++ b/src/modules/features/SettingDialogue/PaneSyncSettings.ts @@ -1,4 +1,7 @@ -import { type ObsidianLiveSyncSettings, LOG_LEVEL_NOTICE, REMOTE_COUCHDB, LEVEL_ADVANCED } from "@lib/common/types.ts"; +import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type"; +import { REMOTE_COUCHDB } from "@lib/common/models/setting.const"; +import { LEVEL_ADVANCED } from "@lib/common/models/shared.definition.configNames"; +import { LOG_LEVEL_NOTICE } from "@lib/common/logger"; import { Logger } from "@lib/common/logger.ts"; import { $msg } from "@lib/common/i18n.ts"; import { LiveSyncSetting as Setting } from "./LiveSyncSetting.ts"; diff --git a/src/modules/features/SettingDialogue/remoteConfigBuffer.ts b/src/modules/features/SettingDialogue/remoteConfigBuffer.ts index be23e0d..4a52b14 100644 --- a/src/modules/features/SettingDialogue/remoteConfigBuffer.ts +++ b/src/modules/features/SettingDialogue/remoteConfigBuffer.ts @@ -1,6 +1,5 @@ import { pickBucketSyncSettings, pickCouchDBSyncSettings, pickP2PSyncSettings } from "@lib/common/utils.ts"; -import type { ObsidianLiveSyncSettings } from "@lib/common/types.ts"; - +import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type"; // Keep the setting dialogue buffer aligned with the current core settings before persisting other dirty keys. // This also clears stale dirty values left from editing a different remote type before switching active remotes. export function syncActivatedRemoteSettings( diff --git a/src/modules/features/SetupManager.ts b/src/modules/features/SetupManager.ts index 56287d7..818d1a6 100644 --- a/src/modules/features/SetupManager.ts +++ b/src/modules/features/SetupManager.ts @@ -1,16 +1,7 @@ -import { - type BucketSyncSetting, - type CouchDBConnection, - type EncryptionSettings, - type ObsidianLiveSyncSettings, - type P2PSyncSetting, - DEFAULT_SETTINGS, - LOG_LEVEL_NOTICE, - LOG_LEVEL_VERBOSE, - REMOTE_COUCHDB, - REMOTE_MINIO, - REMOTE_P2P, -} from "@lib/common/types.ts"; +import type { BucketSyncSetting, CouchDBConnection, EncryptionSettings, ObsidianLiveSyncSettings, P2PSyncSetting } from "@lib/common/models/setting.type"; +import { DEFAULT_SETTINGS } from "@lib/common/models/setting.const.defaults"; +import { REMOTE_COUCHDB, REMOTE_MINIO, REMOTE_P2P } from "@lib/common/models/setting.const"; +import { LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "@lib/common/logger"; import { isObjectDifferent } from "@lib/common/utils.ts"; import Intro from "./SetupWizard/dialogs/Intro.svelte"; import SelectMethodNewUser from "./SetupWizard/dialogs/SelectMethodNewUser.svelte"; diff --git a/src/modules/main/ModuleLiveSyncMain.ts b/src/modules/main/ModuleLiveSyncMain.ts index 73f45c1..3da6059 100644 --- a/src/modules/main/ModuleLiveSyncMain.ts +++ b/src/modules/main/ModuleLiveSyncMain.ts @@ -1,5 +1,7 @@ import { fireAndForget } from "octagonal-wheels/promises"; -import { LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE, VER, type ObsidianLiveSyncSettings } from "@lib/common/types.ts"; +import { VER } from "@lib/common/models/shared.const.behabiour"; +import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type"; +import { LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "@lib/common/logger"; import { EVENT_LAYOUT_READY, EVENT_PLUGIN_LOADED,