Skip to content

DesignNodeModel

Defined in: packages/core/src/models/design-nodes.ts:53

Cache of design file/node metadata and node renders with TTL refresh.

new DesignNodeModel(db, credentials, providers, options?): DesignNodeModel

Defined in: packages/core/src/models/design-nodes.ts:62

DatabaseAdapter

DesignCredentialModel

readonly DesignProvider[]

ConnectionModel

Members’ own connections, used when the project has no credential.

Logger

StorageAdapter

DesignNodeTables

DesignNodeModel

cachedFor(projectId, urls, viewerId?): Promise<Map<string, DesignNode>>

Defined in: packages/core/src/models/design-nodes.ts:103

Cached rows for the given design URLs, keyed by URL (unparseable or uncached URLs are absent). A row fetched with someone’s own connection is only visible to that viewer.

string

readonly string[]

string

Promise<Map<string, DesignNode>>


get(projectId, id): Promise<DesignNode | null>

Defined in: packages/core/src/models/design-nodes.ts:89

Cached row by id, scoped to the project, or null.

string

string

Promise<DesignNode | null>


readRender(node): Promise<Buffer<ArrayBufferLike> | null>

Defined in: packages/core/src/models/design-nodes.ts:95

Cached render bytes of a node, or null when it has none (or storage is not wired).

DesignNode

Promise<Buffer<ArrayBufferLike> | null>


refresh(projectId, url, now?, viewerId?): Promise<DesignNode | null>

Defined in: packages/core/src/models/design-nodes.ts:121

Refresh one link (see refreshMany); null for unsupported URLs or nothing cached.

string

string

Date

string

Promise<DesignNode | null>


refreshMany(projectId, urls, options?): Promise<Map<string, DesignNode | null>>

Defined in: packages/core/src/models/design-nodes.ts:140

Refresh the given links’ metadata and renders when missing or past the TTL. Links of one file share one metadata call and one render call, and files run with bounded concurrency. Transient failures keep the previous cache; auth failures update the credential’s health. Never throws.

string

readonly string[]

RefreshOptions = {}

Promise<Map<string, DesignNode | null>>