@intentius/chant-lexicon-prometheus 0.98.0 → 0.99.0

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.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/dist/import/embedded.d.ts +14 -0
  3. package/dist/import/embedded.d.ts.map +1 -0
  4. package/dist/import/generator.d.ts +15 -0
  5. package/dist/import/generator.d.ts.map +1 -1
  6. package/dist/import/parser.d.ts.map +1 -1
  7. package/dist/integrations.d.ts +531 -0
  8. package/dist/integrations.d.ts.map +1 -0
  9. package/dist/integrity.json +4 -4
  10. package/dist/lint/rules/literal-credential.d.ts.map +1 -1
  11. package/dist/manifest.json +1 -1
  12. package/dist/model.d.ts +58 -123
  13. package/dist/model.d.ts.map +1 -1
  14. package/dist/plugin.d.ts.map +1 -1
  15. package/dist/rules/literal-credential.ts +41 -10
  16. package/dist/skills/chant-prometheus-alertmanager.md +1 -1
  17. package/package.json +2 -2
  18. package/src/import/embedded.test.ts +56 -0
  19. package/src/import/embedded.ts +44 -0
  20. package/src/import/generated-types.e2e.test.ts +3 -1
  21. package/src/import/generator.test.ts +21 -4
  22. package/src/import/generator.ts +32 -24
  23. package/src/import/parser.test.ts +13 -0
  24. package/src/import/parser.ts +18 -1
  25. package/src/import/roundtrip.test.ts +46 -9
  26. package/src/import/testdata/alertmanager-full.yml +3 -3
  27. package/src/import/testdata/alertmanager-integrations.yml +215 -0
  28. package/src/import/testdata/fixtures.ts +8 -0
  29. package/src/import/testdata/upstream/alertmanager-conf-good.yml +120 -0
  30. package/src/import/testdata/upstream/alertmanager-mattermost-default-webhook-url-file.yml +16 -0
  31. package/src/import/testdata/upstream/alertmanager-opsgenie-default-apikey-file.yml +27 -0
  32. package/src/import/testdata/upstream/alertmanager-rocketchat-default-token-file.yml +25 -0
  33. package/src/import/testdata/upstream/alertmanager-sns-topic-arn.yml +17 -0
  34. package/src/import/testdata/upstream/alertmanager-telegram-default-bot-token-file.yml +16 -0
  35. package/src/import/testdata/upstream/alertmanager-victorops-default-apikey-file.yml +23 -0
  36. package/src/import/testdata/upstream/alertmanager-wechat-default-api-secret-file.yml +18 -0
  37. package/src/integrations.ts +538 -0
  38. package/src/lint/rules/literal-credential.ts +41 -10
  39. package/src/lint/rules/rules.test.ts +31 -1
  40. package/src/model.ts +136 -110
  41. package/src/plugin.ts +5 -0
  42. package/src/skills/chant-prometheus-alertmanager.md +1 -1
@@ -0,0 +1,25 @@
1
+ # Vendored from github.com/prometheus/alertmanager v0.34.1, config/testdata/conf.rocketchat-default-token-file.yml
2
+ # (https://github.com/prometheus/alertmanager/blob/v0.34.1/config/testdata/conf.rocketchat-default-token-file.yml). Apache-2.0.
3
+ # Unchanged below this header.
4
+ global:
5
+ rocketchat_token_file: /global_file
6
+ rocketchat_token_id_file: /etc/alertmanager/rocketchat_token_id
7
+ route:
8
+ group_by: ['alertname', 'cluster', 'service']
9
+ group_wait: 30s
10
+ group_interval: 5m
11
+ repeat_interval: 3h
12
+ receiver: team-Y-rocketchat
13
+ routes:
14
+ - match:
15
+ service: foo
16
+ receiver: team-X-rocketchat
17
+ receivers:
18
+ - name: 'team-X-rocketchat'
19
+ rocketchat_configs:
20
+ - channel: '#team-X'
21
+ - name: 'team-Y-rocketchat'
22
+ rocketchat_configs:
23
+ - channel: '#team-Y'
24
+ token_file: /override_file
25
+ token_id_file: /override_file
@@ -0,0 +1,17 @@
1
+ # Vendored from github.com/prometheus/alertmanager v0.34.1, config/testdata/conf.sns-topic-arn.yml
2
+ # (https://github.com/prometheus/alertmanager/blob/v0.34.1/config/testdata/conf.sns-topic-arn.yml). Apache-2.0.
3
+ # Unchanged below this header.
4
+ route:
5
+ receiver: 'sns-api-notifications'
6
+ group_by: [alertname]
7
+ receivers:
8
+ - name: 'sns-api-notifications'
9
+ sns_configs:
10
+ - api_url: https://sns.us-east-2.amazonaws.com
11
+ topic_arn: arn:aws:sns:us-east-2:123456789012:My-Topic
12
+ sigv4:
13
+ region: us-east-2
14
+ access_key: access_key
15
+ secret_key: secret_ket
16
+ attributes:
17
+ severity: Sev2
@@ -0,0 +1,16 @@
1
+ # Vendored from github.com/prometheus/alertmanager v0.34.1, config/testdata/conf.telegram-default-bot-token-file.yml
2
+ # (https://github.com/prometheus/alertmanager/blob/v0.34.1/config/testdata/conf.telegram-default-bot-token-file.yml). Apache-2.0.
3
+ # Unchanged below this header.
4
+ global:
5
+ telegram_bot_token_file: /global_file
6
+ route:
7
+ receiver: team-X-telegram
8
+
9
+ receivers:
10
+ - name: team-X-telegram
11
+ telegram_configs:
12
+ - chat_id: 123
13
+ - name: team-Y-telegram
14
+ telegram_configs:
15
+ - chat_id: 456
16
+ bot_token_file: /override_file
@@ -0,0 +1,23 @@
1
+ # Vendored from github.com/prometheus/alertmanager v0.34.1, config/testdata/conf.victorops-default-apikey-file.yml
2
+ # (https://github.com/prometheus/alertmanager/blob/v0.34.1/config/testdata/conf.victorops-default-apikey-file.yml). Apache-2.0.
3
+ # Unchanged below this header.
4
+ global:
5
+ victorops_api_key_file: '/global_file'
6
+ route:
7
+ group_by: ['alertname', 'cluster', 'service']
8
+ group_wait: 30s
9
+ group_interval: 5m
10
+ repeat_interval: 3h
11
+ receiver: team-Y-victorops
12
+ routes:
13
+ - match:
14
+ service: foo
15
+ receiver: team-X-victorops
16
+ receivers:
17
+ - name: 'team-X-victorops'
18
+ victorops_configs:
19
+ - routing_key: 'team-X'
20
+ - name: 'team-Y-victorops'
21
+ victorops_configs:
22
+ - routing_key: 'team-Y'
23
+ api_key_file: /override_file
@@ -0,0 +1,18 @@
1
+ # Vendored from github.com/prometheus/alertmanager v0.34.1, config/testdata/conf.wechat-default-api-secret-file.yml
2
+ # (https://github.com/prometheus/alertmanager/blob/v0.34.1/config/testdata/conf.wechat-default-api-secret-file.yml). Apache-2.0.
3
+ # Unchanged below this header.
4
+ global:
5
+ wechat_api_secret_file: '/global_file'
6
+ wechat_api_corp_id: 'my_corp_id'
7
+ route:
8
+ receiver: 'wechat-notifications'
9
+ group_by: [alertname, datacenter, app]
10
+ receivers:
11
+ - name: 'wechat-notifications'
12
+ wechat_configs:
13
+ # Use global
14
+ - {}
15
+ # Override global with other file
16
+ - api_secret_file: '/override_file'
17
+ # Override global with inline API secret
18
+ - api_secret: 'my_inline_secret'
@@ -0,0 +1,538 @@
1
+ /**
2
+ * Alertmanager's receiver integrations and the HTTP client settings they
3
+ * share, typed against the Go structs of the pinned release (see ./pin.ts):
4
+ * `alertmanager/config` (`notifiers.go`), `alertmanager/notify/<name>`
5
+ * (`config.go`), `prometheus/common/config` (`http_config.go`,
6
+ * `headers.go`) and `prometheus/sigv4`.
7
+ *
8
+ * Field names are the YAML keys. Durations are strings (`30s`), secrets and
9
+ * URLs are strings, and every credential with a `*_file` sibling is best
10
+ * set through that sibling: Alertmanager does not expand environment
11
+ * variables in its config, and PROM001 flags a literal.
12
+ */
13
+
14
+ // ── Shared ──────────────────────────────────────────────────────────
15
+
16
+ /** `tls_config`: client TLS settings. */
17
+ export interface TlsConfig {
18
+ /** A PEM CA certificate, inline. Set this or `ca_file`. */
19
+ ca?: string;
20
+ ca_file?: string;
21
+ ca_ref?: string;
22
+ cert?: string;
23
+ cert_file?: string;
24
+ cert_ref?: string;
25
+ /** A PEM private key, inline. A credential: prefer `key_file`. */
26
+ key?: string;
27
+ key_file?: string;
28
+ key_ref?: string;
29
+ server_name?: string;
30
+ insecure_skip_verify?: boolean;
31
+ /** e.g. `TLS12`. */
32
+ min_version?: string;
33
+ max_version?: string;
34
+ }
35
+
36
+ /** One entry of `http_headers`: values written as is, as secrets, or read from files. */
37
+ export interface HttpHeaderConfig {
38
+ values?: string[];
39
+ secrets?: string[];
40
+ files?: string[];
41
+ }
42
+
43
+ /** `oauth2`: the client-credentials (or JWT bearer) grant. */
44
+ export interface OAuth2Config {
45
+ client_id?: string;
46
+ client_secret?: string;
47
+ client_secret_file?: string;
48
+ client_secret_ref?: string;
49
+ client_certificate_key_id?: string;
50
+ client_certificate_key?: string;
51
+ client_certificate_key_file?: string;
52
+ client_certificate_key_ref?: string;
53
+ grant_type?: string;
54
+ signature_algorithm?: string;
55
+ iss?: string;
56
+ audience?: string;
57
+ claims?: Record<string, unknown>;
58
+ scopes?: string[];
59
+ token_url?: string;
60
+ endpoint_params?: Record<string, string>;
61
+ tls_config?: TlsConfig;
62
+ proxy_url?: string;
63
+ no_proxy?: string;
64
+ proxy_from_environment?: boolean;
65
+ proxy_connect_header?: Record<string, string[]>;
66
+ }
67
+
68
+ /** HTTP client settings shared by the receivers that make HTTP calls. */
69
+ export interface HttpClientConfig {
70
+ basic_auth?: {
71
+ username?: string;
72
+ username_file?: string;
73
+ username_ref?: string;
74
+ password?: string;
75
+ password_file?: string;
76
+ password_ref?: string;
77
+ };
78
+ authorization?: { type?: string; credentials?: string; credentials_file?: string; credentials_ref?: string };
79
+ oauth2?: OAuth2Config;
80
+ bearer_token?: string;
81
+ bearer_token_file?: string;
82
+ tls_config?: TlsConfig;
83
+ follow_redirects?: boolean;
84
+ enable_http2?: boolean;
85
+ proxy_url?: string;
86
+ no_proxy?: string;
87
+ proxy_from_environment?: boolean;
88
+ proxy_connect_header?: Record<string, string[]>;
89
+ /** Headers added to every request, by header name. */
90
+ http_headers?: Record<string, HttpHeaderConfig>;
91
+ }
92
+
93
+ interface NotifierBase {
94
+ /** Whether to notify about resolved alerts too. */
95
+ send_resolved?: boolean;
96
+ }
97
+
98
+ interface HttpNotifier extends NotifierBase {
99
+ http_config?: HttpClientConfig;
100
+ }
101
+
102
+ // ── The integrations, in the order Alertmanager's Receiver declares them ──
103
+
104
+ /** `discord_configs`. */
105
+ export interface DiscordConfig extends HttpNotifier {
106
+ /** The channel webhook URL. A credential: prefer `webhook_url_file`. */
107
+ webhook_url?: string;
108
+ webhook_url_file?: string;
109
+ content?: string;
110
+ title?: string;
111
+ message?: string;
112
+ username?: string;
113
+ avatar_url?: string;
114
+ }
115
+
116
+ /** Email threading: group notifications for the same alert group into one thread. */
117
+ export interface EmailThreadingConfig {
118
+ enabled?: boolean;
119
+ /** `daily`, or `none` to thread for as long as the group lives. */
120
+ thread_by_date?: string;
121
+ }
122
+
123
+ /** `email_configs`. */
124
+ export interface EmailConfig extends NotifierBase {
125
+ to: string;
126
+ from?: string;
127
+ hello?: string;
128
+ /** `host:port` of the SMTP server. Falls back to `global.smtp_smarthost`. */
129
+ smarthost?: string;
130
+ auth_username?: string;
131
+ auth_password?: string;
132
+ auth_password_file?: string;
133
+ auth_secret?: string;
134
+ auth_secret_file?: string;
135
+ auth_identity?: string;
136
+ headers?: Record<string, string>;
137
+ html?: string;
138
+ text?: string;
139
+ require_tls?: boolean;
140
+ tls_config?: TlsConfig;
141
+ force_implicit_tls?: boolean;
142
+ threading?: EmailThreadingConfig;
143
+ }
144
+
145
+ /** `incidentio_configs`. */
146
+ export interface IncidentioConfig extends HttpNotifier {
147
+ /** The alert source URL. Set this or `url_file`. */
148
+ url?: string;
149
+ url_file?: string;
150
+ /** A credential: prefer `alert_source_token_file`. */
151
+ alert_source_token?: string;
152
+ alert_source_token_file?: string;
153
+ /** Most alerts per message; 0 sends them all. */
154
+ max_alerts?: number;
155
+ timeout?: string;
156
+ }
157
+
158
+ /** A Jira field's template, as a string or with whether it is rewritten on update. */
159
+ export type JiraFieldConfig = string | { template?: string; enable_update?: boolean };
160
+
161
+ /** `jira_configs`. */
162
+ export interface JiraConfig extends HttpNotifier {
163
+ /** Falls back to `global.jira_api_url`. */
164
+ api_url?: string;
165
+ /** `auto`, `cloud` or `datacenter`. */
166
+ api_type?: string;
167
+ project?: string;
168
+ summary?: JiraFieldConfig;
169
+ description?: JiraFieldConfig;
170
+ labels?: string[];
171
+ priority?: string;
172
+ issue_type?: string;
173
+ reopen_transition?: string;
174
+ resolve_transition?: string;
175
+ wont_fix_resolution?: string;
176
+ reopen_duration?: string;
177
+ /** Other issue fields, by Jira field id. */
178
+ fields?: Record<string, unknown>;
179
+ }
180
+
181
+ /** A field of a Mattermost attachment. */
182
+ export interface MattermostField {
183
+ title?: string;
184
+ value?: string;
185
+ short?: boolean;
186
+ }
187
+
188
+ /** An attachment of a Mattermost message. */
189
+ export interface MattermostAttachment {
190
+ fallback?: string;
191
+ color?: string;
192
+ pretext?: string;
193
+ text?: string;
194
+ author_name?: string;
195
+ author_link?: string;
196
+ author_icon?: string;
197
+ title?: string;
198
+ title_link?: string;
199
+ fields?: MattermostField[];
200
+ thumb_url?: string;
201
+ footer?: string;
202
+ footer_icon?: string;
203
+ image_url?: string;
204
+ }
205
+
206
+ /** `mattermost_configs`. */
207
+ export interface MattermostConfig extends HttpNotifier {
208
+ /** The incoming-webhook URL. A credential: prefer `webhook_url_file`. */
209
+ webhook_url?: string;
210
+ webhook_url_file?: string;
211
+ channel?: string;
212
+ username?: string;
213
+ text?: string;
214
+ fallback?: string;
215
+ color?: string;
216
+ pretext?: string;
217
+ author_name?: string;
218
+ author_link?: string;
219
+ author_icon?: string;
220
+ title?: string;
221
+ title_link?: string;
222
+ fields?: MattermostField[];
223
+ thumb_url?: string;
224
+ footer?: string;
225
+ footer_icon?: string;
226
+ image_url?: string;
227
+ icon_url?: string;
228
+ icon_emoji?: string;
229
+ attachments?: MattermostAttachment[];
230
+ type?: string;
231
+ props?: { card?: string };
232
+ priority?: { priority?: string; requested_ack?: boolean; persistent_notifications?: boolean };
233
+ }
234
+
235
+ /** `msteams_configs`: the Office 365 connector webhook. */
236
+ export interface MSTeamsConfig extends HttpNotifier {
237
+ /** A credential: prefer `webhook_url_file`. */
238
+ webhook_url?: string;
239
+ webhook_url_file?: string;
240
+ title?: string;
241
+ summary?: string;
242
+ text?: string;
243
+ }
244
+
245
+ /** `msteamsv2_configs`: the Power Automate (Workflows) webhook. */
246
+ export interface MSTeamsV2Config extends HttpNotifier {
247
+ /** A credential: prefer `webhook_url_file`. */
248
+ webhook_url?: string;
249
+ webhook_url_file?: string;
250
+ title?: string;
251
+ text?: string;
252
+ }
253
+
254
+ /** Who an Opsgenie alert is assigned to: one of `id`, `name` or `username`, and a `type`. */
255
+ export interface OpsGenieResponder {
256
+ id?: string;
257
+ name?: string;
258
+ username?: string;
259
+ /** `team`, `teams`, `user`, `escalation` or `schedule`. */
260
+ type: string;
261
+ }
262
+
263
+ /** `opsgenie_configs`. */
264
+ export interface OpsGenieConfig extends HttpNotifier {
265
+ /** Falls back to `global.opsgenie_api_key`. A credential: prefer `api_key_file`. */
266
+ api_key?: string;
267
+ api_key_file?: string;
268
+ api_url?: string;
269
+ message?: string;
270
+ description?: string;
271
+ source?: string;
272
+ details?: Record<string, string>;
273
+ entity?: string;
274
+ responders?: OpsGenieResponder[];
275
+ /** Comma-separated. */
276
+ actions?: string;
277
+ /** Comma-separated. */
278
+ tags?: string;
279
+ note?: string;
280
+ /** `P1` to `P5`. */
281
+ priority?: string;
282
+ update_alerts?: boolean;
283
+ }
284
+
285
+ /** `pagerduty_configs`. */
286
+ export interface PagerDutyConfig extends HttpNotifier {
287
+ /** Events API v2 integration key. A credential: prefer `routing_key_file`. */
288
+ routing_key?: string;
289
+ routing_key_file?: string;
290
+ /** Events API v1 integration key. A credential: prefer `service_key_file`. */
291
+ service_key?: string;
292
+ service_key_file?: string;
293
+ url?: string;
294
+ client?: string;
295
+ client_url?: string;
296
+ description?: string;
297
+ details?: Record<string, unknown>;
298
+ images?: Array<{ src?: string; alt?: string; href?: string }>;
299
+ links?: Array<{ href?: string; text?: string }>;
300
+ source?: string;
301
+ severity?: string;
302
+ class?: string;
303
+ component?: string;
304
+ group?: string;
305
+ timeout?: string;
306
+ }
307
+
308
+ /** A Slack message button. */
309
+ export interface SlackAction {
310
+ type: string;
311
+ text: string;
312
+ url?: string;
313
+ style?: string;
314
+ name?: string;
315
+ value?: string;
316
+ confirm?: { text: string; title?: string; ok_text?: string; dismiss_text?: string };
317
+ }
318
+
319
+ /** `slack_configs`. */
320
+ export interface SlackConfig extends HttpNotifier {
321
+ /** The incoming-webhook URL. It is a credential: prefer `api_url_file`. */
322
+ api_url?: string;
323
+ api_url_file?: string;
324
+ /** A Slack app bot token, used with `app_url`. A credential: prefer `app_token_file`. */
325
+ app_token?: string;
326
+ app_token_file?: string;
327
+ app_url?: string;
328
+ channel?: string;
329
+ username?: string;
330
+ color?: string;
331
+ title?: string;
332
+ title_link?: string;
333
+ pretext?: string;
334
+ text?: string;
335
+ /** The message's top-level text, shown in notifications. */
336
+ message_text?: string;
337
+ fields?: Array<{ title: string; value: string; short?: boolean }>;
338
+ short_fields?: boolean;
339
+ footer?: string;
340
+ fallback?: string;
341
+ callback_id?: string;
342
+ icon_emoji?: string;
343
+ icon_url?: string;
344
+ image_url?: string;
345
+ thumb_url?: string;
346
+ link_names?: boolean;
347
+ mrkdwn_in?: string[];
348
+ actions?: SlackAction[];
349
+ /** Edit the first message for the alert group instead of posting a new one (app token only). */
350
+ update_message?: boolean;
351
+ timeout?: string;
352
+ }
353
+
354
+ /** `webhook_configs`. */
355
+ export interface WebhookConfig extends HttpNotifier {
356
+ /** Where alerts are POSTed. Set this or `url_file`. */
357
+ url?: string;
358
+ url_file?: string;
359
+ /** Most alerts per message; 0 sends them all. */
360
+ max_alerts?: number;
361
+ timeout?: string;
362
+ /** A custom body, rendered as templates, in place of the default JSON. */
363
+ payload?: unknown;
364
+ }
365
+
366
+ /** `wechat_configs`. */
367
+ export interface WechatConfig extends HttpNotifier {
368
+ /** Falls back to `global.wechat_api_secret`. A credential: prefer `api_secret_file`. */
369
+ api_secret?: string;
370
+ api_secret_file?: string;
371
+ corp_id?: string;
372
+ message?: string;
373
+ api_url?: string;
374
+ to_user?: string;
375
+ to_party?: string;
376
+ to_tag?: string;
377
+ /** Go reads a number here as its string. */
378
+ agent_id?: string | number;
379
+ /** `text` or `markdown`. */
380
+ message_type?: string;
381
+ }
382
+
383
+ /** `pushover_configs`. */
384
+ export interface PushoverConfig extends HttpNotifier {
385
+ /** A credential: prefer `user_key_file`. */
386
+ user_key?: string;
387
+ user_key_file?: string;
388
+ /** A credential: prefer `token_file`. */
389
+ token?: string;
390
+ token_file?: string;
391
+ title?: string;
392
+ message?: string;
393
+ url?: string;
394
+ url_title?: string;
395
+ device?: string;
396
+ sound?: string;
397
+ /** Often a template; Go reads a number here as its string. */
398
+ priority?: string | number;
399
+ retry?: string;
400
+ expire?: string;
401
+ ttl?: string;
402
+ html?: boolean;
403
+ monospace?: boolean;
404
+ }
405
+
406
+ /** `victorops_configs`. */
407
+ export interface VictorOpsConfig extends HttpNotifier {
408
+ /** Falls back to `global.victorops_api_key`. A credential: prefer `api_key_file`. */
409
+ api_key?: string;
410
+ api_key_file?: string;
411
+ api_url?: string;
412
+ routing_key: string;
413
+ message_type?: string;
414
+ state_message?: string;
415
+ entity_display_name?: string;
416
+ monitoring_tool?: string;
417
+ custom_fields?: Record<string, string>;
418
+ }
419
+
420
+ /** AWS Signature v4 signing for `sns_configs`. */
421
+ export interface SigV4Config {
422
+ region?: string;
423
+ access_key?: string;
424
+ secret_key?: string;
425
+ profile?: string;
426
+ role_arn?: string;
427
+ external_id?: string;
428
+ use_fips_sts_endpoint?: boolean;
429
+ service_name?: string;
430
+ }
431
+
432
+ /** `sns_configs`. Set one of `topic_arn`, `phone_number` or `target_arn`. */
433
+ export interface SNSConfig extends HttpNotifier {
434
+ api_url?: string;
435
+ sigv4?: SigV4Config;
436
+ topic_arn?: string;
437
+ phone_number?: string;
438
+ target_arn?: string;
439
+ subject?: string;
440
+ message?: string;
441
+ attributes?: Record<string, string>;
442
+ use_aws_http_client?: boolean;
443
+ }
444
+
445
+ /** `telegram_configs`. */
446
+ export interface TelegramConfig extends HttpNotifier {
447
+ api_url?: string;
448
+ /** A credential: prefer `bot_token_file`. */
449
+ bot_token?: string;
450
+ bot_token_file?: string;
451
+ chat_id?: number;
452
+ chat_id_file?: string;
453
+ message_thread_id?: number;
454
+ message?: string;
455
+ disable_notifications?: boolean;
456
+ /** `MarkdownV2`, `Markdown` or `HTML`. */
457
+ parse_mode?: string;
458
+ }
459
+
460
+ /** `webex_configs`. */
461
+ export interface WebexConfig extends HttpNotifier {
462
+ /** Falls back to `global.webex_api_url`. The credential goes in `http_config.authorization`. */
463
+ api_url?: string;
464
+ message?: string;
465
+ room_id: string;
466
+ }
467
+
468
+ /**
469
+ * A field of a Rocket.Chat attachment. Alertmanager declares these structs
470
+ * without YAML tags, so the keys are the Go field names in lower case.
471
+ */
472
+ export interface RocketchatAttachmentField {
473
+ short?: boolean;
474
+ title?: string;
475
+ value?: string;
476
+ }
477
+
478
+ /** A Rocket.Chat attachment button. Keys are the Go field names in lower case, as for fields. */
479
+ export interface RocketchatAttachmentAction {
480
+ type?: string;
481
+ text?: string;
482
+ url?: string;
483
+ imageurl?: string;
484
+ iswebview?: boolean;
485
+ webviewheightratio?: string;
486
+ msg?: string;
487
+ msginchatwindow?: boolean;
488
+ msgprocessingtype?: string;
489
+ }
490
+
491
+ /** `rocketchat_configs`. */
492
+ export interface RocketchatConfig extends HttpNotifier {
493
+ api_url?: string;
494
+ /** A credential: prefer `token_id_file`. */
495
+ token_id?: string;
496
+ token_id_file?: string;
497
+ /** A credential: prefer `token_file`. */
498
+ token?: string;
499
+ token_file?: string;
500
+ channel?: string;
501
+ color?: string;
502
+ title?: string;
503
+ title_link?: string;
504
+ text?: string;
505
+ fields?: RocketchatAttachmentField[];
506
+ short_fields?: boolean;
507
+ emoji?: string;
508
+ icon_url?: string;
509
+ image_url?: string;
510
+ thumb_url?: string;
511
+ link_names?: boolean;
512
+ actions?: RocketchatAttachmentAction[];
513
+ }
514
+
515
+ /** Every receiver integration: its key under a receiver, and the name of the type of one entry. */
516
+ export const RECEIVER_INTEGRATION_TYPES = Object.freeze({
517
+ discord_configs: "DiscordConfig",
518
+ email_configs: "EmailConfig",
519
+ incidentio_configs: "IncidentioConfig",
520
+ pagerduty_configs: "PagerDutyConfig",
521
+ slack_configs: "SlackConfig",
522
+ webhook_configs: "WebhookConfig",
523
+ opsgenie_configs: "OpsGenieConfig",
524
+ wechat_configs: "WechatConfig",
525
+ pushover_configs: "PushoverConfig",
526
+ victorops_configs: "VictorOpsConfig",
527
+ sns_configs: "SNSConfig",
528
+ telegram_configs: "TelegramConfig",
529
+ webex_configs: "WebexConfig",
530
+ msteams_configs: "MSTeamsConfig",
531
+ msteamsv2_configs: "MSTeamsV2Config",
532
+ jira_configs: "JiraConfig",
533
+ rocketchat_configs: "RocketchatConfig",
534
+ mattermost_configs: "MattermostConfig",
535
+ } as const);
536
+
537
+ /** The receiver keys that hold integrations. */
538
+ export type ReceiverIntegration = keyof typeof RECEIVER_INTEGRATION_TYPES;