From 5128b1a42a4b5cbe540de6e406e1e48302d5b3dd Mon Sep 17 00:00:00 2001 From: EvanHahn Date: Thu, 31 Oct 2024 21:50:38 +0000 Subject: [PATCH] Release v2.1.0 --- docs/api/md/-internal-/README.md | 2 +- docs/api/md/-internal-/classes/BlobStore.md | 4 +- docs/api/md/-internal-/classes/CoreManager.md | 16 +++++ docs/api/md/-internal-/classes/DataStore.md | 22 ++---- .../api/md/-internal-/classes/MapeoProject.md | 65 ++++++++++++++---- docs/api/md/-internal-/classes/MemberApi.md | 41 +++++++++++ docs/api/md/-internal-/classes/SyncApi.md | 56 +++++++++++++++ .../md/-internal-/interfaces/MemberInfo.md | 6 ++ docs/api/md/-internal-/interfaces/Role.md | 2 +- .../Hyperdrive/interfaces/HyperdriveEntry.md | 2 +- .../README.md | 2 +- ...iceInfoTable.md => deviceSettingsTable.md} | 6 +- .../README.md | 2 + .../remoteDetectionAlertBacklinkTable.md | 9 +++ .../variables/remoteDetectionAlertTable.md | 9 +++ .../type-aliases/ArrayAtLeastOne.md | 13 ---- .../md/-internal-/type-aliases/BlobFilter.md | 2 +- .../type-aliases/GenericBlobFilter.md | 11 +++ .../-internal-/variables/NAMESPACE_SCHEMAS.md | 2 +- docs/api/md/README.md | 1 + docs/api/md/classes/MapeoManager.md | 68 ++++++++++--------- docs/api/md/functions/replicateProject.md | 19 ++++++ package-lock.json | 4 +- package.json | 2 +- 24 files changed, 278 insertions(+), 88 deletions(-) rename docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/variables/{localDeviceInfoTable.md => deviceSettingsTable.md} (54%) create mode 100644 docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/variables/remoteDetectionAlertBacklinkTable.md create mode 100644 docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/variables/remoteDetectionAlertTable.md delete mode 100644 docs/api/md/-internal-/type-aliases/ArrayAtLeastOne.md create mode 100644 docs/api/md/-internal-/type-aliases/GenericBlobFilter.md create mode 100644 docs/api/md/functions/replicateProject.md diff --git a/docs/api/md/-internal-/README.md b/docs/api/md/-internal-/README.md index 78149f5ad..28766977c 100644 --- a/docs/api/md/-internal-/README.md +++ b/docs/api/md/-internal-/README.md @@ -91,7 +91,6 @@ ### Type Aliases -- [ArrayAtLeastOne](type-aliases/ArrayAtLeastOne.md) - [BitField](type-aliases/BitField.md) - [BlobDownloadStateError](type-aliases/BlobDownloadStateError.md) - [BlobFilter](type-aliases/BlobFilter.md) @@ -109,6 +108,7 @@ - [DeviceInfoParam](type-aliases/DeviceInfoParam.md) - [EditableProjectSettings](type-aliases/EditableProjectSettings.md) - [ElementOf](type-aliases/ElementOf.md) +- [GenericBlobFilter](type-aliases/GenericBlobFilter.md) - [GetMapeoDocTables](type-aliases/GetMapeoDocTables.md) - [HypercorePeer](type-aliases/HypercorePeer.md) - [HypercoreRemoteBitfield](type-aliases/HypercoreRemoteBitfield.md) diff --git a/docs/api/md/-internal-/classes/BlobStore.md b/docs/api/md/-internal-/classes/BlobStore.md index 38b8b3681..710f53dd2 100644 --- a/docs/api/md/-internal-/classes/BlobStore.md +++ b/docs/api/md/-internal-/classes/BlobStore.md @@ -117,7 +117,7 @@ Set to `true` to wait for a blob to download, otherwise will throw if blob is no • **options?** -• **options.metadata?**: `undefined` \| `object` +• **options.metadata?**: `undefined` \| `JsonObject` Metadata to store with the blob @@ -244,7 +244,7 @@ Hyperdrive entry • **options?** -• **options.metadata?**: `undefined` \| `object` +• **options.metadata?**: `undefined` \| `JsonObject` Metadata to store with the blob diff --git a/docs/api/md/-internal-/classes/CoreManager.md b/docs/api/md/-internal-/classes/CoreManager.md index 999f18a34..6a7f1627d 100644 --- a/docs/api/md/-internal-/classes/CoreManager.md +++ b/docs/api/md/-internal-/classes/CoreManager.md @@ -240,3 +240,19 @@ Resolves when all cores have finished loading #### Returns `Promise`\<`void`\> + +*** + +### sendDownloadIntents() + +> **sendDownloadIntents**(`blobFilter`, `peer`): `void` + +#### Parameters + +• **blobFilter**: [`BlobFilter`](../type-aliases/BlobFilter.md) + +• **peer**: [`HypercorePeer`](../type-aliases/HypercorePeer.md) + +#### Returns + +`void` diff --git a/docs/api/md/-internal-/classes/DataStore.md b/docs/api/md/-internal-/classes/DataStore.md index bb64ca4a6..3e495aafc 100644 --- a/docs/api/md/-internal-/classes/DataStore.md +++ b/docs/api/md/-internal-/classes/DataStore.md @@ -32,6 +32,8 @@ • **opts.namespace**: `TNamespace` +• **opts.reindex**: `boolean` + • **opts.storage**: `StorageParam` #### Returns @@ -66,11 +68,11 @@ ### schemas -> `get` **schemas**(): (`"observation"` \| `"track"`)[] \| (`"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`)[] \| (`"coreOwnership"` \| `"role"`)[] +> `get` **schemas**(): (`"observation"` \| `"track"` \| `"remoteDetectionAlert"`)[] \| (`"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`)[] \| (`"coreOwnership"` \| `"role"`)[] #### Returns -(`"observation"` \| `"track"`)[] \| (`"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`)[] \| (`"coreOwnership"` \| `"role"`)[] +(`"observation"` \| `"track"` \| `"remoteDetectionAlert"`)[] \| (`"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`)[] \| (`"coreOwnership"` \| `"role"`)[] *** @@ -94,16 +96,6 @@ *** -### getIndexState() - -> **getIndexState**(): `IndexState` - -#### Returns - -`IndexState` - -*** - ### read() > **read**(`versionId`): `Promise`\<`MapeoDoc`\> @@ -146,7 +138,7 @@ Unlink all index files. This should only be called after `close()` has resolved. ### write() -> **write**\<`TDoc`\>(`doc`): `Promise`\<`Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\>\> +> **write**\<`TDoc`\>(`doc`): `Promise`\<`Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\>\> UNSAFE: Does not check links: [] refer to a valid doc - should only be used internally. @@ -156,7 +148,7 @@ this DataStore. #### Type Parameters -• **TDoc** *extends* `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object` & `CoreOwnershipSignatures`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object` & `CoreOwnershipSignatures`, `"versionId"`\> +• **TDoc** *extends* `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object` & `CoreOwnershipSignatures`, `"versionId"` \| `"originalVersionId"` \| `"links"`\> & `object` \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object`, `"versionId"`\> \| `object` & `Omit`\<`object` & `CoreOwnershipSignatures`, `"versionId"`\> #### Parameters @@ -164,7 +156,7 @@ this DataStore. #### Returns -`Promise`\<`Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\>\> +`Promise`\<`Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\> \| `Extract`\<`object`, `TDoc`\>\> *** diff --git a/docs/api/md/-internal-/classes/MapeoProject.md b/docs/api/md/-internal-/classes/MapeoProject.md index e9768a583..a314c8515 100644 --- a/docs/api/md/-internal-/classes/MapeoProject.md +++ b/docs/api/md/-internal-/classes/MapeoProject.md @@ -34,6 +34,10 @@ Encryption keys for each namespace • **opts.getMediaBaseUrl** +• **opts.isArchiveDevice**: `boolean` + +Whether this device is an archive device + • **opts.keyManager**: `KeyManager` mapeo/crypto KeyManager instance @@ -142,7 +146,7 @@ DataTypes object mappings, used for tests ##### observation -> **observation**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> +> **observation**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> ##### preset @@ -152,13 +156,17 @@ DataTypes object mappings, used for tests > **projectSettings**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"config"`, `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"`\>, `SQLiteTableWithColumns`\<`object`\>, `"projectSettings"`, `object`, `object`\> +##### remoteDetectionAlert + +> **remoteDetectionAlert**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"remoteDetectionAlert"`, `object`, `object`\> + ##### role > **role**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"auth"`, `"coreOwnership"` \| `"role"`\>, `SQLiteTableWithColumns`\<`object`\>, `"role"`, `object`, `object`\> ##### track -> **track**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> +> **track**: [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> ##### translation @@ -166,6 +174,16 @@ DataTypes object mappings, used for tests *** +### \[kIsArchiveDevice\] + +> `get` **\[kIsArchiveDevice\]**(): `boolean` + +#### Returns + +`boolean` + +*** + ### $icons > `get` **$icons**(): [`IconApi`](IconApi.md) @@ -228,11 +246,11 @@ DataTypes object mappings, used for tests ### observation -> `get` **observation**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> +> `get` **observation**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> #### Returns -[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> +[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"observation"`, `object`, `object`\> *** @@ -246,13 +264,23 @@ DataTypes object mappings, used for tests *** +### remoteDetectionAlert + +> `get` **remoteDetectionAlert**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"remoteDetectionAlert"`, `object`, `object`\> + +#### Returns + +[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"remoteDetectionAlert"`, `object`, `object`\> + +*** + ### track -> `get` **track**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> +> `get` **track**(): [`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> #### Returns -[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> +[`DataType`](DataType.md)\<[`DataStore`](DataStore.md)\<`"data"`, `"observation"` \| `"track"` \| `"remoteDetectionAlert"`\>, `SQLiteTableWithColumns`\<`object`\>, `"track"`, `object`, `object`\> ## Methods @@ -280,22 +308,33 @@ Clear data if we've left the project. No-op if you're still in the project. ### \[kProjectReplicate\]() -> **\[kProjectReplicate\]**(`stream`): `Duplex`\<`any`, `any`, `any`, `any`, `true`, `true`, `DuplexEvents`\<`any`, `any`\>\> & `object` & [`Protomux`](Protomux.md)\<`Duplex`\<`any`, `any`, `any`, `any`, `true`, `true`, `DuplexEvents`\<`any`, `any`\>\>\> +> **\[kProjectReplicate\]**(`isInitiatorOrStream`): [`ReplicationStream`](../type-aliases/ReplicationStream.md) Replicate a project to a @hyperswarm/secret-stream. Invites will not function because the RPC channel is not connected for project replication, -and only this project will replicate (to replicate multiple projects you -need to replicate the manager instance via manager[kManagerReplicate]) +and only this project will replicate. #### Parameters -• **stream**: [`Protomux`](Protomux.md)\<`Duplex`\<`any`, `any`, `any`, `any`, `true`, `true`, `DuplexEvents`\<`any`, `any`\>\>\> +• **isInitiatorOrStream**: `boolean` \| `Duplex` \| `Duplex`\<`any`, `any`, `any`, `any`, `true`, `true`, `DuplexEvents`\<`any`, `any`\>\> + +#### Returns + +[`ReplicationStream`](../type-aliases/ReplicationStream.md) -A duplex stream, a @hyperswarm/secret-stream, or a Protomux instance +*** + +### \[kSetIsArchiveDevice\]() + +> **\[kSetIsArchiveDevice\]**(`isArchiveDevice`): `Promise`\<`void`\> + +#### Parameters + +• **isArchiveDevice**: `boolean` #### Returns -`Duplex`\<`any`, `any`, `any`, `any`, `true`, `true`, `DuplexEvents`\<`any`, `any`\>\> & `object` & [`Protomux`](Protomux.md)\<`Duplex`\<`any`, `any`, `any`, `any`, `true`, `true`, `DuplexEvents`\<`any`, `any`\>\>\> +`Promise`\<`void`\> *** @@ -305,7 +344,7 @@ A duplex stream, a @hyperswarm/secret-stream, or a Protomux instance #### Parameters -• **value**: `Pick`\<`object`, `"name"` \| `"deviceType"`\> +• **value**: `Pick`\<`object`, `"name"` \| `"deviceType"` \| `"selfHostedServerDetails"`\> #### Returns diff --git a/docs/api/md/-internal-/classes/MemberApi.md b/docs/api/md/-internal-/classes/MemberApi.md index 841614c83..9c1791910 100644 --- a/docs/api/md/-internal-/classes/MemberApi.md +++ b/docs/api/md/-internal-/classes/MemberApi.md @@ -34,12 +34,18 @@ public key of this device as hex string • **opts.encryptionKeys**: `EncryptionKeys` +• **opts.getProjectName** + +• **opts.getReplicationStream** + • **opts.projectKey**: `Buffer` • **opts.roles**: [`Roles`](Roles.md) • **opts.rpc**: [`LocalPeers`](LocalPeers.md) +• **opts.waitForInitialSyncWithPeer** + #### Returns [`MemberApi`](MemberApi.md) @@ -50,6 +56,41 @@ public key of this device as hex string ## Methods +### addServerPeer() + +> **addServerPeer**(`baseUrl`, `options`?): `Promise`\<`void`\> + +Add a server peer. + +Can reject with any of the following error codes (accessed via `err.code`): + +- `INVALID_URL`: the base URL is invalid, likely due to user error. +- `MISSING_DATA`: some required data is missing in order to add the server + 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? +- `INVALID_SERVER_RESPONSE`: we connected to the server but it returned + an unexpected response. Is the server running a compatible version of + CoMapeo Cloud? + +If `err.code` is not specified, that indicates a bug in this module. + +#### Parameters + +• **baseUrl**: `string` + +• **options?** = `{}` + +• **options.dangerouslyAllowInsecureConnections?**: `undefined` \| `boolean` = `false` + +Allow insecure network connections. Should only be used in tests. + +#### Returns + +`Promise`\<`void`\> + +*** + ### assignRole() > **assignRole**(`deviceId`, `roleId`): `Promise`\<`void`\> diff --git a/docs/api/md/-internal-/classes/SyncApi.md b/docs/api/md/-internal-/classes/SyncApi.md index 016ff9dfd..082f2fbce 100644 --- a/docs/api/md/-internal-/classes/SyncApi.md +++ b/docs/api/md/-internal-/classes/SyncApi.md @@ -20,10 +20,16 @@ • **opts** +• **opts.blobDownloadFilter**: `null` \| [`BlobFilter`](../type-aliases/BlobFilter.md) + • **opts.coreManager**: [`CoreManager`](CoreManager.md) • **opts.coreOwnership**: [`CoreOwnership`](CoreOwnership.md) +• **opts.getReplicationStream** + +• **opts.getServerWebsocketUrls** + • **opts.logger**: `undefined` \| [`Logger`](Logger.md) • **opts.roles**: [`Roles`](Roles.md) @@ -86,6 +92,56 @@ Rescind any requests for a full stop. *** +### \[kSetBlobDownloadFilter\]() + +> **\[kSetBlobDownloadFilter\]**(`blobDownloadFilter`): `void` + +#### Parameters + +• **blobDownloadFilter**: `null` \| [`BlobFilter`](../type-aliases/BlobFilter.md) + +#### Returns + +`void` + +*** + +### \[kWaitForInitialSyncWithPeer\]() + +> **\[kWaitForInitialSyncWithPeer\]**(`deviceId`, `abortSignal`): `Promise`\<`void`\> + +#### Parameters + +• **deviceId**: `string` + +• **abortSignal**: `AbortSignal` + +#### Returns + +`Promise`\<`void`\> + +*** + +### connectServers() + +> **connectServers**(): `void` + +#### Returns + +`void` + +*** + +### disconnectServers() + +> **disconnectServers**(): `void` + +#### Returns + +`void` + +*** + ### getState() > **getState**(): [`State`](../interfaces/State.md) diff --git a/docs/api/md/-internal-/interfaces/MemberInfo.md b/docs/api/md/-internal-/interfaces/MemberInfo.md index 2f19c3213..63dbc99b6 100644 --- a/docs/api/md/-internal-/interfaces/MemberInfo.md +++ b/docs/api/md/-internal-/interfaces/MemberInfo.md @@ -35,3 +35,9 @@ ### role > **role**: [`Role`](Role.md)\<`"a12a6702b93bd7ff"` \| `"f7c150f5a3a9a855"` \| `"012fd2d431c0bf60"` \| `"9e6d29263cba36c9"` \| `"8ced989b1904606b"` \| `"08e4251e36f6e7ed"`\> + +*** + +### selfHostedServerDetails + +> **selfHostedServerDetails**: `undefined` \| `object` diff --git a/docs/api/md/-internal-/interfaces/Role.md b/docs/api/md/-internal-/interfaces/Role.md index c56a2f617..216ac2713 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"` \| `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"` \| `"coreOwnership"` \| `"role"`, [`DocCapability`](DocCapability.md)\> +> **docs**: `Record`\<`"observation"` \| `"track"` \| `"remoteDetectionAlert"` \| `"translation"` \| `"preset"` \| `"field"` \| `"projectSettings"` \| `"deviceInfo"` \| `"icon"` \| `"coreOwnership"` \| `"role"`, [`DocCapability`](DocCapability.md)\> *** diff --git a/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntry.md b/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntry.md index a9eacc431..0c37b65db 100644 --- a/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntry.md +++ b/docs/api/md/-internal-/namespaces/Hyperdrive/interfaces/HyperdriveEntry.md @@ -38,4 +38,4 @@ #### metadata -> **metadata**: `null` \| `object` +> **metadata**: `JsonValue` diff --git a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/README.md b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/README.md index 9d4a5f05d..e3c08cf00 100644 --- a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/README.md +++ b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/README.md @@ -14,7 +14,7 @@ ### Variables -- [localDeviceInfoTable](variables/localDeviceInfoTable.md) +- [deviceSettingsTable](variables/deviceSettingsTable.md) - [projectBacklinkTable](variables/projectBacklinkTable.md) - [projectKeysTable](variables/projectKeysTable.md) - [projectSettingsTable](variables/projectSettingsTable.md) diff --git a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/variables/localDeviceInfoTable.md b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/variables/deviceSettingsTable.md similarity index 54% rename from docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/variables/localDeviceInfoTable.md rename to docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/variables/deviceSettingsTable.md index eeaa1bb35..dd95cb77f 100644 --- a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/variables/localDeviceInfoTable.md +++ b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_client/variables/deviceSettingsTable.md @@ -2,8 +2,8 @@ *** -[API](../../../../README.md) / [\](../../../README.md) / ["/home/runner/work/comapeo-core/comapeo-core/src/schema/client"](../README.md) / localDeviceInfoTable +[API](../../../../README.md) / [\](../../../README.md) / ["/home/runner/work/comapeo-core/comapeo-core/src/schema/client"](../README.md) / deviceSettingsTable -# Variable: localDeviceInfoTable +# Variable: deviceSettingsTable -> `const` **localDeviceInfoTable**: `SQLiteTableWithColumns`\<`object`\> +> `const` **deviceSettingsTable**: `SQLiteTableWithColumns`\<`object`\> diff --git a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/README.md b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/README.md index 9997edccc..fd892afd4 100644 --- a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/README.md +++ b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/README.md @@ -23,6 +23,8 @@ - [observationTable](variables/observationTable.md) - [presetBacklinkTable](variables/presetBacklinkTable.md) - [presetTable](variables/presetTable.md) +- [remoteDetectionAlertBacklinkTable](variables/remoteDetectionAlertBacklinkTable.md) +- [remoteDetectionAlertTable](variables/remoteDetectionAlertTable.md) - [roleBacklinkTable](variables/roleBacklinkTable.md) - [roleTable](variables/roleTable.md) - [trackBacklinkTable](variables/trackBacklinkTable.md) diff --git a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/variables/remoteDetectionAlertBacklinkTable.md b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/variables/remoteDetectionAlertBacklinkTable.md new file mode 100644 index 000000000..0502c6d83 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/variables/remoteDetectionAlertBacklinkTable.md @@ -0,0 +1,9 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / ["/home/runner/work/comapeo-core/comapeo-core/src/schema/project"](../README.md) / remoteDetectionAlertBacklinkTable + +# Variable: remoteDetectionAlertBacklinkTable + +> `const` **remoteDetectionAlertBacklinkTable**: `SQLiteTableWithColumns`\<`object`\> diff --git a/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/variables/remoteDetectionAlertTable.md b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/variables/remoteDetectionAlertTable.md new file mode 100644 index 000000000..9b55b46a4 --- /dev/null +++ b/docs/api/md/-internal-/namespaces/home_runner_work_comapeo-core_comapeo-core_src_schema_project/variables/remoteDetectionAlertTable.md @@ -0,0 +1,9 @@ +[**API**](../../../../README.md) • **Docs** + +*** + +[API](../../../../README.md) / [\](../../../README.md) / ["/home/runner/work/comapeo-core/comapeo-core/src/schema/project"](../README.md) / remoteDetectionAlertTable + +# Variable: remoteDetectionAlertTable + +> `const` **remoteDetectionAlertTable**: `SQLiteTableWithColumns`\<`object`\> diff --git a/docs/api/md/-internal-/type-aliases/ArrayAtLeastOne.md b/docs/api/md/-internal-/type-aliases/ArrayAtLeastOne.md deleted file mode 100644 index 22c34b59f..000000000 --- a/docs/api/md/-internal-/type-aliases/ArrayAtLeastOne.md +++ /dev/null @@ -1,13 +0,0 @@ -[**API**](../../README.md) • **Docs** - -*** - -[API](../../README.md) / [\](../README.md) / ArrayAtLeastOne - -# Type Alias: ArrayAtLeastOne\ - -> **ArrayAtLeastOne**\<`T`\>: [`T`, `...T[]`] - -## Type Parameters - -• **T** diff --git a/docs/api/md/-internal-/type-aliases/BlobFilter.md b/docs/api/md/-internal-/type-aliases/BlobFilter.md index 41260e255..07b115fb0 100644 --- a/docs/api/md/-internal-/type-aliases/BlobFilter.md +++ b/docs/api/md/-internal-/type-aliases/BlobFilter.md @@ -6,4 +6,4 @@ # Type Alias: BlobFilter -> **BlobFilter**: `RequireAtLeastOne`\<`{ [KeyType in BlobType]: ArrayAtLeastOne> }`\> +> **BlobFilter**: `RequireAtLeastOne`\<`{ [KeyType in BlobType]: BlobVariant[] }`\> diff --git a/docs/api/md/-internal-/type-aliases/GenericBlobFilter.md b/docs/api/md/-internal-/type-aliases/GenericBlobFilter.md new file mode 100644 index 000000000..9a058fca0 --- /dev/null +++ b/docs/api/md/-internal-/type-aliases/GenericBlobFilter.md @@ -0,0 +1,11 @@ +[**API**](../../README.md) • **Docs** + +*** + +[API](../../README.md) / [\](../README.md) / GenericBlobFilter + +# Type Alias: GenericBlobFilter + +> **GenericBlobFilter**: `Record`\<`string`, `string`[]\> + +Map of blob types to array of blob variants diff --git a/docs/api/md/-internal-/variables/NAMESPACE_SCHEMAS.md b/docs/api/md/-internal-/variables/NAMESPACE_SCHEMAS.md index 056e3d985..73892a062 100644 --- a/docs/api/md/-internal-/variables/NAMESPACE_SCHEMAS.md +++ b/docs/api/md/-internal-/variables/NAMESPACE_SCHEMAS.md @@ -20,4 +20,4 @@ ### data -> `readonly` **data**: readonly [`"observation"`, `"track"`] +> `readonly` **data**: readonly [`"observation"`, `"track"`, `"remoteDetectionAlert"`] diff --git a/docs/api/md/README.md b/docs/api/md/README.md index 5591a5b56..9c634664d 100644 --- a/docs/api/md/README.md +++ b/docs/api/md/README.md @@ -20,3 +20,4 @@ ## Functions - [CoMapeoMapsFastifyPlugin](functions/CoMapeoMapsFastifyPlugin.md) +- [replicateProject](functions/replicateProject.md) diff --git a/docs/api/md/classes/MapeoManager.md b/docs/api/md/classes/MapeoManager.md index cdf2033b3..ead93d734 100644 --- a/docs/api/md/classes/MapeoManager.md +++ b/docs/api/md/classes/MapeoManager.md @@ -68,18 +68,6 @@ path for drizzle migrations folder for project database ## Accessors -### \[kRPC\] - -> `get` **\[kRPC\]**(): [`LocalPeers`](../-internal-/classes/LocalPeers.md) - -MapeoRPC instance, used for tests - -#### Returns - -[`LocalPeers`](../-internal-/classes/LocalPeers.md) - -*** - ### deviceId > `get` **deviceId**(): `string` @@ -100,26 +88,6 @@ MapeoRPC instance, used for tests ## Methods -### \[kManagerReplicate\]() - -> **\[kManagerReplicate\]**(`isInitiator`): [`ReplicationStream`](../-internal-/type-aliases/ReplicationStream.md) - -Create a Mapeo replication stream. This replication connects the Mapeo RPC -channel and allows invites. All active projects will sync automatically to -this replication stream. Only use for local (trusted) connections, because -the RPC channel key is public. To sync a specific project without -connecting RPC, use project[kProjectReplication]. - -#### Parameters - -• **isInitiator**: `boolean` - -#### Returns - -[`ReplicationStream`](../-internal-/type-aliases/ReplicationStream.md) - -*** - ### addProject() > **addProject**(`projectJoinDetails`, `opts`?): `Promise`\<`string`\> @@ -134,7 +102,7 @@ downloaded their proof of project membership and the project config. • **opts?** = `{}` -For internal use in tests, set opts.waitForSync = false to not wait for sync during addProject() +Set opts.waitForSync = false to not wait for sync during addProject() • **opts.waitForSync?**: `boolean` = `true` @@ -194,6 +162,22 @@ Project public id *** +### getIsArchiveDevice() + +> **getIsArchiveDevice**(): `boolean` + +Get whether this device is an archive device. Archive devices will download +all media during sync, where-as non-archive devices will not download media +original variants, and only download preview and thumbnail variants. + +#### Returns + +`boolean` + +isArchiveDevice + +*** + ### getMapStyleJsonUrl() > **getMapStyleJsonUrl**(): `Promise`\<`string`\> @@ -306,6 +290,24 @@ Will undo the effects of `onBackgrounded`. *** +### setIsArchiveDevice() + +> **setIsArchiveDevice**(`isArchiveDevice`): `void` + +Set whether this device is an archive device. Archive devices will download +all media during sync, where-as non-archive devices will not download media +original variants, and only download preview and thumbnail variants. + +#### Parameters + +• **isArchiveDevice**: `boolean` + +#### Returns + +`void` + +*** + ### startLocalPeerDiscoveryServer() > **startLocalPeerDiscoveryServer**(): `Promise`\<`object`\> diff --git a/docs/api/md/functions/replicateProject.md b/docs/api/md/functions/replicateProject.md new file mode 100644 index 000000000..4f1e78c9b --- /dev/null +++ b/docs/api/md/functions/replicateProject.md @@ -0,0 +1,19 @@ +[**API**](../README.md) • **Docs** + +*** + +[API](../README.md) / replicateProject + +# Function: replicateProject() + +> **replicateProject**(`project`, ...`args`): [`ReplicationStream`](../-internal-/type-aliases/ReplicationStream.md) + +## Parameters + +• **project**: [`MapeoProject`](../-internal-/classes/MapeoProject.md) + +• ...**args**: [`boolean` \| `Duplex` \| `Duplex`\<`any`, `any`, `any`, `any`, `true`, `true`, `DuplexEvents`\<`any`, `any`\>\>] + +## Returns + +[`ReplicationStream`](../-internal-/type-aliases/ReplicationStream.md) diff --git a/package-lock.json b/package-lock.json index 37ef0fc3d..6389b75bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@comapeo/core", - "version": "2.0.1", + "version": "2.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@comapeo/core", - "version": "2.0.1", + "version": "2.1.0", "license": "MIT", "dependencies": { "@comapeo/fallback-smp": "^1.0.0", diff --git a/package.json b/package.json index fee337a09..2384cbe32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@comapeo/core", - "version": "2.0.1", + "version": "2.1.0", "description": "Offline p2p mapping library", "main": "src/index.js", "types": "dist/index.d.ts",