-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
Copy pathconfig.ts
57 lines (51 loc) · 1.63 KB
/
config.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
53
54
55
56
57
/*
* 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.
*/
import { schema, TypeOf } from '@kbn/config-schema';
import { PluginConfigDescriptor } from 'kibana/server';
const apmConfigSchema = schema.object({
url: schema.maybe(schema.string()),
secret_token: schema.maybe(schema.string()),
ui: schema.maybe(
schema.object({
url: schema.maybe(schema.string()),
})
),
});
const fullStoryConfigSchema = schema.object({
enabled: schema.boolean({ defaultValue: false }),
org_id: schema.conditional(
schema.siblingRef('enabled'),
true,
schema.string({ minLength: 1 }),
schema.maybe(schema.string())
),
});
const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
id: schema.maybe(schema.string()),
apm: schema.maybe(apmConfigSchema),
cname: schema.maybe(schema.string()),
base_url: schema.maybe(schema.string()),
profile_url: schema.maybe(schema.string()),
deployment_url: schema.maybe(schema.string()),
organization_url: schema.maybe(schema.string()),
full_story: fullStoryConfigSchema,
});
export type CloudConfigType = TypeOf<typeof configSchema>;
export const config: PluginConfigDescriptor<CloudConfigType> = {
exposeToBrowser: {
id: true,
cname: true,
base_url: true,
profile_url: true,
deployment_url: true,
organization_url: true,
full_story: true,
},
deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')],
schema: configSchema,
};