From eb2544b21b219209fe05818b22d72594dd66532f Mon Sep 17 00:00:00 2001 From: Patrick Jungermann Date: Tue, 17 May 2022 23:53:08 +0200 Subject: [PATCH] fix: inline config interfaces Signed-off-by: Patrick Jungermann --- .changeset/beige-deers-remember.md | 5 ++ .changeset/nervous-gorillas-approve.md | 6 ++ .../catalog-backend-module-aws/config.d.ts | 66 ++++++++++++------- .../catalog-backend-module-gerrit/config.d.ts | 43 ++++++------ plugins/cost-insights/config.d.ts | 2 +- 5 files changed, 78 insertions(+), 44 deletions(-) create mode 100644 .changeset/beige-deers-remember.md create mode 100644 .changeset/nervous-gorillas-approve.md diff --git a/.changeset/beige-deers-remember.md b/.changeset/beige-deers-remember.md new file mode 100644 index 0000000000..4fcba4f0c6 --- /dev/null +++ b/.changeset/beige-deers-remember.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-cost-insights': patch +--- + +Add missing `export` in configuration schema. diff --git a/.changeset/nervous-gorillas-approve.md b/.changeset/nervous-gorillas-approve.md new file mode 100644 index 0000000000..8c0d742b7b --- /dev/null +++ b/.changeset/nervous-gorillas-approve.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-catalog-backend-module-aws': patch +'@backstage/plugin-catalog-backend-module-gerrit': patch +--- + +Inline config interfaces diff --git a/plugins/catalog-backend-module-aws/config.d.ts b/plugins/catalog-backend-module-aws/config.d.ts index 2e41d60aac..6f84ca6daf 100644 --- a/plugins/catalog-backend-module-aws/config.d.ts +++ b/plugins/catalog-backend-module-aws/config.d.ts @@ -14,27 +14,6 @@ * limitations under the License. */ -interface AwsS3Config { - /** - * (Required) AWS S3 Bucket Name - * @visibility backend - */ - bucketName: string; - /** - * (Optional) AWS S3 Object key prefix - * If not set, all keys will be accepted, no filtering will be applied. - * @visibility backend - */ - prefix?: string; - /** - * (Optional) AWS Region. - * If not set, AWS_REGION environment variable or aws config file will be used. - * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html - * @visibility backend - */ - region?: string; -} - export interface Config { catalog?: { /** @@ -62,7 +41,50 @@ export interface Config { * * Uses "default" as default id for the single config variant. */ - awsS3?: AwsS3Config | Record; + awsS3?: + | { + /** + * (Required) AWS S3 Bucket Name + * @visibility backend + */ + bucketName: string; + /** + * (Optional) AWS S3 Object key prefix + * If not set, all keys will be accepted, no filtering will be applied. + * @visibility backend + */ + prefix?: string; + /** + * (Optional) AWS Region. + * If not set, AWS_REGION environment variable or aws config file will be used. + * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html + * @visibility backend + */ + region?: string; + } + | Record< + string, + { + /** + * (Required) AWS S3 Bucket Name + * @visibility backend + */ + bucketName: string; + /** + * (Optional) AWS S3 Object key prefix + * If not set, all keys will be accepted, no filtering will be applied. + * @visibility backend + */ + prefix?: string; + /** + * (Optional) AWS Region. + * If not set, AWS_REGION environment variable or aws config file will be used. + * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html + * @visibility backend + */ + region?: string; + } + >; }; }; } diff --git a/plugins/catalog-backend-module-gerrit/config.d.ts b/plugins/catalog-backend-module-gerrit/config.d.ts index 14e8f58d8f..744917a198 100644 --- a/plugins/catalog-backend-module-gerrit/config.d.ts +++ b/plugins/catalog-backend-module-gerrit/config.d.ts @@ -14,26 +14,6 @@ * limitations under the License. */ -interface GerritConfig { - /** - * (Required) The host of the Gerrit integration to use. - * @visibility backend - */ - host: string; - /** - * (Required) The query to use for the "List Projects" API call. Used to limit the - * scope of the projects that the provider tries to ingest. - * @visibility backend - */ - query: string; - /** - * (Optional) Branch. - * The branch where the provider will try to find entities. Defaults to "master". - * @visibility backend - */ - branch?: string; -} - export interface Config { catalog?: { /** @@ -45,7 +25,28 @@ export interface Config { * * Maps provider id with configuration. */ - gerrit?: Record; + gerrit?: Record< + string, + { + /** + * (Required) The host of the Gerrit integration to use. + * @visibility backend + */ + host: string; + /** + * (Required) The query to use for the "List Projects" API call. Used to limit the + * scope of the projects that the provider tries to ingest. + * @visibility backend + */ + query: string; + /** + * (Optional) Branch. + * The branch where the provider will try to find entities. Defaults to "master". + * @visibility backend + */ + branch?: string; + } + >; }; }; } diff --git a/plugins/cost-insights/config.d.ts b/plugins/cost-insights/config.d.ts index 3d4e649b67..8438ca6561 100644 --- a/plugins/cost-insights/config.d.ts +++ b/plugins/cost-insights/config.d.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -interface Config { +export interface Config { costInsights: { /** * @visibility frontend