|
| 1 | +/* |
| 2 | + * Licensed to Elasticsearch B.V. under one or more contributor |
| 3 | + * license agreements. See the NOTICE file distributed with |
| 4 | + * this work for additional information regarding copyright |
| 5 | + * ownership. Elasticsearch B.V. licenses this file to you under |
| 6 | + * the Apache License, Version 2.0 (the "License"); you may |
| 7 | + * not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, |
| 13 | + * software distributed under the License is distributed on an |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + * KIND, either express or implied. See the License for the |
| 16 | + * specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +import { schema, TypeOf } from '@kbn/config-schema'; |
| 21 | +import { configSchema as tilemapSchema } from '../tile_map/config'; |
| 22 | + |
| 23 | +// TODO: Move this to regionmap plugin on migration |
| 24 | +export const regionmapSchema = schema.object({ |
| 25 | + includeElasticMapsService: schema.boolean({ defaultValue: true }), |
| 26 | + layers: schema.maybe( |
| 27 | + schema.arrayOf( |
| 28 | + schema.object({ |
| 29 | + url: schema.string(), |
| 30 | + format: schema.object({ |
| 31 | + type: schema.string({ defaultValue: 'geojson' }), |
| 32 | + }), |
| 33 | + meta: schema.object({ |
| 34 | + feature_collection_path: schema.string({ defaultValue: 'data' }), |
| 35 | + }), |
| 36 | + attribution: schema.string(), |
| 37 | + name: schema.string(), |
| 38 | + fields: schema.arrayOf( |
| 39 | + schema.object({ |
| 40 | + name: schema.string(), |
| 41 | + description: schema.string(), |
| 42 | + }) |
| 43 | + ), |
| 44 | + }) |
| 45 | + ) |
| 46 | + ), |
| 47 | +}); |
| 48 | + |
| 49 | +export const configSchema = schema.object({ |
| 50 | + includeElasticMapsService: schema.boolean({ defaultValue: true }), |
| 51 | + proxyElasticMapsServiceInMaps: schema.boolean({ defaultValue: false }), |
| 52 | + tilemap: tilemapSchema, |
| 53 | + regionmap: regionmapSchema, |
| 54 | + manifestServiceUrl: schema.string({ defaultValue: '' }), |
| 55 | + emsFileApiUrl: schema.string({ defaultValue: 'https://vector.maps.elastic.co' }), |
| 56 | + emsTileApiUrl: schema.string({ defaultValue: 'https://tiles.maps.elastic.co' }), |
| 57 | + emsLandingPageUrl: schema.string({ defaultValue: 'https://maps.elastic.co/v7.7' }), |
| 58 | + emsFontLibraryUrl: schema.string({ |
| 59 | + defaultValue: 'https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf', |
| 60 | + }), |
| 61 | + emsTileLayerId: schema.object({ |
| 62 | + bright: schema.string({ defaultValue: 'road_map' }), |
| 63 | + desaturated: schema.string({ defaultValue: 'road_map_desaturated' }), |
| 64 | + dark: schema.string({ defaultValue: 'dark_map' }), |
| 65 | + }), |
| 66 | +}); |
| 67 | + |
| 68 | +export type ConfigSchema = TypeOf<typeof configSchema>; |
0 commit comments