@rwdocs/backstage-plugin-rw-backend 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -49,8 +49,7 @@ class CommentEventPublisher {
|
|
|
49
49
|
async publishOwnerSide(row, actorRef) {
|
|
50
50
|
const section = await this.sections.getSection(row.site_ref, row.section_ref);
|
|
51
51
|
if (!section || !section.entity_owner_ref) return;
|
|
52
|
-
const recipients = [section.entity_owner_ref]
|
|
53
|
-
if (recipients.length === 0) return;
|
|
52
|
+
const recipients = [section.entity_owner_ref];
|
|
54
53
|
const subpath = types.subpathOf(row.page_ref);
|
|
55
54
|
const viewerPath = mapping.joinNonEmpty([section.section_path, subpath], "/");
|
|
56
55
|
const actorName = author.authorFromRow(row).name;
|
|
@@ -67,8 +66,7 @@ class CommentEventPublisher {
|
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
68
|
async publishParticipantSide(kind, row, rootId, actorRef, resolvedActorName) {
|
|
70
|
-
const
|
|
71
|
-
const recipients = participants.filter((ref) => ref !== actorRef);
|
|
69
|
+
const recipients = await this.comments.participantsOf(rootId);
|
|
72
70
|
if (recipients.length === 0) return;
|
|
73
71
|
const section = await this.sections.getSection(row.site_ref, row.section_ref);
|
|
74
72
|
const subpath = types.subpathOf(row.page_ref);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentEventPublisher.cjs.js","sources":["../../src/comments/CommentEventPublisher.ts"],"sourcesContent":["import { LoggerService } from \"@backstage/backend-plugin-api\";\nimport { parseEntityRef } from \"@backstage/catalog-model\";\nimport { EventsService } from \"@backstage/plugin-events-node\";\nimport {\n RW_COMMENTS_TOPIC,\n CommentEventPayload,\n CommentEventAudience,\n buildCommentDeepLinkSuffix,\n} from \"@rwdocs/backstage-plugin-rw-common\";\nimport { SectionsReader } from \"../siteIndex/SectionsReader\";\nimport { PagesReader } from \"../siteIndex/PagesReader\";\nimport { snippetFromHtml } from \"../inbox/snippet\";\nimport { joinNonEmpty } from \"../inbox/mapping\";\nimport { CommentStore } from \"./CommentStore\";\nimport { authorFromRow } from \"./author\";\nimport { CommentRow, subpathOf } from \"./types\";\n\n/** Publishes self-contained `rw.comments` domain events after a comment write commits.\n * Owns recipient + deep-link resolution (it has the comments + sections tables) so the\n * notifications module can stay a thin sender. Best-effort: every method catches and\n * logs, and always resolves, so a publish failure can never affect the comment write.\n * Callers invoke fire-and-forget. */\nexport class CommentEventPublisher {\n private readonly events: EventsService;\n private readonly sections: SectionsReader;\n private readonly comments: CommentStore;\n private readonly logger: LoggerService;\n private readonly pages: PagesReader;\n\n constructor(deps: {\n events: EventsService;\n sections: SectionsReader;\n comments: CommentStore;\n logger: LoggerService;\n pages: PagesReader;\n }) {\n this.events = deps.events;\n this.sections = deps.sections;\n this.comments = deps.comments;\n this.logger = deps.logger;\n this.pages = deps.pages;\n }\n\n async onCommentCreated(row: CommentRow, actorRef: string): Promise<void> {\n try {\n if (row.parent_id === null) {\n await this.publishOwnerSide(row, actorRef);\n } else {\n await this.publishParticipantSide(\"created\", row, row.parent_id, actorRef);\n }\n } catch (error) {\n this.logger.warn(`rw.comments publish (created) failed: ${error}`);\n }\n }\n\n async onCommentResolved(row: CommentRow, actorRef: string, actorName?: string): Promise<void> {\n try {\n // resolve only happens on top-level rows, so the row IS the thread root.\n await this.publishParticipantSide(\"resolved\", row, row.id, actorRef, actorName);\n } catch (error) {\n this.logger.warn(`rw.comments publish (resolved) failed: ${error}`);\n }\n }\n\n private async resolvePageTitle(\n siteRef: string,\n sectionRef: string,\n subpath: string,\n ): Promise<string | null> {\n try {\n return await this.pages.getTitle(siteRef, sectionRef, subpath);\n } catch (err) {\n this.logger.warn(`rw.comments: could not resolve page title: ${err}`);\n return null;\n }\n }\n\n private async publishOwnerSide(row: CommentRow, actorRef: string): Promise<void> {\n const section = await this.sections.getSection(row.site_ref, row.section_ref);\n if (!section || !section.entity_owner_ref) return; // new/unowned section: inbox catches it\n const recipients = [section.entity_owner_ref].filter((ref) => ref !== actorRef);\n if (recipients.length === 0) return;\n const subpath = subpathOf(row.page_ref);\n const viewerPath = joinNonEmpty([section.section_path, subpath], \"/\");\n const actorName = authorFromRow(row).name;\n const [pageTitle, sectionTitle] = await Promise.all([\n this.resolvePageTitle(row.site_ref, row.section_ref, subpath),\n this.resolvePageTitle(row.site_ref, row.section_ref, \"\"),\n ]);\n await this.publish(\"created\", \"owner\", row, row.id, recipients, actorRef, {\n entityRef: section.entity_ref,\n viewerPath,\n actorName,\n pageTitle,\n sectionTitle,\n });\n }\n\n private async publishParticipantSide(\n kind: \"created\" | \"resolved\",\n row: CommentRow,\n rootId: string,\n actorRef: string,\n resolvedActorName?: string,\n ): Promise<void> {\n // participantsOf already returns distinct refs, so no extra dedup is needed here.\n const participants = await this.comments.participantsOf(rootId);\n const recipients = participants.filter((ref) => ref !== actorRef);\n if (recipients.length === 0) return;\n // The section row provides entityRef (link target) + section_path (path prefix); degrade gracefully if absent: entityRef -> null (module emits no link), viewerPath -> bare subpath.\n const section = await this.sections.getSection(row.site_ref, row.section_ref);\n const subpath = subpathOf(row.page_ref);\n const viewerPath = section ? joinNonEmpty([section.section_path, subpath], \"/\") : subpath;\n const actorName =\n kind === \"resolved\"\n ? (resolvedActorName ?? parseEntityRef(actorRef).name)\n : authorFromRow(row).name;\n const [pageTitle, sectionTitle] = await Promise.all([\n this.resolvePageTitle(row.site_ref, row.section_ref, subpath),\n this.resolvePageTitle(row.site_ref, row.section_ref, \"\"),\n ]);\n await this.publish(kind, \"participants\", row, rootId, recipients, actorRef, {\n entityRef: section?.entity_ref ?? null,\n viewerPath,\n actorName,\n pageTitle,\n sectionTitle,\n });\n }\n\n private async publish(\n kind: \"created\" | \"resolved\",\n audience: CommentEventAudience,\n row: CommentRow,\n rootId: string,\n recipients: string[],\n actorRef: string,\n link: {\n entityRef: string | null;\n viewerPath: string;\n actorName: string;\n pageTitle: string | null;\n sectionTitle: string | null;\n },\n ): Promise<void> {\n const eventPayload: CommentEventPayload = {\n kind,\n audience,\n occurredAt: new Date().toISOString(),\n commentId: row.id,\n rootId,\n parentId: row.parent_id,\n siteRef: row.site_ref,\n sectionRef: row.section_ref,\n pageRef: row.page_ref,\n actorRef,\n recipients,\n entityRef: link.entityRef,\n // Anchor on the thread root, not the triggering row: a reply notification\n // should open the whole thread (rootId === row.id for top-level + resolve events).\n deepLinkSuffix: buildCommentDeepLinkSuffix({\n viewerPath: link.viewerPath,\n commentId: rootId,\n }),\n bodySnippet: snippetFromHtml(row.body_html),\n actorName: link.actorName,\n pageTitle: link.pageTitle,\n sectionTitle: link.sectionTitle,\n };\n await this.events.publish({ topic: RW_COMMENTS_TOPIC, eventPayload });\n }\n}\n"],"names":["subpathOf","joinNonEmpty","authorFromRow","parseEntityRef","buildCommentDeepLinkSuffix","snippetFromHtml","RW_COMMENTS_TOPIC"],"mappings":";;;;;;;;;AAsBO,MAAM,qBAAA,CAAsB;AAAA,EAChB,MAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EAEjB,YAAY,IAAA,EAMT;AACD,IAAA,IAAA,CAAK,SAAS,IAAA,CAAK,MAAA;AACnB,IAAA,IAAA,CAAK,WAAW,IAAA,CAAK,QAAA;AACrB,IAAA,IAAA,CAAK,WAAW,IAAA,CAAK,QAAA;AACrB,IAAA,IAAA,CAAK,SAAS,IAAA,CAAK,MAAA;AACnB,IAAA,IAAA,CAAK,QAAQ,IAAA,CAAK,KAAA;AAAA,EACpB;AAAA,EAEA,MAAM,gBAAA,CAAiB,GAAA,EAAiB,QAAA,EAAiC;AACvE,IAAA,IAAI;AACF,MAAA,IAAI,GAAA,CAAI,cAAc,IAAA,EAAM;AAC1B,QAAA,MAAM,IAAA,CAAK,gBAAA,CAAiB,GAAA,EAAK,QAAQ,CAAA;AAAA,MAC3C,CAAA,MAAO;AACL,QAAA,MAAM,KAAK,sBAAA,CAAuB,SAAA,EAAW,GAAA,E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,MACA,UAAA;AAAA,MACA,WAAW,IAAA,CAAK,SAAA;AAAA;AAAA;AAAA,MAGhB,gBAAgBE,kDAAA,CAA2B;AAAA,QACzC,YAAY,IAAA,CAAK,UAAA;AAAA,QACjB,SAAA,EAAW;AAAA,OACZ,CAAA;AAAA,MACD,WAAA,EAAaC,uBAAA,CAAgB,GAAA,CAAI,SAAS,CAAA;AAAA,MAC1C,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,cAAc,IAAA,CAAK;AAAA,KACrB;AACA,IAAA,MAAM,KAAK,MAAA,CAAO,OAAA,CAAQ,EAAE,KAAA,EAAOC,yCAAA,EAAmB,cAAc,CAAA;AAAA,EACtE;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CommentEventPublisher.cjs.js","sources":["../../src/comments/CommentEventPublisher.ts"],"sourcesContent":["import { LoggerService } from \"@backstage/backend-plugin-api\";\nimport { parseEntityRef } from \"@backstage/catalog-model\";\nimport { EventsService } from \"@backstage/plugin-events-node\";\nimport {\n RW_COMMENTS_TOPIC,\n CommentEventPayload,\n CommentEventAudience,\n buildCommentDeepLinkSuffix,\n} from \"@rwdocs/backstage-plugin-rw-common\";\nimport { SectionsReader } from \"../siteIndex/SectionsReader\";\nimport { PagesReader } from \"../siteIndex/PagesReader\";\nimport { snippetFromHtml } from \"../inbox/snippet\";\nimport { joinNonEmpty } from \"../inbox/mapping\";\nimport { CommentStore } from \"./CommentStore\";\nimport { authorFromRow } from \"./author\";\nimport { CommentRow, subpathOf } from \"./types\";\n\n/** Publishes self-contained `rw.comments` domain events after a comment write commits.\n * Owns recipient + deep-link resolution from the comments + sections tables, so the\n * notifications module stays a thin sender. `recipients` are the raw section owner / thread\n * participants and may include the actor; actor exclusion is done entirely subscriber-side via\n * `excludeEntityRef` (see CommentNotifier), which the recipient resolver applies after expanding\n * groups — the one place that also catches an actor who owns the section through a group.\n * Best-effort: every method catches and logs, and always resolves, so a publish failure can\n * never affect the comment write. Callers invoke fire-and-forget. */\nexport class CommentEventPublisher {\n private readonly events: EventsService;\n private readonly sections: SectionsReader;\n private readonly comments: CommentStore;\n private readonly logger: LoggerService;\n private readonly pages: PagesReader;\n\n constructor(deps: {\n events: EventsService;\n sections: SectionsReader;\n comments: CommentStore;\n logger: LoggerService;\n pages: PagesReader;\n }) {\n this.events = deps.events;\n this.sections = deps.sections;\n this.comments = deps.comments;\n this.logger = deps.logger;\n this.pages = deps.pages;\n }\n\n async onCommentCreated(row: CommentRow, actorRef: string): Promise<void> {\n try {\n if (row.parent_id === null) {\n await this.publishOwnerSide(row, actorRef);\n } else {\n await this.publishParticipantSide(\"created\", row, row.parent_id, actorRef);\n }\n } catch (error) {\n this.logger.warn(`rw.comments publish (created) failed: ${error}`);\n }\n }\n\n async onCommentResolved(row: CommentRow, actorRef: string, actorName?: string): Promise<void> {\n try {\n // resolve only happens on top-level rows, so the row IS the thread root.\n await this.publishParticipantSide(\"resolved\", row, row.id, actorRef, actorName);\n } catch (error) {\n this.logger.warn(`rw.comments publish (resolved) failed: ${error}`);\n }\n }\n\n private async resolvePageTitle(\n siteRef: string,\n sectionRef: string,\n subpath: string,\n ): Promise<string | null> {\n try {\n return await this.pages.getTitle(siteRef, sectionRef, subpath);\n } catch (err) {\n this.logger.warn(`rw.comments: could not resolve page title: ${err}`);\n return null;\n }\n }\n\n private async publishOwnerSide(row: CommentRow, actorRef: string): Promise<void> {\n const section = await this.sections.getSection(row.site_ref, row.section_ref);\n if (!section || !section.entity_owner_ref) return; // new/unowned section: inbox catches it\n // Actor left in even when they own the section; excluded at delivery (see class doc).\n const recipients = [section.entity_owner_ref];\n const subpath = subpathOf(row.page_ref);\n const viewerPath = joinNonEmpty([section.section_path, subpath], \"/\");\n const actorName = authorFromRow(row).name;\n const [pageTitle, sectionTitle] = await Promise.all([\n this.resolvePageTitle(row.site_ref, row.section_ref, subpath),\n this.resolvePageTitle(row.site_ref, row.section_ref, \"\"),\n ]);\n await this.publish(\"created\", \"owner\", row, row.id, recipients, actorRef, {\n entityRef: section.entity_ref,\n viewerPath,\n actorName,\n pageTitle,\n sectionTitle,\n });\n }\n\n private async publishParticipantSide(\n kind: \"created\" | \"resolved\",\n row: CommentRow,\n rootId: string,\n actorRef: string,\n resolvedActorName?: string,\n ): Promise<void> {\n // participantsOf returns distinct refs (no extra dedup); the actor is left in and excluded\n // at delivery (see class doc).\n const recipients = await this.comments.participantsOf(rootId);\n if (recipients.length === 0) return; // defensive: thread with no live participants (e.g. root deleted)\n // The section row provides entityRef (link target) + section_path (path prefix); degrade gracefully if absent: entityRef -> null (module emits no link), viewerPath -> bare subpath.\n const section = await this.sections.getSection(row.site_ref, row.section_ref);\n const subpath = subpathOf(row.page_ref);\n const viewerPath = section ? joinNonEmpty([section.section_path, subpath], \"/\") : subpath;\n const actorName =\n kind === \"resolved\"\n ? (resolvedActorName ?? parseEntityRef(actorRef).name)\n : authorFromRow(row).name;\n const [pageTitle, sectionTitle] = await Promise.all([\n this.resolvePageTitle(row.site_ref, row.section_ref, subpath),\n this.resolvePageTitle(row.site_ref, row.section_ref, \"\"),\n ]);\n await this.publish(kind, \"participants\", row, rootId, recipients, actorRef, {\n entityRef: section?.entity_ref ?? null,\n viewerPath,\n actorName,\n pageTitle,\n sectionTitle,\n });\n }\n\n private async publish(\n kind: \"created\" | \"resolved\",\n audience: CommentEventAudience,\n row: CommentRow,\n rootId: string,\n recipients: string[],\n actorRef: string,\n link: {\n entityRef: string | null;\n viewerPath: string;\n actorName: string;\n pageTitle: string | null;\n sectionTitle: string | null;\n },\n ): Promise<void> {\n const eventPayload: CommentEventPayload = {\n kind,\n audience,\n occurredAt: new Date().toISOString(),\n commentId: row.id,\n rootId,\n parentId: row.parent_id,\n siteRef: row.site_ref,\n sectionRef: row.section_ref,\n pageRef: row.page_ref,\n actorRef,\n recipients,\n entityRef: link.entityRef,\n // Anchor on the thread root, not the triggering row: a reply notification\n // should open the whole thread (rootId === row.id for top-level + resolve events).\n deepLinkSuffix: buildCommentDeepLinkSuffix({\n viewerPath: link.viewerPath,\n commentId: rootId,\n }),\n bodySnippet: snippetFromHtml(row.body_html),\n actorName: link.actorName,\n pageTitle: link.pageTitle,\n sectionTitle: link.sectionTitle,\n };\n await this.events.publish({ topic: RW_COMMENTS_TOPIC, eventPayload });\n }\n}\n"],"names":["subpathOf","joinNonEmpty","authorFromRow","parseEntityRef","buildCommentDeepLinkSuffix","snippetFromHtml","RW_COMMENTS_TOPIC"],"mappings":";;;;;;;;;AAyBO,MAAM,qBAAA,CAAsB;AAAA,EAChB,MAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EAEjB,YAAY,IAAA,EAMT;AACD,IAAA,IAAA,CAAK,SAAS,IAAA,CAAK,MAAA;AACnB,IAAA,IAAA,CAAK,WAAW,IAAA,CAAK,QAAA;AACrB,IAAA,IAAA,CAAK,WAAW,IAAA,CAAK,QAAA;AACrB,IAAA,IAAA,CAAK,SAAS,IAAA,CAAK,MAAA;AACnB,IAAA,IAAA,CAAK,QAAQ,IAAA,CAAK,KAAA;AAAA,EACpB;AAAA,EAEA,MAAM,gBAAA,CAAiB,GAAA,EAAiB,QAAA,EAAiC;AACvE,IAAA,IAAI;AACF,MAAA,IAAI,GAAA,CAAI,cAAc,IAAA,EAAM;AAC1B,QAAA,MAAM,IAAA,CAAK,gBAAA,CAAiB,GAAA,EAAK,QAAQ,CAAA;AAAA,MAC3C,CAAA,MAAO;AACL,QAAA,MAAM,KAAK,sBAAA,CAAuB,SAAA,EAAW,GAAA,EAAK,GAAA,CAAI,WAAW,QAAQ,CAAA;AAAA,MAC3E;AAAA,IACF,SAAS,KAAA,EAAO;AACd,MAAA,IAAA,CAAK,MAAA,CAAO,IAAA,CAAK,CAAA,sCAAA,EAAyC,KAAK,CAAA,CAAE,CAAA;AAAA,IACnE;AAAA,EACF;AAAA,EAEA,MAAM,iBAAA,CAAkB,GAAA,EAAiB,QAAA,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,CAAA;AAAA,EACtE;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rwdocs/backstage-plugin-rw-backend",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"license": "MIT OR Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@backstage/plugin-permission-common": "^0.9.9",
|
|
62
62
|
"@backstage/plugin-permission-node": "^0.11.1",
|
|
63
63
|
"@backstage/types": "^1.2.2",
|
|
64
|
-
"@rwdocs/backstage-plugin-rw-common": "^0.1.
|
|
64
|
+
"@rwdocs/backstage-plugin-rw-common": "^0.1.7",
|
|
65
65
|
"@rwdocs/core": "^0.1.28",
|
|
66
66
|
"express": "^4.21.0",
|
|
67
67
|
"express-promise-router": "^4.1.0",
|