@griffin-app/griffin-ts 0.1.15 → 0.1.17
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/builder.d.ts +2 -0
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +6 -2
- package/dist/builder.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations.d.ts +10 -0
- package/dist/integrations.d.ts.map +1 -0
- package/dist/integrations.js +24 -0
- package/dist/integrations.js.map +1 -0
- package/dist/notifications.d.ts +96 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/notifications.js +126 -0
- package/dist/notifications.js.map +1 -0
- package/dist/schema-exports.d.ts +2 -1
- package/dist/schema-exports.d.ts.map +1 -1
- package/dist/schema-exports.js +2 -1
- package/dist/schema-exports.js.map +1 -1
- package/dist/schema.d.ts +122 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +4 -0
- package/dist/schema.js.map +1 -1
- package/dist/sequential-builder.d.ts +2 -0
- package/dist/sequential-builder.d.ts.map +1 -1
- package/dist/sequential-builder.js +11 -3
- package/dist/sequential-builder.js.map +1 -1
- package/dist/type-exports.d.ts +1 -0
- package/dist/type-exports.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/builder.ts +9 -2
- package/src/index.ts +16 -0
- package/src/integrations.ts +32 -0
- package/src/notifications.ts +168 -0
- package/src/schema-exports.ts +9 -0
- package/src/schema.ts +9 -0
- package/src/sequential-builder.ts +14 -3
- package/src/type-exports.ts +7 -0
package/dist/builder.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Assertion, MonitorDSL, NodeDSL, Frequency, HttpRequestDSL, Wait, Assertions } from "./schema.js";
|
|
2
|
+
import type { MonitorNotification } from "./notifications.js";
|
|
2
3
|
import { type START as StartType, type END as EndType } from "./constants.js";
|
|
3
4
|
/**
|
|
4
5
|
* A node definition without the id field.
|
|
@@ -91,6 +92,7 @@ export declare function createGraphBuilder(config: {
|
|
|
91
92
|
name: string;
|
|
92
93
|
frequency: Frequency;
|
|
93
94
|
locations?: string[];
|
|
95
|
+
notifications?: MonitorNotification[];
|
|
94
96
|
}): TestBuilder;
|
|
95
97
|
/**
|
|
96
98
|
* Configuration for an HttpRequest node
|
package/dist/builder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,OAAO,EAEP,SAAS,EAGT,cAAc,EAEd,IAAI,EACJ,UAAU,EAEX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,KAAK,IAAI,SAAS,EAAE,KAAK,GAAG,IAAI,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9E;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW,CAC1B,QAAQ,SAAS,MAAM,GAAG,KAAK,EAC/B,SAAS,SAAS,MAAM,GAAG,KAAK,EAChC,QAAQ,SAAS,MAAM,GAAG,KAAK;IAE/B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,IAAI,SAAS,MAAM,EACzB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,aAAa,GAClB,WAAW,CAAC,QAAQ,GAAG,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAErD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CACL,IAAI,SAAS,SAAS,GAAG,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,EACrD,EAAE,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,EAE5C,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,EAAE,GACL,WA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iBAAiB;IAChC,MAAM,EACF,KAAK,GACL,MAAM,GACN,KAAK,GACL,QAAQ,GACR,OAAO,GACP,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACtC,eAAe,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAY5B;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAkB9E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAK7D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAKzE"}
|
package/dist/builder.js
CHANGED
|
@@ -23,11 +23,11 @@ class TestBuilderImpl {
|
|
|
23
23
|
return this;
|
|
24
24
|
}
|
|
25
25
|
get build() {
|
|
26
|
-
const { name, frequency, locations } = this.config;
|
|
26
|
+
const { name, frequency, locations, notifications } = this.config;
|
|
27
27
|
const nodes = this.nodes;
|
|
28
28
|
const edges = this.edges;
|
|
29
29
|
const buildFn = () => {
|
|
30
|
-
|
|
30
|
+
const result = {
|
|
31
31
|
name,
|
|
32
32
|
version: CURRENT_MONITOR_VERSION,
|
|
33
33
|
frequency,
|
|
@@ -35,6 +35,10 @@ class TestBuilderImpl {
|
|
|
35
35
|
nodes,
|
|
36
36
|
edges,
|
|
37
37
|
};
|
|
38
|
+
if (notifications !== undefined && notifications.length > 0) {
|
|
39
|
+
result.notifications = notifications;
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
38
42
|
};
|
|
39
43
|
// Type assertion: build is only callable when graph constraints are satisfied
|
|
40
44
|
// The conditional type in TestBuilder['build'] enforces this at the call site
|
package/dist/builder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,QAAQ,EAGR,uBAAuB,GACxB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,QAAQ,EAGR,uBAAuB,GACxB,MAAM,aAAa,CAAC;AA8FrB;;;GAGG;AACH,MAAM,eAAe;IAST;IAJF,KAAK,GAAc,EAAE,CAAC;IACtB,KAAK,GAAW,EAAE,CAAC;IAE3B,YACU,MAKP;QALO,WAAM,GAAN,MAAM,CAKb;IACA,CAAC;IAEJ,OAAO,CACL,IAAU,EACV,IAAmB;QAEnB,yDAAyD;QACzD,4FAA4F;QAC5F,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,IAAI,EAAwB,CAAC,CAAC;QAC7D,qDAAqD;QACrD,OAAO,IAAoE,CAAC;IAC9E,CAAC;IAED,OAAO,CAIL,IAAU,EACV,EAAM;QAMN,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9B,+EAA+E;QAC/E,OAAO,IAIN,CAAC;IACJ,CAAC;IAED,IAAI,KAAK;QACP,MAAM,EAAE,IA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AE,MAAM,CAAC,OAAO;QACvB,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB,CAAC;AACJ,CAAC;AAQD;;GAEG;AACH,SAAS,cAAc,CAAC,QAAsB;IAC5C,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,SAAS,IAAI,QAAQ,EAAE,CAAC;QAC1B,OAAO,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;IACjC,CAAC;IACD,IAAI,SAAS,IAAI,QAAQ,EAAE,CAAC;QAC1B,OAAO,QAAQ,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC;IACtC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,IAAI,CAAC,QAAsB;IACzC,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,WAAW,EAAE,cAAc,CAAC,QAAQ,CAAC;KACtC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,SAAS,CAAC,UAAuB;IAC/C,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,SAAS;QACxB,UAAU,EAAE,UAAU;KACvB,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,9 @@ export { variable, isVariableRef } from "./variable.js";
|
|
|
16
16
|
export type { VariableRef } from "./variable.js";
|
|
17
17
|
export { secret, isSecretRef } from "./secrets.js";
|
|
18
18
|
export type { SecretOptions } from "./secrets.js";
|
|
19
|
+
export { notify } from "./notifications.js";
|
|
20
|
+
export { MonitorNotificationSchema, NotificationRoutingSchema, SlackRoutingSchema, EmailRoutingSchema, WebhookRoutingSchema, } from "./notifications.js";
|
|
21
|
+
export type { NotificationTrigger, MonitorNotification, NotificationRouting, SlackRouting, EmailRouting, WebhookRouting, } from "./notifications.js";
|
|
19
22
|
export { START, END } from "./constants.js";
|
|
20
23
|
export type { START as StartType, END as EndType } from "./constants.js";
|
|
21
24
|
export { GET, POST, PUT, DELETE, PATCH } from "./http-methods.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EACV,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EACV,iBAAiB,EACjB,YAAY,IAAI,gBAAgB,GACjC,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EACV,qBAAqB,EACrB,iBAAiB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AChB,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EACL,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,IAAI,EACJ,SAAS,IAAI,aAAa,EAC1B,SAAS,IAAI,aAAa,EAC1B,UAAU,IAAI,cAAc,EAC5B,SAAS,IAAI,aAAa,EAC1B,WAAW,IAAI,eAAe,GAC/B,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,8 @@ export { Frequency } from "./frequency.js";
|
|
|
20
20
|
export { WaitDuration } from "./wait.js";
|
|
21
21
|
export { variable, isVariableRef } from "./variable.js";
|
|
22
22
|
export { secret, isSecretRef } from "./secrets.js";
|
|
23
|
+
export { notify } from "./notifications.js";
|
|
24
|
+
export { MonitorNotificationSchema, NotificationRoutingSchema, SlackRoutingSchema, EmailRoutingSchema, WebhookRoutingSchema, } from "./notifications.js";
|
|
23
25
|
// ============================================================================
|
|
24
26
|
// DSL Constants
|
|
25
27
|
// ============================================================================
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAM5D,+EAA+E;AAC/E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AAM,gBAAgB,CAAC;AAG5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAExD,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAkB1E,+EAA+E;AAC/E,sDAAsD;AACtD,+EAA+E;AAE/E,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,OAAO,EACL,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Type, type Static } from "typebox";
|
|
2
|
+
export declare const IntegrationCategorySchema: Type.TUnsafe<"notifications" | "secrets" | "metrics">;
|
|
3
|
+
export declare const NotificationProviderSchema: Type.TUnsafe<"slack" | "email" | "webhook">;
|
|
4
|
+
export declare const SecretsProviderSchema: Type.TUnsafe<"aws" | "vault">;
|
|
5
|
+
export declare const ProviderSchema: Type.TUnsafe<"slack" | "email" | "webhook" | "aws" | "vault">;
|
|
6
|
+
export type IntegrationCategory = Static<typeof IntegrationCategorySchema>;
|
|
7
|
+
export type SecretsProvider = Static<typeof SecretsProviderSchema>;
|
|
8
|
+
export type NotificationProvider = Static<typeof NotificationProviderSchema>;
|
|
9
|
+
export type Provider = Static<typeof ProviderSchema>;
|
|
10
|
+
//# sourceMappingURL=integrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../src/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,yBAAyB,uDAIN,CAAC;AAEjC,eAAO,MAAM,0BAA0B,6CAIN,CAAC;AAElC,eAAO,MAAM,qBAAqB,+BAIN,CAAC;AAC7B,eAAO,MAAM,cAAc,+DAMN,CAAC;AAEtB,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE3E,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACnE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC7E,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StringEnum } from "./shared.js";
|
|
2
|
+
export const IntegrationCategorySchema = StringEnum([
|
|
3
|
+
"notifications",
|
|
4
|
+
"secrets",
|
|
5
|
+
"metrics",
|
|
6
|
+
], { $id: "IntegrationCategory" });
|
|
7
|
+
export const NotificationProviderSchema = StringEnum([
|
|
8
|
+
"slack",
|
|
9
|
+
"email",
|
|
10
|
+
"webhook",
|
|
11
|
+
], { $id: "NotificationProvider" });
|
|
12
|
+
export const SecretsProviderSchema = StringEnum([
|
|
13
|
+
//Type.Literal("env"),
|
|
14
|
+
"aws",
|
|
15
|
+
"vault",
|
|
16
|
+
], { $id: "SecretsProvider" });
|
|
17
|
+
export const ProviderSchema = StringEnum([
|
|
18
|
+
"aws",
|
|
19
|
+
"vault",
|
|
20
|
+
"slack",
|
|
21
|
+
"email",
|
|
22
|
+
"webhook",
|
|
23
|
+
], { $id: "Provider" });
|
|
24
|
+
//# sourceMappingURL=integrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../src/integrations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAC;IAClD,eAAe;IACf,SAAS;IACT,SAAS;CACV,EAAE,EAAC,GAAG,EAAE,qBAAqB,EAAC,CAAC,CAAC;AAEjC,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;IACnD,OAAO;IACP,OAAO;IACP,SAAS;CACV,EAAE,EAAC,GAAG,EAAE,sBAAsB,EAAC,CAAC,CAAC;AAElC,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;IAC9C,sBAAsB;IACtB,KAAK;IACL,OAAO;CACR,EAAE,EAAC,GAAG,EAAE,iBAAiB,EAAC,CAAC,CAAC;AAC7B,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,KAAK;IACL,OAAO;IACP,OAAO;IACP,OAAO;IACP,SAAS;CACV,EAAE,EAAC,GAAG,EAAE,UAAU,EAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Type, type Static } from "typebox";
|
|
2
|
+
export declare const NotificationTriggerSchema: Type.TUnion<[Type.TObject<{
|
|
3
|
+
type: Type.TLiteral<"run_failed">;
|
|
4
|
+
}>, Type.TObject<{
|
|
5
|
+
type: Type.TLiteral<"run_recovered">;
|
|
6
|
+
}>, Type.TObject<{
|
|
7
|
+
type: Type.TLiteral<"consecutive_failures">;
|
|
8
|
+
threshold: Type.TNumber;
|
|
9
|
+
}>, Type.TObject<{
|
|
10
|
+
type: Type.TLiteral<"success_rate_below">;
|
|
11
|
+
threshold: Type.TNumber;
|
|
12
|
+
window_minutes: Type.TNumber;
|
|
13
|
+
}>, Type.TObject<{
|
|
14
|
+
type: Type.TLiteral<"latency_above">;
|
|
15
|
+
threshold_ms: Type.TNumber;
|
|
16
|
+
percentile: Type.TUnion<[Type.TLiteral<"p50">, Type.TLiteral<"p95">, Type.TLiteral<"p99">]>;
|
|
17
|
+
window_minutes: Type.TNumber;
|
|
18
|
+
}>]>;
|
|
19
|
+
export type NotificationTrigger = Static<typeof NotificationTriggerSchema>;
|
|
20
|
+
export declare const SlackRoutingSchema: Type.TObject<{
|
|
21
|
+
provider: Type.TLiteral<"slack">;
|
|
22
|
+
channel: Type.TString;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const EmailRoutingSchema: Type.TObject<{
|
|
25
|
+
provider: Type.TLiteral<"email">;
|
|
26
|
+
toAddresses: Type.TArray<Type.TString>;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const WebhookRoutingSchema: Type.TObject<{
|
|
29
|
+
provider: Type.TLiteral<"webhook">;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const NotificationRoutingSchema: Type.TUnion<[Type.TObject<{
|
|
32
|
+
provider: Type.TLiteral<"slack">;
|
|
33
|
+
channel: Type.TString;
|
|
34
|
+
}>, Type.TObject<{
|
|
35
|
+
provider: Type.TLiteral<"email">;
|
|
36
|
+
toAddresses: Type.TArray<Type.TString>;
|
|
37
|
+
}>, Type.TObject<{
|
|
38
|
+
provider: Type.TLiteral<"webhook">;
|
|
39
|
+
}>]>;
|
|
40
|
+
export type SlackRouting = Static<typeof SlackRoutingSchema>;
|
|
41
|
+
export type EmailRouting = Static<typeof EmailRoutingSchema>;
|
|
42
|
+
export type WebhookRouting = Static<typeof WebhookRoutingSchema>;
|
|
43
|
+
export type NotificationRouting = Static<typeof NotificationRoutingSchema>;
|
|
44
|
+
export declare const MonitorNotificationSchema: Type.TObject<{
|
|
45
|
+
trigger: Type.TUnion<[Type.TObject<{
|
|
46
|
+
type: Type.TLiteral<"run_failed">;
|
|
47
|
+
}>, Type.TObject<{
|
|
48
|
+
type: Type.TLiteral<"run_recovered">;
|
|
49
|
+
}>, Type.TObject<{
|
|
50
|
+
type: Type.TLiteral<"consecutive_failures">;
|
|
51
|
+
threshold: Type.TNumber;
|
|
52
|
+
}>, Type.TObject<{
|
|
53
|
+
type: Type.TLiteral<"success_rate_below">;
|
|
54
|
+
threshold: Type.TNumber;
|
|
55
|
+
window_minutes: Type.TNumber;
|
|
56
|
+
}>, Type.TObject<{
|
|
57
|
+
type: Type.TLiteral<"latency_above">;
|
|
58
|
+
threshold_ms: Type.TNumber;
|
|
59
|
+
percentile: Type.TUnion<[Type.TLiteral<"p50">, Type.TLiteral<"p95">, Type.TLiteral<"p99">]>;
|
|
60
|
+
window_minutes: Type.TNumber;
|
|
61
|
+
}>]>;
|
|
62
|
+
integration: Type.TString;
|
|
63
|
+
routing: Type.TUnion<[Type.TObject<{
|
|
64
|
+
provider: Type.TLiteral<"slack">;
|
|
65
|
+
channel: Type.TString;
|
|
66
|
+
}>, Type.TObject<{
|
|
67
|
+
provider: Type.TLiteral<"email">;
|
|
68
|
+
toAddresses: Type.TArray<Type.TString>;
|
|
69
|
+
}>, Type.TObject<{
|
|
70
|
+
provider: Type.TLiteral<"webhook">;
|
|
71
|
+
}>]>;
|
|
72
|
+
cooldown_minutes: Type.TOptional<Type.TNumber>;
|
|
73
|
+
}>;
|
|
74
|
+
export type MonitorNotification = Static<typeof MonitorNotificationSchema>;
|
|
75
|
+
declare class NotificationBuilder {
|
|
76
|
+
private trigger;
|
|
77
|
+
private cooldownMinutes?;
|
|
78
|
+
constructor(trigger: NotificationTrigger);
|
|
79
|
+
withCooldown(minutes: number): this;
|
|
80
|
+
toSlack(integration: string, channel: string): MonitorNotification;
|
|
81
|
+
toEmail(integration: string, toAddresses: string[]): MonitorNotification;
|
|
82
|
+
toWebhook(integration: string): MonitorNotification;
|
|
83
|
+
}
|
|
84
|
+
export declare const notify: {
|
|
85
|
+
onFailure: () => NotificationBuilder;
|
|
86
|
+
onRecovery: () => NotificationBuilder;
|
|
87
|
+
onConsecutiveFailures: (threshold: number) => NotificationBuilder;
|
|
88
|
+
onSuccessRateBelow: (threshold: number, window_minutes: number) => NotificationBuilder;
|
|
89
|
+
onLatencyAbove: (options: {
|
|
90
|
+
threshold_ms: number;
|
|
91
|
+
percentile: "p50" | "p95" | "p99";
|
|
92
|
+
window_minutes: number;
|
|
93
|
+
}) => NotificationBuilder;
|
|
94
|
+
};
|
|
95
|
+
export {};
|
|
96
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAM5C,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;IA0BJ,CAAC;AAEnC,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAM3E,eAAO,MAAM,kBAAkB;;;EAG7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;EAG7B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;EAE/B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;IAIpC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC7D,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACjE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAM3E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQrC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAM3E,cAAM,mBAAmB;IACvB,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,eAAe,CAAC,CAAS;gBAErB,OAAO,EAAE,mBAAmB;IAIxC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKnC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,mBAAmB;IAWlE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,mBAAmB;IAWxE,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB;CAUpD;AAMD,eAAO,MAAM,MAAM;;;uCAOkB,MAAM;oCAMT,MAAM,kBAAkB,MAAM;8BAOpC;QACxB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;QAClC,cAAc,EAAE,MAAM,CAAC;KACxB;CAOF,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// Trigger Types (matches hub NotificationTriggerSchema)
|
|
4
|
+
// =============================================================================
|
|
5
|
+
export const NotificationTriggerSchema = Type.Union([
|
|
6
|
+
Type.Object({
|
|
7
|
+
type: Type.Literal("run_failed"),
|
|
8
|
+
}),
|
|
9
|
+
Type.Object({
|
|
10
|
+
type: Type.Literal("run_recovered"),
|
|
11
|
+
}),
|
|
12
|
+
Type.Object({
|
|
13
|
+
type: Type.Literal("consecutive_failures"),
|
|
14
|
+
threshold: Type.Number({ minimum: 1 }),
|
|
15
|
+
}),
|
|
16
|
+
Type.Object({
|
|
17
|
+
type: Type.Literal("success_rate_below"),
|
|
18
|
+
threshold: Type.Number({ minimum: 0, maximum: 100 }),
|
|
19
|
+
window_minutes: Type.Number({ minimum: 1 }),
|
|
20
|
+
}),
|
|
21
|
+
Type.Object({
|
|
22
|
+
type: Type.Literal("latency_above"),
|
|
23
|
+
threshold_ms: Type.Number({ minimum: 0 }),
|
|
24
|
+
percentile: Type.Union([
|
|
25
|
+
Type.Literal("p50"),
|
|
26
|
+
Type.Literal("p95"),
|
|
27
|
+
Type.Literal("p99"),
|
|
28
|
+
]),
|
|
29
|
+
window_minutes: Type.Number({ minimum: 1 }),
|
|
30
|
+
}),
|
|
31
|
+
], { $id: "NotificationTrigger" });
|
|
32
|
+
// =============================================================================
|
|
33
|
+
// Routing (discriminated union per provider)
|
|
34
|
+
// =============================================================================
|
|
35
|
+
export const SlackRoutingSchema = Type.Object({
|
|
36
|
+
provider: Type.Literal("slack"),
|
|
37
|
+
channel: Type.String(),
|
|
38
|
+
});
|
|
39
|
+
export const EmailRoutingSchema = Type.Object({
|
|
40
|
+
provider: Type.Literal("email"),
|
|
41
|
+
toAddresses: Type.Array(Type.String()),
|
|
42
|
+
});
|
|
43
|
+
export const WebhookRoutingSchema = Type.Object({
|
|
44
|
+
provider: Type.Literal("webhook"),
|
|
45
|
+
});
|
|
46
|
+
export const NotificationRoutingSchema = Type.Union([
|
|
47
|
+
SlackRoutingSchema,
|
|
48
|
+
EmailRoutingSchema,
|
|
49
|
+
WebhookRoutingSchema,
|
|
50
|
+
]);
|
|
51
|
+
// =============================================================================
|
|
52
|
+
// Monitor Notification (DSL config: trigger + integration + routing)
|
|
53
|
+
// =============================================================================
|
|
54
|
+
export const MonitorNotificationSchema = Type.Object({
|
|
55
|
+
trigger: NotificationTriggerSchema,
|
|
56
|
+
integration: Type.String(),
|
|
57
|
+
routing: NotificationRoutingSchema,
|
|
58
|
+
cooldown_minutes: Type.Optional(Type.Number({ minimum: 0 })),
|
|
59
|
+
}, { $id: "MonitorNotification" });
|
|
60
|
+
// =============================================================================
|
|
61
|
+
// Notification Builder (type-safe: provider-specific terminal methods)
|
|
62
|
+
// =============================================================================
|
|
63
|
+
class NotificationBuilder {
|
|
64
|
+
trigger;
|
|
65
|
+
cooldownMinutes;
|
|
66
|
+
constructor(trigger) {
|
|
67
|
+
this.trigger = trigger;
|
|
68
|
+
}
|
|
69
|
+
withCooldown(minutes) {
|
|
70
|
+
this.cooldownMinutes = minutes;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
toSlack(integration, channel) {
|
|
74
|
+
return {
|
|
75
|
+
trigger: this.trigger,
|
|
76
|
+
integration,
|
|
77
|
+
routing: { provider: "slack", channel },
|
|
78
|
+
...(this.cooldownMinutes !== undefined && {
|
|
79
|
+
cooldown_minutes: this.cooldownMinutes,
|
|
80
|
+
}),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
toEmail(integration, toAddresses) {
|
|
84
|
+
return {
|
|
85
|
+
trigger: this.trigger,
|
|
86
|
+
integration,
|
|
87
|
+
routing: { provider: "email", toAddresses },
|
|
88
|
+
...(this.cooldownMinutes !== undefined && {
|
|
89
|
+
cooldown_minutes: this.cooldownMinutes,
|
|
90
|
+
}),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
toWebhook(integration) {
|
|
94
|
+
return {
|
|
95
|
+
trigger: this.trigger,
|
|
96
|
+
integration,
|
|
97
|
+
routing: { provider: "webhook" },
|
|
98
|
+
...(this.cooldownMinutes !== undefined && {
|
|
99
|
+
cooldown_minutes: this.cooldownMinutes,
|
|
100
|
+
}),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// =============================================================================
|
|
105
|
+
// notify API
|
|
106
|
+
// =============================================================================
|
|
107
|
+
export const notify = {
|
|
108
|
+
onFailure: () => new NotificationBuilder({ type: "run_failed" }),
|
|
109
|
+
onRecovery: () => new NotificationBuilder({ type: "run_recovered" }),
|
|
110
|
+
onConsecutiveFailures: (threshold) => new NotificationBuilder({
|
|
111
|
+
type: "consecutive_failures",
|
|
112
|
+
threshold,
|
|
113
|
+
}),
|
|
114
|
+
onSuccessRateBelow: (threshold, window_minutes) => new NotificationBuilder({
|
|
115
|
+
type: "success_rate_below",
|
|
116
|
+
threshold,
|
|
117
|
+
window_minutes,
|
|
118
|
+
}),
|
|
119
|
+
onLatencyAbove: (options) => new NotificationBuilder({
|
|
120
|
+
type: "latency_above",
|
|
121
|
+
threshold_ms: options.threshold_ms,
|
|
122
|
+
percentile: options.percentile,
|
|
123
|
+
window_minutes: options.window_minutes,
|
|
124
|
+
}),
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=notif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AmB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAEjD,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,mBAAmB,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;IAEpD,qBAAqB,EAAE,CAAC,SAAiB,EAAE,EAAE,CAC3C,IAAI,mBAAmB,CAAC;QACtB,IAAI,EAAE,sBAAsB;QAC5B,SAAS;KACV,CAAC;IAEJ,kBAAkB,EAAE,CAAC,SAAiB,EAAE,cAAsB,EAAE,EAAE,CAChE,IAAI,mBAAmB,CAAC;QACtB,IAAI,EAAE,oBAAoB;QAC1B,SAAS;QACT,cAAc;KACf,CAAC;IAEJ,cAAc,EAAE,CAAC,OAIhB,EAAE,EAAE,CACH,IAAI,mBAAmB,CAAC;QACtB,IAAI,EAAE,eAAe;QACrB,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC;CACL,CAAC"}
|
package/dist/schema-exports.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* TypeBox schemas and enums for griffin test monitors.
|
|
3
3
|
* Import from "griffin/schema" to access validation schemas.
|
|
4
4
|
*/
|
|
5
|
-
export { SecretRefDataSchema, SecretRefSchema, StringLiteralSchema, VariableRefSchema, ResponseFormatSchema, HttpMethodSchema, HttpRequestDSLSchema, FrequencySchema, WaitSchema, JSONPathSchema, FrequencyUnitSchema, XMLPathSchema, TextPathSchema, UnaryPredicateSchema, UnaryPredicateOperatorSchema, BinaryPredicateOperatorSchema, BinaryPredicateSchema, AssertionSchema, AssertionsSchema, NodeDSLSchema, EdgeSchema, MonitorDSLSchema, MonitorDSLSchemaV1, ResolvedStringSchema, HttpRequestResolvedSchema, NodeResolvedSchema, ResolvedMonitorV1Schema, ResolvedMonitorSchema, FrequencyUnit, ResponseFormat, HttpMethod, NodeType, UnaryPredicate, BinaryPredicateOperator, CURRENT_MONITOR_VERSION, SUPPORTED_MONITOR_VERSIONS, } from "./schema.js";
|
|
5
|
+
export { SecretRefDataSchema, SecretRefSchema, StringLiteralSchema, VariableRefSchema, ResponseFormatSchema, HttpMethodSchema, HttpRequestDSLSchema, FrequencySchema, WaitSchema, JSONPathSchema, FrequencyUnitSchema, XMLPathSchema, TextPathSchema, UnaryPredicateSchema, UnaryPredicateOperatorSchema, BinaryPredicateOperatorSchema, BinaryPredicateSchema, AssertionSchema, AssertionsSchema, NodeDSLSchema, EdgeSchema, MonitorDSLSchema, MonitorDSLSchemaV1, MonitorNotificationSchema, ResolvedStringSchema, HttpRequestResolvedSchema, NodeResolvedSchema, ResolvedMonitorV1Schema, ResolvedMonitorSchema, FrequencyUnit, ResponseFormat, HttpMethod, NodeType, UnaryPredicate, BinaryPredicateOperator, CURRENT_MONITOR_VERSION, SUPPORTED_MONITOR_VERSIONS, } from "./schema.js";
|
|
6
|
+
export { IntegrationCategorySchema, NotificationProviderSchema, SecretsProviderSchema, ProviderSchema, } from "./integrations.js";
|
|
6
7
|
export type { MonitorDSL, MonitorDSLV1, NodeDSL, HttpRequestDSL, Edge, Frequency, Assertion, Assertions, SecretRef, VariableRef, ResolvedMonitor, ResolvedMonitorV1, NodeResolved, HttpRequestResolved, } from "./schema.js";
|
|
7
8
|
//# sourceMappingURL=schema-exports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-exports.d.ts","sourceRoot":"","sources":["../src/schema-exports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"schema-exports.d.ts","sourceRoot":"","sources":["../src/schema-exports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EAGzB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EAGrB,aAAa,EACb,cAAc,EACd,UAAU,EACV,QAAQ,EACR,cAAc,EACd,uBAAuB,EAGvB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,UAAU,EACV,YAAY,EACZ,OAAO,EACP,cAAc,EACd,IAAI,EACJ,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
package/dist/schema-exports.js
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export {
|
|
6
6
|
// Schema values - DSL (what users write)
|
|
7
|
-
SecretRefDataSchema, SecretRefSchema, StringLiteralSchema, VariableRefSchema, ResponseFormatSchema, HttpMethodSchema, HttpRequestDSLSchema, FrequencySchema, WaitSchema, JSONPathSchema, FrequencyUnitSchema, XMLPathSchema, TextPathSchema, UnaryPredicateSchema, UnaryPredicateOperatorSchema, BinaryPredicateOperatorSchema, BinaryPredicateSchema, AssertionSchema, AssertionsSchema, NodeDSLSchema, EdgeSchema, MonitorDSLSchema, MonitorDSLSchemaV1,
|
|
7
|
+
SecretRefDataSchema, SecretRefSchema, StringLiteralSchema, VariableRefSchema, ResponseFormatSchema, HttpMethodSchema, HttpRequestDSLSchema, FrequencySchema, WaitSchema, JSONPathSchema, FrequencyUnitSchema, XMLPathSchema, TextPathSchema, UnaryPredicateSchema, UnaryPredicateOperatorSchema, BinaryPredicateOperatorSchema, BinaryPredicateSchema, AssertionSchema, AssertionsSchema, NodeDSLSchema, EdgeSchema, MonitorDSLSchema, MonitorDSLSchemaV1, MonitorNotificationSchema,
|
|
8
8
|
// Schema values - Resolved (what hub/executor use)
|
|
9
9
|
ResolvedStringSchema, HttpRequestResolvedSchema, NodeResolvedSchema, ResolvedMonitorV1Schema, ResolvedMonitorSchema,
|
|
10
10
|
// Enums (runtime values)
|
|
11
11
|
FrequencyUnit, ResponseFormat, HttpMethod, NodeType, BinaryPredicateOperator,
|
|
12
12
|
// Constants
|
|
13
13
|
CURRENT_MONITOR_VERSION, SUPPORTED_MONITOR_VERSIONS, } from "./schema.js";
|
|
14
|
+
export { IntegrationCategorySchema, NotificationProviderSchema, SecretsProviderSchema, ProviderSchema, } from "./integrations.js";
|
|
14
15
|
//# sourceMappingURL=schema-exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-exports.js","sourceRoot":"","sources":["../src/schema-exports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO;AACL,yCAAyC;AACzC,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,kBAAkB;
|
|
1
|
+
{"version":3,"file":"schema-exports.js","sourceRoot":"","sources":["../src/schema-exports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO;AACL,yCAAyC;AACzC,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB;AAEzB,mDAAmD;AACnD,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB;AAErB,yBAAyB;AACzB,aAAa,EACb,cAAc,EACd,UAAU,EACV,QAAQ,EAER,uBAAuB;AAEvB,YAAY;AACZ,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,cAAc,GACf,MAAM,mBAAmB,CAAC"}
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Type, type Static } from "typebox";
|
|
2
|
+
export { MonitorNotificationSchema } from "./notifications.js";
|
|
3
|
+
export type { MonitorNotification } from "./notifications.js";
|
|
2
4
|
export declare const CURRENT_MONITOR_VERSION = "1.0";
|
|
3
5
|
export declare const SUPPORTED_MONITOR_VERSIONS: readonly ["1.0"];
|
|
4
6
|
export declare const SecretRefDataSchema: Type.TObject<{
|
|
@@ -408,6 +410,36 @@ export declare const MonitorDSLSchemaV1: Type.TObject<{
|
|
|
408
410
|
every: Type.TNumber;
|
|
409
411
|
unit: Type.TUnsafe<FrequencyUnit>;
|
|
410
412
|
}>;
|
|
413
|
+
notifications: Type.TOptional<Type.TArray<Type.TObject<{
|
|
414
|
+
trigger: Type.TUnion<[Type.TObject<{
|
|
415
|
+
type: Type.TLiteral<"run_failed">;
|
|
416
|
+
}>, Type.TObject<{
|
|
417
|
+
type: Type.TLiteral<"run_recovered">;
|
|
418
|
+
}>, Type.TObject<{
|
|
419
|
+
type: Type.TLiteral<"consecutive_failures">;
|
|
420
|
+
threshold: Type.TNumber;
|
|
421
|
+
}>, Type.TObject<{
|
|
422
|
+
type: Type.TLiteral<"success_rate_below">;
|
|
423
|
+
threshold: Type.TNumber;
|
|
424
|
+
window_minutes: Type.TNumber;
|
|
425
|
+
}>, Type.TObject<{
|
|
426
|
+
type: Type.TLiteral<"latency_above">;
|
|
427
|
+
threshold_ms: Type.TNumber;
|
|
428
|
+
percentile: Type.TUnion<[Type.TLiteral<"p50">, Type.TLiteral<"p95">, Type.TLiteral<"p99">]>;
|
|
429
|
+
window_minutes: Type.TNumber;
|
|
430
|
+
}>]>;
|
|
431
|
+
integration: Type.TString;
|
|
432
|
+
routing: Type.TUnion<[Type.TObject<{
|
|
433
|
+
provider: Type.TLiteral<"slack">;
|
|
434
|
+
channel: Type.TString;
|
|
435
|
+
}>, Type.TObject<{
|
|
436
|
+
provider: Type.TLiteral<"email">;
|
|
437
|
+
toAddresses: Type.TArray<Type.TString>;
|
|
438
|
+
}>, Type.TObject<{
|
|
439
|
+
provider: Type.TLiteral<"webhook">;
|
|
440
|
+
}>]>;
|
|
441
|
+
cooldown_minutes: Type.TOptional<Type.TNumber>;
|
|
442
|
+
}>>>;
|
|
411
443
|
nodes: Type.TArray<Type.TUnion<[Type.TObject<{
|
|
412
444
|
id: Type.TString;
|
|
413
445
|
type: Type.TLiteral<NodeType.HTTP_REQUEST>;
|
|
@@ -532,6 +564,36 @@ export declare const MonitorDSLSchema: Type.TObject<{
|
|
|
532
564
|
every: Type.TNumber;
|
|
533
565
|
unit: Type.TUnsafe<FrequencyUnit>;
|
|
534
566
|
}>;
|
|
567
|
+
notifications: Type.TOptional<Type.TArray<Type.TObject<{
|
|
568
|
+
trigger: Type.TUnion<[Type.TObject<{
|
|
569
|
+
type: Type.TLiteral<"run_failed">;
|
|
570
|
+
}>, Type.TObject<{
|
|
571
|
+
type: Type.TLiteral<"run_recovered">;
|
|
572
|
+
}>, Type.TObject<{
|
|
573
|
+
type: Type.TLiteral<"consecutive_failures">;
|
|
574
|
+
threshold: Type.TNumber;
|
|
575
|
+
}>, Type.TObject<{
|
|
576
|
+
type: Type.TLiteral<"success_rate_below">;
|
|
577
|
+
threshold: Type.TNumber;
|
|
578
|
+
window_minutes: Type.TNumber;
|
|
579
|
+
}>, Type.TObject<{
|
|
580
|
+
type: Type.TLiteral<"latency_above">;
|
|
581
|
+
threshold_ms: Type.TNumber;
|
|
582
|
+
percentile: Type.TUnion<[Type.TLiteral<"p50">, Type.TLiteral<"p95">, Type.TLiteral<"p99">]>;
|
|
583
|
+
window_minutes: Type.TNumber;
|
|
584
|
+
}>]>;
|
|
585
|
+
integration: Type.TString;
|
|
586
|
+
routing: Type.TUnion<[Type.TObject<{
|
|
587
|
+
provider: Type.TLiteral<"slack">;
|
|
588
|
+
channel: Type.TString;
|
|
589
|
+
}>, Type.TObject<{
|
|
590
|
+
provider: Type.TLiteral<"email">;
|
|
591
|
+
toAddresses: Type.TArray<Type.TString>;
|
|
592
|
+
}>, Type.TObject<{
|
|
593
|
+
provider: Type.TLiteral<"webhook">;
|
|
594
|
+
}>]>;
|
|
595
|
+
cooldown_minutes: Type.TOptional<Type.TNumber>;
|
|
596
|
+
}>>>;
|
|
535
597
|
nodes: Type.TArray<Type.TUnion<[Type.TObject<{
|
|
536
598
|
id: Type.TString;
|
|
537
599
|
type: Type.TLiteral<NodeType.HTTP_REQUEST>;
|
|
@@ -780,6 +842,36 @@ export declare const ResolvedMonitorV1Schema: Type.TObject<{
|
|
|
780
842
|
every: Type.TNumber;
|
|
781
843
|
unit: Type.TUnsafe<FrequencyUnit>;
|
|
782
844
|
}>;
|
|
845
|
+
notifications: Type.TOptional<Type.TArray<Type.TObject<{
|
|
846
|
+
trigger: Type.TUnion<[Type.TObject<{
|
|
847
|
+
type: Type.TLiteral<"run_failed">;
|
|
848
|
+
}>, Type.TObject<{
|
|
849
|
+
type: Type.TLiteral<"run_recovered">;
|
|
850
|
+
}>, Type.TObject<{
|
|
851
|
+
type: Type.TLiteral<"consecutive_failures">;
|
|
852
|
+
threshold: Type.TNumber;
|
|
853
|
+
}>, Type.TObject<{
|
|
854
|
+
type: Type.TLiteral<"success_rate_below">;
|
|
855
|
+
threshold: Type.TNumber;
|
|
856
|
+
window_minutes: Type.TNumber;
|
|
857
|
+
}>, Type.TObject<{
|
|
858
|
+
type: Type.TLiteral<"latency_above">;
|
|
859
|
+
threshold_ms: Type.TNumber;
|
|
860
|
+
percentile: Type.TUnion<[Type.TLiteral<"p50">, Type.TLiteral<"p95">, Type.TLiteral<"p99">]>;
|
|
861
|
+
window_minutes: Type.TNumber;
|
|
862
|
+
}>]>;
|
|
863
|
+
integration: Type.TString;
|
|
864
|
+
routing: Type.TUnion<[Type.TObject<{
|
|
865
|
+
provider: Type.TLiteral<"slack">;
|
|
866
|
+
channel: Type.TString;
|
|
867
|
+
}>, Type.TObject<{
|
|
868
|
+
provider: Type.TLiteral<"email">;
|
|
869
|
+
toAddresses: Type.TArray<Type.TString>;
|
|
870
|
+
}>, Type.TObject<{
|
|
871
|
+
provider: Type.TLiteral<"webhook">;
|
|
872
|
+
}>]>;
|
|
873
|
+
cooldown_minutes: Type.TOptional<Type.TNumber>;
|
|
874
|
+
}>>>;
|
|
783
875
|
environment: Type.TString;
|
|
784
876
|
nodes: Type.TArray<Type.TUnion<[Type.TObject<{
|
|
785
877
|
id: Type.TString;
|
|
@@ -876,6 +968,36 @@ export declare const ResolvedMonitorSchema: Type.TObject<{
|
|
|
876
968
|
every: Type.TNumber;
|
|
877
969
|
unit: Type.TUnsafe<FrequencyUnit>;
|
|
878
970
|
}>;
|
|
971
|
+
notifications: Type.TOptional<Type.TArray<Type.TObject<{
|
|
972
|
+
trigger: Type.TUnion<[Type.TObject<{
|
|
973
|
+
type: Type.TLiteral<"run_failed">;
|
|
974
|
+
}>, Type.TObject<{
|
|
975
|
+
type: Type.TLiteral<"run_recovered">;
|
|
976
|
+
}>, Type.TObject<{
|
|
977
|
+
type: Type.TLiteral<"consecutive_failures">;
|
|
978
|
+
threshold: Type.TNumber;
|
|
979
|
+
}>, Type.TObject<{
|
|
980
|
+
type: Type.TLiteral<"success_rate_below">;
|
|
981
|
+
threshold: Type.TNumber;
|
|
982
|
+
window_minutes: Type.TNumber;
|
|
983
|
+
}>, Type.TObject<{
|
|
984
|
+
type: Type.TLiteral<"latency_above">;
|
|
985
|
+
threshold_ms: Type.TNumber;
|
|
986
|
+
percentile: Type.TUnion<[Type.TLiteral<"p50">, Type.TLiteral<"p95">, Type.TLiteral<"p99">]>;
|
|
987
|
+
window_minutes: Type.TNumber;
|
|
988
|
+
}>]>;
|
|
989
|
+
integration: Type.TString;
|
|
990
|
+
routing: Type.TUnion<[Type.TObject<{
|
|
991
|
+
provider: Type.TLiteral<"slack">;
|
|
992
|
+
channel: Type.TString;
|
|
993
|
+
}>, Type.TObject<{
|
|
994
|
+
provider: Type.TLiteral<"email">;
|
|
995
|
+
toAddresses: Type.TArray<Type.TString>;
|
|
996
|
+
}>, Type.TObject<{
|
|
997
|
+
provider: Type.TLiteral<"webhook">;
|
|
998
|
+
}>]>;
|
|
999
|
+
cooldown_minutes: Type.TOptional<Type.TNumber>;
|
|
1000
|
+
}>>>;
|
|
879
1001
|
environment: Type.TString;
|
|
880
1002
|
nodes: Type.TArray<Type.TUnion<[Type.TObject<{
|
|
881
1003
|
id: Type.TString;
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/sch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;AAChD,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC3E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import { Ref, StringEnum } from "./shared.js";
|
|
3
|
+
import { MonitorNotificationSchema, } from "./notifications.js";
|
|
4
|
+
export { MonitorNotificationSchema } from "./notifications.js";
|
|
3
5
|
// Version constants
|
|
4
6
|
export const CURRENT_MONITOR_VERSION = "1.0";
|
|
5
7
|
export const SUPPORTED_MONITOR_VERSIONS = ["1.0"];
|
|
@@ -243,6 +245,7 @@ export const MonitorDSLSchemaV1 = Type.Object({
|
|
|
243
245
|
name: Type.String(),
|
|
244
246
|
version: Type.Literal("1.0"),
|
|
245
247
|
frequency: FrequencySchema,
|
|
248
|
+
notifications: Type.Optional(Type.Array(MonitorNotificationSchema)),
|
|
246
249
|
nodes: Type.Array(NodeDSLSchema),
|
|
247
250
|
edges: Type.Array(EdgeSchema),
|
|
248
251
|
}, {
|
|
@@ -277,6 +280,7 @@ export const ResolvedMonitorV1Schema = Type.Object({
|
|
|
277
280
|
name: Type.String(),
|
|
278
281
|
version: Type.Literal("1.0"),
|
|
279
282
|
frequency: FrequencySchema,
|
|
283
|
+
notifications: Type.Optional(Type.Array(MonitorNotificationSchema)),
|
|
280
284
|
environment: Type.String({ default: "default" }),
|
|
281
285
|
nodes: Type.Array(NodeResolvedSchema),
|
|
282
286
|
edges: Type.Array(EdgeSchema),
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,aAAa,CAA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AE,mBAAmB;CACzB,CACF,CAAC;AAEF,mDAAmD;AACnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type HttpRequestConfig, type WaitDuration } from "./builder.js";
|
|
2
2
|
import { Frequency, MonitorDSL, type Assertion as AssertionType } from "./schema.js";
|
|
3
|
+
import type { MonitorNotification } from "./notifications.js";
|
|
3
4
|
import { type StateProxy } from "./assertions.js";
|
|
4
5
|
/**
|
|
5
6
|
* Callback type for building assertions with type-safe state access
|
|
@@ -121,5 +122,6 @@ export declare function createTestBuilder(config: {
|
|
|
121
122
|
name: string;
|
|
122
123
|
frequency: Frequency;
|
|
123
124
|
locations?: string[];
|
|
125
|
+
notifications?: MonitorNotification[];
|
|
124
126
|
}): SequentialTestBuilder;
|
|
125
127
|
//# sourceMappingURL=sequential-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequential-builder.d.ts","sourceRoot":"","sources":["../src/sequential-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAIL,SAAS,EACT,UAAU,EAEV,KAAK,SAAS,IAAI,aAAa,EAChC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,SAAS,SAAS,MAAM,IAAI,CACxD,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,KACzB,aAAa,EAAE,CAAC;AAErB;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,SAAS,SAAS,MAAM,GAAG,KAAK;IACrE;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,IAAI,SAAS,MAAM,EACzB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,iBAAiB,GACxB,qBAAq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AE,YAAY,GACrB,qBAAqB,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAE3C;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,QAAQ,EAAE,iBAAiB,CAAC,SAAS,CAAC,GACrC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,KAAK,IAAI,UAAU,CAAC;CACrB;AAmHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACvC,GAAG,qBAAqB,CAExB"}
|
|
@@ -44,11 +44,11 @@ class SequentialTestBuilderImpl {
|
|
|
44
44
|
return this;
|
|
45
45
|
}
|
|
46
46
|
build() {
|
|
47
|
-
const { name, frequency, locations } = this.config;
|
|
47
|
+
const { name, frequency, locations, notifications } = this.config;
|
|
48
48
|
const edges = [];
|
|
49
49
|
// If no nodes, return empty monitor with just START->END
|
|
50
50
|
if (this.nodes.length === 0) {
|
|
51
|
-
|
|
51
|
+
const result = {
|
|
52
52
|
name,
|
|
53
53
|
frequency,
|
|
54
54
|
locations,
|
|
@@ -56,6 +56,10 @@ class SequentialTestBuilderImpl {
|
|
|
56
56
|
nodes: [],
|
|
57
57
|
edges: [{ from: START, to: END }],
|
|
58
58
|
};
|
|
59
|
+
if (notifications !== undefined && notifications.length > 0) {
|
|
60
|
+
result.notifications = notifications;
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
59
63
|
}
|
|
60
64
|
// Connect START to first node
|
|
61
65
|
edges.push({ from: START, to: this.nodes[0].id });
|
|
@@ -68,7 +72,7 @@ class SequentialTestBuilderImpl {
|
|
|
68
72
|
}
|
|
69
73
|
// Connect last node to END
|
|
70
74
|
edges.push({ from: this.nodes[this.nodes.length - 1].id, to: END });
|
|
71
|
-
|
|
75
|
+
const result = {
|
|
72
76
|
name,
|
|
73
77
|
version: CURRENT_MONITOR_VERSION,
|
|
74
78
|
frequency,
|
|
@@ -76,6 +80,10 @@ class SequentialTestBuilderImpl {
|
|
|
76
80
|
nodes: this.nodes,
|
|
77
81
|
edges,
|
|
78
82
|
};
|
|
83
|
+
if (notifications !== undefined && notifications.length > 0) {
|
|
84
|
+
result.notifications = notifications;
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
79
87
|
}
|
|
80
88
|
}
|
|
81
89
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequential-builder.js","sourceRoot":"","sources":["../src/sequential-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,IAAI,EACJ,SAAS,GAGV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,uBAAuB,EAKvB,cAAc,GAEf,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"sequential-builder.js","sourceRoot":"","sources":["../src/sequential-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,IAAI,EACJ,SAAS,GAGV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,uBAAuB,EAKvB,cAAc,GAEf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAC;AAyFpE;;GAEG;AACH,MAAM,yBAAyB;IAQnB;IALF,KAAK,GAAc,EAAE,CAAC;IACtB,SAAS,GAAa,EAAE,CAAC;IACzB,WAAW,GAAG,CAAC,CAAC;IAExB,YACU,MAKP;QALO,WAAM,GAAN,MAAM,CAKb;IACA,CAAC;IAEJ;;OAEG;IACK,gBAAgB;QACtB,OA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,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAEpE,MAAM,MAAM,GAAe;YACzB,IAAI;YACJ,OAAO,EAAE,uBAAuB;YAChC,SAAS;YACT,SAAS;YACT,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK;SACN,CAAC;QACF,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5D,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;QACvC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAKjC;IACC,OAAO,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC"}
|
package/dist/type-exports.d.ts
CHANGED
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
* Import from "griffin/types" for TypeScript type checking.
|
|
4
4
|
*/
|
|
5
5
|
export type { String, HttpRequestDSL, Frequency, Wait, VariableRef, BinaryPredicate, Assertion, Assertions, NodeDSL, Edge, MonitorDSL, } from "./schema.js";
|
|
6
|
+
export type { IntegrationCategory, NotificationProvider, SecretsProvider, Provider, } from "./integrations.js";
|
|
6
7
|
//# sourceMappingURL=type-exports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-exports.d.ts","sourceRoot":"","sources":["../src/type-exports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACV,MAAM,EACN,cAAc,EACd,SAAS,EACT,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,UAAU,EACV,OAAO,EACP,IAAI,EACJ,UAAU,GACX,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"type-exports.d.ts","sourceRoot":"","sources":["../src/type-exports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACV,MAAM,EACN,cAAc,EACd,SAAS,EACT,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,UAAU,EACV,OAAO,EACP,IAAI,EACJ,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,QAAQ,GACT,MAAM,mBAAmB,CAAC"}
|
package/package.json
CHANGED
package/src/builder.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Assertions,
|
|
13
13
|
CURRENT_MONITOR_VERSION,
|
|
14
14
|
} from "./schema.js";
|
|
15
|
+
import type { MonitorNotification } from "./notifications.js";
|
|
15
16
|
import { type START as StartType, type END as EndType } from "./constants.js";
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -121,6 +122,7 @@ class TestBuilderImpl<
|
|
|
121
122
|
name: string;
|
|
122
123
|
frequency: Frequency;
|
|
123
124
|
locations?: string[];
|
|
125
|
+
notifications?: MonitorNotification[];
|
|
124
126
|
},
|
|
125
127
|
) {}
|
|
126
128
|
|
|
@@ -156,12 +158,12 @@ class TestBuilderImpl<
|
|
|
156
158
|
}
|
|
157
159
|
|
|
158
160
|
get build(): TestBuilder<NodeName, HasOutput, HasInput>["build"] {
|
|
159
|
-
const { name, frequency, locations } = this.config;
|
|
161
|
+
const { name, frequency, locations, notifications } = this.config;
|
|
160
162
|
const nodes = this.nodes;
|
|
161
163
|
const edges = this.edges;
|
|
162
164
|
|
|
163
165
|
const buildFn = (): MonitorDSL => {
|
|
164
|
-
|
|
166
|
+
const result: MonitorDSL = {
|
|
165
167
|
name,
|
|
166
168
|
version: CURRENT_MONITOR_VERSION,
|
|
167
169
|
frequency,
|
|
@@ -169,6 +171,10 @@ class TestBuilderImpl<
|
|
|
169
171
|
nodes,
|
|
170
172
|
edges,
|
|
171
173
|
};
|
|
174
|
+
if (notifications !== undefined && notifications.length > 0) {
|
|
175
|
+
result.notifications = notifications;
|
|
176
|
+
}
|
|
177
|
+
return result;
|
|
172
178
|
};
|
|
173
179
|
|
|
174
180
|
// Type assertion: build is only callable when graph constraints are satisfied
|
|
@@ -203,6 +209,7 @@ export function createGraphBuilder(config: {
|
|
|
203
209
|
name: string;
|
|
204
210
|
frequency: Frequency;
|
|
205
211
|
locations?: string[];
|
|
212
|
+
notifications?: MonitorNotification[];
|
|
206
213
|
}): TestBuilder {
|
|
207
214
|
return new TestBuilderImpl(config);
|
|
208
215
|
}
|
package/src/index.ts
CHANGED
|
@@ -38,6 +38,22 @@ export { variable, isVariableRef } from "./variable.js";
|
|
|
38
38
|
export type { VariableRef } from "./variable.js";
|
|
39
39
|
export { secret, isSecretRef } from "./secrets.js";
|
|
40
40
|
export type { SecretOptions } from "./secrets.js";
|
|
41
|
+
export { notify } from "./notifications.js";
|
|
42
|
+
export {
|
|
43
|
+
MonitorNotificationSchema,
|
|
44
|
+
NotificationRoutingSchema,
|
|
45
|
+
SlackRoutingSchema,
|
|
46
|
+
EmailRoutingSchema,
|
|
47
|
+
WebhookRoutingSchema,
|
|
48
|
+
} from "./notifications.js";
|
|
49
|
+
export type {
|
|
50
|
+
NotificationTrigger,
|
|
51
|
+
MonitorNotification,
|
|
52
|
+
NotificationRouting,
|
|
53
|
+
SlackRouting,
|
|
54
|
+
EmailRouting,
|
|
55
|
+
WebhookRouting,
|
|
56
|
+
} from "./notifications.js";
|
|
41
57
|
|
|
42
58
|
// ============================================================================
|
|
43
59
|
// DSL Constants
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Type, type Static } from "typebox";
|
|
2
|
+
import { StringEnum } from "./shared.js";
|
|
3
|
+
export const IntegrationCategorySchema = StringEnum([
|
|
4
|
+
"notifications",
|
|
5
|
+
"secrets",
|
|
6
|
+
"metrics",
|
|
7
|
+
], {$id: "IntegrationCategory"});
|
|
8
|
+
|
|
9
|
+
export const NotificationProviderSchema = StringEnum([
|
|
10
|
+
"slack",
|
|
11
|
+
"email",
|
|
12
|
+
"webhook",
|
|
13
|
+
], {$id: "NotificationProvider"});
|
|
14
|
+
|
|
15
|
+
export const SecretsProviderSchema = StringEnum([
|
|
16
|
+
//Type.Literal("env"),
|
|
17
|
+
"aws",
|
|
18
|
+
"vault",
|
|
19
|
+
], {$id: "SecretsProvider"});
|
|
20
|
+
export const ProviderSchema = StringEnum([
|
|
21
|
+
"aws",
|
|
22
|
+
"vault",
|
|
23
|
+
"slack",
|
|
24
|
+
"email",
|
|
25
|
+
"webhook",
|
|
26
|
+
], {$id: "Provider"});
|
|
27
|
+
|
|
28
|
+
export type IntegrationCategory = Static<typeof IntegrationCategorySchema>;
|
|
29
|
+
|
|
30
|
+
export type SecretsProvider = Static<typeof SecretsProviderSchema>;
|
|
31
|
+
export type NotificationProvider = Static<typeof NotificationProviderSchema>;
|
|
32
|
+
export type Provider = Static<typeof ProviderSchema>;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { Type, type Static } from "typebox";
|
|
2
|
+
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Trigger Types (matches hub NotificationTriggerSchema)
|
|
5
|
+
// =============================================================================
|
|
6
|
+
|
|
7
|
+
export const NotificationTriggerSchema = Type.Union([
|
|
8
|
+
Type.Object({
|
|
9
|
+
type: Type.Literal("run_failed"),
|
|
10
|
+
}),
|
|
11
|
+
Type.Object({
|
|
12
|
+
type: Type.Literal("run_recovered"),
|
|
13
|
+
}),
|
|
14
|
+
Type.Object({
|
|
15
|
+
type: Type.Literal("consecutive_failures"),
|
|
16
|
+
threshold: Type.Number({ minimum: 1 }),
|
|
17
|
+
}),
|
|
18
|
+
Type.Object({
|
|
19
|
+
type: Type.Literal("success_rate_below"),
|
|
20
|
+
threshold: Type.Number({ minimum: 0, maximum: 100 }),
|
|
21
|
+
window_minutes: Type.Number({ minimum: 1 }),
|
|
22
|
+
}),
|
|
23
|
+
Type.Object({
|
|
24
|
+
type: Type.Literal("latency_above"),
|
|
25
|
+
threshold_ms: Type.Number({ minimum: 0 }),
|
|
26
|
+
percentile: Type.Union([
|
|
27
|
+
Type.Literal("p50"),
|
|
28
|
+
Type.Literal("p95"),
|
|
29
|
+
Type.Literal("p99"),
|
|
30
|
+
]),
|
|
31
|
+
window_minutes: Type.Number({ minimum: 1 }),
|
|
32
|
+
}),
|
|
33
|
+
], { $id: "NotificationTrigger" });
|
|
34
|
+
|
|
35
|
+
export type NotificationTrigger = Static<typeof NotificationTriggerSchema>;
|
|
36
|
+
|
|
37
|
+
// =============================================================================
|
|
38
|
+
// Routing (discriminated union per provider)
|
|
39
|
+
// =============================================================================
|
|
40
|
+
|
|
41
|
+
export const SlackRoutingSchema = Type.Object({
|
|
42
|
+
provider: Type.Literal("slack"),
|
|
43
|
+
channel: Type.String(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const EmailRoutingSchema = Type.Object({
|
|
47
|
+
provider: Type.Literal("email"),
|
|
48
|
+
toAddresses: Type.Array(Type.String()),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const WebhookRoutingSchema = Type.Object({
|
|
52
|
+
provider: Type.Literal("webhook"),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const NotificationRoutingSchema = Type.Union([
|
|
56
|
+
SlackRoutingSchema,
|
|
57
|
+
EmailRoutingSchema,
|
|
58
|
+
WebhookRoutingSchema,
|
|
59
|
+
]);
|
|
60
|
+
|
|
61
|
+
export type SlackRouting = Static<typeof SlackRoutingSchema>;
|
|
62
|
+
export type EmailRouting = Static<typeof EmailRoutingSchema>;
|
|
63
|
+
export type WebhookRouting = Static<typeof WebhookRoutingSchema>;
|
|
64
|
+
export type NotificationRouting = Static<typeof NotificationRoutingSchema>;
|
|
65
|
+
|
|
66
|
+
// =============================================================================
|
|
67
|
+
// Monitor Notification (DSL config: trigger + integration + routing)
|
|
68
|
+
// =============================================================================
|
|
69
|
+
|
|
70
|
+
export const MonitorNotificationSchema = Type.Object(
|
|
71
|
+
{
|
|
72
|
+
trigger: NotificationTriggerSchema,
|
|
73
|
+
integration: Type.String(),
|
|
74
|
+
routing: NotificationRoutingSchema,
|
|
75
|
+
cooldown_minutes: Type.Optional(Type.Number({ minimum: 0 })),
|
|
76
|
+
},
|
|
77
|
+
{ $id: "MonitorNotification" },
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export type MonitorNotification = Static<typeof MonitorNotificationSchema>;
|
|
81
|
+
|
|
82
|
+
// =============================================================================
|
|
83
|
+
// Notification Builder (type-safe: provider-specific terminal methods)
|
|
84
|
+
// =============================================================================
|
|
85
|
+
|
|
86
|
+
class NotificationBuilder {
|
|
87
|
+
private trigger: NotificationTrigger;
|
|
88
|
+
private cooldownMinutes?: number;
|
|
89
|
+
|
|
90
|
+
constructor(trigger: NotificationTrigger) {
|
|
91
|
+
this.trigger = trigger;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
withCooldown(minutes: number): this {
|
|
95
|
+
this.cooldownMinutes = minutes;
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
toSlack(integration: string, channel: string): MonitorNotification {
|
|
100
|
+
return {
|
|
101
|
+
trigger: this.trigger,
|
|
102
|
+
integration,
|
|
103
|
+
routing: { provider: "slack", channel },
|
|
104
|
+
...(this.cooldownMinutes !== undefined && {
|
|
105
|
+
cooldown_minutes: this.cooldownMinutes,
|
|
106
|
+
}),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
toEmail(integration: string, toAddresses: string[]): MonitorNotification {
|
|
111
|
+
return {
|
|
112
|
+
trigger: this.trigger,
|
|
113
|
+
integration,
|
|
114
|
+
routing: { provider: "email", toAddresses },
|
|
115
|
+
...(this.cooldownMinutes !== undefined && {
|
|
116
|
+
cooldown_minutes: this.cooldownMinutes,
|
|
117
|
+
}),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
toWebhook(integration: string): MonitorNotification {
|
|
122
|
+
return {
|
|
123
|
+
trigger: this.trigger,
|
|
124
|
+
integration,
|
|
125
|
+
routing: { provider: "webhook" },
|
|
126
|
+
...(this.cooldownMinutes !== undefined && {
|
|
127
|
+
cooldown_minutes: this.cooldownMinutes,
|
|
128
|
+
}),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// =============================================================================
|
|
134
|
+
// notify API
|
|
135
|
+
// =============================================================================
|
|
136
|
+
|
|
137
|
+
export const notify = {
|
|
138
|
+
onFailure: () =>
|
|
139
|
+
new NotificationBuilder({ type: "run_failed" }),
|
|
140
|
+
|
|
141
|
+
onRecovery: () =>
|
|
142
|
+
new NotificationBuilder({ type: "run_recovered" }),
|
|
143
|
+
|
|
144
|
+
onConsecutiveFailures: (threshold: number) =>
|
|
145
|
+
new NotificationBuilder({
|
|
146
|
+
type: "consecutive_failures",
|
|
147
|
+
threshold,
|
|
148
|
+
}),
|
|
149
|
+
|
|
150
|
+
onSuccessRateBelow: (threshold: number, window_minutes: number) =>
|
|
151
|
+
new NotificationBuilder({
|
|
152
|
+
type: "success_rate_below",
|
|
153
|
+
threshold,
|
|
154
|
+
window_minutes,
|
|
155
|
+
}),
|
|
156
|
+
|
|
157
|
+
onLatencyAbove: (options: {
|
|
158
|
+
threshold_ms: number;
|
|
159
|
+
percentile: "p50" | "p95" | "p99";
|
|
160
|
+
window_minutes: number;
|
|
161
|
+
}) =>
|
|
162
|
+
new NotificationBuilder({
|
|
163
|
+
type: "latency_above",
|
|
164
|
+
threshold_ms: options.threshold_ms,
|
|
165
|
+
percentile: options.percentile,
|
|
166
|
+
window_minutes: options.window_minutes,
|
|
167
|
+
}),
|
|
168
|
+
};
|
package/src/schema-exports.ts
CHANGED
|
@@ -28,6 +28,7 @@ export {
|
|
|
28
28
|
EdgeSchema,
|
|
29
29
|
MonitorDSLSchema,
|
|
30
30
|
MonitorDSLSchemaV1,
|
|
31
|
+
MonitorNotificationSchema,
|
|
31
32
|
|
|
32
33
|
// Schema values - Resolved (what hub/executor use)
|
|
33
34
|
ResolvedStringSchema,
|
|
@@ -49,6 +50,14 @@ export {
|
|
|
49
50
|
SUPPORTED_MONITOR_VERSIONS,
|
|
50
51
|
} from "./schema.js";
|
|
51
52
|
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
IntegrationCategorySchema,
|
|
56
|
+
NotificationProviderSchema,
|
|
57
|
+
SecretsProviderSchema,
|
|
58
|
+
ProviderSchema,
|
|
59
|
+
} from "./integrations.js";
|
|
60
|
+
|
|
52
61
|
// Type exports
|
|
53
62
|
export type {
|
|
54
63
|
MonitorDSL,
|
package/src/schema.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { Type, type Static } from "typebox";
|
|
2
2
|
import { Ref, StringEnum } from "./shared.js";
|
|
3
|
+
import {
|
|
4
|
+
MonitorNotificationSchema,
|
|
5
|
+
type MonitorNotification,
|
|
6
|
+
} from "./notifications.js";
|
|
7
|
+
|
|
8
|
+
export { MonitorNotificationSchema } from "./notifications.js";
|
|
9
|
+
export type { MonitorNotification } from "./notifications.js";
|
|
3
10
|
|
|
4
11
|
// Version constants
|
|
5
12
|
export const CURRENT_MONITOR_VERSION = "1.0";
|
|
@@ -319,6 +326,7 @@ export const MonitorDSLSchemaV1 = Type.Object(
|
|
|
319
326
|
name: Type.String(),
|
|
320
327
|
version: Type.Literal("1.0"),
|
|
321
328
|
frequency: FrequencySchema,
|
|
329
|
+
notifications: Type.Optional(Type.Array(MonitorNotificationSchema)),
|
|
322
330
|
nodes: Type.Array(NodeDSLSchema),
|
|
323
331
|
edges: Type.Array(EdgeSchema),
|
|
324
332
|
},
|
|
@@ -388,6 +396,7 @@ export const ResolvedMonitorV1Schema = Type.Object(
|
|
|
388
396
|
name: Type.String(),
|
|
389
397
|
version: Type.Literal("1.0"),
|
|
390
398
|
frequency: FrequencySchema,
|
|
399
|
+
notifications: Type.Optional(Type.Array(MonitorNotificationSchema)),
|
|
391
400
|
environment: Type.String({ default: "default" }),
|
|
392
401
|
nodes: Type.Array(NodeResolvedSchema),
|
|
393
402
|
edges: Type.Array(EdgeSchema),
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
ResponseFormat,
|
|
16
16
|
type Assertion as AssertionType,
|
|
17
17
|
} from "./schema.js";
|
|
18
|
+
import type { MonitorNotification } from "./notifications.js";
|
|
18
19
|
import { createStateProxy, type StateProxy } from "./assertions.js";
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -119,6 +120,7 @@ class SequentialTestBuilderImpl<
|
|
|
119
120
|
name: string;
|
|
120
121
|
frequency: Frequency;
|
|
121
122
|
locations?: string[];
|
|
123
|
+
notifications?: MonitorNotification[];
|
|
122
124
|
},
|
|
123
125
|
) {}
|
|
124
126
|
|
|
@@ -168,12 +170,12 @@ class SequentialTestBuilderImpl<
|
|
|
168
170
|
}
|
|
169
171
|
|
|
170
172
|
build(): MonitorDSL {
|
|
171
|
-
const { name, frequency, locations } = this.config;
|
|
173
|
+
const { name, frequency, locations, notifications } = this.config;
|
|
172
174
|
const edges: Edge[] = [];
|
|
173
175
|
|
|
174
176
|
// If no nodes, return empty monitor with just START->END
|
|
175
177
|
if (this.nodes.length === 0) {
|
|
176
|
-
|
|
178
|
+
const result: MonitorDSL = {
|
|
177
179
|
name,
|
|
178
180
|
frequency,
|
|
179
181
|
locations,
|
|
@@ -181,6 +183,10 @@ class SequentialTestBuilderImpl<
|
|
|
181
183
|
nodes: [],
|
|
182
184
|
edges: [{ from: START, to: END }],
|
|
183
185
|
};
|
|
186
|
+
if (notifications !== undefined && notifications.length > 0) {
|
|
187
|
+
result.notifications = notifications;
|
|
188
|
+
}
|
|
189
|
+
return result;
|
|
184
190
|
}
|
|
185
191
|
|
|
186
192
|
// Connect START to first node
|
|
@@ -197,7 +203,7 @@ class SequentialTestBuilderImpl<
|
|
|
197
203
|
// Connect last node to END
|
|
198
204
|
edges.push({ from: this.nodes[this.nodes.length - 1].id, to: END });
|
|
199
205
|
|
|
200
|
-
|
|
206
|
+
const result: MonitorDSL = {
|
|
201
207
|
name,
|
|
202
208
|
version: CURRENT_MONITOR_VERSION,
|
|
203
209
|
frequency,
|
|
@@ -205,6 +211,10 @@ class SequentialTestBuilderImpl<
|
|
|
205
211
|
nodes: this.nodes,
|
|
206
212
|
edges,
|
|
207
213
|
};
|
|
214
|
+
if (notifications !== undefined && notifications.length > 0) {
|
|
215
|
+
result.notifications = notifications;
|
|
216
|
+
}
|
|
217
|
+
return result;
|
|
208
218
|
}
|
|
209
219
|
}
|
|
210
220
|
|
|
@@ -256,6 +266,7 @@ export function createTestBuilder(config: {
|
|
|
256
266
|
name: string;
|
|
257
267
|
frequency: Frequency;
|
|
258
268
|
locations?: string[];
|
|
269
|
+
notifications?: MonitorNotification[];
|
|
259
270
|
}): SequentialTestBuilder {
|
|
260
271
|
return new SequentialTestBuilderImpl(config);
|
|
261
272
|
}
|