Compare commits

..

50 Commits

Author SHA1 Message Date
vorotamoroz
f62db5fe73 WIP (pluginV2) 2026-06-22 12:14:48 +09:00
vorotamoroz
c57b8a5f4e Write the minimal CoC. Welcome your feedback! 2026-06-19 12:13:23 +01:00
vorotamoroz
f90a83ef1e Update docs 2026-06-19 11:33:38 +01:00
vorotamoroz
62f44e38c0 Releasing 0.25.77 (#968)
Squash commits
2026-06-19 17:45:37 +09:00
vorotamoroz
c6c4044f3c Merge pull request #965 from vrtmrz/refactor_structure
Refactor structure (2)
2026-06-18 10:44:41 +09:00
vorotamoroz
2bd7832d71 Merge pull request #964 from mugenrei/main
Merge upstream
2026-06-18 10:43:08 +09:00
vorotamoroz
72033472f3 add dependency explicitly 2026-06-17 10:36:38 +01:00
vorotamoroz
93dc03e86f remove unused dependencies, update some dependencies 2026-06-17 10:05:45 +01:00
vorotamoroz
dae8443fe8 update more deps 2026-06-17 06:35:14 +01:00
vorotamoroz
88a8bcbd5a barrel node specific modules to summarise the warnings 2026-06-17 06:15:25 +01:00
vorotamoroz
4a5283543d for automatic review 2026-06-17 06:10:30 +01:00
vorotamoroz
7895336189 revert deno test 2026-06-17 06:08:40 +01:00
vorotamoroz
2d5cdccf7d for automatic review 2026-06-17 05:51:01 +01:00
mugenrei
28cdf40fcd Merge branch 'main' into main 2026-06-17 01:44:26 -03:00
vorotamoroz
497fd04081 fix global references 2026-06-17 05:29:45 +01:00
vorotamoroz
38142aaf1c Merge pull request #963 from vrtmrz/refactor_structure
Refactor structure
2026-06-17 13:06:30 +09:00
vorotamoroz
ae9c46f8f0 Fix import paths 2026-06-17 04:39:39 +01:00
vorotamoroz
dcd10cd690 Fix dependency management 2026-06-17 04:24:55 +01:00
vorotamoroz
5a35b71339 define workspace 2026-06-17 04:01:45 +01:00
vorotamoroz
18a59219f7 add ignore paths 2026-06-15 12:25:50 +01:00
vorotamoroz
c9095738e6 (chore): limit tags 2026-06-15 12:21:58 +01:00
vorotamoroz
bed415fc6b (chore): add missing release date 2026-06-15 12:21:11 +01:00
vorotamoroz
4eeb93b9e4 Merge pull request #961 from vrtmrz/0_25_76
Releasing 0.25.76
2026-06-15 20:18:37 +09:00
vorotamoroz
0fc233686b prettify and bump 2026-06-15 11:54:41 +01:00
vorotamoroz
def1d297f5 Merge pull request #958 from vrtmrz/fix_875
Fix S3 client with custom headers and strict server
2026-06-15 19:41:31 +09:00
vorotamoroz
e7cf2a6fba Merge branch 'main' into fix_875 2026-06-15 19:41:18 +09:00
vorotamoroz
2da2fd7671 Merge pull request #960 from vrtmrz/fix_956
Fix configuration serialisation
2026-06-15 19:40:37 +09:00
vorotamoroz
d5175969e7 Update notes. 2026-06-15 11:39:38 +01:00
vorotamoroz
46f9630999 track merged submodule 2026-06-15 11:39:13 +01:00
vorotamoroz
75adcf0ff0 track merged submodule 2026-06-15 11:38:50 +01:00
vorotamoroz
866dd49ba3 ### Fixed
- No longer connection information of the P2P synchronisation is broken on the specific platform (#956).
2026-06-15 11:34:25 +01:00
vorotamoroz
d0a84d07aa (chore) typo 2026-06-15 10:43:27 +01:00
vorotamoroz
089a4c0f8b ### Fixed
- Now S3 connection with custom headers works properly.
2026-06-15 10:41:26 +01:00
vorotamoroz
1a1f816872 Merge pull request #957 from vrtmrz/v0_25_75
Releasing v0.25.75
2026-06-13 12:05:16 +09:00
vorotamoroz
9d86c2828b Update dependency, and bump 2026-06-13 11:58:40 +09:00
vorotamoroz
3b6d3beaa7 Merge pull request #955 from vrtmrz/fix_953
Fix an issue where using fast synchronisation caused a TypeError in some environment
2026-06-13 11:21:19 +09:00
vorotamoroz
bb75b6ead8 Merge remote-tracking branch 'origin/main' into fix_953 2026-06-13 11:19:22 +09:00
vorotamoroz
fccb2304f6 update submodule pointer 2026-06-13 11:18:03 +09:00
vorotamoroz
f00ef5eaae update submodule pointer 2026-06-13 11:15:03 +09:00
vorotamoroz
4e7ee760de Merge pull request #949 from AutoraLabs/feat/keep-livesync-active-in-background
feat: opt-in desktop setting to keep replication active in the background
2026-06-13 11:14:04 +09:00
vorotamoroz
c4faade30c Update submodule pointer 2026-06-13 11:13:35 +09:00
vorotamoroz
295dc1392a ### Fixed
- Fixed an issue where using fast synchronisation caused a TypeError in some environments (#953).
2026-06-12 11:33:07 +01:00
Miguel Ferreira
445a8c747c chore(submodule): bump src/lib to commonlib main (#51 merged as e98d929)
vrtmrz/livesync-commonlib#51 is merged into commonlib main as e98d929. Repoint
the gitlink from the PR branch commit to that merge commit so this PR builds
against upstream main.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:45:40 +01:00
Miguel Ferreira
292a6b9e1e refactor: detect platform via APIService.isMobile() instead of Platform.isDesktopApp
Address the maintainer review on #949: determine the platform through the
plugin's own service layer (services.API.isMobile()) rather than Obsidian's
Platform API directly, matching the existing call in ObsidianLiveSyncSettingTab.
Applies to both PR-introduced sites: the runtime guard (ModuleObsidianEvents)
and the settings-pane toggle (PaneSyncSettings).

The TFile import becomes type-only so deps.ts is no longer pulled at runtime;
the unit test drives the platform through the services.API.isMobile() mock.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:45:40 +01:00
vorotamoroz
0e04e7d31d Merge pull request #951 from vrtmrz/feat_docker_ci_build
feat: Docker CI workflow to enhance image tagging and push logic base…
2026-06-09 18:41:26 +09:00
vorotamoroz
4cf4acf7e9 feat: Docker CI workflow to enhance image tagging and push logic based on branch and event type 2026-06-09 09:00:43 +00:00
Miguel Ferreira
c78e583399 feat: opt-in desktop setting to keep replication active in the background
Replication is suspended when the Obsidian window becomes hidden (document.hidden),
so LiveSync and Periodic stop syncing while minimised until the window is focused.

Add keepReplicationActiveInBackground (default off, desktop only). When enabled, the
window-visibility handler no longer suspends on hide, so replication keeps running while
minimised. Becoming visible forces a teardown before reopen (LiveSync only) so a stalled,
half-open channel is always replaced.

Includes the setting definition (src/lib submodule), a desktop-only toggle in the Sync
pane shown for LiveSync and Periodic, a docs/settings.md entry, and unit tests for the
visibility handler.
2026-06-05 00:06:26 +01:00
mugenrei
ebbac96b16 docs: add comprehensive Cloudflare Tunnel setup guide
- Step-by-step tunnel creation in Zero Trust dashboard
- Detailed public hostname configuration (couchdb:5984 vs localhost)
- Troubleshooting section for 404, 502, and 524 errors
- Obsidian plugin configuration instructions
- Emphasis on token-based tunnels ignoring local config file
2026-02-18 10:57:18 -03:00
mugenrei
ed0e67e853 fix: CRLF line endings in couchdb-init.sh, add .gitattributes
Shell scripts with CRLF line endings crash inside Linux containers with
'set: illegal option -' and 'command not found' errors.

- Strip CRLF -> LF in couchdb-init.sh
- Add .gitattributes to enforce LF on .sh, .yml, .ini, .md etc.
  so this never regresses on Windows checkouts
2026-02-18 10:52:51 -03:00
mugenrei
f99d7dc00f Add initial Docker setup and configuration for self-hosted LiveSync with CouchDB 2026-02-18 09:46:49 -03:00
586 changed files with 7678 additions and 4930 deletions

23
.gitattributes vendored
View File

@@ -1 +1,24 @@
# Always checkout shell scripts with LF line endings (never CRLF)
*.sh text eol=lf
# Standard text files — auto normalize on checkout
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.ini text eol=lf
*.env text eol=lf
*.json text eol=lf
*.ts text eol=lf
*.js text eol=lf
*.mjs text eol=lf
*.css text eol=lf
# Binary files — no line ending conversion
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.woff2 binary
*.woff binary
*.sh text eol=lf

View File

@@ -8,8 +8,21 @@ name: Build and Push CLI Docker Image
on:
push:
branches:
- main
tags:
- "*.*.*-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:
inputs:
dry_run:
@@ -41,14 +54,32 @@ jobs:
id: meta
run: |
VERSION=$(jq -r '.version' manifest.json)
EPOCH=$(date +%s)
TAG="${VERSION}-${EPOCH}-cli"
SHORT_SHA=$(git rev-parse --short HEAD)
IMAGE="ghcr.io/${{ github.repository_owner }}/livesync-cli"
echo "tag=${TAG}" >> $GITHUB_OUTPUT
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
echo "full=${IMAGE}:${TAG}" >> $GITHUB_OUTPUT
echo "version=${IMAGE}:${VERSION}-cli" >> $GITHUB_OUTPUT
echo "latest=${IMAGE}:latest" >> $GITHUB_OUTPUT
# Build tag list based on the event and git ref
TAGS=""
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
# 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
uses: docker/login-action@v3
@@ -92,10 +123,7 @@ jobs:
with:
context: .
file: src/apps/cli/Dockerfile
push: ${{ !(github.event_name == 'workflow_dispatch' && inputs.dry_run) }}
tags: |
${{ steps.meta.outputs.full }}
${{ steps.meta.outputs.version }}
${{ steps.meta.outputs.latest }}
push: ${{ steps.meta.outputs.push }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -4,6 +4,7 @@ on:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Push events to matching any tag format, i.e. 1.0, 20.15.10
- '!*-cli' # Exclude command-line interface tags
workflow_dispatch:
jobs:

View File

@@ -1,68 +1,111 @@
# Run Unit test without Harnesses
name: unit-ci
on:
workflow_dispatch:
push:
branches:
- main
- beta
paths:
- 'src/**'
- 'test/**'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- 'vite.config.ts'
- 'vitest.config*.ts'
- 'esbuild.config.mjs'
- 'eslint.config.mjs'
- '.github/workflows/unit-ci.yml'
pull_request:
paths:
- 'src/**'
- 'test/**'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- 'vite.config.ts'
- 'vitest.config*.ts'
- 'esbuild.config.mjs'
- 'eslint.config.mjs'
- '.github/workflows/unit-ci.yml'
permissions:
contents: read
jobs:
test:
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
# 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
run: npm run test:unit:coverage
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/**
# Run Unit test without Harnesses
name: unit-ci
on:
workflow_dispatch:
push:
branches:
- main
- beta
paths:
- 'src/**'
- 'test/**'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- 'vite.config.ts'
- 'vitest.config*.ts'
- 'esbuild.config.mjs'
- 'eslint.config.mjs'
- '.github/workflows/unit-ci.yml'
pull_request:
paths:
- 'src/**'
- 'test/**'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- 'vite.config.ts'
- 'vitest.config*.ts'
- 'esbuild.config.mjs'
- 'eslint.config.mjs'
- '.github/workflows/unit-ci.yml'
permissions:
contents: read
jobs:
unit-test:
name: Unit 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: Run unit tests suite with coverage
run: npm run test:unit:coverage
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-coverage-report
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

View File

@@ -1,3 +1,4 @@
pouchdb-browser.js
main_org.js
_types
main.js
_types/**

27
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,27 @@
# Code of Conduct
We wish to maintain an open, welcoming, and collaborative environment for all contributors.
## Our Standard
Our core principle is mutual respect. We encourage open discussion, diverse perspectives, and constructive feedback.
## The Limit of Tolerance
To preserve a tolerant and open community, we do not tolerate intolerance. Actions that aim to harass, exclude, or silence others are not welcome. Specifically, we do not accept personal attacks, breaches of privacy, or sustained disruption of discussions. We prioritise protecting the community's capacity for open, peaceful collaboration.
## Resolution
If any issue arises, the project maintainers will resolve it in a fair, minimal, and constructive manner, aiming to restore a cooperative environment. Depending on the nature of the behaviour, actions may range from a simple warning to temporary or permanent suspension of repository access.
## Contact
You can contact the project maintainer via email at `vrtmrz@proton.me` or via Nostr at `npub1azzj0dzw8evwtgyjeucyfz5cs8k0eg7rd0x4qvggcg3s7lx0dmaqv9sfka`.
## Criticism of the Maintainer
To ensure open and transparent governance, criticism of the maintainer will not be deleted as long as it is clearly framed as a constructive objection. However, spamming duplicate issues on the same topic or resorting to personal attacks will result in closure or removal.
## Revisions
This Code of Conduct is maintained by the project maintainers and may be updated to address new challenges. While the final decision rests with the maintainers, we welcome constructive suggestions and feedback through issues or pull requests.

70
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,70 @@
# Contributing to Self-hosted LiveSync
Thank you for your interest in contributing to Self-hosted LiveSync! We welcome all contributions, including bug reports, feature requests, documentation improvements, translations, and pull requests.
## Getting Started
To set up the development environment, please follow these steps:
1. Clone the repository recursively to ensure all Git submodules are loaded:
```bash
git clone --recursive https://github.com/vrtmrz/obsidian-livesync
```
If you have already cloned the repository without submodules, run the following command:
```bash
git submodule update --init --recursive
```
2. Install the package dependencies:
```bash
npm ci
```
3. Build the plug-in:
```bash
npm run build
```
For a more comprehensive guide on development workflows, testing configurations, and subrepos, please refer to [devs.md](devs.md).
## Guidelines for Contributions
### 1. Code Style and Verification
Before submitting a pull request, you must run verification scripts locally to ensure that there are no syntax, type, or linting errors:
- Run type checking and linting:
```bash
npm run check
```
- Run unit tests:
```bash
npm run test:unit
```
If you have the capability and a suitable environment (such as Linux and Docker), running the CLI End-to-End (E2E) tests is also highly appreciated. Instructions are detailed in [devs.md](devs.md). If you cannot run E2E tests locally, please explicitly ask to run the tests on the CI by stating 'Please run CI tests' in your pull request description.
### 2. Documentation and UI Text Style
To maintain consistency across the project, we ask that you follow the established writing style and conventions of the codebase when contributing documentation or user-facing messages:
- **Spelling**: Prioritise region-independent, neutral spelling if a suitable word exists. If there is no such word, please use British English spelling to align with the codebase's style (for example: preferring '-ise' and '-isation' suffixes over '-ize' and '-ization'). However, we do not treat alternative spellings as errors.
- **Oxford Comma**: Use the serial (Oxford) comma to separate items in lists of three or more (for example: 'settings, snippets, and themes').
- **Logical Punctuation**: Place punctuation marks outside quotation marks unless they are part of the quoted text itself (for example: write 'dialogue', not 'dialogue,').
- **No Contractions**: Avoid using contractions in general text or documentation (for example: write "do not" instead of "don't", and "cannot" instead of "can't").
- **Affirmative Phrasing**: Avoid asking questions using negative forms in user-facing dialogue. Use affirmative questions to prevent translation and interpretation discrepancies.
- **Specific Words**: Use 'dialogue' for documentation and user-facing messages (use 'dialog' only inside source code). Use the hyphenated form 'plug-in' in user-facing text (use 'plugin' only in configuration settings or technical contexts).
For a detailed list of vocabulary conventions and terms, please refer to [docs/terms.md](docs/terms.md).
### 3. Translations
To add or update translations, please refer to [docs/adding_translations.md](docs/adding_translations.md) for detailed instructions.
### 4. Git Submodules
The `src/lib` directory is a Git submodule pointing to the shared library `livesync-commonlib`. If you wish to propose changes to the shared library, do not modify `src/lib` directly. Instead, please submit a separate pull request to the [livesync-commonlib repository](https://github.com/vrtmrz/livesync-commonlib).
## License
By contributing, you agree that your contributions will be licensed under the MIT License.

View File

@@ -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 { HasSettings, ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
import type { EntryDoc } from "@lib/common/models/db.definition";
import type { HasSettings, ObsidianLiveSyncSettings, EntryDoc } from "@lib/common/types";
import type { Confirm } from "@lib/interfaces/Confirm";
import type { DatabaseFileAccess } from "@lib/interfaces/DatabaseFileAccess";
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 { AbstractModule } from "./modules/AbstractModule";
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> {
addOns: TCommands[];
/**
@@ -50,7 +52,7 @@ export declare class LiveSyncBaseCore<T extends ServiceContext = ServiceContext,
* @param constructor
* @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.
* @param module The module to register.

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { KeyValueDatabase } from "@lib/interfaces/KeyValueDatabase.ts";
export { OpenKeyValueDatabase } from "./KeyValueDBv2.ts";
export declare const _OpenKeyValueDatabase: (dbKey: string) => Promise<KeyValueDatabase>;

View File

@@ -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 IDBPDatabase } from "idb";
export declare function OpenKeyValueDatabase(dbKey: string): Promise<KeyValueDatabase>;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { NecessaryServices } from "@lib/interfaces/ServiceModule";
type PeriodicProcessorHost = NecessaryServices<"API" | "control", never>;
export declare class PeriodicProcessor {

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { ItemView } from "@/deps.ts";
import { type mount } from "svelte";
export declare abstract class SvelteItemView extends ItemView {

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { eventHub } from "@lib/hub/hub";
export declare const EVENT_PLUGIN_LOADED = "plugin-loaded";
export declare const EVENT_PLUGIN_UNLOADED = "plugin-unloaded";

View File

@@ -1,5 +1,7 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
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";
declare global {
interface LSEvents {

View File

@@ -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 { LiveSyncBaseCore } from "@/LiveSyncBaseCore";
export declare function generateReport(settings: ObsidianLiveSyncSettings, core: LiveSyncBaseCore): Promise<{

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { PersistentMap } from "octagonal-wheels/dataobject/PersistentMap";
export declare let sameChangePairs: PersistentMap<number[]>;
export declare function initializeStores(vaultName: string): void;

View File

@@ -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 { DatabaseEntry, FilePath } from "@lib/common/models/db.type";
import type { EntryBody } from "@lib/common/models/db.definition";
import { type DatabaseEntry, type EntryBody, type FilePath } from "@lib/common/types.ts";
export type { CacheData, FileEventItem } from "@lib/common/types.ts";
export interface PluginDataEntry extends DatabaseEntry {
deviceVaultName: string;

View File

@@ -1,7 +1,7 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { TAbstractFile } from "@/deps.ts";
import type { AnyEntry, DocumentID, EntryHasPath, FilePath, FilePathWithPrefix } from "@lib/common/models/db.type";
import type { CouchDBCredentials } from "@lib/common/models/auth.type";
import type { UXFileInfo, UXFileInfoStub } from "@lib/common/models/fileaccess.type";
import { type AnyEntry, type CouchDBCredentials, type DocumentID, type EntryHasPath, type FilePath, type FilePathWithPrefix, type UXFileInfo, type UXFileInfoStub } from "@lib/common/types.ts";
export { ICHeader, ICXHeader } from "./types.ts";
import type { KeyValueDatabase } from "@lib/interfaces/KeyValueDatabase.ts";
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>;
import { BASE_IS_NEW, EVEN, TARGET_IS_NEW } from "@lib/common/models/shared.const.symbols.ts";
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 declare function markChangesAreSame(file: AnyEntry | string | UXFileInfoStub, mtime1: number, mtime2: number): true | undefined;
export declare function unmarkChanges(file: AnyEntry | string | UXFileInfoStub): void;

View File

@@ -1,6 +1,8 @@
import type { FilePath } from "@lib/common/models/db.type";
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";
export type { DataWriteOptions, PluginManifest, RequestUrlParam, RequestUrlResponse, MarkdownFileInfo, ListedFiles, ValueComponent, Stat, } from "obsidian";
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
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;
export { normalizePath };
export { type Diff, DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, diff_match_patch } from "diff-match-patch";

View File

@@ -1,11 +1,12 @@
import { type PluginManifest, type App } from "@/deps.ts";
import type { EntryDoc } from "@lib/common/models/db.definition";
import type { LoadedEntry, FilePathWithPrefix, FilePath, AnyEntry } from "@lib/common/models/db.type";
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
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 { PeriodicProcessor } from "@/common/PeriodicProcessor.ts";
import { QueueProcessor } from "octagonal-wheels/concurrency/processor";
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 { LiveSyncCore } from "@/main.ts";
declare global {
@@ -78,8 +79,7 @@ export type PluginDataEx = {
mtime: number;
};
export declare class ConfigSync extends LiveSyncCommands {
pluginDialogClass: new (app: App, plugin: ObsidianLiveSyncPlugin) => PluginDialogModal;
constructor(plugin: ObsidianLiveSyncPlugin, core: LiveSyncCore, pluginDialogClass: new (app: App, plugin: ObsidianLiveSyncPlugin) => PluginDialogModal);
constructor(plugin: ObsidianLiveSyncPlugin, core: LiveSyncCore);
get configDir(): string;
get kvDB(): import("../../lib/src/interfaces/KeyValueDatabase.ts").KeyValueDatabase;
get useV2(): boolean;
@@ -91,7 +91,7 @@ export declare class ConfigSync extends LiveSyncCommands {
showPluginSyncModal(): void;
hidePluginSyncModal(): 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;
getFileCategory(filePath: string): "CONFIG" | "THEME" | "SNIPPET" | "PLUGIN_MAIN" | "PLUGIN_ETC" | "PLUGIN_DATA" | "";
isTargetPath(filePath: string): boolean;

View File

@@ -1,6 +1,8 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { mount } from "svelte";
import { App, Modal } from "@/deps.ts";
import type ObsidianLiveSyncPlugin from "@/main.ts";
import ObsidianLiveSyncPlugin from "@/main.ts";
export declare class PluginDialogModal extends Modal {
plugin: ObsidianLiveSyncPlugin;
component: ReturnType<typeof mount> | undefined;

View File

@@ -1,5 +1,7 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
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";
export declare class JsonResolveModal extends Modal {
filename: FilePath;

View File

@@ -1,7 +1,8 @@
import type { LoadedEntry, FilePathWithPrefix, FilePath, DocumentID, MetaEntry } from "@lib/common/models/db.type";
import type { UXFileInfo, UXStat, UXDataWriteOptions } from "@lib/common/models/fileaccess.type";
// @ts-nocheck
// 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 { CustomRegExp } from "@lib/common/utils.regexp.ts";
import { type CustomRegExp } from "@lib/common/utils.ts";
import { type MapLike } from "@/common/utils.ts";
import { PeriodicProcessor } from "@/common/PeriodicProcessor.ts";
import { LiveSyncCommands } from "@/features/LiveSyncCommands.ts";
@@ -21,7 +22,7 @@ export declare class HiddenFileSync extends LiveSyncCommands {
isThisModuleEnabled(): boolean;
periodicInternalFileScanProcessor: PeriodicProcessor;
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;
onload(): void;
private _everyOnDatabaseInitialized;

View File

@@ -1,5 +1,6 @@
import type { AnyEntry, DocumentID, FilePath, FilePathWithPrefix } from "@lib/common/models/db.type";
import type { LOG_LEVEL } from "@lib/common/logger";
// @ts-nocheck
// 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 { LiveSyncCore } from "@/main.ts";
import { createInstanceLogFunction } from "@lib/services/lib/logUtils.ts";
@@ -10,7 +11,7 @@ export declare abstract class LiveSyncCommands {
plugin: ObsidianLiveSyncPlugin;
core: LiveSyncCore;
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 services(): import("../lib/src/services/InjectableServices").InjectableServiceHub<import("../lib/src/services/implements/obsidian/ObsidianServiceContext").ObsidianServiceContext>;
path2id(filename: FilePathWithPrefix | FilePath, prefix?: string): Promise<DocumentID>;
@@ -26,8 +27,8 @@ export declare abstract class LiveSyncCommands {
_info: (msg: unknown, key?: string) => void;
_notice: (msg: unknown, key?: string) => void;
_progress: (prefix?: string, level?: LOG_LEVEL) => {
log: (msg: unknown) => void;
once: (msg: unknown) => void;
log: (msg: string) => void;
once: (msg: string) => void;
done: (msg?: string) => void;
};
_debug: (msg: unknown, key?: string) => void;

View File

@@ -1,5 +1,6 @@
import type { DocumentID, EntryLeaf } from "@lib/common/models/db.type";
import type { EntryDoc } from "@lib/common/models/db.definition";
// @ts-nocheck
// 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";
type ChunkID = DocumentID;
type NoteDocumentID = DocumentID;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { App, Modal } from "@/deps.ts";
import { mount } from "svelte";
import type { LiveSyncTrysteroReplicator } from "@lib/replication/trystero/LiveSyncTrysteroReplicator";

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { App } from "@/deps.ts";
import type { LiveSyncTrysteroReplicator } from "@lib/replication/trystero/LiveSyncTrysteroReplicator";
/**

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { Menu, WorkspaceLeaf } from "@/deps.ts";
import { SvelteItemView } from "@/common/SvelteItemView.ts";
import { type PeerStatus } from "@lib/replication/trystero/P2PReplicatorPaneCommon.ts";
@@ -22,7 +24,7 @@ export declare class P2PReplicatorPaneView extends SvelteItemView {
getDisplayText(): string;
onClose(): Promise<void>;
instantiateComponent(target: HTMLElement): {
$on?(type: string, callback: (e: any) => void): () => void; // eslint-disable-line @typescript-eslint/no-explicit-any
$set?(props: Partial<Record<string, any>>): void; // eslint-disable-line @typescript-eslint/no-explicit-any
} & Record<string, any>; // 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 -- Only type declaration
} & Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any -- Only type declaration
}

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { WorkspaceLeaf } from "@/deps.ts";
import { SvelteItemView } from "@/common/SvelteItemView.ts";
import type { LiveSyncBaseCore } from "@/LiveSyncBaseCore.ts";
@@ -13,7 +15,7 @@ export declare class P2PServerStatusPaneView extends SvelteItemView {
getViewType(): string;
getDisplayText(): string;
instantiateComponent(target: HTMLElement): {
$on?(type: string, callback: (e: any) => void): () => void; // eslint-disable-line @typescript-eslint/no-explicit-any
$set?(props: Partial<Record<string, any>>): void; // eslint-disable-line @typescript-eslint/no-explicit-any
} & Record<string, any>; // 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 -- Only type declaration
} & Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any -- Only type declaration
}

View File

@@ -1,2 +1,4 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export { DirectFileManipulator } from "./DirectFileManipulatorV2.ts";
export type { DirectFileManipulatorOptions } from "./DirectFileManipulatorV2.ts";

View File

@@ -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,
* Due to size limitation of QR code, we encode settings as an array instead of object.

View File

@@ -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";
/**
* ContentSplitter interface for splitting content into chunks.

View File

@@ -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";
export declare abstract class ContentSplitterCore {
/**

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { ContentSplitterOptions, SplitOptions } from "./ContentSplitter.ts";
import { ContentSplitterBase } from "./ContentSplitterBase.ts";
/**

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { ContentSplitterOptions, SplitOptions } from "./ContentSplitter";
import { ContentSplitterBase } from "./ContentSplitterBase";
/**

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { ContentSplitterOptions, SplitOptions } from "./ContentSplitter.ts";
import { ContentSplitterBase } from "./ContentSplitterBase.ts";
/**

View File

@@ -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 { ContentSplitterCore, type ContentSplitterBase } from "./ContentSplitterBase";
/**

View File

@@ -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 { CONTEXT_DIALOG_CONTROLS, setupDialogContext, getDialogContext, SvelteDialogManagerBase, } from "@lib/services/implements/base/SvelteDialog.ts";

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { type SlipBoard } from "octagonal-wheels/bureau/SlipBoard";
declare global {
interface Slips extends LSSlips {

View File

@@ -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";
export type RemoteConfigurationResult = {
type: "couchdb";
@@ -10,7 +12,7 @@ export type RemoteConfigurationResult = {
settings: P2PConnectionInfo;
} | {
type: "webdav";
settings: any; // eslint-disable-line @typescript-eslint/no-explicit-any
settings: never;
};
export declare class ConnectionStringParser {
/**

View File

@@ -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 {
cause?: unknown;
}
@@ -34,7 +37,7 @@ export declare class LiveSyncError extends Error implements ErrorWithCause {
* @example
* 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.
* @param error The error to wrap.

View File

@@ -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 { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
import { type ObsidianLiveSyncSettings } from "./types";
declare enum ConditionType {
PLATFORM_CASE_INSENSITIVE = "platform-case-insensitive",
PLATFORM_CASE_SENSITIVE = "platform-case-sensitive",
@@ -25,7 +27,7 @@ type BaseRule<TType extends string, TValue> = {
valueDisplayFunc?: (settings: Partial<ObsidianLiveSyncSettings>) => string;
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> & {
min?: number;
max?: number;
@@ -36,10 +38,9 @@ type StringRangeRule = BaseRule<"string", string> & {
maxLength?: number;
regexp?: string;
};
type StringRule = BaseRule<"string", string> & {};
type BooleanRule = BaseRule<"boolean", boolean> & {};
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> & {}; // 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 AnyRule = NumberRuleExact | NumberRuleRange | StringRule | StringRangeRule | BooleanRule;
type DoctorCheckSettings = Omit<Partial<ObsidianLiveSyncSettings>, "remoteConfigurations" | "pluginSyncExtendedSetting">;
export type DoctorRegulation = {
version: string;

View File

@@ -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 {};

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { getLanguage as ObsidianGetLanguage } from "obsidian";
export declare function setGetLanguage(func: typeof ObsidianGetLanguage): void;
export declare function getLanguage(): string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
declare const manifestVersion: string;
declare const packageVersion: string;
export { manifestVersion, packageVersion };

View File

@@ -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 { TaggedType } from "@lib/common/models/shared.type.util";
import type { TaggedType } from "./types";
export declare let currentLang: I18N_LANGS;
export declare function getResolvedLang(lang?: I18N_LANGS): I18N_LANGS;
export declare function isAutoDisplayLanguage(lang: I18N_LANGS): boolean;

View File

@@ -1,2 +1,4 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export * from "octagonal-wheels/common/logger";
export type * from "octagonal-wheels/common/logger";

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { PartialMessages as def } from "./def.ts";
import { type MESSAGE } from "@lib/common/rosetta.ts";
type MessageKeys = keyof typeof def.def;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const allMessages: {
readonly "(Active)": {
readonly def: "(Active)";

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const PartialMessages: {
readonly de: {
"(Active)": string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const PartialMessages: {
readonly def: {
"(Active)": string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const PartialMessages: {
readonly es: {
"(Active)": string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const PartialMessages: {
readonly fr: {
"(BETA) Always overwrite with a newer file": string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const PartialMessages: {
readonly he: {
"(BETA) Always overwrite with a newer file": string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const PartialMessages: {
readonly ja: {
"(Active)": string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const PartialMessages: {
readonly ko: {
"(Active)": string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const PartialMessages: {
readonly ru: {
"(Active)": string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const PartialMessages: {
readonly "zh-tw": {
"(Active)": string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const PartialMessages: {
readonly zh: {
"(Active)": string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export type CouchDBCredentials = BasicCredentials | JWTCredentials;
export type JWTAlgorithm = "HS256" | "HS512" | "ES256" | "ES512" | "";
export type Credential = {

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { DocumentID } from "./db.type";
export declare const VERSIONING_DOCID: DocumentID;
export declare const MILESTONE_DOCID: DocumentID;

View File

@@ -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 { 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";
export type NodeKey = string;
export interface DeviceInfo {
@@ -50,7 +52,7 @@ export interface EntryNodeInfo extends DatabaseEntry {
nodeid: string;
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 EntryDocResponse = EntryDoc & PouchDB.Core.IdMeta & PouchDB.Core.GetMeta;
export declare function isMetaEntry(entry: AnyEntry): entry is MetaEntry;

View File

@@ -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 { EntryTypes, SYNCINFO_ID } from "./db.const";
export type FilePath = TaggedType<string, "FilePath">;
@@ -32,7 +34,7 @@ export interface DatabaseEntry {
/**
* Represents the base structure for an entry that represents a file.
*/
export interface EntryBase {
export type EntryBase = {
/**
* The creation time of the file.
*/
@@ -49,7 +51,7 @@ export interface EntryBase {
* Deleted flag.
*/
deleted?: boolean;
}
};
export type EdenChunk = {
data: string;
epoch: number;
@@ -57,106 +59,72 @@ export type EdenChunk = {
export type EntryWithEden = {
eden: Record<DocumentID, EdenChunk>;
};
/**
* Represents the common fields for all database entries representing physical files.
*/
export interface FileEntryBase extends DatabaseEntry, EntryBase, EntryWithEden {
export type NoteEntry = DatabaseEntry & EntryBase & EntryWithEden & {
/**
* The path of the file.
*/
path: FilePathWithPrefix;
}
/**
* Represents an entry that contains children (chunk IDs).
*/
export interface EntryWithChildren {
/**
* Chunk IDs indicating the contents of the file.
* 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 {
data: string | string[];
/**
* The type of the entry.
*/
type: EntryTypes["NOTE_LEGACY"];
}
/**
* Represents a chunk-split binary file entry.
*/
export interface NewEntry extends FileEntryBase, EntryWithChildren {
};
export type NewEntry = DatabaseEntry & EntryBase & EntryWithEden & {
/**
* The path of the file.
*/
path: FilePathWithPrefix;
/**
* Chunk IDs indicating the contents of the file.
*/
children: string[];
/**
* The type of the entry.
*/
type: EntryTypes["NOTE_BINARY"];
}
/**
* Represents a chunk-split plain text file entry.
*/
export interface PlainEntry extends FileEntryBase, EntryWithChildren {
};
export type PlainEntry = DatabaseEntry & EntryBase & EntryWithEden & {
/**
* The path of the file.
*/
path: FilePathWithPrefix;
/**
* Chunk IDs indicating the contents of the file.
*/
children: string[];
/**
* The type of the entry.
*/
type: EntryTypes["NOTE_PLAIN"];
}
/**
* Represents a customization / configuration file entry.
* @deprecated Use NewEntry or PlainEntry directly.
*/
export type InternalFileEntry = NewEntry;
/**
* 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 & {
};
export type InternalFileEntry = DatabaseEntry & NewEntry & EntryBase & {
deleted?: boolean;
};
export type AnyEntry = NoteEntry | NewEntry | PlainEntry | InternalFileEntry;
export type LoadedEntry = AnyEntry & {
data: string | string[];
datatype: EntryTypeNotes;
};
/**
* Represents a file entry prepared for saving.
*/
export type SavingEntry = AnyEntry & EntryWithBlob & {
export type SavingEntry = AnyEntry & {
data: Blob;
datatype: EntryTypeNotes;
};
/**
* Represents a metadata entry (chunked file entry) without full content.
*/
export type MetaEntry = NewEntry | PlainEntry;
/**
* Represents a leaf (chunk) document in the database.
*/
export interface EntryLeaf extends DatabaseEntry, EntryWithData<string> {
export type MetaEntry = AnyEntry & {
children: string[];
};
export type EntryLeaf = DatabaseEntry & {
type: EntryTypes["CHUNK"];
data: string;
isCorrupted?: boolean;
}
/**
* Represents a chunk pack document.
*/
export interface EntryChunkPack extends DatabaseEntry, EntryWithData<string> {
};
export type EntryChunkPack = DatabaseEntry & {
type: EntryTypes["CHUNK_PACK"];
}
data: string;
};
export interface EntryVersionInfo extends DatabaseEntry {
type: EntryTypes["VERSION_INFO"];
version: number;
@@ -169,7 +137,8 @@ export interface ChunkVersionRange {
max: number;
current: number;
}
export interface SyncInfo extends DatabaseEntry, EntryWithData<string> {
export interface SyncInfo extends DatabaseEntry {
_id: typeof SYNCINFO_ID;
type: EntryTypes["SYNC_INFO"];
data: string;
}

View File

@@ -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";
export type diff_result_leaf = {
rev: string;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const CHeader = "h:";
export declare const PSCHeader = "ps:";
export declare const PSCHeaderEnd = "ps;";

View File

@@ -1,50 +1,41 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { FilePath, FilePathWithPrefix } from "./db.type";
export interface UXStat {
export type UXStat = {
size: number;
mtime: number;
ctime: number;
type: "file" | "folder";
}
/**
* Represents the common base properties for any filesystem object stub.
*/
export interface UXFileSystemStubBase {
};
export type UXFileInfoStub = {
name: string;
path: FilePath | FilePathWithPrefix;
stat: UXStat;
deleted?: boolean;
isFolder?: false;
isInternal?: boolean;
};
export type UXFileInfo = UXFileInfoStub & {
body: Blob;
};
export type UXAbstractInfoStub = UXFileInfoStub | UXFolderInfo;
export type UXInternalFileInfoStub = {
name: string;
path: FilePath | FilePathWithPrefix;
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;
isInternal: true;
stat: undefined;
}
/**
* Represents information about a folder.
*/
export interface UXFolderInfo extends UXFileSystemStubBase {
};
export type UXFolderInfo = {
name: string;
path: FilePath | FilePathWithPrefix;
deleted?: boolean;
isFolder: true;
children: UXFileInfoStub[];
parent: FilePath | FilePathWithPrefix | undefined;
}
export interface UXDataWriteOptions {
};
export type UXDataWriteOptions = {
/**
* Time of creation, represented as a unix timestamp, in milliseconds.
* 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.
* Omit this if you want to keep the default behaviour.
* @public
* */
*/
mtime?: number;
}
};
export type CacheData = string | ArrayBuffer;
export type FileEventType = "CREATE" | "DELETE" | "CHANGED" | "INTERNAL";
export interface FileEventArgs {
export type FileEventArgs = {
file: UXFileInfoStub | UXInternalFileInfoStub;
cache?: CacheData;
oldPath?: string;
ctx?: unknown;
}
export interface FileEventItem {
};
export type FileEventItem = {
type: FileEventType;
args: FileEventArgs;
key: string;
skipBatchWait?: boolean;
cancelled?: boolean;
batched?: boolean;
}
};
export interface FileWithFileStat extends Omit<UXStat, "type"> {
path: FilePath;
}

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { FilePath } from "./db.type";
export declare const PREFIXMD_LOGFILE = "livesync_log_";
export declare const PREFIXMD_LOGFILE_UC = "LIVESYNC_LOG_";

View File

@@ -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_SUPPORT_CASE_INSENSITIVE = 10;
export declare const CURRENT_SETTING_VERSION = 10;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { type ObsidianLiveSyncSettings, type P2PSyncSetting } from "./setting.type";
export declare const P2P_DEFAULT_SETTINGS: P2PSyncSetting;
export declare const DEFAULT_SETTINGS: ObsidianLiveSyncSettings;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { ObsidianLiveSyncSettings } from "./setting.type";
export declare const PREFERRED_BASE: Partial<ObsidianLiveSyncSettings>;
export declare const PREFERRED_SETTING_CLOUDANT: Partial<ObsidianLiveSyncSettings>;

View File

@@ -1,2 +1,4 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { ObsidianLiveSyncSettings } from "./setting.type";
export declare const KeyIndexOfSettings: Record<keyof ObsidianLiveSyncSettings, number>;

View File

@@ -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 { I18N_LANGS } from "@lib/common/rosetta";
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.
*/
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).
* 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;
}
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 ObsidianLiveSyncSettings = ObsidianLiveSyncSettings_PluginSetting & RemoteDBSettings & LocalDBSettings;

View File

@@ -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_BIN = 102400;
export declare const VER = 12;

View File

@@ -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 configURIBase = "obsidian://setuplivesync?settings=";
export declare const configURIBaseQR = "obsidian://setuplivesync?settingsQR=";

View File

@@ -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 AUTO_MERGED: unique symbol;
export declare const NOT_CONFLICTED: unique symbol;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { ObsidianLiveSyncSettings } from "./setting.type";
export declare const LEVEL_ADVANCED = "ADVANCED";
export declare const LEVEL_POWER_USER = "POWER_USER";

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
export declare const DatabaseConnectingStatuses: {
readonly STARTED: "STARTED";
readonly NOT_CONNECTED: "NOT_CONNECTED";

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { TaggedType } from "octagonal-wheels/common/types";
export type { TaggedType };
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 Prettify<T> = {
[K in keyof T]: T[K];
} & {};
} & {}; // eslint-disable-line @typescript-eslint/no-empty-object-type, @typescript-eslint/ban-types -- Empty object type

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { EntryTypes } from "./db.const";
import type { DatabaseEntry, DocumentID } from "./db.type";
export declare const ProtocolVersions: {

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { ObsidianLiveSyncSettings } from "./setting.type";
export declare const TweakValuesShouldMatchedTemplate: Partial<ObsidianLiveSyncSettings>;
type TweakKeys = keyof TweakValues;
@@ -24,6 +26,7 @@ export declare const TweakValuesTemplate: {
syncOnStart?: boolean | undefined;
syncOnFileOpen?: boolean | undefined;
syncOnEditorSave?: boolean | undefined;
keepReplicationActiveInBackground?: boolean | undefined;
syncMinimumInterval?: number | undefined;
showVerboseLog?: boolean | undefined;
lessInformationInLog?: boolean | undefined;

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
/**
# Rosetta stone
- To localise messages to your language, please write a translation to this file and submit a PR.

View File

@@ -1,5 +1,6 @@
import type { ConfigurationItem } from "@lib/common/models/shared.definition.configNames";
import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { type ConfigurationItem, type ObsidianLiveSyncSettings } from "./types.ts";
type ExtractPropertiesByType<T, U> = {
[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;
syncOnFileOpen: boolean;
syncOnEditorSave: boolean;
keepReplicationActiveInBackground: boolean;
syncMinimumInterval: number;
showVerboseLog: boolean;
lessInformationInLog: boolean;
@@ -59,7 +61,7 @@ export declare const AllSettingDefault: {
resolveConflictsByNewerFile: boolean;
writeDocumentsIfConflicted: boolean;
disableMarkdownAutoMerge: boolean;
configPassphraseStore: import("@lib/common/models/setting.type").ConfigPassphraseStore;
configPassphraseStore: import("./types.ts").ConfigPassphraseStore;
encryptedPassphrase: string;
encryptedCouchDBConnection: string;
periodicReplication: boolean;
@@ -80,7 +82,7 @@ export declare const AllSettingDefault: {
notifyPluginOrSettingUpdated: boolean;
usePluginSyncV2: 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;
usePowerUserMode: boolean;
useEdgeCaseMode: boolean;
@@ -105,7 +107,7 @@ export declare const AllSettingDefault: {
isConfigured?: boolean;
lastReadUpdates: number;
doctorProcessedVersion: string;
remoteConfigurations: Record<string, import("@lib/common/models/setting.type").RemoteConfiguration>;
remoteConfigurations: Record<string, import("./models/setting.type.ts").RemoteConfiguration>;
activeConfigurationId: string;
P2P_ActiveRemoteConfigurationId: string;
couchDB_URI: string;
@@ -129,19 +131,19 @@ export declare const AllSettingDefault: {
bucketCustomHeaders: string;
bucketPrefix: string;
forcePathStyle: boolean;
remoteType: import("@lib/common/models/setting.type").RemoteType;
remoteType: import("./types.ts").RemoteType;
encrypt: boolean;
passphrase: string;
usePathObfuscation: boolean;
E2EEAlgorithm: import("@lib/common/models/setting.type").E2EEAlgorithm;
hashAlg: import("@lib/common/models/setting.type").HashAlgorithm;
E2EEAlgorithm: import("./types.ts").E2EEAlgorithm;
hashAlg: import("./types.ts").HashAlgorithm;
minimumChunkSize: number;
customChunkSize: number;
longLineThreshold: number;
useSegmenter: boolean;
enableChunkSplitterV2: boolean;
doNotUseFixedRevisionForChunks: boolean;
chunkSplitterVersion: import("@lib/common/models/setting.type").ChunkSplitterVersion;
chunkSplitterVersion: import("./types.ts").ChunkSplitterVersion;
useEden: boolean;
maxChunksInEden: number;
maxTotalLengthInEden: number;
@@ -174,7 +176,7 @@ export declare const AllSettingDefault: {
useTimeouts: boolean;
deleteMetadataOfDeletedFiles: boolean;
automaticallyDeleteMetadataOfDeletedFiles: number;
P2P_AutoAccepting: import("@lib/common/models/setting.type").AutoAccepting;
P2P_AutoAccepting: import("./types.ts").AutoAccepting;
P2P_AutoSyncPeers: string;
P2P_AutoWatchPeers: string;
P2P_SyncOnReplication: string;
@@ -208,7 +210,7 @@ export declare function getConfig(key: AllSettingItemKey): false | {
placeHolder?: string;
status?: "BETA" | "ALPHA" | "EXPERIMENTAL";
obsolete?: boolean;
level?: import("@lib/common/models/shared.definition.configNames").ConfigLevel;
level?: import("./types.ts").ConfigLevel;
isHidden?: boolean;
isAdvanced?: boolean;
};

View File

@@ -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 { UXFileInfoStub } from "@lib/common/models/fileaccess.type";
import type { UXFileInfoStub } from "./types";
/**
* returns is internal chunk of file
* @param id ID

View File

@@ -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 { 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";

View File

@@ -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;

View File

@@ -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";
export { replaceAll, replaceAllPairs };
import { concatUInt8Array } from "octagonal-wheels/binary";
@@ -13,13 +16,116 @@ export { sendValue, sendSignal, waitForSignal, waitForValue };
import { throttle } from "octagonal-wheels/function";
export { throttle };
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 { sizeToHumanReadable } from "octagonal-wheels/number";
export * from "./utils.concurrency";
export * from "./utils.timer";
export * from "./utils.notations";
export * from "./utils.database";
export * from "./utils.regexp";
export * from "./utils.settings";
export * from "./utils.patch";
export * from "./utils.misc";
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 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;

View File

@@ -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;

View File

@@ -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.
* @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.
*/
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;

View File

@@ -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>;

View File

@@ -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;

View File

@@ -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 ensureError(error: unknown): Error;

View File

@@ -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 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[] | {

View File

@@ -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 {};

View File

@@ -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;

View File

@@ -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>;

View File

@@ -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

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import type { SimpleStore } from "octagonal-wheels/databases/SimpleStoreBase";
export declare class StoredMapLike<U> {
_store: SimpleStore<U>;

View File

@@ -1,5 +1,7 @@
type InstanceHaveOnBindFunction = {
onBindFunction: (core: any, services: any) => void; // eslint-disable-line @typescript-eslint/no-explicit-any
} & Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
export declare function __$checkInstanceBinding<T extends InstanceHaveOnBindFunction>(instance: T): void;
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
interface InstanceHaveOnBindFunction<T> {
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 {};

View File

@@ -1,3 +1,5 @@
// @ts-nocheck
// REPO: https://github.com/vrtmrz/livesync-commonlib Commit hash: 90de158
import { encryptHKDFWorker, decryptHKDFWorker } from "@lib/worker/bgWorker.ts";
export declare const encryptHKDF: typeof encryptHKDFWorker;
export declare const decryptHKDF: typeof decryptHKDFWorker;

View File

@@ -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.
*

Some files were not shown because too many files have changed in this diff Show More