@helia/utils 2.4.2-92480ee8 → 2.4.2-9c2961df
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.min.js.map +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.js +8 -8
- package/dist/src/storage.js +1 -1
- package/dist/src/utils/datastore-version.js +1 -1
- package/dist/src/utils/get-codec.js +1 -1
- package/dist/src/utils/get-hasher.js +1 -1
- package/dist/src/utils/storage.js +1 -1
- package/package.json +2 -2
- package/src/index.ts +10 -10
- package/src/storage.ts +1 -1
- package/src/utils/datastore-version.ts +1 -1
- package/src/utils/get-codec.ts +1 -1
- package/src/utils/get-hasher.ts +1 -1
- package/src/utils/storage.ts +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* modules such as `helia`, `@helia/http`, etc.
|
|
6
6
|
*/
|
|
7
7
|
import { TypedEventEmitter } from '@libp2p/interface';
|
|
8
|
-
import { BlockStorage } from './storage.
|
|
9
|
-
import type { BlockStorageInit } from './storage.
|
|
8
|
+
import { BlockStorage } from './storage.ts';
|
|
9
|
+
import type { BlockStorageInit } from './storage.ts';
|
|
10
10
|
import type { Await, CodecLoader, GCOptions, HasherLoader, Helia as HeliaInterface, HeliaEvents, Routing } from '@helia/interface';
|
|
11
11
|
import type { BlockBroker } from '@helia/interface/blocks';
|
|
12
12
|
import type { Pins } from '@helia/interface/pins';
|
|
@@ -18,8 +18,8 @@ import type { Datastore } from 'interface-datastore';
|
|
|
18
18
|
import type { Libp2pOptions } from 'libp2p';
|
|
19
19
|
import type { BlockCodec } from 'multiformats';
|
|
20
20
|
import type { MultihashHasher } from 'multiformats/hashes/interface';
|
|
21
|
-
export { AbstractSession } from './abstract-session.
|
|
22
|
-
export type { AbstractCreateSessionOptions, BlockstoreSessionEvents, AbstractSessionComponents } from './abstract-session.
|
|
21
|
+
export { AbstractSession } from './abstract-session.ts';
|
|
22
|
+
export type { AbstractCreateSessionOptions, BlockstoreSessionEvents, AbstractSessionComponents } from './abstract-session.ts';
|
|
23
23
|
export type { BlockStorage, BlockStorageInit };
|
|
24
24
|
export { breadthFirstWalker, depthFirstWalker, naturalOrderWalker } from './graph-walker.ts';
|
|
25
25
|
export type { GraphWalkerComponents, GraphWalkerInit, GraphNode, GraphWalker } from './graph-walker.ts';
|
package/dist/src/index.js
CHANGED
|
@@ -8,14 +8,14 @@ import { contentRoutingSymbol, peerRoutingSymbol, start, stop, TypedEventEmitter
|
|
|
8
8
|
import { dns } from '@multiformats/dns';
|
|
9
9
|
import drain from 'it-drain';
|
|
10
10
|
import { CustomProgressEvent } from 'progress-events';
|
|
11
|
-
import { PinsImpl } from
|
|
12
|
-
import { Routing as RoutingClass } from
|
|
13
|
-
import { BlockStorage } from
|
|
14
|
-
import { assertDatastoreVersionIsCurrent } from
|
|
15
|
-
import { getCodec } from
|
|
16
|
-
import { getHasher } from
|
|
17
|
-
import { NetworkedStorage } from
|
|
18
|
-
export { AbstractSession } from
|
|
11
|
+
import { PinsImpl } from "./pins.js";
|
|
12
|
+
import { Routing as RoutingClass } from "./routing.js";
|
|
13
|
+
import { BlockStorage } from "./storage.js";
|
|
14
|
+
import { assertDatastoreVersionIsCurrent } from "./utils/datastore-version.js";
|
|
15
|
+
import { getCodec } from "./utils/get-codec.js";
|
|
16
|
+
import { getHasher } from "./utils/get-hasher.js";
|
|
17
|
+
import { NetworkedStorage } from "./utils/networked-storage.js";
|
|
18
|
+
export { AbstractSession } from "./abstract-session.js";
|
|
19
19
|
export { breadthFirstWalker, depthFirstWalker, naturalOrderWalker } from "./graph-walker.js";
|
|
20
20
|
export class Helia {
|
|
21
21
|
libp2p;
|
package/dist/src/storage.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { start, stop } from '@libp2p/interface';
|
|
2
2
|
import createMortice from 'mortice';
|
|
3
|
-
import { BlockPinnedError } from
|
|
3
|
+
import { BlockPinnedError } from "./errors.js";
|
|
4
4
|
/**
|
|
5
5
|
* BlockStorage is a hybrid blockstore that puts/gets blocks from a configured
|
|
6
6
|
* blockstore (that may be on disk, s3, or something else). If the blocks are
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Key } from 'interface-datastore';
|
|
2
2
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string';
|
|
3
3
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
|
|
4
|
-
import { InvalidDatastoreVersionError } from
|
|
4
|
+
import { InvalidDatastoreVersionError } from "../errors.js";
|
|
5
5
|
const DS_VERSION_KEY = new Key('/version');
|
|
6
6
|
const CURRENT_VERSION = 1;
|
|
7
7
|
export async function assertDatastoreVersionIsCurrent(datastore) {
|
|
@@ -5,7 +5,7 @@ import * as dagJson from '@ipld/dag-json';
|
|
|
5
5
|
import * as dagPb from '@ipld/dag-pb';
|
|
6
6
|
import * as json from 'multiformats/codecs/json';
|
|
7
7
|
import * as raw from 'multiformats/codecs/raw';
|
|
8
|
-
import { isPromise } from
|
|
8
|
+
import { isPromise } from "./is-promise.js";
|
|
9
9
|
export function getCodec(initialCodecs = [], loadCodec) {
|
|
10
10
|
const codecs = {
|
|
11
11
|
[dagPb.code]: dagPb,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UnknownHashAlgorithmError } from '@helia/interface';
|
|
2
2
|
import { identity } from 'multiformats/hashes/identity';
|
|
3
3
|
import { sha256, sha512 } from 'multiformats/hashes/sha2';
|
|
4
|
-
import { isPromise } from
|
|
4
|
+
import { isPromise } from "./is-promise.js";
|
|
5
5
|
export function getHasher(initialHashers = [], loadHasher) {
|
|
6
6
|
const hashers = {
|
|
7
7
|
[sha256.code]: sha256,
|
|
@@ -6,7 +6,7 @@ import forEach from 'it-foreach';
|
|
|
6
6
|
import { CustomProgressEvent } from 'progress-events';
|
|
7
7
|
import { equals as uint8ArrayEquals } from 'uint8arrays/equals';
|
|
8
8
|
import { BlockNotFoundWhileOfflineError, InvalidConfigurationError, LoadBlockFailedError } from "../errors.js";
|
|
9
|
-
import { isPromise } from
|
|
9
|
+
import { isPromise } from "./is-promise.js";
|
|
10
10
|
const DEFAULT_MAX_IDENTITY_HASH_DIGEST_LENGTH = 128;
|
|
11
11
|
export class Storage {
|
|
12
12
|
child;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helia/utils",
|
|
3
|
-
"version": "2.4.2-
|
|
3
|
+
"version": "2.4.2-9c2961df",
|
|
4
4
|
"description": "Shared code that implements the Helia API",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/ipfs/helia/tree/main/packages/utils#readme",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"test:electron-main": "aegir test -t electron-main"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@helia/interface": "6.1.1-
|
|
50
|
+
"@helia/interface": "6.1.1-9c2961df",
|
|
51
51
|
"@ipld/dag-cbor": "^9.2.5",
|
|
52
52
|
"@ipld/dag-json": "^10.2.5",
|
|
53
53
|
"@ipld/dag-pb": "^4.1.5",
|
package/src/index.ts
CHANGED
|
@@ -9,14 +9,14 @@ import { contentRoutingSymbol, peerRoutingSymbol, start, stop, TypedEventEmitter
|
|
|
9
9
|
import { dns } from '@multiformats/dns'
|
|
10
10
|
import drain from 'it-drain'
|
|
11
11
|
import { CustomProgressEvent } from 'progress-events'
|
|
12
|
-
import { PinsImpl } from './pins.
|
|
13
|
-
import { Routing as RoutingClass } from './routing.
|
|
14
|
-
import { BlockStorage } from './storage.
|
|
15
|
-
import { assertDatastoreVersionIsCurrent } from './utils/datastore-version.
|
|
16
|
-
import { getCodec } from './utils/get-codec.
|
|
17
|
-
import { getHasher } from './utils/get-hasher.
|
|
18
|
-
import { NetworkedStorage } from './utils/networked-storage.
|
|
19
|
-
import type { BlockStorageInit } from './storage.
|
|
12
|
+
import { PinsImpl } from './pins.ts'
|
|
13
|
+
import { Routing as RoutingClass } from './routing.ts'
|
|
14
|
+
import { BlockStorage } from './storage.ts'
|
|
15
|
+
import { assertDatastoreVersionIsCurrent } from './utils/datastore-version.ts'
|
|
16
|
+
import { getCodec } from './utils/get-codec.ts'
|
|
17
|
+
import { getHasher } from './utils/get-hasher.ts'
|
|
18
|
+
import { NetworkedStorage } from './utils/networked-storage.ts'
|
|
19
|
+
import type { BlockStorageInit } from './storage.ts'
|
|
20
20
|
import type { Await, CodecLoader, GCOptions, HasherLoader, Helia as HeliaInterface, HeliaEvents, Routing } from '@helia/interface'
|
|
21
21
|
import type { BlockBroker } from '@helia/interface/blocks'
|
|
22
22
|
import type { Pins } from '@helia/interface/pins'
|
|
@@ -30,8 +30,8 @@ import type { BlockCodec } from 'multiformats'
|
|
|
30
30
|
import type { CID } from 'multiformats/cid'
|
|
31
31
|
import type { MultihashHasher } from 'multiformats/hashes/interface'
|
|
32
32
|
|
|
33
|
-
export { AbstractSession } from './abstract-session.
|
|
34
|
-
export type { AbstractCreateSessionOptions, BlockstoreSessionEvents, AbstractSessionComponents } from './abstract-session.
|
|
33
|
+
export { AbstractSession } from './abstract-session.ts'
|
|
34
|
+
export type { AbstractCreateSessionOptions, BlockstoreSessionEvents, AbstractSessionComponents } from './abstract-session.ts'
|
|
35
35
|
|
|
36
36
|
export type { BlockStorage, BlockStorageInit }
|
|
37
37
|
|
package/src/storage.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { start, stop } from '@libp2p/interface'
|
|
2
2
|
import createMortice from 'mortice'
|
|
3
|
-
import { BlockPinnedError } from './errors.
|
|
3
|
+
import { BlockPinnedError } from './errors.ts'
|
|
4
4
|
import type { Blocks, Pair, DeleteManyBlocksProgressEvents, DeleteBlockProgressEvents, GetBlockProgressEvents, GetManyBlocksProgressEvents, PutManyBlocksProgressEvents, PutBlockProgressEvents, GetAllBlocksProgressEvents, GetOfflineOptions, SessionBlockstore } from '@helia/interface/blocks'
|
|
5
5
|
import type { Pins } from '@helia/interface/pins'
|
|
6
6
|
import type { AbortOptions, Startable } from '@libp2p/interface'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Key } from 'interface-datastore'
|
|
2
2
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
3
3
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
|
|
4
|
-
import { InvalidDatastoreVersionError } from '../errors.
|
|
4
|
+
import { InvalidDatastoreVersionError } from '../errors.ts'
|
|
5
5
|
import type { Datastore } from 'interface-datastore'
|
|
6
6
|
|
|
7
7
|
const DS_VERSION_KEY = new Key('/version')
|
package/src/utils/get-codec.ts
CHANGED
|
@@ -6,7 +6,7 @@ import * as dagJson from '@ipld/dag-json'
|
|
|
6
6
|
import * as dagPb from '@ipld/dag-pb'
|
|
7
7
|
import * as json from 'multiformats/codecs/json'
|
|
8
8
|
import * as raw from 'multiformats/codecs/raw'
|
|
9
|
-
import { isPromise } from './is-promise.
|
|
9
|
+
import { isPromise } from './is-promise.ts'
|
|
10
10
|
import type { Await } from '@helia/interface'
|
|
11
11
|
import type { BlockCodec } from 'multiformats/codecs/interface'
|
|
12
12
|
|
package/src/utils/get-hasher.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UnknownHashAlgorithmError } from '@helia/interface'
|
|
2
2
|
import { identity } from 'multiformats/hashes/identity'
|
|
3
3
|
import { sha256, sha512 } from 'multiformats/hashes/sha2'
|
|
4
|
-
import { isPromise } from './is-promise.
|
|
4
|
+
import { isPromise } from './is-promise.ts'
|
|
5
5
|
import type { Await } from '@helia/interface'
|
|
6
6
|
import type { MultihashHasher } from 'multiformats/hashes/interface'
|
|
7
7
|
|
package/src/utils/storage.ts
CHANGED
|
@@ -6,7 +6,7 @@ import forEach from 'it-foreach'
|
|
|
6
6
|
import { CustomProgressEvent } from 'progress-events'
|
|
7
7
|
import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
|
|
8
8
|
import { BlockNotFoundWhileOfflineError, InvalidConfigurationError, LoadBlockFailedError } from '../errors.ts'
|
|
9
|
-
import { isPromise } from './is-promise.
|
|
9
|
+
import { isPromise } from './is-promise.ts'
|
|
10
10
|
import type { HasherLoader } from '@helia/interface'
|
|
11
11
|
import type { BlockBroker, Pair, DeleteManyBlocksProgressEvents, DeleteBlockProgressEvents, GetBlockProgressEvents, GetManyBlocksProgressEvents, PutManyBlocksProgressEvents, PutBlockProgressEvents, GetAllBlocksProgressEvents, GetOfflineOptions, BlockRetrievalOptions } from '@helia/interface/blocks'
|
|
12
12
|
import type { AbortOptions, ComponentLogger, Logger, LoggerOptions } from '@libp2p/interface'
|