-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
Copy pathindex.ts
52 lines (45 loc) · 1.89 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
// TODO: https://github.com/elastic/kibana/issues/110905
/* eslint-disable @kbn/eslint/no_export_all */
import { schema, TypeOf } from '@kbn/config-schema';
import { PluginConfigDescriptor, PluginInitializerContext } from 'src/core/server';
import { ObservabilityPlugin, ObservabilityPluginSetup } from './plugin';
import { createOrUpdateIndex, Mappings } from './utils/create_or_update_index';
import { ScopedAnnotationsClient } from './lib/annotations/bootstrap_annotations';
import { unwrapEsResponse, WrappedElasticsearchClientError } from './utils/unwrap_es_response';
export { rangeQuery, kqlQuery } from './utils/queries';
export { getInspectResponse } from './utils/get_inspect_response';
export * from './types';
export const config: PluginConfigDescriptor = {
exposeToBrowser: {
unsafe: true,
},
schema: schema.object({
enabled: schema.boolean({ defaultValue: true }),
annotations: schema.object({
enabled: schema.boolean({ defaultValue: true }),
index: schema.string({ defaultValue: 'observability-annotations' }),
}),
unsafe: schema.object({
alertingExperience: schema.object({ enabled: schema.boolean({ defaultValue: false }) }),
cases: schema.object({ enabled: schema.boolean({ defaultValue: false }) }),
}),
}),
deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')],
};
export type ObservabilityConfig = TypeOf<typeof config.schema>;
export const plugin = (initContext: PluginInitializerContext) =>
new ObservabilityPlugin(initContext);
export {
createOrUpdateIndex,
Mappings,
ObservabilityPluginSetup,
ScopedAnnotationsClient,
unwrapEsResponse,
WrappedElasticsearchClientError,
};