@daocloud-proto/insight 0.43.3 → 0.44.0-5-g53d0b2e

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.
@@ -287,6 +287,7 @@ export type AlertSummary = {
287
287
  builtin?: boolean
288
288
  status?: InsightIoApiAlertV1alpha1Type.AlertStatus
289
289
  notifyStatus?: NotifyStatus
290
+ notifyPolicyStatus?: PolicyNotifyStatus
290
291
  }
291
292
 
292
293
  export type NotifyStatus = {
@@ -294,6 +295,24 @@ export type NotifyStatus = {
294
295
  messages?: {[key: string]: string}
295
296
  }
296
297
 
298
+ export type PolicyRouteRef = {
299
+ path?: string
300
+ matcher?: string
301
+ }
302
+
303
+ export type PolicyNotifyResult = {
304
+ template?: string
305
+ receivers?: string[]
306
+ status?: NotifyStatusStatus
307
+ messages?: {[key: string]: string}
308
+ route?: PolicyRouteRef
309
+ }
310
+
311
+ export type PolicyNotifyStatus = {
312
+ status?: NotifyStatusStatus
313
+ items?: PolicyNotifyResult[]
314
+ }
315
+
297
316
  export type GetAlertRequest = {
298
317
  id?: string
299
318
  resolved?: boolean
@@ -322,6 +341,7 @@ export type Alert = {
322
341
  builtin?: boolean
323
342
  status?: InsightIoApiAlertV1alpha1Type.AlertStatus
324
343
  notifyStatus?: NotifyStatus
344
+ notifyPolicyStatus?: PolicyNotifyStatus
325
345
  }
326
346
 
327
347
  export type CountAlertRequest = {
@@ -0,0 +1,65 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as InsightIoApiAlertV1alpha1Type from "./type.pb"
8
+
9
+ export enum DryRunStepResult {
10
+ DRY_RUN_STEP_RESULT_UNSPECIFIED = "DRY_RUN_STEP_RESULT_UNSPECIFIED",
11
+ DRY_RUN_STEP_RESULT_UNMATCHED = "DRY_RUN_STEP_RESULT_UNMATCHED",
12
+ DRY_RUN_STEP_RESULT_SKIPPED = "DRY_RUN_STEP_RESULT_SKIPPED",
13
+ DRY_RUN_STEP_RESULT_MATCHED = "DRY_RUN_STEP_RESULT_MATCHED",
14
+ DRY_RUN_STEP_RESULT_SELECTED = "DRY_RUN_STEP_RESULT_SELECTED",
15
+ }
16
+
17
+ export type NotificationPolicy = {
18
+ description?: string
19
+ enabled?: boolean
20
+ route?: string
21
+ createAt?: string
22
+ updateAt?: string
23
+ }
24
+
25
+ export type NotificationPolicyRouteSchema = {
26
+ schema?: string
27
+ }
28
+
29
+ export type PutNotificationPolicyRequest = {
30
+ description?: string
31
+ enabled?: boolean
32
+ route?: string
33
+ }
34
+
35
+ export type DryRunNotificationPolicyRequest = {
36
+ route?: string
37
+ data?: InsightIoApiAlertV1alpha1Type.AMHookRequest
38
+ }
39
+
40
+ export type DryRunRouteStep = {
41
+ path?: string
42
+ matcher?: string
43
+ result?: DryRunStepResult
44
+ hasContinue?: boolean
45
+ }
46
+
47
+ export type DryRunTarget = {
48
+ receiver?: string
49
+ chain?: string[]
50
+ template?: string
51
+ }
52
+
53
+ export type DryRunAlertTrace = {
54
+ fingerprint?: string
55
+ labels?: {[key: string]: string}
56
+ alertPath?: string
57
+ steps?: DryRunRouteStep[]
58
+ targets?: DryRunTarget[]
59
+ }
60
+
61
+ export type DryRunNotificationPolicyResult = {
62
+ valid?: boolean
63
+ error?: string
64
+ traces?: DryRunAlertTrace[]
65
+ }
@@ -7,6 +7,7 @@
7
7
  import * as InsightIoApiAlertV1alpha1Alert from "../../alert/v1alpha1/alert.pb"
8
8
  import * as InsightIoApiAlertV1alpha1Inhibition from "../../alert/v1alpha1/inhibition.pb"
9
9
  import * as InsightIoApiAlertV1alpha1Notify from "../../alert/v1alpha1/notify.pb"
10
+ import * as InsightIoApiAlertV1alpha1Policy from "../../alert/v1alpha1/policy.pb"
10
11
  import * as InsightIoApiAlertV1alpha1Silence from "../../alert/v1alpha1/silence.pb"
11
12
  import * as InsightIoApiAlertV1alpha1Type from "../../alert/v1alpha1/type.pb"
12
13
  import * as InsightIoApiEventV1alpha1Event from "../../event/v1alpha1/event.pb"
@@ -297,6 +298,18 @@ export class Alert {
297
298
  static DeleteInhibition(req: InsightIoApiAlertV1alpha1Alert.ID, initReq?: fm.InitReq): Promise<empty> {
298
299
  return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.ID, empty>(`/apis/insight.io/v1alpha1/alert/inhibitions/${req["id"]}`, {...initReq, method: "DELETE"})
299
300
  }
301
+ static GetNotificationPolicy(req: empty, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Policy.NotificationPolicy> {
302
+ return fm.fetchReq<empty, InsightIoApiAlertV1alpha1Policy.NotificationPolicy>(`/apis/insight.io/v1alpha1/alert/notification-policy?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
303
+ }
304
+ static PutNotificationPolicy(req: InsightIoApiAlertV1alpha1Policy.PutNotificationPolicyRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Policy.NotificationPolicy> {
305
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Policy.PutNotificationPolicyRequest, InsightIoApiAlertV1alpha1Policy.NotificationPolicy>(`/apis/insight.io/v1alpha1/alert/notification-policy`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
306
+ }
307
+ static GetNotificationPolicyRouteSchema(req: empty, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Policy.NotificationPolicyRouteSchema> {
308
+ return fm.fetchReq<empty, InsightIoApiAlertV1alpha1Policy.NotificationPolicyRouteSchema>(`/apis/insight.io/v1alpha1/alert/notification-policy/schema?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
309
+ }
310
+ static DryRunNotificationPolicy(req: InsightIoApiAlertV1alpha1Policy.DryRunNotificationPolicyRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Policy.DryRunNotificationPolicyResult> {
311
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Policy.DryRunNotificationPolicyRequest, InsightIoApiAlertV1alpha1Policy.DryRunNotificationPolicyResult>(`/apis/insight.io/v1alpha1/alert/notification-policy/dry-run`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
312
+ }
300
313
  }
301
314
  export class Log {
302
315
  static SearchLog(req: InsightIoApiLogV1alpha1Log.SearchLogRequest, initReq?: fm.InitReq): Promise<InsightIoApiLogV1alpha1Log.SearchLogResponse> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/insight",
3
- "version":"0.43.3",
3
+ "version":"0.44.0-5-g53d0b2e",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {