@checkstack/notification-discord-backend 0.1.49 → 0.1.51

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,54 @@
1
1
  # @checkstack/notification-discord-backend
2
2
 
3
+ ## 0.1.51
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
+
44
+ ## 0.1.50
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [2ec8f64]
49
+ - @checkstack/backend-api@0.24.1
50
+ - @checkstack/notification-backend@1.5.15
51
+
3
52
  ## 0.1.49
4
53
 
5
54
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/notification-discord-backend",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "checkstack": {
@@ -18,9 +18,9 @@
18
18
  "pack": "bunx @checkstack/scripts plugin-pack"
19
19
  },
20
20
  "dependencies": {
21
- "@checkstack/backend-api": "0.24.0",
22
- "@checkstack/common": "0.16.0",
23
- "@checkstack/notification-backend": "1.5.14",
21
+ "@checkstack/backend-api": "0.25.0",
22
+ "@checkstack/common": "0.17.0",
23
+ "@checkstack/notification-backend": "1.5.16",
24
24
  "zod": "^4.2.1"
25
25
  },
26
26
  "devDependencies": {
package/src/index.ts CHANGED
@@ -12,8 +12,8 @@ import {
12
12
  import {
13
13
  notificationStrategyExtensionPoint,
14
14
  postJson,
15
- SUBJECT_STATUS_EMOJI,
16
15
  IMPORTANCE_EMOJI,
16
+ renderSubjectsAsMarkdown,
17
17
  } from "@checkstack/notification-backend";
18
18
  import { pluginMetadata } from "./plugin-metadata";
19
19
 
@@ -112,16 +112,7 @@ function buildDiscordEmbed(options: DiscordEmbedOptions): DiscordEmbed {
112
112
  // status with a colored circle when present.
113
113
  fields.push({
114
114
  name: "Affected",
115
- value: subjects
116
- .map((subject) => {
117
- const prefix = subject.status
118
- ? `${SUBJECT_STATUS_EMOJI[subject.status]} `
119
- : "• ";
120
- return subject.url
121
- ? `${prefix}[${subject.name}](${subject.url})`
122
- : `${prefix}${subject.name}`;
123
- })
124
- .join("\n"),
115
+ value: renderSubjectsAsMarkdown({ subjects, heading: null }),
125
116
  inline: false,
126
117
  });
127
118
  }