diff --git a/packages/kbn-spec-to-console/README.md b/packages/kbn-spec-to-console/README.md deleted file mode 100644 index fc59bff62417..000000000000 --- a/packages/kbn-spec-to-console/README.md +++ /dev/null @@ -1,36 +0,0 @@ -A mini utility to convert [Elasticsearch's REST spec](https://github.com/elastic/elasticsearch/blob/master/rest-api-spec) to Console's (Kibana) autocomplete format. - - -It is used to semi-manually update Console's autocompletion rules. - -### Retrieving the spec - -If you don't have a copy of the Elasticsearch repo on your machine, follow these steps to clone only the rest API specs - -``` -mkdir es-spec && cd es-spec -git init -git remote add origin https://github.com/elastic/elasticsearch -git config core.sparsecheckout true -echo "rest-api-spec/src/main/resources/rest-api-spec/api/*\nx-pack/plugin/src/test/resources/rest-api-spec/api/*" > .git/info/sparse-checkout -git pull --depth=1 origin master -``` - -### Usage - -You need to run the command twice: once for the **OSS** specs and once for the **X-Pack** specs -At the root of the Kibana repository, run the following commands: - -```sh -# OSS -yarn spec_to_console -g "/rest-api-spec/src/main/resources/rest-api-spec/api/*" -d "src/plugins/console/server/lib/spec_definitions/json/generated" - -# X-pack -yarn spec_to_console -g "/x-pack/plugin/src/test/resources/rest-api-spec/api/*" -d "x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated" -``` - -### Information used in Console that is not available in the REST spec - -* Request bodies -* Data fetched at runtime: indices, fields, snapshots, etc -* Ad hoc additions \ No newline at end of file diff --git a/packages/osd-spec-to-console/README.md b/packages/osd-spec-to-console/README.md new file mode 100644 index 000000000000..eceb543eddd1 --- /dev/null +++ b/packages/osd-spec-to-console/README.md @@ -0,0 +1,36 @@ +\ mini utility to convert [OpenSearch's REST spec](https://github.com/elastic/elasticsearch/blob/master/rest-api-spec) to Console's (OpenSearch Dashboards) autocomplete format. + + +It is used to semi-manually update Console's autocompletion rules. + +### Retrieving the spec + +If you don't have a copy of the OpenSearch repo on your machine, follow these steps to clone only the rest API specs + +``` +mkdir opensearch-spec && cd opensearch-spec +git init +git remote add origin https://github.com/elastic/elasticsearch +git config core.sparsecheckout true +echo "rest-api-spec/src/main/resources/rest-api-spec/api/*\nx-pack/plugin/src/test/resources/rest-api-spec/api/*" > .git/info/sparse-checkout +git pull --depth=1 origin master +``` + +### Usage + +You need to run the command twice: once for the **OSS** specs and once for the **X-Pack** specs +At the root of the OpenSearch Dashboards repository, run the following commands: + +```sh +# OSS +yarn spec_to_console -g "/rest-api-spec/src/main/resources/rest-api-spec/api/*" -d "src/plugins/console/server/lib/spec_definitions/json/generated" + +# X-pack +yarn spec_to_console -g "/x-pack/plugin/src/test/resources/rest-api-spec/api/*" -d "x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated" +``` + +### Information used in Console that is not available in the REST spec + +* Request bodies +* Data fetched at runtime: indices, fields, snapshots, etc +* Ad hoc additions \ No newline at end of file diff --git a/packages/kbn-spec-to-console/bin/spec_to_console.js b/packages/osd-spec-to-console/bin/spec_to_console.js similarity index 100% rename from packages/kbn-spec-to-console/bin/spec_to_console.js rename to packages/osd-spec-to-console/bin/spec_to_console.js diff --git a/packages/kbn-spec-to-console/index.js b/packages/osd-spec-to-console/index.js similarity index 100% rename from packages/kbn-spec-to-console/index.js rename to packages/osd-spec-to-console/index.js diff --git a/packages/kbn-spec-to-console/lib/convert.js b/packages/osd-spec-to-console/lib/convert.js similarity index 100% rename from packages/kbn-spec-to-console/lib/convert.js rename to packages/osd-spec-to-console/lib/convert.js diff --git a/packages/kbn-spec-to-console/lib/convert.test.js b/packages/osd-spec-to-console/lib/convert.test.js similarity index 100% rename from packages/kbn-spec-to-console/lib/convert.test.js rename to packages/osd-spec-to-console/lib/convert.test.js diff --git a/packages/kbn-spec-to-console/lib/convert/methods.js b/packages/osd-spec-to-console/lib/convert/methods.js similarity index 100% rename from packages/kbn-spec-to-console/lib/convert/methods.js rename to packages/osd-spec-to-console/lib/convert/methods.js diff --git a/packages/kbn-spec-to-console/lib/convert/params.js b/packages/osd-spec-to-console/lib/convert/params.js similarity index 100% rename from packages/kbn-spec-to-console/lib/convert/params.js rename to packages/osd-spec-to-console/lib/convert/params.js diff --git a/packages/kbn-spec-to-console/lib/convert/parts.js b/packages/osd-spec-to-console/lib/convert/parts.js similarity index 100% rename from packages/kbn-spec-to-console/lib/convert/parts.js rename to packages/osd-spec-to-console/lib/convert/parts.js diff --git a/packages/kbn-spec-to-console/lib/convert/paths.js b/packages/osd-spec-to-console/lib/convert/paths.js similarity index 100% rename from packages/kbn-spec-to-console/lib/convert/paths.js rename to packages/osd-spec-to-console/lib/convert/paths.js diff --git a/packages/kbn-spec-to-console/lib/replace_pattern.js b/packages/osd-spec-to-console/lib/replace_pattern.js similarity index 100% rename from packages/kbn-spec-to-console/lib/replace_pattern.js rename to packages/osd-spec-to-console/lib/replace_pattern.js diff --git a/packages/kbn-spec-to-console/lib/static/map_interpolation.json b/packages/osd-spec-to-console/lib/static/map_interpolation.json similarity index 100% rename from packages/kbn-spec-to-console/lib/static/map_interpolation.json rename to packages/osd-spec-to-console/lib/static/map_interpolation.json diff --git a/packages/kbn-spec-to-console/package.json b/packages/osd-spec-to-console/package.json similarity index 85% rename from packages/kbn-spec-to-console/package.json rename to packages/osd-spec-to-console/package.json index 9684201c7238..d48793cf0ed5 100644 --- a/packages/kbn-spec-to-console/package.json +++ b/packages/osd-spec-to-console/package.json @@ -1,7 +1,7 @@ { "name": "spec-to-console", "version": "0.0.0", - "description": "ES REST spec -> Console autocomplete", + "description": "OpenSearch REST spec -> Console autocomplete", "main": "index.js", "directories": { "lib": "lib" @@ -12,7 +12,7 @@ }, "author": "", "license": "Apache-2.0", - "kibana": { + "opensearchDashboards": { "devOnly": true }, "bugs": { diff --git a/packages/kbn-spec-to-console/test/fixtures/cluster_health_autocomplete.json b/packages/osd-spec-to-console/test/fixtures/cluster_health_autocomplete.json similarity index 100% rename from packages/kbn-spec-to-console/test/fixtures/cluster_health_autocomplete.json rename to packages/osd-spec-to-console/test/fixtures/cluster_health_autocomplete.json diff --git a/packages/kbn-spec-to-console/test/fixtures/cluster_health_spec.json b/packages/osd-spec-to-console/test/fixtures/cluster_health_spec.json similarity index 100% rename from packages/kbn-spec-to-console/test/fixtures/cluster_health_spec.json rename to packages/osd-spec-to-console/test/fixtures/cluster_health_spec.json diff --git a/packages/kbn-spec-to-console/yarn.lock b/packages/osd-spec-to-console/yarn.lock similarity index 100% rename from packages/kbn-spec-to-console/yarn.lock rename to packages/osd-spec-to-console/yarn.lock