From 336a58784f4c545c79faa23790ab6eec9a6fe78d Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Fri, 5 Mar 2021 19:16:48 -0800 Subject: [PATCH] [Rename] kbn-config-schema to osd-config-scheme (#71) * [Rename] kbn-config-schema to osd-config-scheme Signed-off-by: Kawika Avilla * Handle PR comments Signed-off-by: Kawika Avilla --- .../README.md | 26 ++++++------- .../package.json | 4 +- .../src/byte_size_value/index.test.ts | 0 .../src/byte_size_value/index.ts | 0 .../src/duration/index.ts | 0 .../src/errors/index.ts | 0 .../src/errors/schema_error.test.ts | 0 .../src/errors/schema_error.ts | 0 .../src/errors/schema_type_error.ts | 0 .../src/errors/schema_types_error.ts | 0 .../src/errors/validation_error.ts | 0 .../src/index.ts | 0 .../src/internals/index.ts | 0 .../src/references/context_reference.ts | 0 .../src/references/index.ts | 0 .../src/references/reference.test.ts | 0 .../src/references/reference.ts | 0 .../src/references/sibling_reference.ts | 0 .../src/typeguards/index.ts | 0 .../src/typeguards/is_config_schema.test.ts | 4 +- .../src/typeguards/is_config_schema.ts | 2 +- .../src/types/any_type.test.ts | 0 .../src/types/any_type.ts | 0 .../src/types/array_type.test.ts | 0 .../src/types/array_type.ts | 0 .../src/types/boolean_type.test.ts | 0 .../src/types/boolean_type.ts | 0 .../src/types/buffer_type.test.ts | 0 .../src/types/buffer_type.ts | 0 .../src/types/byte_size_type.test.ts | 0 .../src/types/byte_size_type.ts | 0 .../src/types/conditional_type.test.ts | 0 .../src/types/conditional_type.ts | 0 .../src/types/duration_type.test.ts | 0 .../src/types/duration_type.ts | 0 .../src/types/index.ts | 0 .../src/types/ip_type.test.ts | 0 .../src/types/ip_type.ts | 0 .../src/types/literal_type.test.ts | 0 .../src/types/literal_type.ts | 0 .../src/types/map_of_type.test.ts | 0 .../src/types/map_type.ts | 0 .../src/types/maybe_type.test.ts | 0 .../src/types/maybe_type.ts | 0 .../src/types/never_type.test.ts | 0 .../src/types/never_type.ts | 0 .../src/types/nullable_type.test.ts | 0 .../src/types/number_type.test.ts | 0 .../src/types/number_type.ts | 0 .../src/types/object_type.test.ts | 0 .../src/types/object_type.ts | 0 .../src/types/one_of_type.test.ts | 0 .../src/types/record_of_type.test.ts | 0 .../src/types/record_type.ts | 0 .../src/types/stream_type.test.ts | 0 .../src/types/stream_type.ts | 0 .../src/types/string_type.test.ts | 0 .../src/types/string_type.ts | 0 .../src/types/type.ts | 2 +- .../src/types/union_type.ts | 0 .../src/types/uri_type.test.ts | 38 +++++++++---------- .../src/types/uri_type.ts | 0 .../tsconfig.json | 0 .../types/joi.d.ts | 0 64 files changed, 38 insertions(+), 38 deletions(-) rename packages/{kbn-config-schema => osd-config-schema}/README.md (94%) rename packages/{kbn-config-schema => osd-config-schema}/package.json (85%) rename packages/{kbn-config-schema => osd-config-schema}/src/byte_size_value/index.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/byte_size_value/index.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/duration/index.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/errors/index.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/errors/schema_error.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/errors/schema_error.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/errors/schema_type_error.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/errors/schema_types_error.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/errors/validation_error.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/index.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/internals/index.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/references/context_reference.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/references/index.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/references/reference.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/references/reference.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/references/sibling_reference.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/typeguards/index.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/typeguards/is_config_schema.test.ts (95%) rename packages/{kbn-config-schema => osd-config-schema}/src/typeguards/is_config_schema.ts (93%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/any_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/any_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/array_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/array_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/boolean_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/boolean_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/buffer_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/buffer_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/byte_size_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/byte_size_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/conditional_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/conditional_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/duration_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/duration_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/index.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/ip_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/ip_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/literal_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/literal_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/map_of_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/map_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/maybe_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/maybe_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/never_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/never_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/nullable_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/number_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/number_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/object_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/object_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/one_of_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/record_of_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/record_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/stream_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/stream_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/string_type.test.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/string_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/type.ts (98%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/union_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/uri_type.test.ts (75%) rename packages/{kbn-config-schema => osd-config-schema}/src/types/uri_type.ts (100%) rename packages/{kbn-config-schema => osd-config-schema}/tsconfig.json (100%) rename packages/{kbn-config-schema => osd-config-schema}/types/joi.d.ts (100%) diff --git a/packages/kbn-config-schema/README.md b/packages/osd-config-schema/README.md similarity index 94% rename from packages/kbn-config-schema/README.md rename to packages/osd-config-schema/README.md index a4f2c1f6458c..0614b86943e8 100644 --- a/packages/kbn-config-schema/README.md +++ b/packages/osd-config-schema/README.md @@ -1,11 +1,11 @@ -# `@kbn/config-schema` — The Kibana config validation library +# `@osd/config-schema` — The OpenSearch Dashboards config validation library -`@kbn/config-schema` is a TypeScript library inspired by Joi and designed to allow run-time validation of the -Kibana configuration entries providing developers with a fully typed model of the validated data. +`@osd/config-schema` is a TypeScript library inspired by Joi and designed to allow run-time validation of the +OpenSearch Dashboards configuration entries providing developers with a fully typed model of the validated data. ## Table of Contents -- [Why `@kbn/config-schema`?](#why-kbnconfig-schema) +- [Why `@osd/config-schema`?](#why-osdconfig-schema) - [Schema building blocks](#schema-building-blocks) - [Basic types](#basic-types) - [`schema.string()`](#schemastring) @@ -35,9 +35,9 @@ Kibana configuration entries providing developers with a fully typed model of th - [Custom validation](#custom-validation) - [Default values](#default-values) -## Why `@kbn/config-schema`? +## Why `@osd/config-schema`? -Validation of externally supplied data is very important for Kibana. Especially if this data is used to configure how it operates. +Validation of externally supplied data is very important for OpenSearch Dashboards. Especially if this data is used to configure how it operates. There are a number of reasons why we decided to roll our own solution for the configuration validation: @@ -95,7 +95,7 @@ expect(() => __Notes:__ * `validate` method throws as soon as the first schema violation is encountered, no further validation is performed. -* when you retrieve configuration within a Kibana plugin `validate` function is called by the Core automatically providing appropriate namespace and context variables (environment name, package info etc.). +* when you retrieve configuration within a OpenSearch Dashboards plugin `validate` function is called by the Core automatically providing appropriate namespace and context variables (environment name, package info etc.). ### Basic types @@ -478,8 +478,8 @@ valueSchema.validate({}, { envName: 'dev' }); ``` __Notes:__ -* The `@kbn/config-schema` neither validates nor coerces the "dereferenced" value and the developer is responsible for making sure that it has the appropriate type. -* The root context that Kibana provides during config validation includes lots of useful properties like `environment name` that can be used to provide a strict schema for production and more relaxed one for development. +* The `@osd/config-schema` neither validates nor coerces the "dereferenced" value and the developer is responsible for making sure that it has the appropriate type. +* The root context that OpenSearch Dashboards provides during config validation includes lots of useful properties like `environment name` that can be used to provide a strict schema for production and more relaxed one for development. #### `schema.siblingRef()` @@ -496,14 +496,14 @@ const valueSchema = schema.object({ ``` __Notes:__ -* The `@kbn/config-schema` neither validates nor coerces the "dereferenced" value and the developer is responsible for making sure that it has the appropriate type. +* The `@osd/config-schema` neither validates nor coerces the "dereferenced" value and the developer is responsible for making sure that it has the appropriate type. ## Custom validation Using built-in schema primitives may not be enough in some scenarios or sometimes the attempt to model complex schemas with built-in primitives only may result in unreadable code. -For these cases `@kbn/config-schema` provides a way to specify a custom validation function for almost any schema building block through the `validate` option. +For these cases `@osd/config-schema` provides a way to specify a custom validation function for almost any schema building block through the `validate` option. -For example `@kbn/config-schema` doesn't have a dedicated primitive for the `RegExp` based validation currently, but you can easily do that with a custom `validate` function: +For example `@osd/config-schema` doesn't have a dedicated primitive for the `RegExp` based validation currently, but you can easily do that with a custom `validate` function: ```typescript const valueSchema = schema.string({ @@ -552,4 +552,4 @@ const valueSchemaWithFunctionEvaluatedDefault = schema.string({ defaultValue: () ``` __Notes:__ -* `@kbn/config-schema` neither validates nor coerces default value and developer is responsible for making sure that it has the appropriate type. +* `@osd/config-schema` neither validates nor coerces default value and developer is responsible for making sure that it has the appropriate type. diff --git a/packages/kbn-config-schema/package.json b/packages/osd-config-schema/package.json similarity index 85% rename from packages/kbn-config-schema/package.json rename to packages/osd-config-schema/package.json index 9abe7f31dd06..27773df2b410 100644 --- a/packages/kbn-config-schema/package.json +++ b/packages/osd-config-schema/package.json @@ -1,5 +1,5 @@ { - "name": "@kbn/config-schema", + "name": "@osd/config-schema", "main": "./target/out/index.js", "types": "./target/types/index.d.ts", "version": "1.0.0", @@ -7,7 +7,7 @@ "private": true, "scripts": { "build": "tsc", - "kbn:bootstrap": "yarn build" + "osd:bootstrap": "yarn build" }, "devDependencies": { "typescript": "4.0.2", diff --git a/packages/kbn-config-schema/src/byte_size_value/index.test.ts b/packages/osd-config-schema/src/byte_size_value/index.test.ts similarity index 100% rename from packages/kbn-config-schema/src/byte_size_value/index.test.ts rename to packages/osd-config-schema/src/byte_size_value/index.test.ts diff --git a/packages/kbn-config-schema/src/byte_size_value/index.ts b/packages/osd-config-schema/src/byte_size_value/index.ts similarity index 100% rename from packages/kbn-config-schema/src/byte_size_value/index.ts rename to packages/osd-config-schema/src/byte_size_value/index.ts diff --git a/packages/kbn-config-schema/src/duration/index.ts b/packages/osd-config-schema/src/duration/index.ts similarity index 100% rename from packages/kbn-config-schema/src/duration/index.ts rename to packages/osd-config-schema/src/duration/index.ts diff --git a/packages/kbn-config-schema/src/errors/index.ts b/packages/osd-config-schema/src/errors/index.ts similarity index 100% rename from packages/kbn-config-schema/src/errors/index.ts rename to packages/osd-config-schema/src/errors/index.ts diff --git a/packages/kbn-config-schema/src/errors/schema_error.test.ts b/packages/osd-config-schema/src/errors/schema_error.test.ts similarity index 100% rename from packages/kbn-config-schema/src/errors/schema_error.test.ts rename to packages/osd-config-schema/src/errors/schema_error.test.ts diff --git a/packages/kbn-config-schema/src/errors/schema_error.ts b/packages/osd-config-schema/src/errors/schema_error.ts similarity index 100% rename from packages/kbn-config-schema/src/errors/schema_error.ts rename to packages/osd-config-schema/src/errors/schema_error.ts diff --git a/packages/kbn-config-schema/src/errors/schema_type_error.ts b/packages/osd-config-schema/src/errors/schema_type_error.ts similarity index 100% rename from packages/kbn-config-schema/src/errors/schema_type_error.ts rename to packages/osd-config-schema/src/errors/schema_type_error.ts diff --git a/packages/kbn-config-schema/src/errors/schema_types_error.ts b/packages/osd-config-schema/src/errors/schema_types_error.ts similarity index 100% rename from packages/kbn-config-schema/src/errors/schema_types_error.ts rename to packages/osd-config-schema/src/errors/schema_types_error.ts diff --git a/packages/kbn-config-schema/src/errors/validation_error.ts b/packages/osd-config-schema/src/errors/validation_error.ts similarity index 100% rename from packages/kbn-config-schema/src/errors/validation_error.ts rename to packages/osd-config-schema/src/errors/validation_error.ts diff --git a/packages/kbn-config-schema/src/index.ts b/packages/osd-config-schema/src/index.ts similarity index 100% rename from packages/kbn-config-schema/src/index.ts rename to packages/osd-config-schema/src/index.ts diff --git a/packages/kbn-config-schema/src/internals/index.ts b/packages/osd-config-schema/src/internals/index.ts similarity index 100% rename from packages/kbn-config-schema/src/internals/index.ts rename to packages/osd-config-schema/src/internals/index.ts diff --git a/packages/kbn-config-schema/src/references/context_reference.ts b/packages/osd-config-schema/src/references/context_reference.ts similarity index 100% rename from packages/kbn-config-schema/src/references/context_reference.ts rename to packages/osd-config-schema/src/references/context_reference.ts diff --git a/packages/kbn-config-schema/src/references/index.ts b/packages/osd-config-schema/src/references/index.ts similarity index 100% rename from packages/kbn-config-schema/src/references/index.ts rename to packages/osd-config-schema/src/references/index.ts diff --git a/packages/kbn-config-schema/src/references/reference.test.ts b/packages/osd-config-schema/src/references/reference.test.ts similarity index 100% rename from packages/kbn-config-schema/src/references/reference.test.ts rename to packages/osd-config-schema/src/references/reference.test.ts diff --git a/packages/kbn-config-schema/src/references/reference.ts b/packages/osd-config-schema/src/references/reference.ts similarity index 100% rename from packages/kbn-config-schema/src/references/reference.ts rename to packages/osd-config-schema/src/references/reference.ts diff --git a/packages/kbn-config-schema/src/references/sibling_reference.ts b/packages/osd-config-schema/src/references/sibling_reference.ts similarity index 100% rename from packages/kbn-config-schema/src/references/sibling_reference.ts rename to packages/osd-config-schema/src/references/sibling_reference.ts diff --git a/packages/kbn-config-schema/src/typeguards/index.ts b/packages/osd-config-schema/src/typeguards/index.ts similarity index 100% rename from packages/kbn-config-schema/src/typeguards/index.ts rename to packages/osd-config-schema/src/typeguards/index.ts diff --git a/packages/kbn-config-schema/src/typeguards/is_config_schema.test.ts b/packages/osd-config-schema/src/typeguards/is_config_schema.test.ts similarity index 95% rename from packages/kbn-config-schema/src/typeguards/is_config_schema.test.ts rename to packages/osd-config-schema/src/typeguards/is_config_schema.test.ts index 485251055d2b..320160b9ef60 100644 --- a/packages/kbn-config-schema/src/typeguards/is_config_schema.test.ts +++ b/packages/osd-config-schema/src/typeguards/is_config_schema.test.ts @@ -50,7 +50,7 @@ describe('isConfigSchema', () => { expect(isConfigSchema(function () {})).toBe(false); }); - it('returns true as long as `__isKbnConfigSchemaType` is true', () => { - expect(isConfigSchema({ __isKbnConfigSchemaType: true })).toBe(true); + it('returns true as long as `__isOsdConfigSchemaType` is true', () => { + expect(isConfigSchema({ __isOsdConfigSchemaType: true })).toBe(true); }); }); diff --git a/packages/kbn-config-schema/src/typeguards/is_config_schema.ts b/packages/osd-config-schema/src/typeguards/is_config_schema.ts similarity index 93% rename from packages/kbn-config-schema/src/typeguards/is_config_schema.ts rename to packages/osd-config-schema/src/typeguards/is_config_schema.ts index 20e68ab2ead2..ae3638744ae2 100644 --- a/packages/kbn-config-schema/src/typeguards/is_config_schema.ts +++ b/packages/osd-config-schema/src/typeguards/is_config_schema.ts @@ -20,5 +20,5 @@ import { Type } from '../types'; export function isConfigSchema(obj: any): obj is Type { - return obj ? obj.__isKbnConfigSchemaType === true : false; + return obj ? obj.__isOsdConfigSchemaType === true : false; } diff --git a/packages/kbn-config-schema/src/types/any_type.test.ts b/packages/osd-config-schema/src/types/any_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/any_type.test.ts rename to packages/osd-config-schema/src/types/any_type.test.ts diff --git a/packages/kbn-config-schema/src/types/any_type.ts b/packages/osd-config-schema/src/types/any_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/any_type.ts rename to packages/osd-config-schema/src/types/any_type.ts diff --git a/packages/kbn-config-schema/src/types/array_type.test.ts b/packages/osd-config-schema/src/types/array_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/array_type.test.ts rename to packages/osd-config-schema/src/types/array_type.test.ts diff --git a/packages/kbn-config-schema/src/types/array_type.ts b/packages/osd-config-schema/src/types/array_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/array_type.ts rename to packages/osd-config-schema/src/types/array_type.ts diff --git a/packages/kbn-config-schema/src/types/boolean_type.test.ts b/packages/osd-config-schema/src/types/boolean_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/boolean_type.test.ts rename to packages/osd-config-schema/src/types/boolean_type.test.ts diff --git a/packages/kbn-config-schema/src/types/boolean_type.ts b/packages/osd-config-schema/src/types/boolean_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/boolean_type.ts rename to packages/osd-config-schema/src/types/boolean_type.ts diff --git a/packages/kbn-config-schema/src/types/buffer_type.test.ts b/packages/osd-config-schema/src/types/buffer_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/buffer_type.test.ts rename to packages/osd-config-schema/src/types/buffer_type.test.ts diff --git a/packages/kbn-config-schema/src/types/buffer_type.ts b/packages/osd-config-schema/src/types/buffer_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/buffer_type.ts rename to packages/osd-config-schema/src/types/buffer_type.ts diff --git a/packages/kbn-config-schema/src/types/byte_size_type.test.ts b/packages/osd-config-schema/src/types/byte_size_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/byte_size_type.test.ts rename to packages/osd-config-schema/src/types/byte_size_type.test.ts diff --git a/packages/kbn-config-schema/src/types/byte_size_type.ts b/packages/osd-config-schema/src/types/byte_size_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/byte_size_type.ts rename to packages/osd-config-schema/src/types/byte_size_type.ts diff --git a/packages/kbn-config-schema/src/types/conditional_type.test.ts b/packages/osd-config-schema/src/types/conditional_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/conditional_type.test.ts rename to packages/osd-config-schema/src/types/conditional_type.test.ts diff --git a/packages/kbn-config-schema/src/types/conditional_type.ts b/packages/osd-config-schema/src/types/conditional_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/conditional_type.ts rename to packages/osd-config-schema/src/types/conditional_type.ts diff --git a/packages/kbn-config-schema/src/types/duration_type.test.ts b/packages/osd-config-schema/src/types/duration_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/duration_type.test.ts rename to packages/osd-config-schema/src/types/duration_type.test.ts diff --git a/packages/kbn-config-schema/src/types/duration_type.ts b/packages/osd-config-schema/src/types/duration_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/duration_type.ts rename to packages/osd-config-schema/src/types/duration_type.ts diff --git a/packages/kbn-config-schema/src/types/index.ts b/packages/osd-config-schema/src/types/index.ts similarity index 100% rename from packages/kbn-config-schema/src/types/index.ts rename to packages/osd-config-schema/src/types/index.ts diff --git a/packages/kbn-config-schema/src/types/ip_type.test.ts b/packages/osd-config-schema/src/types/ip_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/ip_type.test.ts rename to packages/osd-config-schema/src/types/ip_type.test.ts diff --git a/packages/kbn-config-schema/src/types/ip_type.ts b/packages/osd-config-schema/src/types/ip_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/ip_type.ts rename to packages/osd-config-schema/src/types/ip_type.ts diff --git a/packages/kbn-config-schema/src/types/literal_type.test.ts b/packages/osd-config-schema/src/types/literal_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/literal_type.test.ts rename to packages/osd-config-schema/src/types/literal_type.test.ts diff --git a/packages/kbn-config-schema/src/types/literal_type.ts b/packages/osd-config-schema/src/types/literal_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/literal_type.ts rename to packages/osd-config-schema/src/types/literal_type.ts diff --git a/packages/kbn-config-schema/src/types/map_of_type.test.ts b/packages/osd-config-schema/src/types/map_of_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/map_of_type.test.ts rename to packages/osd-config-schema/src/types/map_of_type.test.ts diff --git a/packages/kbn-config-schema/src/types/map_type.ts b/packages/osd-config-schema/src/types/map_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/map_type.ts rename to packages/osd-config-schema/src/types/map_type.ts diff --git a/packages/kbn-config-schema/src/types/maybe_type.test.ts b/packages/osd-config-schema/src/types/maybe_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/maybe_type.test.ts rename to packages/osd-config-schema/src/types/maybe_type.test.ts diff --git a/packages/kbn-config-schema/src/types/maybe_type.ts b/packages/osd-config-schema/src/types/maybe_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/maybe_type.ts rename to packages/osd-config-schema/src/types/maybe_type.ts diff --git a/packages/kbn-config-schema/src/types/never_type.test.ts b/packages/osd-config-schema/src/types/never_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/never_type.test.ts rename to packages/osd-config-schema/src/types/never_type.test.ts diff --git a/packages/kbn-config-schema/src/types/never_type.ts b/packages/osd-config-schema/src/types/never_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/never_type.ts rename to packages/osd-config-schema/src/types/never_type.ts diff --git a/packages/kbn-config-schema/src/types/nullable_type.test.ts b/packages/osd-config-schema/src/types/nullable_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/nullable_type.test.ts rename to packages/osd-config-schema/src/types/nullable_type.test.ts diff --git a/packages/kbn-config-schema/src/types/number_type.test.ts b/packages/osd-config-schema/src/types/number_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/number_type.test.ts rename to packages/osd-config-schema/src/types/number_type.test.ts diff --git a/packages/kbn-config-schema/src/types/number_type.ts b/packages/osd-config-schema/src/types/number_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/number_type.ts rename to packages/osd-config-schema/src/types/number_type.ts diff --git a/packages/kbn-config-schema/src/types/object_type.test.ts b/packages/osd-config-schema/src/types/object_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/object_type.test.ts rename to packages/osd-config-schema/src/types/object_type.test.ts diff --git a/packages/kbn-config-schema/src/types/object_type.ts b/packages/osd-config-schema/src/types/object_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/object_type.ts rename to packages/osd-config-schema/src/types/object_type.ts diff --git a/packages/kbn-config-schema/src/types/one_of_type.test.ts b/packages/osd-config-schema/src/types/one_of_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/one_of_type.test.ts rename to packages/osd-config-schema/src/types/one_of_type.test.ts diff --git a/packages/kbn-config-schema/src/types/record_of_type.test.ts b/packages/osd-config-schema/src/types/record_of_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/record_of_type.test.ts rename to packages/osd-config-schema/src/types/record_of_type.test.ts diff --git a/packages/kbn-config-schema/src/types/record_type.ts b/packages/osd-config-schema/src/types/record_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/record_type.ts rename to packages/osd-config-schema/src/types/record_type.ts diff --git a/packages/kbn-config-schema/src/types/stream_type.test.ts b/packages/osd-config-schema/src/types/stream_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/stream_type.test.ts rename to packages/osd-config-schema/src/types/stream_type.test.ts diff --git a/packages/kbn-config-schema/src/types/stream_type.ts b/packages/osd-config-schema/src/types/stream_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/stream_type.ts rename to packages/osd-config-schema/src/types/stream_type.ts diff --git a/packages/kbn-config-schema/src/types/string_type.test.ts b/packages/osd-config-schema/src/types/string_type.test.ts similarity index 100% rename from packages/kbn-config-schema/src/types/string_type.test.ts rename to packages/osd-config-schema/src/types/string_type.test.ts diff --git a/packages/kbn-config-schema/src/types/string_type.ts b/packages/osd-config-schema/src/types/string_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/string_type.ts rename to packages/osd-config-schema/src/types/string_type.ts diff --git a/packages/kbn-config-schema/src/types/type.ts b/packages/osd-config-schema/src/types/type.ts similarity index 98% rename from packages/kbn-config-schema/src/types/type.ts rename to packages/osd-config-schema/src/types/type.ts index 5ca16c61399e..e9ef67a2b1f9 100644 --- a/packages/kbn-config-schema/src/types/type.ts +++ b/packages/osd-config-schema/src/types/type.ts @@ -33,7 +33,7 @@ export abstract class Type { public readonly type: V = null! as V; // used for the `isConfigSchema` typeguard - public readonly __isKbnConfigSchemaType = true; + public readonly __isOsdConfigSchemaType = true; /** * Internal "schema" backed by Joi. diff --git a/packages/kbn-config-schema/src/types/union_type.ts b/packages/osd-config-schema/src/types/union_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/union_type.ts rename to packages/osd-config-schema/src/types/union_type.ts diff --git a/packages/kbn-config-schema/src/types/uri_type.test.ts b/packages/osd-config-schema/src/types/uri_type.test.ts similarity index 75% rename from packages/kbn-config-schema/src/types/uri_type.test.ts rename to packages/osd-config-schema/src/types/uri_type.test.ts index 72e5ca6f7171..8d931640ce81 100644 --- a/packages/kbn-config-schema/src/types/uri_type.test.ts +++ b/packages/osd-config-schema/src/types/uri_type.test.ts @@ -32,18 +32,18 @@ test('returns value for valid URI as per RFC3986', () => { 'http://tools.ietf.org/html/rfc3986' ); expect(uriSchema.validate('udp://3domain.local')).toBe('udp://3domain.local'); - expect(uriSchema.validate('urn:elastic:kibana')).toBe('urn:elastic:kibana'); + expect(uriSchema.validate('urn:opensearch:opensearchDashboards')).toBe('urn:opensearch:opensearchDashboards'); expect(uriSchema.validate('ftp://ftp.ietf.org/rfc/rfc3986.txt')).toBe( 'ftp://ftp.ietf.org/rfc/rfc3986.txt' ); - expect(uriSchema.validate('mailto:Platform.Kibana@elastic.co')).toBe( - 'mailto:Platform.Kibana@elastic.co' + expect(uriSchema.validate('mailto:Platform.OpenSearchDashboards@opensearch.co')).toBe( + 'mailto:Platform.OpenSearchDashboards@opensearch.co' ); expect(uriSchema.validate('tel:+500-111-222-333')).toBe('tel:+500-111-222-333'); - expect(uriSchema.validate('file:///kibana.log')).toBe('file:///kibana.log'); - expect(uriSchema.validate('http://elastic@localhost:9200')).toBe('http://elastic@localhost:9200'); - expect(uriSchema.validate('http://elastic:changeme@localhost:9200')).toBe( - 'http://elastic:changeme@localhost:9200' + expect(uriSchema.validate('file:///opensearch_dashboards.log')).toBe('file:///opensearch_dashboards.log'); + expect(uriSchema.validate('http://opensearch@localhost:9200')).toBe('http://opensearch@localhost:9200'); + expect(uriSchema.validate('http://opensearch:changeme@localhost:9200')).toBe( + 'http://opensearch:changeme@localhost:9200' ); expect(uriSchema.validate('ldap://[2001:db8::7]/c=GB?objectClass?one')).toBe( 'ldap://[2001:db8::7]/c=GB?objectClass?one' @@ -79,17 +79,17 @@ describe('#scheme', () => { test('returns value when URI has required scheme', () => { const uriSchema = schema.uri({ scheme: ['http', 'https'] }); - expect(uriSchema.validate('http://elastic.co')).toBe('http://elastic.co'); - expect(uriSchema.validate('https://elastic.co')).toBe('https://elastic.co'); + expect(uriSchema.validate('http://opensearch.co')).toBe('http://opensearch.co'); + expect(uriSchema.validate('https://opensearch.co')).toBe('https://opensearch.co'); }); test('returns error when shorter string', () => { const uriSchema = schema.uri({ scheme: ['http', 'https'] }); - expect(() => uriSchema.validate('ftp://elastic.co')).toThrowErrorMatchingInlineSnapshot( + expect(() => uriSchema.validate('ftp://opensearch.co')).toThrowErrorMatchingInlineSnapshot( `"expected URI with scheme [http|https]."` ); - expect(() => uriSchema.validate('file:///kibana.log')).toThrowErrorMatchingInlineSnapshot( + expect(() => uriSchema.validate('file:///opensearch_dashboards.log')).toThrowErrorMatchingInlineSnapshot( `"expected URI with scheme [http|https]."` ); }); @@ -104,16 +104,16 @@ describe('#defaultValue', () => { test('returns value when specified', () => { expect( - schema.uri({ defaultValue: 'http://localhost:9200' }).validate('http://kibana.local') - ).toBe('http://kibana.local'); + schema.uri({ defaultValue: 'http://localhost:9200' }).validate('http://opensearch-dashboards.local') + ).toBe('http://opensearch-dashboards.local'); }); test('returns value from context when context reference is specified', () => { expect( schema.uri({ defaultValue: schema.contextRef('some_uri') }).validate(undefined, { - some_uri: 'http://kibana.local', + some_uri: 'http://opensearch-dashboards.local', }) - ).toBe('http://kibana.local'); + ).toBe('http://opensearch-dashboards.local'); }); }); @@ -125,15 +125,15 @@ describe('#validate', () => { calledWith = val; }; - schema.uri({ validate: validator }).validate('http://kibana.local'); + schema.uri({ validate: validator }).validate('http://opensearch-dashboards.local'); - expect(calledWith).toBe('http://kibana.local'); + expect(calledWith).toBe('http://opensearch-dashboards.local'); }); test('is not called with default value in no input', () => { const validate = jest.fn(); - schema.uri({ validate, defaultValue: 'http://kibana.local' }).validate(undefined); + schema.uri({ validate, defaultValue: 'http://opensearch-dashboards.local' }).validate(undefined); expect(validate).not.toHaveBeenCalled(); }); @@ -142,7 +142,7 @@ describe('#validate', () => { const validate = () => 'validator failure'; expect(() => - schema.uri({ validate }).validate('http://kibana.local') + schema.uri({ validate }).validate('http://opensearch-dashboards.local') ).toThrowErrorMatchingInlineSnapshot(`"validator failure"`); }); }); diff --git a/packages/kbn-config-schema/src/types/uri_type.ts b/packages/osd-config-schema/src/types/uri_type.ts similarity index 100% rename from packages/kbn-config-schema/src/types/uri_type.ts rename to packages/osd-config-schema/src/types/uri_type.ts diff --git a/packages/kbn-config-schema/tsconfig.json b/packages/osd-config-schema/tsconfig.json similarity index 100% rename from packages/kbn-config-schema/tsconfig.json rename to packages/osd-config-schema/tsconfig.json diff --git a/packages/kbn-config-schema/types/joi.d.ts b/packages/osd-config-schema/types/joi.d.ts similarity index 100% rename from packages/kbn-config-schema/types/joi.d.ts rename to packages/osd-config-schema/types/joi.d.ts