kibana/packages/kbn-generate-console-definitions
Elena Stoeva dbf017ba31
Rename Management team name in codeowners file (#178626)
The AppEx Management team was recently renamed on GitHub from
`platform-deployment-management` to `kibana-management`. This PR updates
the Codeowners file and all references to the team name.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-18 15:46:31 +00:00
..
src [Console] Generate autocomplete definitions from ES specification (#163301) 2023-08-15 11:30:39 +02:00
index.ts [Console] Use ES specification for autocomplete definitions (#159241) 2023-06-23 12:05:25 -07:00
jest.config.js [Console] Use ES specification for autocomplete definitions (#159241) 2023-06-23 12:05:25 -07:00
kibana.jsonc Rename Management team name in codeowners file (#178626) 2024-03-18 15:46:31 +00:00
package.json [Console] Use ES specification for autocomplete definitions (#159241) 2023-06-23 12:05:25 -07:00
README.md [Console] Generate autocomplete definitions from ES specification (#163301) 2023-08-15 11:30:39 +02:00
tsconfig.json [Console] Use ES specification for autocomplete definitions (#159241) 2023-06-23 12:05:25 -07:00

Generate console definitions

This package is a script to generate definitions used in Console to display autocomplete suggestions. The definitions files are generated from the Elasticsearch specification repo. This script is a new implementation of an old kbn-spec-to-console package: The old script used JSON specs in the Elasticsearch repo as the source.

Instructions

  1. Checkout the Elasticsearch specification repo.
  2. Run the command node scripts/generate_console_definitions.js --source <ES_SPECIFICATION_REPO> --emptyDest This command will use the folder <ES_SPECIFICATION_REPO> as the source and the constant AUTOCOMPLETE_DEFINITIONS_FOLDER as the destination. Based on the value of the constant, the autocomplete definitions will be generated in the folder <KIBANA_REPO>/src/plugins/server/lib/spec_definitions/json/generated. The flag --emptyDest indicates that all existing files in the destination folder will be removed.
  3. It's possible to generate the definitions into a different folder. For that pass an option to the command --dest <DEFINITIONS_FOLDER> and also update the constant AUTOCOMPLETE_DEFINITIONS_FOLDER so that the Console server will load the definitions from this folder.

Functionality

This script generates definitions for all endpoints defined in the ES specification at once. The script generates fully functional autocomplete definition files with properties as described in the Console README.md file except data_autocomplete_rules. Currently, this property needs to be written manually to add autocomplete suggestions for request body parameters.