From 20746873de9f96c3e553eacf171d6a2e4d7283da Mon Sep 17 00:00:00 2001 From: achou11 Date: Mon, 21 Oct 2024 14:26:02 +0000 Subject: [PATCH] Release v2.0.1 --- docs/api/md/-internal-/README.md | 4 +- docs/api/md/-internal-/classes/BlobStore.md | 18 +++---- .../-internal-/classes/DriveLiveDownload.md | 51 ------------------ .../api/md/-internal-/classes/LiveDownload.md | 53 ------------------- .../interfaces/BlobDownloadEvents.md | 23 ++++++++ .../md/-internal-/type-aliases/Readable.md | 11 ++++ package-lock.json | 4 +- package.json | 2 +- 8 files changed, 47 insertions(+), 119 deletions(-) delete mode 100644 docs/api/md/-internal-/classes/DriveLiveDownload.md delete mode 100644 docs/api/md/-internal-/classes/LiveDownload.md create mode 100644 docs/api/md/-internal-/interfaces/BlobDownloadEvents.md create mode 100644 docs/api/md/-internal-/type-aliases/Readable.md diff --git a/docs/api/md/-internal-/README.md b/docs/api/md/-internal-/README.md index 393cb87ce..78149f5ad 100644 --- a/docs/api/md/-internal-/README.md +++ b/docs/api/md/-internal-/README.md @@ -38,14 +38,12 @@ - [default](classes/default.md) - [default](classes/default.md) - [DenseIndex](classes/DenseIndex.md) -- [DriveLiveDownload](classes/DriveLiveDownload.md) - [Hyperblobs](classes/Hyperblobs.md) - [Hyperdrive](classes/Hyperdrive.md) - [IconApi](classes/IconApi.md) - [Index](classes/Index.md) - [IndexWriter](classes/IndexWriter.md) - [InviteApi](classes/InviteApi.md) -- [LiveDownload](classes/LiveDownload.md) - [LocalDiscovery](classes/LocalDiscovery.md) - [LocalPeers](classes/LocalPeers.md) - [Logger](classes/Logger.md) @@ -65,6 +63,7 @@ ### Interfaces - [BitmapOpts](interfaces/BitmapOpts.md) +- [BlobDownloadEvents](interfaces/BlobDownloadEvents.md) - [BlobDownloadState](interfaces/BlobDownloadState.md) - [Channel](interfaces/Channel.md) - [CorestoreEvents](interfaces/CorestoreEvents.md) @@ -137,6 +136,7 @@ - [PublicPeerInfo](type-aliases/PublicPeerInfo.md) - [Range](type-aliases/Range.md) - [RawStream](type-aliases/RawStream.md) +- [Readable](type-aliases/Readable.md) - [ReplicationStream](type-aliases/ReplicationStream.md) - [RoleId](type-aliases/RoleId.md) - [SchemaName](type-aliases/SchemaName.md) diff --git a/docs/api/md/-internal-/classes/BlobStore.md b/docs/api/md/-internal-/classes/BlobStore.md index 0b3e92579..38b8b3681 100644 --- a/docs/api/md/-internal-/classes/BlobStore.md +++ b/docs/api/md/-internal-/classes/BlobStore.md @@ -56,7 +56,7 @@ Enable to return an object with a `block` property with number of bytes removed ### createEntryReadStream() -> **createEntryReadStream**(`driveId`, `entry`, `options`?): `Promise`\<[`BlobReadStream`](BlobReadStream.md)\> +> **createEntryReadStream**(`driveId`, `entry`, `options`?): `Promise`\<[`Readable`](../type-aliases/Readable.md)\> Optimization for creating the blobs read stream when you have previously read the entry from Hyperdrive using `drive.entry` @@ -79,13 +79,13 @@ Set to `true` to wait for a blob to download, otherwise will throw if blob is no #### Returns -`Promise`\<[`BlobReadStream`](BlobReadStream.md)\> +`Promise`\<[`Readable`](../type-aliases/Readable.md)\> *** ### createReadStream() -> **createReadStream**(`blobId`, `options`?): `Readable`\<`any`, `any`, `any`, `true`, `false`, `ReadableEvents`\<`any`\>\> +> **createReadStream**(`blobId`, `options`?): [`Readable`](../type-aliases/Readable.md) #### Parameters @@ -103,7 +103,7 @@ Set to `true` to wait for a blob to download, otherwise will throw if blob is no #### Returns -`Readable`\<`any`, `any`, `any`, `true`, `false`, `ReadableEvents`\<`any`\>\> +[`Readable`](../type-aliases/Readable.md) *** @@ -129,7 +129,7 @@ Metadata to store with the blob ### download() -> **download**(`filter`?, `options`?): [`LiveDownload`](LiveDownload.md) +> **download**(`filter`?, `options`?): `TypedEmitter`\<[`BlobDownloadEvents`](../interfaces/BlobDownloadEvents.md)\> Download blobs from all drives, optionally filtering particular blob types or blob variants. Download will be 'live' and will continue downloading new @@ -152,9 +152,7 @@ Optional AbortSignal to cancel in-progress download #### Returns -[`LiveDownload`](LiveDownload.md) - -EventEmitter with `.state` propery, emits `state` with new state when it updates +`TypedEmitter`\<[`BlobDownloadEvents`](../interfaces/BlobDownloadEvents.md)\> *** @@ -188,7 +186,7 @@ Set to `true` to wait for a blob to download, otherwise will throw if blob is no ### get() -> **get**(`blobId`, `opts`): `Promise`\<`Buffer`\> +> **get**(`blobId`, `opts`): `Promise`\<`Uint8Array`\> #### Parameters @@ -206,7 +204,7 @@ Set to `true` to wait for a blob to download, otherwise will throw if blob is no #### Returns -`Promise`\<`Buffer`\> +`Promise`\<`Uint8Array`\> *** diff --git a/docs/api/md/-internal-/classes/DriveLiveDownload.md b/docs/api/md/-internal-/classes/DriveLiveDownload.md deleted file mode 100644 index f48ec4397..000000000 --- a/docs/api/md/-internal-/classes/DriveLiveDownload.md +++ /dev/null @@ -1,51 +0,0 @@ -[**API**](../../README.md) • **Docs** - -*** - -[API](../../README.md) / [\](../README.md) / DriveLiveDownload - -# Class: DriveLiveDownload - -LiveDownload class - -## Extends - -- `TypedEmitter` - -## Constructors - -### new DriveLiveDownload() - -> **new DriveLiveDownload**(`drive`, `options`): [`DriveLiveDownload`](DriveLiveDownload.md) - -Like drive.download() but 'live', - -#### Parameters - -• **drive**: [`Hyperdrive`](Hyperdrive.md) - -• **options** = `{}` - -• **options.filter**: `undefined` \| [`BlobFilter`](../type-aliases/BlobFilter.md) - -Filter blobs of specific types and/or sizes to download - -• **options.signal**: `undefined` \| `AbortSignal` - -#### Returns - -[`DriveLiveDownload`](DriveLiveDownload.md) - -#### Overrides - -`TypedEmitter.constructor` - -## Accessors - -### state - -> `get` **state**(): [`BlobDownloadState`](../interfaces/BlobDownloadState.md) \| [`BlobDownloadStateError`](../type-aliases/BlobDownloadStateError.md) - -#### Returns - -[`BlobDownloadState`](../interfaces/BlobDownloadState.md) \| [`BlobDownloadStateError`](../type-aliases/BlobDownloadStateError.md) diff --git a/docs/api/md/-internal-/classes/LiveDownload.md b/docs/api/md/-internal-/classes/LiveDownload.md deleted file mode 100644 index b558e80d7..000000000 --- a/docs/api/md/-internal-/classes/LiveDownload.md +++ /dev/null @@ -1,53 +0,0 @@ -[**API**](../../README.md) • **Docs** - -*** - -[API](../../README.md) / [\](../README.md) / LiveDownload - -# Class: LiveDownload - -LiveDownload class - -## Extends - -- `TypedEmitter` - -## Constructors - -### new LiveDownload() - -> **new LiveDownload**(`drives`, `emitter`, `options`): [`LiveDownload`](LiveDownload.md) - -Like drive.download() but 'live', and for multiple drives - -#### Parameters - -• **drives**: `Iterable`\<[`Hyperdrive`](Hyperdrive.md), `any`, `any`\> - -• **emitter**: [`InternalDriveEmitter`](../type-aliases/InternalDriveEmitter.md) - -• **options** - -• **options.filter**: `undefined` \| [`BlobFilter`](../type-aliases/BlobFilter.md) - -Filter blobs of specific types and/or sizes to download - -• **options.signal**: `undefined` \| `AbortSignal` - -#### Returns - -[`LiveDownload`](LiveDownload.md) - -#### Overrides - -`TypedEmitter.constructor` - -## Accessors - -### state - -> `get` **state**(): [`BlobDownloadState`](../interfaces/BlobDownloadState.md) \| [`BlobDownloadStateError`](../type-aliases/BlobDownloadStateError.md) - -#### Returns - -[`BlobDownloadState`](../interfaces/BlobDownloadState.md) \| [`BlobDownloadStateError`](../type-aliases/BlobDownloadStateError.md) diff --git a/docs/api/md/-internal-/interfaces/BlobDownloadEvents.md b/docs/api/md/-internal-/interfaces/BlobDownloadEvents.md new file mode 100644 index 000000000..dab74ecd4 --- /dev/null +++ b/docs/api/md/-internal-/interfaces/BlobDownloadEvents.md @@ -0,0 +1,23 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / BlobDownloadEvents + +# Interface: BlobDownloadEvents + +## Properties + +### state() + +> **state**: (`state`) => `void` + +Emitted with the current download state whenever it changes (not emitted during initial 'checking' status) + +#### Parameters + +• **state**: [`BlobDownloadState`](BlobDownloadState.md) \| [`BlobDownloadStateError`](../type-aliases/BlobDownloadStateError.md) + +#### Returns + +`void` diff --git a/docs/api/md/-internal-/type-aliases/Readable.md b/docs/api/md/-internal-/type-aliases/Readable.md new file mode 100644 index 000000000..9831d8533 --- /dev/null +++ b/docs/api/md/-internal-/type-aliases/Readable.md @@ -0,0 +1,11 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / Readable + +# Type Alias: Readable + +> **Readable**\<\>: `NodeReadable` \| `StreamxReadable` + +## Type Parameters diff --git a/package-lock.json b/package-lock.json index 06389c559..eea05dea7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@comapeo/core", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@comapeo/core", - "version": "2.0.0", + "version": "2.0.1", "license": "MIT", "dependencies": { "@comapeo/fallback-smp": "^1.0.0", diff --git a/package.json b/package.json index b1aae2e2e..e479e5c79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@comapeo/core", - "version": "2.0.0", + "version": "2.0.1", "description": "Offline p2p mapping library", "main": "src/index.js", "types": "dist/index.d.ts",