@griffin-app/griffin-ts 0.1.18 → 0.1.20
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/integrations.d.ts +2 -2
- package/dist/integrations.d.ts.map +1 -1
- package/dist/integrations.js +2 -0
- package/dist/integrations.js.map +1 -1
- package/dist/notifications.d.ts +2 -2
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +4 -4
- package/dist/notifications.js.map +1 -1
- package/dist/target.d.ts +33 -0
- package/dist/target.d.ts.map +1 -0
- package/dist/target.js +53 -0
- package/dist/target.js.map +1 -0
- package/package.json +1 -1
- package/src/integrations.ts +2 -0
- package/src/notifications.ts +4 -4
package/dist/integrations.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Type, type Static } from "typebox";
|
|
2
2
|
export declare const IntegrationCategorySchema: Type.TUnsafe<"notifications" | "secrets" | "metrics">;
|
|
3
|
-
export declare const NotificationProviderSchema: Type.TUnsafe<"slack" | "email" | "webhook">;
|
|
3
|
+
export declare const NotificationProviderSchema: Type.TUnsafe<"slack" | "email" | "webhook" | "resend">;
|
|
4
4
|
export declare const SecretsProviderSchema: Type.TUnsafe<"aws" | "vault">;
|
|
5
|
-
export declare const ProviderSchema: Type.TUnsafe<"slack" | "email" | "webhook" | "aws" | "vault">;
|
|
5
|
+
export declare const ProviderSchema: Type.TUnsafe<"slack" | "email" | "webhook" | "resend" | "aws" | "vault">;
|
|
6
6
|
export type IntegrationCategory = Static<typeof IntegrationCategorySchema>;
|
|
7
7
|
export type SecretsProvider = Static<typeof SecretsProviderSchema>;
|
|
8
8
|
export type NotificationProvider = Static<typeof NotificationProviderSchema>;
|
|
@@ -1 +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,
|
|
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,wDAKN,CAAC;AAElC,eAAO,MAAM,qBAAqB,+BAIN,CAAC;AAC7B,eAAO,MAAM,cAAc,0EAON,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"}
|
package/dist/integrations.js
CHANGED
|
@@ -8,6 +8,7 @@ export const NotificationProviderSchema = StringEnum([
|
|
|
8
8
|
"slack",
|
|
9
9
|
"email",
|
|
10
10
|
"webhook",
|
|
11
|
+
"resend",
|
|
11
12
|
], { $id: "NotificationProvider" });
|
|
12
13
|
export const SecretsProviderSchema = StringEnum([
|
|
13
14
|
//Type.Literal("env"),
|
|
@@ -20,5 +21,6 @@ export const ProviderSchema = StringEnum([
|
|
|
20
21
|
"slack",
|
|
21
22
|
"email",
|
|
22
23
|
"webhook",
|
|
24
|
+
"resend",
|
|
23
25
|
], { $id: "Provider" });
|
|
24
26
|
//# sourceMappingURL=integrations.js.map
|
package/dist/integrations.js.map
CHANGED
|
@@ -1 +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;
|
|
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;IACT,QAAQ;CACT,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;IACT,QAAQ;CACT,EAAE,EAAC,GAAG,EAAE,UAAU,EAAC,CAAC,CAAC"}
|
package/dist/notifications.d.ts
CHANGED
|
@@ -77,8 +77,8 @@ declare class NotificationBuilder {
|
|
|
77
77
|
private cooldownMinutes?;
|
|
78
78
|
constructor(trigger: NotificationTrigger);
|
|
79
79
|
withCooldown(minutes: number): this;
|
|
80
|
-
toSlack(channel: string): MonitorNotification;
|
|
81
|
-
toEmail(toAddresses: string[]): MonitorNotification;
|
|
80
|
+
toSlack(integration: string, channel: string): MonitorNotification;
|
|
81
|
+
toEmail(integration: string, toAddresses: string[]): MonitorNotification;
|
|
82
82
|
toWebhook(integration: string): MonitorNotification;
|
|
83
83
|
}
|
|
84
84
|
export declare const notify: {
|
|
@@ -1 +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,OAAO,EAAE,MAAM,GAAG,mBAAmB;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AAM,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"}
|
package/dist/notifications.js
CHANGED
|
@@ -70,20 +70,20 @@ class NotificationBuilder {
|
|
|
70
70
|
this.cooldownMinutes = minutes;
|
|
71
71
|
return this;
|
|
72
72
|
}
|
|
73
|
-
toSlack(channel) {
|
|
73
|
+
toSlack(integration, channel) {
|
|
74
74
|
return {
|
|
75
75
|
trigger: this.trigger,
|
|
76
|
-
integration
|
|
76
|
+
integration,
|
|
77
77
|
routing: { provider: "slack", channel },
|
|
78
78
|
...(this.cooldownMinutes !== undefined && {
|
|
79
79
|
cooldown_minutes: this.cooldownMinutes,
|
|
80
80
|
}),
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
toEmail(toAddresses) {
|
|
83
|
+
toEmail(integration, toAddresses) {
|
|
84
84
|
return {
|
|
85
85
|
trigger: this.trigger,
|
|
86
|
-
integration
|
|
86
|
+
integration,
|
|
87
87
|
routing: { provider: "email", toAddresses },
|
|
88
88
|
...(this.cooldownMinutes !== undefined && {
|
|
89
89
|
cooldown_minutes: this.cooldownMinutes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,SAAS,CAAC;AAE5C,gFAAgF;AAChF,wDAAwD;AACxD,gFAAgF;AAEhF,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,KAAK,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC;QACV,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;KACjC,CAAC;IACF,IAAI,CA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,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/target.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Target reference utilities for griffin DSL.
|
|
3
|
+
*
|
|
4
|
+
* Targets are resolved at runtime by the runner based on the execution environment.
|
|
5
|
+
* This allows the same test to run against different environments (staging, production, etc.)
|
|
6
|
+
* without changing the test code.
|
|
7
|
+
*/
|
|
8
|
+
import { TargetRef } from "./schema.js";
|
|
9
|
+
/**
|
|
10
|
+
* Create a target reference for endpoint base URLs.
|
|
11
|
+
*
|
|
12
|
+
* The runner will resolve this to the appropriate base URL based on the
|
|
13
|
+
* execution environment (passed as a per-run parameter).
|
|
14
|
+
*
|
|
15
|
+
* @param key - The target identifier (e.g., "billing-service", "api-gateway")
|
|
16
|
+
* @returns A target reference object
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* builder.addNode("billing", Endpoint({
|
|
21
|
+
* method: GET,
|
|
22
|
+
* path: "/invoices",
|
|
23
|
+
* base: target("billing-service"),
|
|
24
|
+
* response_format: JSON
|
|
25
|
+
* }));
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function target(key: string): TargetRef;
|
|
29
|
+
/**
|
|
30
|
+
* Type guard to check if a value is a target reference.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isTargetRef(value: unknown): value is TargetRef;
|
|
33
|
+
//# sourceMappingURL=target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../src/target.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAa7C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAO9D"}
|
package/dist/target.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Target reference utilities for griffin DSL.
|
|
4
|
+
*
|
|
5
|
+
* Targets are resolved at runtime by the runner based on the execution environment.
|
|
6
|
+
* This allows the same test to run against different environments (staging, production, etc.)
|
|
7
|
+
* without changing the test code.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.target = target;
|
|
11
|
+
exports.isTargetRef = isTargetRef;
|
|
12
|
+
/**
|
|
13
|
+
* Create a target reference for endpoint base URLs.
|
|
14
|
+
*
|
|
15
|
+
* The runner will resolve this to the appropriate base URL based on the
|
|
16
|
+
* execution environment (passed as a per-run parameter).
|
|
17
|
+
*
|
|
18
|
+
* @param key - The target identifier (e.g., "billing-service", "api-gateway")
|
|
19
|
+
* @returns A target reference object
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* builder.addNode("billing", Endpoint({
|
|
24
|
+
* method: GET,
|
|
25
|
+
* path: "/invoices",
|
|
26
|
+
* base: target("billing-service"),
|
|
27
|
+
* response_format: JSON
|
|
28
|
+
* }));
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
function target(key) {
|
|
32
|
+
if (!key || typeof key !== "string") {
|
|
33
|
+
throw new Error(`Target key must be a non-empty string. Got: ${key}`);
|
|
34
|
+
}
|
|
35
|
+
if (key.trim() === "") {
|
|
36
|
+
throw new Error("Target key cannot be empty or whitespace only");
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
type: "target",
|
|
40
|
+
key: key.trim(),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Type guard to check if a value is a target reference.
|
|
45
|
+
*/
|
|
46
|
+
function isTargetRef(value) {
|
|
47
|
+
if (typeof value !== "object" || value === null) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
const obj = value;
|
|
51
|
+
return obj.type === "target" && typeof obj.key === "string";
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.js","sourceRoot":"","sources":["../src/target.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAuBH,wBAaC;AAKD,kCAOC;AA5CD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,MAAM,CAAC,GAAW;IAChC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,+CAA+C,GAAG,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE;KAChB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC;AAC9D,CAAC"}
|
package/package.json
CHANGED
package/src/integrations.ts
CHANGED
|
@@ -10,6 +10,7 @@ export const NotificationProviderSchema = StringEnum([
|
|
|
10
10
|
"slack",
|
|
11
11
|
"email",
|
|
12
12
|
"webhook",
|
|
13
|
+
"resend",
|
|
13
14
|
], {$id: "NotificationProvider"});
|
|
14
15
|
|
|
15
16
|
export const SecretsProviderSchema = StringEnum([
|
|
@@ -23,6 +24,7 @@ export const ProviderSchema = StringEnum([
|
|
|
23
24
|
"slack",
|
|
24
25
|
"email",
|
|
25
26
|
"webhook",
|
|
27
|
+
"resend",
|
|
26
28
|
], {$id: "Provider"});
|
|
27
29
|
|
|
28
30
|
export type IntegrationCategory = Static<typeof IntegrationCategorySchema>;
|
package/src/notifications.ts
CHANGED
|
@@ -96,10 +96,10 @@ class NotificationBuilder {
|
|
|
96
96
|
return this;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
toSlack(channel: string): MonitorNotification {
|
|
99
|
+
toSlack(integration: string, channel: string): MonitorNotification {
|
|
100
100
|
return {
|
|
101
101
|
trigger: this.trigger,
|
|
102
|
-
integration
|
|
102
|
+
integration,
|
|
103
103
|
routing: { provider: "slack", channel },
|
|
104
104
|
...(this.cooldownMinutes !== undefined && {
|
|
105
105
|
cooldown_minutes: this.cooldownMinutes,
|
|
@@ -107,10 +107,10 @@ class NotificationBuilder {
|
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
toEmail(toAddresses: string[]): MonitorNotification {
|
|
110
|
+
toEmail(integration: string, toAddresses: string[]): MonitorNotification {
|
|
111
111
|
return {
|
|
112
112
|
trigger: this.trigger,
|
|
113
|
-
integration
|
|
113
|
+
integration,
|
|
114
114
|
routing: { provider: "email", toAddresses },
|
|
115
115
|
...(this.cooldownMinutes !== undefined && {
|
|
116
116
|
cooldown_minutes: this.cooldownMinutes,
|