|
3 | 3 | * or more contributor license agreements. Licensed under the Elastic License;
|
4 | 4 | * you may not use this file except in compliance with the Elastic License.
|
5 | 5 | */
|
6 |
| -import { ActionConnector } from '../../../types'; |
| 6 | +import { UserConfiguredActionConnector } from '../../../types'; |
7 | 7 |
|
8 | 8 | export interface EmailActionParams {
|
9 | 9 | to: string[];
|
@@ -64,66 +64,56 @@ export interface WebhookActionParams {
|
64 | 64 | body?: string;
|
65 | 65 | }
|
66 | 66 |
|
67 |
| -interface EmailConfig { |
| 67 | +export interface EmailConfig { |
68 | 68 | from: string;
|
69 | 69 | host: string;
|
70 | 70 | port: number;
|
71 | 71 | secure?: boolean;
|
72 | 72 | }
|
73 | 73 |
|
74 |
| -interface EmailSecrets { |
| 74 | +export interface EmailSecrets { |
75 | 75 | user: string | null;
|
76 | 76 | password: string | null;
|
77 | 77 | }
|
78 | 78 |
|
79 |
| -export interface EmailActionConnector extends ActionConnector { |
80 |
| - config: EmailConfig; |
81 |
| - secrets: EmailSecrets; |
82 |
| -} |
| 79 | +export type EmailActionConnector = UserConfiguredActionConnector<EmailConfig, EmailSecrets>; |
83 | 80 |
|
84 |
| -interface EsIndexConfig { |
| 81 | +export interface EsIndexConfig { |
85 | 82 | index: string;
|
86 | 83 | executionTimeField?: string | null;
|
87 | 84 | refresh?: boolean;
|
88 | 85 | }
|
89 | 86 |
|
90 |
| -export interface EsIndexActionConnector extends ActionConnector { |
91 |
| - config: EsIndexConfig; |
92 |
| -} |
| 87 | +export type EsIndexActionConnector = UserConfiguredActionConnector<EsIndexConfig, unknown>; |
93 | 88 |
|
94 |
| -interface PagerDutyConfig { |
| 89 | +export interface PagerDutyConfig { |
95 | 90 | apiUrl?: string;
|
96 | 91 | }
|
97 | 92 |
|
98 |
| -interface PagerDutySecrets { |
| 93 | +export interface PagerDutySecrets { |
99 | 94 | routingKey: string;
|
100 | 95 | }
|
101 | 96 |
|
102 |
| -export interface PagerDutyActionConnector extends ActionConnector { |
103 |
| - config: PagerDutyConfig; |
104 |
| - secrets: PagerDutySecrets; |
105 |
| -} |
| 97 | +export type PagerDutyActionConnector = UserConfiguredActionConnector< |
| 98 | + PagerDutyConfig, |
| 99 | + PagerDutySecrets |
| 100 | +>; |
106 | 101 |
|
107 |
| -interface SlackSecrets { |
| 102 | +export interface SlackSecrets { |
108 | 103 | webhookUrl: string;
|
109 | 104 | }
|
110 | 105 |
|
111 |
| -export interface SlackActionConnector extends ActionConnector { |
112 |
| - secrets: SlackSecrets; |
113 |
| -} |
| 106 | +export type SlackActionConnector = UserConfiguredActionConnector<unknown, SlackSecrets>; |
114 | 107 |
|
115 |
| -interface WebhookConfig { |
| 108 | +export interface WebhookConfig { |
116 | 109 | method: string;
|
117 | 110 | url: string;
|
118 | 111 | headers: Record<string, string>;
|
119 | 112 | }
|
120 | 113 |
|
121 |
| -interface WebhookSecrets { |
| 114 | +export interface WebhookSecrets { |
122 | 115 | user: string;
|
123 | 116 | password: string;
|
124 | 117 | }
|
125 | 118 |
|
126 |
| -export interface WebhookActionConnector extends ActionConnector { |
127 |
| - config: WebhookConfig; |
128 |
| - secrets: WebhookSecrets; |
129 |
| -} |
| 119 | +export type WebhookActionConnector = UserConfiguredActionConnector<WebhookConfig, WebhookSecrets>; |
0 commit comments