zen-fs-config 0.11.0 → 0.11.4
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/README.md +19 -0
- package/README.zh-CN.md +18 -0
- package/dist/{backend-registry-5KJGMNZX.mjs → backend-registry-F7RJCILX.mjs} +1 -1
- package/dist/backends/gitee.mjs +1 -1
- package/dist/backends/github.mjs +1 -1
- package/dist/backends/remotestorage.mjs +1 -1
- package/dist/backends/webdav.mjs +1 -1
- package/dist/{chunk-S2OW2HJC.mjs → chunk-VUFW6U3A.mjs} +232 -19
- package/dist/index.d.mts +40 -2
- package/dist/index.d.ts +40 -2
- package/dist/index.js +258 -26
- package/dist/index.mjs +10 -2
- package/dist/zen-fs-config.js +317 -58
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -36,6 +36,24 @@ npm install zen-fs-remotestoragejs # RemoteStorage replica
|
|
|
36
36
|
>
|
|
37
37
|
> **Cloud backends are optional peer dependencies, installed by you (the consumer), not bundled by `zen-fs-config`.** The core *pre-registers* the `GitHub`, `Gitee`, and `RemoteStorage` backend **types** (so you can pass `type: 'Gitee'`, etc. straight to `addBackend`/`connect` without calling `registerBackend`), but it does **not** ship their implementations. You must `npm install` the matching package yourself; otherwise `createBackend()` throws a clear "package not installed — run `npm install <pkg>`" hint. This keeps the core bundle small and avoids forcing an internet dependency on everyone.
|
|
38
38
|
|
|
39
|
+
### Installing behind a mirror (without dirtying the lockfile)
|
|
40
|
+
|
|
41
|
+
This repo commits an `.npmrc` with `registry=https://registry.npmjs.org/`, so the `resolved` hosts in `package-lock.json` always point at the official registry. If they don't, CI running npm 12 (`allow-remote=none`) refuses to install with `EALLOWREMOTE`.
|
|
42
|
+
|
|
43
|
+
To use a mirror locally **without touching the lockfile**, run `npm ci` with a one-off registry override:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# installs only — npm rewrites the npmjs hosts to this registry for download
|
|
47
|
+
npm ci --registry=https://registry.npmmirror.com
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Do **not** pass the mirror when adding or updating packages: `npm install <pkg>` stamps the then-current registry's absolute URL into the lock. If it happens, normalise before committing:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm i --package-lock-only --registry=https://registry.npmjs.org
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
|
|
39
57
|
## Usage via `<script>` tag (no build step)
|
|
40
58
|
|
|
41
59
|
A self-contained browser bundle is published at `dist/zen-fs-config.js`. It bundles the **core** dependencies (`@zenfs/core`, `@zenfs/dom`, `zen-fs-sync`, `zen-fs-cache`) and exposes the library on the global `window.ZenFSConfig`. No npm install, no bundler — just drop it into any HTML page. **Cloud backends (GitHub / Gitee / RemoteStorage) are NOT bundled** — see the section below to enable them in `<script>` mode with **no import map required**.
|
|
@@ -103,6 +121,7 @@ import 'zen-fs-config/backends/remotestorage' // → zen-fs-remotestoragejs
|
|
|
103
121
|
```
|
|
104
122
|
|
|
105
123
|
Notes:
|
|
124
|
+
- **If your host lets users pick the backend type in the UI, import all four entries.** The registry only knows the backends whose entry you imported. Skip one (say you imported gitee + webdav only) and the moment a user selects the missing one (e.g. RemoteStorage) it fails at runtime with the *same* `Backend package "zen-fs-remotestoragejs" is not available` message — indistinguishable from "the package isn't installed", which sends debugging in the wrong direction. The entries themselves cost almost nothing: the backend package still lives in its own lazy chunk and is never downloaded unless that backend is used.
|
|
106
125
|
- Importing an entry does **not** duplicate the registry: all entries share one chunk with the main entry, so the backend map stays single-instance, and the package itself is still code-split (only fetched when the backend is first used).
|
|
107
126
|
- The backend metadata (options schema, identity/account fields) always comes from the library — hosts should not re-declare it.
|
|
108
127
|
- If you prefer to own the registration, the same entries work with an injected loader:
|
package/README.zh-CN.md
CHANGED
|
@@ -33,6 +33,23 @@ npm install zen-fs-remotestoragejs # RemoteStorage 副本
|
|
|
33
33
|
>
|
|
34
34
|
> **云后端是可选对等依赖,由你(使用者)自行安装,`zen-fs-config` 并不打包它们。** 核心会**预注册** `GitHub`、`Gitee`、`RemoteStorage` 这三种后端**类型**(因此你可以直接把 `type: 'Gitee'` 等传给 `addBackend`/`connect`,无需调用 `registerBackend`),但**不包含它们的实现包**。你必须自己 `npm install` 对应包;否则 `createBackend()` 会抛出明确的"未安装——请运行 `npm install <pkg>`"提示。这样可保持核心包体积精简,也不会强制所有人都带上网络依赖。
|
|
35
35
|
|
|
36
|
+
### 国内镜像 / 本地加速(不改动 lockfile)
|
|
37
|
+
|
|
38
|
+
本仓库根目录提交了 `.npmrc`(`registry=https://registry.npmjs.org/`),保证 `package-lock.json` 里的 `resolved` 主机名始终是官方 registry——否则 CI 一旦用 npm 12(`allow-remote=none`)就会 `EALLOWREMOTE` 拒装。
|
|
39
|
+
|
|
40
|
+
本地想走镜像而不污染 lockfile,用 `npm ci` 加一次性 registry 覆盖即可:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# 只装、不改 lock:npm 会把锁里的 npmjs 地址改写为当前 registry 去下载
|
|
44
|
+
npm ci --registry=https://registry.npmmirror.com
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**加/升级依赖时不要带镜像参数**(`npm install <pkg>` 会把当时 registry 的绝对 URL 写进 lock),若不慎写入,提交前归一化:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm i --package-lock-only --registry=https://registry.npmjs.org
|
|
51
|
+
```
|
|
52
|
+
|
|
36
53
|
## 通过 `<script>` 标签直接使用(无需构建)
|
|
37
54
|
|
|
38
55
|
包内置了一个自包含的浏览器构建 `dist/zen-fs-config.js`,它把**核心**依赖(`@zenfs/core`、`@zenfs/dom`、`zen-fs-sync`、`zen-fs-cache`)打包在一起,并将库挂载到全局变量 `window.ZenFSConfig`。无需 npm install、无需打包工具,直接放入任意 HTML 页面即可。**云后端(GitHub / Gitee / RemoteStorage)并不包含在自包含包内**——见下方小节,了解如何在 `<script>` 模式下启用它们(**无需 import map**)。
|
|
@@ -100,6 +117,7 @@ import 'zen-fs-config/backends/remotestorage' // → zen-fs-remotestoragejs
|
|
|
100
117
|
```
|
|
101
118
|
|
|
102
119
|
说明:
|
|
120
|
+
- **宿主如果让用户在界面上选后端类型,就把四个入口全引一遍。** 注册表里只有你引过的入口对应的后端;少引一个(例如只引了 gitee + webdav),用户一旦切到没引的那个(比如 RemoteStorage),运行时报的错和「包没装」长得一模一样(同样是 `Backend package "zen-fs-remotestoragejs" is not available`),排查很容易走偏。入口本身几乎没成本——后端包仍是独立的懒加载 chunk,没选到的后端不会下载。
|
|
103
121
|
- 引入入口**不会**产生第二份注册表:所有入口与主入口共享同一个 chunk,后端列表仍是单实例;后端包本身依旧按需分包(首次使用时才下载)。
|
|
104
122
|
- 后端的元数据(参数 schema、identity/account 字段)始终由库提供,宿主不要另抄一份。
|
|
105
123
|
- 如果你想自己掌控注册:`import { registerGiteeBackend } from 'zen-fs-config'; registerGiteeBackend(() => import('zen-fs-gitee'));`(字面量写在你这一侧)。
|
package/dist/backends/gitee.mjs
CHANGED
package/dist/backends/github.mjs
CHANGED
package/dist/backends/webdav.mjs
CHANGED
|
@@ -19,27 +19,27 @@ function openDB(name) {
|
|
|
19
19
|
const factory = idb();
|
|
20
20
|
if (!factory) return Promise.resolve(null);
|
|
21
21
|
return new Promise((resolve) => {
|
|
22
|
-
let
|
|
22
|
+
let req2;
|
|
23
23
|
try {
|
|
24
|
-
|
|
24
|
+
req2 = factory.open(name);
|
|
25
25
|
} catch {
|
|
26
26
|
resolve(null);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
req2.onupgradeneeded = () => {
|
|
30
30
|
try {
|
|
31
|
-
|
|
31
|
+
req2.transaction?.abort();
|
|
32
32
|
} catch {
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
req2.onsuccess = () => resolve(req2.result);
|
|
36
|
+
req2.onerror = () => resolve(null);
|
|
37
|
+
req2.onblocked = () => resolve(null);
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
var request = (
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
var request = (req2) => new Promise((resolve, reject) => {
|
|
41
|
+
req2.onsuccess = () => resolve(req2.result);
|
|
42
|
+
req2.onerror = () => reject(req2.error);
|
|
43
43
|
});
|
|
44
44
|
function isDecodableListing(bytes) {
|
|
45
45
|
if (bytes.length === 0) return false;
|
|
@@ -145,6 +145,203 @@ async function repairIndexedDBStore(storeName) {
|
|
|
145
145
|
return result;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
// src/idb-alloc.ts
|
|
149
|
+
var INO_BLOCK = 32768;
|
|
150
|
+
var META_DB_SUFFIX = "__ino";
|
|
151
|
+
var META_STORE = "meta";
|
|
152
|
+
var HWM_KEY = "inoHwm";
|
|
153
|
+
function idbFactory() {
|
|
154
|
+
return globalThis.indexedDB ?? null;
|
|
155
|
+
}
|
|
156
|
+
function req(request2) {
|
|
157
|
+
return new Promise((resolve, reject) => {
|
|
158
|
+
request2.onsuccess = () => resolve(request2.result);
|
|
159
|
+
request2.onerror = () => reject(request2.error);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function txDone(tx) {
|
|
163
|
+
return new Promise((resolve, reject) => {
|
|
164
|
+
tx.oncomplete = () => resolve();
|
|
165
|
+
tx.onerror = () => reject(tx.error);
|
|
166
|
+
tx.onabort = () => reject(tx.error);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function openStoreDb(name) {
|
|
170
|
+
const factory = idbFactory();
|
|
171
|
+
if (!factory) return Promise.reject(new Error("IndexedDB is not available"));
|
|
172
|
+
return new Promise((resolve, reject) => {
|
|
173
|
+
const request2 = factory.open(name);
|
|
174
|
+
request2.onupgradeneeded = () => {
|
|
175
|
+
const db = request2.result;
|
|
176
|
+
if (db.objectStoreNames.contains(name)) db.deleteObjectStore(name);
|
|
177
|
+
db.createObjectStore(name);
|
|
178
|
+
};
|
|
179
|
+
request2.onsuccess = () => resolve(request2.result);
|
|
180
|
+
request2.onerror = () => reject(request2.error);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
function openMetaDb(name) {
|
|
184
|
+
const factory = idbFactory();
|
|
185
|
+
if (!factory) return Promise.reject(new Error("IndexedDB is not available"));
|
|
186
|
+
return new Promise((resolve, reject) => {
|
|
187
|
+
const request2 = factory.open(name, 1);
|
|
188
|
+
request2.onupgradeneeded = () => {
|
|
189
|
+
const db = request2.result;
|
|
190
|
+
if (!db.objectStoreNames.contains(META_STORE)) db.createObjectStore(META_STORE);
|
|
191
|
+
};
|
|
192
|
+
request2.onsuccess = () => resolve(request2.result);
|
|
193
|
+
request2.onerror = () => reject(request2.error);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
async function attachAllocId(store, storeName, db) {
|
|
197
|
+
const keys = await req(
|
|
198
|
+
db.transaction(storeName, "readonly").objectStore(storeName).getAllKeys()
|
|
199
|
+
);
|
|
200
|
+
let diskMax = 0;
|
|
201
|
+
for (const raw of keys) {
|
|
202
|
+
const n = Number(raw);
|
|
203
|
+
if (Number.isFinite(n) && n > diskMax) diskMax = n;
|
|
204
|
+
}
|
|
205
|
+
const metaDb = await openMetaDb(storeName + META_DB_SUFFIX);
|
|
206
|
+
let base;
|
|
207
|
+
let end;
|
|
208
|
+
try {
|
|
209
|
+
const tx = metaDb.transaction(META_STORE, "readwrite");
|
|
210
|
+
const meta = tx.objectStore(META_STORE);
|
|
211
|
+
const persisted = Number(await req(meta.get(HWM_KEY))) || 0;
|
|
212
|
+
base = Math.max(persisted, diskMax);
|
|
213
|
+
if (base % 2 !== 0) base += 1;
|
|
214
|
+
end = base + INO_BLOCK;
|
|
215
|
+
meta.put(end, HWM_KEY);
|
|
216
|
+
await txDone(tx);
|
|
217
|
+
} finally {
|
|
218
|
+
try {
|
|
219
|
+
metaDb.close?.();
|
|
220
|
+
} catch {
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
let next = base + 2;
|
|
224
|
+
store.allocId = () => {
|
|
225
|
+
if (next >= end) {
|
|
226
|
+
throw new Error(
|
|
227
|
+
`[zen-fs-config] ${storeName}: inode \u53F7\u6BB5\u5DF2\u7528\u5C3D\uFF08${base}~${end}\uFF09\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u8BE5\u5E93`
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
const id = next;
|
|
231
|
+
next += 2;
|
|
232
|
+
return [id, id + 1];
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function withAllocId(base) {
|
|
236
|
+
return {
|
|
237
|
+
name: base?.name ?? "IndexedDB",
|
|
238
|
+
options: base?.options ?? {},
|
|
239
|
+
isAvailable: base?.isAvailable?.bind?.(base) ?? (() => !!idbFactory()),
|
|
240
|
+
async create(options) {
|
|
241
|
+
const storeName = String(options?.storeName ?? "zen-fs-config");
|
|
242
|
+
await repairIndexedDBStore(storeName);
|
|
243
|
+
const db = await openStoreDb(storeName);
|
|
244
|
+
db.onversionchange = () => {
|
|
245
|
+
try {
|
|
246
|
+
db.close();
|
|
247
|
+
} catch {
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
const { IndexedDBStore } = await import("@zenfs/dom");
|
|
251
|
+
const store = new IndexedDBStore(db);
|
|
252
|
+
await attachAllocId(store, storeName, db);
|
|
253
|
+
const zenfs = await import("@zenfs/core");
|
|
254
|
+
const fs = new zenfs.StoreFS(store);
|
|
255
|
+
if (!options?.disableAsyncCache) {
|
|
256
|
+
await store.transaction().preload();
|
|
257
|
+
}
|
|
258
|
+
return fs;
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// src/write-trace.ts
|
|
264
|
+
var WTRACE_KEY = "debug:wtrace";
|
|
265
|
+
var WTRACE_TAG_KEY = "debug:wtrace:tag";
|
|
266
|
+
var WTRACE_ENV = "DEBUG_WTRACE";
|
|
267
|
+
var cachedTag = null;
|
|
268
|
+
function readLocalStorage(key) {
|
|
269
|
+
try {
|
|
270
|
+
const ls = globalThis?.localStorage;
|
|
271
|
+
if (ls && typeof ls.getItem === "function") return ls.getItem(key);
|
|
272
|
+
} catch {
|
|
273
|
+
}
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
function readEnv() {
|
|
277
|
+
try {
|
|
278
|
+
const env = globalThis?.process?.env;
|
|
279
|
+
if (env && typeof env[WTRACE_ENV] === "string") return env[WTRACE_ENV];
|
|
280
|
+
} catch {
|
|
281
|
+
}
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
function watchPatterns() {
|
|
285
|
+
const raw = readLocalStorage(WTRACE_KEY) ?? readEnv();
|
|
286
|
+
if (!raw) return [];
|
|
287
|
+
const value = String(raw).trim();
|
|
288
|
+
if (!value || value === "0") return [];
|
|
289
|
+
if (value === "1" || value === "*" || value.toLowerCase() === "all") return ["*"];
|
|
290
|
+
return value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
291
|
+
}
|
|
292
|
+
function getWriteTraceTag() {
|
|
293
|
+
const configured = (readLocalStorage(WTRACE_TAG_KEY) ?? "").trim();
|
|
294
|
+
if (configured) return configured;
|
|
295
|
+
if (cachedTag === null) cachedTag = Math.random().toString(36).slice(2, 6);
|
|
296
|
+
return cachedTag;
|
|
297
|
+
}
|
|
298
|
+
function fnv1a(bytes) {
|
|
299
|
+
let hash = 2166136261;
|
|
300
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
301
|
+
hash ^= bytes[i];
|
|
302
|
+
hash = Math.imul(hash, 16777619) >>> 0;
|
|
303
|
+
}
|
|
304
|
+
return hash.toString(16).padStart(8, "0");
|
|
305
|
+
}
|
|
306
|
+
function toBytes(data) {
|
|
307
|
+
if (data instanceof Uint8Array) return data;
|
|
308
|
+
if (data instanceof ArrayBuffer) return new Uint8Array(data);
|
|
309
|
+
if (typeof data === "string") return new TextEncoder().encode(data);
|
|
310
|
+
try {
|
|
311
|
+
return new Uint8Array(data);
|
|
312
|
+
} catch {
|
|
313
|
+
return new Uint8Array(0);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
function fmtTime(ms) {
|
|
317
|
+
if (ms === void 0 || !Number.isFinite(ms)) {
|
|
318
|
+
const now = Date.now();
|
|
319
|
+
return `none->now(${now}@${new Date(now).toISOString()})`;
|
|
320
|
+
}
|
|
321
|
+
return `${ms}@${new Date(ms).toISOString()}`;
|
|
322
|
+
}
|
|
323
|
+
function callerFrames() {
|
|
324
|
+
try {
|
|
325
|
+
const stack = new Error().stack;
|
|
326
|
+
if (!stack) return "";
|
|
327
|
+
return stack.split("\n").slice(2, 5).map((line) => line.trim().replace(/^at\s+/, "")).filter(Boolean).join(" <- ").slice(0, 240);
|
|
328
|
+
} catch {
|
|
329
|
+
return "";
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function traceWrite(backend, op, path, data, mtime) {
|
|
333
|
+
const patterns = watchPatterns();
|
|
334
|
+
if (patterns.length === 0) return;
|
|
335
|
+
if (!patterns.some((p) => p === "*" || path.includes(p))) return;
|
|
336
|
+
const bytes = toBytes(data);
|
|
337
|
+
const frames = callerFrames();
|
|
338
|
+
const line = `tag=${getWriteTraceTag()} backend=${backend} op=${op} path=${path} bytes=${bytes.byteLength} fnv=${fnv1a(bytes)} mtime=${fmtTime(mtime)}` + (frames ? ` at=${frames}` : "");
|
|
339
|
+
try {
|
|
340
|
+
console.log(`[wtrace] ${line}`);
|
|
341
|
+
} catch {
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
148
345
|
// src/backend-registry.ts
|
|
149
346
|
var registry = /* @__PURE__ */ new Map();
|
|
150
347
|
var metadataRegistry = /* @__PURE__ */ new Map();
|
|
@@ -239,9 +436,23 @@ function stripAccountFields(type, options) {
|
|
|
239
436
|
}
|
|
240
437
|
return stripped ?? source;
|
|
241
438
|
}
|
|
242
|
-
async function wrapZenFSFileSystem(config) {
|
|
439
|
+
async function wrapZenFSFileSystem(config, label) {
|
|
243
440
|
const zenfs = await import("@zenfs/core");
|
|
244
441
|
const isolatedFS = await zenfs.resolveMountConfig(config);
|
|
442
|
+
const backendLabel = (() => {
|
|
443
|
+
if (label) return label;
|
|
444
|
+
const c = config ?? {};
|
|
445
|
+
const hints = [
|
|
446
|
+
c.owner && c.repo ? `${c.owner}/${c.repo}` : null,
|
|
447
|
+
c.storeName,
|
|
448
|
+
c.label,
|
|
449
|
+
c.name
|
|
450
|
+
];
|
|
451
|
+
for (const hint of hints) {
|
|
452
|
+
if (typeof hint === "string" && hint.trim()) return hint.trim();
|
|
453
|
+
}
|
|
454
|
+
return "backend";
|
|
455
|
+
})();
|
|
245
456
|
let changeCallback = null;
|
|
246
457
|
const notifyChange = () => {
|
|
247
458
|
if (changeCallback) changeCallback();
|
|
@@ -272,6 +483,7 @@ async function wrapZenFSFileSystem(config) {
|
|
|
272
483
|
async writeFile(path, data, _options) {
|
|
273
484
|
const source = data instanceof ArrayBuffer ? new Uint8Array(data) : data instanceof Uint8Array ? data : new TextEncoder().encode(data);
|
|
274
485
|
const bytes = new Uint8Array(source);
|
|
486
|
+
traceWrite(backendLabel, "writeFile", path, bytes, _options?.mtime);
|
|
275
487
|
await runExclusive(path, async () => {
|
|
276
488
|
const parts = path.split("/").filter(Boolean);
|
|
277
489
|
parts.pop();
|
|
@@ -330,7 +542,10 @@ async function wrapZenFSFileSystem(config) {
|
|
|
330
542
|
backend.createSnapshot = (root, filter) => isolatedFS.createSnapshot(root, filter);
|
|
331
543
|
}
|
|
332
544
|
if (typeof isolatedFS.writeFileWithMtime === "function") {
|
|
333
|
-
backend.writeFileWithMtime = (path, data, mtimeMs) =>
|
|
545
|
+
backend.writeFileWithMtime = (path, data, mtimeMs) => {
|
|
546
|
+
traceWrite(backendLabel, "writeFileWithMtime", path, data, mtimeMs);
|
|
547
|
+
return isolatedFS.writeFileWithMtime(path, data, mtimeMs);
|
|
548
|
+
};
|
|
334
549
|
}
|
|
335
550
|
if (typeof isolatedFS.shouldSync === "function") {
|
|
336
551
|
backend.shouldSync = (...args) => isolatedFS.shouldSync(...args);
|
|
@@ -359,13 +574,7 @@ registerBackend("IndexedDB", async (options) => {
|
|
|
359
574
|
const { IndexedDB } = await import("@zenfs/dom");
|
|
360
575
|
const storeName = options.storeName ?? "zen-fs-config";
|
|
361
576
|
const label = options.label ?? storeName;
|
|
362
|
-
|
|
363
|
-
if (repaired?.repaired) {
|
|
364
|
-
console.warn(
|
|
365
|
-
`[Backend:IndexedDB] ${storeName}: reset ${repaired.repaired} corrupted directory listing(s): ` + repaired.details.map((d) => `ino ${d.key}\u2192slot ${d.data} (${d.reason})`).join(", ")
|
|
366
|
-
);
|
|
367
|
-
}
|
|
368
|
-
return wrapZenFSFileSystem({ backend: IndexedDB, storeName, label });
|
|
577
|
+
return wrapZenFSFileSystem({ backend: withAllocId(IndexedDB), storeName, label });
|
|
369
578
|
}, {
|
|
370
579
|
type: "IndexedDB",
|
|
371
580
|
label: "IndexedDB",
|
|
@@ -680,6 +889,10 @@ function registerWebdavBackend(getModule = () => importOptionalBackend("zen-fs-w
|
|
|
680
889
|
registerWebdavBackend();
|
|
681
890
|
|
|
682
891
|
export {
|
|
892
|
+
INO_BLOCK,
|
|
893
|
+
openStoreDb,
|
|
894
|
+
attachAllocId,
|
|
895
|
+
withAllocId,
|
|
683
896
|
registerBackend,
|
|
684
897
|
unregisterBackend,
|
|
685
898
|
createBackend,
|
package/dist/index.d.mts
CHANGED
|
@@ -1339,7 +1339,7 @@ declare function mergeAccountFields(targetType: string, sourceOptions: Record<st
|
|
|
1339
1339
|
* never persist credentials — they only reference a config-sync backend.
|
|
1340
1340
|
*/
|
|
1341
1341
|
declare function stripAccountFields(type: string, options: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
1342
|
-
declare function wrapZenFSFileSystem(config: any): Promise<BackendInstance>;
|
|
1342
|
+
declare function wrapZenFSFileSystem(config: any, label?: string): Promise<BackendInstance>;
|
|
1343
1343
|
/** Loader that resolves to an optional backend package's module namespace. */
|
|
1344
1344
|
type BackendModuleLoader = () => Promise<any>;
|
|
1345
1345
|
declare const GITHUB_BACKEND_METADATA: BackendMetadata;
|
|
@@ -2823,6 +2823,44 @@ declare function getUiConnection(repo: AppRepo): UiConnection;
|
|
|
2823
2823
|
*/
|
|
2824
2824
|
declare function connectV2(appId: string, options?: ConnectV2Options): Promise<AppRepo>;
|
|
2825
2825
|
|
|
2826
|
+
/**
|
|
2827
|
+
* StoreFS inode 撞号(id collision)防护。
|
|
2828
|
+
*
|
|
2829
|
+
* 背景
|
|
2830
|
+
* ----
|
|
2831
|
+
* `@zenfs/core` 的 StoreFS 打开库时用 `_populate` 把目录树展开成内存索引;
|
|
2832
|
+
* `allocNew()` 在没有 `store.allocId` 的情况下用 `max(_paths.keys()) + 2` 推导
|
|
2833
|
+
* 下一个 inode 号。`_populate` 只要遇到一个解不开的目录表就整体中断,索引残缺
|
|
2834
|
+
* → 推导出的号落在已有节点上 → `commitNew` 覆盖别人的 data slot(目录表被文件
|
|
2835
|
+
* 字节顶掉),此后每次 readdir 都报 `Cannot convert <path> to a BigInt`,同步再
|
|
2836
|
+
* 把这个损坏推给远端。
|
|
2837
|
+
*
|
|
2838
|
+
* `allocNew` 的第一行就是 `if (this.store.allocId) { ... }`:官方把发号权留给
|
|
2839
|
+
* Store(SingleBuffer v2 就用持久化原子计数器实现)。IndexedDB 的 store
|
|
2840
|
+
* (`@zenfs/dom`)没有实现它,所以永远走推导分支 —— 这就是缺口。
|
|
2841
|
+
*
|
|
2842
|
+
* 做法
|
|
2843
|
+
* ----
|
|
2844
|
+
* 打开库时从持久化高水位里**预占一段连续号**,把区间放在内存,`allocId()` 同步
|
|
2845
|
+
* 从区间里取号:满足接口的同步签名,且完全不再依赖内存索引。预占写在独立的
|
|
2846
|
+
* meta 库里,用 readwrite 事务完成;IndexedDB 对同一 object store 的读写事务
|
|
2847
|
+
* 天然串行,多个标签页拿到的是互不相交的区间,不需要额外加锁。
|
|
2848
|
+
*/
|
|
2849
|
+
/** 每次打开预占的号段长度(含 ino 与 data 槽,实际可用约 1.6 万个新节点)。 */
|
|
2850
|
+
declare const INO_BLOCK = 32768;
|
|
2851
|
+
/** 打开(必要时创建)StoreFS 使用的库,与 `@zenfs/dom` 的 createDB 行为一致。 */
|
|
2852
|
+
declare function openStoreDb(name: string): Promise<any>;
|
|
2853
|
+
/**
|
|
2854
|
+
* 给任意 IndexedDB store 实例挂上 `allocId`:
|
|
2855
|
+
* 高水位 = max(持久化值, 磁盘上已有的最大 key),再原子推进一整段。
|
|
2856
|
+
*/
|
|
2857
|
+
declare function attachAllocId(store: any, storeName: string, db: any): Promise<void>;
|
|
2858
|
+
/**
|
|
2859
|
+
* 把 `@zenfs/dom` 的 IndexedDB 后端描述符包一层,create 时构造带 `allocId` 的
|
|
2860
|
+
* store。保持 name / options / isAvailable 不变,`resolveMountConfig` 照旧可用。
|
|
2861
|
+
*/
|
|
2862
|
+
declare function withAllocId(base: any): any;
|
|
2863
|
+
|
|
2826
2864
|
/**
|
|
2827
2865
|
* zen-fs-config — Sidecar Version File Management
|
|
2828
2866
|
*
|
|
@@ -3192,4 +3230,4 @@ interface EnsureDataGroupResult {
|
|
|
3192
3230
|
*/
|
|
3193
3231
|
declare function ensureDataGroup(source: DataGroupSource, appId: string, opts?: EnsureDataGroupOptions): Promise<EnsureDataGroupResult>;
|
|
3194
3232
|
|
|
3195
|
-
export { ALIASES_DIR, type AddBackendResult, type AppDataBackendDescriptor, type AppDataGroup, type AppDataGroupDescriptor, type AppRepo, BackendAlreadyExistsError, type BackendConflictInfo, type BackendConflictReason, type BackendConflictResolution, type BackendConflictResolutionResult, type BackendDescriptor, BackendEndpointConflictError, type BackendFactory, BackendIdentityError, type BackendInstance, type BackendMetadata, type BackendModuleLoader, type BackendParamDef, type BackendSyncState, type BackendsMeta, CONFIG_DIR, CONFLICTS_DIR, type CacheOptions, type ConfigBackendInput, ConfigNotReadyError, ConfigRepo, type ConfigRepoOptions, type ConfigSerializer, type ConfigSyncGroupDescriptor, type ConfigSyncGroupHandle, type ConflictArchive, type ConflictInfo, ConflictStore, ConnectFailedError, type ConnectOptions, type ConnectResult, ConnectV2Error, type ConnectV2Options, DATA_GROUP_DEFAULT_FEATURES, DATA_GROUP_PREFERENCE_PREFIX, type DataBackendInput, type DataGroup, DataGroupBackendError, type DataGroupCandidate, DataGroupCreateError, type DataGroupFlushResult, type DataGroupInfo, DataGroupNotFoundError, DataGroupOperationError, type DataGroupSource, type DataGroupSyncEvent, type DataGroupSyncProgress, type DataGroupSyncResult, type DerivedIdentityInput, type EnsureDataGroupOptions, type EnsureDataGroupResult, FolderStore, GITEE_BACKEND_METADATA, GITHUB_BACKEND_METADATA, GROUP_DESCRIPTOR_FILE, type GroupAliasDescriptor, type GroupDescriptor, type GroupIdentity, type GroupInstanceIdRootResult, type GroupProbeResult, type GroupProbeState, type IConfigRepo, type IdentityBindingResult, type IdentityCandidate, type IdentityCandidateSource, type IdentityConflictReason, type IdentityResolutionMode, type IdentityResolutionResult, InvalidBackendError, type KeepPurgeResult, LEGACY_CONFLICTS_DIR, LEGACY_TOMBSTONES_DIR, LOCAL_IDB_BACKEND_ID, LOCAL_STORAGE_UNAVAILABLE, type LocalStorageUnavailableDetails, LocalStorageUnavailableError, type LocalStoreDeletionResult, META_DIR, type MigrateLocalFS, type MigrateReplicaFS, type MtimePurgeResult, NeedsInitError, type PreferenceOptions, type PreferenceStorage, type PurgeKeepOptions, type PurgeLocalSyncConfigOptions, type PurgeLocalSyncConfigResult, type PurgeMtimeOptions, type PurgeableFS$1 as PurgeableFS, REMOTESTORAGE_BACKEND_METADATA, type RemoteIdentitySnapshot, type RemoteIdentityState, RemoteUnreachableError, type ReplicaSetupSummary, type ResolveDataGroupOptions, type SetGroupInstanceIdOptions, type SetGroupInstanceIdResult, type SyncGroupFeatures, type SyncGroupHandle, type SyncGroupKind, type SyncGroupSyncEvent, type SyncGroupType, TOMBSTONES_DIR, type TombstoneMeta, TombstoneStore, type UiConnection, VERSIONS_DIR, type VersionMeta, type VersionMigrationOptions, type VersionMigrationResult, VersionStore, WEBDAV_BACKEND_METADATA, backendSupportsAccessMode, bindRemoteGroupIdentity, bindRemoteGroupIdentityDetailed, collectDataGroupCandidates, configKeyToFilePath, connect, connectV2, connectionToAppRepo, createBackend, createConfigRepo, createSerializerChain, dataGroupLocalStoreName, deleteDataGroupLocalStore, deleteIndexedDbStore, deriveGroupInstanceId, encodeMetaPath, ensureDataGroup, getAccountFields, getBackendMetadata, getExtension, getPreferredDataGroupId, getUiConnection, groupAliasFilePath, groupHasPath, hasBackend, incrementVersion, isBrowserEnv, isKeepFile, isLocalBackendType, isLocalStorageUnavailableError, isMtimeSidecar, isValidGroupInstanceId, legacyVersionPathFor, listBackendMetadata, listBackends, listDataGroupCandidates, localPrimaryType, localSyncStoreNames, mergeAccountFields, migrateVersionSidecars, newGroupInstanceId, probeGroupTypeDetailed, purgeKeepFiles, purgeLocalSyncConfig, purgeMtimeSidecars, readGroupAlias, readGroupAliases, readGroupDescriptor, readVersion, registerBackend, registerFolderBackend, registerGiteeBackend, registerGithubBackend, registerRemoteStorageBackend, registerWebdavBackend, resolveDataGroup, resolveLocalPrimary, resolveRemoteIdentity, setPreferredDataGroupId, sha256, shortInstanceId, stripAccountFields, summarizeIdentity, unregisterBackend, verifyOrRepairVersion, versionPathFor, wrapZenFSFileSystem, writeGroupAlias, writeGroupDescriptor, writeVersion };
|
|
3233
|
+
export { ALIASES_DIR, type AddBackendResult, type AppDataBackendDescriptor, type AppDataGroup, type AppDataGroupDescriptor, type AppRepo, BackendAlreadyExistsError, type BackendConflictInfo, type BackendConflictReason, type BackendConflictResolution, type BackendConflictResolutionResult, type BackendDescriptor, BackendEndpointConflictError, type BackendFactory, BackendIdentityError, type BackendInstance, type BackendMetadata, type BackendModuleLoader, type BackendParamDef, type BackendSyncState, type BackendsMeta, CONFIG_DIR, CONFLICTS_DIR, type CacheOptions, type ConfigBackendInput, ConfigNotReadyError, ConfigRepo, type ConfigRepoOptions, type ConfigSerializer, type ConfigSyncGroupDescriptor, type ConfigSyncGroupHandle, type ConflictArchive, type ConflictInfo, ConflictStore, ConnectFailedError, type ConnectOptions, type ConnectResult, ConnectV2Error, type ConnectV2Options, DATA_GROUP_DEFAULT_FEATURES, DATA_GROUP_PREFERENCE_PREFIX, type DataBackendInput, type DataGroup, DataGroupBackendError, type DataGroupCandidate, DataGroupCreateError, type DataGroupFlushResult, type DataGroupInfo, DataGroupNotFoundError, DataGroupOperationError, type DataGroupSource, type DataGroupSyncEvent, type DataGroupSyncProgress, type DataGroupSyncResult, type DerivedIdentityInput, type EnsureDataGroupOptions, type EnsureDataGroupResult, FolderStore, GITEE_BACKEND_METADATA, GITHUB_BACKEND_METADATA, GROUP_DESCRIPTOR_FILE, type GroupAliasDescriptor, type GroupDescriptor, type GroupIdentity, type GroupInstanceIdRootResult, type GroupProbeResult, type GroupProbeState, type IConfigRepo, INO_BLOCK, type IdentityBindingResult, type IdentityCandidate, type IdentityCandidateSource, type IdentityConflictReason, type IdentityResolutionMode, type IdentityResolutionResult, InvalidBackendError, type KeepPurgeResult, LEGACY_CONFLICTS_DIR, LEGACY_TOMBSTONES_DIR, LOCAL_IDB_BACKEND_ID, LOCAL_STORAGE_UNAVAILABLE, type LocalStorageUnavailableDetails, LocalStorageUnavailableError, type LocalStoreDeletionResult, META_DIR, type MigrateLocalFS, type MigrateReplicaFS, type MtimePurgeResult, NeedsInitError, type PreferenceOptions, type PreferenceStorage, type PurgeKeepOptions, type PurgeLocalSyncConfigOptions, type PurgeLocalSyncConfigResult, type PurgeMtimeOptions, type PurgeableFS$1 as PurgeableFS, REMOTESTORAGE_BACKEND_METADATA, type RemoteIdentitySnapshot, type RemoteIdentityState, RemoteUnreachableError, type ReplicaSetupSummary, type ResolveDataGroupOptions, type SetGroupInstanceIdOptions, type SetGroupInstanceIdResult, type SyncGroupFeatures, type SyncGroupHandle, type SyncGroupKind, type SyncGroupSyncEvent, type SyncGroupType, TOMBSTONES_DIR, type TombstoneMeta, TombstoneStore, type UiConnection, VERSIONS_DIR, type VersionMeta, type VersionMigrationOptions, type VersionMigrationResult, VersionStore, WEBDAV_BACKEND_METADATA, attachAllocId, backendSupportsAccessMode, bindRemoteGroupIdentity, bindRemoteGroupIdentityDetailed, collectDataGroupCandidates, configKeyToFilePath, connect, connectV2, connectionToAppRepo, createBackend, createConfigRepo, createSerializerChain, dataGroupLocalStoreName, deleteDataGroupLocalStore, deleteIndexedDbStore, deriveGroupInstanceId, encodeMetaPath, ensureDataGroup, getAccountFields, getBackendMetadata, getExtension, getPreferredDataGroupId, getUiConnection, groupAliasFilePath, groupHasPath, hasBackend, incrementVersion, isBrowserEnv, isKeepFile, isLocalBackendType, isLocalStorageUnavailableError, isMtimeSidecar, isValidGroupInstanceId, legacyVersionPathFor, listBackendMetadata, listBackends, listDataGroupCandidates, localPrimaryType, localSyncStoreNames, mergeAccountFields, migrateVersionSidecars, newGroupInstanceId, openStoreDb, probeGroupTypeDetailed, purgeKeepFiles, purgeLocalSyncConfig, purgeMtimeSidecars, readGroupAlias, readGroupAliases, readGroupDescriptor, readVersion, registerBackend, registerFolderBackend, registerGiteeBackend, registerGithubBackend, registerRemoteStorageBackend, registerWebdavBackend, resolveDataGroup, resolveLocalPrimary, resolveRemoteIdentity, setPreferredDataGroupId, sha256, shortInstanceId, stripAccountFields, summarizeIdentity, unregisterBackend, verifyOrRepairVersion, versionPathFor, withAllocId, wrapZenFSFileSystem, writeGroupAlias, writeGroupDescriptor, writeVersion };
|
package/dist/index.d.ts
CHANGED
|
@@ -1339,7 +1339,7 @@ declare function mergeAccountFields(targetType: string, sourceOptions: Record<st
|
|
|
1339
1339
|
* never persist credentials — they only reference a config-sync backend.
|
|
1340
1340
|
*/
|
|
1341
1341
|
declare function stripAccountFields(type: string, options: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
1342
|
-
declare function wrapZenFSFileSystem(config: any): Promise<BackendInstance>;
|
|
1342
|
+
declare function wrapZenFSFileSystem(config: any, label?: string): Promise<BackendInstance>;
|
|
1343
1343
|
/** Loader that resolves to an optional backend package's module namespace. */
|
|
1344
1344
|
type BackendModuleLoader = () => Promise<any>;
|
|
1345
1345
|
declare const GITHUB_BACKEND_METADATA: BackendMetadata;
|
|
@@ -2823,6 +2823,44 @@ declare function getUiConnection(repo: AppRepo): UiConnection;
|
|
|
2823
2823
|
*/
|
|
2824
2824
|
declare function connectV2(appId: string, options?: ConnectV2Options): Promise<AppRepo>;
|
|
2825
2825
|
|
|
2826
|
+
/**
|
|
2827
|
+
* StoreFS inode 撞号(id collision)防护。
|
|
2828
|
+
*
|
|
2829
|
+
* 背景
|
|
2830
|
+
* ----
|
|
2831
|
+
* `@zenfs/core` 的 StoreFS 打开库时用 `_populate` 把目录树展开成内存索引;
|
|
2832
|
+
* `allocNew()` 在没有 `store.allocId` 的情况下用 `max(_paths.keys()) + 2` 推导
|
|
2833
|
+
* 下一个 inode 号。`_populate` 只要遇到一个解不开的目录表就整体中断,索引残缺
|
|
2834
|
+
* → 推导出的号落在已有节点上 → `commitNew` 覆盖别人的 data slot(目录表被文件
|
|
2835
|
+
* 字节顶掉),此后每次 readdir 都报 `Cannot convert <path> to a BigInt`,同步再
|
|
2836
|
+
* 把这个损坏推给远端。
|
|
2837
|
+
*
|
|
2838
|
+
* `allocNew` 的第一行就是 `if (this.store.allocId) { ... }`:官方把发号权留给
|
|
2839
|
+
* Store(SingleBuffer v2 就用持久化原子计数器实现)。IndexedDB 的 store
|
|
2840
|
+
* (`@zenfs/dom`)没有实现它,所以永远走推导分支 —— 这就是缺口。
|
|
2841
|
+
*
|
|
2842
|
+
* 做法
|
|
2843
|
+
* ----
|
|
2844
|
+
* 打开库时从持久化高水位里**预占一段连续号**,把区间放在内存,`allocId()` 同步
|
|
2845
|
+
* 从区间里取号:满足接口的同步签名,且完全不再依赖内存索引。预占写在独立的
|
|
2846
|
+
* meta 库里,用 readwrite 事务完成;IndexedDB 对同一 object store 的读写事务
|
|
2847
|
+
* 天然串行,多个标签页拿到的是互不相交的区间,不需要额外加锁。
|
|
2848
|
+
*/
|
|
2849
|
+
/** 每次打开预占的号段长度(含 ino 与 data 槽,实际可用约 1.6 万个新节点)。 */
|
|
2850
|
+
declare const INO_BLOCK = 32768;
|
|
2851
|
+
/** 打开(必要时创建)StoreFS 使用的库,与 `@zenfs/dom` 的 createDB 行为一致。 */
|
|
2852
|
+
declare function openStoreDb(name: string): Promise<any>;
|
|
2853
|
+
/**
|
|
2854
|
+
* 给任意 IndexedDB store 实例挂上 `allocId`:
|
|
2855
|
+
* 高水位 = max(持久化值, 磁盘上已有的最大 key),再原子推进一整段。
|
|
2856
|
+
*/
|
|
2857
|
+
declare function attachAllocId(store: any, storeName: string, db: any): Promise<void>;
|
|
2858
|
+
/**
|
|
2859
|
+
* 把 `@zenfs/dom` 的 IndexedDB 后端描述符包一层,create 时构造带 `allocId` 的
|
|
2860
|
+
* store。保持 name / options / isAvailable 不变,`resolveMountConfig` 照旧可用。
|
|
2861
|
+
*/
|
|
2862
|
+
declare function withAllocId(base: any): any;
|
|
2863
|
+
|
|
2826
2864
|
/**
|
|
2827
2865
|
* zen-fs-config — Sidecar Version File Management
|
|
2828
2866
|
*
|
|
@@ -3192,4 +3230,4 @@ interface EnsureDataGroupResult {
|
|
|
3192
3230
|
*/
|
|
3193
3231
|
declare function ensureDataGroup(source: DataGroupSource, appId: string, opts?: EnsureDataGroupOptions): Promise<EnsureDataGroupResult>;
|
|
3194
3232
|
|
|
3195
|
-
export { ALIASES_DIR, type AddBackendResult, type AppDataBackendDescriptor, type AppDataGroup, type AppDataGroupDescriptor, type AppRepo, BackendAlreadyExistsError, type BackendConflictInfo, type BackendConflictReason, type BackendConflictResolution, type BackendConflictResolutionResult, type BackendDescriptor, BackendEndpointConflictError, type BackendFactory, BackendIdentityError, type BackendInstance, type BackendMetadata, type BackendModuleLoader, type BackendParamDef, type BackendSyncState, type BackendsMeta, CONFIG_DIR, CONFLICTS_DIR, type CacheOptions, type ConfigBackendInput, ConfigNotReadyError, ConfigRepo, type ConfigRepoOptions, type ConfigSerializer, type ConfigSyncGroupDescriptor, type ConfigSyncGroupHandle, type ConflictArchive, type ConflictInfo, ConflictStore, ConnectFailedError, type ConnectOptions, type ConnectResult, ConnectV2Error, type ConnectV2Options, DATA_GROUP_DEFAULT_FEATURES, DATA_GROUP_PREFERENCE_PREFIX, type DataBackendInput, type DataGroup, DataGroupBackendError, type DataGroupCandidate, DataGroupCreateError, type DataGroupFlushResult, type DataGroupInfo, DataGroupNotFoundError, DataGroupOperationError, type DataGroupSource, type DataGroupSyncEvent, type DataGroupSyncProgress, type DataGroupSyncResult, type DerivedIdentityInput, type EnsureDataGroupOptions, type EnsureDataGroupResult, FolderStore, GITEE_BACKEND_METADATA, GITHUB_BACKEND_METADATA, GROUP_DESCRIPTOR_FILE, type GroupAliasDescriptor, type GroupDescriptor, type GroupIdentity, type GroupInstanceIdRootResult, type GroupProbeResult, type GroupProbeState, type IConfigRepo, type IdentityBindingResult, type IdentityCandidate, type IdentityCandidateSource, type IdentityConflictReason, type IdentityResolutionMode, type IdentityResolutionResult, InvalidBackendError, type KeepPurgeResult, LEGACY_CONFLICTS_DIR, LEGACY_TOMBSTONES_DIR, LOCAL_IDB_BACKEND_ID, LOCAL_STORAGE_UNAVAILABLE, type LocalStorageUnavailableDetails, LocalStorageUnavailableError, type LocalStoreDeletionResult, META_DIR, type MigrateLocalFS, type MigrateReplicaFS, type MtimePurgeResult, NeedsInitError, type PreferenceOptions, type PreferenceStorage, type PurgeKeepOptions, type PurgeLocalSyncConfigOptions, type PurgeLocalSyncConfigResult, type PurgeMtimeOptions, type PurgeableFS$1 as PurgeableFS, REMOTESTORAGE_BACKEND_METADATA, type RemoteIdentitySnapshot, type RemoteIdentityState, RemoteUnreachableError, type ReplicaSetupSummary, type ResolveDataGroupOptions, type SetGroupInstanceIdOptions, type SetGroupInstanceIdResult, type SyncGroupFeatures, type SyncGroupHandle, type SyncGroupKind, type SyncGroupSyncEvent, type SyncGroupType, TOMBSTONES_DIR, type TombstoneMeta, TombstoneStore, type UiConnection, VERSIONS_DIR, type VersionMeta, type VersionMigrationOptions, type VersionMigrationResult, VersionStore, WEBDAV_BACKEND_METADATA, backendSupportsAccessMode, bindRemoteGroupIdentity, bindRemoteGroupIdentityDetailed, collectDataGroupCandidates, configKeyToFilePath, connect, connectV2, connectionToAppRepo, createBackend, createConfigRepo, createSerializerChain, dataGroupLocalStoreName, deleteDataGroupLocalStore, deleteIndexedDbStore, deriveGroupInstanceId, encodeMetaPath, ensureDataGroup, getAccountFields, getBackendMetadata, getExtension, getPreferredDataGroupId, getUiConnection, groupAliasFilePath, groupHasPath, hasBackend, incrementVersion, isBrowserEnv, isKeepFile, isLocalBackendType, isLocalStorageUnavailableError, isMtimeSidecar, isValidGroupInstanceId, legacyVersionPathFor, listBackendMetadata, listBackends, listDataGroupCandidates, localPrimaryType, localSyncStoreNames, mergeAccountFields, migrateVersionSidecars, newGroupInstanceId, probeGroupTypeDetailed, purgeKeepFiles, purgeLocalSyncConfig, purgeMtimeSidecars, readGroupAlias, readGroupAliases, readGroupDescriptor, readVersion, registerBackend, registerFolderBackend, registerGiteeBackend, registerGithubBackend, registerRemoteStorageBackend, registerWebdavBackend, resolveDataGroup, resolveLocalPrimary, resolveRemoteIdentity, setPreferredDataGroupId, sha256, shortInstanceId, stripAccountFields, summarizeIdentity, unregisterBackend, verifyOrRepairVersion, versionPathFor, wrapZenFSFileSystem, writeGroupAlias, writeGroupDescriptor, writeVersion };
|
|
3233
|
+
export { ALIASES_DIR, type AddBackendResult, type AppDataBackendDescriptor, type AppDataGroup, type AppDataGroupDescriptor, type AppRepo, BackendAlreadyExistsError, type BackendConflictInfo, type BackendConflictReason, type BackendConflictResolution, type BackendConflictResolutionResult, type BackendDescriptor, BackendEndpointConflictError, type BackendFactory, BackendIdentityError, type BackendInstance, type BackendMetadata, type BackendModuleLoader, type BackendParamDef, type BackendSyncState, type BackendsMeta, CONFIG_DIR, CONFLICTS_DIR, type CacheOptions, type ConfigBackendInput, ConfigNotReadyError, ConfigRepo, type ConfigRepoOptions, type ConfigSerializer, type ConfigSyncGroupDescriptor, type ConfigSyncGroupHandle, type ConflictArchive, type ConflictInfo, ConflictStore, ConnectFailedError, type ConnectOptions, type ConnectResult, ConnectV2Error, type ConnectV2Options, DATA_GROUP_DEFAULT_FEATURES, DATA_GROUP_PREFERENCE_PREFIX, type DataBackendInput, type DataGroup, DataGroupBackendError, type DataGroupCandidate, DataGroupCreateError, type DataGroupFlushResult, type DataGroupInfo, DataGroupNotFoundError, DataGroupOperationError, type DataGroupSource, type DataGroupSyncEvent, type DataGroupSyncProgress, type DataGroupSyncResult, type DerivedIdentityInput, type EnsureDataGroupOptions, type EnsureDataGroupResult, FolderStore, GITEE_BACKEND_METADATA, GITHUB_BACKEND_METADATA, GROUP_DESCRIPTOR_FILE, type GroupAliasDescriptor, type GroupDescriptor, type GroupIdentity, type GroupInstanceIdRootResult, type GroupProbeResult, type GroupProbeState, type IConfigRepo, INO_BLOCK, type IdentityBindingResult, type IdentityCandidate, type IdentityCandidateSource, type IdentityConflictReason, type IdentityResolutionMode, type IdentityResolutionResult, InvalidBackendError, type KeepPurgeResult, LEGACY_CONFLICTS_DIR, LEGACY_TOMBSTONES_DIR, LOCAL_IDB_BACKEND_ID, LOCAL_STORAGE_UNAVAILABLE, type LocalStorageUnavailableDetails, LocalStorageUnavailableError, type LocalStoreDeletionResult, META_DIR, type MigrateLocalFS, type MigrateReplicaFS, type MtimePurgeResult, NeedsInitError, type PreferenceOptions, type PreferenceStorage, type PurgeKeepOptions, type PurgeLocalSyncConfigOptions, type PurgeLocalSyncConfigResult, type PurgeMtimeOptions, type PurgeableFS$1 as PurgeableFS, REMOTESTORAGE_BACKEND_METADATA, type RemoteIdentitySnapshot, type RemoteIdentityState, RemoteUnreachableError, type ReplicaSetupSummary, type ResolveDataGroupOptions, type SetGroupInstanceIdOptions, type SetGroupInstanceIdResult, type SyncGroupFeatures, type SyncGroupHandle, type SyncGroupKind, type SyncGroupSyncEvent, type SyncGroupType, TOMBSTONES_DIR, type TombstoneMeta, TombstoneStore, type UiConnection, VERSIONS_DIR, type VersionMeta, type VersionMigrationOptions, type VersionMigrationResult, VersionStore, WEBDAV_BACKEND_METADATA, attachAllocId, backendSupportsAccessMode, bindRemoteGroupIdentity, bindRemoteGroupIdentityDetailed, collectDataGroupCandidates, configKeyToFilePath, connect, connectV2, connectionToAppRepo, createBackend, createConfigRepo, createSerializerChain, dataGroupLocalStoreName, deleteDataGroupLocalStore, deleteIndexedDbStore, deriveGroupInstanceId, encodeMetaPath, ensureDataGroup, getAccountFields, getBackendMetadata, getExtension, getPreferredDataGroupId, getUiConnection, groupAliasFilePath, groupHasPath, hasBackend, incrementVersion, isBrowserEnv, isKeepFile, isLocalBackendType, isLocalStorageUnavailableError, isMtimeSidecar, isValidGroupInstanceId, legacyVersionPathFor, listBackendMetadata, listBackends, listDataGroupCandidates, localPrimaryType, localSyncStoreNames, mergeAccountFields, migrateVersionSidecars, newGroupInstanceId, openStoreDb, probeGroupTypeDetailed, purgeKeepFiles, purgeLocalSyncConfig, purgeMtimeSidecars, readGroupAlias, readGroupAliases, readGroupDescriptor, readVersion, registerBackend, registerFolderBackend, registerGiteeBackend, registerGithubBackend, registerRemoteStorageBackend, registerWebdavBackend, resolveDataGroup, resolveLocalPrimary, resolveRemoteIdentity, setPreferredDataGroupId, sha256, shortInstanceId, stripAccountFields, summarizeIdentity, unregisterBackend, verifyOrRepairVersion, versionPathFor, withAllocId, wrapZenFSFileSystem, writeGroupAlias, writeGroupDescriptor, writeVersion };
|