Merge pull request #25326 from backstage/blam/middleware-fix

Fix `MiddlewareFactory` legacy wrapping
This commit is contained in:
Ben Lambert
2024-06-19 19:07:19 +02:00
committed by GitHub
3 changed files with 7 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-app-api': patch
---
Fixing issue with `MiddlewareFactory` deprecation wrapping
+1 -2
View File
@@ -208,8 +208,7 @@ export const loggerServiceFactory: () => ServiceFactory<
export class MiddlewareFactory {
compression(): RequestHandler;
cors(): RequestHandler;
// Warning: (ae-forgotten-export) The symbol "MiddlewareFactory_2" needs to be exported by the entry point index.d.ts
static create(options: MiddlewareFactoryOptions): MiddlewareFactory_2;
static create(options: MiddlewareFactoryOptions): MiddlewareFactory;
error(options?: MiddlewareFactoryErrorOptions): ErrorRequestHandler;
helmet(): RequestHandler;
logging(): RequestHandler;
+1 -1
View File
@@ -58,7 +58,7 @@ export class MiddlewareFactory {
* Creates a new {@link MiddlewareFactory}.
*/
static create(options: MiddlewareFactoryOptions) {
return _MiddlewareFactory.create(options);
return new MiddlewareFactory(_MiddlewareFactory.create(options));
}
private constructor(private readonly impl: _MiddlewareFactory) {}