Rename router catalogClient options to catalog and make mandatory

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
This commit is contained in:
Fredrik Adelöw
2026-04-03 22:57:23 +02:00
parent 3588c3f57f
commit da3f5356ec
3 changed files with 6 additions and 9 deletions
+1 -1
View File
@@ -166,7 +166,7 @@ export const techdocsPlugin = createBackendPlugin({
discovery,
httpAuth,
auth,
catalogClient: catalog,
catalog,
}),
);
@@ -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(() => {
@@ -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;