@checkstack/notification-teams-backend 0.0.28 → 0.0.30
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 +27 -0
- package/package.json +4 -4
- package/src/index.test.ts +7 -7
- package/src/index.ts +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @checkstack/notification-teams-backend
|
|
2
2
|
|
|
3
|
+
## 0.0.30
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @checkstack/backend-api@0.13.1
|
|
8
|
+
- @checkstack/notification-backend@0.2.1
|
|
9
|
+
|
|
10
|
+
## 0.0.29
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 8d1ef12: ## Downstream consumer bumps for the anomaly detection + cache system rollout
|
|
15
|
+
|
|
16
|
+
Packages on this branch were updated as part of the anomaly detection feature (schema annotations on result fields, plugin metadata for the modular cache system) but were not listed in the upstream changesets.
|
|
17
|
+
|
|
18
|
+
- **`@checkstack/healthcheck-common`** (minor) — new RPC contract additions and schema changes supporting per-field anomaly metadata.
|
|
19
|
+
- **`@checkstack/cache-memory-common`** (minor) — new package providing access rules + plugin metadata for the in-memory cache backend.
|
|
20
|
+
- **healthcheck plugins** (patch) — adopt the new `x-anomaly-*` schema annotations on their result fields so anomaly detection works automatically against their checks. No public API changes.
|
|
21
|
+
- **integration / notification / auth / queue / collector plugins** (patch) — minor internal updates as consumers of upstream API changes (cache plugin registry, schema additions). No public API changes.
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [8d1ef12]
|
|
24
|
+
- Updated dependencies [8d1ef12]
|
|
25
|
+
- Updated dependencies [8d1ef12]
|
|
26
|
+
- @checkstack/common@0.7.0
|
|
27
|
+
- @checkstack/notification-backend@0.2.0
|
|
28
|
+
- @checkstack/backend-api@0.13.0
|
|
29
|
+
|
|
3
30
|
## 0.0.28
|
|
4
31
|
|
|
5
32
|
### 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.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"checkstack": {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"lint": "eslint src --ext .ts"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@checkstack/backend-api": "0.
|
|
19
|
-
"@checkstack/common": "0.
|
|
20
|
-
"@checkstack/notification-backend": "0.
|
|
18
|
+
"@checkstack/backend-api": "0.13.0",
|
|
19
|
+
"@checkstack/common": "0.7.0",
|
|
20
|
+
"@checkstack/notification-backend": "0.2.0",
|
|
21
21
|
"zod": "^4.2.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
package/src/index.test.ts
CHANGED
|
@@ -59,7 +59,7 @@ describe("Microsoft Teams Notification Strategy", () => {
|
|
|
59
59
|
expect(card.type).toBe("AdaptiveCard");
|
|
60
60
|
expect(card.version).toBe("1.4");
|
|
61
61
|
expect(card.$schema).toBe(
|
|
62
|
-
"http://adaptivecards.io/schemas/adaptive-card.json"
|
|
62
|
+
"http://adaptivecards.io/schemas/adaptive-card.json",
|
|
63
63
|
);
|
|
64
64
|
|
|
65
65
|
const body = card.body as Array<Record<string, unknown>>;
|
|
@@ -138,7 +138,7 @@ describe("Microsoft Teams Notification Strategy", () => {
|
|
|
138
138
|
|
|
139
139
|
const mockFetch = spyOn(globalThis, "fetch").mockImplementation((async (
|
|
140
140
|
url: RequestInfo | URL,
|
|
141
|
-
options?: RequestInit
|
|
141
|
+
options?: RequestInit,
|
|
142
142
|
) => {
|
|
143
143
|
capturedUrl = url.toString();
|
|
144
144
|
capturedBody = options?.body as string;
|
|
@@ -186,7 +186,7 @@ describe("Microsoft Teams Notification Strategy", () => {
|
|
|
186
186
|
|
|
187
187
|
const mockFetch = spyOn(globalThis, "fetch").mockImplementation((async (
|
|
188
188
|
_url: RequestInfo | URL,
|
|
189
|
-
options?: RequestInit
|
|
189
|
+
options?: RequestInit,
|
|
190
190
|
) => {
|
|
191
191
|
capturedBody = options?.body as string;
|
|
192
192
|
return new Response(JSON.stringify({ id: "msg-789" }), {
|
|
@@ -222,14 +222,14 @@ describe("Microsoft Teams Notification Strategy", () => {
|
|
|
222
222
|
},
|
|
223
223
|
],
|
|
224
224
|
}),
|
|
225
|
-
}
|
|
225
|
+
},
|
|
226
226
|
);
|
|
227
227
|
|
|
228
228
|
const parsedBody = JSON.parse(capturedBody!);
|
|
229
229
|
expect(parsedBody.body.contentType).toBe("html");
|
|
230
230
|
expect(parsedBody.attachments).toHaveLength(1);
|
|
231
231
|
expect(parsedBody.attachments[0].contentType).toBe(
|
|
232
|
-
"application/vnd.microsoft.card.adaptive"
|
|
232
|
+
"application/vnd.microsoft.card.adaptive",
|
|
233
233
|
);
|
|
234
234
|
|
|
235
235
|
const cardContent = JSON.parse(parsedBody.attachments[0].content);
|
|
@@ -246,9 +246,9 @@ describe("Microsoft Teams Notification Strategy", () => {
|
|
|
246
246
|
JSON.stringify({
|
|
247
247
|
error: { code: "Forbidden", message: "Access denied" },
|
|
248
248
|
}),
|
|
249
|
-
{ status: 403 }
|
|
249
|
+
{ status: 403 },
|
|
250
250
|
);
|
|
251
|
-
}) as unknown as typeof fetch
|
|
251
|
+
}) as unknown as typeof fetch,
|
|
252
252
|
);
|
|
253
253
|
|
|
254
254
|
try {
|
package/src/index.ts
CHANGED
|
@@ -24,7 +24,7 @@ const teamsConfigSchemaV1 = z.object({
|
|
|
24
24
|
tenantId: configString({}).describe("Azure AD Tenant ID"),
|
|
25
25
|
clientId: configString({}).describe("Azure AD Application (Client) ID"),
|
|
26
26
|
clientSecret: configString({ "x-secret": true }).describe(
|
|
27
|
-
"Azure AD Client Secret"
|
|
27
|
+
"Azure AD Client Secret",
|
|
28
28
|
),
|
|
29
29
|
});
|
|
30
30
|
|
|
@@ -203,7 +203,7 @@ const teamsStrategy: NotificationStrategy<TeamsConfig> = {
|
|
|
203
203
|
const parts = idTokenClaims.split(".");
|
|
204
204
|
if (parts.length === 3) {
|
|
205
205
|
const payload = JSON.parse(
|
|
206
|
-
Buffer.from(parts[1], "base64url").toString()
|
|
206
|
+
Buffer.from(parts[1], "base64url").toString(),
|
|
207
207
|
) as { oid?: string };
|
|
208
208
|
if (payload.oid) {
|
|
209
209
|
return payload.oid;
|
|
@@ -226,7 +226,7 @@ const teamsStrategy: NotificationStrategy<TeamsConfig> = {
|
|
|
226
226
|
} satisfies StrategyOAuthConfig<TeamsConfig>,
|
|
227
227
|
|
|
228
228
|
async send(
|
|
229
|
-
context: NotificationSendContext<TeamsConfig
|
|
229
|
+
context: NotificationSendContext<TeamsConfig>,
|
|
230
230
|
): Promise<NotificationDeliveryResult> {
|
|
231
231
|
const { notification, strategyConfig, logger } = context;
|
|
232
232
|
|
|
@@ -324,7 +324,7 @@ const teamsStrategy: NotificationStrategy<TeamsConfig> = {
|
|
|
324
324
|
],
|
|
325
325
|
}),
|
|
326
326
|
signal: AbortSignal.timeout(10_000),
|
|
327
|
-
}
|
|
327
|
+
},
|
|
328
328
|
);
|
|
329
329
|
|
|
330
330
|
if (!messageResponse.ok) {
|
|
@@ -346,8 +346,7 @@ const teamsStrategy: NotificationStrategy<TeamsConfig> = {
|
|
|
346
346
|
externalId: messageData.id,
|
|
347
347
|
};
|
|
348
348
|
} catch (error) {
|
|
349
|
-
const message =
|
|
350
|
-
extractErrorMessage(error, "Unknown Graph API error");
|
|
349
|
+
const message = extractErrorMessage(error, "Unknown Graph API error");
|
|
351
350
|
logger.error("Teams notification error", { error: message });
|
|
352
351
|
return {
|
|
353
352
|
success: false,
|
|
@@ -367,7 +366,7 @@ export default createBackendPlugin({
|
|
|
367
366
|
register(env) {
|
|
368
367
|
// Get the notification strategy extension point
|
|
369
368
|
const extensionPoint = env.getExtensionPoint(
|
|
370
|
-
notificationStrategyExtensionPoint
|
|
369
|
+
notificationStrategyExtensionPoint,
|
|
371
370
|
);
|
|
372
371
|
|
|
373
372
|
// Register the Teams strategy with our plugin metadata
|