From 2bdb3131df59c042835f103bdb2e4b272b3a4dde Mon Sep 17 00:00:00 2001 From: Dmitry Shevchenko Date: Mon, 13 Sep 2021 18:39:52 +0200 Subject: [PATCH] Add missing import statement to schema generator template (#111955) --- x-pack/plugins/event_log/generated/schemas.ts | 8 ++++---- x-pack/plugins/event_log/scripts/create_schemas.js | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/event_log/generated/schemas.ts b/x-pack/plugins/event_log/generated/schemas.ts index 7cecba1efa438..15dc182dbe653 100644 --- a/x-pack/plugins/event_log/generated/schemas.ts +++ b/x-pack/plugins/event_log/generated/schemas.ts @@ -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; diff --git a/x-pack/plugins/event_log/scripts/create_schemas.js b/x-pack/plugins/event_log/scripts/create_schemas.js index 0a53165630a29..c86722ccd76c6 100755 --- a/x-pack/plugins/event_log/scripts/create_schemas.js +++ b/x-pack/plugins/event_log/scripts/create_schemas.js @@ -283,6 +283,7 @@ const SchemaFileTemplate = ` // the event log import { schema, TypeOf } from '@kbn/config-schema'; +import semver from 'semver'; type DeepWriteable = { -readonly [P in keyof T]: DeepWriteable }; type DeepPartial = {