Merge pull request #25326 from backstage/blam/middleware-fix
Fix `MiddlewareFactory` legacy wrapping
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-app-api': patch
|
||||
---
|
||||
|
||||
Fixing issue with `MiddlewareFactory` deprecation wrapping
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
Reference in New Issue
Block a user