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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user