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;