|
@@ -24,7 +24,7 @@ type IssueAlertRuleFormField =
|
|
* These templates that tell the UI how to render the action or condition
|
|
* These templates that tell the UI how to render the action or condition
|
|
* and what fields it needs
|
|
* and what fields it needs
|
|
*/
|
|
*/
|
|
-export type IssueAlertRuleActionTemplate = {
|
|
|
|
|
|
+export interface IssueAlertRuleActionTemplate {
|
|
enabled: boolean;
|
|
enabled: boolean;
|
|
id: string;
|
|
id: string;
|
|
label: string;
|
|
label: string;
|
|
@@ -39,21 +39,18 @@ export type IssueAlertRuleActionTemplate = {
|
|
link?: string;
|
|
link?: string;
|
|
sentryAppInstallationUuid?: string;
|
|
sentryAppInstallationUuid?: string;
|
|
ticketType?: string;
|
|
ticketType?: string;
|
|
-};
|
|
|
|
|
|
+}
|
|
export type IssueAlertRuleConditionTemplate = IssueAlertRuleActionTemplate;
|
|
export type IssueAlertRuleConditionTemplate = IssueAlertRuleActionTemplate;
|
|
|
|
|
|
/**
|
|
/**
|
|
* These are the action or condition data that the user is editing or has saved.
|
|
* These are the action or condition data that the user is editing or has saved.
|
|
*/
|
|
*/
|
|
-export type IssueAlertRuleAction = Omit<
|
|
|
|
- IssueAlertRuleActionTemplate,
|
|
|
|
- 'formFields' | 'enabled'
|
|
|
|
-> & {
|
|
|
|
- dynamic_form_fields?: IssueConfigField[];
|
|
|
|
-} & {
|
|
|
|
|
|
+export interface IssueAlertRuleAction
|
|
|
|
+ extends Omit<IssueAlertRuleActionTemplate, 'formFields' | 'enabled'> {
|
|
// These are the same values as the keys in `formFields` for a template
|
|
// These are the same values as the keys in `formFields` for a template
|
|
[key: string]: any;
|
|
[key: string]: any;
|
|
-};
|
|
|
|
|
|
+ dynamic_form_fields?: IssueConfigField[];
|
|
|
|
+}
|
|
|
|
|
|
export type IssueAlertRuleCondition = Omit<
|
|
export type IssueAlertRuleCondition = Omit<
|
|
IssueAlertRuleConditionTemplate,
|
|
IssueAlertRuleConditionTemplate,
|
|
@@ -65,7 +62,7 @@ export type IssueAlertRuleCondition = Omit<
|
|
[key: string]: number | string;
|
|
[key: string]: number | string;
|
|
};
|
|
};
|
|
|
|
|
|
-export type UnsavedIssueAlertRule = {
|
|
|
|
|
|
+export interface UnsavedIssueAlertRule {
|
|
/** When an issue matches [actionMatch] of the following */
|
|
/** When an issue matches [actionMatch] of the following */
|
|
actionMatch: 'all' | 'any' | 'none';
|
|
actionMatch: 'all' | 'any' | 'none';
|
|
actions: IssueAlertRuleAction[];
|
|
actions: IssueAlertRuleAction[];
|
|
@@ -77,17 +74,17 @@ export type UnsavedIssueAlertRule = {
|
|
name: string;
|
|
name: string;
|
|
environment?: null | string;
|
|
environment?: null | string;
|
|
owner?: string | null;
|
|
owner?: string | null;
|
|
-};
|
|
|
|
|
|
+}
|
|
|
|
|
|
// Issue-based alert rule
|
|
// Issue-based alert rule
|
|
-export type IssueAlertRule = UnsavedIssueAlertRule & {
|
|
|
|
|
|
+export interface IssueAlertRule extends UnsavedIssueAlertRule {
|
|
createdBy: {email: string; id: number; name: string} | null;
|
|
createdBy: {email: string; id: number; name: string} | null;
|
|
dateCreated: string;
|
|
dateCreated: string;
|
|
id: string;
|
|
id: string;
|
|
projects: string[];
|
|
projects: string[];
|
|
errors?: {detail: string}[];
|
|
errors?: {detail: string}[];
|
|
lastTriggered?: string;
|
|
lastTriggered?: string;
|
|
-};
|
|
|
|
|
|
+}
|
|
|
|
|
|
// Project's alert rule stats
|
|
// Project's alert rule stats
|
|
export type ProjectAlertRuleStats = {
|
|
export type ProjectAlertRuleStats = {
|