@hashtree/core 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -8
- package/dist/index.js.map +1 -1
- package/dist/store/index.d.ts +0 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +0 -2
- package/dist/store/index.js.map +1 -1
- package/package.json +2 -6
package/dist/index.d.ts
CHANGED
|
@@ -10,16 +10,13 @@ export { sha256 } from './hash.js';
|
|
|
10
10
|
export { encryptChk, decryptChk, contentHash, encryptedSizeChk, encrypt, decrypt, generateKey, keyToHex, keyFromHex, encryptedSize, plaintextSize, type EncryptionKey, } from './crypto.js';
|
|
11
11
|
export { encodeTreeNode, decodeTreeNode, tryDecodeTreeNode, encodeAndHash, getNodeType, } from './codec.js';
|
|
12
12
|
export { MemoryStore } from './store/memory.js';
|
|
13
|
-
export { OpfsStore, type OpfsStoreOptions } from './store/opfs.js';
|
|
14
13
|
export { BlossomStore, type BlossomStoreConfig, type BlossomServer, type BlossomSigner, type BlossomAuthEvent, type BlossomLogEntry, type BlossomLogger, type BlossomUploadCallback, } from './store/blossom.js';
|
|
15
|
-
export {
|
|
14
|
+
export { FallbackStore, type FallbackStoreConfig, type ReadableStore, type WritableStore, } from './store/fallback.js';
|
|
16
15
|
export { HashTree, StreamWriter, verifyTree, DEFAULT_CHUNK_SIZE, type HashTreeConfig, type TreeEntry, type DirEntry, } from './hashtree.js';
|
|
17
16
|
export type { StreamOptions } from './tree/read.js';
|
|
18
17
|
export { type Chunker, fixedChunker, videoChunker, } from './builder.js';
|
|
19
|
-
export { WebRTCStore, DEFAULT_RELAYS, Peer, PeerId, generateUuid, type SignalingMessage, type WebRTCStoreConfig, type PeerStatus, type WebRTCStoreEvent, type WebRTCStoreEventHandler, type EventSigner, type EventEncrypter, type EventDecrypter, type GiftWrapper, type GiftUnwrapper, type SignedEvent, type PeerPool, type PeerClassifier, type PoolConfig, type WebRTCStats, } from './webrtc/index.js';
|
|
20
18
|
export { BEP52_BLOCK_SIZE, ZERO_HASH, Bep52TreeBuilder, Bep52StreamBuilder, type Bep52Result, type Bep52Config, } from './bep52.js';
|
|
21
19
|
export * as bep52 from './bep52.js';
|
|
22
|
-
export { createNostrRefResolver, createNostrRefResolver as createNostrRootResolver, type NostrRefResolverConfig, type NostrRefResolverConfig as NostrRootResolverConfig, type NostrEvent, type NostrFilter, type Nip19Like, type VisibilityCallbacks, } from './resolver/index.js';
|
|
23
20
|
export { nhashEncode, nhashDecode, npathEncode, npathDecode, decode, isNHash, isNPath, NHashTypeGuard, BECH32_REGEX, type NHashData, type NPathData, type DecodeResult, } from './nhash.js';
|
|
24
21
|
export { generateLinkKey, computeKeyId, encryptKeyForLink, decryptKeyFromLink, hex as visibilityHex, type TreeVisibility, } from './visibility.js';
|
|
25
22
|
export type { WorkerRequest, WorkerResponse, WorkerConfig, NostrFilter as WorkerNostrFilter, UnsignedEvent as WorkerUnsignedEvent, SignedEvent as WorkerSignedEvent, PeerStats as WorkerPeerStats, RelayStats as WorkerRelayStats, DirEntry as WorkerDirEntry, SocialGraphEvent as WorkerSocialGraphEvent, BlossomUploadProgress as WorkerBlossomUploadProgress, BlossomServerStatus as WorkerBlossomServerStatus, BlossomServerConfig as WorkerBlossomServerConfig, MediaRequest, MediaResponse, WebRTCCommand, WebRTCEvent, } from './worker/protocol.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,IAAI,EACJ,GAAG,EACH,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,aAAa,EAEb,WAAW,IAAI,YAAY,GAC5B,MAA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B,QAAQ,IAAI,cAAc,EAC1B,gBAAgB,IAAI,sBAAsB,EAC1C,qBAAqB,IAAI,2BAA2B,EACpD,mBAAmB,IAAI,yBAAyB,EAChD,mBAAmB,IAAI,yBAAyB,EAChD,YAAY,EACZ,aAAa,EAEb,aAAa,EACb,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,25 +17,18 @@ encrypt, decrypt, generateKey, keyToHex, keyFromHex, encryptedSize, plaintextSiz
|
|
|
17
17
|
export { encodeTreeNode, decodeTreeNode, tryDecodeTreeNode, encodeAndHash, getNodeType, } from './codec.js';
|
|
18
18
|
// Storage adapters
|
|
19
19
|
export { MemoryStore } from './store/memory.js';
|
|
20
|
-
export { OpfsStore } from './store/opfs.js';
|
|
21
20
|
export { BlossomStore, } from './store/blossom.js';
|
|
22
|
-
export {
|
|
21
|
+
export { FallbackStore, } from './store/fallback.js';
|
|
23
22
|
// HashTree - unified tree operations (create, read, edit, stream)
|
|
24
23
|
export { HashTree, StreamWriter, verifyTree, DEFAULT_CHUNK_SIZE, } from './hashtree.js';
|
|
25
24
|
// Chunker utilities
|
|
26
25
|
export { fixedChunker, videoChunker, } from './builder.js';
|
|
27
|
-
// WebRTC P2P store
|
|
28
|
-
export { WebRTCStore, DEFAULT_RELAYS, Peer, PeerId, generateUuid, } from './webrtc/index.js';
|
|
29
26
|
// BEP52 (BitTorrent v2) compatible merkle tree
|
|
30
27
|
// Main API: Bep52TreeBuilder, Bep52StreamBuilder
|
|
31
28
|
// Low-level functions available via: import { bep52 } from '@hashtree/core'
|
|
32
29
|
export { BEP52_BLOCK_SIZE, ZERO_HASH, Bep52TreeBuilder, Bep52StreamBuilder, } from './bep52.js';
|
|
33
30
|
// Re-export low-level BEP52 merkle functions as namespace
|
|
34
31
|
export * as bep52 from './bep52.js';
|
|
35
|
-
// Ref resolvers
|
|
36
|
-
export { createNostrRefResolver,
|
|
37
|
-
// Legacy alias
|
|
38
|
-
createNostrRefResolver as createNostrRootResolver, } from './resolver/index.js';
|
|
39
32
|
// Bech32 identifiers (nhash, npath)
|
|
40
33
|
export { nhashEncode, nhashDecode, npathEncode, npathDecode, decode, isNHash, isNPath, NHashTypeGuard, BECH32_REGEX, } from './nhash.js';
|
|
41
34
|
// Tree visibility utilities (public/link-visible/private)
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH,OAAO,EACL,QAAQ,EACR,KAAK,EACL,OAAO,EACP,GAAG,GACJ,MAAM,YAAY,CAAC;AAEpB,iBAAiB;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,uBAAuB;AACvB,OAAO;AACL,2EAA2E;AAC3E,UAAU,EACV,UAAU,EACV,WAAW,EACX,gBAAgB;AAChB,yDAAyD;AACzD,OAAO,EACP,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,GAEd,MAAM,aAAa,CAAC;AAErB,oBAAoB;AACpB,OAAO,EACL,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,mBAAmB;AACnB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH,OAAO,EACL,QAAQ,EACR,KAAK,EACL,OAAO,EACP,GAAG,GACJ,MAAM,YAAY,CAAC;AAEpB,iBAAiB;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,uBAAuB;AACvB,OAAO;AACL,2EAA2E;AAC3E,UAAU,EACV,UAAU,EACV,WAAW,EACX,gBAAgB;AAChB,yDAAyD;AACzD,OAAO,EACP,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,GAEd,MAAM,aAAa,CAAC;AAErB,oBAAoB;AACpB,OAAO,EACL,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,mBAAmB;AACnB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,YAAY,GAQb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,GAId,MAAM,qBAAqB,CAAC;AAE7B,kEAAkE;AAClE,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,kBAAkB,GAInB,MAAM,eAAe,CAAC;AAKvB,oBAAoB;AACpB,OAAO,EAEL,YAAY,EACZ,YAAY,GACb,MAAM,cAAc,CAAC;AAGtB,+CAA+C;AAC/C,iDAAiD;AACjD,4EAA4E;AAC5E,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,kBAAkB,GAGnB,MAAM,YAAY,CAAC;AAEpB,0DAA0D;AAC1D,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAGpC,oCAAoC;AACpC,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,MAAM,EACN,OAAO,EACP,OAAO,EACP,cAAc,EACd,YAAY,GAIb,MAAM,YAAY,CAAC;AAEpB,0DAA0D;AAC1D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,GAAG,IAAI,aAAa,GAErB,MAAM,iBAAiB,CAAC;AAwBzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/store/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { MemoryStore } from './memory.js';
|
|
2
|
-
export { OpfsStore, type OpfsStoreOptions } from './opfs.js';
|
|
3
2
|
export { BlossomStore, type BlossomStoreConfig, type BlossomServer, type BlossomSigner, type BlossomAuthEvent } from './blossom.js';
|
|
4
|
-
export { DexieStore } from './dexie.js';
|
|
5
3
|
export { FallbackStore, type FallbackStoreConfig, type ReadableStore, type WritableStore } from './fallback.js';
|
|
6
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACpI,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/store/index.js
CHANGED
package/dist/store/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAA0F,MAAM,cAAc,CAAC;AACpI,OAAO,EAAE,aAAa,EAAoE,MAAM,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashtree/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Simple content-addressed merkle tree with KV storage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,12 +36,8 @@
|
|
|
36
36
|
"homepage": "https://files.iris.to/#/npub1xndmdgymsf4a34rzr7346vp8qcptxf75pjqweh8naa8rklgxpfqqmfjtce/hashtree",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@msgpack/msgpack": "^3.1.2",
|
|
39
|
-
"@nostr-dev-kit/ndk": "^3.0.0-beta.66",
|
|
40
39
|
"@noble/hashes": "^2.0.1",
|
|
41
|
-
"@scure/base": "^2.0.0"
|
|
42
|
-
"dexie": "^4.0.11",
|
|
43
|
-
"nostr-social-graph": "^1.0.33",
|
|
44
|
-
"nostr-tools": "^2.18.2"
|
|
40
|
+
"@scure/base": "^2.0.0"
|
|
45
41
|
},
|
|
46
42
|
"devDependencies": {
|
|
47
43
|
"@types/ws": "^8.18.1",
|