From 60e99c3416d99c10a7178835cdbd75d6ab2ac173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Thu, 29 Aug 2024 02:23:28 +0200 Subject: [PATCH 1/2] [Move `@kbn/config-schema` to server] `kbn-io-ts-utils` --- .../src/props_to_schema/index.ts | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 packages/kbn-io-ts-utils/src/props_to_schema/index.ts diff --git a/packages/kbn-io-ts-utils/src/props_to_schema/index.ts b/packages/kbn-io-ts-utils/src/props_to_schema/index.ts deleted file mode 100644 index 5915df1b0102e..0000000000000 --- a/packages/kbn-io-ts-utils/src/props_to_schema/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import * as t from 'io-ts'; -import { PathReporter } from 'io-ts/lib/PathReporter'; -import { schema, Type } from '@kbn/config-schema'; -import { isLeft } from 'fp-ts/lib/Either'; - -export function propsToSchema>(type: T): Type> { - return schema.object( - {}, - { - unknowns: 'allow', - validate: (val) => { - const decoded = type.decode(val); - - if (isLeft(decoded)) { - return PathReporter.report(decoded).join('\n'); - } - }, - } - ); -} From 13bbe1b674526f73cc767fb4d7132364780ed3bb Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:36:16 +0000 Subject: [PATCH 2/2] [CI] Auto-commit changed files from 'node scripts/notice' --- packages/kbn-io-ts-utils/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/kbn-io-ts-utils/tsconfig.json b/packages/kbn-io-ts-utils/tsconfig.json index 5145b1ee2a7f4..0ac791e1542ae 100644 --- a/packages/kbn-io-ts-utils/tsconfig.json +++ b/packages/kbn-io-ts-utils/tsconfig.json @@ -11,7 +11,6 @@ "**/*.ts" ], "kbn_references": [ - "@kbn/config-schema", "@kbn/core", "@kbn/datemath" ],