|
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,67 +64,57 @@ 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 | hasAuth: boolean;
|
73 | 73 | }
|
74 | 74 |
|
75 |
| -interface EmailSecrets { |
| 75 | +export interface EmailSecrets { |
76 | 76 | user: string | null;
|
77 | 77 | password: string | null;
|
78 | 78 | }
|
79 | 79 |
|
80 |
| -export interface EmailActionConnector extends ActionConnector { |
81 |
| - config: EmailConfig; |
82 |
| - secrets: EmailSecrets; |
83 |
| -} |
| 80 | +export type EmailActionConnector = UserConfiguredActionConnector<EmailConfig, EmailSecrets>; |
84 | 81 |
|
85 |
| -interface EsIndexConfig { |
| 82 | +export interface EsIndexConfig { |
86 | 83 | index: string;
|
87 | 84 | executionTimeField?: string | null;
|
88 | 85 | refresh?: boolean;
|
89 | 86 | }
|
90 | 87 |
|
91 |
| -export interface EsIndexActionConnector extends ActionConnector { |
92 |
| - config: EsIndexConfig; |
93 |
| -} |
| 88 | +export type EsIndexActionConnector = UserConfiguredActionConnector<EsIndexConfig, unknown>; |
94 | 89 |
|
95 |
| -interface PagerDutyConfig { |
| 90 | +export interface PagerDutyConfig { |
96 | 91 | apiUrl?: string;
|
97 | 92 | }
|
98 | 93 |
|
99 |
| -interface PagerDutySecrets { |
| 94 | +export interface PagerDutySecrets { |
100 | 95 | routingKey: string;
|
101 | 96 | }
|
102 | 97 |
|
103 |
| -export interface PagerDutyActionConnector extends ActionConnector { |
104 |
| - config: PagerDutyConfig; |
105 |
| - secrets: PagerDutySecrets; |
106 |
| -} |
| 98 | +export type PagerDutyActionConnector = UserConfiguredActionConnector< |
| 99 | + PagerDutyConfig, |
| 100 | + PagerDutySecrets |
| 101 | +>; |
107 | 102 |
|
108 |
| -interface SlackSecrets { |
| 103 | +export interface SlackSecrets { |
109 | 104 | webhookUrl: string;
|
110 | 105 | }
|
111 | 106 |
|
112 |
| -export interface SlackActionConnector extends ActionConnector { |
113 |
| - secrets: SlackSecrets; |
114 |
| -} |
| 107 | +export type SlackActionConnector = UserConfiguredActionConnector<unknown, SlackSecrets>; |
115 | 108 |
|
116 |
| -interface WebhookConfig { |
| 109 | +export interface WebhookConfig { |
117 | 110 | method: string;
|
118 | 111 | url: string;
|
119 | 112 | headers: Record<string, string>;
|
120 | 113 | }
|
121 | 114 |
|
122 |
| -interface WebhookSecrets { |
| 115 | +export interface WebhookSecrets { |
123 | 116 | user: string;
|
124 | 117 | password: string;
|
125 | 118 | }
|
126 | 119 |
|
127 |
| -export interface WebhookActionConnector extends ActionConnector { |
128 |
| - config: WebhookConfig; |
129 |
| - secrets: WebhookSecrets; |
130 |
| -} |
| 120 | +export type WebhookActionConnector = UserConfiguredActionConnector<WebhookConfig, WebhookSecrets>; |
0 commit comments