diff --git a/docs/api/md/-internal-/README.md b/docs/api/md/-internal-/README.md index 28766977c..3985ff0e9 100644 --- a/docs/api/md/-internal-/README.md +++ b/docs/api/md/-internal-/README.md @@ -16,9 +16,9 @@ - ["/home/runner/work/comapeo-core/comapeo-core/src/schema/project"](namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/README.md) - ["/home/runner/work/comapeo-core/comapeo-core/src/sync/core-sync-state"](namespaces/home_runner_work_comapeo-core_comapeo-core_src_sync_core-sync-state/README.md) - ["/home/runner/work/comapeo-core/comapeo-core/src/sync/namespace-sync-state"](namespaces/home_runner_work_comapeo-core_comapeo-core_src_sync_namespace-sync-state/README.md) -- ["hyperdrive"](namespaces/hyperdrive/README.md) +- [Hyperbee](namespaces/Hyperbee/README.md) - [Hyperblobs](namespaces/Hyperblobs/README.md) -- [Hyperdrive](namespaces/Hyperdrive/README-1.md) +- [Hyperdrive](namespaces/Hyperdrive/README.md) ### Classes @@ -38,8 +38,13 @@ - [default](classes/default.md) - [default](classes/default.md) - [DenseIndex](classes/DenseIndex.md) +- [Downloader](classes/Downloader.md) +- [EntryWatcher](classes/EntryWatcher.md) +- [Hyperbee](classes/Hyperbee.md) +- [HyperbeeBatch](classes/HyperbeeBatch.md) - [Hyperblobs](classes/Hyperblobs.md) - [Hyperdrive](classes/Hyperdrive.md) +- [HyperdriveIndexImpl](classes/HyperdriveIndexImpl.md) - [IconApi](classes/IconApi.md) - [Index](classes/Index.md) - [IndexWriter](classes/IndexWriter.md) @@ -62,9 +67,8 @@ ### Interfaces +- [AbstractEncoding](interfaces/AbstractEncoding.md) - [BitmapOpts](interfaces/BitmapOpts.md) -- [BlobDownloadEvents](interfaces/BlobDownloadEvents.md) -- [BlobDownloadState](interfaces/BlobDownloadState.md) - [Channel](interfaces/Channel.md) - [CorestoreEvents](interfaces/CorestoreEvents.md) - [DataTypeEvents](interfaces/DataTypeEvents.md) @@ -92,10 +96,10 @@ ### Type Aliases - [BitField](type-aliases/BitField.md) -- [BlobDownloadStateError](type-aliases/BlobDownloadStateError.md) - [BlobFilter](type-aliases/BlobFilter.md) - [BlobId](type-aliases/BlobId.md) - [BlobIdBase](type-aliases/BlobIdBase.md) +- [BlobStoreEntriesStream](type-aliases/BlobStoreEntriesStream.md) - [BlobType](type-aliases/BlobType.md) - [BlobVariant](type-aliases/BlobVariant.md) - [Chunk](type-aliases/Chunk.md) @@ -108,6 +112,8 @@ - [DeviceInfoParam](type-aliases/DeviceInfoParam.md) - [EditableProjectSettings](type-aliases/EditableProjectSettings.md) - [ElementOf](type-aliases/ElementOf.md) +- [Encoding](type-aliases/Encoding.md) +- [GenericBlobFilter](type-aliases/GenericBlobFilter.md) - [GenericBlobFilter](type-aliases/GenericBlobFilter.md) - [GetMapeoDocTables](type-aliases/GetMapeoDocTables.md) - [HypercorePeer](type-aliases/HypercorePeer.md) @@ -115,7 +121,6 @@ - [HypercoreRemoteBitfieldPage](type-aliases/HypercoreRemoteBitfieldPage.md) - [IconVariant](type-aliases/IconVariant.md) - [IndexedDocIds](type-aliases/IndexedDocIds.md) -- [InternalDriveEmitter](type-aliases/InternalDriveEmitter.md) - [InviteInternal](type-aliases/InviteInternal.md) - [Keypair](type-aliases/Keypair.md) - [KeyPair](type-aliases/KeyPair-1.md) @@ -163,6 +168,12 @@ Re-exports [BlobId](namespaces/Hyperblobs/interfaces/BlobId.md) *** +### HyperbeeEntry + +Re-exports [HyperbeeEntry](namespaces/Hyperbee/interfaces/HyperbeeEntry.md) + +*** + ### HyperdriveEntry Re-exports [HyperdriveEntry](namespaces/Hyperdrive/interfaces/HyperdriveEntry.md) diff --git a/docs/api/md/-internal-/classes/BlobApi.md b/docs/api/md/-internal-/classes/BlobApi.md index a43d121a5..1a9833f94 100644 --- a/docs/api/md/-internal-/classes/BlobApi.md +++ b/docs/api/md/-internal-/classes/BlobApi.md @@ -62,7 +62,7 @@ Write blobs for provided variants of a file ##### type -> **type**: `"photo"` \| `"audio"` \| `"video"` +> **type**: `"photo"` \| `"video"` \| `"audio"` *** diff --git a/docs/api/md/-internal-/classes/BlobStore.md b/docs/api/md/-internal-/classes/BlobStore.md index 710f53dd2..679628ea9 100644 --- a/docs/api/md/-internal-/classes/BlobStore.md +++ b/docs/api/md/-internal-/classes/BlobStore.md @@ -6,6 +6,10 @@ # Class: BlobStore +## Extends + +- `TypedEmitter` + ## Constructors ### new BlobStore() @@ -18,10 +22,18 @@ • **options.coreManager**: [`CoreManager`](CoreManager.md) +• **options.downloadFilter**: `null` \| [`BlobFilter`](../type-aliases/BlobFilter.md) + +Filter blob types and/or variants to download. Set to `null` to download all blobs. + #### Returns [`BlobStore`](BlobStore.md) +#### Overrides + +`TypedEmitter.constructor` + ## Accessors ### writerDriveId @@ -54,32 +66,38 @@ Enable to return an object with a `block` property with number of bytes removed *** -### createEntryReadStream() +### close() -> **createEntryReadStream**(`driveId`, `entry`, `options`?): `Promise`\<[`Readable`](../type-aliases/Readable.md)\> +> **close**(): `void` -Optimization for creating the blobs read stream when you have -previously read the entry from Hyperdrive using `drive.entry` +#### Returns -#### Parameters +`void` -• **driveId**: `string` +*** -Hyperdrive drive discovery id +### createEntriesReadStream() -• **entry**: [`HyperdriveEntry`](../namespaces/Hyperdrive/interfaces/HyperdriveEntry.md) +> **createEntriesReadStream**(`opts`): [`BlobStoreEntriesStream`](../type-aliases/BlobStoreEntriesStream.md) -Hyperdrive entry +This is a low-level method to create a stream of entries from all drives. +It includes entries for unknown blob types and variants. -• **options?** = `...` +#### Parameters -• **options.wait?**: `undefined` \| `boolean` +• **opts** = `{}` -Set to `true` to wait for a blob to download, otherwise will throw if blob is not available locally +• **opts.filter**: `undefined` \| `null` \| [`GenericBlobFilter`](../type-aliases/GenericBlobFilter.md) + +Filter blob types and/or variants in returned entries. Filter is { [BlobType]: BlobVariants[] }. + +• **opts.live**: `undefined` \| `boolean` = `false` + +Set to `true` to get a live stream of entries #### Returns -`Promise`\<[`Readable`](../type-aliases/Readable.md)\> +[`BlobStoreEntriesStream`](../type-aliases/BlobStoreEntriesStream.md) *** @@ -107,52 +125,52 @@ Set to `true` to wait for a blob to download, otherwise will throw if blob is no *** -### createWriteStream() +### createReadStreamFromEntry() -> **createWriteStream**(`blobId`, `options`?): `Writable`\<`any`, `any`, `any`, `false`, `true`, `WritableEvents`\<`any`\>\> & `object` +> **createReadStreamFromEntry**(`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` #### Parameters -• **blobId**: `Omit`\<[`BlobId`](../type-aliases/BlobId.md), `"driveId"`\> +• **driveId**: `string` -• **options?** +Hyperdrive drive discovery id -• **options.metadata?**: `undefined` \| `JsonObject` +• **entry**: [`HyperdriveEntry`](../namespaces/Hyperdrive/interfaces/HyperdriveEntry.md) -Metadata to store with the blob +Hyperdrive entry -#### Returns +• **options?** = `...` -`Writable`\<`any`, `any`, `any`, `false`, `true`, `WritableEvents`\<`any`\>\> & `object` +• **options.wait?**: `undefined` \| `boolean` -*** +Set to `true` to wait for a blob to download, otherwise will throw if blob is not available locally + +#### Returns -### download() +`Promise`\<[`Readable`](../type-aliases/Readable.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 -data as it becomes available from any replicating drive. +### createWriteStream() -If no filter is specified, all blobs will be downloaded. If a filter is -specified, then _only_ blobs that match the filter will be downloaded. +> **createWriteStream**(`blobId`, `options`?): `Writable`\<`any`, `any`, `any`, `false`, `true`, `WritableEvents`\<`any`\>\> & `object` #### Parameters -• **filter?**: [`BlobFilter`](../type-aliases/BlobFilter.md) - -Filter blob types and/or variants to download. Filter is { [BlobType]: BlobVariants[] }. At least one blob variant must be specified for each blob type. +• **blobId**: `Omit`\<[`BlobId`](../type-aliases/BlobId.md), `"driveId"`\> -• **options?** = `{}` +• **options?** -• **options.signal?**: `undefined` \| `AbortSignal` +• **options.metadata?**: `undefined` \| `JsonObject` -Optional AbortSignal to cancel in-progress download +Metadata to store with the blob #### Returns -`TypedEmitter`\<[`BlobDownloadEvents`](../interfaces/BlobDownloadEvents.md)\> +`Writable`\<`any`, `any`, `any`, `false`, `true`, `WritableEvents`\<`any`\>\> & `object` *** @@ -253,3 +271,21 @@ Metadata to store with the blob `Promise`\<`string`\> discovery key as hex string of hyperdrive where blob is stored + +*** + +### setDownloadFilter() + +> **setDownloadFilter**(`filter`): `void` + +Set the filter for downloading blobs. + +#### Parameters + +• **filter**: `null` \| [`BlobFilter`](../type-aliases/BlobFilter.md) + +Filter blob types and/or variants to download. Filter is { [BlobType]: BlobVariants[] }. At least one blob variant must be specified for each blob type. + +#### Returns + +`void` diff --git a/docs/api/md/-internal-/classes/CoreIndex.md b/docs/api/md/-internal-/classes/CoreIndex.md index e74af53c0..9d809b015 100644 --- a/docs/api/md/-internal-/classes/CoreIndex.md +++ b/docs/api/md/-internal-/classes/CoreIndex.md @@ -49,7 +49,7 @@ Hypercore instance Buffer containing public key of this core -• **options.namespace**: `"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` +• **options.namespace**: `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` • **options.writer**: `undefined` \| `boolean` = `false` @@ -101,7 +101,7 @@ Get all known cores in a namespace #### Parameters -• **namespace**: `"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` +• **namespace**: `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` #### Returns @@ -117,7 +117,7 @@ Get the write core for the given namespace #### Parameters -• **namespace**: `"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` +• **namespace**: `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` #### Returns diff --git a/docs/api/md/-internal-/classes/CoreManager.md b/docs/api/md/-internal-/classes/CoreManager.md index 6a7f1627d..2419a1200 100644 --- a/docs/api/md/-internal-/classes/CoreManager.md +++ b/docs/api/md/-internal-/classes/CoreManager.md @@ -28,7 +28,7 @@ Immediately start downloading cores - should only be set to false for tests Drizzle better-sqlite3 database instance -• **options.encryptionKeys**: `undefined` \| `Partial`\<`Record`\<`"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"`, `Buffer`\>\> = `{}` +• **options.encryptionKeys**: `undefined` \| `Partial`\<`Record`\<`"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"`, `Buffer`\>\> = `{}` Encryption keys for each namespace @@ -132,7 +132,7 @@ Add a core to the manager (will be persisted across restarts) 32-byte public key of core to add -• **namespace**: `"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` +• **namespace**: `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` #### Returns @@ -159,7 +159,7 @@ TODO: gracefully close replication streams #### Parameters -• **namespace**: `"blob"` \| `"config"` \| `"data"` \| `"blobIndex"` +• **namespace**: `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` #### Returns @@ -207,7 +207,7 @@ Get an array of all cores in the given namespace #### Parameters -• **namespace**: `"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` +• **namespace**: `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` #### Returns @@ -223,7 +223,7 @@ Get the writer core for the given namespace #### Parameters -• **namespace**: `"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` +• **namespace**: `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` #### Returns diff --git a/docs/api/md/-internal-/classes/CoreOwnership.md b/docs/api/md/-internal-/classes/CoreOwnership.md index 1422d54da..48ec83c93 100644 --- a/docs/api/md/-internal-/classes/CoreOwnership.md +++ b/docs/api/md/-internal-/classes/CoreOwnership.md @@ -20,9 +20,9 @@ • **opts** -• **opts.coreKeypairs**: `Record`\<`"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"`, [`KeyPair`](../type-aliases/KeyPair-1.md)\> +• **opts.coreKeypairs**: `Record`\<`"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"`, [`KeyPair`](../type-aliases/KeyPair-1.md)\> -• **opts.dataType**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"auth"`, `"coreOwnership"` \| `"role"`\>, `SQLiteTableWithColumns`\<`object`\>, `"coreOwnership"`, `object`, `object`\> +• **opts.dataType**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"auth"`, `"role"` \| `"coreOwnership"`\>, `SQLiteTableWithColumns`\<`object`\>, `"coreOwnership"`, `object`, `object`\> • **opts.identityKeypair**: [`KeyPair`](../type-aliases/KeyPair-1.md) @@ -70,7 +70,7 @@ Get capabilities for a given deviceId • **deviceId**: `string` -• **namespace**: `"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` +• **namespace**: `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` #### Returns diff --git a/docs/api/md/-internal-/classes/CoreSyncState.md b/docs/api/md/-internal-/classes/CoreSyncState.md index 6d637ee71..a433b552a 100644 --- a/docs/api/md/-internal-/classes/CoreSyncState.md +++ b/docs/api/md/-internal-/classes/CoreSyncState.md @@ -39,7 +39,7 @@ Each peer (including the local peer) has a state of: • **opts.logger**: `undefined` \| [`Logger`](Logger.md) -• **opts.namespace**: `"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` +• **opts.namespace**: `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` • **opts.onUpdate** @@ -67,6 +67,28 @@ Called when a state update is available (via getState()) *** +### addWantRange() + +> **addWantRange**(`peerId`, `start`, `length`): `void` + +Add a ranges of wanted blocks for a peer. By default a peer wants all +blocks in a core - calling this will change the peer to only want the +blocks/ranges that are added here + +#### Parameters + +• **peerId**: `string` + +• **start**: `number` + +• **length**: `number` + +#### Returns + +`void` + +*** + ### attachCore() > **attachCore**(`core`): `void` @@ -85,6 +107,20 @@ before we have the core key that allows us to create a core instance. *** +### clearWantRanges() + +> **clearWantRanges**(`peerId`): `void` + +#### Parameters + +• **peerId**: `string` + +#### Returns + +`void` + +*** + ### disconnectPeer() > **disconnectPeer**(`peerId`): `void` @@ -128,23 +164,3 @@ peer before the peer actually starts syncing this core #### Returns `void` - -*** - -### setPeerWants() - -> **setPeerWants**(`peerId`, `ranges`): `void` - -Add a ranges of wanted blocks for a peer. By default a peer wants all -blocks in a core - calling this will change the peer to only want the -blocks/ranges that are added here - -#### Parameters - -• **peerId**: `string` - -• **ranges**: `object`[] - -#### Returns - -`void` diff --git a/docs/api/md/-internal-/classes/Corestore.md b/docs/api/md/-internal-/classes/Corestore.md index fcd02c35a..d8037b066 100644 --- a/docs/api/md/-internal-/classes/Corestore.md +++ b/docs/api/md/-internal-/classes/Corestore.md @@ -24,7 +24,7 @@ • **options.poolSize?**: `number` -• **options.primaryKey?**: `Buffer` \| `Uint8Array` +• **options.primaryKey?**: `Uint8Array` \| `Buffer` #### Returns @@ -60,7 +60,7 @@ ##### Parameters -• **key**: `Buffer` \| `Uint8Array` +• **key**: `Uint8Array` \| `Buffer` ##### Returns diff --git a/docs/api/md/-internal-/classes/DataStore.md b/docs/api/md/-internal-/classes/DataStore.md index 3e495aafc..f9299e504 100644 --- a/docs/api/md/-internal-/classes/DataStore.md +++ b/docs/api/md/-internal-/classes/DataStore.md @@ -68,11 +68,11 @@ ### schemas -> `get` **schemas**(): (`"observation"` \| `"track"` \| `"remoteDetectionAlert"`)[] \| (`"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`)[] \| (`"coreOwnership"` \| `"role"`)[] +> `get` **schemas**(): (`"track"` \| `"remoteDetectionAlert"` \| `"observation"`)[] \| (`"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`)[] \| (`"role"` \| `"coreOwnership"`)[] #### Returns -(`"observation"` \| `"track"` \| `"remoteDetectionAlert"`)[] \| (`"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`)[] \| (`"coreOwnership"` \| `"role"`)[] +(`"track"` \| `"remoteDetectionAlert"` \| `"observation"`)[] \| (`"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`)[] \| (`"role"` \| `"coreOwnership"`)[] *** diff --git a/docs/api/md/-internal-/classes/DataType.md b/docs/api/md/-internal-/classes/DataType.md index 64380df12..7ca297422 100644 --- a/docs/api/md/-internal-/classes/DataType.md +++ b/docs/api/md/-internal-/classes/DataType.md @@ -150,9 +150,11 @@ ### getByDocId() +#### getByDocId(docId, opts) + > **getByDocId**(`docId`, `opts`?): `Promise`\<`TDoc` & `object`\> -#### Parameters +##### Parameters • **docId**: `string` @@ -160,10 +162,30 @@ • **opts.lang?**: `string` -#### Returns +• **opts.mustBeFound?**: `true` + +##### Returns `Promise`\<`TDoc` & `object`\> +#### getByDocId(docId, opts) + +> **getByDocId**(`docId`, `opts`?): `Promise`\<`null` \| `TDoc` & `object`\> + +##### Parameters + +• **docId**: `string` + +• **opts?** + +• **opts.lang?**: `string` + +• **opts.mustBeFound?**: `boolean` + +##### Returns + +`Promise`\<`null` \| `TDoc` & `object`\> + *** ### getByVersionId() diff --git a/docs/api/md/-internal-/classes/Downloader.md b/docs/api/md/-internal-/classes/Downloader.md new file mode 100644 index 000000000..93aea1509 --- /dev/null +++ b/docs/api/md/-internal-/classes/Downloader.md @@ -0,0 +1,64 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / Downloader + +# Class: Downloader + +Like hyperdrive.download() but 'live', and for multiple drives. + +Will emit an 'error' event for any unexpected errors. A consumer must attach +an error listener to avoid uncaught errors. Sources of errors include: + +- If the entries stream emits an error +- If a drive referenced in an entry is not found +- If core.has() throws (e.g. if hypercore is closed) +- If core.download().done() throws, which should not happen according to + current hypercore code. +- If the entries stream ends unexpectedly (it should be live and not end) + +NB: unlike hyperdrive.download(), this will also download deleted and +previous versions of blobs - we don't currently support editing or deleting +of blobs, so this should not be an issue, and if we do in the future, +downloading deleted and previous versions may be desirable behavior anyway + +## Extends + +- `TypedEmitter` + +## Constructors + +### new Downloader() + +> **new Downloader**(`driveIndex`, `options`?): [`Downloader`](Downloader.md) + +#### Parameters + +• **driveIndex**: [`HyperdriveIndexImpl`](HyperdriveIndexImpl.md) + +• **options?** = `{}` + +• **options.filter?**: `undefined` \| `null` \| [`BlobFilter`](../type-aliases/BlobFilter.md) + +Filter blobs of specific types and/or sizes to download + +#### Returns + +[`Downloader`](Downloader.md) + +#### Overrides + +`TypedEmitter.constructor` + +## Methods + +### destroy() + +> **destroy**(): `void` + +Cancel the downloads and clean up resources. + +#### Returns + +`void` diff --git a/docs/api/md/-internal-/classes/EntryWatcher.md b/docs/api/md/-internal-/classes/EntryWatcher.md new file mode 100644 index 000000000..fa567c1fc --- /dev/null +++ b/docs/api/md/-internal-/classes/EntryWatcher.md @@ -0,0 +1,59 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / EntryWatcher + +# Class: EntryWatcher\ + +## Extends + +- `TypedEmitter`\<`object`\> + +## Type Parameters + +• **T** + +## Constructors + +### new EntryWatcher() + +> **new EntryWatcher**\<`T`\>(): [`EntryWatcher`](EntryWatcher.md)\<`T`\> + +#### Returns + +[`EntryWatcher`](EntryWatcher.md)\<`T`\> + +#### Inherited from + +`TypedEmitter<{ + update: () => void + }>.constructor` + +## Properties + +### node + +> **node**: `object` + +#### key + +> **key**: `string` + +#### seq + +> **seq**: `number` + +#### value + +> **value**: `T` + +## Methods + +### close() + +> **close**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> diff --git a/docs/api/md/-internal-/classes/Hyperbee.md b/docs/api/md/-internal-/classes/Hyperbee.md new file mode 100644 index 000000000..72b8ea7e4 --- /dev/null +++ b/docs/api/md/-internal-/classes/Hyperbee.md @@ -0,0 +1,293 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / Hyperbee + +# Class: Hyperbee\ + +## Type Parameters + +• **T** = `any` + +## Constructors + +### new Hyperbee() + +> **new Hyperbee**\<`T`\>(`core`, `options`?): [`Hyperbee`](Hyperbee.md)\<`T`\> + +#### Parameters + +• **core**: `Hypercore`\<`"binary"`, `undefined`\> + +• **options?**: [`HyperbeeOptions`](../namespaces/Hyperbee/interfaces/HyperbeeOptions.md)\<`T`\> + +#### Returns + +[`Hyperbee`](Hyperbee.md)\<`T`\> + +## Properties + +### core + +> `readonly` **core**: `Hypercore`\<`"binary"`, `undefined`\> + +*** + +### version + +> `readonly` **version**: `number` + +## Methods + +### batch() + +> **batch**(): [`HyperbeeBatch`](HyperbeeBatch.md)\<`T`\> + +#### Returns + +[`HyperbeeBatch`](HyperbeeBatch.md)\<`T`\> + +*** + +### checkout() + +> **checkout**(`version`): [`Hyperbee`](Hyperbee.md)\<`any`\> + +#### Parameters + +• **version**: `number` + +#### Returns + +[`Hyperbee`](Hyperbee.md)\<`any`\> + +*** + +### close() + +> **close**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### createDiffStream() + +> **createDiffStream**(`otherVersion`, `options`?): `Readable`\<[`DiffStreamEntry`](../namespaces/Hyperbee/interfaces/DiffStreamEntry.md)\<`T`\>, [`DiffStreamEntry`](../namespaces/Hyperbee/interfaces/DiffStreamEntry.md)\<`T`\>, [`DiffStreamEntry`](../namespaces/Hyperbee/interfaces/DiffStreamEntry.md)\<`T`\>, `true`, `false`, `ReadableEvents`\<[`DiffStreamEntry`](../namespaces/Hyperbee/interfaces/DiffStreamEntry.md)\<`T`\>\>\> + +#### Parameters + +• **otherVersion**: `number` + +• **options?**: [`DiffStreamOptions`](../namespaces/Hyperbee/interfaces/DiffStreamOptions.md) + +#### Returns + +`Readable`\<[`DiffStreamEntry`](../namespaces/Hyperbee/interfaces/DiffStreamEntry.md)\<`T`\>, [`DiffStreamEntry`](../namespaces/Hyperbee/interfaces/DiffStreamEntry.md)\<`T`\>, [`DiffStreamEntry`](../namespaces/Hyperbee/interfaces/DiffStreamEntry.md)\<`T`\>, `true`, `false`, `ReadableEvents`\<[`DiffStreamEntry`](../namespaces/Hyperbee/interfaces/DiffStreamEntry.md)\<`T`\>\>\> + +*** + +### createHistoryStream() + +> **createHistoryStream**(`options`?): `Readable`\<[`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\> & `object`, [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\> & `object`, [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\> & `object`, `true`, `false`, `ReadableEvents`\<[`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\> & `object`\>\> + +#### Parameters + +• **options?**: [`HistoryStreamOptions`](../namespaces/Hyperbee/interfaces/HistoryStreamOptions.md) + +#### Returns + +`Readable`\<[`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\> & `object`, [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\> & `object`, [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\> & `object`, `true`, `false`, `ReadableEvents`\<[`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\> & `object`\>\> + +*** + +### createReadStream() + +> **createReadStream**(`range`?, `options`?): `Readable`\<[`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>, [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>, [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>, `true`, `false`, `ReadableEvents`\<[`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>\>\> + +#### Parameters + +• **range?**: [`ReadStreamRange`](../namespaces/Hyperbee/interfaces/ReadStreamRange.md) + +• **options?**: [`ReadStreamOptions`](../namespaces/Hyperbee/interfaces/ReadStreamOptions.md) + +#### Returns + +`Readable`\<[`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>, [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>, [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>, `true`, `false`, `ReadableEvents`\<[`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>\>\> + +*** + +### del() + +> **del**(`key`, `options`?): `Promise`\<`void`\> + +#### Parameters + +• **key**: `string` + +• **options?**: [`DelOptions`](../namespaces/Hyperbee/interfaces/DelOptions.md)\<`T`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### get() + +> **get**(`key`): `Promise`\<`null` \| [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>\> + +#### Parameters + +• **key**: `string` + +#### Returns + +`Promise`\<`null` \| [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>\> + +*** + +### getAndWatch() + +> **getAndWatch**(`key`, `options`?): `Promise`\<[`EntryWatcher`](EntryWatcher.md)\<`T`\>\> + +#### Parameters + +• **key**: `string` + +• **options?**: [`GetAndWatchOptions`](../namespaces/Hyperbee/interfaces/GetAndWatchOptions.md) + +#### Returns + +`Promise`\<[`EntryWatcher`](EntryWatcher.md)\<`T`\>\> + +*** + +### getHeader() + +> **getHeader**(`options`?): `Promise`\<`any`\> + +#### Parameters + +• **options?**: `any` + +#### Returns + +`Promise`\<`any`\> + +*** + +### peek() + +> **peek**(`range`?, `options`?): `Promise`\<`null` \| [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>\> + +#### Parameters + +• **range?**: [`ReadStreamRange`](../namespaces/Hyperbee/interfaces/ReadStreamRange.md) + +• **options?**: [`ReadStreamOptions`](../namespaces/Hyperbee/interfaces/ReadStreamOptions.md) + +#### Returns + +`Promise`\<`null` \| [`HyperbeeEntry`](../namespaces/Hyperbee/interfaces/HyperbeeEntry.md)\<`T`\>\> + +*** + +### put() + +> **put**(`key`, `value`?, `options`?): `Promise`\<`void`\> + +#### Parameters + +• **key**: `string` + +• **value?**: `any` + +• **options?**: [`PutOptions`](../namespaces/Hyperbee/interfaces/PutOptions.md)\<`T`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### ready() + +> **ready**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### replicate() + +> **replicate**(`isInitiatorOrStream`): `Readable`\<`any`, `any`, `any`, `true`, `false`, `ReadableEvents`\<`any`\>\> + +#### Parameters + +• **isInitiatorOrStream**: `any` + +#### Returns + +`Readable`\<`any`, `any`, `any`, `true`, `false`, `ReadableEvents`\<`any`\>\> + +*** + +### snapshot() + +> **snapshot**(): [`Hyperbee`](Hyperbee.md)\<`any`\> + +#### Returns + +[`Hyperbee`](Hyperbee.md)\<`any`\> + +*** + +### sub() + +> **sub**(`prefix`, `options`?): [`Hyperbee`](Hyperbee.md)\<`any`\> + +#### Parameters + +• **prefix**: `string` + +• **options?**: [`SubDatabaseOptions`](../namespaces/Hyperbee/interfaces/SubDatabaseOptions.md) + +#### Returns + +[`Hyperbee`](Hyperbee.md)\<`any`\> + +*** + +### watch() + +> **watch**(`range`?): `AsyncIterable`\<[`any`, `any`], `any`, `any`\> & `object` + +#### Parameters + +• **range?**: [`ReadStreamRange`](../namespaces/Hyperbee/interfaces/ReadStreamRange.md) + +#### Returns + +`AsyncIterable`\<[`any`, `any`], `any`, `any`\> & `object` + +*** + +### isHyperbee() + +> `static` **isHyperbee**(`core`, `options`?): `Promise`\<`boolean`\> + +#### Parameters + +• **core**: `Hypercore`\<`"binary"`, `undefined`\> + +• **options?**: `any` + +#### Returns + +`Promise`\<`boolean`\> diff --git a/docs/api/md/-internal-/classes/HyperbeeBatch.md b/docs/api/md/-internal-/classes/HyperbeeBatch.md new file mode 100644 index 000000000..a5f084adf --- /dev/null +++ b/docs/api/md/-internal-/classes/HyperbeeBatch.md @@ -0,0 +1,89 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / HyperbeeBatch + +# Class: HyperbeeBatch\ + +## Type Parameters + +• **T** + +## Constructors + +### new HyperbeeBatch() + +> **new HyperbeeBatch**\<`T`\>(): [`HyperbeeBatch`](HyperbeeBatch.md)\<`T`\> + +#### Returns + +[`HyperbeeBatch`](HyperbeeBatch.md)\<`T`\> + +## Methods + +### close() + +> **close**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### del() + +> **del**(`key`, `options`?): `Promise`\<`void`\> + +#### Parameters + +• **key**: `string` + +• **options?**: `any` + +#### Returns + +`Promise`\<`void`\> + +*** + +### flush() + +> **flush**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + +### get() + +> **get**(`key`): `Promise`\<`any`\> + +#### Parameters + +• **key**: `string` + +#### Returns + +`Promise`\<`any`\> + +*** + +### put() + +> **put**(`key`, `value`?, `options`?): `Promise`\<`void`\> + +#### Parameters + +• **key**: `string` + +• **value?**: `T` + +• **options?**: `any` + +#### Returns + +`Promise`\<`void`\> diff --git a/docs/api/md/-internal-/classes/Hyperdrive.md b/docs/api/md/-internal-/classes/Hyperdrive.md index 9a3057ba2..4677654b8 100644 --- a/docs/api/md/-internal-/classes/Hyperdrive.md +++ b/docs/api/md/-internal-/classes/Hyperdrive.md @@ -72,7 +72,7 @@ ### db -> `readonly` **db**: `any` +> `readonly` **db**: [`Hyperbee`](Hyperbee.md)\<`any`\> *** @@ -142,6 +142,16 @@ *** +### close() + +> **close**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +*** + ### createReadStream() > **createReadStream**(`path`, `opts`?): `Readable`\<`any`, `any`, `any`, `true`, `false`, `ReadableEvents`\<`any`\>\> @@ -330,11 +340,11 @@ ### getBlobs() -> **getBlobs**(): `Promise`\<`null` \| [`Hyperblobs`](Hyperblobs.md)\> +> **getBlobs**(): `Promise`\<[`Hyperblobs`](Hyperblobs.md)\> #### Returns -`Promise`\<`null` \| [`Hyperblobs`](Hyperblobs.md)\> +`Promise`\<[`Hyperblobs`](Hyperblobs.md)\> *** diff --git a/docs/api/md/-internal-/classes/HyperdriveIndexImpl.md b/docs/api/md/-internal-/classes/HyperdriveIndexImpl.md new file mode 100644 index 000000000..5b52e0943 --- /dev/null +++ b/docs/api/md/-internal-/classes/HyperdriveIndexImpl.md @@ -0,0 +1,73 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / HyperdriveIndexImpl + +# Class: HyperdriveIndexImpl + +## Extends + +- `TypedEmitter` + +## Constructors + +### new HyperdriveIndexImpl() + +> **new HyperdriveIndexImpl**(`coreManager`): [`HyperdriveIndexImpl`](HyperdriveIndexImpl.md) + +#### Parameters + +• **coreManager**: [`CoreManager`](CoreManager.md) + +#### Returns + +[`HyperdriveIndexImpl`](HyperdriveIndexImpl.md) + +#### Overrides + +`TypedEmitter.constructor` + +## Accessors + +### writer + +> `get` **writer**(): [`Hyperdrive`](Hyperdrive.md) + +#### Returns + +[`Hyperdrive`](Hyperdrive.md) + +*** + +### writerKey + +> `get` **writerKey**(): `Buffer` + +#### Returns + +`Buffer` + +## Methods + +### \[iterator\]() + +> **\[iterator\]**(): `MapIterator`\<[`Hyperdrive`](Hyperdrive.md)\> + +#### Returns + +`MapIterator`\<[`Hyperdrive`](Hyperdrive.md)\> + +*** + +### get() + +> **get**(`driveId`): `undefined` \| [`Hyperdrive`](Hyperdrive.md) + +#### Parameters + +• **driveId**: `string` + +#### Returns + +`undefined` \| [`Hyperdrive`](Hyperdrive.md) diff --git a/docs/api/md/-internal-/classes/IconApi.md b/docs/api/md/-internal-/classes/IconApi.md index 7d96b9e1c..cf871d24b 100644 --- a/docs/api/md/-internal-/classes/IconApi.md +++ b/docs/api/md/-internal-/classes/IconApi.md @@ -18,9 +18,9 @@ • **opts.getMediaBaseUrl** -• **opts.iconDataStore**: [`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\> +• **opts.iconDataStore**: [`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\> -• **opts.iconDataType**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"icon"`, `object`, `object`\> +• **opts.iconDataType**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"icon"`, `object`, `object`\> #### Returns diff --git a/docs/api/md/-internal-/classes/MapeoProject.md b/docs/api/md/-internal-/classes/MapeoProject.md index a314c8515..161bf2fdf 100644 --- a/docs/api/md/-internal-/classes/MapeoProject.md +++ b/docs/api/md/-internal-/classes/MapeoProject.md @@ -130,47 +130,47 @@ DataTypes object mappings, used for tests ##### coreOwnership -> **coreOwnership**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"auth"`, `"coreOwnership"` \| `"role"`\>, `SQLiteTableWithColumns`\<`object`\>, `"coreOwnership"`, `object`, `object`\> +> **coreOwnership**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"auth"`, `"role"` \| `"coreOwnership"`\>, `SQLiteTableWithColumns`\<`object`\>, `"coreOwnership"`, `object`, `object`\> ##### deviceInfo -> **deviceInfo**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"deviceInfo"`, `object`, `object`\> +> **deviceInfo**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"deviceInfo"`, `object`, `object`\> ##### field -> **field**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"field"`, `object`, `object`\> +> **field**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"field"`, `object`, `object`\> ##### icon -> **icon**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"icon"`, `object`, `object`\> +> **icon**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"icon"`, `object`, `object`\> ##### observation -> **observation**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> +> **observation**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"track"` \| `"remoteDetectionAlert"` \| `"observation"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> ##### preset -> **preset**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"preset"`, `object`, `object`\> +> **preset**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"preset"`, `object`, `object`\> ##### projectSettings -> **projectSettings**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"projectSettings"`, `object`, `object`\> +> **projectSettings**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"projectSettings"`, `object`, `object`\> ##### remoteDetectionAlert -> **remoteDetectionAlert**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"remoteDetectionAlert"`, `object`, `object`\> +> **remoteDetectionAlert**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"track"` \| `"remoteDetectionAlert"` \| `"observation"`\>, `SQLiteTableWithColumns`\<`object`\>, `"remoteDetectionAlert"`, `object`, `object`\> ##### role -> **role**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"auth"`, `"coreOwnership"` \| `"role"`\>, `SQLiteTableWithColumns`\<`object`\>, `"role"`, `object`, `object`\> +> **role**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"auth"`, `"role"` \| `"coreOwnership"`\>, `SQLiteTableWithColumns`\<`object`\>, `"role"`, `object`, `object`\> ##### track -> **track**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> +> **track**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"track"` \| `"remoteDetectionAlert"` \| `"observation"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> ##### translation -> **translation**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"translation"`, `object`, `object`\> +> **translation**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"translation"`, `object`, `object`\> *** @@ -236,51 +236,51 @@ DataTypes object mappings, used for tests ### field -> `get` **field**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"field"`, `object`, `object`\> +> `get` **field**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"field"`, `object`, `object`\> #### Returns -[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"field"`, `object`, `object`\> +[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"field"`, `object`, `object`\> *** ### observation -> `get` **observation**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> +> `get` **observation**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"track"` \| `"remoteDetectionAlert"` \| `"observation"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> #### Returns -[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> +[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"track"` \| `"remoteDetectionAlert"` \| `"observation"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> *** ### preset -> `get` **preset**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"preset"`, `object`, `object`\> +> `get` **preset**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"preset"`, `object`, `object`\> #### Returns -[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"preset"`, `object`, `object`\> +[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"projectSettings"` \| `"preset"` \| `"icon"` \| `"field"` \| `"deviceInfo"`\>, `SQLiteTableWithColumns`\<`object`\>, `"preset"`, `object`, `object`\> *** ### remoteDetectionAlert -> `get` **remoteDetectionAlert**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"remoteDetectionAlert"`, `object`, `object`\> +> `get` **remoteDetectionAlert**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"track"` \| `"remoteDetectionAlert"` \| `"observation"`\>, `SQLiteTableWithColumns`\<`object`\>, `"remoteDetectionAlert"`, `object`, `object`\> #### Returns -[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"remoteDetectionAlert"`, `object`, `object`\> +[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"track"` \| `"remoteDetectionAlert"` \| `"observation"`\>, `SQLiteTableWithColumns`\<`object`\>, `"remoteDetectionAlert"`, `object`, `object`\> *** ### track -> `get` **track**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> +> `get` **track**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"track"` \| `"remoteDetectionAlert"` \| `"observation"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> #### Returns -[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> +[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"track"` \| `"remoteDetectionAlert"` \| `"observation"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> ## Methods diff --git a/docs/api/md/-internal-/classes/MemberApi.md b/docs/api/md/-internal-/classes/MemberApi.md index 9c1791910..0d4b6f9c9 100644 --- a/docs/api/md/-internal-/classes/MemberApi.md +++ b/docs/api/md/-internal-/classes/MemberApi.md @@ -69,6 +69,10 @@ Can reject with any of the following error codes (accessed via `err.code`): peer. For example, the project must have a name. - `NETWORK_ERROR`: there was an issue connecting to the server. Is the device online? Is the server online? +- `SERVER_HAS_TOO_MANY_PROJECTS`: the server limits the number of projects + it can have, and it's at the limit. +- `PROJECT_NOT_IN_SERVER_ALLOWLIST`: the server only allows specific + projects to be added and ours wasn't one of them. - `INVALID_SERVER_RESPONSE`: we connected to the server but it returned an unexpected response. Is the server running a compatible version of CoMapeo Cloud? diff --git a/docs/api/md/-internal-/classes/PeerSyncController.md b/docs/api/md/-internal-/classes/PeerSyncController.md index 88a50e04d..d4536ec59 100644 --- a/docs/api/md/-internal-/classes/PeerSyncController.md +++ b/docs/api/md/-internal-/classes/PeerSyncController.md @@ -54,11 +54,11 @@ ### syncCapability -> `get` **syncCapability**(): `Record`\<`"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"`, [`SyncCapability`](../type-aliases/SyncCapability.md)\> +> `get` **syncCapability**(): `Record`\<`"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"`, [`SyncCapability`](../type-aliases/SyncCapability.md)\> #### Returns -`Record`\<`"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"`, [`SyncCapability`](../type-aliases/SyncCapability.md)\> +`Record`\<`"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"`, [`SyncCapability`](../type-aliases/SyncCapability.md)\> ## Methods diff --git a/docs/api/md/-internal-/classes/Roles.md b/docs/api/md/-internal-/classes/Roles.md index 602198455..0dd044dd1 100644 --- a/docs/api/md/-internal-/classes/Roles.md +++ b/docs/api/md/-internal-/classes/Roles.md @@ -24,7 +24,7 @@ • **opts.coreOwnership**: [`CoreOwnership`](CoreOwnership.md) -• **opts.dataType**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"auth"`, `"coreOwnership"` \| `"role"`\>, `SQLiteTableWithColumns`\<`object`\>, `"role"`, `object`, `object`\> +• **opts.dataType**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"auth"`, `"role"` \| `"coreOwnership"`\>, `SQLiteTableWithColumns`\<`object`\>, `"role"`, `object`, `object`\> • **opts.deviceKey**: `Buffer` diff --git a/docs/api/md/-internal-/classes/SyncApi.md b/docs/api/md/-internal-/classes/SyncApi.md index 082f2fbce..4318be40f 100644 --- a/docs/api/md/-internal-/classes/SyncApi.md +++ b/docs/api/md/-internal-/classes/SyncApi.md @@ -52,6 +52,42 @@ ## Methods +### \[kAddBlobWantRange\]() + +> **\[kAddBlobWantRange\]**(`peerId`, `start`, `length`): `void` + +Add some blob blocks this peer wants. + +#### Parameters + +• **peerId**: `string` + +• **start**: `number` + +• **length**: `number` + +#### Returns + +`void` + +*** + +### \[kClearBlobWantRanges\]() + +> **\[kClearBlobWantRanges\]**(`peerId`): `void` + +Clear the blob blocks this peer wants. + +#### Parameters + +• **peerId**: `string` + +#### Returns + +`void` + +*** + ### \[kHandleDiscoveryKey\]() > **\[kHandleDiscoveryKey\]**(`discoveryKey`, `protomux`): `void` diff --git a/docs/api/md/-internal-/classes/SyncState.md b/docs/api/md/-internal-/classes/SyncState.md index fb06afe95..96af747d6 100644 --- a/docs/api/md/-internal-/classes/SyncState.md +++ b/docs/api/md/-internal-/classes/SyncState.md @@ -40,6 +40,24 @@ Emit sync state when it changes ## Methods +### addBlobWantRange() + +> **addBlobWantRange**(`peerId`, `start`, `length`): `void` + +#### Parameters + +• **peerId**: `string` + +• **start**: `number` + +• **length**: `number` + +#### Returns + +`void` + +*** + ### addPeer() > **addPeer**(`peerId`): `void` @@ -54,6 +72,20 @@ Emit sync state when it changes *** +### clearBlobWantRanges() + +> **clearBlobWantRanges**(`peerId`): `void` + +#### Parameters + +• **peerId**: `string` + +#### Returns + +`void` + +*** + ### disconnectPeer() > **disconnectPeer**(`peerId`): `void` diff --git a/docs/api/md/-internal-/interfaces/AbstractEncoding.md b/docs/api/md/-internal-/interfaces/AbstractEncoding.md new file mode 100644 index 000000000..625ce2e12 --- /dev/null +++ b/docs/api/md/-internal-/interfaces/AbstractEncoding.md @@ -0,0 +1,39 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / AbstractEncoding + +# Interface: AbstractEncoding\ + +## Type Parameters + +• **T** = `any` + +## Properties + +### decode() + +> **decode**: (`buffer`) => `T` + +#### Parameters + +• **buffer**: `Buffer` + +#### Returns + +`T` + +*** + +### encode() + +> **encode**: (`data`) => `Buffer` + +#### Parameters + +• **data**: `T` + +#### Returns + +`Buffer` diff --git a/docs/api/md/-internal-/interfaces/BlobDownloadEvents.md b/docs/api/md/-internal-/interfaces/BlobDownloadEvents.md deleted file mode 100644 index dab74ecd4..000000000 --- a/docs/api/md/-internal-/interfaces/BlobDownloadEvents.md +++ /dev/null @@ -1,23 +0,0 @@ -[**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-/interfaces/BlobDownloadState.md b/docs/api/md/-internal-/interfaces/BlobDownloadState.md deleted file mode 100644 index 88db35b13..000000000 --- a/docs/api/md/-internal-/interfaces/BlobDownloadState.md +++ /dev/null @@ -1,53 +0,0 @@ -[**API**](../../README.md) • **Docs** - -*** - -[API](../../README.md) / [\](../README.md) / BlobDownloadState - -# Interface: BlobDownloadState - -## Properties - -### error - -> **error**: `null` - -If status = 'error' then this will be an Error object - -*** - -### haveBytes - -> **haveBytes**: `number` - -The bytes already downloaded - -*** - -### haveCount - -> **haveCount**: `number` - -The number of files already downloaded - -*** - -### status - -> **status**: `"checking"` \| `"downloading"` \| `"downloaded"` \| `"aborted"` - -*** - -### wantBytes - -> **wantBytes**: `number` - -The bytes pending download - -*** - -### wantCount - -> **wantCount**: `number` - -The number of files pending download diff --git a/docs/api/md/-internal-/interfaces/HaveMsg.md b/docs/api/md/-internal-/interfaces/HaveMsg.md index 719e145f1..86bd84b63 100644 --- a/docs/api/md/-internal-/interfaces/HaveMsg.md +++ b/docs/api/md/-internal-/interfaces/HaveMsg.md @@ -22,7 +22,7 @@ ### namespace -> **namespace**: `"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` +> **namespace**: `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` *** diff --git a/docs/api/md/-internal-/interfaces/Role.md b/docs/api/md/-internal-/interfaces/Role.md index 216ac2713..37c47c37f 100644 --- a/docs/api/md/-internal-/interfaces/Role.md +++ b/docs/api/md/-internal-/interfaces/Role.md @@ -14,7 +14,7 @@ ### docs -> **docs**: `Record`\<`"observation"` \| `"track"` \| `"remoteDetectionAlert"` \| `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"` \| `"coreOwnership"` \| `"role"`, [`DocCapability`](DocCapability.md)\> +> **docs**: `Record`\<`"translation"` \| `"track"` \| `"role"` \| `"remoteDetectionAlert"` \| `"projectSettings"` \| `"preset"` \| `"observation"` \| `"icon"` \| `"field"` \| `"deviceInfo"` \| `"coreOwnership"`, [`DocCapability`](DocCapability.md)\> *** @@ -38,4 +38,4 @@ ### sync -> **sync**: `Record`\<`"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"`, `"allowed"` \| `"blocked"`\> +> **sync**: `Record`\<`"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"`, `"allowed"` \| `"blocked"`\> diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/README.md b/docs/api/md/-internal-/namespaces/Hyperbee/README.md new file mode 100644 index 000000000..d894c9e44 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/README.md @@ -0,0 +1,24 @@ +[**API**](../../../README.md) • **Docs** + +*** + +[API](../../../README.md) / [\](../../README.md) / Hyperbee + +# Hyperbee + +## Index + +### Interfaces + +- [DelOptions](interfaces/DelOptions.md) +- [DiffStreamEntry](interfaces/DiffStreamEntry.md) +- [DiffStreamOptions](interfaces/DiffStreamOptions.md) +- [GetAndWatchOptions](interfaces/GetAndWatchOptions.md) +- [HeaderOptions](interfaces/HeaderOptions.md) +- [HistoryStreamOptions](interfaces/HistoryStreamOptions.md) +- [HyperbeeEntry](interfaces/HyperbeeEntry.md) +- [HyperbeeOptions](interfaces/HyperbeeOptions.md) +- [PutOptions](interfaces/PutOptions.md) +- [ReadStreamOptions](interfaces/ReadStreamOptions.md) +- [ReadStreamRange](interfaces/ReadStreamRange.md) +- [SubDatabaseOptions](interfaces/SubDatabaseOptions.md) diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/DelOptions.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/DelOptions.md new file mode 100644 index 000000000..1250dcdb0 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/DelOptions.md @@ -0,0 +1,25 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / DelOptions + +# Interface: DelOptions\ + +## Type Parameters + +• **T** = `any` + +## Properties + +### cas()? + +> `optional` **cas**: (`prev`) => `boolean` \| `PromiseLike`\<`boolean`\> + +#### Parameters + +• **prev**: `T` + +#### Returns + +`boolean` \| `PromiseLike`\<`boolean`\> diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/DiffStreamEntry.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/DiffStreamEntry.md new file mode 100644 index 000000000..b2fcdde51 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/DiffStreamEntry.md @@ -0,0 +1,23 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / DiffStreamEntry + +# Interface: DiffStreamEntry\ + +## Type Parameters + +• **T** = `any` + +## Properties + +### left + +> **left**: `T` + +*** + +### right + +> **right**: `T` diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/DiffStreamOptions.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/DiffStreamOptions.md new file mode 100644 index 000000000..68a3b9938 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/DiffStreamOptions.md @@ -0,0 +1,31 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / DiffStreamOptions + +# Interface: DiffStreamOptions + +## Extends + +- [`ReadStreamOptions`](ReadStreamOptions.md) + +## Properties + +### limit? + +> `optional` **limit**: `number` + +#### Inherited from + +[`ReadStreamOptions`](ReadStreamOptions.md).[`limit`](ReadStreamOptions.md#limit) + +*** + +### reverse? + +> `optional` **reverse**: `boolean` + +#### Inherited from + +[`ReadStreamOptions`](ReadStreamOptions.md).[`reverse`](ReadStreamOptions.md#reverse) diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/GetAndWatchOptions.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/GetAndWatchOptions.md new file mode 100644 index 000000000..0eda32721 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/GetAndWatchOptions.md @@ -0,0 +1,19 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / GetAndWatchOptions + +# Interface: GetAndWatchOptions + +## Properties + +### keyEncoding? + +> `optional` **keyEncoding**: `"ascii"` \| `"utf-8"` \| `"binary"` \| `"json"` \| [`AbstractEncoding`](../../../interfaces/AbstractEncoding.md)\<`any`\> + +*** + +### valueEncoding? + +> `optional` **valueEncoding**: `"ascii"` \| `"utf-8"` \| `"binary"` \| `"json"` \| [`AbstractEncoding`](../../../interfaces/AbstractEncoding.md)\<`any`\> diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HeaderOptions.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HeaderOptions.md new file mode 100644 index 000000000..7ade75865 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HeaderOptions.md @@ -0,0 +1,7 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / HeaderOptions + +# Interface: HeaderOptions diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HistoryStreamOptions.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HistoryStreamOptions.md new file mode 100644 index 000000000..daeff4db8 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HistoryStreamOptions.md @@ -0,0 +1,79 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / HistoryStreamOptions + +# Interface: HistoryStreamOptions + +## Extends + +- [`ReadStreamOptions`](ReadStreamOptions.md) + +## Properties + +### encoding? + +> `optional` **encoding**: [`Encoding`](../../../type-aliases/Encoding.md)\<`T`\> + +*** + +### gt? + +> `optional` **gt**: `number` + +*** + +### gte? + +> `optional` **gte**: `number` + +*** + +### keyEncoding? + +> `optional` **keyEncoding**: [`Encoding`](../../../type-aliases/Encoding.md)\<`T`\> + +*** + +### limit? + +> `optional` **limit**: `number` + +#### Inherited from + +[`ReadStreamOptions`](ReadStreamOptions.md).[`limit`](ReadStreamOptions.md#limit) + +*** + +### live? + +> `optional` **live**: `boolean` + +*** + +### lt? + +> `optional` **lt**: `number` + +*** + +### lte? + +> `optional` **lte**: `number` + +*** + +### reverse? + +> `optional` **reverse**: `boolean` + +#### Overrides + +[`ReadStreamOptions`](ReadStreamOptions.md).[`reverse`](ReadStreamOptions.md#reverse) + +*** + +### valueEncoding? + +> `optional` **valueEncoding**: [`Encoding`](../../../type-aliases/Encoding.md)\<`T`\> diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HyperbeeEntry.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HyperbeeEntry.md new file mode 100644 index 000000000..6c8ec8e6f --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HyperbeeEntry.md @@ -0,0 +1,33 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / HyperbeeEntry + +# Interface: HyperbeeEntry\ + +## Extended by + +- [`HyperdriveEntry`](../../Hyperdrive/interfaces/HyperdriveEntry.md) + +## Type Parameters + +• **T** = `any` + +## Properties + +### key + +> **key**: `string` + +*** + +### seq + +> **seq**: `number` + +*** + +### value + +> **value**: `T` diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HyperbeeOptions.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HyperbeeOptions.md new file mode 100644 index 000000000..adb889224 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/HyperbeeOptions.md @@ -0,0 +1,27 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / HyperbeeOptions + +# Interface: HyperbeeOptions\ + +## Extended by + +- [`SubDatabaseOptions`](SubDatabaseOptions.md) + +## Type Parameters + +• **T** = `any` + +## Properties + +### keyEncoding? + +> `optional` **keyEncoding**: [`Encoding`](../../../type-aliases/Encoding.md)\<`T`\> + +*** + +### valueEncoding? + +> `optional` **valueEncoding**: [`Encoding`](../../../type-aliases/Encoding.md)\<`T`\> diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/PutOptions.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/PutOptions.md new file mode 100644 index 000000000..fd5567385 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/PutOptions.md @@ -0,0 +1,27 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / PutOptions + +# Interface: PutOptions\ + +## Type Parameters + +• **T** = `any` + +## Properties + +### cas()? + +> `optional` **cas**: (`prev`, `next`) => `boolean` \| `PromiseLike`\<`boolean`\> + +#### Parameters + +• **prev**: [`HyperbeeEntry`](HyperbeeEntry.md)\<`T`\> + +• **next**: [`HyperbeeEntry`](HyperbeeEntry.md)\<`T`\> + +#### Returns + +`boolean` \| `PromiseLike`\<`boolean`\> diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/ReadStreamOptions.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/ReadStreamOptions.md new file mode 100644 index 000000000..d0933dfc6 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/ReadStreamOptions.md @@ -0,0 +1,24 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / ReadStreamOptions + +# Interface: ReadStreamOptions + +## Extended by + +- [`HistoryStreamOptions`](HistoryStreamOptions.md) +- [`DiffStreamOptions`](DiffStreamOptions.md) + +## Properties + +### limit? + +> `optional` **limit**: `number` + +*** + +### reverse? + +> `optional` **reverse**: `boolean` diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/ReadStreamRange.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/ReadStreamRange.md new file mode 100644 index 000000000..c4d04bc92 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/ReadStreamRange.md @@ -0,0 +1,31 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / ReadStreamRange + +# Interface: ReadStreamRange + +## Properties + +### gt? + +> `optional` **gt**: `string` + +*** + +### gte? + +> `optional` **gte**: `string` + +*** + +### lt? + +> `optional` **lt**: `string` + +*** + +### lte? + +> `optional` **lte**: `string` diff --git a/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/SubDatabaseOptions.md b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/SubDatabaseOptions.md new file mode 100644 index 000000000..c3675354f --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperbee/interfaces/SubDatabaseOptions.md @@ -0,0 +1,37 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperbee](../README.md) / SubDatabaseOptions + +# Interface: SubDatabaseOptions + +## Extends + +- [`HyperbeeOptions`](HyperbeeOptions.md)\<`any`\> + +## Properties + +### keyEncoding? + +> `optional` **keyEncoding**: [`Encoding`](../../../type-aliases/Encoding.md)\<`any`\> + +#### Inherited from + +[`HyperbeeOptions`](HyperbeeOptions.md).[`keyEncoding`](HyperbeeOptions.md#keyencoding) + +*** + +### sep? + +> `optional` **sep**: `Buffer` + +*** + +### valueEncoding? + +> `optional` **valueEncoding**: [`Encoding`](../../../type-aliases/Encoding.md)\<`any`\> + +#### Inherited from + +[`HyperbeeOptions`](HyperbeeOptions.md).[`valueEncoding`](HyperbeeOptions.md#valueencoding) diff --git a/docs/api/md/-internal-/namespaces/Hyperdrive/README-1.md b/docs/api/md/-internal-/namespaces/Hyperdrive/README.md similarity index 77% rename from docs/api/md/-internal-/namespaces/Hyperdrive/README-1.md rename to docs/api/md/-internal-/namespaces/Hyperdrive/README.md index 035b48c93..8010ad379 100644 --- a/docs/api/md/-internal-/namespaces/Hyperdrive/README-1.md +++ b/docs/api/md/-internal-/namespaces/Hyperdrive/README.md @@ -11,3 +11,4 @@ ### Interfaces - [HyperdriveEntry](interfaces/HyperdriveEntry.md) +- [HyperdriveEntryValue](interfaces/HyperdriveEntryValue.md) diff --git a/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntry.md b/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntry.md index 0c37b65db..3c2e6b163 100644 --- a/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntry.md +++ b/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntry.md @@ -2,40 +2,40 @@ *** -[API](../../../../README.md) / [\](../../../README.md) / [Hyperdrive](../README-1.md) / HyperdriveEntry +[API](../../../../README.md) / [\](../../../README.md) / [Hyperdrive](../README.md) / HyperdriveEntry # Interface: HyperdriveEntry +## Extends + +- [`HyperbeeEntry`](../../Hyperbee/interfaces/HyperbeeEntry.md)\<[`HyperdriveEntryValue`](HyperdriveEntryValue.md)\> + ## Properties ### key > **key**: `string` -*** - -### seq +#### Inherited from -> **seq**: `number` +[`HyperbeeEntry`](../../Hyperbee/interfaces/HyperbeeEntry.md).[`key`](../../Hyperbee/interfaces/HyperbeeEntry.md#key) *** -### value - -> **value**: `object` +### seq -#### blob +> **seq**: `number` -> **blob**: [`BlobId`](../../Hyperblobs/interfaces/BlobId.md) +#### Inherited from -#### executable +[`HyperbeeEntry`](../../Hyperbee/interfaces/HyperbeeEntry.md).[`seq`](../../Hyperbee/interfaces/HyperbeeEntry.md#seq) -> **executable**: `boolean` +*** -#### linkname +### value -> **linkname**: `null` \| `string` +> **value**: [`HyperdriveEntryValue`](HyperdriveEntryValue.md) -#### metadata +#### Inherited from -> **metadata**: `JsonValue` +[`HyperbeeEntry`](../../Hyperbee/interfaces/HyperbeeEntry.md).[`value`](../../Hyperbee/interfaces/HyperbeeEntry.md#value) diff --git a/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntryValue.md b/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntryValue.md new file mode 100644 index 000000000..8f7baf743 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntryValue.md @@ -0,0 +1,31 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / [Hyperdrive](../README.md) / HyperdriveEntryValue + +# Interface: HyperdriveEntryValue + +## Properties + +### blob + +> **blob**: [`BlobId`](../../Hyperblobs/interfaces/BlobId.md) + +*** + +### executable + +> **executable**: `boolean` + +*** + +### linkname + +> **linkname**: `null` \| `string` + +*** + +### metadata + +> **metadata**: `JsonValue` diff --git a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_sync_core-sync-state/interfaces/InternalState.md b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_sync_core-sync-state/interfaces/InternalState.md index 9ac7d12cf..3d09ef4ce 100644 --- a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_sync_core-sync-state/interfaces/InternalState.md +++ b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_sync_core-sync-state/interfaces/InternalState.md @@ -24,7 +24,7 @@ Core length, e.g. how many blocks in the core (including blocks that are not dow ### namespace -> **namespace**: `"blob"` \| `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` +> **namespace**: `"auth"` \| `"config"` \| `"data"` \| `"blobIndex"` \| `"blob"` *** diff --git a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_sync_namespace-sync-state/classes/NamespaceSyncState.md b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_sync_namespace-sync-state/classes/NamespaceSyncState.md index efc4fb368..64d7f4def 100644 --- a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_sync_namespace-sync-state/classes/NamespaceSyncState.md +++ b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_sync_namespace-sync-state/classes/NamespaceSyncState.md @@ -62,6 +62,38 @@ Called when a state update is available (via getState()) *** +### addWantRange() + +> **addWantRange**(`peerId`, `start`, `length`): `void` + +#### Parameters + +• **peerId**: `string` + +• **start**: `number` + +• **length**: `number` + +#### Returns + +`void` + +*** + +### clearWantRanges() + +> **clearWantRanges**(`peerId`): `void` + +#### Parameters + +• **peerId**: `string` + +#### Returns + +`void` + +*** + ### disconnectPeer() > **disconnectPeer**(`peerId`): `void` diff --git a/docs/api/md/-internal-/namespaces/hyperdrive/README.md b/docs/api/md/-internal-/namespaces/hyperdrive/README.md deleted file mode 100644 index 0e5af5752..000000000 --- a/docs/api/md/-internal-/namespaces/hyperdrive/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**API**](../../../README.md) • **Docs** - -*** - -[API](../../../README.md) / [\](../../README.md) / "hyperdrive" - -# "hyperdrive" - -## References - -### HyperdriveEntry - -Re-exports [HyperdriveEntry](../Hyperdrive/interfaces/HyperdriveEntry.md) diff --git a/docs/api/md/-internal-/type-aliases/BlobDownloadStateError.md b/docs/api/md/-internal-/type-aliases/BlobDownloadStateError.md deleted file mode 100644 index 0fdcb4675..000000000 --- a/docs/api/md/-internal-/type-aliases/BlobDownloadStateError.md +++ /dev/null @@ -1,21 +0,0 @@ -[**API**](../../README.md) • **Docs** - -*** - -[API](../../README.md) / [\](../README.md) / BlobDownloadStateError - -# Type Alias: BlobDownloadStateError - -> **BlobDownloadStateError**\<\>: `Omit`\<[`BlobDownloadState`](../interfaces/BlobDownloadState.md), `"error"` \| `"status"`\> & `object` - -## Type declaration - -### error - -> **error**: `Error` - -### status - -> **status**: `"error"` - -## Type Parameters diff --git a/docs/api/md/-internal-/type-aliases/BlobStoreEntriesStream.md b/docs/api/md/-internal-/type-aliases/BlobStoreEntriesStream.md new file mode 100644 index 000000000..7fe5c6e05 --- /dev/null +++ b/docs/api/md/-internal-/type-aliases/BlobStoreEntriesStream.md @@ -0,0 +1,17 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / BlobStoreEntriesStream + +# Type Alias: BlobStoreEntriesStream + +> **BlobStoreEntriesStream**: `Readable` & `object` + +## Type declaration + +### \[asyncIterator\]() + +#### Returns + +`AsyncIterableIterator`\<[`HyperdriveEntry`](../namespaces/Hyperdrive/interfaces/HyperdriveEntry.md) & `object`, `any`, `any`\> diff --git a/docs/api/md/-internal-/type-aliases/Encoding.md b/docs/api/md/-internal-/type-aliases/Encoding.md new file mode 100644 index 000000000..6f5ef9ef1 --- /dev/null +++ b/docs/api/md/-internal-/type-aliases/Encoding.md @@ -0,0 +1,13 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / Encoding + +# Type Alias: Encoding\ + +> **Encoding**\<`T`\>: `"binary"` \| `"utf-8"` \| `"ascii"` \| `"json"` \| [`AbstractEncoding`](../interfaces/AbstractEncoding.md)\<`T`\> + +## Type Parameters + +• **T** diff --git a/docs/api/md/-internal-/type-aliases/GenericBlobFilter.md b/docs/api/md/-internal-/type-aliases/GenericBlobFilter.md index 9a058fca0..0782e0b7b 100644 --- a/docs/api/md/-internal-/type-aliases/GenericBlobFilter.md +++ b/docs/api/md/-internal-/type-aliases/GenericBlobFilter.md @@ -6,6 +6,10 @@ # Type Alias: GenericBlobFilter -> **GenericBlobFilter**: `Record`\<`string`, `string`[]\> +> **GenericBlobFilter**\<\>: `object` -Map of blob types to array of blob variants +## Type Parameters + +## Index Signature + + \[`type`: `string`\]: readonly `string`[] diff --git a/docs/api/md/-internal-/type-aliases/InternalDriveEmitter.md b/docs/api/md/-internal-/type-aliases/InternalDriveEmitter.md deleted file mode 100644 index 88f800e12..000000000 --- a/docs/api/md/-internal-/type-aliases/InternalDriveEmitter.md +++ /dev/null @@ -1,25 +0,0 @@ -[**API**](../../README.md) • **Docs** - -*** - -[API](../../README.md) / [\](../README.md) / InternalDriveEmitter - -# Type Alias: InternalDriveEmitter - -> **InternalDriveEmitter**\<\>: `TypedEmitter`\<`object`\> - -## Type declaration - -### add-drive() - -> **add-drive**: (`drive`) => `void` - -#### Parameters - -• **drive**: [`"hyperdrive"`](../namespaces/hyperdrive/README.md) - -#### Returns - -`void` - -## Type Parameters diff --git a/docs/api/md/-internal-/variables/SUPPORTED_BLOB_VARIANTS.md b/docs/api/md/-internal-/variables/SUPPORTED_BLOB_VARIANTS.md index c56a1343f..7222775e1 100644 --- a/docs/api/md/-internal-/variables/SUPPORTED_BLOB_VARIANTS.md +++ b/docs/api/md/-internal-/variables/SUPPORTED_BLOB_VARIANTS.md @@ -8,6 +8,8 @@ > `const` **SUPPORTED\_BLOB\_VARIANTS**: `object` +**`Internal`** + ## Type declaration ### audio diff --git a/package-lock.json b/package-lock.json index 7ec004e9e..8f53e4322 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@comapeo/core", - "version": "2.1.0", + "version": "2.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@comapeo/core", - "version": "2.1.0", + "version": "2.2.0", "license": "MIT", "dependencies": { "@comapeo/fallback-smp": "^1.0.0", diff --git a/package.json b/package.json index dced69c0a..bd833cca8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@comapeo/core", - "version": "2.1.0", + "version": "2.2.0", "description": "Offline p2p mapping library", "main": "src/index.js", "types": "dist/index.d.ts",