Skip to content

basalt / comments/src / Comments

Class: Comments ​

Defined in: comments/src/comments.ts:148

Per-resource comment threads with @mentions and resolve/reopen, scoped by tenant. Emits hooks (comment:created, comment:mentioned, …) so live updates (@basaltkit/realtime) and notifications wire up without coupling.

Constructors ​

Constructor ​

> new Comments(options?, tenancyActive?): Comments

Defined in: comments/src/comments.ts:157

Parameters ​

options? ​

CommentsOptions = {}

tenancyActive? ​

() => boolean

Whether the host app registered @basaltkit/tenancy. commentsPlugin wires this to the container's 'tenancy:active' metadata marker — a signal, not an import, so this generic package never depends on the opt-in SaaS layer. Defaults to false (single-tenant).

Returns ​

Comments

Methods ​

edit() ​

> edit(id, body, tenantId?): Promise<Comment>

Defined in: comments/src/comments.ts:189

Parameters ​

id ​

string

body ​

string

tenantId? ​

string

Returns ​

Promise<Comment>


get() ​

> get(id, tenantId?): Promise<Comment | null>

Defined in: comments/src/comments.ts:185

Parameters ​

id ​

string

tenantId? ​

string

Returns ​

Promise<Comment | null>


on() ​

> on(resourceType, resourceId, tenantId?): ResourceComments

Defined in: comments/src/comments.ts:176

Parameters ​

resourceType ​

string

resourceId ​

string

tenantId? ​

string

Returns ​

ResourceComments


remove() ​

> remove(id, tenantId?): Promise<void>

Defined in: comments/src/comments.ts:198

Parameters ​

id ​

string

tenantId? ​

string

Returns ​

Promise<void>


reopen() ​

> reopen(id, tenantId?): Promise<Comment>

Defined in: comments/src/comments.ts:217

Parameters ​

id ​

string

tenantId? ​

string

Returns ​

Promise<Comment>


resolve() ​

> resolve(id, resolvedBy, tenantId?): Promise<Comment>

Defined in: comments/src/comments.ts:211

Parameters ​

id ​

string

resolvedBy ​

string

tenantId? ​

string

Returns ​

Promise<Comment>

Released under the MIT License.