@cat-factory/integrations 0.116.4 → 0.117.1
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/dist/modules/notificationWebhook/WebhookNotificationChannel.d.ts +8 -1
- package/dist/modules/notificationWebhook/WebhookNotificationChannel.d.ts.map +1 -1
- package/dist/modules/notificationWebhook/WebhookNotificationChannel.js +7 -0
- package/dist/modules/notificationWebhook/WebhookNotificationChannel.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Clock, Notification, NotificationChannel, NotificationWebhookRepository, SecretCipher, UrlSafetyPolicy } from '@cat-factory/kernel';
|
|
1
|
+
import type { Clock, Notification, NotificationChannel, NotificationWebhookRepository, OperationalMetrics, SecretCipher, UrlSafetyPolicy } from '@cat-factory/kernel';
|
|
2
2
|
import { WEBHOOK_SIGNATURE_HEADERS } from './webhookSignature.js';
|
|
3
3
|
export interface WebhookNotificationChannelDependencies {
|
|
4
4
|
notificationWebhookRepository: NotificationWebhookRepository;
|
|
@@ -26,6 +26,13 @@ export interface WebhookNotificationChannelDependencies {
|
|
|
26
26
|
notificationId: string;
|
|
27
27
|
type: string;
|
|
28
28
|
}) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Where a spent delivery is COUNTED, beside the per-failure report `onError` makes. The
|
|
31
|
+
* hook answers "why did this one card not arrive"; the counter answers "are deliveries
|
|
32
|
+
* failing at a rate nobody has noticed" — an endpoint that has been rejecting every card
|
|
33
|
+
* for a week produces a steady trickle of individual warnings and no signal at all.
|
|
34
|
+
*/
|
|
35
|
+
operationalMetrics?: OperationalMetrics;
|
|
29
36
|
}
|
|
30
37
|
export declare class WebhookNotificationChannel implements NotificationChannel {
|
|
31
38
|
private readonly deps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebhookNotificationChannel.d.ts","sourceRoot":"","sources":["../../../src/modules/notificationWebhook/WebhookNotificationChannel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,mBAAmB,EAGnB,6BAA6B,EAC7B,YAAY,EACZ,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAoBjE,MAAM,WAAW,sCAAsC;IACrD,6BAA6B,EAAE,6BAA6B,CAAA;IAC5D,YAAY,EAAE,YAAY,CAAA;IAC1B,KAAK,EAAE,KAAK,CAAA;IACZ,oFAAoF;IACpF,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB,yFAAyF;IACzF,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,OAAO,EACd,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KACnE,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"WebhookNotificationChannel.d.ts","sourceRoot":"","sources":["../../../src/modules/notificationWebhook/WebhookNotificationChannel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,mBAAmB,EAGnB,6BAA6B,EAC7B,kBAAkB,EAClB,YAAY,EACZ,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAoBjE,MAAM,WAAW,sCAAsC;IACrD,6BAA6B,EAAE,6BAA6B,CAAA;IAC5D,YAAY,EAAE,YAAY,CAAA;IAC1B,KAAK,EAAE,KAAK,CAAA;IACZ,oFAAoF;IACpF,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB,yFAAyF;IACzF,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,OAAO,EACd,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KACnE,IAAI,CAAA;IACT;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;CACxC;AAED,qBAAa,0BAA2B,YAAW,mBAAmB;IACxD,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAjC,YAA6B,IAAI,EAAE,sCAAsC,EAAI;IAEvE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB5E;YAEa,IAAI;CAuBnB;AAcD,OAAO,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -19,6 +19,13 @@ export class WebhookNotificationChannel {
|
|
|
19
19
|
notificationId: notification.id,
|
|
20
20
|
type: notification.type,
|
|
21
21
|
});
|
|
22
|
+
// The notification TYPE is a bounded enum, so it is safe as a dimension and is the one
|
|
23
|
+
// split worth having: an endpoint that only fails on a particular card is a receiver
|
|
24
|
+
// bug, where a flat failure across types is an outage.
|
|
25
|
+
this.deps.operationalMetrics?.increment('notification.delivery_failed', {
|
|
26
|
+
channel: 'webhook',
|
|
27
|
+
type: notification.type,
|
|
28
|
+
});
|
|
22
29
|
}
|
|
23
30
|
}
|
|
24
31
|
async post(workspaceId, notification) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebhookNotificationChannel.js","sourceRoot":"","sources":["../../../src/modules/notificationWebhook/WebhookNotificationChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,GAEnC,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"WebhookNotificationChannel.js","sourceRoot":"","sources":["../../../src/modules/notificationWebhook/WebhookNotificationChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,GAEnC,MAAM,wBAAwB,CAAA;AAY/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAsDjE,MAAM,OAAO,0BAA0B;IACR,IAAI;IAAjC,YAA6B,IAA4C;oBAA5C,IAAI;IAA2C,CAAC;IAE7E,KAAK,CAAC,OAAO,CAAC,WAAmB,EAAE,YAA0B;QAC3D,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,sFAAsF;YACtF,2FAA2F;YAC3F,yFAAyF;YACzF,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE;gBACzB,WAAW;gBACX,cAAc,EAAE,YAAY,CAAC,EAAE;gBAC/B,IAAI,EAAE,YAAY,CAAC,IAAI;aACxB,CAAC,CAAA;YACF,uFAAuF;YACvF,qFAAqF;YACrF,uDAAuD;YACvD,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,8BAA8B,EAAE;gBACtE,OAAO,EAAE,SAAS;gBAClB,IAAI,EAAE,YAAY,CAAC,IAAI;aACxB,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,IAAI,CAAC,WAAmB,EAAE,YAA0B;QAChE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QAC9E,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,OAAM;QACxC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC;YAAE,OAAM;QAErD,MAAM,IAAI,GAAgC;YACxC,6FAA6F;YAC7F,4FAA4F;YAC5F,sFAAsF;YACtF,UAAU,EAAE,GAAG,YAAY,CAAC,EAAE,IAAI,YAAY,CAAC,MAAM,EAAE;YACvD,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YAC7B,WAAW;YACX,KAAK,EAAE,YAAY,CAAC,WAAW;YAC/B,MAAM,EAAE,YAAY,CAAC,OAAO;YAC5B,YAAY;SACb,CAAA;QACD,MAAM,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE;YACjC,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAA;IACJ,CAAC;CACF;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,OAAkC,EAAE,IAAsB;IAC9E,MAAM,KAAK,GAAgC,OAAO,CAAC,KAAK,CAAC,MAAM;QAC7D,CAAC,CAAC,OAAO,CAAC,KAAK;QACf,CAAC,CAAC,kCAAkC,CAAA;IACtC,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAC7B,CAAC;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/integrations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.1",
|
|
4
4
|
"description": "External-system integration domain logic for the Agent Architecture Board (GitHub, documents, tasks, environments, runners).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"ai": "^7.0.47",
|
|
28
28
|
"p-map": "^7.0.6",
|
|
29
29
|
"yaml": "^2.9.0",
|
|
30
|
-
"@cat-factory/contracts": "0.
|
|
31
|
-
"@cat-factory/kernel": "0.
|
|
30
|
+
"@cat-factory/contracts": "0.213.0",
|
|
31
|
+
"@cat-factory/kernel": "0.216.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"typescript": "7.0.2",
|
|
35
35
|
"undici": "^8.9.0",
|
|
36
36
|
"valibot": "^1.4.2",
|
|
37
37
|
"vitest": "^4.1.10",
|
|
38
|
-
"@cat-factory/caching": "0.
|
|
38
|
+
"@cat-factory/caching": "0.13.1"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc -b tsconfig.build.json",
|