@hesprs/sync-engine-sdk 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.js +1 -1
- package/dist/dev.spec.d.ts +74 -4
- package/dist/index-M1OI9qC7.spec.d.ts +1334 -0
- package/dist/index.js +1 -1
- package/dist/index.spec.d.ts +1 -34
- package/dist/{packages/plugin → plugin}/src/components/MigrationModal.js +1 -1
- package/dist/prefix.js +1 -1
- package/package.json +3 -3
- package/dist/debug-wrapper.spec.d.ts +0 -6
- package/dist/node_modules/.bun/synthkernel@._synthkernel.tgz/node_modules/synthkernel/dist/context.spec.d.ts +0 -29
- package/dist/node_modules/.bun/synthkernel@._synthkernel.tgz/node_modules/synthkernel/dist/reactive.spec.d.ts +0 -14
- package/dist/node_modules/.bun/uni-kv@.._.._uni-kv.tgz/node_modules/uni-kv/dist/interface.spec.d.ts +0 -46
- package/dist/packages/plugin/src/components/FilterEditorModal.spec.d.ts +0 -17
- package/dist/packages/plugin/src/components/HeadersEditorModal.spec.d.ts +0 -18
- package/dist/packages/plugin/src/components/MigrationModal.spec.d.ts +0 -45
- package/dist/packages/plugin/src/components/ModuleEditorModal.spec.d.ts +0 -26
- package/dist/packages/plugin/src/components/SourceEditorModal.spec.d.ts +0 -16
- package/dist/packages/plugin/src/components/UnknownModuleModal.spec.d.ts +0 -19
- package/dist/packages/plugin/src/components/file-tree/index.spec.d.ts +0 -7
- package/dist/packages/plugin/src/components/module-management/index.spec.d.ts +0 -23
- package/dist/packages/plugin/src/fs/hierarchical-optimizer.spec.d.ts +0 -1
- package/dist/packages/plugin/src/fs/index.spec.d.ts +0 -13
- package/dist/packages/plugin/src/fs/interface.spec.d.ts +0 -71
- package/dist/packages/plugin/src/fs/middlewares/custom-headers.spec.d.ts +0 -1
- package/dist/packages/plugin/src/fs/middlewares/rate-limiter.spec.d.ts +0 -1
- package/dist/packages/plugin/src/fs/middlewares/retry.spec.d.ts +0 -1
- package/dist/packages/plugin/src/fs/vault/index.spec.d.ts +0 -3
- package/dist/packages/plugin/src/fs/vault/request.spec.d.ts +0 -71
- package/dist/packages/plugin/src/fs/wrappers/asymmetric-storage.spec.d.ts +0 -2
- package/dist/packages/plugin/src/fs/wrappers/cancellation.spec.d.ts +0 -2
- package/dist/packages/plugin/src/fs/wrappers/context.spec.d.ts +0 -2
- package/dist/packages/plugin/src/fs/wrappers/memory-control.spec.d.ts +0 -1
- package/dist/packages/plugin/src/fs/wrappers/optimization.spec.d.ts +0 -1
- package/dist/packages/plugin/src/index.spec.d.ts +0 -30
- package/dist/packages/plugin/src/modules/Bootstrap.spec.d.ts +0 -85
- package/dist/packages/plugin/src/modules/EventBus.spec.d.ts +0 -35
- package/dist/packages/plugin/src/modules/Extensibility.spec.d.ts +0 -96
- package/dist/packages/plugin/src/modules/I18n.spec.d.ts +0 -22
- package/dist/packages/plugin/src/modules/ModulesModal.spec.d.ts +0 -49
- package/dist/packages/plugin/src/modules/Observability.spec.d.ts +0 -58
- package/dist/packages/plugin/src/modules/ProgressModal.spec.d.ts +0 -66
- package/dist/packages/plugin/src/modules/Registrar.spec.d.ts +0 -147
- package/dist/packages/plugin/src/modules/Scheduler.spec.d.ts +0 -43
- package/dist/packages/plugin/src/modules/Storage.spec.d.ts +0 -54
- package/dist/packages/plugin/src/modules/Sync.spec.d.ts +0 -84
- package/dist/packages/plugin/src/settings/controls.spec.d.ts +0 -21
- package/dist/packages/plugin/src/settings/development.spec.d.ts +0 -17
- package/dist/packages/plugin/src/settings/features.spec.d.ts +0 -24
- package/dist/packages/plugin/src/settings/filter.spec.d.ts +0 -11
- package/dist/packages/plugin/src/settings/head.spec.d.ts +0 -23
- package/dist/packages/plugin/src/settings/miscellaneous.spec.d.ts +0 -21
- package/dist/packages/plugin/src/sync/conflict-resolve/keep-local.spec.d.ts +0 -1
- package/dist/packages/plugin/src/sync/conflict-resolve/keep-remote.spec.d.ts +0 -1
- package/dist/packages/plugin/src/sync/conflict-resolve/latest-survive.spec.d.ts +0 -1
- package/dist/packages/plugin/src/sync/conflict-resolve/rename-and-keep-both.spec.d.ts +0 -1
- package/dist/packages/plugin/src/sync/decision/bidirectional.spec.d.ts +0 -2
- package/dist/packages/plugin/src/sync/decision/interface.spec.d.ts +0 -90
- package/dist/packages/plugin/src/sync/index.spec.d.ts +0 -21
- package/dist/packages/plugin/src/sync/tasks/AddRecord.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/CreateLocalDir.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/CreateRemoteDir.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/Download.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/MoveLocal.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/MoveRemote.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/RemoveLocal.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/RemoveRecord.spec.d.ts +0 -7
- package/dist/packages/plugin/src/sync/tasks/RemoveRemote.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/ResolveConflict.spec.d.ts +0 -11
- package/dist/packages/plugin/src/sync/tasks/Upload.spec.d.ts +0 -8
- package/dist/packages/plugin/src/sync/tasks/interface.spec.d.ts +0 -36
- package/dist/packages/plugin/src/sync/utils/detect-moves.spec.d.ts +0 -2
- package/dist/packages/plugin/src/sync/utils/post-traversal.spec.d.ts +0 -1
- package/dist/packages/plugin/src/types.spec.d.ts +0 -40
- package/dist/packages/plugin/src/utils/glob-match.spec.d.ts +0 -5
- package/dist/packages/plugin/src/utils/pipe.spec.d.ts +0 -14
- package/dist/packages/plugin/src/utils/sha-256.spec.d.ts +0 -4
- package/dist/packages/plugin/test/e2e-utils.spec.d.ts +0 -5
- package/dist/packages/plugin/test/test-kit.spec.d.ts +0 -58
- package/dist/prefix.spec.d.ts +0 -6
- package/dist/transform.spec.d.ts +0 -15
- /package/dist/{packages/plugin → plugin}/src/components/render-progress.js +0 -0
- /package/dist/{packages/plugin → plugin}/src/utils/pipe.js +0 -0
- /package/dist/{packages/plugin → plugin}/src/utils/round-percent.js +0 -0
- /package/dist/{packages/plugin → plugin}/src/utils/sha-256.js +0 -0
- /package/dist/{packages/plugin → plugin}/src/utils/to-error-message.js +0 -0
- /package/dist/{packages/plugin → plugin}/test/test-kit.js +0 -0
- /package/dist/{packages/shared → shared}/src/get-status.js +0 -0
- /package/dist/{packages/shared → shared}/src/path.js +0 -0
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./
|
|
1
|
+
import e from"./plugin/src/components/MigrationModal.js";import t from"./prefix.js";import{pipe as n,readWithSize as r,writeWithValue as i}from"./plugin/src/utils/pipe.js";function a(e){let t=e;for(;`original`in t;)t=t.original;return t}export{a as digOriginal,n as pipe,t as prefixWrapper,r as readWithSize,e as setNeedMigration,i as writeWithValue};
|
package/dist/index.spec.d.ts
CHANGED
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BatchOptimizer, CustomAtom, DeleteAtom, Fs, InputAtom, ListReporter, MkdirAtom, MoveAtom, OptimizerInput, OptimizerOutput, OutputAtom, RootFs, WrappedFs, WriteAtom } from "./packages/plugin/src/fs/interface.spec.js";
|
|
3
|
-
import { DatabaseAsync, DatabaseSync, StoreAsync, StoreOperations, StoreSync } from "./node_modules/.bun/uni-kv@.._.._uni-kv.tgz/node_modules/uni-kv/dist/interface.spec.js";
|
|
4
|
-
import { Dispatch, On } from "./packages/plugin/src/modules/EventBus.spec.js";
|
|
5
|
-
import { Fragment, ObsidianLanguageCode, Translate, TranslationResource } from "./packages/plugin/src/modules/I18n.spec.js";
|
|
6
|
-
import { RecordStore } from "./packages/plugin/src/modules/Storage.spec.js";
|
|
7
|
-
import { BaseTask, ConflictResolver, ConflictResolverPayload, TaskNames } from "./packages/plugin/src/sync/tasks/interface.spec.js";
|
|
8
|
-
import AddRecord from "./packages/plugin/src/sync/tasks/AddRecord.spec.js";
|
|
9
|
-
import CreateRemoteDir from "./packages/plugin/src/sync/tasks/CreateRemoteDir.spec.js";
|
|
10
|
-
import Download from "./packages/plugin/src/sync/tasks/Download.spec.js";
|
|
11
|
-
import MoveLocal from "./packages/plugin/src/sync/tasks/MoveLocal.spec.js";
|
|
12
|
-
import MoveRemote from "./packages/plugin/src/sync/tasks/MoveRemote.spec.js";
|
|
13
|
-
import RemoveLocal from "./packages/plugin/src/sync/tasks/RemoveLocal.spec.js";
|
|
14
|
-
import RemoveRecord from "./packages/plugin/src/sync/tasks/RemoveRecord.spec.js";
|
|
15
|
-
import RemoveRemote from "./packages/plugin/src/sync/tasks/RemoveRemote.spec.js";
|
|
16
|
-
import ResolveConflict from "./packages/plugin/src/sync/tasks/ResolveConflict.spec.js";
|
|
17
|
-
import Upload from "./packages/plugin/src/sync/tasks/Upload.spec.js";
|
|
18
|
-
import { Decider, DeciderInput, TaskFactory } from "./packages/plugin/src/sync/decision/interface.spec.js";
|
|
19
|
-
import CreateLocalDir from "./packages/plugin/src/sync/tasks/CreateLocalDir.spec.js";
|
|
20
|
-
import "./packages/plugin/src/sync/index.spec.js";
|
|
21
|
-
import { SyncTerminateReason } from "./packages/plugin/src/modules/Sync.spec.js";
|
|
22
|
-
import setNeedMigration from "./packages/plugin/src/components/MigrationModal.spec.js";
|
|
23
|
-
import prefixWrapper from "./prefix.spec.js";
|
|
24
|
-
import { pipe, readWithSize, writeWithValue } from "./packages/plugin/src/utils/pipe.spec.js";
|
|
25
|
-
import { AugmentedModuleMeta, ModuleMeta } from "./packages/plugin/src/modules/Extensibility.spec.js";
|
|
26
|
-
import { ExistingMemoryDB } from "./packages/plugin/src/modules/Bootstrap.spec.js";
|
|
27
|
-
import { Context, Events, Settings, Translations } from "./packages/plugin/src/index.spec.js";
|
|
28
|
-
import { CheckConnectionResult, ConflictResolverEntry, DeciderEntry, FsWrapperEntry, LocalRequestMiddlewareEntry, OptimizerEntry, RemoteFsEntry, RemoteLister, RemoteListerEntry, RemoteRequestMiddlewareEntry, Request, RequestParam, RequestResponse, SettingEntry } from "./packages/plugin/src/modules/Registrar.spec.js";
|
|
29
|
-
import { VaultRequest } from "./packages/plugin/src/fs/vault/request.spec.js";
|
|
30
|
-
import "./packages/plugin/src/fs/index.spec.js";
|
|
31
|
-
//#region src/sdk/index.d.ts
|
|
32
|
-
declare function digOriginal(wrapped: Fs): RootFs;
|
|
33
|
-
type SelectFromContext<O extends object> = Context extends O ? O : never;
|
|
34
|
-
//#endregion
|
|
1
|
+
import { $ as TranslationResource, A as SyncTerminateReason, B as MoveRemote, C as SelectFromContext, Ct as FolderStat, D as writeWithValue, Dt as RecordStatsMap, E as readWithSize, Et as RecordStat, F as Upload, G as BaseTask, H as Download, I as ResolveConflict, J as TaskNames, K as ConflictResolver, L as RemoveRemote, M as Decider, N as DeciderInput, O as prefixWrapper, Ot as Stat, P as TaskFactory, Q as Translate, R as RemoveRecord, S as ModuleMeta, St as FileStat, T as pipe, Tt as Progress, U as CreateRemoteDir, V as MoveLocal, W as AddRecord, X as Fragment, Y as RecordStore, Z as ObsidianLanguageCode, _ as Events, _t as OutputAtom, a as FsWrapperEntry, at as StoreOperations, b as ExistingMemoryDB, bt as WriteAtom, c as RemoteFsEntry, ct as CustomAtom, d as RemoteRequestMiddlewareEntry, dt as InputAtom, et as Dispatch, f as Request, ft as ListReporter, g as Context, gt as OptimizerOutput, h as SettingEntry, ht as OptimizerInput, i as DeciderEntry, it as StoreAsync, j as CreateLocalDir, k as setNeedMigration, kt as StatsMap, l as RemoteLister, lt as DeleteAtom, m as RequestResponse, mt as MoveAtom, n as CheckConnectionResult, nt as DatabaseAsync, o as LocalRequestMiddlewareEntry, ot as StoreSync, p as RequestParam, pt as MkdirAtom, q as ConflictResolverPayload, r as ConflictResolverEntry, rt as DatabaseSync, s as OptimizerEntry, st as BatchOptimizer, t as VaultRequest, tt as On, u as RemoteListerEntry, ut as Fs, v as Settings, vt as RootFs, w as digOriginal, wt as MaybePromise, x as AugmentedModuleMeta, xt as Binary, y as Translations, yt as WrappedFs, z as RemoveLocal } from "./index-M1OI9qC7.spec.js";
|
|
35
2
|
export { type AddRecord, type AugmentedModuleMeta, type BaseTask, type BatchOptimizer, type Binary, type CheckConnectionResult, type ConflictResolver, type ConflictResolverEntry, type ConflictResolverPayload, type Context, type CreateLocalDir, type CreateRemoteDir, type CustomAtom, type DatabaseAsync, type DatabaseSync, type Decider, type DeciderEntry, type DeciderInput, type DeleteAtom, type Dispatch, type Download, type Events, type ExistingMemoryDB, type FileStat, type FolderStat, type Fragment, type Fs, type FsWrapperEntry, type InputAtom, type ListReporter, type LocalRequestMiddlewareEntry, type MaybePromise, type MkdirAtom, type ModuleMeta, type MoveAtom, type MoveLocal, type MoveRemote, type ObsidianLanguageCode, type On, type OptimizerEntry, type OptimizerInput, type OptimizerOutput, type OutputAtom, type Progress, type RecordStat, type RecordStatsMap, type RecordStore, type RemoteFsEntry, type RemoteLister, type RemoteListerEntry, type RemoteRequestMiddlewareEntry, type RemoveLocal, type RemoveRecord, type RemoveRemote, type Request, type RequestParam, type RequestResponse, type ResolveConflict, type RootFs, SelectFromContext, type SettingEntry, type Settings, type Stat, type StatsMap, type StoreAsync, type StoreOperations, type StoreSync, type SyncTerminateReason, type TaskFactory, type TaskNames, type Translate, type TranslationResource, type Translations, type Upload, type VaultRequest, type WrappedFs, type WriteAtom, digOriginal, pipe, prefixWrapper, readWithSize, setNeedMigration, writeWithValue };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./render-progress.js";import t from"../utils/round-percent.js";import n from"../utils/to-error-message.js";import{Modal as r,Notice as i,Setting as a}from"obsidian";var o=class extends r{ctx;options;cleanupCallbacks=[];constructor(e,t){super(e.app),this.ctx=e,this.options=t}onOpen(){let{contentEl:e,options:{content:t,apply:n}}=this,{translate:r}=this.ctx;e.empty(),e.addClass(`markdown-rendered`),this.setTitle(r(`remoteMigration`)),typeof t==`string`?e.createEl(`p`,{cls:`whitespace-pre-wrap`,text:t}):e.append(t),e.createEl(`p`,{cls:`whitespace-pre-wrap`,text:r(`migrationDescription`)}),new a(e).addButton(e=>e.setButtonText(r(`cancel`)).onClick(this.close.bind(this))).addButton(e=>e.setButtonText(r(`toggleWithoutMigration`)).onClick(async()=>{await n(),this.close()})).addButton(e=>e.setButtonText(r(`startMigration`)).setCta().onClick(this.handleMigration))}handleMigration=()=>{let{on:n,translate:r,dispatch:i}=this.ctx;this.contentEl.empty(),this.setTitle(r(`migrationProcess`));let{left:o,right:s,bar:c}=e(this.contentEl,`mb-3`),l,u=e=>{l?.remove(),l=new a(this.contentEl).addButton(t=>t.setButtonText(r(e)).onClick(this.close.bind(this))).settingEl};u(`hide`),this.cleanupCallbacks.push(n(`migrationProgress`,({total:e,completed:n,current:a})=>{n===0&&i(`logGeneral`,`Migration started.`);let l=t(n,e);s.setText(`${n}/${e} ${r(`completed`)}`),a&&o.setText(a),c.setValue(l),l===100&&u(`done`)}),n(`migrationFailed`,()=>{i(`errorGeneral`,`Migration failed.`),o.setText(r(`migrationFailed`)),u(`done`)})),this.migrate()};migrate=async()=>{let{dispatch:e,requestSync:t,initializeSync:r,translate:a,memoryDB:o}=this.ctx;e(`migrationProgress`,{completed:0,current:a(`migrationPhase1Description`),total:3});let s=(await t(`migration`)).result;if(s===`cancelled`||s===`failed`){e(`migrationFailed`,`phase 1 failed`);return}e(`migrationProgress`,{completed:1,current:a(`migrationPhase2Description`),total:3});try{let{record:e,remoteFs:t}=r();await Promise.all([e.clear(),this.options.apply(),...o.getStore(`remoteContext20000`).entries().sort(([e],[t])=>t.length-e.length).map(([e])=>t.delete(e))])}catch(t){let r=n(t);new i(`${a(`migrationFailed`)}: ${r}`),e(`migrationFailed`,r);return}e(`migrationProgress`,{completed:2,current:a(`migrationPhase3Description`),total:3});let c=(await t(`migration`)).result;if(c===`cancelled`||c===`failed`){e(`migrationFailed`,`phase 3 failed`);return}e(`migrationProgress`,{completed:3,current:a(`completed`),total:3})};onClose(){this.cleanupCallbacks.splice(0).forEach(e=>e()),this.contentEl.empty()}};function s(e,{toggle:t,needMigration:n,content:r,apply:i}){let a=!1;t.onChange(s=>{if(a){a=!1;return}
|
|
1
|
+
import e from"./render-progress.js";import t from"../utils/round-percent.js";import n from"../utils/to-error-message.js";import{Modal as r,Notice as i,Setting as a}from"obsidian";var o=class extends r{ctx;options;cleanupCallbacks=[];constructor(e,t){super(e.app),this.ctx=e,this.options=t}onOpen(){let{contentEl:e,options:{content:t,apply:n}}=this,{translate:r}=this.ctx;e.empty(),e.addClass(`markdown-rendered`),this.setTitle(r(`remoteMigration`)),typeof t==`string`?e.createEl(`p`,{cls:`whitespace-pre-wrap`,text:t}):e.append(t),e.createEl(`p`,{cls:`whitespace-pre-wrap`,text:r(`migrationDescription`)}),new a(e).addButton(e=>e.setButtonText(r(`cancel`)).onClick(this.close.bind(this))).addButton(e=>e.setButtonText(r(`toggleWithoutMigration`)).onClick(async()=>{await n(),this.close()})).addButton(e=>e.setButtonText(r(`startMigration`)).setCta().onClick(this.handleMigration))}handleMigration=()=>{let{on:n,translate:r,dispatch:i}=this.ctx;this.contentEl.empty(),this.setTitle(r(`migrationProcess`));let{left:o,right:s,bar:c}=e(this.contentEl,`mb-3`),l,u=e=>{l?.remove(),l=new a(this.contentEl).addButton(t=>t.setButtonText(r(e)).onClick(this.close.bind(this))).settingEl};u(`hide`),this.cleanupCallbacks.push(n(`migrationProgress`,({total:e,completed:n,current:a})=>{n===0&&i(`logGeneral`,`Migration started.`);let l=t(n,e);s.setText(`${n}/${e} ${r(`completed`)}`),a&&o.setText(a),c.setValue(l),l===100&&u(`done`)}),n(`migrationFailed`,()=>{i(`errorGeneral`,`Migration failed.`),o.setText(r(`migrationFailed`)),u(`done`)})),this.migrate()};migrate=async()=>{let{dispatch:e,requestSync:t,initializeSync:r,translate:a,memoryDB:o}=this.ctx;e(`migrationProgress`,{completed:0,current:a(`migrationPhase1Description`),total:3});let s=(await t(`migration`)).result;if(s===`cancelled`||s===`failed`){e(`migrationFailed`,`phase 1 failed`);return}e(`migrationProgress`,{completed:1,current:a(`migrationPhase2Description`),total:3});try{let{record:e,remoteFs:t}=r();await Promise.all([e.clear(),this.options.apply(),...o.getStore(`remoteContext20000`).entries().sort(([e],[t])=>t.length-e.length).map(([e])=>t.delete(e))])}catch(t){let r=n(t);new i(`${a(`migrationFailed`)}: ${r}`),e(`migrationFailed`,r);return}e(`migrationProgress`,{completed:2,current:a(`migrationPhase3Description`),total:3});let c=(await t(`migration`)).result;if(c===`cancelled`||c===`failed`){e(`migrationFailed`,`phase 3 failed`);return}e(`migrationProgress`,{completed:3,current:a(`completed`),total:3})};onClose(){this.cleanupCallbacks.splice(0).forEach(e=>e()),this.contentEl.empty()}};function s(e,{toggle:t,needMigration:n,content:r,apply:i}){let a=!1;t.onChange(s=>{if(a){a=!1;return}let c=async n=>{n?(a=!0,t.setValue(!s),new o(e,{apply:async()=>{await i(s),a=!0,t.setValue(s)},content:r(s)}).open()):await i(s)},l=n?.(s)??!0;l instanceof Promise?l.then(c):c(l)})}export{s as default};
|
package/dist/prefix.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeBaseDir as e}from"./
|
|
1
|
+
import{normalizeBaseDir as e}from"./shared/src/path.js";function t(e,t){return t===`/`?e:e===`/`?t:`${e}${t}`}function n(e,t){if(e===`/`)return t;if(!t.startsWith(e))throw Error(`Accessed out-of-scope path "${t}"`);return t=t.slice(e.length),t===``?`/`:t}function r(e,t){return Object.assign(t,{key:n(e,t.key)})}function i(e,t){return t.map(t=>r(e,t)).filter(e=>e.key!==`/`)}var a=class{original;prefix;constructor(e,t){this.original=e,this.prefix=t}getUid(){return`${this.original.getUid()}~${this.prefix}`}read(e,n){return this.original.read(t(this.prefix,e),n)}readStream(e,n){return this.original.readStream(t(this.prefix,e),n)}write(e,n,r){return this.original.write(t(this.prefix,e),n,r)}writeStream(e,n,r){return this.original.writeStream(t(this.prefix,e),n,r)}delete(e){return this.original.delete(t(this.prefix,e))}move(e,n){return this.original.move(t(this.prefix,e),t(this.prefix,n))}mkdir(e,n){return this.original.mkdir(t(this.prefix,e),n)}async stat(e){let n=await this.original.stat(t(this.prefix,e));return r(this.prefix,n)}exists(e){return this.original.exists(t(this.prefix,e))}async list(e,r){let a=await this.original.list(t(this.prefix,e),e=>r(Object.assign(e,{current:n(this.prefix,e.current)})));return i(this.prefix,a)}};function o(t,n){return new a(t,e(n))}export{o as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hesprs/sync-engine-sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Official SDK for developing modules targeting Sync Engine, the extensible Obsidian syncing plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"obsidian-plugin",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"scripts": {
|
|
45
45
|
"dev:plugin": "MODE=dev BUILD=plugin tsdown",
|
|
46
46
|
"build:plugin": "BUILD=plugin tsdown",
|
|
47
|
-
"dev": "MODE=dev tsdown",
|
|
48
|
-
"compile": "tsdown",
|
|
47
|
+
"dev": "MODE=dev PASS=dts tsdown && MODE=dev tsdown",
|
|
48
|
+
"compile": "PASS=dts tsdown && tsdown",
|
|
49
49
|
"fix": "oxlint --silent --fix && oxfmt",
|
|
50
50
|
"check": "tsc && oxlint && oxfmt --check",
|
|
51
51
|
"tests": "bun --preload=./test/mocks test"
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Fs, WrappedFs } from "./packages/plugin/src/fs/interface.spec.js";
|
|
2
|
-
import "./packages/plugin/src/fs/index.spec.js";
|
|
3
|
-
//#region src/sdk/debug-wrapper.d.ts
|
|
4
|
-
declare function debugWrapper(original: Fs, log: (content: string) => void): WrappedFs;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { debugWrapper as default };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.bun/synthkernel@.+synthkernel.tgz/node_modules/synthkernel/dist/context.d.ts
|
|
2
|
-
//#region src/context.d.ts
|
|
3
|
-
type General = any;
|
|
4
|
-
type GeneralConstructor = new (...args: Array<General>) => General;
|
|
5
|
-
type ModuleConstructor<C extends object> = new (context: C) => General;
|
|
6
|
-
type GeneralModuleInput = ReadonlyArray<GeneralConstructor> | ReadonlyArray<object>;
|
|
7
|
-
type IsPlainObject<T> = T extends object ? T extends Function | Date | RegExp | Array<any> | Map<any, any> | Set<any> ? false : true : false;
|
|
8
|
-
type ShallowMerge<A, B> = IsPlainObject<A> extends true ? (IsPlainObject<B> extends true ? Omit<A, keyof B> & B : B) : B;
|
|
9
|
-
type Keys<T> = T extends General ? keyof T : never;
|
|
10
|
-
type InstanceEach<T extends GeneralModuleInput> = T extends ReadonlyArray<GeneralConstructor> ? { [K in keyof T]: InstanceType<T[K]>; } : T;
|
|
11
|
-
type PickEach<T extends ReadonlyArray<object>, K extends PropertyKey> = { [I in keyof T]: Pick<T[I], Extract<K, keyof T[I]>>; };
|
|
12
|
-
type RootValue<T extends object> = RootKey extends keyof T ? Extract<T[RootKey], object> : {};
|
|
13
|
-
type MergeRootEach<T extends ReadonlyArray<object>> = { [I in keyof T]: ShallowMerge<Omit<T[I], RootKey>, RootValue<T[I]>>; };
|
|
14
|
-
type ExtractKeyEach<T extends ReadonlyArray<object>, K extends Keys<T>> = { [I in keyof T]: K extends keyof T[I] ? T[I][K] : never; };
|
|
15
|
-
type MergeObjects<T extends ReadonlyArray<object>, O extends ReadonlyArray<object> = MergeRootEach<T>> = { [P in Keys<O[number]>]: MergeValues<ExtractKeyEach<O, P>>; };
|
|
16
|
-
type MergeSingleKey<M extends GeneralModuleInput, K extends Keys<InstanceEach<M>[number]>> = MergeValues<ExtractKeyEach<InstanceEach<M>, K>>;
|
|
17
|
-
type MergePair<A, B> = [A] extends [never] ? B : [B] extends [never] ? A : ShallowMerge<A, B>;
|
|
18
|
-
type MergeValues<T extends ReadonlyArray<unknown>> = T extends readonly [infer First, ...infer Rest] ? [First] extends [never] ? MergeValues<Rest> : Rest extends ReadonlyArray<unknown> ? Rest['length'] extends 0 ? First : MergePair<First, MergeValues<Rest>> : never : never;
|
|
19
|
-
type MergeResult<M extends GeneralModuleInput, K extends Keys<InstanceEach<M>[number]>, Pr extends object, Po extends object> = MergeObjects<[Pr, ...PickEach<InstanceEach<M>, K>, Po]>;
|
|
20
|
-
type Context<M extends GeneralModuleInput, K extends Keys<InstanceEach<M>[number]>, Pr extends object = {}, Po extends object = {}> = MergeResult<M, K, Pr, Po> & {
|
|
21
|
-
__modules__: WeakMap<M[number], InstanceEach<M>[number]>;
|
|
22
|
-
__getModule__: <C extends new (ctx: General) => InstanceEach<M>[number]>(ctor: C) => InstanceType<C>;
|
|
23
|
-
__addModule__: <N extends ModuleConstructor<Context<[...M, N], K, Pr, Po>>>(newModule: N) => Context<[...M, N], K, Pr, Po>;
|
|
24
|
-
__assign__: (obj: Partial<MergeResult<M, K, Pr, Po>>) => Context<M, K, Pr, Po>;
|
|
25
|
-
};
|
|
26
|
-
declare const ROOT_KEY = "root";
|
|
27
|
-
type RootKey = typeof ROOT_KEY;
|
|
28
|
-
//#endregion
|
|
29
|
-
export { Context, MergeSingleKey };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.bun/synthkernel@.+synthkernel.tgz/node_modules/synthkernel/dist/reactive.d.ts
|
|
2
|
-
//#region src/reactive.d.ts
|
|
3
|
-
type RefMatchingFunc<T> = (newValue: T, oldValue: T) => unknown;
|
|
4
|
-
type Ref<T> = {
|
|
5
|
-
(): T;
|
|
6
|
-
(newValue: T): void;
|
|
7
|
-
subscribe(func: RefMatchingFunc<T>, options?: {
|
|
8
|
-
immediate?: boolean;
|
|
9
|
-
}): () => void;
|
|
10
|
-
unsubscribe(func: RefMatchingFunc<T>): void;
|
|
11
|
-
clear(): void;
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Ref };
|
package/dist/node_modules/.bun/uni-kv@.._.._uni-kv.tgz/node_modules/uni-kv/dist/interface.spec.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.bun/uni-kv@..+..+uni-kv.tgz/node_modules/uni-kv/dist/interface.d.ts
|
|
2
|
-
//#region src/interface.d.ts
|
|
3
|
-
type Database<D extends Record<string, unknown>, M extends Record<string, unknown>, F extends boolean> = {
|
|
4
|
-
getStore<K extends keyof D>(name: K): Store<D[K], F>;
|
|
5
|
-
getStoreNames(): IsPromise<Array<string>, F>;
|
|
6
|
-
deleteStore(name: string): IsPromise<void, F>;
|
|
7
|
-
clearStores(): IsPromise<void, F>;
|
|
8
|
-
getMeta<T extends keyof M>(key: T): IsPromise<M[T] | undefined, F>;
|
|
9
|
-
setMeta<T extends keyof M>(key: T, value: M[T]): IsPromise<void, F>;
|
|
10
|
-
dispose(): IsPromise<void, F>;
|
|
11
|
-
};
|
|
12
|
-
type Store<T, F extends boolean> = {
|
|
13
|
-
get(key: string): IsPromise<T | undefined, F>;
|
|
14
|
-
set(key: string, value: T): IsPromise<void, F>;
|
|
15
|
-
delete(key: string): IsPromise<void, F>;
|
|
16
|
-
clear(): IsPromise<void, F>;
|
|
17
|
-
keys(): IsPromise<Array<string>, F>;
|
|
18
|
-
values(): IsPromise<Array<T>, F>;
|
|
19
|
-
entries(): IsPromise<Array<[string, T]>, F>;
|
|
20
|
-
batch(operations: Array<StoreOperations<T>>): IsPromise<Array<GetResult<T>>, F>;
|
|
21
|
-
};
|
|
22
|
-
type StoreSync<T = unknown> = Store<T, false>;
|
|
23
|
-
type StoreAsync<T = unknown> = Store<T, true>;
|
|
24
|
-
type DatabaseSync<D extends Record<string, unknown> = Record<string, unknown>, M extends Record<string, unknown> = {}> = Database<D, M, false>;
|
|
25
|
-
type DatabaseAsync<D extends Record<string, unknown> = Record<string, unknown>, M extends Record<string, unknown> = {}> = Database<D, M, true>;
|
|
26
|
-
type GetOperation = {
|
|
27
|
-
type: 'get';
|
|
28
|
-
key: string;
|
|
29
|
-
};
|
|
30
|
-
type GetResult<T> = {
|
|
31
|
-
key: string;
|
|
32
|
-
value: T | undefined;
|
|
33
|
-
};
|
|
34
|
-
type SetOperation<T> = {
|
|
35
|
-
type: 'set';
|
|
36
|
-
key: string;
|
|
37
|
-
value: T;
|
|
38
|
-
};
|
|
39
|
-
type DeleteOperation = {
|
|
40
|
-
type: 'delete';
|
|
41
|
-
key: string;
|
|
42
|
-
};
|
|
43
|
-
type StoreOperations<T> = GetOperation | SetOperation<T> | DeleteOperation;
|
|
44
|
-
type IsPromise<T, F extends boolean> = F extends true ? Promise<T> : T;
|
|
45
|
-
//#endregion
|
|
46
|
-
export { DatabaseAsync, DatabaseSync, DeleteOperation, GetOperation, GetResult, SetOperation, StoreAsync, StoreOperations, StoreSync };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import "../types.spec.js";
|
|
2
|
-
import "../modules/I18n.spec.js";
|
|
3
|
-
import { App, Modal } from "obsidian";
|
|
4
|
-
//#region src/components/FilterEditorModal.d.ts
|
|
5
|
-
type FilterEditorTranslations = {
|
|
6
|
-
cancel: string;
|
|
7
|
-
remove: string;
|
|
8
|
-
save: string;
|
|
9
|
-
add: string;
|
|
10
|
-
inclusionRules: string;
|
|
11
|
-
exclusionRules: string;
|
|
12
|
-
inclusionRulesDescription: string;
|
|
13
|
-
exclusionRulesDescription: string;
|
|
14
|
-
filterPlaceholder: string;
|
|
15
|
-
};
|
|
16
|
-
//#endregion
|
|
17
|
-
export { FilterEditorTranslations };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import "../modules/I18n.spec.js";
|
|
2
|
-
import "../modules/Bootstrap.spec.js";
|
|
3
|
-
import { App, Modal } from "obsidian";
|
|
4
|
-
//#region src/components/HeadersEditorModal.d.ts
|
|
5
|
-
type HeadersEditorTranslations = {
|
|
6
|
-
add: string;
|
|
7
|
-
cancel: string;
|
|
8
|
-
addSecretHeader: string;
|
|
9
|
-
remove: string;
|
|
10
|
-
save: string;
|
|
11
|
-
customHeadersDescription: string;
|
|
12
|
-
editHeaders: string;
|
|
13
|
-
headerKeyPlaceholder: string;
|
|
14
|
-
headerValuePlaceholder: string;
|
|
15
|
-
omittedInvalidEntry: string;
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { HeadersEditorTranslations };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { MaybePromise, Progress } from "../types.spec.js";
|
|
2
|
-
import { Dispatch, On } from "../modules/EventBus.spec.js";
|
|
3
|
-
import { Translate } from "../modules/I18n.spec.js";
|
|
4
|
-
import { SyncTerminateReason } from "../modules/Sync.spec.js";
|
|
5
|
-
import { ExistingMemoryDB } from "../modules/Bootstrap.spec.js";
|
|
6
|
-
import { Events } from "../index.spec.js";
|
|
7
|
-
import { Infras } from "../modules/Registrar.spec.js";
|
|
8
|
-
import { App, ToggleComponent } from "obsidian";
|
|
9
|
-
//#region src/components/MigrationModal.d.ts
|
|
10
|
-
type MigrationModalTranslations = {
|
|
11
|
-
cancel: string;
|
|
12
|
-
remoteMigration: string;
|
|
13
|
-
migrationProcess: string;
|
|
14
|
-
startMigration: string;
|
|
15
|
-
migrationDescription: string;
|
|
16
|
-
migrationPhase1Description: string;
|
|
17
|
-
migrationPhase2Description: string;
|
|
18
|
-
migrationPhase3Description: string;
|
|
19
|
-
toggleWithoutMigration: string;
|
|
20
|
-
migrationFailed: string;
|
|
21
|
-
completed: string;
|
|
22
|
-
hide: string;
|
|
23
|
-
done: string;
|
|
24
|
-
};
|
|
25
|
-
type MigrationEvents = {
|
|
26
|
-
migrationProgress: Progress;
|
|
27
|
-
migrationFailed: string;
|
|
28
|
-
};
|
|
29
|
-
type MigrationContext = {
|
|
30
|
-
app: App;
|
|
31
|
-
on: On<MigrationEvents>;
|
|
32
|
-
dispatch: Dispatch<MigrationEvents & Events>;
|
|
33
|
-
translate: Translate<MigrationModalTranslations>;
|
|
34
|
-
requestSync: (trigger: string) => Promise<SyncTerminateReason>;
|
|
35
|
-
initializeSync: () => Infras;
|
|
36
|
-
memoryDB: ExistingMemoryDB;
|
|
37
|
-
};
|
|
38
|
-
declare function setNeedMigration(ctx: MigrationContext, { toggle, needMigration, content, apply }: {
|
|
39
|
-
toggle: ToggleComponent;
|
|
40
|
-
needMigration?: (value: boolean) => MaybePromise<boolean>;
|
|
41
|
-
content: (value: boolean) => string | DocumentFragment;
|
|
42
|
-
apply: (value: boolean) => MaybePromise<void>;
|
|
43
|
-
}): void;
|
|
44
|
-
//#endregion
|
|
45
|
-
export { MigrationModalTranslations, setNeedMigration as default };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import "../types.spec.js";
|
|
2
|
-
import { Fragment } from "../modules/I18n.spec.js";
|
|
3
|
-
import "../modules/Extensibility.spec.js";
|
|
4
|
-
import { App, Modal } from "obsidian";
|
|
5
|
-
//#region src/components/ModuleEditorModal.d.ts
|
|
6
|
-
type ModuleEditorTranslations = {
|
|
7
|
-
editModuleInformation: string;
|
|
8
|
-
enable: string;
|
|
9
|
-
name: string;
|
|
10
|
-
namePlaceholder: string;
|
|
11
|
-
description: string;
|
|
12
|
-
descriptionPlaceholder: string;
|
|
13
|
-
icon: string;
|
|
14
|
-
iconDescription: Fragment;
|
|
15
|
-
iconPlaceholder: string;
|
|
16
|
-
updateSource: string;
|
|
17
|
-
updateSourceDescription: string;
|
|
18
|
-
updateSourcePlaceholder: string;
|
|
19
|
-
invalidValue: string;
|
|
20
|
-
integrityVerification: string;
|
|
21
|
-
integrityVerificationDescription: Fragment;
|
|
22
|
-
save: string;
|
|
23
|
-
cancel: string;
|
|
24
|
-
};
|
|
25
|
-
//#endregion
|
|
26
|
-
export { ModuleEditorTranslations };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import "../modules/I18n.spec.js";
|
|
2
|
-
import { App, Modal } from "obsidian";
|
|
3
|
-
//#region src/components/SourceEditorModal.d.ts
|
|
4
|
-
type SourceEditorTranslations = {
|
|
5
|
-
add: string;
|
|
6
|
-
cancel: string;
|
|
7
|
-
editSources: string;
|
|
8
|
-
omittedInvalidEntry: string;
|
|
9
|
-
moduleSourcePlaceholder: string;
|
|
10
|
-
remove: string;
|
|
11
|
-
save: string;
|
|
12
|
-
sourcesDescription: string;
|
|
13
|
-
httpInsecureWarning: string;
|
|
14
|
-
};
|
|
15
|
-
//#endregion
|
|
16
|
-
export { SourceEditorTranslations };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Fragment } from "../modules/I18n.spec.js";
|
|
2
|
-
import "../../../../index.spec.js";
|
|
3
|
-
import { App, Modal } from "obsidian";
|
|
4
|
-
//#region src/components/UnknownModuleModal.d.ts
|
|
5
|
-
type FileInfo = {
|
|
6
|
-
path: string;
|
|
7
|
-
size: string;
|
|
8
|
-
mtime: string;
|
|
9
|
-
ctime: string;
|
|
10
|
-
fileName: string;
|
|
11
|
-
};
|
|
12
|
-
type UnknownModuleTranslations = {
|
|
13
|
-
unknownModule: string;
|
|
14
|
-
unknownModuleDescription: Fragment<FileInfo>;
|
|
15
|
-
delete: string;
|
|
16
|
-
configure: string;
|
|
17
|
-
};
|
|
18
|
-
//#endregion
|
|
19
|
-
export { UnknownModuleTranslations };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import "../../modules/I18n.spec.js";
|
|
2
|
-
import "../../modules/Extensibility.spec.js";
|
|
3
|
-
import { App } from "obsidian";
|
|
4
|
-
//#region src/components/module-management/index.d.ts
|
|
5
|
-
type ModuleManagementTranslations = {
|
|
6
|
-
disableModule: string;
|
|
7
|
-
disabled: string;
|
|
8
|
-
downloadModule: string;
|
|
9
|
-
enableModule: string;
|
|
10
|
-
enabled: string;
|
|
11
|
-
installed: string;
|
|
12
|
-
loadingModules: string;
|
|
13
|
-
noInstalledModulesFound: string;
|
|
14
|
-
noMatchingModulesFound: string;
|
|
15
|
-
noModulesAvailable: string;
|
|
16
|
-
notInstalled: string;
|
|
17
|
-
updateAvailable: string;
|
|
18
|
-
updateModule: string;
|
|
19
|
-
deleteModule: string;
|
|
20
|
-
editModuleInformation: string;
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
export { ModuleManagementTranslations };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./interface.spec.js";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BatchOptimizer, CustomAtom, DeleteAtom, Fs, InputAtom, ListReporter, MkdirAtom, MoveAtom, OptimizerInput, OptimizerOutput, OutputAtom, RootFs, WrappedFs, WriteAtom } from "./interface.spec.js";
|
|
2
|
-
import "./wrappers/optimization.spec.js";
|
|
3
|
-
import "./wrappers/asymmetric-storage.spec.js";
|
|
4
|
-
import "./wrappers/context.spec.js";
|
|
5
|
-
import "./wrappers/cancellation.spec.js";
|
|
6
|
-
import "./wrappers/memory-control.spec.js";
|
|
7
|
-
import "./middlewares/rate-limiter.spec.js";
|
|
8
|
-
import "./middlewares/retry.spec.js";
|
|
9
|
-
import "./middlewares/custom-headers.spec.js";
|
|
10
|
-
import { VaultRequest } from "./vault/request.spec.js";
|
|
11
|
-
import "./vault/index.spec.js";
|
|
12
|
-
import "./hierarchical-optimizer.spec.js";
|
|
13
|
-
export type { BatchOptimizer, CustomAtom, DeleteAtom, Fs, InputAtom, ListReporter, MkdirAtom, MoveAtom, OptimizerInput, OptimizerOutput, OutputAtom, RootFs, VaultRequest, WrappedFs, WriteAtom };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Binary, FileStat, MaybePromise, Progress, Stat } from "../types.spec.js";
|
|
2
|
-
import { GlobMatchResult } from "../utils/glob-match.spec.js";
|
|
3
|
-
//#region src/fs/interface.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* All keys use unified format:
|
|
6
|
-
* - root: `/`
|
|
7
|
-
* - file: `note.md`, `folder/note.md`
|
|
8
|
-
* - folder: `folder/`, `folder/nested/`
|
|
9
|
-
*/
|
|
10
|
-
type RootFs = {
|
|
11
|
-
getUid(): string;
|
|
12
|
-
read(key: string, stat: FileStat): MaybePromise<Binary>;
|
|
13
|
-
readStream(key: string, stat: FileStat): MaybePromise<ReadableStream<Binary>>;
|
|
14
|
-
write(key: string, value: Binary, stat: FileStat): MaybePromise<string>;
|
|
15
|
-
writeStream(key: string, value: ReadableStream<Binary>, stat: FileStat): MaybePromise<string>;
|
|
16
|
-
delete(key: string): MaybePromise<void>;
|
|
17
|
-
move(oldKey: string, newKey: string): MaybePromise<void>;
|
|
18
|
-
mkdir(key: string, recursive?: boolean): MaybePromise<void>;
|
|
19
|
-
stat(key: string): MaybePromise<Stat>;
|
|
20
|
-
exists(key: string): MaybePromise<boolean>;
|
|
21
|
-
list(key: string, reporter: ListReporter): MaybePromise<Array<Stat>>;
|
|
22
|
-
};
|
|
23
|
-
type ListReporter = (progress: Required<Progress>) => MaybePromise<GlobMatchResult>;
|
|
24
|
-
type WrappedFs = RootFs & {
|
|
25
|
-
original: Fs;
|
|
26
|
-
};
|
|
27
|
-
type Fs = WrappedFs | RootFs;
|
|
28
|
-
type WriteAtom = {
|
|
29
|
-
type: 'write';
|
|
30
|
-
key: string;
|
|
31
|
-
execute: () => MaybePromise<string>;
|
|
32
|
-
resolve: (uid: string) => void;
|
|
33
|
-
reject: (err: Error) => void;
|
|
34
|
-
};
|
|
35
|
-
type DeleteAtom = {
|
|
36
|
-
type: 'delete';
|
|
37
|
-
key: string;
|
|
38
|
-
execute: () => MaybePromise<void>;
|
|
39
|
-
resolve: () => void;
|
|
40
|
-
reject: (err: Error) => void;
|
|
41
|
-
};
|
|
42
|
-
type MoveAtom = {
|
|
43
|
-
type: 'move';
|
|
44
|
-
oldKey: string;
|
|
45
|
-
newKey: string;
|
|
46
|
-
execute: () => MaybePromise<void>;
|
|
47
|
-
resolve: () => void;
|
|
48
|
-
reject: (err: Error) => void;
|
|
49
|
-
};
|
|
50
|
-
type MkdirAtom = {
|
|
51
|
-
type: 'mkdir';
|
|
52
|
-
key: string;
|
|
53
|
-
execute: () => MaybePromise<void>;
|
|
54
|
-
resolve: () => void;
|
|
55
|
-
reject: (err: Error) => void;
|
|
56
|
-
};
|
|
57
|
-
type InputAtom = WriteAtom | DeleteAtom | MoveAtom | MkdirAtom;
|
|
58
|
-
type CustomAtom = {
|
|
59
|
-
type: 'custom';
|
|
60
|
-
execute: () => MaybePromise<void>;
|
|
61
|
-
};
|
|
62
|
-
type OutputAtom = InputAtom | CustomAtom;
|
|
63
|
-
type OptimizerInput = {
|
|
64
|
-
atoms: Array<InputAtom>;
|
|
65
|
-
fs: Fs;
|
|
66
|
-
executeAtom: (atom: OutputAtom) => Promise<void | string>;
|
|
67
|
-
};
|
|
68
|
-
type OptimizerOutput = Array<OutputAtom>;
|
|
69
|
-
type BatchOptimizer = (input: OptimizerInput) => OptimizerOutput;
|
|
70
|
-
//#endregion
|
|
71
|
-
export { BatchOptimizer, CustomAtom, DeleteAtom, Fs, InputAtom, ListReporter, MkdirAtom, MoveAtom, OptimizerInput, OptimizerOutput, OutputAtom, RootFs, WrappedFs, WriteAtom };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../../modules/Registrar.spec.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../../types.spec.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../../modules/Registrar.spec.js";
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Binary } from "../../types.spec.js";
|
|
2
|
-
import { App, ListedFiles, Stat } from "obsidian";
|
|
3
|
-
//#region src/fs/vault/request.d.ts
|
|
4
|
-
type VaultRequestParam = {
|
|
5
|
-
method: 'GET';
|
|
6
|
-
key: string;
|
|
7
|
-
} | {
|
|
8
|
-
method: 'GET_STREAM';
|
|
9
|
-
key: string;
|
|
10
|
-
} | {
|
|
11
|
-
method: 'PUT';
|
|
12
|
-
key: string;
|
|
13
|
-
value: Binary;
|
|
14
|
-
headers?: {
|
|
15
|
-
mtime?: number;
|
|
16
|
-
ctime?: number;
|
|
17
|
-
};
|
|
18
|
-
} | {
|
|
19
|
-
method: 'APPEND';
|
|
20
|
-
key: string;
|
|
21
|
-
value: Binary;
|
|
22
|
-
headers?: {
|
|
23
|
-
mtime?: number;
|
|
24
|
-
ctime?: number;
|
|
25
|
-
};
|
|
26
|
-
} | {
|
|
27
|
-
method: 'DELETE';
|
|
28
|
-
key: string;
|
|
29
|
-
headers?: {
|
|
30
|
-
permanent?: boolean;
|
|
31
|
-
};
|
|
32
|
-
} | {
|
|
33
|
-
method: 'MOVE';
|
|
34
|
-
key: string;
|
|
35
|
-
headers: {
|
|
36
|
-
destination: string;
|
|
37
|
-
};
|
|
38
|
-
} | {
|
|
39
|
-
method: 'MKDIR';
|
|
40
|
-
key: string;
|
|
41
|
-
} | {
|
|
42
|
-
method: 'EXISTS';
|
|
43
|
-
key: string;
|
|
44
|
-
} | {
|
|
45
|
-
method: 'STAT';
|
|
46
|
-
key: string;
|
|
47
|
-
headers?: {
|
|
48
|
-
cached?: boolean;
|
|
49
|
-
};
|
|
50
|
-
} | {
|
|
51
|
-
method: 'LIST';
|
|
52
|
-
key: string;
|
|
53
|
-
headers?: {
|
|
54
|
-
cached?: boolean;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
type VaultRequestResponseMap = {
|
|
58
|
-
GET: Binary;
|
|
59
|
-
GET_STREAM: ReadableStream<Binary>;
|
|
60
|
-
PUT: void;
|
|
61
|
-
APPEND: void;
|
|
62
|
-
DELETE: void;
|
|
63
|
-
MOVE: void;
|
|
64
|
-
MKDIR: void;
|
|
65
|
-
EXISTS: boolean;
|
|
66
|
-
STAT: Stat;
|
|
67
|
-
LIST: ListedFiles;
|
|
68
|
-
};
|
|
69
|
-
type VaultRequest = <T extends VaultRequestParam>(params: T) => Promise<VaultRequestResponseMap[T['method']]>;
|
|
70
|
-
//#endregion
|
|
71
|
-
export { VaultRequest };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../interface.spec.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../interface.spec.js";
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Context as Context$1, MergeSingleKey } from "../../../node_modules/.bun/synthkernel@._synthkernel.tgz/node_modules/synthkernel/dist/context.spec.js";
|
|
2
|
-
import EventBus from "./modules/EventBus.spec.js";
|
|
3
|
-
import I18n from "./modules/I18n.spec.js";
|
|
4
|
-
import Storage from "./modules/Storage.spec.js";
|
|
5
|
-
import Sync from "./modules/Sync.spec.js";
|
|
6
|
-
import Observability, { AddRibbonIcon } from "./modules/Observability.spec.js";
|
|
7
|
-
import Extensibility from "./modules/Extensibility.spec.js";
|
|
8
|
-
import Bootstrap from "./modules/Bootstrap.spec.js";
|
|
9
|
-
import ModulesModal from "./modules/ModulesModal.spec.js";
|
|
10
|
-
import ProgressModal from "./modules/ProgressModal.spec.js";
|
|
11
|
-
import Scheduler from "./modules/Scheduler.spec.js";
|
|
12
|
-
import Registrar from "./modules/Registrar.spec.js";
|
|
13
|
-
import { App, Command, EventRef, Plugin } from "obsidian";
|
|
14
|
-
//#region src/index.d.ts
|
|
15
|
-
declare const internalModules: readonly [typeof EventBus, typeof I18n, typeof Storage, typeof Extensibility, typeof Registrar, typeof Sync, typeof Observability, typeof Scheduler, typeof ProgressModal, typeof ModulesModal, typeof Bootstrap];
|
|
16
|
-
type InternalModules = typeof internalModules;
|
|
17
|
-
type MergeKeys = 'settings' | 'root' | 'events' | 'i18n';
|
|
18
|
-
type Context = Context$1<InternalModules, MergeKeys, {
|
|
19
|
-
app: App;
|
|
20
|
-
addCommand: (command: Command) => Command;
|
|
21
|
-
registerEvent: (ref: EventRef) => void;
|
|
22
|
-
addRibbonIcon: AddRibbonIcon;
|
|
23
|
-
addStatusBarItem: () => HTMLElement;
|
|
24
|
-
saveSettings: () => Promise<void>;
|
|
25
|
-
}>;
|
|
26
|
-
type Events = MergeSingleKey<InternalModules, 'events'>;
|
|
27
|
-
type Settings = MergeSingleKey<InternalModules, 'settings'>;
|
|
28
|
-
type Translations = MergeSingleKey<InternalModules, 'i18n'>;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { Context, Events, MergeKeys, Settings, Translations };
|