packages/kbn-generate-console-definitions/README.md
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.
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.--dest <DEFINITIONS_FOLDER> and also update the constant AUTOCOMPLETE_DEFINITIONS_FOLDER so that the Console server will load the definitions from this folder.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.