mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-06-20 13:20:17 +00:00
Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| becff6eba9 | |||
| 6c07f0ca64 | |||
| 18f1fce3e8 | |||
| efb6a0a814 | |||
| 874164ecf5 | |||
| 42954fcf68 | |||
| b2c6916ac7 | |||
| 21f47cf48d | |||
| 21796b6651 | |||
| f468758c75 | |||
| 2ee6a2c09f | |||
| 463c0c0bc8 | |||
| 641488de1f | |||
| 5cb76bba72 | |||
| 866a49204c | |||
| fb93511ae7 | |||
| 72033472f3 | |||
| 93dc03e86f | |||
| dae8443fe8 | |||
| 88a8bcbd5a | |||
| 4a5283543d | |||
| 7895336189 | |||
| 2d5cdccf7d | |||
| 497fd04081 | |||
| ae9c46f8f0 | |||
| dcd10cd690 | |||
| 5a35b71339 | |||
| 18a59219f7 | |||
| c9095738e6 | |||
| bed415fc6b | |||
| 4eeb93b9e4 | |||
| 0fc233686b | |||
| def1d297f5 | |||
| e7cf2a6fba | |||
| 2da2fd7671 | |||
| d5175969e7 | |||
| 46f9630999 | |||
| 75adcf0ff0 | |||
| 866dd49ba3 | |||
| d0a84d07aa | |||
| 089a4c0f8b | |||
| 1a1f816872 | |||
| 9d86c2828b | |||
| 3b6d3beaa7 | |||
| bb75b6ead8 | |||
| fccb2304f6 | |||
| f00ef5eaae | |||
| 4e7ee760de | |||
| c4faade30c | |||
| 295dc1392a | |||
| 445a8c747c | |||
| 292a6b9e1e | |||
| 0e04e7d31d | |||
| 4cf4acf7e9 | |||
| c78e583399 |
@@ -8,8 +8,21 @@ name: Build and Push CLI Docker Image
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
tags:
|
tags:
|
||||||
- "*.*.*-cli"
|
- "*.*.*-cli"
|
||||||
|
paths-ignore:
|
||||||
|
- "docs/**"
|
||||||
|
- "*.md"
|
||||||
|
- "images/**"
|
||||||
|
- "assets/**"
|
||||||
|
- "instruction_images/**"
|
||||||
|
- "src/apps/webapp/**"
|
||||||
|
- "src/apps/webpeer/**"
|
||||||
|
- ".github/workflows/release.yml"
|
||||||
|
- ".github/workflows/unit-ci.yml"
|
||||||
|
- ".github/workflows/harness-ci.yml"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
dry_run:
|
dry_run:
|
||||||
@@ -41,14 +54,32 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(jq -r '.version' manifest.json)
|
VERSION=$(jq -r '.version' manifest.json)
|
||||||
EPOCH=$(date +%s)
|
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||||
TAG="${VERSION}-${EPOCH}-cli"
|
|
||||||
IMAGE="ghcr.io/${{ github.repository_owner }}/livesync-cli"
|
IMAGE="ghcr.io/${{ github.repository_owner }}/livesync-cli"
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
|
||||||
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
|
# Build tag list based on the event and git ref
|
||||||
echo "full=${IMAGE}:${TAG}" >> $GITHUB_OUTPUT
|
TAGS=""
|
||||||
echo "version=${IMAGE}:${VERSION}-cli" >> $GITHUB_OUTPUT
|
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
||||||
echo "latest=${IMAGE}:latest" >> $GITHUB_OUTPUT
|
# Stable release builds
|
||||||
|
TAGS="${IMAGE}:${VERSION}-cli,${IMAGE}:latest,${IMAGE}:${VERSION}-sha-${SHORT_SHA}-cli"
|
||||||
|
elif [[ "${{ github.ref }}" == refs/heads/main ]]; then
|
||||||
|
# Bleeding-edge / nightly builds
|
||||||
|
TAGS="${IMAGE}:edge,${IMAGE}:${VERSION}-dev-sha-${SHORT_SHA}-cli"
|
||||||
|
else
|
||||||
|
# Other branches / manual run fallback
|
||||||
|
TAGS="${IMAGE}:${VERSION}-dev-sha-${SHORT_SHA}-cli"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Determine if the image should be pushed
|
||||||
|
PUSH="true"
|
||||||
|
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||||
|
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
|
||||||
|
PUSH="false"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
|
||||||
|
echo "push=${PUSH}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@@ -92,10 +123,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: src/apps/cli/Dockerfile
|
file: src/apps/cli/Dockerfile
|
||||||
push: ${{ !(github.event_name == 'workflow_dispatch' && inputs.dry_run) }}
|
push: ${{ steps.meta.outputs.push }}
|
||||||
tags: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
${{ steps.meta.outputs.full }}
|
|
||||||
${{ steps.meta.outputs.version }}
|
|
||||||
${{ steps.meta.outputs.latest }}
|
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ on:
|
|||||||
# Sequence of patterns matched against refs/tags
|
# Sequence of patterns matched against refs/tags
|
||||||
tags:
|
tags:
|
||||||
- '*' # Push events to matching any tag format, i.e. 1.0, 20.15.10
|
- '*' # Push events to matching any tag format, i.e. 1.0, 20.15.10
|
||||||
|
- '!*-cli' # Exclude command-line interface tags
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ permissions:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
unit-test:
|
||||||
|
name: Unit Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
@@ -53,10 +54,6 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
# unit tests do not require Playwright, so we can skip installing its dependencies to save time
|
|
||||||
# - name: Install test dependencies (Playwright Chromium)
|
|
||||||
# run: npm run test:install-dependencies
|
|
||||||
|
|
||||||
- name: Run unit tests suite with coverage
|
- name: Run unit tests suite with coverage
|
||||||
run: npm run test:unit:coverage
|
run: npm run test:unit:coverage
|
||||||
|
|
||||||
@@ -64,5 +61,51 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: coverage-report
|
name: unit-coverage-report
|
||||||
path: coverage/**
|
path: coverage/**
|
||||||
|
|
||||||
|
integration-test:
|
||||||
|
name: Integration Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '24.x'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Create environment configuration files
|
||||||
|
run: |
|
||||||
|
cat <<EOF > .env
|
||||||
|
BUILD_MODE=dev
|
||||||
|
PATHS_TEST_INSTALL=
|
||||||
|
EOF
|
||||||
|
cat <<EOF > .test.env
|
||||||
|
hostname=http://127.0.0.1:5989/
|
||||||
|
dbname=livesync-test-db2
|
||||||
|
username=admin
|
||||||
|
password=testpassword
|
||||||
|
minioEndpoint=http://127.0.0.1:9000
|
||||||
|
accessKey=minioadmin
|
||||||
|
secretKey=minioadmin
|
||||||
|
bucketName=livesync-test-bucket
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Start CouchDB container
|
||||||
|
run: npm run test:docker-couchdb:start
|
||||||
|
|
||||||
|
- name: Run integration tests
|
||||||
|
run: npm run test:integration
|
||||||
|
|
||||||
|
- name: Stop CouchDB container
|
||||||
|
if: always()
|
||||||
|
run: npm run test:docker-couchdb:stop || true
|
||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
pouchdb-browser.js
|
pouchdb-browser.js
|
||||||
main_org.js
|
main_org.js
|
||||||
_types
|
main.js
|
||||||
|
_types/**
|
||||||
Vendored
+5
-3
@@ -1,6 +1,7 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { SimpleStore } from "octagonal-wheels/databases/SimpleStoreBase";
|
import type { SimpleStore } from "octagonal-wheels/databases/SimpleStoreBase";
|
||||||
import type { HasSettings, ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
|
import type { HasSettings, ObsidianLiveSyncSettings, EntryDoc } from "@lib/common/types";
|
||||||
import type { EntryDoc } from "@lib/common/models/db.definition";
|
|
||||||
import type { Confirm } from "@lib/interfaces/Confirm";
|
import type { Confirm } from "@lib/interfaces/Confirm";
|
||||||
import type { DatabaseFileAccess } from "@lib/interfaces/DatabaseFileAccess";
|
import type { DatabaseFileAccess } from "@lib/interfaces/DatabaseFileAccess";
|
||||||
import type { Rebuilder } from "@lib/interfaces/DatabaseRebuilder";
|
import type { Rebuilder } from "@lib/interfaces/DatabaseRebuilder";
|
||||||
@@ -15,6 +16,7 @@ import type { ServiceContext } from "@lib/services/base/ServiceBase";
|
|||||||
import type { InjectableServiceHub } from "@lib/services/InjectableServices";
|
import type { InjectableServiceHub } from "@lib/services/InjectableServices";
|
||||||
import { AbstractModule } from "./modules/AbstractModule";
|
import { AbstractModule } from "./modules/AbstractModule";
|
||||||
import type { ServiceModules } from "@lib/interfaces/ServiceModule";
|
import type { ServiceModules } from "@lib/interfaces/ServiceModule";
|
||||||
|
import type { Constructor } from "@lib/common/utils.type";
|
||||||
export declare class LiveSyncBaseCore<T extends ServiceContext = ServiceContext, TCommands extends IMinimumLiveSyncCommands = IMinimumLiveSyncCommands> implements LiveSyncLocalDBEnv, LiveSyncReplicatorEnv, LiveSyncJournalReplicatorEnv, LiveSyncCouchDBReplicatorEnv, HasSettings<ObsidianLiveSyncSettings> {
|
export declare class LiveSyncBaseCore<T extends ServiceContext = ServiceContext, TCommands extends IMinimumLiveSyncCommands = IMinimumLiveSyncCommands> implements LiveSyncLocalDBEnv, LiveSyncReplicatorEnv, LiveSyncJournalReplicatorEnv, LiveSyncCouchDBReplicatorEnv, HasSettings<ObsidianLiveSyncSettings> {
|
||||||
addOns: TCommands[];
|
addOns: TCommands[];
|
||||||
/**
|
/**
|
||||||
@@ -50,7 +52,7 @@ export declare class LiveSyncBaseCore<T extends ServiceContext = ServiceContext,
|
|||||||
* @param constructor
|
* @param constructor
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getModule<T extends AbstractModule>(constructor: new (...args: any[]) => T): T; // eslint-disable-line @typescript-eslint/no-explicit-any
|
getModule<T extends AbstractModule>(constructor: Constructor<T>): T;
|
||||||
/**
|
/**
|
||||||
* Register a module to the plug-in.
|
* Register a module to the plug-in.
|
||||||
* @param module The module to register.
|
* @param module The module to register.
|
||||||
|
|||||||
Vendored
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { KeyValueDatabase } from "@lib/interfaces/KeyValueDatabase.ts";
|
import type { KeyValueDatabase } from "@lib/interfaces/KeyValueDatabase.ts";
|
||||||
export { OpenKeyValueDatabase } from "./KeyValueDBv2.ts";
|
export { OpenKeyValueDatabase } from "./KeyValueDBv2.ts";
|
||||||
export declare const _OpenKeyValueDatabase: (dbKey: string) => Promise<KeyValueDatabase>;
|
export declare const _OpenKeyValueDatabase: (dbKey: string) => Promise<KeyValueDatabase>;
|
||||||
|
|||||||
Vendored
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { KeyValueDatabase } from "@lib/interfaces/KeyValueDatabase";
|
import type { KeyValueDatabase } from "@lib/interfaces/KeyValueDatabase";
|
||||||
import { type IDBPDatabase } from "idb";
|
import { type IDBPDatabase } from "idb";
|
||||||
export declare function OpenKeyValueDatabase(dbKey: string): Promise<KeyValueDatabase>;
|
export declare function OpenKeyValueDatabase(dbKey: string): Promise<KeyValueDatabase>;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { NecessaryServices } from "@lib/interfaces/ServiceModule";
|
import type { NecessaryServices } from "@lib/interfaces/ServiceModule";
|
||||||
type PeriodicProcessorHost = NecessaryServices<"API" | "control", never>;
|
type PeriodicProcessorHost = NecessaryServices<"API" | "control", never>;
|
||||||
export declare class PeriodicProcessor {
|
export declare class PeriodicProcessor {
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { ItemView } from "@/deps.ts";
|
import { ItemView } from "@/deps.ts";
|
||||||
import { type mount } from "svelte";
|
import { type mount } from "svelte";
|
||||||
export declare abstract class SvelteItemView extends ItemView {
|
export declare abstract class SvelteItemView extends ItemView {
|
||||||
|
|||||||
Vendored
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { eventHub } from "@lib/hub/hub";
|
import { eventHub } from "@lib/hub/hub";
|
||||||
export declare const EVENT_PLUGIN_LOADED = "plugin-loaded";
|
export declare const EVENT_PLUGIN_LOADED = "plugin-loaded";
|
||||||
export declare const EVENT_PLUGIN_UNLOADED = "plugin-unloaded";
|
export declare const EVENT_PLUGIN_UNLOADED = "plugin-unloaded";
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { TFile } from "@/deps";
|
import type { TFile } from "@/deps";
|
||||||
import type { FilePathWithPrefix, LoadedEntry } from "@lib/common/models/db.type";
|
import type { FilePathWithPrefix, LoadedEntry } from "@lib/common/types";
|
||||||
export declare const EVENT_REQUEST_SHOW_HISTORY = "show-history";
|
export declare const EVENT_REQUEST_SHOW_HISTORY = "show-history";
|
||||||
declare global {
|
declare global {
|
||||||
interface LSEvents {
|
interface LSEvents {
|
||||||
|
|||||||
Vendored
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
|
import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
|
||||||
import type { LiveSyncBaseCore } from "@/LiveSyncBaseCore";
|
import type { LiveSyncBaseCore } from "@/LiveSyncBaseCore";
|
||||||
export declare function generateReport(settings: ObsidianLiveSyncSettings, core: LiveSyncBaseCore): Promise<{
|
export declare function generateReport(settings: ObsidianLiveSyncSettings, core: LiveSyncBaseCore): Promise<{
|
||||||
|
|||||||
Vendored
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { PersistentMap } from "octagonal-wheels/dataobject/PersistentMap";
|
import { PersistentMap } from "octagonal-wheels/dataobject/PersistentMap";
|
||||||
export declare let sameChangePairs: PersistentMap<number[]>;
|
export declare let sameChangePairs: PersistentMap<number[]>;
|
||||||
export declare function initializeStores(vaultName: string): void;
|
export declare function initializeStores(vaultName: string): void;
|
||||||
|
|||||||
Vendored
+3
-2
@@ -1,6 +1,7 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { type PluginManifest, TFile } from "@/deps.ts";
|
import { type PluginManifest, TFile } from "@/deps.ts";
|
||||||
import type { DatabaseEntry, FilePath } from "@lib/common/models/db.type";
|
import { type DatabaseEntry, type EntryBody, type FilePath } from "@lib/common/types.ts";
|
||||||
import type { EntryBody } from "@lib/common/models/db.definition";
|
|
||||||
export type { CacheData, FileEventItem } from "@lib/common/types.ts";
|
export type { CacheData, FileEventItem } from "@lib/common/types.ts";
|
||||||
export interface PluginDataEntry extends DatabaseEntry {
|
export interface PluginDataEntry extends DatabaseEntry {
|
||||||
deviceVaultName: string;
|
deviceVaultName: string;
|
||||||
|
|||||||
Vendored
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { TAbstractFile } from "@/deps.ts";
|
import { TAbstractFile } from "@/deps.ts";
|
||||||
import type { AnyEntry, DocumentID, EntryHasPath, FilePath, FilePathWithPrefix } from "@lib/common/models/db.type";
|
import { type AnyEntry, type CouchDBCredentials, type DocumentID, type EntryHasPath, type FilePath, type FilePathWithPrefix, type UXFileInfo, type UXFileInfoStub } from "@lib/common/types.ts";
|
||||||
import type { CouchDBCredentials } from "@lib/common/models/auth.type";
|
|
||||||
import type { UXFileInfo, UXFileInfoStub } from "@lib/common/models/fileaccess.type";
|
|
||||||
export { ICHeader, ICXHeader } from "./types.ts";
|
export { ICHeader, ICXHeader } from "./types.ts";
|
||||||
import type { KeyValueDatabase } from "@lib/interfaces/KeyValueDatabase.ts";
|
import type { KeyValueDatabase } from "@lib/interfaces/KeyValueDatabase.ts";
|
||||||
export { scheduleTask, cancelTask, cancelAllTasks } from "octagonal-wheels/concurrency/task";
|
export { scheduleTask, cancelTask, cancelAllTasks } from "octagonal-wheels/concurrency/task";
|
||||||
@@ -26,7 +26,7 @@ export declare const requestToCouchDB: (baseUri: string, username: string, passw
|
|||||||
export declare function requestToCouchDBWithCredentials(baseUri: string, credentials: CouchDBCredentials, origin?: string, key?: string, body?: string, method?: string, customHeaders?: Record<string, string>): Promise<import("obsidian").RequestUrlResponse>;
|
export declare function requestToCouchDBWithCredentials(baseUri: string, credentials: CouchDBCredentials, origin?: string, key?: string, body?: string, method?: string, customHeaders?: Record<string, string>): Promise<import("obsidian").RequestUrlResponse>;
|
||||||
import { BASE_IS_NEW, EVEN, TARGET_IS_NEW } from "@lib/common/models/shared.const.symbols.ts";
|
import { BASE_IS_NEW, EVEN, TARGET_IS_NEW } from "@lib/common/models/shared.const.symbols.ts";
|
||||||
export { BASE_IS_NEW, EVEN, TARGET_IS_NEW };
|
export { BASE_IS_NEW, EVEN, TARGET_IS_NEW };
|
||||||
import { compareMTime } from "@lib/common/utils.database.ts";
|
import { compareMTime } from "@lib/common/utils.ts";
|
||||||
export { compareMTime };
|
export { compareMTime };
|
||||||
export declare function markChangesAreSame(file: AnyEntry | string | UXFileInfoStub, mtime1: number, mtime2: number): true | undefined;
|
export declare function markChangesAreSame(file: AnyEntry | string | UXFileInfoStub, mtime1: number, mtime2: number): true | undefined;
|
||||||
export declare function unmarkChanges(file: AnyEntry | string | UXFileInfoStub): void;
|
export declare function unmarkChanges(file: AnyEntry | string | UXFileInfoStub): void;
|
||||||
|
|||||||
Vendored
+5
-3
@@ -1,6 +1,8 @@
|
|||||||
import type { FilePath } from "@lib/common/models/db.type";
|
// @ts-nocheck
|
||||||
export { addIcon, App, debounce, Editor, FuzzySuggestModal, MarkdownRenderer, MarkdownView, Modal, Notice, Platform, Plugin, PluginSettingTab, requestUrl, sanitizeHTMLToDom, Setting, stringifyYaml, TAbstractFile, TextAreaComponent, TFile, TFolder, parseYaml, ItemView, WorkspaceLeaf, Menu, request, getLanguage, ButtonComponent, TextComponent, ToggleComponent, DropdownComponent, } from "obsidian";
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export type { DataWriteOptions, PluginManifest, RequestUrlParam, RequestUrlResponse, MarkdownFileInfo, ListedFiles, ValueComponent, Stat, } from "obsidian";
|
import { type FilePath } from "@lib/common/types.ts";
|
||||||
|
export { addIcon, App, debounce, Editor, FuzzySuggestModal, MarkdownRenderer, MarkdownView, Modal, Notice, Platform, Plugin, PluginSettingTab, requestUrl, sanitizeHTMLToDom, Setting, stringifyYaml, TAbstractFile, TextAreaComponent, TFile, TFolder, parseYaml, ItemView, WorkspaceLeaf, Menu, request, getLanguage, ButtonComponent, TextComponent, ToggleComponent, DropdownComponent, Component, } from "obsidian";
|
||||||
|
export type { DataWriteOptions, PluginManifest, RequestUrlParam, RequestUrlResponse, MarkdownFileInfo, ListedFiles, ValueComponent, Stat, Command, ViewCreator, } from "obsidian";
|
||||||
declare const normalizePath: <T extends string | FilePath>(from: T) => T;
|
declare const normalizePath: <T extends string | FilePath>(from: T) => T;
|
||||||
export { normalizePath };
|
export { normalizePath };
|
||||||
export { type Diff, DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, diff_match_patch } from "diff-match-patch";
|
export { type Diff, DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, diff_match_patch } from "diff-match-patch";
|
||||||
|
|||||||
+7
-7
@@ -1,11 +1,12 @@
|
|||||||
import { type PluginManifest, type App } from "@/deps.ts";
|
// @ts-nocheck
|
||||||
import type { EntryDoc } from "@lib/common/models/db.definition";
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { LoadedEntry, FilePathWithPrefix, FilePath, AnyEntry } from "@lib/common/models/db.type";
|
import { type PluginManifest } from "@/deps.ts";
|
||||||
|
import type { EntryDoc, LoadedEntry, FilePathWithPrefix, FilePath, AnyEntry } from "@lib/common/types.ts";
|
||||||
import { LiveSyncCommands } from "@/features/LiveSyncCommands.ts";
|
import { LiveSyncCommands } from "@/features/LiveSyncCommands.ts";
|
||||||
import { PeriodicProcessor } from "@/common/PeriodicProcessor.ts";
|
import { PeriodicProcessor } from "@/common/PeriodicProcessor.ts";
|
||||||
import { QueueProcessor } from "octagonal-wheels/concurrency/processor";
|
import { QueueProcessor } from "octagonal-wheels/concurrency/processor";
|
||||||
import type ObsidianLiveSyncPlugin from "@/main.ts";
|
import type ObsidianLiveSyncPlugin from "@/main.ts";
|
||||||
import type { PluginDialogModal } from "./PluginDialogModal.ts";
|
import { PluginDialogModal } from "./PluginDialogModal.ts";
|
||||||
import type { InjectableServiceHub } from "@lib/services/InjectableServices.ts";
|
import type { InjectableServiceHub } from "@lib/services/InjectableServices.ts";
|
||||||
import type { LiveSyncCore } from "@/main.ts";
|
import type { LiveSyncCore } from "@/main.ts";
|
||||||
declare global {
|
declare global {
|
||||||
@@ -78,8 +79,7 @@ export type PluginDataEx = {
|
|||||||
mtime: number;
|
mtime: number;
|
||||||
};
|
};
|
||||||
export declare class ConfigSync extends LiveSyncCommands {
|
export declare class ConfigSync extends LiveSyncCommands {
|
||||||
pluginDialogClass: new (app: App, plugin: ObsidianLiveSyncPlugin) => PluginDialogModal;
|
constructor(plugin: ObsidianLiveSyncPlugin, core: LiveSyncCore);
|
||||||
constructor(plugin: ObsidianLiveSyncPlugin, core: LiveSyncCore, pluginDialogClass: new (app: App, plugin: ObsidianLiveSyncPlugin) => PluginDialogModal);
|
|
||||||
get configDir(): string;
|
get configDir(): string;
|
||||||
get kvDB(): import("../../lib/src/interfaces/KeyValueDatabase.ts").KeyValueDatabase;
|
get kvDB(): import("../../lib/src/interfaces/KeyValueDatabase.ts").KeyValueDatabase;
|
||||||
get useV2(): boolean;
|
get useV2(): boolean;
|
||||||
@@ -91,7 +91,7 @@ export declare class ConfigSync extends LiveSyncCommands {
|
|||||||
showPluginSyncModal(): void;
|
showPluginSyncModal(): void;
|
||||||
hidePluginSyncModal(): void;
|
hidePluginSyncModal(): void;
|
||||||
onunload(): void;
|
onunload(): void;
|
||||||
addRibbonIcon: (icon: string, title: string, callback: (evt: MouseEvent) => any) => HTMLElement; // eslint-disable-line @typescript-eslint/no-explicit-any
|
addRibbonIcon: (icon: string, title: string, callback: (evt: MouseEvent) => unknown) => HTMLElement;
|
||||||
onload(): void;
|
onload(): void;
|
||||||
getFileCategory(filePath: string): "CONFIG" | "THEME" | "SNIPPET" | "PLUGIN_MAIN" | "PLUGIN_ETC" | "PLUGIN_DATA" | "";
|
getFileCategory(filePath: string): "CONFIG" | "THEME" | "SNIPPET" | "PLUGIN_MAIN" | "PLUGIN_ETC" | "PLUGIN_DATA" | "";
|
||||||
isTargetPath(filePath: string): boolean;
|
isTargetPath(filePath: string): boolean;
|
||||||
|
|||||||
+3
-1
@@ -1,6 +1,8 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { mount } from "svelte";
|
import { mount } from "svelte";
|
||||||
import { App, Modal } from "@/deps.ts";
|
import { App, Modal } from "@/deps.ts";
|
||||||
import type ObsidianLiveSyncPlugin from "@/main.ts";
|
import ObsidianLiveSyncPlugin from "@/main.ts";
|
||||||
export declare class PluginDialogModal extends Modal {
|
export declare class PluginDialogModal extends Modal {
|
||||||
plugin: ObsidianLiveSyncPlugin;
|
plugin: ObsidianLiveSyncPlugin;
|
||||||
component: ReturnType<typeof mount> | undefined;
|
component: ReturnType<typeof mount> | undefined;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { App, Modal } from "@/deps.ts";
|
import { App, Modal } from "@/deps.ts";
|
||||||
import type { FilePath, LoadedEntry } from "@lib/common/models/db.type";
|
import { type FilePath, type LoadedEntry } from "@lib/common/types.ts";
|
||||||
import { mount } from "svelte";
|
import { mount } from "svelte";
|
||||||
export declare class JsonResolveModal extends Modal {
|
export declare class JsonResolveModal extends Modal {
|
||||||
filename: FilePath;
|
filename: FilePath;
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import type { LoadedEntry, FilePathWithPrefix, FilePath, DocumentID, MetaEntry } from "@lib/common/models/db.type";
|
// @ts-nocheck
|
||||||
import type { UXFileInfo, UXStat, UXDataWriteOptions } from "@lib/common/models/fileaccess.type";
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
import { type LoadedEntry, type FilePathWithPrefix, type FilePath, type DocumentID, type UXFileInfo, type UXStat, type MetaEntry, type UXDataWriteOptions } from "@lib/common/types.ts";
|
||||||
import { type InternalFileInfo } from "@/common/types.ts";
|
import { type InternalFileInfo } from "@/common/types.ts";
|
||||||
import type { CustomRegExp } from "@lib/common/utils.regexp.ts";
|
import { type CustomRegExp } from "@lib/common/utils.ts";
|
||||||
import { type MapLike } from "@/common/utils.ts";
|
import { type MapLike } from "@/common/utils.ts";
|
||||||
import { PeriodicProcessor } from "@/common/PeriodicProcessor.ts";
|
import { PeriodicProcessor } from "@/common/PeriodicProcessor.ts";
|
||||||
import { LiveSyncCommands } from "@/features/LiveSyncCommands.ts";
|
import { LiveSyncCommands } from "@/features/LiveSyncCommands.ts";
|
||||||
@@ -21,7 +22,7 @@ export declare class HiddenFileSync extends LiveSyncCommands {
|
|||||||
isThisModuleEnabled(): boolean;
|
isThisModuleEnabled(): boolean;
|
||||||
periodicInternalFileScanProcessor: PeriodicProcessor;
|
periodicInternalFileScanProcessor: PeriodicProcessor;
|
||||||
get kvDB(): import("../../lib/src/interfaces/KeyValueDatabase").KeyValueDatabase;
|
get kvDB(): import("../../lib/src/interfaces/KeyValueDatabase").KeyValueDatabase;
|
||||||
getConflictedDoc(path: FilePathWithPrefix, rev: string): Promise<false | import("../../lib/src/common/types").diff_result_leaf>;
|
getConflictedDoc(path: FilePathWithPrefix, rev: string): Promise<false | import("@lib/common/types.ts").diff_result_leaf>;
|
||||||
onunload(): void;
|
onunload(): void;
|
||||||
onload(): void;
|
onload(): void;
|
||||||
private _everyOnDatabaseInitialized;
|
private _everyOnDatabaseInitialized;
|
||||||
|
|||||||
+6
-5
@@ -1,5 +1,6 @@
|
|||||||
import type { AnyEntry, DocumentID, FilePath, FilePathWithPrefix } from "@lib/common/models/db.type";
|
// @ts-nocheck
|
||||||
import type { LOG_LEVEL } from "@lib/common/logger";
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
import { type AnyEntry, type DocumentID, type FilePath, type FilePathWithPrefix, type LOG_LEVEL } from "@lib/common/types.ts";
|
||||||
import type ObsidianLiveSyncPlugin from "@/main.ts";
|
import type ObsidianLiveSyncPlugin from "@/main.ts";
|
||||||
import type { LiveSyncCore } from "@/main.ts";
|
import type { LiveSyncCore } from "@/main.ts";
|
||||||
import { createInstanceLogFunction } from "@lib/services/lib/logUtils.ts";
|
import { createInstanceLogFunction } from "@lib/services/lib/logUtils.ts";
|
||||||
@@ -10,7 +11,7 @@ export declare abstract class LiveSyncCommands {
|
|||||||
plugin: ObsidianLiveSyncPlugin;
|
plugin: ObsidianLiveSyncPlugin;
|
||||||
core: LiveSyncCore;
|
core: LiveSyncCore;
|
||||||
get app(): import("obsidian").App;
|
get app(): import("obsidian").App;
|
||||||
get settings(): import("../lib/src/common/types").ObsidianLiveSyncSettings;
|
get settings(): import("@lib/common/types.ts").ObsidianLiveSyncSettings;
|
||||||
get localDatabase(): import("../lib/src/pouchdb/LiveSyncLocalDB").LiveSyncLocalDB;
|
get localDatabase(): import("../lib/src/pouchdb/LiveSyncLocalDB").LiveSyncLocalDB;
|
||||||
get services(): import("../lib/src/services/InjectableServices").InjectableServiceHub<import("../lib/src/services/implements/obsidian/ObsidianServiceContext").ObsidianServiceContext>;
|
get services(): import("../lib/src/services/InjectableServices").InjectableServiceHub<import("../lib/src/services/implements/obsidian/ObsidianServiceContext").ObsidianServiceContext>;
|
||||||
path2id(filename: FilePathWithPrefix | FilePath, prefix?: string): Promise<DocumentID>;
|
path2id(filename: FilePathWithPrefix | FilePath, prefix?: string): Promise<DocumentID>;
|
||||||
@@ -26,8 +27,8 @@ export declare abstract class LiveSyncCommands {
|
|||||||
_info: (msg: unknown, key?: string) => void;
|
_info: (msg: unknown, key?: string) => void;
|
||||||
_notice: (msg: unknown, key?: string) => void;
|
_notice: (msg: unknown, key?: string) => void;
|
||||||
_progress: (prefix?: string, level?: LOG_LEVEL) => {
|
_progress: (prefix?: string, level?: LOG_LEVEL) => {
|
||||||
log: (msg: unknown) => void;
|
log: (msg: string) => void;
|
||||||
once: (msg: unknown) => void;
|
once: (msg: string) => void;
|
||||||
done: (msg?: string) => void;
|
done: (msg?: string) => void;
|
||||||
};
|
};
|
||||||
_debug: (msg: unknown, key?: string) => void;
|
_debug: (msg: unknown, key?: string) => void;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import type { DocumentID, EntryLeaf } from "@lib/common/models/db.type";
|
// @ts-nocheck
|
||||||
import type { EntryDoc } from "@lib/common/models/db.definition";
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
import { type DocumentID, type EntryDoc, type EntryLeaf } from "@lib/common/types";
|
||||||
import { LiveSyncCommands } from "@/features/LiveSyncCommands";
|
import { LiveSyncCommands } from "@/features/LiveSyncCommands";
|
||||||
type ChunkID = DocumentID;
|
type ChunkID = DocumentID;
|
||||||
type NoteDocumentID = DocumentID;
|
type NoteDocumentID = DocumentID;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { App, Modal } from "@/deps.ts";
|
import { App, Modal } from "@/deps.ts";
|
||||||
import { mount } from "svelte";
|
import { mount } from "svelte";
|
||||||
import type { LiveSyncTrysteroReplicator } from "@lib/replication/trystero/LiveSyncTrysteroReplicator";
|
import type { LiveSyncTrysteroReplicator } from "@lib/replication/trystero/LiveSyncTrysteroReplicator";
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { App } from "@/deps.ts";
|
import { App } from "@/deps.ts";
|
||||||
import type { LiveSyncTrysteroReplicator } from "@lib/replication/trystero/LiveSyncTrysteroReplicator";
|
import type { LiveSyncTrysteroReplicator } from "@lib/replication/trystero/LiveSyncTrysteroReplicator";
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { Menu, WorkspaceLeaf } from "@/deps.ts";
|
import { Menu, WorkspaceLeaf } from "@/deps.ts";
|
||||||
import { SvelteItemView } from "@/common/SvelteItemView.ts";
|
import { SvelteItemView } from "@/common/SvelteItemView.ts";
|
||||||
import { type PeerStatus } from "@lib/replication/trystero/P2PReplicatorPaneCommon.ts";
|
import { type PeerStatus } from "@lib/replication/trystero/P2PReplicatorPaneCommon.ts";
|
||||||
@@ -22,7 +24,7 @@ export declare class P2PReplicatorPaneView extends SvelteItemView {
|
|||||||
getDisplayText(): string;
|
getDisplayText(): string;
|
||||||
onClose(): Promise<void>;
|
onClose(): Promise<void>;
|
||||||
instantiateComponent(target: HTMLElement): {
|
instantiateComponent(target: HTMLElement): {
|
||||||
$on?(type: string, callback: (e: any) => void): () => void; // eslint-disable-line @typescript-eslint/no-explicit-any
|
$on?(type: string, callback: (e: any) => void): () => void; // eslint-disable-line @typescript-eslint/no-explicit-any -- Only type declaration
|
||||||
$set?(props: Partial<Record<string, any>>): void; // eslint-disable-line @typescript-eslint/no-explicit-any
|
$set?(props: Partial<Record<string, any>>): void; // eslint-disable-line @typescript-eslint/no-explicit-any -- Only type declaration
|
||||||
} & Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
} & Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any -- Only type declaration
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { WorkspaceLeaf } from "@/deps.ts";
|
import { WorkspaceLeaf } from "@/deps.ts";
|
||||||
import { SvelteItemView } from "@/common/SvelteItemView.ts";
|
import { SvelteItemView } from "@/common/SvelteItemView.ts";
|
||||||
import type { LiveSyncBaseCore } from "@/LiveSyncBaseCore.ts";
|
import type { LiveSyncBaseCore } from "@/LiveSyncBaseCore.ts";
|
||||||
@@ -13,7 +15,7 @@ export declare class P2PServerStatusPaneView extends SvelteItemView {
|
|||||||
getViewType(): string;
|
getViewType(): string;
|
||||||
getDisplayText(): string;
|
getDisplayText(): string;
|
||||||
instantiateComponent(target: HTMLElement): {
|
instantiateComponent(target: HTMLElement): {
|
||||||
$on?(type: string, callback: (e: any) => void): () => void; // eslint-disable-line @typescript-eslint/no-explicit-any
|
$on?(type: string, callback: (e: any) => void): () => void; // eslint-disable-line @typescript-eslint/no-explicit-any -- Only type declaration
|
||||||
$set?(props: Partial<Record<string, any>>): void; // eslint-disable-line @typescript-eslint/no-explicit-any
|
$set?(props: Partial<Record<string, any>>): void; // eslint-disable-line @typescript-eslint/no-explicit-any -- Only type declaration
|
||||||
} & Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
} & Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any -- Only type declaration
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export { DirectFileManipulator } from "./DirectFileManipulatorV2.ts";
|
export { DirectFileManipulator } from "./DirectFileManipulatorV2.ts";
|
||||||
export type { DirectFileManipulatorOptions } from "./DirectFileManipulatorV2.ts";
|
export type { DirectFileManipulatorOptions } from "./DirectFileManipulatorV2.ts";
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
import { type ObsidianLiveSyncSettings } from "@lib/common/types";
|
||||||
/**
|
/**
|
||||||
* Encode settings to a tiny array to encode in QRCode,
|
* Encode settings to a tiny array to encode in QRCode,
|
||||||
* Due to size limitation of QR code, we encode settings as an array instead of object.
|
* Due to size limitation of QR code, we encode settings as an array instead of object.
|
||||||
|
|||||||
+7
-1
@@ -1,4 +1,10 @@
|
|||||||
import type { FilePathWithPrefix } from "@lib/common/models/db.type";
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
/**
|
||||||
|
* Content-Splitter for Self-hosted LiveSync.
|
||||||
|
* Splits content into manageable chunks for efficient storage and synchronisation.
|
||||||
|
*/
|
||||||
|
import { type FilePathWithPrefix } from "@lib/common/types.ts";
|
||||||
import type { ISettingService } from "@lib/services/base/IService.ts";
|
import type { ISettingService } from "@lib/services/base/IService.ts";
|
||||||
/**
|
/**
|
||||||
* ContentSplitter interface for splitting content into chunks.
|
* ContentSplitter interface for splitting content into chunks.
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import type { SavingEntry } from "@lib/common/models/db.type";
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
import { type SavingEntry } from "@lib/common/types.ts";
|
||||||
import { type ContentSplitterOptions, type SplitOptions } from "./ContentSplitter.ts";
|
import { type ContentSplitterOptions, type SplitOptions } from "./ContentSplitter.ts";
|
||||||
export declare abstract class ContentSplitterCore {
|
export declare abstract class ContentSplitterCore {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { ContentSplitterOptions, SplitOptions } from "./ContentSplitter.ts";
|
import type { ContentSplitterOptions, SplitOptions } from "./ContentSplitter.ts";
|
||||||
import { ContentSplitterBase } from "./ContentSplitterBase.ts";
|
import { ContentSplitterBase } from "./ContentSplitterBase.ts";
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { ContentSplitterOptions, SplitOptions } from "./ContentSplitter";
|
import type { ContentSplitterOptions, SplitOptions } from "./ContentSplitter";
|
||||||
import { ContentSplitterBase } from "./ContentSplitterBase";
|
import { ContentSplitterBase } from "./ContentSplitterBase";
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { ContentSplitterOptions, SplitOptions } from "./ContentSplitter.ts";
|
import type { ContentSplitterOptions, SplitOptions } from "./ContentSplitter.ts";
|
||||||
import { ContentSplitterBase } from "./ContentSplitterBase.ts";
|
import { ContentSplitterBase } from "./ContentSplitterBase.ts";
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import type { SavingEntry } from "@lib/common/models/db.type";
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
import type { SavingEntry } from "@lib/common/types";
|
||||||
import type { ContentSplitterOptions } from "./ContentSplitter";
|
import type { ContentSplitterOptions } from "./ContentSplitter";
|
||||||
import { ContentSplitterCore, type ContentSplitterBase } from "./ContentSplitterBase";
|
import { ContentSplitterCore, type ContentSplitterBase } from "./ContentSplitterBase";
|
||||||
/**
|
/**
|
||||||
|
|||||||
+2
@@ -1,2 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export type { HasSetResult, HasGetInitialData, ComponentHasResult, GuestDialogProps, DialogSvelteComponentBaseProps, DialogControlBase, } from "@lib/services/implements/base/SvelteDialog.ts";
|
export type { HasSetResult, HasGetInitialData, ComponentHasResult, GuestDialogProps, DialogSvelteComponentBaseProps, DialogControlBase, } from "@lib/services/implements/base/SvelteDialog.ts";
|
||||||
export { CONTEXT_DIALOG_CONTROLS, setupDialogContext, getDialogContext, SvelteDialogManagerBase, } from "@lib/services/implements/base/SvelteDialog.ts";
|
export { CONTEXT_DIALOG_CONTROLS, setupDialogContext, getDialogContext, SvelteDialogManagerBase, } from "@lib/services/implements/base/SvelteDialog.ts";
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { type SlipBoard } from "octagonal-wheels/bureau/SlipBoard";
|
import { type SlipBoard } from "octagonal-wheels/bureau/SlipBoard";
|
||||||
declare global {
|
declare global {
|
||||||
interface Slips extends LSSlips {
|
interface Slips extends LSSlips {
|
||||||
|
|||||||
+3
-1
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { CouchDBConnection, BucketSyncSetting, P2PConnectionInfo } from "./models/setting.type";
|
import type { CouchDBConnection, BucketSyncSetting, P2PConnectionInfo } from "./models/setting.type";
|
||||||
export type RemoteConfigurationResult = {
|
export type RemoteConfigurationResult = {
|
||||||
type: "couchdb";
|
type: "couchdb";
|
||||||
@@ -10,7 +12,7 @@ export type RemoteConfigurationResult = {
|
|||||||
settings: P2PConnectionInfo;
|
settings: P2PConnectionInfo;
|
||||||
} | {
|
} | {
|
||||||
type: "webdav";
|
type: "webdav";
|
||||||
settings: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
settings: never;
|
||||||
};
|
};
|
||||||
export declare class ConnectionStringParser {
|
export declare class ConnectionStringParser {
|
||||||
/**
|
/**
|
||||||
|
|||||||
+4
-1
@@ -1,3 +1,6 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
import type { Constructor } from "@lib/common/utils.type";
|
||||||
interface ErrorWithCause extends Error {
|
interface ErrorWithCause extends Error {
|
||||||
cause?: unknown;
|
cause?: unknown;
|
||||||
}
|
}
|
||||||
@@ -34,7 +37,7 @@ export declare class LiveSyncError extends Error implements ErrorWithCause {
|
|||||||
* @example
|
* @example
|
||||||
* LiveSyncError.isCausedBy(someSyncParamsFetchError, SyncParamsNotFoundError); // Returns true if the error is caused by SyncParamsNotFoundError; this is usually represented as SyncParamsFetchError at the uppermost layer.
|
* LiveSyncError.isCausedBy(someSyncParamsFetchError, SyncParamsNotFoundError); // Returns true if the error is caused by SyncParamsNotFoundError; this is usually represented as SyncParamsFetchError at the uppermost layer.
|
||||||
*/
|
*/
|
||||||
static isCausedBy<T extends LiveSyncError>(error: unknown, errorClass: new (...args: any[]) => T): boolean; // eslint-disable-line @typescript-eslint/no-explicit-any
|
static isCausedBy<T extends LiveSyncError>(error: unknown, errorClass: Constructor<T>): boolean;
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of the error class from an existing error.
|
* Creates a new instance of the error class from an existing error.
|
||||||
* @param error The error to wrap.
|
* @param error The error to wrap.
|
||||||
|
|||||||
+6
-5
@@ -1,5 +1,7 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { Confirm } from "@lib/interfaces/Confirm";
|
import type { Confirm } from "@lib/interfaces/Confirm";
|
||||||
import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
|
import { type ObsidianLiveSyncSettings } from "./types";
|
||||||
declare enum ConditionType {
|
declare enum ConditionType {
|
||||||
PLATFORM_CASE_INSENSITIVE = "platform-case-insensitive",
|
PLATFORM_CASE_INSENSITIVE = "platform-case-insensitive",
|
||||||
PLATFORM_CASE_SENSITIVE = "platform-case-sensitive",
|
PLATFORM_CASE_SENSITIVE = "platform-case-sensitive",
|
||||||
@@ -25,7 +27,7 @@ type BaseRule<TType extends string, TValue> = {
|
|||||||
valueDisplayFunc?: (settings: Partial<ObsidianLiveSyncSettings>) => string;
|
valueDisplayFunc?: (settings: Partial<ObsidianLiveSyncSettings>) => string;
|
||||||
obsoleteValues?: TValue[];
|
obsoleteValues?: TValue[];
|
||||||
};
|
};
|
||||||
type NumberRuleExact = BaseRule<"number", number> & {};
|
type NumberRuleExact = BaseRule<"number", number> & {}; // eslint-disable-line @typescript-eslint/no-empty-object-type, @typescript-eslint/ban-types -- Empty object type
|
||||||
type NumberRuleRange = BaseRule<"number", number> & {
|
type NumberRuleRange = BaseRule<"number", number> & {
|
||||||
min?: number;
|
min?: number;
|
||||||
max?: number;
|
max?: number;
|
||||||
@@ -36,10 +38,9 @@ type StringRangeRule = BaseRule<"string", string> & {
|
|||||||
maxLength?: number;
|
maxLength?: number;
|
||||||
regexp?: string;
|
regexp?: string;
|
||||||
};
|
};
|
||||||
type StringRule = BaseRule<"string", string> & {};
|
type StringRule = BaseRule<"string", string> & {}; // eslint-disable-line @typescript-eslint/no-empty-object-type, @typescript-eslint/ban-types -- Empty object type
|
||||||
type BooleanRule = BaseRule<"boolean", boolean> & {};
|
type BooleanRule = BaseRule<"boolean", boolean> & {}; // eslint-disable-line @typescript-eslint/no-empty-object-type, @typescript-eslint/ban-types -- Empty object type
|
||||||
export type RuleForType<T> = T extends number ? NumberRuleExact | NumberRuleRange : T extends string ? StringRule | StringRangeRule : T extends boolean ? BooleanRule : never;
|
export type RuleForType<T> = T extends number ? NumberRuleExact | NumberRuleRange : T extends string ? StringRule | StringRangeRule : T extends boolean ? BooleanRule : never;
|
||||||
export type AnyRule = NumberRuleExact | NumberRuleRange | StringRule | StringRangeRule | BooleanRule;
|
|
||||||
type DoctorCheckSettings = Omit<Partial<ObsidianLiveSyncSettings>, "remoteConfigurations" | "pluginSyncExtendedSetting">;
|
type DoctorCheckSettings = Omit<Partial<ObsidianLiveSyncSettings>, "remoteConfigurations" | "pluginSyncExtendedSetting">;
|
||||||
export type DoctorRegulation = {
|
export type DoctorRegulation = {
|
||||||
version: string;
|
version: string;
|
||||||
|
|||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
declare class Context<T extends Record<string | number | symbol, any> = object> { // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
||||||
_data: Partial<T>;
|
|
||||||
children: WeakRef<Context<T>>[];
|
|
||||||
parent?: Context<T>;
|
|
||||||
constructor(base?: Context<T>, data?: Partial<T>);
|
|
||||||
set<V extends keyof T>(key: V, value: T[V]): void;
|
|
||||||
get<V extends keyof T>(key: V): T[V] | undefined;
|
|
||||||
setInGlobalContext<V extends keyof T>(key: V, value: T[V]): void;
|
|
||||||
setInNearestContext<V extends keyof T>(key: V, value: T[V]): void;
|
|
||||||
spawnContext<V extends Record<string, any>>(data?: V): Context<V & T>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
||||||
_disposeChild(child: Context<any>): void; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
||||||
dispose(): void;
|
|
||||||
}
|
|
||||||
export declare function getContext<T extends U, U extends Record<string, any> = object>(data?: T): Context<T & object>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
||||||
export declare function getIndependentContext<T extends U, U extends Record<string, any> = object>(data?: T): Context<T>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
||||||
export {};
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { getLanguage as ObsidianGetLanguage } from "obsidian";
|
import type { getLanguage as ObsidianGetLanguage } from "obsidian";
|
||||||
export declare function setGetLanguage(func: typeof ObsidianGetLanguage): void;
|
export declare function setGetLanguage(func: typeof ObsidianGetLanguage): void;
|
||||||
export declare function getLanguage(): string;
|
export declare function getLanguage(): string;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
declare const manifestVersion: string;
|
declare const manifestVersion: string;
|
||||||
declare const packageVersion: string;
|
declare const packageVersion: string;
|
||||||
export { manifestVersion, packageVersion };
|
export { manifestVersion, packageVersion };
|
||||||
|
|||||||
Vendored
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { AllMessageKeys, I18N_LANGS } from "./rosetta";
|
import type { AllMessageKeys, I18N_LANGS } from "./rosetta";
|
||||||
import type { TaggedType } from "@lib/common/models/shared.type.util";
|
import type { TaggedType } from "./types";
|
||||||
export declare let currentLang: I18N_LANGS;
|
export declare let currentLang: I18N_LANGS;
|
||||||
export declare function getResolvedLang(lang?: I18N_LANGS): I18N_LANGS;
|
export declare function getResolvedLang(lang?: I18N_LANGS): I18N_LANGS;
|
||||||
export declare function isAutoDisplayLanguage(lang: I18N_LANGS): boolean;
|
export declare function isAutoDisplayLanguage(lang: I18N_LANGS): boolean;
|
||||||
|
|||||||
+2
@@ -1,2 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export * from "octagonal-wheels/common/logger";
|
export * from "octagonal-wheels/common/logger";
|
||||||
export type * from "octagonal-wheels/common/logger";
|
export type * from "octagonal-wheels/common/logger";
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { PartialMessages as def } from "./def.ts";
|
import { PartialMessages as def } from "./def.ts";
|
||||||
import { type MESSAGE } from "@lib/common/rosetta.ts";
|
import { type MESSAGE } from "@lib/common/rosetta.ts";
|
||||||
type MessageKeys = keyof typeof def.def;
|
type MessageKeys = keyof typeof def.def;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const allMessages: {
|
export declare const allMessages: {
|
||||||
readonly "(Active)": {
|
readonly "(Active)": {
|
||||||
readonly def: "(Active)";
|
readonly def: "(Active)";
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const PartialMessages: {
|
export declare const PartialMessages: {
|
||||||
readonly de: {
|
readonly de: {
|
||||||
"(Active)": string;
|
"(Active)": string;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const PartialMessages: {
|
export declare const PartialMessages: {
|
||||||
readonly def: {
|
readonly def: {
|
||||||
"(Active)": string;
|
"(Active)": string;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const PartialMessages: {
|
export declare const PartialMessages: {
|
||||||
readonly es: {
|
readonly es: {
|
||||||
"(Active)": string;
|
"(Active)": string;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const PartialMessages: {
|
export declare const PartialMessages: {
|
||||||
readonly fr: {
|
readonly fr: {
|
||||||
"(BETA) Always overwrite with a newer file": string;
|
"(BETA) Always overwrite with a newer file": string;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const PartialMessages: {
|
export declare const PartialMessages: {
|
||||||
readonly he: {
|
readonly he: {
|
||||||
"(BETA) Always overwrite with a newer file": string;
|
"(BETA) Always overwrite with a newer file": string;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const PartialMessages: {
|
export declare const PartialMessages: {
|
||||||
readonly ja: {
|
readonly ja: {
|
||||||
"(Active)": string;
|
"(Active)": string;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const PartialMessages: {
|
export declare const PartialMessages: {
|
||||||
readonly ko: {
|
readonly ko: {
|
||||||
"(Active)": string;
|
"(Active)": string;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const PartialMessages: {
|
export declare const PartialMessages: {
|
||||||
readonly ru: {
|
readonly ru: {
|
||||||
"(Active)": string;
|
"(Active)": string;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const PartialMessages: {
|
export declare const PartialMessages: {
|
||||||
readonly "zh-tw": {
|
readonly "zh-tw": {
|
||||||
"(Active)": string;
|
"(Active)": string;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const PartialMessages: {
|
export declare const PartialMessages: {
|
||||||
readonly zh: {
|
readonly zh: {
|
||||||
"(Active)": string;
|
"(Active)": string;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export type CouchDBCredentials = BasicCredentials | JWTCredentials;
|
export type CouchDBCredentials = BasicCredentials | JWTCredentials;
|
||||||
export type JWTAlgorithm = "HS256" | "HS512" | "ES256" | "ES512" | "";
|
export type JWTAlgorithm = "HS256" | "HS512" | "ES256" | "ES512" | "";
|
||||||
export type Credential = {
|
export type Credential = {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { DocumentID } from "./db.type";
|
import type { DocumentID } from "./db.type";
|
||||||
export declare const VERSIONING_DOCID: DocumentID;
|
export declare const VERSIONING_DOCID: DocumentID;
|
||||||
export declare const MILESTONE_DOCID: DocumentID;
|
export declare const MILESTONE_DOCID: DocumentID;
|
||||||
|
|||||||
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { MILESTONE_DOCID, NODEINFO_DOCID } from "./db.const";
|
import type { MILESTONE_DOCID, NODEINFO_DOCID } from "./db.const";
|
||||||
import type { AnyEntry, ChunkVersionRange, DatabaseEntry, EntryChunkPack, EntryLeaf, EntryTypes, EntryVersionInfo, LoadedEntry, MetaEntry } from "./db.type";
|
import type { AnyEntry, ChunkVersionRange, DatabaseEntry, EntryChunkPack, EntryLeaf, EntryTypes, EntryVersionInfo, InternalFileEntry, LoadedEntry, MetaEntry, NewEntry, NoteEntry, PlainEntry } from "./db.type";
|
||||||
import type { TweakValues } from "./tweak.definition";
|
import type { TweakValues } from "./tweak.definition";
|
||||||
export type NodeKey = string;
|
export type NodeKey = string;
|
||||||
export interface DeviceInfo {
|
export interface DeviceInfo {
|
||||||
@@ -50,7 +52,7 @@ export interface EntryNodeInfo extends DatabaseEntry {
|
|||||||
nodeid: string;
|
nodeid: string;
|
||||||
v20220607?: boolean;
|
v20220607?: boolean;
|
||||||
}
|
}
|
||||||
export type EntryBody = AnyEntry;
|
export type EntryBody = NoteEntry | NewEntry | PlainEntry | InternalFileEntry;
|
||||||
export type EntryDoc = EntryBody | LoadedEntry | EntryLeaf | EntryVersionInfo | EntryMilestoneInfo | EntryNodeInfo | EntryChunkPack;
|
export type EntryDoc = EntryBody | LoadedEntry | EntryLeaf | EntryVersionInfo | EntryMilestoneInfo | EntryNodeInfo | EntryChunkPack;
|
||||||
export type EntryDocResponse = EntryDoc & PouchDB.Core.IdMeta & PouchDB.Core.GetMeta;
|
export type EntryDocResponse = EntryDoc & PouchDB.Core.IdMeta & PouchDB.Core.GetMeta;
|
||||||
export declare function isMetaEntry(entry: AnyEntry): entry is MetaEntry;
|
export declare function isMetaEntry(entry: AnyEntry): entry is MetaEntry;
|
||||||
|
|||||||
+43
-74
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { TaggedType } from "octagonal-wheels/common/types";
|
import type { TaggedType } from "octagonal-wheels/common/types";
|
||||||
import type { EntryTypes, SYNCINFO_ID } from "./db.const";
|
import type { EntryTypes, SYNCINFO_ID } from "./db.const";
|
||||||
export type FilePath = TaggedType<string, "FilePath">;
|
export type FilePath = TaggedType<string, "FilePath">;
|
||||||
@@ -32,7 +34,7 @@ export interface DatabaseEntry {
|
|||||||
/**
|
/**
|
||||||
* Represents the base structure for an entry that represents a file.
|
* Represents the base structure for an entry that represents a file.
|
||||||
*/
|
*/
|
||||||
export interface EntryBase {
|
export type EntryBase = {
|
||||||
/**
|
/**
|
||||||
* The creation time of the file.
|
* The creation time of the file.
|
||||||
*/
|
*/
|
||||||
@@ -49,7 +51,7 @@ export interface EntryBase {
|
|||||||
* Deleted flag.
|
* Deleted flag.
|
||||||
*/
|
*/
|
||||||
deleted?: boolean;
|
deleted?: boolean;
|
||||||
}
|
};
|
||||||
export type EdenChunk = {
|
export type EdenChunk = {
|
||||||
data: string;
|
data: string;
|
||||||
epoch: number;
|
epoch: number;
|
||||||
@@ -57,106 +59,72 @@ export type EdenChunk = {
|
|||||||
export type EntryWithEden = {
|
export type EntryWithEden = {
|
||||||
eden: Record<DocumentID, EdenChunk>;
|
eden: Record<DocumentID, EdenChunk>;
|
||||||
};
|
};
|
||||||
/**
|
export type NoteEntry = DatabaseEntry & EntryBase & EntryWithEden & {
|
||||||
* Represents the common fields for all database entries representing physical files.
|
|
||||||
*/
|
|
||||||
export interface FileEntryBase extends DatabaseEntry, EntryBase, EntryWithEden {
|
|
||||||
/**
|
/**
|
||||||
* The path of the file.
|
* The path of the file.
|
||||||
*/
|
*/
|
||||||
path: FilePathWithPrefix;
|
path: FilePathWithPrefix;
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Represents an entry that contains children (chunk IDs).
|
* Contents of the file.
|
||||||
*/
|
*/
|
||||||
export interface EntryWithChildren {
|
data: string | string[];
|
||||||
/**
|
|
||||||
* Chunk IDs indicating the contents of the file.
|
|
||||||
*/
|
|
||||||
children: string[];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Represents an entry that contains content data.
|
|
||||||
*/
|
|
||||||
export interface EntryWithData<T = string | string[] | Blob> {
|
|
||||||
/**
|
|
||||||
* Contents / payload of the entry.
|
|
||||||
*/
|
|
||||||
data: T;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Represents an entry that contains document body text.
|
|
||||||
*/
|
|
||||||
export type EntryWithBody = EntryWithData<string | string[]>;
|
|
||||||
/**
|
|
||||||
* Represents an entry that contains a binary Blob.
|
|
||||||
*/
|
|
||||||
export type EntryWithBlob = EntryWithData<Blob>;
|
|
||||||
/**
|
|
||||||
* Represents a legacy note entry where file content is stored directly in the metadata.
|
|
||||||
*/
|
|
||||||
export interface NoteEntry extends FileEntryBase, EntryWithBody {
|
|
||||||
/**
|
/**
|
||||||
* The type of the entry.
|
* The type of the entry.
|
||||||
*/
|
*/
|
||||||
type: EntryTypes["NOTE_LEGACY"];
|
type: EntryTypes["NOTE_LEGACY"];
|
||||||
}
|
};
|
||||||
|
export type NewEntry = DatabaseEntry & EntryBase & EntryWithEden & {
|
||||||
/**
|
/**
|
||||||
* Represents a chunk-split binary file entry.
|
* The path of the file.
|
||||||
*/
|
*/
|
||||||
export interface NewEntry extends FileEntryBase, EntryWithChildren {
|
path: FilePathWithPrefix;
|
||||||
|
/**
|
||||||
|
* Chunk IDs indicating the contents of the file.
|
||||||
|
*/
|
||||||
|
children: string[];
|
||||||
/**
|
/**
|
||||||
* The type of the entry.
|
* The type of the entry.
|
||||||
*/
|
*/
|
||||||
type: EntryTypes["NOTE_BINARY"];
|
type: EntryTypes["NOTE_BINARY"];
|
||||||
}
|
};
|
||||||
|
export type PlainEntry = DatabaseEntry & EntryBase & EntryWithEden & {
|
||||||
/**
|
/**
|
||||||
* Represents a chunk-split plain text file entry.
|
* The path of the file.
|
||||||
*/
|
*/
|
||||||
export interface PlainEntry extends FileEntryBase, EntryWithChildren {
|
path: FilePathWithPrefix;
|
||||||
|
/**
|
||||||
|
* Chunk IDs indicating the contents of the file.
|
||||||
|
*/
|
||||||
|
children: string[];
|
||||||
/**
|
/**
|
||||||
* The type of the entry.
|
* The type of the entry.
|
||||||
*/
|
*/
|
||||||
type: EntryTypes["NOTE_PLAIN"];
|
type: EntryTypes["NOTE_PLAIN"];
|
||||||
}
|
};
|
||||||
/**
|
export type InternalFileEntry = DatabaseEntry & NewEntry & EntryBase & {
|
||||||
* Represents a customization / configuration file entry.
|
deleted?: boolean;
|
||||||
* @deprecated Use NewEntry or PlainEntry directly.
|
};
|
||||||
*/
|
export type AnyEntry = NoteEntry | NewEntry | PlainEntry | InternalFileEntry;
|
||||||
export type InternalFileEntry = NewEntry;
|
export type LoadedEntry = AnyEntry & {
|
||||||
/**
|
data: string | string[];
|
||||||
* Represents any file-related database entry.
|
|
||||||
*/
|
|
||||||
export type AnyEntry = NoteEntry | NewEntry | PlainEntry;
|
|
||||||
/**
|
|
||||||
* Represents a file entry after its contents have been loaded and assembled.
|
|
||||||
*/
|
|
||||||
export type LoadedEntry = AnyEntry & EntryWithBody & {
|
|
||||||
datatype: EntryTypeNotes;
|
datatype: EntryTypeNotes;
|
||||||
};
|
};
|
||||||
/**
|
export type SavingEntry = AnyEntry & {
|
||||||
* Represents a file entry prepared for saving.
|
data: Blob;
|
||||||
*/
|
|
||||||
export type SavingEntry = AnyEntry & EntryWithBlob & {
|
|
||||||
datatype: EntryTypeNotes;
|
datatype: EntryTypeNotes;
|
||||||
};
|
};
|
||||||
/**
|
export type MetaEntry = AnyEntry & {
|
||||||
* Represents a metadata entry (chunked file entry) without full content.
|
children: string[];
|
||||||
*/
|
};
|
||||||
export type MetaEntry = NewEntry | PlainEntry;
|
export type EntryLeaf = DatabaseEntry & {
|
||||||
/**
|
|
||||||
* Represents a leaf (chunk) document in the database.
|
|
||||||
*/
|
|
||||||
export interface EntryLeaf extends DatabaseEntry, EntryWithData<string> {
|
|
||||||
type: EntryTypes["CHUNK"];
|
type: EntryTypes["CHUNK"];
|
||||||
|
data: string;
|
||||||
isCorrupted?: boolean;
|
isCorrupted?: boolean;
|
||||||
}
|
};
|
||||||
/**
|
export type EntryChunkPack = DatabaseEntry & {
|
||||||
* Represents a chunk pack document.
|
|
||||||
*/
|
|
||||||
export interface EntryChunkPack extends DatabaseEntry, EntryWithData<string> {
|
|
||||||
type: EntryTypes["CHUNK_PACK"];
|
type: EntryTypes["CHUNK_PACK"];
|
||||||
}
|
data: string;
|
||||||
|
};
|
||||||
export interface EntryVersionInfo extends DatabaseEntry {
|
export interface EntryVersionInfo extends DatabaseEntry {
|
||||||
type: EntryTypes["VERSION_INFO"];
|
type: EntryTypes["VERSION_INFO"];
|
||||||
version: number;
|
version: number;
|
||||||
@@ -169,7 +137,8 @@ export interface ChunkVersionRange {
|
|||||||
max: number;
|
max: number;
|
||||||
current: number;
|
current: number;
|
||||||
}
|
}
|
||||||
export interface SyncInfo extends DatabaseEntry, EntryWithData<string> {
|
export interface SyncInfo extends DatabaseEntry {
|
||||||
_id: typeof SYNCINFO_ID;
|
_id: typeof SYNCINFO_ID;
|
||||||
type: EntryTypes["SYNC_INFO"];
|
type: EntryTypes["SYNC_INFO"];
|
||||||
|
data: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { AUTO_MERGED, CANCELLED, MISSING_OR_ERROR, NOT_CONFLICTED } from "./shared.const.symbols";
|
import type { AUTO_MERGED, CANCELLED, MISSING_OR_ERROR, NOT_CONFLICTED } from "./shared.const.symbols";
|
||||||
export type diff_result_leaf = {
|
export type diff_result_leaf = {
|
||||||
rev: string;
|
rev: string;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const CHeader = "h:";
|
export declare const CHeader = "h:";
|
||||||
export declare const PSCHeader = "ps:";
|
export declare const PSCHeader = "ps:";
|
||||||
export declare const PSCHeaderEnd = "ps;";
|
export declare const PSCHeaderEnd = "ps;";
|
||||||
|
|||||||
+30
-39
@@ -1,50 +1,41 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { FilePath, FilePathWithPrefix } from "./db.type";
|
import type { FilePath, FilePathWithPrefix } from "./db.type";
|
||||||
export interface UXStat {
|
export type UXStat = {
|
||||||
size: number;
|
size: number;
|
||||||
mtime: number;
|
mtime: number;
|
||||||
ctime: number;
|
ctime: number;
|
||||||
type: "file" | "folder";
|
type: "file" | "folder";
|
||||||
}
|
};
|
||||||
/**
|
export type UXFileInfoStub = {
|
||||||
* Represents the common base properties for any filesystem object stub.
|
name: string;
|
||||||
*/
|
path: FilePath | FilePathWithPrefix;
|
||||||
export interface UXFileSystemStubBase {
|
stat: UXStat;
|
||||||
|
deleted?: boolean;
|
||||||
|
isFolder?: false;
|
||||||
|
isInternal?: boolean;
|
||||||
|
};
|
||||||
|
export type UXFileInfo = UXFileInfoStub & {
|
||||||
|
body: Blob;
|
||||||
|
};
|
||||||
|
export type UXAbstractInfoStub = UXFileInfoStub | UXFolderInfo;
|
||||||
|
export type UXInternalFileInfoStub = {
|
||||||
name: string;
|
name: string;
|
||||||
path: FilePath | FilePathWithPrefix;
|
path: FilePath | FilePathWithPrefix;
|
||||||
deleted?: boolean;
|
deleted?: boolean;
|
||||||
isInternal?: boolean;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Represents a stub for a regular file.
|
|
||||||
*/
|
|
||||||
export interface UXFileInfoStub extends UXFileSystemStubBase {
|
|
||||||
stat: UXStat;
|
|
||||||
isFolder?: false;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Represents a complete file containing its binary body.
|
|
||||||
*/
|
|
||||||
export interface UXFileInfo extends UXFileInfoStub {
|
|
||||||
body: Blob;
|
|
||||||
}
|
|
||||||
export type UXAbstractInfoStub = UXFileInfoStub | UXFolderInfo;
|
|
||||||
/**
|
|
||||||
* Represents a stub for an internal/hidden file.
|
|
||||||
*/
|
|
||||||
export interface UXInternalFileInfoStub extends UXFileSystemStubBase {
|
|
||||||
isFolder?: false;
|
isFolder?: false;
|
||||||
isInternal: true;
|
isInternal: true;
|
||||||
stat: undefined;
|
stat: undefined;
|
||||||
}
|
};
|
||||||
/**
|
export type UXFolderInfo = {
|
||||||
* Represents information about a folder.
|
name: string;
|
||||||
*/
|
path: FilePath | FilePathWithPrefix;
|
||||||
export interface UXFolderInfo extends UXFileSystemStubBase {
|
deleted?: boolean;
|
||||||
isFolder: true;
|
isFolder: true;
|
||||||
children: UXFileInfoStub[];
|
children: UXFileInfoStub[];
|
||||||
parent: FilePath | FilePathWithPrefix | undefined;
|
parent: FilePath | FilePathWithPrefix | undefined;
|
||||||
}
|
};
|
||||||
export interface UXDataWriteOptions {
|
export type UXDataWriteOptions = {
|
||||||
/**
|
/**
|
||||||
* Time of creation, represented as a unix timestamp, in milliseconds.
|
* Time of creation, represented as a unix timestamp, in milliseconds.
|
||||||
* Omit this if you want to keep the default behaviour.
|
* Omit this if you want to keep the default behaviour.
|
||||||
@@ -55,25 +46,25 @@ export interface UXDataWriteOptions {
|
|||||||
* Time of last modification, represented as a unix timestamp, in milliseconds.
|
* Time of last modification, represented as a unix timestamp, in milliseconds.
|
||||||
* Omit this if you want to keep the default behaviour.
|
* Omit this if you want to keep the default behaviour.
|
||||||
* @public
|
* @public
|
||||||
* */
|
*/
|
||||||
mtime?: number;
|
mtime?: number;
|
||||||
}
|
};
|
||||||
export type CacheData = string | ArrayBuffer;
|
export type CacheData = string | ArrayBuffer;
|
||||||
export type FileEventType = "CREATE" | "DELETE" | "CHANGED" | "INTERNAL";
|
export type FileEventType = "CREATE" | "DELETE" | "CHANGED" | "INTERNAL";
|
||||||
export interface FileEventArgs {
|
export type FileEventArgs = {
|
||||||
file: UXFileInfoStub | UXInternalFileInfoStub;
|
file: UXFileInfoStub | UXInternalFileInfoStub;
|
||||||
cache?: CacheData;
|
cache?: CacheData;
|
||||||
oldPath?: string;
|
oldPath?: string;
|
||||||
ctx?: unknown;
|
ctx?: unknown;
|
||||||
}
|
};
|
||||||
export interface FileEventItem {
|
export type FileEventItem = {
|
||||||
type: FileEventType;
|
type: FileEventType;
|
||||||
args: FileEventArgs;
|
args: FileEventArgs;
|
||||||
key: string;
|
key: string;
|
||||||
skipBatchWait?: boolean;
|
skipBatchWait?: boolean;
|
||||||
cancelled?: boolean;
|
cancelled?: boolean;
|
||||||
batched?: boolean;
|
batched?: boolean;
|
||||||
}
|
};
|
||||||
export interface FileWithFileStat extends Omit<UXStat, "type"> {
|
export interface FileWithFileStat extends Omit<UXStat, "type"> {
|
||||||
path: FilePath;
|
path: FilePath;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { FilePath } from "./db.type";
|
import type { FilePath } from "./db.type";
|
||||||
export declare const PREFIXMD_LOGFILE = "livesync_log_";
|
export declare const PREFIXMD_LOGFILE = "livesync_log_";
|
||||||
export declare const PREFIXMD_LOGFILE_UC = "LIVESYNC_LOG_";
|
export declare const PREFIXMD_LOGFILE_UC = "LIVESYNC_LOG_";
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const SETTING_VERSION_INITIAL = 0;
|
export declare const SETTING_VERSION_INITIAL = 0;
|
||||||
export declare const SETTING_VERSION_SUPPORT_CASE_INSENSITIVE = 10;
|
export declare const SETTING_VERSION_SUPPORT_CASE_INSENSITIVE = 10;
|
||||||
export declare const CURRENT_SETTING_VERSION = 10;
|
export declare const CURRENT_SETTING_VERSION = 10;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { type ObsidianLiveSyncSettings, type P2PSyncSetting } from "./setting.type";
|
import { type ObsidianLiveSyncSettings, type P2PSyncSetting } from "./setting.type";
|
||||||
export declare const P2P_DEFAULT_SETTINGS: P2PSyncSetting;
|
export declare const P2P_DEFAULT_SETTINGS: P2PSyncSetting;
|
||||||
export declare const DEFAULT_SETTINGS: ObsidianLiveSyncSettings;
|
export declare const DEFAULT_SETTINGS: ObsidianLiveSyncSettings;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { ObsidianLiveSyncSettings } from "./setting.type";
|
import type { ObsidianLiveSyncSettings } from "./setting.type";
|
||||||
export declare const PREFERRED_BASE: Partial<ObsidianLiveSyncSettings>;
|
export declare const PREFERRED_BASE: Partial<ObsidianLiveSyncSettings>;
|
||||||
export declare const PREFERRED_SETTING_CLOUDANT: Partial<ObsidianLiveSyncSettings>;
|
export declare const PREFERRED_SETTING_CLOUDANT: Partial<ObsidianLiveSyncSettings>;
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { ObsidianLiveSyncSettings } from "./setting.type";
|
import type { ObsidianLiveSyncSettings } from "./setting.type";
|
||||||
export declare const KeyIndexOfSettings: Record<keyof ObsidianLiveSyncSettings, number>;
|
export declare const KeyIndexOfSettings: Record<keyof ObsidianLiveSyncSettings, number>;
|
||||||
|
|||||||
+10
-1
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { ChunkAlgorithms, E2EEAlgorithms, HashAlgorithms, MODE_AUTOMATIC, MODE_PAUSED, MODE_SELECTIVE, MODE_SHINY, RemoteTypes } from "./setting.const";
|
import type { ChunkAlgorithms, E2EEAlgorithms, HashAlgorithms, MODE_AUTOMATIC, MODE_PAUSED, MODE_SELECTIVE, MODE_SHINY, RemoteTypes } from "./setting.const";
|
||||||
import type { I18N_LANGS } from "@lib/common/rosetta";
|
import type { I18N_LANGS } from "@lib/common/rosetta";
|
||||||
import type { CustomRegExpSourceList } from "./shared.type.util";
|
import type { CustomRegExpSourceList } from "./shared.type.util";
|
||||||
@@ -95,6 +97,13 @@ interface SyncMethodSettings {
|
|||||||
* Different from syncOnSave, this is only reacts to the editor save event.
|
* Different from syncOnSave, this is only reacts to the editor save event.
|
||||||
*/
|
*/
|
||||||
syncOnEditorSave: boolean;
|
syncOnEditorSave: boolean;
|
||||||
|
/**
|
||||||
|
* Desktop only, opt-in. Keep replication running while the window is hidden or minimised,
|
||||||
|
* instead of suspending it until the window becomes visible again. The trigger is
|
||||||
|
* document.hidden, not window focus. Applies to the background-capable sync modes (LiveSync
|
||||||
|
* and Periodic). Ignored on mobile. Default false.
|
||||||
|
*/
|
||||||
|
keepReplicationActiveInBackground: boolean;
|
||||||
/**
|
/**
|
||||||
* The minimum delay between synchronisation operations (in milliseconds).
|
* The minimum delay between synchronisation operations (in milliseconds).
|
||||||
* If the operation is triggered before this delay, the operation will be delayed until the delay is over, and executed as a single operation.
|
* If the operation is triggered before this delay, the operation will be delayed until the delay is over, and executed as a single operation.
|
||||||
@@ -883,7 +892,7 @@ export interface RemoteConfigurations {
|
|||||||
*/
|
*/
|
||||||
P2P_ActiveRemoteConfigurationId: string;
|
P2P_ActiveRemoteConfigurationId: string;
|
||||||
}
|
}
|
||||||
interface ObsidianLiveSyncSettings_PluginSetting extends SyncMethodSettings, UISettings, FileHandlingSettings, MergeBehaviourSettings, EncryptedUserSettings, PeriodicReplicationSettings, InternalFileSettings, PluginSyncSettings, ModeSettings, ExtraTweakSettings, BetaTweakSettings, ObsoleteSettings, DebugModeSettings, SettingSyncSettings, SafetyValveSettings, DataOnSettings, RemoteConfigurations {
|
interface ObsidianLiveSyncSettings_PluginSetting extends SyncMethodSettings, UISettings, FileHandlingSettings, MergeBehaviourSettings, EncryptedUserSettings, PeriodicReplicationSettings, InternalFileSettings, PluginSyncSettings, ModeSettings, ExtraTweakSettings, BetaTweakSettings, ObsoleteSettings, DebugModeSettings, SettingSyncSettings, SafetyValveSettings, DataOnSettings, RemoteConfigurations { // eslint-disable-line @typescript-eslint/no-empty-object-type, @typescript-eslint/no-empty-interface -- Empty interface
|
||||||
}
|
}
|
||||||
export type RemoteDBSettings = CouchDBConnection & BucketSyncSetting & RemoteTypeSettings & EncryptionSettings & ChunkSettings & EdenSettings & DataOnRemoteDBSettings & ObsoleteRemoteDBSettings & OnDemandChunkSettings & BetaRemoteDBSettings & ReplicationSetting & RemoteDBTweakSettings & FileHandlingSettings & ProcessingBehaviourSettings & OptionalAndNotExposedRemoteDBSettings & CrossPlatformInteroperabilitySettings & ConflictHandlingSettings & EdgeCaseHandlingSettings & DeletedFileMetadataSettings & P2PSyncSetting & RemoteConfigurations;
|
export type RemoteDBSettings = CouchDBConnection & BucketSyncSetting & RemoteTypeSettings & EncryptionSettings & ChunkSettings & EdenSettings & DataOnRemoteDBSettings & ObsoleteRemoteDBSettings & OnDemandChunkSettings & BetaRemoteDBSettings & ReplicationSetting & RemoteDBTweakSettings & FileHandlingSettings & ProcessingBehaviourSettings & OptionalAndNotExposedRemoteDBSettings & CrossPlatformInteroperabilitySettings & ConflictHandlingSettings & EdgeCaseHandlingSettings & DeletedFileMetadataSettings & P2PSyncSetting & RemoteConfigurations;
|
||||||
export type ObsidianLiveSyncSettings = ObsidianLiveSyncSettings_PluginSetting & RemoteDBSettings & LocalDBSettings;
|
export type ObsidianLiveSyncSettings = ObsidianLiveSyncSettings_PluginSetting & RemoteDBSettings & LocalDBSettings;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const MAX_DOC_SIZE = 1000;
|
export declare const MAX_DOC_SIZE = 1000;
|
||||||
export declare const MAX_DOC_SIZE_BIN = 102400;
|
export declare const MAX_DOC_SIZE_BIN = 102400;
|
||||||
export declare const VER = 12;
|
export declare const VER = 12;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const SETTING_KEY_P2P_DEVICE_NAME = "p2p_device_name";
|
export declare const SETTING_KEY_P2P_DEVICE_NAME = "p2p_device_name";
|
||||||
export declare const configURIBase = "obsidian://setuplivesync?settings=";
|
export declare const configURIBase = "obsidian://setuplivesync?settings=";
|
||||||
export declare const configURIBaseQR = "obsidian://setuplivesync?settingsQR=";
|
export declare const configURIBaseQR = "obsidian://setuplivesync?settingsQR=";
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const CANCELLED: unique symbol;
|
export declare const CANCELLED: unique symbol;
|
||||||
export declare const AUTO_MERGED: unique symbol;
|
export declare const AUTO_MERGED: unique symbol;
|
||||||
export declare const NOT_CONFLICTED: unique symbol;
|
export declare const NOT_CONFLICTED: unique symbol;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { ObsidianLiveSyncSettings } from "./setting.type";
|
import type { ObsidianLiveSyncSettings } from "./setting.type";
|
||||||
export declare const LEVEL_ADVANCED = "ADVANCED";
|
export declare const LEVEL_ADVANCED = "ADVANCED";
|
||||||
export declare const LEVEL_POWER_USER = "POWER_USER";
|
export declare const LEVEL_POWER_USER = "POWER_USER";
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare const DatabaseConnectingStatuses: {
|
export declare const DatabaseConnectingStatuses: {
|
||||||
readonly STARTED: "STARTED";
|
readonly STARTED: "STARTED";
|
||||||
readonly NOT_CONNECTED: "NOT_CONNECTED";
|
readonly NOT_CONNECTED: "NOT_CONNECTED";
|
||||||
|
|||||||
+3
-1
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { TaggedType } from "octagonal-wheels/common/types";
|
import type { TaggedType } from "octagonal-wheels/common/types";
|
||||||
export type { TaggedType };
|
export type { TaggedType };
|
||||||
export type CustomRegExpSource = TaggedType<string, "CustomRegExp">;
|
export type CustomRegExpSource = TaggedType<string, "CustomRegExp">;
|
||||||
@@ -5,4 +7,4 @@ export type CustomRegExpSourceList<D extends string = ","> = TaggedType<string,
|
|||||||
export type ParsedCustomRegExp = [isInverted: boolean, pattern: string];
|
export type ParsedCustomRegExp = [isInverted: boolean, pattern: string];
|
||||||
export type Prettify<T> = {
|
export type Prettify<T> = {
|
||||||
[K in keyof T]: T[K];
|
[K in keyof T]: T[K];
|
||||||
} & {};
|
} & {}; // eslint-disable-line @typescript-eslint/no-empty-object-type, @typescript-eslint/ban-types -- Empty object type
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { EntryTypes } from "./db.const";
|
import { EntryTypes } from "./db.const";
|
||||||
import type { DatabaseEntry, DocumentID } from "./db.type";
|
import type { DatabaseEntry, DocumentID } from "./db.type";
|
||||||
export declare const ProtocolVersions: {
|
export declare const ProtocolVersions: {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { ObsidianLiveSyncSettings } from "./setting.type";
|
import type { ObsidianLiveSyncSettings } from "./setting.type";
|
||||||
export declare const TweakValuesShouldMatchedTemplate: Partial<ObsidianLiveSyncSettings>;
|
export declare const TweakValuesShouldMatchedTemplate: Partial<ObsidianLiveSyncSettings>;
|
||||||
type TweakKeys = keyof TweakValues;
|
type TweakKeys = keyof TweakValues;
|
||||||
@@ -24,6 +26,7 @@ export declare const TweakValuesTemplate: {
|
|||||||
syncOnStart?: boolean | undefined;
|
syncOnStart?: boolean | undefined;
|
||||||
syncOnFileOpen?: boolean | undefined;
|
syncOnFileOpen?: boolean | undefined;
|
||||||
syncOnEditorSave?: boolean | undefined;
|
syncOnEditorSave?: boolean | undefined;
|
||||||
|
keepReplicationActiveInBackground?: boolean | undefined;
|
||||||
syncMinimumInterval?: number | undefined;
|
syncMinimumInterval?: number | undefined;
|
||||||
showVerboseLog?: boolean | undefined;
|
showVerboseLog?: boolean | undefined;
|
||||||
lessInformationInLog?: boolean | undefined;
|
lessInformationInLog?: boolean | undefined;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
/**
|
/**
|
||||||
# Rosetta stone
|
# Rosetta stone
|
||||||
- To localise messages to your language, please write a translation to this file and submit a PR.
|
- To localise messages to your language, please write a translation to this file and submit a PR.
|
||||||
|
|||||||
+13
-11
@@ -1,5 +1,6 @@
|
|||||||
import type { ConfigurationItem } from "@lib/common/models/shared.definition.configNames";
|
// @ts-nocheck
|
||||||
import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
import { type ConfigurationItem, type ObsidianLiveSyncSettings } from "./types.ts";
|
||||||
type ExtractPropertiesByType<T, U> = {
|
type ExtractPropertiesByType<T, U> = {
|
||||||
[K in keyof T as T[K] extends U ? K : never]: T[K] extends U ? K : never;
|
[K in keyof T as T[K] extends U ? K : never]: T[K] extends U ? K : never;
|
||||||
};
|
};
|
||||||
@@ -34,6 +35,7 @@ export declare const AllSettingDefault: {
|
|||||||
syncOnStart: boolean;
|
syncOnStart: boolean;
|
||||||
syncOnFileOpen: boolean;
|
syncOnFileOpen: boolean;
|
||||||
syncOnEditorSave: boolean;
|
syncOnEditorSave: boolean;
|
||||||
|
keepReplicationActiveInBackground: boolean;
|
||||||
syncMinimumInterval: number;
|
syncMinimumInterval: number;
|
||||||
showVerboseLog: boolean;
|
showVerboseLog: boolean;
|
||||||
lessInformationInLog: boolean;
|
lessInformationInLog: boolean;
|
||||||
@@ -59,7 +61,7 @@ export declare const AllSettingDefault: {
|
|||||||
resolveConflictsByNewerFile: boolean;
|
resolveConflictsByNewerFile: boolean;
|
||||||
writeDocumentsIfConflicted: boolean;
|
writeDocumentsIfConflicted: boolean;
|
||||||
disableMarkdownAutoMerge: boolean;
|
disableMarkdownAutoMerge: boolean;
|
||||||
configPassphraseStore: import("@lib/common/models/setting.type").ConfigPassphraseStore;
|
configPassphraseStore: import("./types.ts").ConfigPassphraseStore;
|
||||||
encryptedPassphrase: string;
|
encryptedPassphrase: string;
|
||||||
encryptedCouchDBConnection: string;
|
encryptedCouchDBConnection: string;
|
||||||
periodicReplication: boolean;
|
periodicReplication: boolean;
|
||||||
@@ -80,7 +82,7 @@ export declare const AllSettingDefault: {
|
|||||||
notifyPluginOrSettingUpdated: boolean;
|
notifyPluginOrSettingUpdated: boolean;
|
||||||
usePluginSyncV2: boolean;
|
usePluginSyncV2: boolean;
|
||||||
usePluginEtc: boolean;
|
usePluginEtc: boolean;
|
||||||
pluginSyncExtendedSetting: Record<import("@lib/common/models/setting.type").PluginSyncSettingEntry["key"], import("@lib/common/models/setting.type").PluginSyncSettingEntry>;
|
pluginSyncExtendedSetting: Record<import("./types.ts").PluginSyncSettingEntry["key"], import("./types.ts").PluginSyncSettingEntry>;
|
||||||
useAdvancedMode: boolean;
|
useAdvancedMode: boolean;
|
||||||
usePowerUserMode: boolean;
|
usePowerUserMode: boolean;
|
||||||
useEdgeCaseMode: boolean;
|
useEdgeCaseMode: boolean;
|
||||||
@@ -105,7 +107,7 @@ export declare const AllSettingDefault: {
|
|||||||
isConfigured?: boolean;
|
isConfigured?: boolean;
|
||||||
lastReadUpdates: number;
|
lastReadUpdates: number;
|
||||||
doctorProcessedVersion: string;
|
doctorProcessedVersion: string;
|
||||||
remoteConfigurations: Record<string, import("@lib/common/models/setting.type").RemoteConfiguration>;
|
remoteConfigurations: Record<string, import("./models/setting.type.ts").RemoteConfiguration>;
|
||||||
activeConfigurationId: string;
|
activeConfigurationId: string;
|
||||||
P2P_ActiveRemoteConfigurationId: string;
|
P2P_ActiveRemoteConfigurationId: string;
|
||||||
couchDB_URI: string;
|
couchDB_URI: string;
|
||||||
@@ -129,19 +131,19 @@ export declare const AllSettingDefault: {
|
|||||||
bucketCustomHeaders: string;
|
bucketCustomHeaders: string;
|
||||||
bucketPrefix: string;
|
bucketPrefix: string;
|
||||||
forcePathStyle: boolean;
|
forcePathStyle: boolean;
|
||||||
remoteType: import("@lib/common/models/setting.type").RemoteType;
|
remoteType: import("./types.ts").RemoteType;
|
||||||
encrypt: boolean;
|
encrypt: boolean;
|
||||||
passphrase: string;
|
passphrase: string;
|
||||||
usePathObfuscation: boolean;
|
usePathObfuscation: boolean;
|
||||||
E2EEAlgorithm: import("@lib/common/models/setting.type").E2EEAlgorithm;
|
E2EEAlgorithm: import("./types.ts").E2EEAlgorithm;
|
||||||
hashAlg: import("@lib/common/models/setting.type").HashAlgorithm;
|
hashAlg: import("./types.ts").HashAlgorithm;
|
||||||
minimumChunkSize: number;
|
minimumChunkSize: number;
|
||||||
customChunkSize: number;
|
customChunkSize: number;
|
||||||
longLineThreshold: number;
|
longLineThreshold: number;
|
||||||
useSegmenter: boolean;
|
useSegmenter: boolean;
|
||||||
enableChunkSplitterV2: boolean;
|
enableChunkSplitterV2: boolean;
|
||||||
doNotUseFixedRevisionForChunks: boolean;
|
doNotUseFixedRevisionForChunks: boolean;
|
||||||
chunkSplitterVersion: import("@lib/common/models/setting.type").ChunkSplitterVersion;
|
chunkSplitterVersion: import("./types.ts").ChunkSplitterVersion;
|
||||||
useEden: boolean;
|
useEden: boolean;
|
||||||
maxChunksInEden: number;
|
maxChunksInEden: number;
|
||||||
maxTotalLengthInEden: number;
|
maxTotalLengthInEden: number;
|
||||||
@@ -174,7 +176,7 @@ export declare const AllSettingDefault: {
|
|||||||
useTimeouts: boolean;
|
useTimeouts: boolean;
|
||||||
deleteMetadataOfDeletedFiles: boolean;
|
deleteMetadataOfDeletedFiles: boolean;
|
||||||
automaticallyDeleteMetadataOfDeletedFiles: number;
|
automaticallyDeleteMetadataOfDeletedFiles: number;
|
||||||
P2P_AutoAccepting: import("@lib/common/models/setting.type").AutoAccepting;
|
P2P_AutoAccepting: import("./types.ts").AutoAccepting;
|
||||||
P2P_AutoSyncPeers: string;
|
P2P_AutoSyncPeers: string;
|
||||||
P2P_AutoWatchPeers: string;
|
P2P_AutoWatchPeers: string;
|
||||||
P2P_SyncOnReplication: string;
|
P2P_SyncOnReplication: string;
|
||||||
@@ -208,7 +210,7 @@ export declare function getConfig(key: AllSettingItemKey): false | {
|
|||||||
placeHolder?: string;
|
placeHolder?: string;
|
||||||
status?: "BETA" | "ALPHA" | "EXPERIMENTAL";
|
status?: "BETA" | "ALPHA" | "EXPERIMENTAL";
|
||||||
obsolete?: boolean;
|
obsolete?: boolean;
|
||||||
level?: import("@lib/common/models/shared.definition.configNames").ConfigLevel;
|
level?: import("./types.ts").ConfigLevel;
|
||||||
isHidden?: boolean;
|
isHidden?: boolean;
|
||||||
isAdvanced?: boolean;
|
isAdvanced?: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { DocumentID, FilePath, FilePathWithPrefix } from "./models/db.type";
|
import type { DocumentID, FilePath, FilePathWithPrefix } from "./models/db.type";
|
||||||
import type { UXFileInfoStub } from "@lib/common/models/fileaccess.type";
|
import type { UXFileInfoStub } from "./types";
|
||||||
/**
|
/**
|
||||||
* returns is internal chunk of file
|
* returns is internal chunk of file
|
||||||
* @param id ID
|
* @param id ID
|
||||||
|
|||||||
Vendored
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export type { TaggedType } from "./models/shared.type.util.ts";
|
export type { TaggedType } from "./models/shared.type.util.ts";
|
||||||
export { LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_NOTICE, LOG_LEVEL_URGENT, LOG_LEVEL_VERBOSE, } from "octagonal-wheels/common/logger";
|
export { LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_NOTICE, LOG_LEVEL_URGENT, LOG_LEVEL_VERBOSE, } from "octagonal-wheels/common/logger";
|
||||||
export type { LOG_LEVEL } from "octagonal-wheels/common/logger";
|
export type { LOG_LEVEL } from "octagonal-wheels/common/logger";
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
export declare function resolveWithIgnoreKnownError<T>(p: Promise<T>, def: T): Promise<T>;
|
|
||||||
export declare const Parallels: (ps?: Set<Promise<unknown>>) => {
|
|
||||||
add: (p: Promise<unknown>) => Set<Promise<unknown>>;
|
|
||||||
wait: (limit: number) => false | Promise<unknown>;
|
|
||||||
all: () => Promise<unknown[]>;
|
|
||||||
};
|
|
||||||
export declare function allSettledWithConcurrencyLimit<T>(processes: Promise<T>[], limit: number): Promise<void>;
|
|
||||||
export declare const globalConcurrencyController: import("octagonal-wheels/concurrency/semaphore_v2").SemaphoreObject;
|
|
||||||
export declare function wrapException<T>(func: () => Promise<Awaited<T>>): Promise<Awaited<T> | Error>;
|
|
||||||
export declare function wrapByDefault<T, U>(func: () => T, onError: (err: Error) => U): T | U;
|
|
||||||
Vendored
+114
-8
@@ -1,3 +1,6 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
import { type AnyEntry, type DatabaseEntry, type EntryLeaf, type SyncInfo, type LoadedEntry, type SavingEntry, type NewEntry, type PlainEntry, type CustomRegExpSource, type ParsedCustomRegExp, type CustomRegExpSourceList, type ObsidianLiveSyncSettings, type RemoteDBSettings, type P2PConnectionInfo, type BucketSyncSetting, type CouchDBConnection, type EncryptionSettings } from "./types.ts";
|
||||||
import { replaceAll, replaceAllPairs } from "octagonal-wheels/string";
|
import { replaceAll, replaceAllPairs } from "octagonal-wheels/string";
|
||||||
export { replaceAll, replaceAllPairs };
|
export { replaceAll, replaceAllPairs };
|
||||||
import { concatUInt8Array } from "octagonal-wheels/binary";
|
import { concatUInt8Array } from "octagonal-wheels/binary";
|
||||||
@@ -13,13 +16,116 @@ export { sendValue, sendSignal, waitForSignal, waitForValue };
|
|||||||
import { throttle } from "octagonal-wheels/function";
|
import { throttle } from "octagonal-wheels/function";
|
||||||
export { throttle };
|
export { throttle };
|
||||||
import type { SimpleStore } from "octagonal-wheels/databases/SimpleStoreBase";
|
import type { SimpleStore } from "octagonal-wheels/databases/SimpleStoreBase";
|
||||||
|
import { BASE_IS_NEW, EVEN, TARGET_IS_NEW } from "./models/shared.const.symbols.ts";
|
||||||
export type { SimpleStore };
|
export type { SimpleStore };
|
||||||
export { sizeToHumanReadable } from "octagonal-wheels/number";
|
export { sizeToHumanReadable } from "octagonal-wheels/number";
|
||||||
export * from "./utils.concurrency";
|
export declare function resolveWithIgnoreKnownError<T>(p: Promise<T>, def: T): Promise<T>;
|
||||||
export * from "./utils.timer";
|
export declare const Parallels: (ps?: Set<Promise<unknown>>) => {
|
||||||
export * from "./utils.notations";
|
add: (p: Promise<unknown>) => Set<Promise<unknown>>;
|
||||||
export * from "./utils.database";
|
wait: (limit: number) => false | Promise<unknown>;
|
||||||
export * from "./utils.regexp";
|
all: () => Promise<unknown[]>;
|
||||||
export * from "./utils.settings";
|
};
|
||||||
export * from "./utils.patch";
|
export declare function allSettledWithConcurrencyLimit<T>(processes: Promise<T>[], limit: number): Promise<void>;
|
||||||
export * from "./utils.misc";
|
export declare function getDocData(doc: string | string[]): string;
|
||||||
|
export declare function getDocDataAsArray(doc: string | string[]): string[];
|
||||||
|
export declare function getDocDataAsArrayBuffer(doc: string | string[] | ArrayBuffer): Uint8Array;
|
||||||
|
export declare function isTextBlob(blob: Blob): boolean;
|
||||||
|
export declare function createTextBlob(data: string | string[]): Blob;
|
||||||
|
export declare function createBinaryBlob(data: Uint8Array | ArrayBuffer): Blob;
|
||||||
|
export declare function createBlob(data: string | string[] | Uint8Array | ArrayBuffer | Blob): Blob;
|
||||||
|
export declare function isTextDocument(doc: LoadedEntry): boolean;
|
||||||
|
export declare function readAsBlob(doc: LoadedEntry): Blob;
|
||||||
|
export declare function readContent(doc: LoadedEntry): string | ArrayBuffer;
|
||||||
|
export declare function isDocContentSame(docA: string | string[] | Blob | ArrayBuffer, docB: string | string[] | Blob | ArrayBuffer): Promise<boolean>;
|
||||||
|
export declare function isObfuscatedEntry(doc: DatabaseEntry): doc is AnyEntry;
|
||||||
|
export declare function isEncryptedChunkEntry(doc: DatabaseEntry): doc is EntryLeaf;
|
||||||
|
export declare function isSyncInfoEntry(doc: DatabaseEntry): doc is SyncInfo;
|
||||||
|
export declare function memorizeFuncWithLRUCache<T, U>(func: (key: T) => U): (key: T) => U | undefined;
|
||||||
|
export declare function memorizeFuncWithLRUCacheMulti<T extends unknown[], U>(func: (...keys: T) => U): (keys: T) => U | undefined;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param exclusion return only not exclusion
|
||||||
|
* @returns
|
||||||
|
*
|
||||||
|
* ["something",false,"aaaaa"].filter(onlyNot(false)) => yields ["something","aaaaaa"]. but, as string[].
|
||||||
|
*/
|
||||||
|
export declare function onlyNot<A, B>(exclusion: B): (item: A | B) => item is Exclude<A, B>;
|
||||||
|
/**
|
||||||
|
* Run task with keeping minimum interval
|
||||||
|
* @param key waiting key
|
||||||
|
* @param interval interval (ms)
|
||||||
|
* @param task task to perform.
|
||||||
|
* @returns result of task
|
||||||
|
* @remarks This function is not designed to be concurrent.
|
||||||
|
*/
|
||||||
|
export declare function runWithInterval<T>(key: string, interval: number, task: () => Promise<T>): Promise<T>;
|
||||||
|
/**
|
||||||
|
* Run task with keeping minimum interval on start
|
||||||
|
* @param key waiting key
|
||||||
|
* @param interval interval (ms)
|
||||||
|
* @param task task to perform.
|
||||||
|
* @returns result of task
|
||||||
|
* @remarks This function is not designed to be concurrent.
|
||||||
|
*/
|
||||||
|
export declare function runWithStartInterval<T>(key: string, interval: number, task: () => Promise<T>): Promise<T>;
|
||||||
|
export declare const globalConcurrencyController: import("octagonal-wheels/concurrency/semaphore_v2").SemaphoreObject;
|
||||||
|
export declare function determineTypeFromBlob(data: Blob): "newnote" | "plain";
|
||||||
|
export declare function determineType(path: string, data: string | string[] | Uint8Array | ArrayBuffer | Blob): "newnote" | "plain";
|
||||||
|
export declare function isAnyNote(doc: DatabaseEntry): doc is NewEntry | PlainEntry;
|
||||||
|
export declare function isLoadedEntry(doc: DatabaseEntry): doc is LoadedEntry;
|
||||||
|
export declare function isDeletedEntry(doc: LoadedEntry): boolean;
|
||||||
|
export declare function createSavingEntryFromLoadedEntry(doc: LoadedEntry): SavingEntry;
|
||||||
|
export declare function setAllItems<T>(set: Set<T>, items: T[]): Set<T>;
|
||||||
|
export declare function escapeNewLineFromString(str: string): string;
|
||||||
|
export declare function unescapeNewLineFromString(str: string): string;
|
||||||
|
export declare function escapeMarkdownValue<T>(value: T): T;
|
||||||
|
export declare function timeDeltaToHumanReadable(delta: number): string;
|
||||||
|
export declare function wrapException<T>(func: () => Promise<Awaited<T>>): Promise<Awaited<T> | Error>;
|
||||||
|
export declare function toRanges(sorted: number[]): string;
|
||||||
|
export declare function isDirty(key: string, value: unknown): boolean;
|
||||||
|
export declare function tryParseJSON<T extends object>(str: string, fallbackValue?: T): T | undefined;
|
||||||
|
export { mergeObject, applyPatch, generatePatchObj, flattenObject, isObjectMargeApplicable, isSensibleMargeApplicable, } from "./utils.patch.ts";
|
||||||
|
export declare function parseHeaderValues(strHeader: string): Record<string, string>;
|
||||||
|
/***
|
||||||
|
* Parse custom regular expression
|
||||||
|
* @param regexp
|
||||||
|
* @returns [negate: boolean, regexp: string]
|
||||||
|
* @example `!!foo` => [true, "foo"]
|
||||||
|
* @example `foo` => [false, "foo"]
|
||||||
|
*/
|
||||||
|
export declare function parseCustomRegExp(regexp: CustomRegExpSource): ParsedCustomRegExp;
|
||||||
|
export declare function matchRegExp(regexp: CustomRegExpSource, target: string): boolean;
|
||||||
|
export declare function isValidRegExp(regexp: CustomRegExpSource): boolean;
|
||||||
|
export declare function isInvertedRegExp(regexp: CustomRegExpSource): boolean;
|
||||||
|
export declare function constructCustomRegExpList<D extends string>(items: CustomRegExpSource[], delimiter: D): CustomRegExpSourceList<D>;
|
||||||
|
export declare function splitCustomRegExpList<D extends string>(list: CustomRegExpSourceList<D>, delimiter: D): CustomRegExpSource[];
|
||||||
|
export declare class CustomRegExp {
|
||||||
|
regexp: RegExp;
|
||||||
|
negate: boolean;
|
||||||
|
pattern: string;
|
||||||
|
constructor(regexp: CustomRegExpSource, flags?: string);
|
||||||
|
test(str: string): boolean;
|
||||||
|
}
|
||||||
|
type RegExpSettingKey = "syncOnlyRegEx" | "syncIgnoreRegEx" | "syncInternalFilesIgnorePatterns" | "syncInternalFilesTargetPatterns" | "syncInternalFileOverwritePatterns";
|
||||||
|
export declare function getFileRegExp(settings: ObsidianLiveSyncSettings | RemoteDBSettings, key: RegExpSettingKey): CustomRegExp[];
|
||||||
|
/**
|
||||||
|
* Copies properties from the source object to the target object only if they exist in the target.
|
||||||
|
* @param source The object to copy properties from.
|
||||||
|
* @param target The object to copy properties to.
|
||||||
|
*/
|
||||||
|
export declare function copyTo<T extends object, U extends T>(source: U, target: T): void;
|
||||||
|
export declare function pickBucketSyncSettings(setting: ObsidianLiveSyncSettings): BucketSyncSetting;
|
||||||
|
export declare function pickCouchDBSyncSettings(setting: ObsidianLiveSyncSettings): CouchDBConnection;
|
||||||
|
export declare function pickEncryptionSettings(setting: ObsidianLiveSyncSettings | EncryptionSettings): EncryptionSettings;
|
||||||
|
export declare function pickP2PSyncSettings(setting: Partial<ObsidianLiveSyncSettings> & P2PConnectionInfo): P2PConnectionInfo;
|
||||||
|
export declare function wrapByDefault<T, U>(func: () => T, onError: (err: Error) => U): T | U;
|
||||||
|
export declare function compareMTime(baseMTime: number, targetMTime: number): typeof BASE_IS_NEW | typeof TARGET_IS_NEW | typeof EVEN;
|
||||||
|
export declare function displayRev(rev: string): string;
|
||||||
|
/**
|
||||||
|
* Generate a random P2P Room ID in the format `123-456-789-abc`.
|
||||||
|
*/
|
||||||
|
export declare function generateP2PRoomId(): string;
|
||||||
|
/**
|
||||||
|
* Extract the stable suffix (last segment) from a Room ID.
|
||||||
|
*/
|
||||||
|
export declare function extractP2PRoomSuffix(roomId: string): string;
|
||||||
|
|||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
import type { AnyEntry, DatabaseEntry, EntryLeaf, SyncInfo, LoadedEntry, SavingEntry, NewEntry, PlainEntry } from "@lib/common/models/db.type";
|
|
||||||
import { BASE_IS_NEW, EVEN, TARGET_IS_NEW } from "./models/shared.const.symbols.ts";
|
|
||||||
export declare function getDocData(doc: string | string[]): string;
|
|
||||||
export declare function getDocDataAsArray(doc: string | string[]): string[];
|
|
||||||
export declare function getDocDataAsArrayBuffer(doc: string | string[] | ArrayBuffer): Uint8Array<ArrayBuffer>;
|
|
||||||
export declare function isTextBlob(blob: Blob): boolean;
|
|
||||||
export declare function createTextBlob(data: string | string[]): Blob;
|
|
||||||
export declare function createBinaryBlob(data: Uint8Array<ArrayBuffer> | ArrayBuffer): Blob;
|
|
||||||
export declare function createBlob(data: string | string[] | Uint8Array<ArrayBuffer> | ArrayBuffer | Blob): Blob;
|
|
||||||
export declare function isTextDocument(doc: LoadedEntry): boolean;
|
|
||||||
export declare function readAsBlob(doc: LoadedEntry): Blob;
|
|
||||||
export declare function readContent(doc: LoadedEntry): string | ArrayBuffer;
|
|
||||||
export declare function isDocContentSame(docA: string | string[] | Blob | ArrayBuffer, docB: string | string[] | Blob | ArrayBuffer): Promise<boolean>;
|
|
||||||
export declare function isObfuscatedEntry(doc: DatabaseEntry): doc is AnyEntry;
|
|
||||||
export declare function isEncryptedChunkEntry(doc: DatabaseEntry): doc is EntryLeaf;
|
|
||||||
export declare function isSyncInfoEntry(doc: DatabaseEntry): doc is SyncInfo;
|
|
||||||
export declare function determineTypeFromBlob(data: Blob): "newnote" | "plain";
|
|
||||||
export declare function determineType(path: string, data: string | string[] | Uint8Array | ArrayBuffer | Blob): "newnote" | "plain";
|
|
||||||
export declare function isAnyNote(doc: DatabaseEntry): doc is NewEntry | PlainEntry;
|
|
||||||
export declare function isLoadedEntry(doc: DatabaseEntry): doc is LoadedEntry;
|
|
||||||
export declare function isDeletedEntry(doc: LoadedEntry): boolean;
|
|
||||||
export declare function createSavingEntryFromLoadedEntry(doc: LoadedEntry): SavingEntry;
|
|
||||||
export declare function compareMTime(baseMTime: number, targetMTime: number): typeof BASE_IS_NEW | typeof TARGET_IS_NEW | typeof EVEN;
|
|
||||||
+5
@@ -1,3 +1,6 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
export declare function isErrorOf(ex: unknown, statusCode: number): boolean;
|
||||||
/**
|
/**
|
||||||
* Checks if the error is effectively a 404 error from CouchDB or PouchDB.
|
* Checks if the error is effectively a 404 error from CouchDB or PouchDB.
|
||||||
* @param ex some error object, expected to be from CouchDB or PouchDB.
|
* @param ex some error object, expected to be from CouchDB or PouchDB.
|
||||||
@@ -5,4 +8,6 @@
|
|||||||
* @throws if the input is not an object or does not have a numeric "status" property.
|
* @throws if the input is not an object or does not have a numeric "status" property.
|
||||||
*/
|
*/
|
||||||
export declare function isNotFoundError(ex: unknown): boolean;
|
export declare function isNotFoundError(ex: unknown): boolean;
|
||||||
|
export declare function isConflictError(ex: unknown): boolean;
|
||||||
|
export declare function isUnauthorizedError(ex: unknown): boolean;
|
||||||
export declare function tryGetFilePath(entry: unknown): string | undefined;
|
export declare function tryGetFilePath(entry: unknown): string | undefined;
|
||||||
|
|||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
export declare function tryParseJSON<T extends object>(str: string, fallbackValue?: T): T | undefined;
|
|
||||||
export declare function parseHeaderValues(strHeader: string): Record<string, string>;
|
|
||||||
export declare function memorizeFuncWithLRUCache<T, U>(func: (key: T) => U): (key: T) => U | undefined;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param exclusion return only not exclusion
|
|
||||||
* @returns
|
|
||||||
*
|
|
||||||
* ["something",false,"aaaaa"].filter(onlyNot(false)) => yields ["something","aaaaaa"]. but, as string[].
|
|
||||||
*/
|
|
||||||
export declare function onlyNot<A, B>(exclusion: B): (item: A | B) => item is Exclude<A, B>;
|
|
||||||
export declare function isDirty(key: string, value: unknown): boolean;
|
|
||||||
export declare function setAllItems<T>(set: Set<T>, items: T[]): Set<T>;
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
export declare function escapeNewLineFromString(str: string): string;
|
|
||||||
export declare function unescapeNewLineFromString(str: string): string;
|
|
||||||
export declare function escapeMarkdownValue<T>(value: T): T;
|
|
||||||
export declare function timeDeltaToHumanReadable(delta: number): string;
|
|
||||||
export declare function toRanges(sorted: number[]): string;
|
|
||||||
export declare function displayRev(rev: string): string;
|
|
||||||
+2
@@ -1,2 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare function asCopy<T>(obj: T): T;
|
export declare function asCopy<T>(obj: T): T;
|
||||||
export declare function ensureError(error: unknown): Error;
|
export declare function ensureError(error: unknown): Error;
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export declare function generatePatchObj(from: Record<string | number | symbol, unknown>, to: Record<string | number | symbol, unknown>): Record<string | number | symbol, unknown>;
|
export declare function generatePatchObj(from: Record<string | number | symbol, unknown>, to: Record<string | number | symbol, unknown>): Record<string | number | symbol, unknown>;
|
||||||
export declare function applyPatch(from: Record<string | number | symbol, unknown>, patch: Record<string | number | symbol, unknown>): Record<string | number | symbol, unknown>;
|
export declare function applyPatch(from: Record<string | number | symbol, unknown>, patch: Record<string | number | symbol, unknown>): Record<string | number | symbol, unknown>;
|
||||||
export declare function mergeObject(objA: Record<string | number | symbol, unknown> | [unknown], objB: Record<string | number | symbol, unknown> | [unknown]): unknown[] | {
|
export declare function mergeObject(objA: Record<string | number | symbol, unknown> | [unknown], objB: Record<string | number | symbol, unknown> | [unknown]): unknown[] | {
|
||||||
|
|||||||
-25
@@ -1,25 +0,0 @@
|
|||||||
import type { CustomRegExpSource, ParsedCustomRegExp, CustomRegExpSourceList } from "@lib/common/models/shared.type.util";
|
|
||||||
import type { ObsidianLiveSyncSettings, RemoteDBSettings } from "@lib/common/models/setting.type";
|
|
||||||
/***
|
|
||||||
* Parse custom regular expression
|
|
||||||
* @param regexp
|
|
||||||
* @returns [negate: boolean, regexp: string]
|
|
||||||
* @example `!!foo` => [true, "foo"]
|
|
||||||
* @example `foo` => [false, "foo"]
|
|
||||||
*/
|
|
||||||
export declare function parseCustomRegExp(regexp: CustomRegExpSource): ParsedCustomRegExp;
|
|
||||||
export declare function matchRegExp(regexp: CustomRegExpSource, target: string): boolean;
|
|
||||||
export declare function isValidRegExp(regexp: CustomRegExpSource): boolean;
|
|
||||||
export declare function isInvertedRegExp(regexp: CustomRegExpSource): boolean;
|
|
||||||
export declare function constructCustomRegExpList<D extends string>(items: CustomRegExpSource[], delimiter: D): CustomRegExpSourceList<D>;
|
|
||||||
export declare function splitCustomRegExpList<D extends string>(list: CustomRegExpSourceList<D>, delimiter: D): CustomRegExpSource[];
|
|
||||||
export declare class CustomRegExp {
|
|
||||||
regexp: RegExp;
|
|
||||||
negate: boolean;
|
|
||||||
pattern: string;
|
|
||||||
constructor(regexp: CustomRegExpSource, flags?: string);
|
|
||||||
test(str: string): boolean;
|
|
||||||
}
|
|
||||||
type RegExpSettingKey = "syncOnlyRegEx" | "syncIgnoreRegEx" | "syncInternalFilesIgnorePatterns" | "syncInternalFilesTargetPatterns" | "syncInternalFileOverwritePatterns";
|
|
||||||
export declare function getFileRegExp(settings: ObsidianLiveSyncSettings | RemoteDBSettings, key: RegExpSettingKey): CustomRegExp[];
|
|
||||||
export {};
|
|
||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
import type { ObsidianLiveSyncSettings, P2PConnectionInfo, BucketSyncSetting, CouchDBConnection, EncryptionSettings } from "@lib/common/models/setting.type";
|
|
||||||
/**
|
|
||||||
* Copies properties from the source object to the target object only if they exist in the target.
|
|
||||||
* @param source The object to copy properties from.
|
|
||||||
* @param target The object to copy properties to.
|
|
||||||
*/
|
|
||||||
export declare function copyTo<T extends object, U extends T>(source: U, target: T): void;
|
|
||||||
export declare function pickBucketSyncSettings(setting: ObsidianLiveSyncSettings): BucketSyncSetting;
|
|
||||||
export declare function pickCouchDBSyncSettings(setting: ObsidianLiveSyncSettings): CouchDBConnection;
|
|
||||||
export declare function pickEncryptionSettings(setting: ObsidianLiveSyncSettings | EncryptionSettings): EncryptionSettings;
|
|
||||||
export declare function pickP2PSyncSettings(setting: Partial<ObsidianLiveSyncSettings> & P2PConnectionInfo): P2PConnectionInfo;
|
|
||||||
/**
|
|
||||||
* Generate a random P2P Room ID in the format `123-456-789-abc`.
|
|
||||||
*/
|
|
||||||
export declare function generateP2PRoomId(): string;
|
|
||||||
/**
|
|
||||||
* Extract the stable suffix (last segment) from a Room ID.
|
|
||||||
*/
|
|
||||||
export declare function extractP2PRoomSuffix(roomId: string): string;
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
/**
|
|
||||||
* Run task with keeping minimum interval
|
|
||||||
* @param key waiting key
|
|
||||||
* @param interval interval (ms)
|
|
||||||
* @param task task to perform.
|
|
||||||
* @returns result of task
|
|
||||||
* @remarks This function is not designed to be concurrent.
|
|
||||||
*/
|
|
||||||
export declare function runWithInterval<T>(key: string, interval: number, task: () => Promise<T>): Promise<T>;
|
|
||||||
/**
|
|
||||||
* Run task with keeping minimum interval on start
|
|
||||||
* @param key waiting key
|
|
||||||
* @param interval interval (ms)
|
|
||||||
* @param task task to perform.
|
|
||||||
* @returns result of task
|
|
||||||
* @remarks This function is not designed to be concurrent.
|
|
||||||
*/
|
|
||||||
export declare function runWithStartInterval<T>(key: string, interval: number, task: () => Promise<T>): Promise<T>;
|
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
export type Constructor<T> = new (...args: any[]) => T; // eslint-disable-line @typescript-eslint/no-explicit-any -- Only type declaration
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import type { SimpleStore } from "octagonal-wheels/databases/SimpleStoreBase";
|
import type { SimpleStore } from "octagonal-wheels/databases/SimpleStoreBase";
|
||||||
export declare class StoredMapLike<U> {
|
export declare class StoredMapLike<U> {
|
||||||
_store: SimpleStore<U>;
|
_store: SimpleStore<U>;
|
||||||
|
|||||||
Vendored
+6
-4
@@ -1,5 +1,7 @@
|
|||||||
type InstanceHaveOnBindFunction = {
|
// @ts-nocheck
|
||||||
onBindFunction: (core: any, services: any) => void; // eslint-disable-line @typescript-eslint/no-explicit-any
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
} & Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
interface InstanceHaveOnBindFunction<T> {
|
||||||
export declare function __$checkInstanceBinding<T extends InstanceHaveOnBindFunction>(instance: T): void;
|
onBindFunction: (...params: T[]) => void;
|
||||||
|
}
|
||||||
|
export declare function __$checkInstanceBinding<T extends InstanceHaveOnBindFunction<any>>(instance: T): void; // eslint-disable-line @typescript-eslint/no-explicit-any -- Only type declaration
|
||||||
export {};
|
export {};
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { encryptHKDFWorker, decryptHKDFWorker } from "@lib/worker/bgWorker.ts";
|
import { encryptHKDFWorker, decryptHKDFWorker } from "@lib/worker/bgWorker.ts";
|
||||||
export declare const encryptHKDF: typeof encryptHKDFWorker;
|
export declare const encryptHKDF: typeof encryptHKDFWorker;
|
||||||
export declare const decryptHKDF: typeof decryptHKDFWorker;
|
export declare const decryptHKDF: typeof decryptHKDFWorker;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
/**
|
/**
|
||||||
* Encrypts a string using a passphrase, unless the string is already encrypted.
|
* Encrypts a string using a passphrase, unless the string is already encrypted.
|
||||||
*
|
*
|
||||||
|
|||||||
+3
-11
@@ -1,5 +1,6 @@
|
|||||||
import type { FilePathWithPrefix } from "@lib/common/models/db.type";
|
// @ts-nocheck
|
||||||
import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
|
import type { FilePathWithPrefix, ObsidianLiveSyncSettings } from "@lib/common/types";
|
||||||
export declare const EVENT_LAYOUT_READY = "layout-ready";
|
export declare const EVENT_LAYOUT_READY = "layout-ready";
|
||||||
export declare const EVENT_PLUGIN_LOADED = "plugin-loaded";
|
export declare const EVENT_PLUGIN_LOADED = "plugin-loaded";
|
||||||
export declare const EVENT_PLUGIN_UNLOADED = "plugin-unloaded";
|
export declare const EVENT_PLUGIN_UNLOADED = "plugin-unloaded";
|
||||||
@@ -15,7 +16,6 @@ export declare const EVENT_REQUEST_SHOW_SETUP_QR = "request-show-setup-qr";
|
|||||||
export declare const EVENT_REQUEST_RELOAD_SETTING_TAB = "reload-setting-tab";
|
export declare const EVENT_REQUEST_RELOAD_SETTING_TAB = "reload-setting-tab";
|
||||||
export declare const EVENT_REQUEST_OPEN_PLUGIN_SYNC_DIALOG = "request-open-plugin-sync-dialog";
|
export declare const EVENT_REQUEST_OPEN_PLUGIN_SYNC_DIALOG = "request-open-plugin-sync-dialog";
|
||||||
export declare const EVENT_FILE_CHANGED = "event-file-changed";
|
export declare const EVENT_FILE_CHANGED = "event-file-changed";
|
||||||
export declare const EVENT_DOCUMENT_STUB_CREATED = "document-stub-created";
|
|
||||||
export declare const EVENT_REQUEST_OPEN_P2P_SETTINGS = "request-open-p2p-settings";
|
export declare const EVENT_REQUEST_OPEN_P2P_SETTINGS = "request-open-p2p-settings";
|
||||||
export declare const EVENT_REQUEST_OPEN_P2P = "request-open-p2p";
|
export declare const EVENT_REQUEST_OPEN_P2P = "request-open-p2p";
|
||||||
export declare const EVENT_REQUEST_CLOSE_P2P = "request-close-p2p";
|
export declare const EVENT_REQUEST_CLOSE_P2P = "request-close-p2p";
|
||||||
@@ -31,14 +31,6 @@ declare global {
|
|||||||
file: FilePathWithPrefix;
|
file: FilePathWithPrefix;
|
||||||
automated: boolean;
|
automated: boolean;
|
||||||
};
|
};
|
||||||
[EVENT_DOCUMENT_STUB_CREATED]: {
|
|
||||||
toc: Set<string>;
|
|
||||||
stub: {
|
|
||||||
[key: string]: {
|
|
||||||
[key: string]: Map<string, Record<string, string>>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
[EVENT_FILE_RENAMED]: {
|
[EVENT_FILE_RENAMED]: {
|
||||||
newPath: FilePathWithPrefix;
|
newPath: FilePathWithPrefix;
|
||||||
old: FilePathWithPrefix;
|
old: FilePathWithPrefix;
|
||||||
|
|||||||
Vendored
+2
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
import { EventHub } from "octagonal-wheels/events";
|
import { EventHub } from "octagonal-wheels/events";
|
||||||
declare global {
|
declare global {
|
||||||
interface LSEvents {
|
interface LSEvents {
|
||||||
|
|||||||
Vendored
+2
@@ -1 +1,3 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
|
||||||
export { DirectFileManipulator, type DirectFileManipulatorOptions } from "./API/DirectFileManipulator.ts";
|
export { DirectFileManipulator, type DirectFileManipulatorOptions } from "./API/DirectFileManipulator.ts";
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user