@checkstack/notification-teams-backend 0.0.35 → 0.0.37
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 +43 -0
- package/package.json +4 -4
- package/src/index.ts +12 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @checkstack/notification-teams-backend
|
|
2
2
|
|
|
3
|
+
## 0.0.37
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a06b899: Dead-code audit cleanup and a small platform of shared notification helpers.
|
|
8
|
+
|
|
9
|
+
**Removed (dead code)**
|
|
10
|
+
|
|
11
|
+
- `core/backend/src/plugin-manager/deregistration-guard.ts` deleted. The exported `assertCanDeregister()` was never called and was a less-complete version of the dependents+isUninstallable checks already done inline by `previewUninstallOriginator` / `uninstallOriginator` in `plugin-manager-orchestrator.ts`.
|
|
12
|
+
- `createMockQueueFactory` deprecated alias removed from `@checkstack/test-utils-backend`. Use `createMockQueueManager` directly.
|
|
13
|
+
|
|
14
|
+
**New shared helpers**
|
|
15
|
+
|
|
16
|
+
- `@checkstack/backend-api` now exports `requestTimeoutMs()` — a Zod field builder for outbound HTTP request timeouts (1s..60s, default 10s). Replaces hand-rolled `configNumber({}).min(1000).max(60_000).default(10_000)` in `integration-webhook-backend`, `integration-script-backend`, and `healthcheck-script-backend`'s inline collector.
|
|
17
|
+
- `@checkstack/notification-common` now exports `SubjectStatusSchema` / `SubjectStatus`, mirroring the existing `ImportanceSchema`.
|
|
18
|
+
- `@checkstack/notification-backend` now exports:
|
|
19
|
+
- `SUBJECT_STATUS_EMOJI` / `IMPORTANCE_EMOJI` — the shared status / importance emoji maps that Discord, Slack, Teams, Webex and Telegram previously each redefined inline.
|
|
20
|
+
- `postJson(opts)` — a timeout-bounded `fetch` wrapper that handles non-2xx logging and error mapping for webhook-style POSTs. Returns `{ ok: true, response } | { ok: false, error }`.
|
|
21
|
+
|
|
22
|
+
**Migrated to shared helpers**
|
|
23
|
+
|
|
24
|
+
- Discord, Slack, Gotify, Pushover notification backends now use `postJson`. Outer try/catch + per-plugin error mapping deleted (~140 LOC).
|
|
25
|
+
- Discord, Slack, Teams, Telegram, Webex notification backends now use `IMPORTANCE_EMOJI`. Discord, Slack, Teams use `SUBJECT_STATUS_EMOJI`.
|
|
26
|
+
- Teams, Webex, Backstage, Telegram kept their inline fetch/Bot logic: their error strings surface server response bodies to operators, or the transport isn't raw `fetch` (Telegram uses `grammy`'s `Bot`).
|
|
27
|
+
|
|
28
|
+
**API surface tightening**
|
|
29
|
+
|
|
30
|
+
- Per-plugin test-only re-exports in 6 notification backends (Pushover, Gotify, Backstage, Slack, Discord, Teams) and the `CertificateInfo` interface in `healthcheck-tls-backend/strategy.ts` are now JSDoc-tagged `@internal`. No behaviour change; signals that downstream consumers must not depend on them.
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [a06b899]
|
|
33
|
+
- Updated dependencies [a06b899]
|
|
34
|
+
- @checkstack/backend-api@0.16.0
|
|
35
|
+
- @checkstack/notification-backend@1.1.0
|
|
36
|
+
|
|
37
|
+
## 0.0.36
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [1909a61]
|
|
42
|
+
- Updated dependencies [b33fb4d]
|
|
43
|
+
- @checkstack/backend-api@0.15.3
|
|
44
|
+
- @checkstack/notification-backend@1.0.5
|
|
45
|
+
|
|
3
46
|
## 0.0.35
|
|
4
47
|
|
|
5
48
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/notification-teams-backend",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"checkstack": {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"pack": "bunx @checkstack/scripts plugin-pack"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@checkstack/backend-api": "0.15.
|
|
21
|
-
"@checkstack/common": "0.
|
|
22
|
-
"@checkstack/notification-backend": "1.0.
|
|
20
|
+
"@checkstack/backend-api": "0.15.3",
|
|
21
|
+
"@checkstack/common": "0.10.0",
|
|
22
|
+
"@checkstack/notification-backend": "1.0.5",
|
|
23
23
|
"zod": "^4.2.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -9,7 +9,11 @@ import {
|
|
|
9
9
|
type NotificationSubject,
|
|
10
10
|
type StrategyOAuthConfig,
|
|
11
11
|
} from "@checkstack/backend-api";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
notificationStrategyExtensionPoint,
|
|
14
|
+
SUBJECT_STATUS_EMOJI,
|
|
15
|
+
IMPORTANCE_EMOJI,
|
|
16
|
+
} from "@checkstack/notification-backend";
|
|
13
17
|
import { pluginMetadata } from "./plugin-metadata";
|
|
14
18
|
import { extractErrorMessage } from "@checkstack/common";
|
|
15
19
|
|
|
@@ -101,13 +105,6 @@ interface AdaptiveCardOptions {
|
|
|
101
105
|
subjects?: NotificationSubject[];
|
|
102
106
|
}
|
|
103
107
|
|
|
104
|
-
const SUBJECT_STATUS_EMOJI = {
|
|
105
|
-
healthy: "🟢",
|
|
106
|
-
degraded: "🟡",
|
|
107
|
-
unhealthy: "🔴",
|
|
108
|
-
unknown: "⚪",
|
|
109
|
-
} as const;
|
|
110
|
-
|
|
111
108
|
function buildAdaptiveCard(options: AdaptiveCardOptions): object {
|
|
112
109
|
const { title, body, importance, action, subjects } = options;
|
|
113
110
|
|
|
@@ -117,16 +114,11 @@ function buildAdaptiveCard(options: AdaptiveCardOptions): object {
|
|
|
117
114
|
critical: "attention",
|
|
118
115
|
};
|
|
119
116
|
|
|
120
|
-
const importanceEmoji: Record<string, string> = {
|
|
121
|
-
info: "ℹ️",
|
|
122
|
-
warning: "⚠️",
|
|
123
|
-
critical: "🚨",
|
|
124
|
-
};
|
|
125
117
|
|
|
126
118
|
const bodyElements: object[] = [
|
|
127
119
|
{
|
|
128
120
|
type: "TextBlock",
|
|
129
|
-
text: `${
|
|
121
|
+
text: `${IMPORTANCE_EMOJI[importance]} ${title}`,
|
|
130
122
|
weight: "bolder",
|
|
131
123
|
size: "large",
|
|
132
124
|
wrap: true,
|
|
@@ -410,6 +402,11 @@ export default createBackendPlugin({
|
|
|
410
402
|
},
|
|
411
403
|
});
|
|
412
404
|
|
|
413
|
-
|
|
405
|
+
/**
|
|
406
|
+
* Internal exports for the package's own unit tests. Not part of the plugin's
|
|
407
|
+
* public API surface.
|
|
408
|
+
* @internal
|
|
409
|
+
*/
|
|
414
410
|
export { teamsConfigSchemaV1, buildAdaptiveCard };
|
|
411
|
+
/** @internal */
|
|
415
412
|
export type { TeamsConfig, AdaptiveCardOptions };
|