@checkstack/notification-backstage-backend 0.1.54 → 0.1.55

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # @checkstack/notification-backstage-backend
2
2
 
3
+ ## 0.1.55
4
+
5
+ ### Patch Changes
6
+
7
+ - 8cad340: feat(notification-common): shared subject-render helpers
8
+
9
+ Add `renderSubjectsAsPlainText` and `renderSubjectsAsMarkdown` to
10
+ `@checkstack/notification-common` (re-exported from
11
+ `@checkstack/notification-backend`) to single-source the affected-subjects list
12
+ that text/markdown notification channels previously each hand-rolled. Both take
13
+ the typed `NotificationSubject[]`, honor a subject's `status` (emoji prefix via
14
+ `SUBJECT_STATUS_EMOJI`) and `url`, and return an empty string for an empty list.
15
+ `renderSubjectsAsMarkdown` supports `linkStyle: "markdown" | "slack"`, a custom
16
+ `bullet`, and an optional `heading`.
17
+
18
+ `SUBJECT_STATUS_EMOJI` now lives in `notification-common` (single source);
19
+ `@checkstack/notification-backend` re-exports it unchanged, so its public
20
+ surface is stable.
21
+
22
+ The Gotify, Webex, Backstage, Telegram, Discord, and Slack strategy plugins now
23
+ route their subject rendering through these helpers (a behavior-preserving
24
+ change pinned by unit tests), which also gives Gotify/Webex/Backstage the
25
+ consistent status-emoji prefix they previously dropped. Teams (FactSet) and
26
+ Pushover (HTML) keep their structured channel-specific framing.
27
+
28
+ - Updated dependencies [8cad340]
29
+ - Updated dependencies [8cad340]
30
+ - Updated dependencies [8cad340]
31
+ - Updated dependencies [8cad340]
32
+ - Updated dependencies [8cad340]
33
+ - Updated dependencies [8cad340]
34
+ - Updated dependencies [8cad340]
35
+ - Updated dependencies [8cad340]
36
+ - Updated dependencies [8cad340]
37
+ - Updated dependencies [8cad340]
38
+ - Updated dependencies [8cad340]
39
+ - Updated dependencies [8cad340]
40
+ - @checkstack/notification-backend@1.5.16
41
+ - @checkstack/backend-api@0.25.0
42
+ - @checkstack/common@0.17.0
43
+
3
44
  ## 0.1.54
4
45
 
5
46
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/notification-backstage-backend",
3
- "version": "0.1.54",
3
+ "version": "0.1.55",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "checkstack": {
@@ -15,9 +15,9 @@
15
15
  "pack": "bunx @checkstack/scripts plugin-pack"
16
16
  },
17
17
  "dependencies": {
18
- "@checkstack/backend-api": "0.24.1",
19
- "@checkstack/notification-backend": "1.5.15",
20
- "@checkstack/common": "0.16.0",
18
+ "@checkstack/backend-api": "0.25.0",
19
+ "@checkstack/notification-backend": "1.5.16",
20
+ "@checkstack/common": "0.17.0",
21
21
  "zod": "^4.2.1"
22
22
  },
23
23
  "devDependencies": {
package/src/index.ts CHANGED
@@ -5,7 +5,10 @@ import {
5
5
  configString,
6
6
  markdownToPlainText,
7
7
  } from "@checkstack/backend-api";
8
- import { notificationStrategyExtensionPoint } from "@checkstack/notification-backend";
8
+ import {
9
+ notificationStrategyExtensionPoint,
10
+ renderSubjectsAsMarkdown,
11
+ } from "@checkstack/notification-backend";
9
12
  import { z } from "zod";
10
13
  import { pluginMetadata } from "./plugin-metadata";
11
14
  import { extractErrorMessage } from "@checkstack/common";
@@ -194,14 +197,11 @@ const backstageStrategy: NotificationStrategy<
194
197
  let description = notification.body
195
198
  ? markdownToPlainText(notification.body)
196
199
  : undefined;
197
- const subjects = notification.subjects ?? [];
198
- if (subjects.length > 0) {
199
- const lines = subjects.map((subject) =>
200
- subject.url
201
- ? `- [${subject.name}](${subject.url})`
202
- : `- ${subject.name}`,
203
- );
204
- const block = `**Affected:**\n${lines.join("\n")}`;
200
+ const block = renderSubjectsAsMarkdown({
201
+ subjects: notification.subjects ?? [],
202
+ bullet: "-",
203
+ });
204
+ if (block) {
205
205
  description = description ? `${description}\n\n${block}` : block;
206
206
  }
207
207