@daocloud-proto/insight 0.31.9 → 0.31.11

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.
@@ -27,6 +27,15 @@ export enum ValidateGroupCode {
27
27
  ERR_RULE_DESCRIPTION = "ERR_RULE_DESCRIPTION",
28
28
  }
29
29
 
30
+ export enum NotifyStatusStatus {
31
+ unknown = "unknown",
32
+ success = "success",
33
+ partial_success = "partial_success",
34
+ fail = "fail",
35
+ silenced = "silenced",
36
+ not_configured = "not_configured",
37
+ }
38
+
30
39
  export type ID = {
31
40
  id?: string
32
41
  }
@@ -265,6 +274,12 @@ export type AlertSummary = {
265
274
  lastSent?: string
266
275
  builtin?: boolean
267
276
  status?: InsightIoApiAlertV1alpha1Type.AlertStatus
277
+ notifyStatus?: NotifyStatus
278
+ }
279
+
280
+ export type NotifyStatus = {
281
+ status?: NotifyStatusStatus
282
+ messages?: {[key: string]: string}
268
283
  }
269
284
 
270
285
  export type GetAlertRequest = {
@@ -292,6 +307,7 @@ export type Alert = {
292
307
  startAt?: string
293
308
  updateAt?: string
294
309
  lastSent?: string
310
+ notifyStatus?: NotifyStatus
295
311
  }
296
312
 
297
313
  export type CountAlertRequest = {
@@ -322,29 +338,6 @@ export type countInfo = {
322
338
  sum?: {[key: string]: string}
323
339
  }
324
340
 
325
- export type AMHookRequest = {
326
- version?: string
327
- groupKey?: string
328
- status?: string
329
- receiver?: string
330
- groupLabels?: {[key: string]: string}
331
- commonLabels?: {[key: string]: string}
332
- commonAnnotations?: {[key: string]: string}
333
- externalURL?: string
334
- alerts?: AmAlert[]
335
- truncatedAlerts?: string
336
- }
337
-
338
- export type AmAlert = {
339
- status?: string
340
- labels?: {[key: string]: string}
341
- annotations?: {[key: string]: string}
342
- startsAt?: string
343
- endsAt?: string
344
- generatorURL?: string
345
- fingerprint?: string
346
- }
347
-
348
341
  export type AlertHistoryRetentionPeriod = {
349
342
  retentionTime?: number
350
343
  }
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import * as InsightIoApiTypeV1alpha1Page from "../../type/v1alpha1/page.pb"
8
+ import * as InsightIoApiAlertV1alpha1Type from "./type.pb"
8
9
 
9
10
  type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
10
11
  type OneOf<T> =
@@ -194,6 +195,21 @@ export type emailBody = {
194
195
  body?: string
195
196
  }
196
197
 
198
+ export type PreviewTemplateRequest = {
199
+ body?: TemplateBody
200
+ data?: InsightIoApiAlertV1alpha1Type.AMHookRequest
201
+ }
202
+
203
+ export type TemplateRenderStatus = {
204
+ content?: string
205
+ status?: boolean
206
+ error?: string
207
+ }
208
+
209
+ export type PreviewTemplateResponse = {
210
+ data?: {[key: string]: TemplateRenderStatus}
211
+ }
212
+
197
213
  export type ProviderAliyunConfig = {
198
214
  signName?: string
199
215
  templateCode?: string
@@ -52,4 +52,27 @@ export enum RuleFilterCondition {
52
52
  REG = "REG",
53
53
  FUZZINESS = "FUZZINESS",
54
54
  WILD_CARD = "WILD_CARD",
55
+ }
56
+
57
+ export type AMHookRequest = {
58
+ version?: string
59
+ groupKey?: string
60
+ status?: string
61
+ receiver?: string
62
+ groupLabels?: {[key: string]: string}
63
+ commonLabels?: {[key: string]: string}
64
+ commonAnnotations?: {[key: string]: string}
65
+ externalURL?: string
66
+ alerts?: AmAlert[]
67
+ truncatedAlerts?: string
68
+ }
69
+
70
+ export type AmAlert = {
71
+ status?: string
72
+ labels?: {[key: string]: string}
73
+ annotations?: {[key: string]: string}
74
+ startsAt?: string
75
+ endsAt?: string
76
+ generatorURL?: string
77
+ fingerprint?: string
55
78
  }
@@ -8,6 +8,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
10
  import * as InsightIoApiAlertV1alpha1Silence from "../../alert/v1alpha1/silence.pb"
11
+ import * as InsightIoApiAlertV1alpha1Type from "../../alert/v1alpha1/type.pb"
11
12
  import * as InsightIoApiEventV1alpha1Event from "../../event/v1alpha1/event.pb"
12
13
  import * as InsightIoApiFeature_gateV1alpha1Feature_gate from "../../feature_gate/v1alpha1/feature_gate.pb"
13
14
  import * as fm from "../../fetch.pb"
@@ -164,8 +165,8 @@ export class Alert {
164
165
  static CountAlert(req: InsightIoApiAlertV1alpha1Alert.CountAlertRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.CountAlertResponse> {
165
166
  return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.CountAlertRequest, InsightIoApiAlertV1alpha1Alert.CountAlertResponse>(`/apis/insight.io/v1alpha1/alert/alertcount?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
166
167
  }
167
- static AlertHook(req: InsightIoApiAlertV1alpha1Alert.AMHookRequest, initReq?: fm.InitReq): Promise<empty> {
168
- return fm.fetchReq<InsightIoApiAlertV1alpha1Alert.AMHookRequest, empty>(`/apis/insight.io/v1alpha1/alert/hook`, {...initReq, method: "POST", body: JSON.stringify(req)})
168
+ static AlertHook(req: InsightIoApiAlertV1alpha1Type.AMHookRequest, initReq?: fm.InitReq): Promise<empty> {
169
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Type.AMHookRequest, empty>(`/apis/insight.io/v1alpha1/alert/hook`, {...initReq, method: "POST", body: JSON.stringify(req)})
169
170
  }
170
171
  static CleanAlertHistory(req: empty, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Alert.CleanAlertHistoryResponse> {
171
172
  return fm.fetchReq<empty, InsightIoApiAlertV1alpha1Alert.CleanAlertHistoryResponse>(`/apis/insight.io/v1alpha1/alert/history/clean`, {...initReq, method: "PUT"})
@@ -224,6 +225,9 @@ export class Alert {
224
225
  static DeleteTemplate(req: InsightIoApiAlertV1alpha1Notify.TemplateName, initReq?: fm.InitReq): Promise<empty> {
225
226
  return fm.fetchReq<InsightIoApiAlertV1alpha1Notify.TemplateName, empty>(`/apis/insight.io/v1alpha1/alert/templates/${req["name"]}`, {...initReq, method: "DELETE"})
226
227
  }
228
+ static PreviewTemplate(req: InsightIoApiAlertV1alpha1Notify.PreviewTemplateRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Notify.PreviewTemplateResponse> {
229
+ return fm.fetchReq<InsightIoApiAlertV1alpha1Notify.PreviewTemplateRequest, InsightIoApiAlertV1alpha1Notify.PreviewTemplateResponse>(`/apis/insight.io/v1alpha1/alert/templates/preview`, {...initReq, method: "POST", body: JSON.stringify(req)})
230
+ }
227
231
  static ListSilences(req: InsightIoApiAlertV1alpha1Silence.ListSilencesRequest, initReq?: fm.InitReq): Promise<InsightIoApiAlertV1alpha1Silence.ListSilencesResponse> {
228
232
  return fm.fetchReq<InsightIoApiAlertV1alpha1Silence.ListSilencesRequest, InsightIoApiAlertV1alpha1Silence.ListSilencesResponse>(`/apis/insight.io/v1alpha1/alert/silences?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
229
233
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/insight",
3
- "version":"0.31.9",
3
+ "version":"0.31.11",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {