API • Docs
API / <internal> / MapeoProject
TypedEmitter
new MapeoProject(
opts
):MapeoProject
• opts
• opts.coreStorage: CoreStorage
Folder to store all hypercore data
• opts.dbPath: string
Path to store project sqlite db. Use :memory:
for memory storage
• opts.encryptionKeys: EncryptionKeys
Encryption keys for each namespace
• opts.getMediaBaseUrl
• opts.isArchiveDevice: boolean
Whether this device is an archive device
• opts.keyManager: KeyManager
mapeo/crypto KeyManager instance
• opts.localPeers: LocalPeers
• opts.logger: undefined
| Logger
• opts.projectKey: Buffer
32-byte public key of the project creator core
• opts.projectMigrationsFolder: string
path for drizzle migration folder for project
• opts.projectSecretKey: undefined
| Buffer
32-byte secret key of the project creator core
• opts.sharedDb: BetterSQLite3Database
<Record
<string
, never
>>
• opts.sharedIndexWriter: IndexWriter
<MapeoDocTables
>
TypedEmitter.constructor
$blobs:
BlobApi
static
EMPTY_PROJECT_SETTINGS:Readonly
<object
>
get
[kBlobStore]():BlobStore
get
[kCoreManager]():CoreManager
CoreManager instance, used for tests
get
[kCoreOwnership]():CoreOwnership
CoreOwnership instance, used for tests
get
[kDataTypes]():object
DataTypes object mappings, used for tests
object
coreOwnership:
DataType
<DataStore
<"auth"
,"coreOwnership"
|"role"
>,SQLiteTableWithColumns
<object
>,"coreOwnership"
,object
,object
>
deviceInfo:
DataType
<DataStore
<"config"
,"translation"
|"preset"
|"field"
|"projectSettings"
|"deviceInfo"
|"icon"
>,SQLiteTableWithColumns
<object
>,"deviceInfo"
,object
,object
>
field:
DataType
<DataStore
<"config"
,"translation"
|"preset"
|"field"
|"projectSettings"
|"deviceInfo"
|"icon"
>,SQLiteTableWithColumns
<object
>,"field"
,object
,object
>
icon:
DataType
<DataStore
<"config"
,"translation"
|"preset"
|"field"
|"projectSettings"
|"deviceInfo"
|"icon"
>,SQLiteTableWithColumns
<object
>,"icon"
,object
,object
>
observation:
DataType
<DataStore
<"data"
,"observation"
|"track"
|"remoteDetectionAlert"
>,SQLiteTableWithColumns
<object
>,"observation"
,object
,object
>
preset:
DataType
<DataStore
<"config"
,"translation"
|"preset"
|"field"
|"projectSettings"
|"deviceInfo"
|"icon"
>,SQLiteTableWithColumns
<object
>,"preset"
,object
,object
>
projectSettings:
DataType
<DataStore
<"config"
,"translation"
|"preset"
|"field"
|"projectSettings"
|"deviceInfo"
|"icon"
>,SQLiteTableWithColumns
<object
>,"projectSettings"
,object
,object
>
remoteDetectionAlert:
DataType
<DataStore
<"data"
,"observation"
|"track"
|"remoteDetectionAlert"
>,SQLiteTableWithColumns
<object
>,"remoteDetectionAlert"
,object
,object
>
role:
DataType
<DataStore
<"auth"
,"coreOwnership"
|"role"
>,SQLiteTableWithColumns
<object
>,"role"
,object
,object
>
track:
DataType
<DataStore
<"data"
,"observation"
|"track"
|"remoteDetectionAlert"
>,SQLiteTableWithColumns
<object
>,"track"
,object
,object
>
translation:
DataType
<DataStore
<"config"
,"translation"
|"preset"
|"field"
|"projectSettings"
|"deviceInfo"
|"icon"
>,SQLiteTableWithColumns
<object
>,"translation"
,object
,object
>
get
[kIsArchiveDevice]():boolean
boolean
get
$icons():IconApi
get
$member():MemberApi
get
$sync():SyncApi
get
$translation():default
get
deviceId():string
string
get
field():DataType
<DataStore
<"config"
,"translation"
|"preset"
|"field"
|"projectSettings"
|"deviceInfo"
|"icon"
>,SQLiteTableWithColumns
<object
>,"field"
,object
,object
>
DataType
<DataStore
<"config"
, "translation"
| "preset"
| "field"
| "projectSettings"
| "deviceInfo"
| "icon"
>, SQLiteTableWithColumns
<object
>, "field"
, object
, object
>
get
observation():DataType
<DataStore
<"data"
,"observation"
|"track"
|"remoteDetectionAlert"
>,SQLiteTableWithColumns
<object
>,"observation"
,object
,object
>
DataType
<DataStore
<"data"
, "observation"
| "track"
| "remoteDetectionAlert"
>, SQLiteTableWithColumns
<object
>, "observation"
, object
, object
>
get
preset():DataType
<DataStore
<"config"
,"translation"
|"preset"
|"field"
|"projectSettings"
|"deviceInfo"
|"icon"
>,SQLiteTableWithColumns
<object
>,"preset"
,object
,object
>
DataType
<DataStore
<"config"
, "translation"
| "preset"
| "field"
| "projectSettings"
| "deviceInfo"
| "icon"
>, SQLiteTableWithColumns
<object
>, "preset"
, object
, object
>
get
remoteDetectionAlert():DataType
<DataStore
<"data"
,"observation"
|"track"
|"remoteDetectionAlert"
>,SQLiteTableWithColumns
<object
>,"remoteDetectionAlert"
,object
,object
>
DataType
<DataStore
<"data"
, "observation"
| "track"
| "remoteDetectionAlert"
>, SQLiteTableWithColumns
<object
>, "remoteDetectionAlert"
, object
, object
>
get
track():DataType
<DataStore
<"data"
,"observation"
|"track"
|"remoteDetectionAlert"
>,SQLiteTableWithColumns
<object
>,"track"
,object
,object
>
DataType
<DataStore
<"data"
, "observation"
| "track"
| "remoteDetectionAlert"
>, SQLiteTableWithColumns
<object
>, "track"
, object
, object
>
[kClearDataIfLeft]():
Promise
<void
>
Clear data if we've left the project. No-op if you're still in the project.
Promise
<void
>
[kProjectLeave]():
Promise
<void
>
Promise
<void
>
[kProjectReplicate](
isInitiatorOrStream
):ReplicationStream
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.
• isInitiatorOrStream: boolean
| Duplex
| Duplex
<any
, any
, any
, any
, true
, true
, DuplexEvents
<any
, any
>>
[kSetIsArchiveDevice](
isArchiveDevice
):Promise
<void
>
• isArchiveDevice: boolean
Promise
<void
>
[kSetOwnDeviceInfo](
value
):Promise
<object
>
• value: Pick
<object
, "name"
| "deviceType"
| "selfHostedServerDetails"
>
Promise
<object
>
$getOwnRole():
Promise
<Role
<"a12a6702b93bd7ff"
|"f7c150f5a3a9a855"
|"012fd2d431c0bf60"
|"9e6d29263cba36c9"
|"8ced989b1904606b"
|"08e4251e36f6e7ed"
>>
Promise
<Role
<"a12a6702b93bd7ff"
| "f7c150f5a3a9a855"
| "012fd2d431c0bf60"
| "9e6d29263cba36c9"
| "8ced989b1904606b"
| "08e4251e36f6e7ed"
>>
$getProjectSettings():
Promise
<EditableProjectSettings
>
Promise
<EditableProjectSettings
>
$originalVersionIdToDeviceId(
originalVersionId
):Promise
<string
>
• originalVersionId: string
The originalVersionId
from a document.
Promise
<string
>
The device ID for this creator.
When device ID cannot be found.
$setProjectSettings(
settings
):Promise
<EditableProjectSettings
>
• settings: Partial
<EditableProjectSettings
>
Promise
<EditableProjectSettings
>
close():
Promise
<void
>
Promise
<void
>
importConfig(
opts
):Promise
<Error
[]>
• opts
• opts.configPath: string
Promise
<Error
[]>
ready():
Promise
<void
>
Resolves when hypercores have all loaded
Promise
<void
>