@checkstack/notification-discord-backend 0.1.50 → 0.1.52

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,52 @@
1
1
  # @checkstack/notification-discord-backend
2
2
 
3
+ ## 0.1.52
4
+
5
+ ### Patch Changes
6
+
7
+ - @checkstack/notification-backend@1.5.17
8
+
9
+ ## 0.1.51
10
+
11
+ ### Patch Changes
12
+
13
+ - 8cad340: feat(notification-common): shared subject-render helpers
14
+
15
+ Add `renderSubjectsAsPlainText` and `renderSubjectsAsMarkdown` to
16
+ `@checkstack/notification-common` (re-exported from
17
+ `@checkstack/notification-backend`) to single-source the affected-subjects list
18
+ that text/markdown notification channels previously each hand-rolled. Both take
19
+ the typed `NotificationSubject[]`, honor a subject's `status` (emoji prefix via
20
+ `SUBJECT_STATUS_EMOJI`) and `url`, and return an empty string for an empty list.
21
+ `renderSubjectsAsMarkdown` supports `linkStyle: "markdown" | "slack"`, a custom
22
+ `bullet`, and an optional `heading`.
23
+
24
+ `SUBJECT_STATUS_EMOJI` now lives in `notification-common` (single source);
25
+ `@checkstack/notification-backend` re-exports it unchanged, so its public
26
+ surface is stable.
27
+
28
+ The Gotify, Webex, Backstage, Telegram, Discord, and Slack strategy plugins now
29
+ route their subject rendering through these helpers (a behavior-preserving
30
+ change pinned by unit tests), which also gives Gotify/Webex/Backstage the
31
+ consistent status-emoji prefix they previously dropped. Teams (FactSet) and
32
+ Pushover (HTML) keep their structured channel-specific framing.
33
+
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
+ - Updated dependencies [8cad340]
41
+ - Updated dependencies [8cad340]
42
+ - Updated dependencies [8cad340]
43
+ - Updated dependencies [8cad340]
44
+ - Updated dependencies [8cad340]
45
+ - Updated dependencies [8cad340]
46
+ - @checkstack/notification-backend@1.5.16
47
+ - @checkstack/backend-api@0.25.0
48
+ - @checkstack/common@0.17.0
49
+
3
50
  ## 0.1.50
4
51
 
5
52
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/notification-discord-backend",
3
- "version": "0.1.50",
3
+ "version": "0.1.52",
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.1",
22
- "@checkstack/common": "0.16.0",
23
- "@checkstack/notification-backend": "1.5.15",
21
+ "@checkstack/backend-api": "0.25.0",
22
+ "@checkstack/common": "0.17.0",
23
+ "@checkstack/notification-backend": "1.5.17",
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
  }