@ssdev-toolkit/nestjs-comment
v1.0.0
Published
Comments and @-mentions attached to host entity types. HTTP API plus mention notification port.
Readme
@ssdev-toolkit/nestjs-comment
Comments and @-mentions attached to host entity types. HTTP API plus mention notification port.
Install
npm install @ssdev-toolkit/nestjs-core @ssdev-toolkit/nestjs-commentThe host registers ICommentRepository and should provide ICommentEntityAccessPort so comments are restricted by record-level access. Optional COMMENT_NOTIFICATION_PORT for mention / “comment added” outbound notices.
What it does
CommentModule.forRoot- CRUD + thread parent checks
- Mention events (
CommentMentionEvent) - Allowed entity types via
CommentModuleOptions
Without ICommentEntityAccessPort, any authenticated user with the comment permission can act on any entityType / entityId — the module logs a startup warning.
Usage
CommentModule.forRoot({
allowedEntityTypes: [{ entityType: 'donation', /* permissions */ }],
});Integrate with correspondence by implementing ICommentNotificationPort in the host.
Build (this repo)
npm run build -w @ssdev-toolkit/nestjs-commentOverview: root README.
