mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Add missing import statement to schema generator template (#111955)
This commit is contained in:
parent
daf9cd55b1
commit
2bdb3131df
2 changed files with 5 additions and 4 deletions
|
@ -149,10 +149,6 @@ function ecsDate() {
|
|||
return schema.maybe(schema.string({ validate: validateDate }));
|
||||
}
|
||||
|
||||
function ecsVersion() {
|
||||
return schema.maybe(schema.string({ validate: validateVersion }));
|
||||
}
|
||||
|
||||
const ISO_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
||||
|
||||
function validateDate(isoDate: string) {
|
||||
|
@ -160,6 +156,10 @@ function validateDate(isoDate: string) {
|
|||
return 'string is not a valid ISO date: ' + isoDate;
|
||||
}
|
||||
|
||||
function ecsVersion() {
|
||||
return schema.maybe(schema.string({ validate: validateVersion }));
|
||||
}
|
||||
|
||||
function validateVersion(version: string) {
|
||||
if (semver.valid(version)) return;
|
||||
return 'string is not a valid version: ' + version;
|
||||
|
|
|
@ -283,6 +283,7 @@ const SchemaFileTemplate = `
|
|||
// the event log
|
||||
|
||||
import { schema, TypeOf } from '@kbn/config-schema';
|
||||
import semver from 'semver';
|
||||
|
||||
type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> };
|
||||
type DeepPartial<T> = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue