-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b25f6ee
commit 7d85488
Showing
37 changed files
with
371 additions
and
629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
type EmailActionType = 'email'; | ||
type LoggingActionType = 'logging'; | ||
type WebhookActionType = 'webhook'; | ||
type IndexActionType = 'index'; | ||
type SlackActionType = 'slack'; | ||
type JiraActionType = 'jira'; | ||
type PagerDutyActionType = 'pagerduty'; | ||
|
||
export interface BaseAction { | ||
id: string; | ||
typeName: string; | ||
simulateMessage: string; | ||
simulateFailMessage: string; | ||
simulatePrompt: string; | ||
selectMessage: string; | ||
validate: () => { [key: string]: string[] }; | ||
isEnabled: boolean; | ||
} | ||
|
||
export interface EmailAction extends BaseAction { | ||
type: EmailActionType; | ||
iconClass: 'email'; | ||
to: []; | ||
subject?: string; | ||
body: string; | ||
} | ||
|
||
export interface LoggingAction extends BaseAction { | ||
type: LoggingActionType; | ||
iconClass: 'loggingApp'; | ||
text: string; | ||
} | ||
|
||
export interface IndexAction extends BaseAction { | ||
type: IndexActionType; | ||
iconClass: 'indexOpen'; | ||
index: string; | ||
} | ||
|
||
export interface PagerDutyAction extends BaseAction { | ||
type: PagerDutyActionType; | ||
iconClass: 'apps'; | ||
description: string; | ||
} | ||
|
||
export interface WebhookAction extends BaseAction { | ||
type: WebhookActionType; | ||
iconClass: 'logoWebhook'; | ||
method?: 'head' | 'get' | 'post' | 'put' | 'delete'; | ||
host: string; | ||
port: number; | ||
path?: string; | ||
body: string; | ||
} | ||
|
||
export interface SlackAction extends BaseAction { | ||
type: SlackActionType; | ||
iconClass: 'logoSlack'; | ||
text: string; | ||
to: string[]; | ||
} | ||
|
||
export interface JiraAction extends BaseAction { | ||
type: JiraActionType; | ||
iconClass: 'apps'; | ||
account?: string; | ||
projectKey: string; | ||
issueType: string; | ||
summary: string; | ||
} | ||
|
||
export type ActionType = | ||
| EmailAction | ||
| LoggingAction | ||
| IndexAction | ||
| SlackAction | ||
| JiraAction | ||
| PagerDutyAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.