From da3f5356ec96d6789775b4425413ad20a78af27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 3 Apr 2026 22:57:23 +0200 Subject: [PATCH] Rename router catalogClient options to catalog and make mandatory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw Made-with: Cursor --- plugins/techdocs-backend/src/plugin.ts | 2 +- plugins/techdocs-backend/src/service/router.test.ts | 4 ++-- plugins/techdocs-backend/src/service/router.ts | 9 +++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/plugins/techdocs-backend/src/plugin.ts b/plugins/techdocs-backend/src/plugin.ts index 543d017ae1..ad26967804 100644 --- a/plugins/techdocs-backend/src/plugin.ts +++ b/plugins/techdocs-backend/src/plugin.ts @@ -166,7 +166,7 @@ export const techdocsPlugin = createBackendPlugin({ discovery, httpAuth, auth, - catalogClient: catalog, + catalog, }), ); diff --git a/plugins/techdocs-backend/src/service/router.test.ts b/plugins/techdocs-backend/src/service/router.test.ts index 5b409960d0..40e8fe450d 100644 --- a/plugins/techdocs-backend/src/service/router.test.ts +++ b/plugins/techdocs-backend/src/service/router.test.ts @@ -125,7 +125,7 @@ describe('createRouter', () => { docsBuildStrategy, auth: mockServices.auth(), httpAuth: mockServices.httpAuth(), - catalogClient: mockCatalogService, + catalog: mockCatalogService, }; const recommendedOptions = { publisher, @@ -136,7 +136,7 @@ describe('createRouter', () => { docsBuildStrategy, auth: mockServices.auth(), httpAuth: mockServices.httpAuth(), - catalogClient: mockCatalogService, + catalog: mockCatalogService, }; beforeEach(() => { diff --git a/plugins/techdocs-backend/src/service/router.ts b/plugins/techdocs-backend/src/service/router.ts index b05eefff79..48b8afaf53 100644 --- a/plugins/techdocs-backend/src/service/router.ts +++ b/plugins/techdocs-backend/src/service/router.ts @@ -60,7 +60,7 @@ export type OutOfTheBoxDeploymentOptions = { cache: CacheService; docsBuildStrategy?: DocsBuildStrategy; buildLogTransport?: winston.transport; - catalogClient?: CatalogService; + catalog: CatalogService; httpAuth: HttpAuthService; auth: AuthService; }; @@ -79,7 +79,7 @@ export type RecommendedDeploymentOptions = { cache: CacheService; docsBuildStrategy?: DocsBuildStrategy; buildLogTransport?: winston.transport; - catalogClient?: CatalogService; + catalog: CatalogService; httpAuth: HttpAuthService; auth: AuthService; }; @@ -116,10 +116,7 @@ export async function createRouter( const router = Router(); const { publisher, config, logger, discovery, httpAuth, auth } = options; - if (!options.catalogClient) { - throw new Error('catalogClient is required'); - } - const catalogClient = options.catalogClient; + const catalogClient = options.catalog; const docsBuildStrategy = options.docsBuildStrategy ?? DefaultDocsBuildStrategy.fromConfig(config); const buildLogTransport = options.buildLogTransport;