@griffin-app/griffin-ts 0.1.25 → 0.1.26
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 +0 -1
- package/dist/integrations.js.map +1 -1
- package/dist/notifications.d.ts +9 -9
- package/dist/notifications.js +7 -7
- package/dist/notifications.js.map +1 -1
- package/dist/schema.d.ts +12 -12
- package/package.json +1 -1
- package/src/integrations.ts +0 -1
- package/src/notifications.ts +7 -7
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">;
|
|
4
4
|
export declare const SecretsProviderSchema: Type.TUnsafe<"aws" | "vault">;
|
|
5
|
-
export declare const ProviderSchema: Type.TUnsafe<"slack" | "email" | "webhook" | "
|
|
5
|
+
export declare const ProviderSchema: Type.TUnsafe<"slack" | "email" | "webhook" | "aws" | "vault" | "resend">;
|
|
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,6CAIN,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
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;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;IACT,QAAQ;CACT,EAAE,EAAC,GAAG,EAAE,UAAU,EAAC,CAAC,CAAC"}
|
package/dist/notifications.d.ts
CHANGED
|
@@ -18,24 +18,24 @@ export declare const NotificationTriggerSchema: Type.TUnion<[Type.TObject<{
|
|
|
18
18
|
}>]>;
|
|
19
19
|
export type NotificationTrigger = Static<typeof NotificationTriggerSchema>;
|
|
20
20
|
export declare const SlackRoutingSchema: Type.TObject<{
|
|
21
|
-
|
|
21
|
+
channelType: Type.TLiteral<"slack">;
|
|
22
22
|
channel: Type.TString;
|
|
23
23
|
}>;
|
|
24
24
|
export declare const EmailRoutingSchema: Type.TObject<{
|
|
25
|
-
|
|
25
|
+
channelType: Type.TLiteral<"email">;
|
|
26
26
|
toAddresses: Type.TArray<Type.TString>;
|
|
27
27
|
}>;
|
|
28
28
|
export declare const WebhookRoutingSchema: Type.TObject<{
|
|
29
|
-
|
|
29
|
+
channelType: Type.TLiteral<"webhook">;
|
|
30
30
|
}>;
|
|
31
31
|
export declare const NotificationRoutingSchema: Type.TUnion<[Type.TObject<{
|
|
32
|
-
|
|
32
|
+
channelType: Type.TLiteral<"slack">;
|
|
33
33
|
channel: Type.TString;
|
|
34
34
|
}>, Type.TObject<{
|
|
35
|
-
|
|
35
|
+
channelType: Type.TLiteral<"email">;
|
|
36
36
|
toAddresses: Type.TArray<Type.TString>;
|
|
37
37
|
}>, Type.TObject<{
|
|
38
|
-
|
|
38
|
+
channelType: Type.TLiteral<"webhook">;
|
|
39
39
|
}>]>;
|
|
40
40
|
export type SlackRouting = Static<typeof SlackRoutingSchema>;
|
|
41
41
|
export type EmailRouting = Static<typeof EmailRoutingSchema>;
|
|
@@ -61,13 +61,13 @@ export declare const MonitorNotificationSchema: Type.TObject<{
|
|
|
61
61
|
}>]>;
|
|
62
62
|
integration: Type.TString;
|
|
63
63
|
routing: Type.TUnion<[Type.TObject<{
|
|
64
|
-
|
|
64
|
+
channelType: Type.TLiteral<"slack">;
|
|
65
65
|
channel: Type.TString;
|
|
66
66
|
}>, Type.TObject<{
|
|
67
|
-
|
|
67
|
+
channelType: Type.TLiteral<"email">;
|
|
68
68
|
toAddresses: Type.TArray<Type.TString>;
|
|
69
69
|
}>, Type.TObject<{
|
|
70
|
-
|
|
70
|
+
channelType: Type.TLiteral<"webhook">;
|
|
71
71
|
}>]>;
|
|
72
72
|
cooldown_minutes: Type.TOptional<Type.TNumber>;
|
|
73
73
|
}>;
|
package/dist/notifications.js
CHANGED
|
@@ -30,18 +30,18 @@ export const NotificationTriggerSchema = Type.Union([
|
|
|
30
30
|
}),
|
|
31
31
|
], { $id: "NotificationTrigger" });
|
|
32
32
|
// =============================================================================
|
|
33
|
-
// Routing (discriminated union
|
|
33
|
+
// Routing (discriminated union by channel type)
|
|
34
34
|
// =============================================================================
|
|
35
35
|
export const SlackRoutingSchema = Type.Object({
|
|
36
|
-
|
|
36
|
+
channelType: Type.Literal("slack"),
|
|
37
37
|
channel: Type.String(),
|
|
38
38
|
});
|
|
39
39
|
export const EmailRoutingSchema = Type.Object({
|
|
40
|
-
|
|
40
|
+
channelType: Type.Literal("email"),
|
|
41
41
|
toAddresses: Type.Array(Type.String()),
|
|
42
42
|
});
|
|
43
43
|
export const WebhookRoutingSchema = Type.Object({
|
|
44
|
-
|
|
44
|
+
channelType: Type.Literal("webhook"),
|
|
45
45
|
});
|
|
46
46
|
export const NotificationRoutingSchema = Type.Union([
|
|
47
47
|
SlackRoutingSchema,
|
|
@@ -74,7 +74,7 @@ class NotificationBuilder {
|
|
|
74
74
|
return {
|
|
75
75
|
trigger: this.trigger,
|
|
76
76
|
integration: "slack",
|
|
77
|
-
routing: {
|
|
77
|
+
routing: { channelType: "slack", channel },
|
|
78
78
|
...(this.cooldownMinutes !== undefined && {
|
|
79
79
|
cooldown_minutes: this.cooldownMinutes,
|
|
80
80
|
}),
|
|
@@ -84,7 +84,7 @@ class NotificationBuilder {
|
|
|
84
84
|
return {
|
|
85
85
|
trigger: this.trigger,
|
|
86
86
|
integration: "email",
|
|
87
|
-
routing: {
|
|
87
|
+
routing: { channelType: "email", toAddresses },
|
|
88
88
|
...(this.cooldownMinutes !== undefined && {
|
|
89
89
|
cooldown_minutes: this.cooldownMinutes,
|
|
90
90
|
}),
|
|
@@ -94,7 +94,7 @@ class NotificationBuilder {
|
|
|
94
94
|
return {
|
|
95
95
|
trigger: this.trigger,
|
|
96
96
|
integration,
|
|
97
|
-
routing: {
|
|
97
|
+
routing: { channelType: "webhook" },
|
|
98
98
|
...(this.cooldownMinutes !== undefined && {
|
|
99
99
|
cooldown_minutes: this.cooldownMinutes,
|
|
100
100
|
}),
|
|
@@ -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,CAAC,MAAM,CAAC;QACV,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;KACpC,CAAC;IACF,IAAI,CAAC,MAAM,CAAC;QACV,IAAI,EAA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B,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.d.ts
CHANGED
|
@@ -410,13 +410,13 @@ export declare const MonitorDSLSchemaV1: Type.TObject<{
|
|
|
410
410
|
}>]>;
|
|
411
411
|
integration: Type.TString;
|
|
412
412
|
routing: Type.TUnion<[Type.TObject<{
|
|
413
|
-
|
|
413
|
+
channelType: Type.TLiteral<"slack">;
|
|
414
414
|
channel: Type.TString;
|
|
415
415
|
}>, Type.TObject<{
|
|
416
|
-
|
|
416
|
+
channelType: Type.TLiteral<"email">;
|
|
417
417
|
toAddresses: Type.TArray<Type.TString>;
|
|
418
418
|
}>, Type.TObject<{
|
|
419
|
-
|
|
419
|
+
channelType: Type.TLiteral<"webhook">;
|
|
420
420
|
}>]>;
|
|
421
421
|
cooldown_minutes: Type.TOptional<Type.TNumber>;
|
|
422
422
|
}>>>;
|
|
@@ -564,13 +564,13 @@ export declare const MonitorDSLSchema: Type.TObject<{
|
|
|
564
564
|
}>]>;
|
|
565
565
|
integration: Type.TString;
|
|
566
566
|
routing: Type.TUnion<[Type.TObject<{
|
|
567
|
-
|
|
567
|
+
channelType: Type.TLiteral<"slack">;
|
|
568
568
|
channel: Type.TString;
|
|
569
569
|
}>, Type.TObject<{
|
|
570
|
-
|
|
570
|
+
channelType: Type.TLiteral<"email">;
|
|
571
571
|
toAddresses: Type.TArray<Type.TString>;
|
|
572
572
|
}>, Type.TObject<{
|
|
573
|
-
|
|
573
|
+
channelType: Type.TLiteral<"webhook">;
|
|
574
574
|
}>]>;
|
|
575
575
|
cooldown_minutes: Type.TOptional<Type.TNumber>;
|
|
576
576
|
}>>>;
|
|
@@ -842,13 +842,13 @@ export declare const ResolvedMonitorV1Schema: Type.TObject<{
|
|
|
842
842
|
}>]>;
|
|
843
843
|
integration: Type.TString;
|
|
844
844
|
routing: Type.TUnion<[Type.TObject<{
|
|
845
|
-
|
|
845
|
+
channelType: Type.TLiteral<"slack">;
|
|
846
846
|
channel: Type.TString;
|
|
847
847
|
}>, Type.TObject<{
|
|
848
|
-
|
|
848
|
+
channelType: Type.TLiteral<"email">;
|
|
849
849
|
toAddresses: Type.TArray<Type.TString>;
|
|
850
850
|
}>, Type.TObject<{
|
|
851
|
-
|
|
851
|
+
channelType: Type.TLiteral<"webhook">;
|
|
852
852
|
}>]>;
|
|
853
853
|
cooldown_minutes: Type.TOptional<Type.TNumber>;
|
|
854
854
|
}>>>;
|
|
@@ -968,13 +968,13 @@ export declare const ResolvedMonitorSchema: Type.TObject<{
|
|
|
968
968
|
}>]>;
|
|
969
969
|
integration: Type.TString;
|
|
970
970
|
routing: Type.TUnion<[Type.TObject<{
|
|
971
|
-
|
|
971
|
+
channelType: Type.TLiteral<"slack">;
|
|
972
972
|
channel: Type.TString;
|
|
973
973
|
}>, Type.TObject<{
|
|
974
|
-
|
|
974
|
+
channelType: Type.TLiteral<"email">;
|
|
975
975
|
toAddresses: Type.TArray<Type.TString>;
|
|
976
976
|
}>, Type.TObject<{
|
|
977
|
-
|
|
977
|
+
channelType: Type.TLiteral<"webhook">;
|
|
978
978
|
}>]>;
|
|
979
979
|
cooldown_minutes: Type.TOptional<Type.TNumber>;
|
|
980
980
|
}>>>;
|
package/package.json
CHANGED
package/src/integrations.ts
CHANGED
package/src/notifications.ts
CHANGED
|
@@ -35,21 +35,21 @@ export const NotificationTriggerSchema = Type.Union([
|
|
|
35
35
|
export type NotificationTrigger = Static<typeof NotificationTriggerSchema>;
|
|
36
36
|
|
|
37
37
|
// =============================================================================
|
|
38
|
-
// Routing (discriminated union
|
|
38
|
+
// Routing (discriminated union by channel type)
|
|
39
39
|
// =============================================================================
|
|
40
40
|
|
|
41
41
|
export const SlackRoutingSchema = Type.Object({
|
|
42
|
-
|
|
42
|
+
channelType: Type.Literal("slack"),
|
|
43
43
|
channel: Type.String(),
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
export const EmailRoutingSchema = Type.Object({
|
|
47
|
-
|
|
47
|
+
channelType: Type.Literal("email"),
|
|
48
48
|
toAddresses: Type.Array(Type.String()),
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
export const WebhookRoutingSchema = Type.Object({
|
|
52
|
-
|
|
52
|
+
channelType: Type.Literal("webhook"),
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
export const NotificationRoutingSchema = Type.Union([
|
|
@@ -100,7 +100,7 @@ class NotificationBuilder {
|
|
|
100
100
|
return {
|
|
101
101
|
trigger: this.trigger,
|
|
102
102
|
integration: "slack",
|
|
103
|
-
routing: {
|
|
103
|
+
routing: { channelType: "slack", channel },
|
|
104
104
|
...(this.cooldownMinutes !== undefined && {
|
|
105
105
|
cooldown_minutes: this.cooldownMinutes,
|
|
106
106
|
}),
|
|
@@ -111,7 +111,7 @@ class NotificationBuilder {
|
|
|
111
111
|
return {
|
|
112
112
|
trigger: this.trigger,
|
|
113
113
|
integration: "email",
|
|
114
|
-
routing: {
|
|
114
|
+
routing: { channelType: "email", toAddresses },
|
|
115
115
|
...(this.cooldownMinutes !== undefined && {
|
|
116
116
|
cooldown_minutes: this.cooldownMinutes,
|
|
117
117
|
}),
|
|
@@ -122,7 +122,7 @@ class NotificationBuilder {
|
|
|
122
122
|
return {
|
|
123
123
|
trigger: this.trigger,
|
|
124
124
|
integration,
|
|
125
|
-
routing: {
|
|
125
|
+
routing: { channelType: "webhook" },
|
|
126
126
|
...(this.cooldownMinutes !== undefined && {
|
|
127
127
|
cooldown_minutes: this.cooldownMinutes,
|
|
128
128
|
}),
|