From ac677bc30ae01a4debabbf9b750b04ff15fc26d6 Mon Sep 17 00:00:00 2001 From: Hitoshi Kamezaki Date: Mon, 19 Jun 2023 11:14:07 +0900 Subject: [PATCH] expose discovery.endpoints to frontend to use FrontendHostDiscovery, it must be exposed `discovery.endpoints `configuration. fix #18291 Signed-off-by: Hitoshi Kamezaki --- .changeset/chatty-deers-shop.md | 5 ++++ packages/core-app-api/config.d.ts | 39 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .changeset/chatty-deers-shop.md diff --git a/.changeset/chatty-deers-shop.md b/.changeset/chatty-deers-shop.md new file mode 100644 index 0000000000..26c5559d0c --- /dev/null +++ b/.changeset/chatty-deers-shop.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-app-api': patch +--- + +Expose discovery.endpoints configuration to use FrontendHostDiscovery diff --git a/packages/core-app-api/config.d.ts b/packages/core-app-api/config.d.ts index e8cc879c90..22f241fbcf 100644 --- a/packages/core-app-api/config.d.ts +++ b/packages/core-app-api/config.d.ts @@ -122,4 +122,43 @@ export interface Config { * @visibility frontend */ enableExperimentalRedirectFlow?: boolean; + + /** + * Discovery options. + * + * @visibility frontend + */ + discovery?: { + /** + * Endpoints + * + * A list of target baseUrls and the associated plugins. + * + * @visibility frontend + */ + endpoints?: Array<{ + /** + * The target baseUrl to use for the plugin + * + * Can be either a string or an object with internal and external keys. (Internal is used for the backend, external for the frontend) + * Targets with `{{pluginId}}` or `{{ pluginId }} in the url will be replaced with the pluginId. + * + * @visibility frontend + */ + target: + | string + | { + /** + * @visibility frontend + */ + external: string; + }; + /** + * Array of plugins which use the target baseUrl. + * + * @visibility frontend + */ + plugins: Array; + }>; + }; }