@dxos/plugin-wnfs 0.8.4-main.ead640a → 0.8.4-main.effb148878
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/LICENSE +102 -5
- package/README.md +2 -2
- package/dist/lib/neutral/WnfsPlugin.mjs +39 -0
- package/dist/lib/neutral/WnfsPlugin.mjs.map +7 -0
- package/dist/lib/neutral/WnfsPlugin.node.mjs +12 -0
- package/dist/lib/neutral/WnfsPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/WnfsPlugin.workerd.mjs +12 -0
- package/dist/lib/neutral/WnfsPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/backend-DHBQUTPC.mjs +47 -0
- package/dist/lib/neutral/backend-DHBQUTPC.mjs.map +7 -0
- package/dist/lib/neutral/blockstore-3NLSWC7Z.mjs +190 -0
- package/dist/lib/neutral/blockstore-3NLSWC7Z.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +13 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-D6VTEQIE.mjs → neutral/chunk-7KFJ6LYH.mjs} +43 -18
- package/dist/lib/neutral/chunk-7KFJ6LYH.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IY6VOJSQ.mjs +37 -0
- package/dist/lib/neutral/chunk-IY6VOJSQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-QODCKFTY.mjs +19 -0
- package/dist/lib/neutral/chunk-QODCKFTY.mjs.map +7 -0
- package/dist/lib/neutral/helpers/index.mjs +26 -0
- package/dist/lib/neutral/helpers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +34 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +17 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +8 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/url-resolver-UD3ZP77Y.mjs +47 -0
- package/dist/lib/neutral/url-resolver-UD3ZP77Y.mjs.map +7 -0
- package/dist/types/src/WnfsPlugin.d.ts +3 -1
- package/dist/types/src/WnfsPlugin.d.ts.map +1 -1
- package/dist/types/src/WnfsPlugin.node.d.ts +4 -0
- package/dist/types/src/WnfsPlugin.node.d.ts.map +1 -0
- package/dist/types/src/WnfsPlugin.test.d.ts +2 -0
- package/dist/types/src/WnfsPlugin.test.d.ts.map +1 -0
- package/dist/types/src/WnfsPlugin.workerd.d.ts +4 -0
- package/dist/types/src/WnfsPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/blockstore.d.ts.map +1 -1
- package/dist/types/src/capabilities/backend.d.ts +7 -0
- package/dist/types/src/capabilities/backend.d.ts.map +1 -0
- package/dist/types/src/capabilities/blockstore.d.ts +3 -2
- package/dist/types/src/capabilities/blockstore.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +5 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-resolver.d.ts +7 -0
- package/dist/types/src/capabilities/url-resolver.d.ts.map +1 -0
- package/dist/types/src/helpers/common.d.ts.map +1 -1
- package/dist/types/src/helpers/load.d.ts +1 -1
- package/dist/types/src/helpers/load.d.ts.map +1 -1
- package/dist/types/src/helpers/upload.d.ts +1 -1
- package/dist/types/src/helpers/upload.d.ts.map +1 -1
- package/dist/types/src/helpers/wnfs-url.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -12
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/WnfsCapabilities.d.ts +11 -0
- package/dist/types/src/types/WnfsCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +95 -48
- package/src/WnfsPlugin.node.ts +11 -0
- package/src/WnfsPlugin.test.ts +20 -0
- package/src/WnfsPlugin.tsx +27 -78
- package/src/WnfsPlugin.workerd.ts +11 -0
- package/src/blockstore.ts +1 -1
- package/src/capabilities/backend.ts +43 -0
- package/src/capabilities/blockstore.ts +14 -10
- package/src/capabilities/index.ts +12 -7
- package/src/capabilities/url-resolver.ts +44 -0
- package/src/helpers/load.ts +12 -7
- package/src/helpers/upload.ts +5 -2
- package/src/index.ts +2 -2
- package/src/meta.ts +24 -4
- package/src/plugin.ts +9 -0
- package/src/translations.ts +2 -11
- package/src/types/WnfsCapabilities.ts +18 -0
- package/src/types/index.ts +1 -2
- package/dist/lib/browser/FileContainer-A4OJVMVS.mjs +0 -103
- package/dist/lib/browser/FileContainer-A4OJVMVS.mjs.map +0 -7
- package/dist/lib/browser/blockstore-HK4IYHJJ.mjs +0 -273
- package/dist/lib/browser/blockstore-HK4IYHJJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-D6VTEQIE.mjs.map +0 -7
- package/dist/lib/browser/chunk-FYRZOKHG.mjs +0 -13
- package/dist/lib/browser/chunk-FYRZOKHG.mjs.map +0 -7
- package/dist/lib/browser/chunk-PAIK4SJ3.mjs +0 -16
- package/dist/lib/browser/chunk-PAIK4SJ3.mjs.map +0 -7
- package/dist/lib/browser/chunk-QQB5IBX7.mjs +0 -64
- package/dist/lib/browser/chunk-QQB5IBX7.mjs.map +0 -7
- package/dist/lib/browser/chunk-Y5JMTQ74.mjs +0 -16
- package/dist/lib/browser/chunk-Y5JMTQ74.mjs.map +0 -7
- package/dist/lib/browser/file-uploader-5S37ZZCW.mjs +0 -30
- package/dist/lib/browser/file-uploader-5S37ZZCW.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -117
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3KMIEDBO.mjs +0 -49
- package/dist/lib/browser/intent-resolver-3KMIEDBO.mjs.map +0 -7
- package/dist/lib/browser/markdown-5XD3I2NQ.mjs +0 -209
- package/dist/lib/browser/markdown-5XD3I2NQ.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-5D7M3Y4W.mjs +0 -88
- package/dist/lib/browser/react-surface-5D7M3Y4W.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/types/src/capabilities/capabilities.d.ts +0 -12
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/file-uploader.d.ts +0 -4
- package/dist/types/src/capabilities/file-uploader.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown.d.ts +0 -4
- package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/FileContainer.d.ts +0 -9
- package/dist/types/src/components/FileContainer.d.ts.map +0 -1
- package/dist/types/src/components/FileInput.d.ts +0 -8
- package/dist/types/src/components/FileInput.d.ts.map +0 -1
- package/dist/types/src/components/FilePreview.d.ts +0 -11
- package/dist/types/src/components/FilePreview.d.ts.map +0 -1
- package/dist/types/src/components/index.d.ts +0 -3
- package/dist/types/src/components/index.d.ts.map +0 -1
- package/dist/types/src/extensions/image.d.ts +0 -14
- package/dist/types/src/extensions/image.d.ts.map +0 -1
- package/dist/types/src/extensions/image.stories.d.ts +0 -11
- package/dist/types/src/extensions/image.stories.d.ts.map +0 -1
- package/dist/types/src/extensions/index.d.ts +0 -2
- package/dist/types/src/extensions/index.d.ts.map +0 -1
- package/dist/types/src/types/file.d.ts +0 -16
- package/dist/types/src/types/file.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -51
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/file-uploader.ts +0 -27
- package/src/capabilities/intent-resolver.ts +0 -33
- package/src/capabilities/markdown.ts +0 -26
- package/src/capabilities/react-surface.tsx +0 -45
- package/src/components/FileContainer.tsx +0 -49
- package/src/components/FileInput.tsx +0 -47
- package/src/components/FilePreview.tsx +0 -23
- package/src/components/index.ts +0 -9
- package/src/extensions/image.stories.tsx +0 -104
- package/src/extensions/image.tsx +0 -203
- package/src/extensions/index.ts +0 -5
- package/src/types/file.ts +0 -17
- package/src/types/types.ts +0 -41
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/common.ts", "../../../src/helpers/load.ts", "../../../src/helpers/upload.ts", "../../../src/helpers/wnfs-url.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats/cid';\nimport { sha256 } from 'multiformats/hashes/sha2';\nimport { type BlockStore as WnfsBlockStore } from 'wnfs';\n\nimport * as crypto from '@dxos/crypto';\nimport { type Space } from '@dxos/react-client/echo';\n\n//\n// PATH\n//\n\nexport const filePath = (fileName: string, space: Space) => {\n return ['spaces', space.id, 'files', fileName];\n};\n\n//\n// RNG\n//\n\nexport class Rng {\n randomBytes(count: number): Uint8Array {\n return new Uint8Array(crypto.randomBytes(count));\n }\n}\n\n//\n// STORE\n//\n\nexport const store = (blockstore: Blockstore): WnfsBlockStore => {\n const getBlock = async (cid: Uint8Array): Promise<Uint8Array | undefined> => {\n const decodedCid = CID.decode(cid);\n return await blockstore.get(decodedCid);\n };\n\n const hasBlock = async (cid: Uint8Array): Promise<boolean> => {\n const decodedCid = CID.decode(cid);\n return await blockstore.has(decodedCid);\n };\n\n const putBlockKeyed = async (cid: Uint8Array, bytes: Uint8Array): Promise<void> => {\n const decodedCid = CID.decode(cid);\n await blockstore.put(decodedCid, bytes);\n };\n\n // Don't hash blocks with the rs-wnfs default Blake 3, sha256 has better support.\n const putBlock = async (bytes: Uint8Array, codec: number): Promise<Uint8Array> => {\n const hash = await sha256.digest(bytes);\n const cid = CID.create(1, codec, hash);\n await blockstore.put(cid, bytes);\n return cid.bytes;\n };\n\n return { getBlock, hasBlock, putBlockKeyed, putBlock };\n};\n\nexport const storeName = () => 'dxos/wnfs';\n\n//\n// OTHER\n//\n\nexport const readFile = (file: File): Promise<Uint8Array> => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (event) => {\n const result = event.target?.result;\n if (result === null || result === undefined || typeof result === 'string') {\n reject(new Error('Expected an ArrayBuffer'));\n return;\n }\n resolve(new Uint8Array(result));\n };\n reader.onerror = (err) => {\n reject(err);\n };\n reader.readAsArrayBuffer(file);\n });\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats';\nimport * as Uint8Arrays from 'uint8arrays';\nimport { AccessKey, PrivateDirectory, PrivateForest, PrivateNode } from 'wnfs';\n\nimport { Obj } from '@dxos/echo';\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { type WnfsCapabilities } from '#types';\n\nimport { Rng, store } from './common';\n\n//\n// LOAD\n//\n\nexport const loadWnfs = async ({\n space,\n blockstore,\n instances,\n}: {\n space: Space;\n blockstore: Blockstore;\n instances?: WnfsCapabilities.Instances;\n}) => {\n // TODO(wittjosiah): Remove.\n // Delete old properties if they exist.\n if (space.properties.wnfs_access_key !== undefined && space.properties.wnfs_private_forest_cid !== undefined) {\n Obj.update(space.properties, (obj) => {\n delete obj['wnfs_access_key'];\n delete obj['wnfs_private_forest_cid'];\n });\n }\n\n const cacheKey = space.properties.wnfs?.privateForestCid;\n if (instances?.[cacheKey]) {\n return instances[cacheKey];\n }\n\n const exists = !!space.properties.wnfs;\n const instance = exists ? await loadWnfsDir(blockstore, space) : await createWnfsDir(blockstore, space);\n if (instances) {\n instances[cacheKey] = instance;\n }\n\n return instance;\n};\n\n//\n// PRIVATE\n//\n\nconst createWnfsDir = async (blockstore: Blockstore, space: Space) => {\n const wnfsStore = store(blockstore);\n const rng = new Rng();\n const forest = new PrivateForest(rng);\n\n const dirResult = await PrivateDirectory.newAndStore(forest.emptyName(), new Date(), forest, wnfsStore, rng);\n const dir = dirResult.rootDir as PrivateDirectory;\n\n const [accessKeyRaw, newForest]: [AccessKey, PrivateForest] = await dir\n .asNode()\n .store(dirResult.forest as PrivateForest, wnfsStore, rng);\n\n const cidBytes = await newForest.store(wnfsStore);\n\n Obj.update(space.properties, (obj) => {\n obj.wnfs = {\n accessKey: Uint8Arrays.toString(accessKeyRaw.toBytes(), 'base64'),\n privateForestCid: CID.decode(cidBytes).toString(),\n };\n });\n\n return {\n directory: dir,\n forest: newForest,\n };\n};\n\nconst loadWnfsDir = async (blockstore: Blockstore, space: Space) => {\n const wnfsStore = store(blockstore);\n\n const accessKey = AccessKey.fromBytes(Uint8Arrays.fromString(space.properties.wnfs.accessKey, 'base64'));\n const forest: PrivateForest = await PrivateForest.load(\n CID.parse(space.properties.wnfs.privateForestCid).bytes,\n wnfsStore,\n );\n const node: PrivateNode = await PrivateNode.load(accessKey, forest, wnfsStore);\n\n return {\n directory: node.asDir(),\n forest,\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats';\nimport * as Raw from 'multiformats/codecs/raw';\nimport { sha256 } from 'multiformats/hashes/sha2';\n\nimport type { Space } from '@dxos/client/echo';\nimport { Obj } from '@dxos/echo';\nimport { log } from '@dxos/log';\n\nimport { type WnfsCapabilities } from '#types';\n\nimport { Rng, filePath, store } from './common';\nimport { loadWnfs } from './load';\nimport { wnfsUrl } from './wnfs-url';\n\nexport const upload = async ({\n file,\n blockstore,\n instances,\n space,\n}: {\n file: File;\n blockstore: Blockstore;\n instances?: WnfsCapabilities.Instances;\n space: Space;\n}) => {\n const { directory, forest } = await loadWnfs({ blockstore, instances, space });\n const wnfsStore = store(blockstore);\n\n const bytes = new Uint8Array(await file.arrayBuffer());\n const hash = await sha256.digest(bytes);\n const cid = CID.create(1, Raw.code, hash);\n\n const path = filePath(cid.toString(), space);\n\n // Given the root directory of the private file system,\n // write the file contents to `path` in said directory.\n const result = await directory.write(path, true, bytes, new Date(), forest, wnfsStore, new Rng());\n\n // Given the new immutable instance of the root directory after writing to it,\n // **store** the changes in the \"dark forest\" and the associated (block) store.\n const [_, updatedForest] = await result.rootDir.store(result.forest, wnfsStore, new Rng());\n const cidBytes = await updatedForest.store(wnfsStore);\n\n // Update the forest pointer on the associated space.\n Obj.update(space.properties, (obj) => {\n obj.wnfs.privateForestCid = CID.decode(cidBytes).toString();\n });\n\n // Generate `wnfs://` URL & return the info.\n const info = {\n name: file.name,\n type: file.type,\n url: wnfsUrl(path),\n cid: cid.toString(),\n };\n\n log('upload', { file, info });\n return info;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { type PrivateDirectory, type PrivateForest } from 'wnfs';\n\nimport { store } from './common';\n\nexport const wnfsUrl = (filePath: string[]) => {\n return 'wnfs://' + filePath.map((f) => encodeURIComponent(f)).join('/');\n};\n\nexport const getPathFromUrl = (wnfsUrl: string) =>\n wnfsUrl\n .replace(/^wnfs:\\/\\//, '')\n .split('/')\n .map((p) => decodeURIComponent(p));\n\nexport const getBlobUrl = async ({\n wnfsUrl,\n blockstore,\n forest,\n directory,\n type,\n}: {\n wnfsUrl: string;\n blockstore: Blockstore;\n forest: PrivateForest;\n directory: PrivateDirectory;\n type?: string;\n}) => {\n const path = getPathFromUrl(wnfsUrl);\n const wnfsStore = store(blockstore);\n const { result } = await directory.read(path, true, forest, wnfsStore);\n const blob = new Blob([result], { type });\n return URL.createObjectURL(blob);\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["CID", "sha256", "crypto", "filePath", "fileName", "space", "id", "Rng", "randomBytes", "count", "Uint8Array", "store", "blockstore", "getBlock", "cid", "decodedCid", "decode", "get", "hasBlock", "has", "putBlockKeyed", "bytes", "put", "putBlock", "codec", "hash", "digest", "create", "storeName", "readFile", "file", "Promise", "resolve", "reject", "reader", "FileReader", "onload", "event", "result", "target", "undefined", "Error", "onerror", "err", "readAsArrayBuffer", "CID", "Uint8Arrays", "AccessKey", "PrivateDirectory", "PrivateForest", "PrivateNode", "Obj", "loadWnfs", "space", "blockstore", "instances", "properties", "wnfs_access_key", "undefined", "wnfs_private_forest_cid", "Obj", "update", "obj", "cacheKey", "wnfs", "privateForestCid", "exists", "instance", "loadWnfsDir", "createWnfsDir", "wnfsStore", "store", "rng", "Rng", "forest", "PrivateForest", "dirResult", "PrivateDirectory", "newAndStore", "emptyName", "Date", "dir", "rootDir", "accessKeyRaw", "newForest", "asNode", "cidBytes", "accessKey", "toString", "toBytes", "CID", "decode", "directory", "AccessKey", "fromBytes", "fromString", "load", "parse", "bytes", "node", "PrivateNode", "asDir", "CID", "Raw", "sha256", "Obj", "log", "wnfsUrl", "filePath", "map", "f", "encodeURIComponent", "join", "getPathFromUrl", "replace", "split", "p", "decodeURIComponent", "getBlobUrl", "blockstore", "forest", "directory", "type", "path", "wnfsStore", "store", "result", "read", "blob", "Blob", "URL", "createObjectURL", "upload", "blockstore", "instances", "space", "hash", "sha256", "bytes", "cid", "CID", "create", "Raw", "path", "filePath", "toString", "Obj", "update", "properties", "obj", "type", "file", "url", "wnfsUrl", "info"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/meta.ts
|
|
2
|
+
import { meta as fileMeta } from "@dxos/plugin-file";
|
|
3
|
+
import { trim } from "@dxos/util";
|
|
4
|
+
var meta = {
|
|
5
|
+
id: "org.dxos.plugin.wnfs",
|
|
6
|
+
name: "WNFS",
|
|
7
|
+
author: "DXOS",
|
|
8
|
+
description: trim`
|
|
9
|
+
Decentralized, end-to-end encrypted file storage for DXOS Composer built on the Web Native File System (WNFS) protocol.
|
|
10
|
+
|
|
11
|
+
WNFS organizes files inside a cryptographic "dark forest" — a content-addressed private file system
|
|
12
|
+
where each write produces a new immutable root CID. Files are stored as IPLD blocks (CIDv1, sha2-256),
|
|
13
|
+
cached locally in IndexedDB, and asynchronously replicated to the DXOS edge blob service as CAR archives.
|
|
14
|
+
Uploads and reads are scoped to a DXOS Space; the forest root CID is persisted atomically on the
|
|
15
|
+
space's ECHO properties so the file system state survives across sessions and devices.
|
|
16
|
+
|
|
17
|
+
The plugin registers as a \`FileCapabilities.Backend\` and \`FileCapabilities.UrlResolver\` so any plugin
|
|
18
|
+
that uses \`plugin-file\` (e.g. \`plugin-gallery\`) can upload files and resolve \`wnfs://\` URLs without
|
|
19
|
+
coupling to the storage implementation. The blockstore automatically queues blocks while offline and
|
|
20
|
+
flushes them when connectivity is restored.
|
|
21
|
+
`,
|
|
22
|
+
icon: "ph--file-cloud--regular",
|
|
23
|
+
iconHue: "teal",
|
|
24
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-wnfs",
|
|
25
|
+
spec: "PLUGIN.mdl",
|
|
26
|
+
tags: [
|
|
27
|
+
"labs"
|
|
28
|
+
],
|
|
29
|
+
dependsOn: [
|
|
30
|
+
fileMeta.id
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
meta
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=chunk-IY6VOJSQ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { meta as fileMeta } from '@dxos/plugin-file';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.wnfs',\n name: 'WNFS',\n author: 'DXOS',\n description: trim`\n Decentralized, end-to-end encrypted file storage for DXOS Composer built on the Web Native File System (WNFS) protocol.\n\n WNFS organizes files inside a cryptographic \"dark forest\" — a content-addressed private file system\n where each write produces a new immutable root CID. Files are stored as IPLD blocks (CIDv1, sha2-256),\n cached locally in IndexedDB, and asynchronously replicated to the DXOS edge blob service as CAR archives.\n Uploads and reads are scoped to a DXOS Space; the forest root CID is persisted atomically on the\n space's ECHO properties so the file system state survives across sessions and devices.\n\n The plugin registers as a \\`FileCapabilities.Backend\\` and \\`FileCapabilities.UrlResolver\\` so any plugin\n that uses \\`plugin-file\\` (e.g. \\`plugin-gallery\\`) can upload files and resolve \\`wnfs://\\` URLs without\n coupling to the storage implementation. The blockstore automatically queues blocks while offline and\n flushes them when connectivity is restored.\n `,\n icon: 'ph--file-cloud--regular',\n iconHue: 'teal',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-wnfs',\n spec: 'PLUGIN.mdl',\n tags: ['labs'],\n dependsOn: [fileMeta.id],\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,QAAQC,gBAAgB;AACjC,SAASC,YAAY;AAEd,IAAMF,OAAoB;EAC/BG,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC,aAAaJ;;;;;;;;;;;;;;EAcbK,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,MAAM;IAAC;;EACPC,WAAW;IAACX,SAASE;;AACvB;",
|
|
6
|
+
"names": ["meta", "fileMeta", "trim", "id", "name", "author", "description", "icon", "iconHue", "source", "spec", "tags", "dependsOn"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
+
|
|
5
|
+
// src/types/WnfsCapabilities.ts
|
|
6
|
+
var WnfsCapabilities_exports = {};
|
|
7
|
+
__export(WnfsCapabilities_exports, {
|
|
8
|
+
Blockstore: () => Blockstore,
|
|
9
|
+
Instances: () => Instances
|
|
10
|
+
});
|
|
11
|
+
import { Capability } from "@dxos/app-framework";
|
|
12
|
+
import { meta } from "#meta";
|
|
13
|
+
var Blockstore = Capability.make(`${meta.id}.capability.blockstore`);
|
|
14
|
+
var Instances = Capability.make(`${meta.id}.capability.instances`);
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
WnfsCapabilities_exports
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=chunk-QODCKFTY.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/WnfsCapabilities.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Blockstore as BlockstoreInterface } from 'interface-blockstore';\nimport { type PrivateDirectory, type PrivateForest } from 'wnfs';\n\nimport { Capability } from '@dxos/app-framework';\nimport { type SpaceId } from '@dxos/keys';\n\nimport { meta } from '#meta';\n\nexport const Blockstore = Capability.make<BlockstoreInterface>(`${meta.id}.capability.blockstore`);\n\nexport type Instances = Record<SpaceId, { directory: PrivateDirectory; forest: PrivateForest }>;\nexport const Instances = Capability.make<Instances>(`${meta.id}.capability.instances`);\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;;;;;AASA,SAASA,kBAAkB;AAG3B,SAASC,YAAY;AAEd,IAAMC,aAAaF,WAAWG,KAA0B,GAAGF,KAAKG,EAAE,wBAAwB;AAG1F,IAAMC,YAAYL,WAAWG,KAAgB,GAAGF,KAAKG,EAAE,uBAAuB;",
|
|
6
|
+
"names": ["Capability", "meta", "Blockstore", "make", "id", "Instances"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Rng,
|
|
3
|
+
filePath,
|
|
4
|
+
getBlobUrl,
|
|
5
|
+
getPathFromUrl,
|
|
6
|
+
loadWnfs,
|
|
7
|
+
readFile,
|
|
8
|
+
store,
|
|
9
|
+
storeName,
|
|
10
|
+
upload,
|
|
11
|
+
wnfsUrl
|
|
12
|
+
} from "../chunk-7KFJ6LYH.mjs";
|
|
13
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
14
|
+
export {
|
|
15
|
+
Rng,
|
|
16
|
+
filePath,
|
|
17
|
+
getBlobUrl,
|
|
18
|
+
getPathFromUrl,
|
|
19
|
+
loadWnfs,
|
|
20
|
+
readFile,
|
|
21
|
+
store,
|
|
22
|
+
storeName,
|
|
23
|
+
upload,
|
|
24
|
+
wnfsUrl
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WnfsCapabilities_exports
|
|
3
|
+
} from "./chunk-QODCKFTY.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Rng,
|
|
6
|
+
filePath,
|
|
7
|
+
getBlobUrl,
|
|
8
|
+
getPathFromUrl,
|
|
9
|
+
loadWnfs,
|
|
10
|
+
readFile,
|
|
11
|
+
store,
|
|
12
|
+
storeName,
|
|
13
|
+
upload,
|
|
14
|
+
wnfsUrl
|
|
15
|
+
} from "./chunk-7KFJ6LYH.mjs";
|
|
16
|
+
import {
|
|
17
|
+
meta
|
|
18
|
+
} from "./chunk-IY6VOJSQ.mjs";
|
|
19
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
20
|
+
export {
|
|
21
|
+
Rng,
|
|
22
|
+
WnfsCapabilities_exports as WnfsCapabilities,
|
|
23
|
+
filePath,
|
|
24
|
+
getBlobUrl,
|
|
25
|
+
getPathFromUrl,
|
|
26
|
+
loadWnfs,
|
|
27
|
+
meta,
|
|
28
|
+
readFile,
|
|
29
|
+
store,
|
|
30
|
+
storeName,
|
|
31
|
+
upload,
|
|
32
|
+
wnfsUrl
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/helpers/common.ts":{"bytes":7514,"imports":[{"path":"multiformats/cid","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true}],"format":"esm"},"src/helpers/load.ts":{"bytes":9287,"imports":[{"path":"multiformats","kind":"import-statement","external":true},{"path":"uint8arrays","kind":"import-statement","external":true},{"path":"wnfs","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/helpers/common.ts","kind":"import-statement","original":"./common"}],"format":"esm"},"src/helpers/wnfs-url.ts":{"bytes":3235,"imports":[{"path":"src/helpers/common.ts","kind":"import-statement","original":"./common"}],"format":"esm"},"src/helpers/upload.ts":{"bytes":6915,"imports":[{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/codecs/raw","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/helpers/common.ts","kind":"import-statement","original":"./common"},{"path":"src/helpers/load.ts","kind":"import-statement","original":"./load"},{"path":"src/helpers/wnfs-url.ts","kind":"import-statement","original":"./wnfs-url"}],"format":"esm"},"src/helpers/index.ts":{"bytes":620,"imports":[{"path":"src/helpers/common.ts","kind":"import-statement","original":"./common"},{"path":"src/helpers/load.ts","kind":"import-statement","original":"./load"},{"path":"src/helpers/upload.ts","kind":"import-statement","original":"./upload"},{"path":"src/helpers/wnfs-url.ts","kind":"import-statement","original":"./wnfs-url"}],"format":"esm"},"src/meta.ts":{"bytes":4304,"imports":[{"path":"@dxos/plugin-file","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/WnfsCapabilities.ts":{"bytes":1732,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":492,"imports":[{"path":"src/types/WnfsCapabilities.ts","kind":"import-statement","original":"./WnfsCapabilities"}],"format":"esm"},"src/index.ts":{"bytes":532,"imports":[{"path":"src/helpers/index.ts","kind":"import-statement","original":"./helpers"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/WnfsPlugin.tsx":{"bytes":4468,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/WnfsPlugin.node.ts":{"bytes":968,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/WnfsPlugin.workerd.ts":{"bytes":972,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/backend.ts":{"bytes":5528,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-file/types","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"src/helpers/index.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"src/blockstore.ts":{"bytes":19231,"imports":[{"path":"@ipld/car","kind":"import-statement","external":true},{"path":"blockstore-core","kind":"import-statement","external":true},{"path":"blockstore-idb","kind":"import-statement","external":true},{"path":"debounce","kind":"import-statement","external":true},{"path":"idb-keyval","kind":"import-statement","external":true},{"path":"it-all","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"uint8arrays","kind":"import-statement","external":true},{"path":"src/helpers/index.ts","kind":"import-statement","original":"./helpers"}],"format":"esm"},"src/capabilities/blockstore.ts":{"bytes":2806,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"src/blockstore.ts","kind":"import-statement","original":"../blockstore"}],"format":"esm"},"src/capabilities/url-resolver.ts":{"bytes":4741,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-file/types","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"src/helpers/index.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1788,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/backend.ts","kind":"dynamic-import","original":"./backend"},{"path":"src/capabilities/blockstore.ts","kind":"dynamic-import","original":"./blockstore"},{"path":"src/capabilities/url-resolver.ts","kind":"dynamic-import","original":"./url-resolver"}],"format":"esm"},"src/plugin.ts":{"bytes":849,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/translations.ts":{"bytes":1021,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":542},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":140}},"bytes":264},"dist/lib/neutral/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/types/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-QODCKFTY.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["WnfsCapabilities"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":194},"dist/lib/neutral/backend-DHBQUTPC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2734},"dist/lib/neutral/backend-DHBQUTPC.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-7KFJ6LYH.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-file/types","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["WNFS_BACKEND_ID","default"],"entryPoint":"src/capabilities/backend.ts","inputs":{"src/capabilities/backend.ts":{"bytesInOutput":1490}},"bytes":1708},"dist/lib/neutral/blockstore-3NLSWC7Z.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11033},"dist/lib/neutral/blockstore-3NLSWC7Z.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-7KFJ6LYH.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"@ipld/car","kind":"import-statement","external":true},{"path":"blockstore-core","kind":"import-statement","external":true},{"path":"blockstore-idb","kind":"import-statement","external":true},{"path":"debounce","kind":"import-statement","external":true},{"path":"idb-keyval","kind":"import-statement","external":true},{"path":"it-all","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"uint8arrays","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/blockstore.ts","inputs":{"src/capabilities/blockstore.ts":{"bytesInOutput":605},"src/blockstore.ts":{"bytesInOutput":4264}},"bytes":5137},"dist/lib/neutral/url-resolver-UD3ZP77Y.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2456},"dist/lib/neutral/url-resolver-UD3ZP77Y.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-7KFJ6LYH.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-file/types","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["WNFS_URL_RESOLVER_ID","default"],"entryPoint":"src/capabilities/url-resolver.ts","inputs":{"src/capabilities/url-resolver.ts":{"bytesInOutput":1099}},"bytes":1353},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-QODCKFTY.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-7KFJ6LYH.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-IY6VOJSQ.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["Rng","WnfsCapabilities","filePath","getBlobUrl","getPathFromUrl","loadWnfs","meta","readFile","store","storeName","upload","wnfsUrl"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":522},"dist/lib/neutral/chunk-QODCKFTY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":986},"dist/lib/neutral/chunk-QODCKFTY.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["WnfsCapabilities_exports"],"inputs":{"src/types/WnfsCapabilities.ts":{"bytesInOutput":355},"src/types/index.ts":{"bytesInOutput":0}},"bytes":524},"dist/lib/neutral/WnfsPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2345},"dist/lib/neutral/WnfsPlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["WnfsPlugin","default"],"entryPoint":"src/WnfsPlugin.tsx","inputs":{"src/WnfsPlugin.tsx":{"bytesInOutput":1073}},"bytes":1225},"dist/lib/neutral/WnfsPlugin.node.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":512},"dist/lib/neutral/WnfsPlugin.node.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["WnfsPlugin","default"],"entryPoint":"src/WnfsPlugin.node.ts","inputs":{"src/WnfsPlugin.node.ts":{"bytesInOutput":174}},"bytes":340},"dist/lib/neutral/WnfsPlugin.workerd.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":515},"dist/lib/neutral/WnfsPlugin.workerd.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["WnfsPlugin","default"],"entryPoint":"src/WnfsPlugin.workerd.ts","inputs":{"src/WnfsPlugin.workerd.ts":{"bytesInOutput":177}},"bytes":352},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1036},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/backend-DHBQUTPC.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/blockstore-3NLSWC7Z.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/url-resolver-UD3ZP77Y.mjs","kind":"dynamic-import"}],"exports":["Backend","Blockstore","UrlResolver"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":321}},"bytes":469},"dist/lib/neutral/helpers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/helpers/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-7KFJ6LYH.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["Rng","filePath","getBlobUrl","getPathFromUrl","loadWnfs","readFile","store","storeName","upload","wnfsUrl"],"entryPoint":"src/helpers/index.ts","inputs":{},"bytes":354},"dist/lib/neutral/chunk-7KFJ6LYH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14094},"dist/lib/neutral/chunk-7KFJ6LYH.mjs":{"imports":[{"path":"multiformats/cid","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"uint8arrays","kind":"import-statement","external":true},{"path":"wnfs","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/codecs/raw","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Rng","filePath","getBlobUrl","getPathFromUrl","loadWnfs","readFile","store","storeName","upload","wnfsUrl"],"inputs":{"src/helpers/common.ts":{"bytesInOutput":1568},"src/helpers/index.ts":{"bytesInOutput":0},"src/helpers/load.ts":{"bytesInOutput":2031},"src/helpers/upload.ts":{"bytesInOutput":1332},"src/helpers/wnfs-url.ts":{"bytesInOutput":567}},"bytes":5801},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-IY6VOJSQ.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":131},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":436},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-IY6VOJSQ.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["WnfsPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":107}},"bytes":264},"dist/lib/neutral/chunk-IY6VOJSQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2014},"dist/lib/neutral/chunk-IY6VOJSQ.mjs":{"imports":[{"path":"@dxos/plugin-file","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":1427}},"bytes":1506},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-IY6VOJSQ.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/plugin.ts
|
|
7
|
+
import { Plugin } from "@dxos/app-framework";
|
|
8
|
+
var WnfsPlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
9
|
+
export {
|
|
10
|
+
WnfsPlugin
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugin.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const WnfsPlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,cAAc;AAIhB,IAAMC,aAAaC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
|
|
6
|
+
"names": ["Plugin", "WnfsPlugin", "Plugin", "lazy", "meta"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/translations.ts
|
|
4
|
+
import { meta } from "#meta";
|
|
5
|
+
var translations = [
|
|
6
|
+
{
|
|
7
|
+
"en-US": {
|
|
8
|
+
[meta.id]: {
|
|
9
|
+
"plugin.name": "WNFS"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
];
|
|
14
|
+
export {
|
|
15
|
+
translations
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=translations.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin.name': 'WNFS',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";;;AAMA,SAASA,YAAY;AAEd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACD,KAAKE,EAAE,GAAG;QACT,eAAe;MACjB;IACF;EACF;;",
|
|
6
|
+
"names": ["meta", "translations", "id"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getBlobUrl,
|
|
3
|
+
loadWnfs
|
|
4
|
+
} from "./chunk-7KFJ6LYH.mjs";
|
|
5
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
6
|
+
|
|
7
|
+
// src/capabilities/url-resolver.ts
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import { Capability } from "@dxos/app-framework";
|
|
10
|
+
import { FileCapabilities } from "@dxos/plugin-file/types";
|
|
11
|
+
import { WnfsCapabilities } from "#types";
|
|
12
|
+
var WNFS_URL_RESOLVER_ID = "wnfs";
|
|
13
|
+
var url_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
14
|
+
const capabilities = yield* Capability.Service;
|
|
15
|
+
return Capability.contributes(FileCapabilities.UrlResolver, {
|
|
16
|
+
id: WNFS_URL_RESOLVER_ID,
|
|
17
|
+
test: (url) => url.startsWith("wnfs://"),
|
|
18
|
+
resolve: async (wnfsUrl, file, space) => {
|
|
19
|
+
if (!space) {
|
|
20
|
+
return void 0;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
const blockstore = capabilities.get(WnfsCapabilities.Blockstore);
|
|
24
|
+
const instances = capabilities.get(WnfsCapabilities.Instances);
|
|
25
|
+
const { directory, forest } = await loadWnfs({
|
|
26
|
+
blockstore,
|
|
27
|
+
instances,
|
|
28
|
+
space
|
|
29
|
+
});
|
|
30
|
+
return await getBlobUrl({
|
|
31
|
+
wnfsUrl,
|
|
32
|
+
blockstore,
|
|
33
|
+
directory,
|
|
34
|
+
forest,
|
|
35
|
+
type: file.type
|
|
36
|
+
});
|
|
37
|
+
} catch {
|
|
38
|
+
return void 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}));
|
|
43
|
+
export {
|
|
44
|
+
WNFS_URL_RESOLVER_ID,
|
|
45
|
+
url_resolver_default as default
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=url-resolver-UD3ZP77Y.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/url-resolver.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { FileCapabilities } from '@dxos/plugin-file/types';\n\nimport { WnfsCapabilities } from '#types';\n\nimport { getBlobUrl, loadWnfs } from '../helpers';\n\nexport const WNFS_URL_RESOLVER_ID = 'wnfs';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const capabilities = yield* Capability.Service;\n\n return Capability.contributes(FileCapabilities.UrlResolver, {\n id: WNFS_URL_RESOLVER_ID,\n test: (url) => url.startsWith('wnfs://'),\n resolve: async (wnfsUrl, file, space) => {\n if (!space) {\n return undefined;\n }\n try {\n const blockstore = capabilities.get(WnfsCapabilities.Blockstore);\n const instances = capabilities.get(WnfsCapabilities.Instances);\n const { directory, forest } = await loadWnfs({ blockstore, instances, space });\n return await getBlobUrl({\n wnfsUrl,\n blockstore,\n directory,\n forest,\n type: file.type,\n });\n } catch {\n return undefined;\n }\n },\n });\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,wBAAwB;AAEjC,SAASC,wBAAwB;AAI1B,IAAMC,uBAAuB;AAEpC,IAAA,uBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,eAAe,OAAOH,WAAWI;AAEvC,SAAOJ,WAAWK,YAAYC,iBAAiBC,aAAa;IAC1DC,IAAIT;IACJU,MAAM,CAACC,QAAQA,IAAIC,WAAW,SAAA;IAC9BC,SAAS,OAAOC,SAASC,MAAMC,UAAAA;AAC7B,UAAI,CAACA,OAAO;AACV,eAAOC;MACT;AACA,UAAI;AACF,cAAMC,aAAad,aAAae,IAAIC,iBAAiBC,UAAU;AAC/D,cAAMC,YAAYlB,aAAae,IAAIC,iBAAiBG,SAAS;AAC7D,cAAM,EAAEC,WAAWC,OAAM,IAAK,MAAMC,SAAS;UAAER;UAAYI;UAAWN;QAAM,CAAA;AAC5E,eAAO,MAAMW,WAAW;UACtBb;UACAI;UACAM;UACAC;UACAG,MAAMb,KAAKa;QACb,CAAA;MACF,QAAQ;AACN,eAAOX;MACT;IACF;EACF,CAAA;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capability", "FileCapabilities", "WnfsCapabilities", "WNFS_URL_RESOLVER_ID", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "contributes", "FileCapabilities", "UrlResolver", "id", "test", "url", "startsWith", "resolve", "wnfsUrl", "file", "space", "undefined", "blockstore", "get", "WnfsCapabilities", "Blockstore", "instances", "Instances", "directory", "forest", "loadWnfs", "getBlobUrl", "type"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WnfsPlugin.d.ts","sourceRoot":"","sources":["../../../src/WnfsPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WnfsPlugin.d.ts","sourceRoot":"","sources":["../../../src/WnfsPlugin.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AASzD,eAAO,MAAM,UAAU,4BA2BtB,CAAC;eAEa,UAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WnfsPlugin.node.d.ts","sourceRoot":"","sources":["../../../src/WnfsPlugin.node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,eAAO,MAAM,UAAU,4BAAwC,CAAC;eAEjD,UAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WnfsPlugin.test.d.ts","sourceRoot":"","sources":["../../../src/WnfsPlugin.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WnfsPlugin.workerd.d.ts","sourceRoot":"","sources":["../../../src/WnfsPlugin.workerd.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,eAAO,MAAM,UAAU,4BAAwC,CAAC;eAEjD,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockstore.d.ts","sourceRoot":"","sources":["../../../src/blockstore.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKjD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAKnC,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"blockstore.d.ts","sourceRoot":"","sources":["../../../src/blockstore.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKjD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAKnC,eAAO,MAAM,MAAM,aAAc,MAAM,oBAEtC,CAAC;AAEF;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,cAAc;;IAQjD,YAAY,OAAO,CAAC,EAAE,MAAM,EAS3B;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAY1B;IAED,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAGtC;IAIc,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ7C;IAEc,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAmBhD;IAEc,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,CAY7C;IAEc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAO1D;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7B;IAIK,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxD;IAEK,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAUjD;IAID,QAAQ,CAAC,cAAc,SAAgC;CAsExD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
import { FileCapabilities } from '@dxos/plugin-file/types';
|
|
4
|
+
export declare const WNFS_BACKEND_ID = "wnfs";
|
|
5
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<FileCapabilities.Backend>>, never, Capability.Service>;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=backend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/backend.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAO3D,eAAO,MAAM,eAAe,SAAS,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<import("interface-blockstore").Blockstore<{}, {}, {}, {}, {}, {}, {}, {}>>>, Error, Capability.Service>;
|
|
3
4
|
export default _default;
|
|
4
5
|
//# sourceMappingURL=blockstore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockstore.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/blockstore.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"blockstore.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/blockstore.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export * from './capabilities';
|
|
1
|
+
import { Capability } from '@dxos/app-framework';
|
|
2
|
+
import { type FileCapabilities } from '@dxos/plugin-file/types';
|
|
3
|
+
export declare const Backend: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<FileCapabilities.Backend>>>;
|
|
4
|
+
export declare const Blockstore: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("interface-blockstore").Blockstore<{}, {}, {}, {}, {}, {}, {}, {}>>>, Error>;
|
|
5
|
+
export declare const UrlResolver: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<FileCapabilities.UrlResolver>>>;
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAO,MAAM,OAAO,EAAE,UAAU,CAAC,cAAc,CAC7C,IAAI,EACJ,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CACjB,CAAC;AAE1D,eAAO,MAAM,UAAU,mKAA8D,CAAC;AAEtF,eAAO,MAAM,WAAW,EAAE,UAAU,CAAC,cAAc,CACjD,IAAI,EACJ,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CACZ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
import { FileCapabilities } from '@dxos/plugin-file/types';
|
|
4
|
+
export declare const WNFS_URL_RESOLVER_ID = "wnfs";
|
|
5
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<FileCapabilities.UrlResolver>>, never, Capability.Service>;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=url-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/url-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAM3D,eAAO,MAAM,oBAAoB,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/helpers/common.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,KAAK,UAAU,IAAI,cAAc,EAAE,MAAM,MAAM,CAAC;AAGzD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAMrD,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/helpers/common.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,KAAK,UAAU,IAAI,cAAc,EAAE,MAAM,MAAM,CAAC;AAGzD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAMrD,eAAO,MAAM,QAAQ,aAAc,MAAM,SAAS,KAAK,aAEtD,CAAC;AAMF,qBAAa,GAAG;IACd,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAErC;CACF;AAMD,eAAO,MAAM,KAAK,eAAgB,UAAU,KAAG,cAyB9C,CAAC;AAEF,eAAO,MAAM,SAAS,cAAoB,CAAC;AAM3C,eAAO,MAAM,QAAQ,SAAU,IAAI,KAAG,OAAO,CAAC,UAAU,CAgBvD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Blockstore } from 'interface-blockstore';
|
|
2
2
|
import { PrivateDirectory, PrivateForest } from 'wnfs';
|
|
3
3
|
import { type Space } from '@dxos/react-client/echo';
|
|
4
|
-
import { type WnfsCapabilities } from '
|
|
4
|
+
import { type WnfsCapabilities } from '#types';
|
|
5
5
|
export declare const loadWnfs: ({ space, blockstore, instances, }: {
|
|
6
6
|
space: Space;
|
|
7
7
|
blockstore: Blockstore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../src/helpers/load.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAa,gBAAgB,EAAE,aAAa,EAAe,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../src/helpers/load.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAa,gBAAgB,EAAE,aAAa,EAAe,MAAM,MAAM,CAAC;AAG/E,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAQ/C,eAAO,MAAM,QAAQ,sCAIlB;IACD,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC;CACxC;;;EAsBA,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Blockstore } from 'interface-blockstore';
|
|
2
2
|
import type { Space } from '@dxos/client/echo';
|
|
3
|
-
import { type WnfsCapabilities } from '
|
|
3
|
+
import { type WnfsCapabilities } from '#types';
|
|
4
4
|
export declare const upload: ({ file, blockstore, instances, space, }: {
|
|
5
5
|
file: File;
|
|
6
6
|
blockstore: Blockstore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/helpers/upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/helpers/upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAM/C,eAAO,MAAM,MAAM,4CAKhB;IACD,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC;IACvC,KAAK,EAAE,KAAK,CAAC;CACd;;;;;EAkCA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wnfs-url.d.ts","sourceRoot":"","sources":["../../../../src/helpers/wnfs-url.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,MAAM,CAAC;AAIjE,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"wnfs-url.d.ts","sourceRoot":"","sources":["../../../../src/helpers/wnfs-url.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,MAAM,CAAC;AAIjE,eAAO,MAAM,OAAO,aAAc,MAAM,EAAE,WAEzC,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,MAAM,aAIR,CAAC;AAEvC,eAAO,MAAM,UAAU,sDAMpB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,oBAMA,CAAC"}
|