Skip to content

Commit bff5b36

Browse files
authored
[Response Ops][Connectors] Moving connector schemas to package - part 2 (#240177)
Towards elastic/kibana-team#2148 ## Summary Part 2 of 4 PRs to move the connector schemas to a more common package location so they can be reused more easily. This PR moves the schemas for the following connector types to the `@kbn/connector-schemas` package: - `cases_webhook` - `d3security` - `jira service management` - `servicenow itsm` - `servicenow itom` - `servicenow sir` - `opsgenie` - `teams` There will be followup PRs for other connector types.
1 parent 7ee2a02 commit bff5b36

173 files changed

Lines changed: 1581 additions & 1106 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/kbn-optimizer/limits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pageLoadAssetSize:
164164
snapshotRestore: 22068
165165
spaces: 30782
166166
stackAlerts: 31499
167-
stackConnectors: 75929
167+
stackConnectors: 76260
168168
streams: 9000
169169
streamsApp: 17000
170170
synthetics: 31571
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
import { i18n } from '@kbn/i18n';
10+
11+
export const CONNECTOR_ID = '.cases-webhook';
12+
export const CONNECTOR_NAME = i18n.translate('connectors.casesWebhook.title', {
13+
defaultMessage: 'Webhook - Case Management',
14+
});
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
export * from './constants';
10+
export {
11+
ExecutorParamsSchema,
12+
ExecutorSubActionPushParamsSchema,
13+
ExternalIncidentServiceConfigurationSchema,
14+
ExternalIncidentServiceSecretConfigurationSchema,
15+
} from './schemas/latest';
16+
17+
export type {
18+
CasesWebhookPublicConfigurationType,
19+
CasesWebhookSecretConfigurationType,
20+
CasesWebhookActionParamsType,
21+
Incident,
22+
ExecutorParams,
23+
ExecutorSubActionPushParams,
24+
PushToServiceApiParams,
25+
ExternalServiceIncidentResponse,
26+
CasesWebhookExecutorResultData,
27+
} from './types/latest';
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
export * from './v1';

x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/schema.ts renamed to src/platform/packages/shared/kbn-connector-schemas/cases_webhook/schemas/v1.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
7-
89
import { z } from '@kbn/zod';
9-
import {
10-
AuthConfiguration,
11-
SecretConfigurationSchema,
12-
WebhookMethods,
13-
} from '@kbn/connector-schemas/common/auth';
10+
import { AuthConfiguration, SecretConfigurationSchema, WebhookMethods } from '../../common/auth';
1411

1512
const HeadersSchema = z.record(z.string(), z.string());
1613

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
export type * from './v1';
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
import type { z } from '@kbn/zod';
11+
import type {
12+
ExecutorParamsSchema,
13+
ExecutorSubActionPushParamsSchema,
14+
ExternalIncidentServiceConfigurationSchema,
15+
ExternalIncidentServiceSecretConfigurationSchema,
16+
} from '../schemas/v1';
17+
18+
// config
19+
export type CasesWebhookPublicConfigurationType = z.infer<
20+
typeof ExternalIncidentServiceConfigurationSchema
21+
>;
22+
// secrets
23+
export type CasesWebhookSecretConfigurationType = z.infer<
24+
typeof ExternalIncidentServiceSecretConfigurationSchema
25+
>;
26+
// params
27+
export type CasesWebhookActionParamsType = z.infer<typeof ExecutorParamsSchema>;
28+
29+
export type Incident = Omit<ExecutorSubActionPushParams['incident'], 'externalId'>;
30+
31+
export type ExecutorParams = z.infer<typeof ExecutorParamsSchema>;
32+
export type ExecutorSubActionPushParams = z.infer<typeof ExecutorSubActionPushParamsSchema>;
33+
export type PushToServiceApiParams = ExecutorSubActionPushParams;
34+
35+
export interface ExternalServiceIncidentResponse {
36+
id: string;
37+
title: string;
38+
url: string;
39+
pushedDate: string;
40+
}
41+
export type CasesWebhookExecutorResultData = ExternalServiceIncidentResponse;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
import { i18n } from '@kbn/i18n';
10+
11+
export const CONNECTOR_ID = '.d3security';
12+
export const CONNECTOR_NAME = i18n.translate('connectors.d3Security.title', {
13+
defaultMessage: 'D3 Security',
14+
});
15+
16+
export enum SUB_ACTION {
17+
RUN = 'run',
18+
TEST = 'test',
19+
}
20+
export enum D3SecuritySeverity {
21+
EMPTY = '',
22+
HIGH = 'high',
23+
MEDIUM = 'medium',
24+
LOW = 'low',
25+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
export * from './constants';
10+
export {
11+
D3SecurityConfigSchema,
12+
D3SecuritySecretsSchema,
13+
D3SecurityRunActionParamsSchema,
14+
D3SecurityRunActionResponseSchema,
15+
} from './schemas/latest';
16+
17+
export type {
18+
D3SecurityConfig,
19+
D3SecuritySecrets,
20+
D3SecurityRunActionParams,
21+
D3SecurityRunActionResponse,
22+
} from './types/latest';
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
export * from './v1';

0 commit comments

Comments
 (0)