@backstage/backend-app-api 0.7.6-next.3 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,31 +1,37 @@
1
1
  /// <reference types="node" />
2
2
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
3
- import { LoggerService, RootConfigService, RootLoggerService, BackendFeature, ServiceFactoryOrFunction, DiscoveryService, HttpAuthService, LifecycleService, RootHttpRouterService, RootLifecycleService, UserInfoService } from '@backstage/backend-plugin-api';
4
- import { ConfigSchema, LoadConfigOptionsRemote, RemoteConfigSourceOptions } from '@backstage/config-loader';
3
+ import { LoggerService, RootConfigService, RootLoggerService, BackendFeature, ServiceFactoryOrFunction, DiscoveryService, LifecycleService, RootLifecycleService, RootHttpRouterService } from '@backstage/backend-plugin-api';
5
4
  import { Config, AppConfig } from '@backstage/config';
5
+ import { ConfigSchema, LoadConfigOptionsRemote, RemoteConfigSourceOptions } from '@backstage/config-loader';
6
+ import { RequestHandler, ErrorRequestHandler, Express, Handler } from 'express';
6
7
  import * as http from 'http';
7
8
  import { RequestListener } from 'http';
8
- import { RequestHandler, ErrorRequestHandler, Express, Handler } from 'express';
9
9
  import { CorsOptions } from 'cors';
10
10
  import { HelmetOptions } from 'helmet';
11
11
  import { JsonObject, HumanDuration } from '@backstage/types';
12
12
  import { Format } from 'logform';
13
13
  import { transport } from 'winston';
14
- import * as _backstage_backend_common from '@backstage/backend-common';
15
14
  import { Server } from 'node:http';
16
15
 
17
16
  /** @public */
18
- declare function createConfigSecretEnumerator(options: {
17
+ declare function createConfigSecretEnumerator$1(options: {
19
18
  logger: LoggerService;
20
19
  dir?: string;
21
20
  schema?: ConfigSchema;
22
21
  }): Promise<(config: Config) => Iterable<string>>;
22
+
23
+ /**
24
+ * @public
25
+ * @deprecated Please import from `@backstage/backend-defaults/rootConfig` instead.
26
+ */
27
+ declare const createConfigSecretEnumerator: typeof createConfigSecretEnumerator$1;
23
28
  /**
24
29
  * Load configuration for a Backend.
25
30
  *
26
31
  * This function should only be called once, during the initialization of the backend.
27
32
  *
28
33
  * @public
34
+ * @deprecated Please migrate to the new backend system and use `coreServices.rootConfig` instead, or the {@link @backstage/config-loader#ConfigSources} facilities if required.
29
35
  */
30
36
  declare function loadBackendConfig(options: {
31
37
  remote?: LoadConfigOptionsRemote;
@@ -41,7 +47,7 @@ declare function loadBackendConfig(options: {
41
47
  *
42
48
  * @public
43
49
  */
44
- interface ExtendedHttpServer extends http.Server {
50
+ interface ExtendedHttpServer$1 extends http.Server {
45
51
  start(): Promise<void>;
46
52
  stop(): Promise<void>;
47
53
  port(): number;
@@ -51,13 +57,13 @@ interface ExtendedHttpServer extends http.Server {
51
57
  *
52
58
  * @public
53
59
  */
54
- type HttpServerOptions = {
60
+ type HttpServerOptions$1 = {
55
61
  listen: {
56
62
  port: number;
57
63
  host: string;
58
64
  };
59
65
  https?: {
60
- certificate: HttpServerCertificateOptions;
66
+ certificate: HttpServerCertificateOptions$1;
61
67
  };
62
68
  };
63
69
  /**
@@ -65,7 +71,7 @@ type HttpServerOptions = {
65
71
  *
66
72
  * @public
67
73
  */
68
- type HttpServerCertificateOptions = {
74
+ type HttpServerCertificateOptions$1 = {
69
75
  type: 'pem';
70
76
  key: string;
71
77
  cert: string;
@@ -88,23 +94,23 @@ type HttpServerCertificateOptions = {
88
94
  * const opts = readHttpServerOptions(config.getConfig('backend'));
89
95
  * ```
90
96
  */
91
- declare function readHttpServerOptions(config?: Config): HttpServerOptions;
97
+ declare function readHttpServerOptions$1(config?: Config): HttpServerOptions$1;
92
98
 
93
99
  /**
94
100
  * Creates a Node.js HTTP or HTTPS server instance.
95
101
  *
96
102
  * @public
97
103
  */
98
- declare function createHttpServer(listener: RequestListener, options: HttpServerOptions, deps: {
104
+ declare function createHttpServer$1(listener: RequestListener, options: HttpServerOptions$1, deps: {
99
105
  logger: LoggerService;
100
- }): Promise<ExtendedHttpServer>;
106
+ }): Promise<ExtendedHttpServer$1>;
101
107
 
102
108
  /**
103
109
  * Options used to create a {@link MiddlewareFactory}.
104
110
  *
105
111
  * @public
106
112
  */
107
- interface MiddlewareFactoryOptions {
113
+ interface MiddlewareFactoryOptions$1 {
108
114
  config: RootConfigService;
109
115
  logger: LoggerService;
110
116
  }
@@ -113,7 +119,7 @@ interface MiddlewareFactoryOptions {
113
119
  *
114
120
  * @public
115
121
  */
116
- interface MiddlewareFactoryErrorOptions {
122
+ interface MiddlewareFactoryErrorOptions$1 {
117
123
  /**
118
124
  * Whether error response bodies should show error stack traces or not.
119
125
  *
@@ -132,12 +138,12 @@ interface MiddlewareFactoryErrorOptions {
132
138
  *
133
139
  * @public
134
140
  */
135
- declare class MiddlewareFactory {
141
+ declare class MiddlewareFactory$1 {
136
142
  #private;
137
143
  /**
138
144
  * Creates a new {@link MiddlewareFactory}.
139
145
  */
140
- static create(options: MiddlewareFactoryOptions): MiddlewareFactory;
146
+ static create(options: MiddlewareFactoryOptions$1): MiddlewareFactory$1;
141
147
  private constructor();
142
148
  /**
143
149
  * Returns a middleware that unconditionally produces a 404 error response.
@@ -217,7 +223,7 @@ declare class MiddlewareFactory {
217
223
  *
218
224
  * @returns An Express error request handler
219
225
  */
220
- error(options?: MiddlewareFactoryErrorOptions): ErrorRequestHandler;
226
+ error(options?: MiddlewareFactoryErrorOptions$1): ErrorRequestHandler;
221
227
  }
222
228
 
223
229
  /**
@@ -232,7 +238,7 @@ declare class MiddlewareFactory {
232
238
  * const corsOptions = readCorsOptions(config.getConfig('backend'));
233
239
  * ```
234
240
  */
235
- declare function readCorsOptions(config?: Config): CorsOptions;
241
+ declare function readCorsOptions$1(config?: Config): CorsOptions;
236
242
 
237
243
  /**
238
244
  * Attempts to read Helmet options from the backend configuration object.
@@ -246,24 +252,168 @@ declare function readCorsOptions(config?: Config): CorsOptions;
246
252
  * const helmetOptions = readHelmetOptions(config.getConfig('backend'));
247
253
  * ```
248
254
  */
249
- declare function readHelmetOptions(config?: Config): HelmetOptions;
255
+ declare function readHelmetOptions$1(config?: Config): HelmetOptions;
256
+
257
+ /**
258
+ * @public
259
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
260
+ */
261
+ declare const readHttpServerOptions: typeof readHttpServerOptions$1;
262
+ /**
263
+ * @public
264
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
265
+ */
266
+ declare const createHttpServer: typeof createHttpServer$1;
267
+ /**
268
+ * @public
269
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
270
+ */
271
+ declare const readCorsOptions: typeof readCorsOptions$1;
272
+ /**
273
+ * @public
274
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
275
+ */
276
+ declare const readHelmetOptions: typeof readHelmetOptions$1;
277
+ /**
278
+ * @public
279
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
280
+ */
281
+ declare class MiddlewareFactory {
282
+ private readonly impl;
283
+ /**
284
+ * Creates a new {@link MiddlewareFactory}.
285
+ */
286
+ static create(options: MiddlewareFactoryOptions): MiddlewareFactory$1;
287
+ private constructor();
288
+ /**
289
+ * Returns a middleware that unconditionally produces a 404 error response.
290
+ *
291
+ * @remarks
292
+ *
293
+ * Typically you want to place this middleware at the end of the chain, such
294
+ * that it's the last one attempted after no other routes matched.
295
+ *
296
+ * @returns An Express request handler
297
+ */
298
+ notFound(): RequestHandler;
299
+ /**
300
+ * Returns the compression middleware.
301
+ *
302
+ * @remarks
303
+ *
304
+ * The middleware will attempt to compress response bodies for all requests
305
+ * that traverse through the middleware.
306
+ */
307
+ compression(): RequestHandler;
308
+ /**
309
+ * Returns a request logging middleware.
310
+ *
311
+ * @remarks
312
+ *
313
+ * Typically you want to place this middleware at the start of the chain, such
314
+ * that it always logs requests whether they are "caught" by handlers farther
315
+ * down or not.
316
+ *
317
+ * @returns An Express request handler
318
+ */
319
+ logging(): RequestHandler;
320
+ /**
321
+ * Returns a middleware that implements the helmet library.
322
+ *
323
+ * @remarks
324
+ *
325
+ * This middleware applies security policies to incoming requests and outgoing
326
+ * responses. It is configured using config keys such as `backend.csp`.
327
+ *
328
+ * @see {@link https://helmetjs.github.io/}
329
+ *
330
+ * @returns An Express request handler
331
+ */
332
+ helmet(): RequestHandler;
333
+ /**
334
+ * Returns a middleware that implements the cors library.
335
+ *
336
+ * @remarks
337
+ *
338
+ * This middleware handles CORS. It is configured using the config key
339
+ * `backend.cors`.
340
+ *
341
+ * @see {@link https://github.com/expressjs/cors}
342
+ *
343
+ * @returns An Express request handler
344
+ */
345
+ cors(): RequestHandler;
346
+ /**
347
+ * Express middleware to handle errors during request processing.
348
+ *
349
+ * @remarks
350
+ *
351
+ * This is commonly the very last middleware in the chain.
352
+ *
353
+ * Its primary purpose is not to do translation of business logic exceptions,
354
+ * but rather to be a global catch-all for uncaught "fatal" errors that are
355
+ * expected to result in a 500 error. However, it also does handle some common
356
+ * error types (such as http-error exceptions, and the well-known error types
357
+ * in the `@backstage/errors` package) and returns the enclosed status code
358
+ * accordingly.
359
+ *
360
+ * It will also produce a response body with a serialized form of the error,
361
+ * unless a previous handler already did send a body. See
362
+ * {@link @backstage/errors#ErrorResponseBody} for the response shape used.
363
+ *
364
+ * @returns An Express error request handler
365
+ */
366
+ error(options?: MiddlewareFactoryErrorOptions): ErrorRequestHandler;
367
+ }
368
+ /**
369
+ * @public
370
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
371
+ */
372
+ type MiddlewareFactoryErrorOptions = MiddlewareFactoryErrorOptions$1;
373
+ /**
374
+ * @public
375
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
376
+ */
377
+ type MiddlewareFactoryOptions = MiddlewareFactoryOptions$1;
378
+ /**
379
+ * @public
380
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
381
+ */
382
+ type ExtendedHttpServer = ExtendedHttpServer$1;
383
+ /**
384
+ * @public
385
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
386
+ */
387
+ type HttpServerCertificateOptions = HttpServerCertificateOptions$1;
388
+ /**
389
+ * @public
390
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
391
+ */
392
+ type HttpServerOptions = HttpServerOptions$1;
250
393
 
251
394
  /**
252
395
  * @public
253
396
  */
254
- interface WinstonLoggerOptions {
397
+ interface WinstonLoggerOptions$1 {
255
398
  meta?: JsonObject;
256
399
  level?: string;
257
400
  format?: Format;
258
401
  transports?: transport[];
259
402
  }
403
+
404
+ /**
405
+ * @public
406
+ * @deprecated Please import from `@backstage/backend-defaults/rootLogger` instead.
407
+ */
408
+ type WinstonLoggerOptions = WinstonLoggerOptions$1;
260
409
  /**
261
410
  * A {@link @backstage/backend-plugin-api#LoggerService} implementation based on winston.
262
411
  *
263
412
  * @public
413
+ * @deprecated Please import from `@backstage/backend-defaults/rootLogger` instead.
264
414
  */
265
415
  declare class WinstonLogger implements RootLoggerService {
266
- #private;
416
+ private readonly impl;
267
417
  /**
268
418
  * Creates a {@link WinstonLogger} instance.
269
419
  */
@@ -310,9 +460,6 @@ interface CreateSpecializedBackendOptions {
310
460
  */
311
461
  declare function createSpecializedBackend(options: CreateSpecializedBackendOptions): Backend;
312
462
 
313
- /** @public */
314
- declare const authServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.AuthService, "plugin">;
315
-
316
463
  /**
317
464
  * @public
318
465
  * @deprecated Please import from `@backstage/backend-defaults/cache` instead.
@@ -344,7 +491,7 @@ declare const rootConfigServiceFactory: (options?: RootConfigFactoryOptions | un
344
491
  * @public
345
492
  * @deprecated Please import from `@backstage/backend-defaults/database` instead.
346
493
  */
347
- declare const databaseServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_common.PluginDatabaseManager, "plugin">;
494
+ declare const databaseServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.DatabaseService, "plugin">;
348
495
 
349
496
  /**
350
497
  * @public
@@ -364,9 +511,7 @@ declare const discoveryServiceFactory: () => _backstage_backend_plugin_api.Servi
364
511
  * @deprecated Please import from `@backstage/backend-defaults/discovery` instead.
365
512
  */
366
513
  declare class HostDiscovery implements DiscoveryService {
367
- private readonly internalBaseUrl;
368
- private readonly externalBaseUrl;
369
- private readonly discoveryConfig;
514
+ private readonly impl;
370
515
  /**
371
516
  * Creates a new HostDiscovery discovery instance by reading
372
517
  * from the `backend` config section, specifically the `.baseUrl` for
@@ -395,31 +540,108 @@ declare class HostDiscovery implements DiscoveryService {
395
540
  basePath?: string;
396
541
  }): HostDiscovery;
397
542
  private constructor();
398
- private getTargetFromConfig;
399
543
  getBaseUrl(pluginId: string): Promise<string>;
400
544
  getExternalBaseUrl(pluginId: string): Promise<string>;
401
545
  }
402
546
 
403
- /** @public */
404
- declare const httpAuthServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<HttpAuthService, "plugin">;
547
+ /**
548
+ * An identity client options object which allows extra configurations
549
+ *
550
+ * @public
551
+ * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead
552
+ */
553
+ type IdentityFactoryOptions = {
554
+ issuer?: string;
555
+ /**
556
+ * JWS "alg" (Algorithm) Header Parameter values. Defaults to an array containing just ES256.
557
+ * More info on supported algorithms: https://github.com/panva/jose
558
+ */
559
+ algorithms?: string[];
560
+ };
561
+ /**
562
+ * @public
563
+ * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead
564
+ */
565
+ declare const identityServiceFactory: (options?: IdentityFactoryOptions | undefined) => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.IdentityService, "plugin">;
566
+
567
+ /**
568
+ * Allows plugins to register shutdown hooks that are run when the process is about to exit.
569
+ *
570
+ * @public
571
+ * @deprecated Please import from `@backstage/backend-defaults/lifecycle` instead.
572
+ */
573
+ declare const lifecycleServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<LifecycleService, "plugin">;
574
+
575
+ /**
576
+ * @public
577
+ * @deprecated Please import from `@backstage/backend-defaults/permissions` instead.
578
+ */
579
+ declare const permissionsServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.PermissionsService, "plugin">;
580
+
581
+ /**
582
+ * Allows plugins to register shutdown hooks that are run when the process is about to exit.
583
+ *
584
+ * @public
585
+ * @deprecated Please import from `@backstage/backend-defaults/rootLifecycle` instead.
586
+ */
587
+ declare const rootLifecycleServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<RootLifecycleService, "root">;
588
+
589
+ /**
590
+ * @public
591
+ * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead
592
+ */
593
+ declare const tokenManagerServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.TokenManagerService, "plugin">;
594
+
595
+ /**
596
+ * @public
597
+ * @deprecated Please import from `@backstage/backend-defaults/urlReader` instead.
598
+ */
599
+ declare const urlReaderServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.UrlReaderService, "plugin">;
600
+
601
+ /**
602
+ * @public
603
+ * @deprecated Please import from `@backstage/backend-defaults/auth` instead.
604
+ */
605
+ declare const authServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.AuthService, "plugin">;
606
+
607
+ /**
608
+ * @public
609
+ * @deprecated Please import from `@backstage/backend-defaults/httpAuth` instead.
610
+ */
611
+ declare const httpAuthServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.HttpAuthService, "plugin">;
405
612
 
406
613
  /**
407
614
  * @public
408
615
  */
409
- interface HttpRouterFactoryOptions {
616
+ interface HttpRouterFactoryOptions$1 {
410
617
  /**
411
618
  * A callback used to generate the path for each plugin, defaults to `/api/{pluginId}`.
412
619
  */
413
620
  getPath?(pluginId: string): string;
414
621
  }
415
- /** @public */
416
- declare const httpRouterServiceFactory: (options?: HttpRouterFactoryOptions | undefined) => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.HttpRouterService, "plugin">;
622
+
623
+ /**
624
+ * @public
625
+ * @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead.
626
+ */
627
+ type HttpRouterFactoryOptions = HttpRouterFactoryOptions$1;
628
+ /**
629
+ * HTTP route registration for plugins.
630
+ *
631
+ * See {@link @backstage/code-plugin-api#HttpRouterService}
632
+ * and {@link https://backstage.io/docs/backend-system/core-services/http-router | the service docs}
633
+ * for more information.
634
+ *
635
+ * @public
636
+ * @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead.
637
+ */
638
+ declare const httpRouterServiceFactory: (options?: HttpRouterFactoryOptions$1 | undefined) => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.HttpRouterService, "plugin">;
417
639
 
418
640
  /**
419
641
  * Options for {@link createLifecycleMiddleware}.
420
642
  * @public
421
643
  */
422
- interface LifecycleMiddlewareOptions {
644
+ interface LifecycleMiddlewareOptions$1 {
423
645
  lifecycle: LifecycleService;
424
646
  /**
425
647
  * The maximum time that paused requests will wait for the service to start, before returning an error.
@@ -442,52 +664,50 @@ interface LifecycleMiddlewareOptions {
442
664
  *
443
665
  * @public
444
666
  */
445
- declare function createLifecycleMiddleware(options: LifecycleMiddlewareOptions): RequestHandler;
667
+ declare function createLifecycleMiddleware$1(options: LifecycleMiddlewareOptions$1): RequestHandler;
446
668
 
447
669
  /**
448
- * An identity client options object which allows extra configurations
449
- *
670
+ * Options for {@link createLifecycleMiddleware}.
450
671
  * @public
451
- * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead
672
+ * @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead.
452
673
  */
453
- type IdentityFactoryOptions = {
454
- issuer?: string;
455
- /**
456
- * JWS "alg" (Algorithm) Header Parameter values. Defaults to an array containing just ES256.
457
- * More info on supported algorithms: https://github.com/panva/jose
458
- */
459
- algorithms?: string[];
460
- };
674
+ type LifecycleMiddlewareOptions = LifecycleMiddlewareOptions$1;
461
675
  /**
676
+ * Creates a middleware that pauses requests until the service has started.
677
+ *
678
+ * @remarks
679
+ *
680
+ * Requests that arrive before the service has started will be paused until startup is complete.
681
+ * If the service does not start within the provided timeout, the request will be rejected with a
682
+ * {@link @backstage/errors#ServiceUnavailableError}.
683
+ *
684
+ * If the service is shutting down, all requests will be rejected with a
685
+ * {@link @backstage/errors#ServiceUnavailableError}.
686
+ *
462
687
  * @public
463
- * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead
688
+ * @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead.
464
689
  */
465
- declare const identityServiceFactory: (options?: IdentityFactoryOptions | undefined) => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.IdentityService, "plugin">;
690
+ declare const createLifecycleMiddleware: typeof createLifecycleMiddleware$1;
466
691
 
467
692
  /**
468
- * Allows plugins to register shutdown hooks that are run when the process is about to exit.
693
+ * Plugin-level logging.
694
+ *
695
+ * See {@link @backstage/code-plugin-api#LoggerService}
696
+ * and {@link https://backstage.io/docs/backend-system/core-services/logger | the service docs}
697
+ * for more information.
469
698
  *
470
699
  * @public
471
- * @deprecated Please import from `@backstage/backend-defaults/lifecycle` instead.
700
+ * @deprecated Please import from `@backstage/backend-defaults/logger` instead.
472
701
  */
473
- declare const lifecycleServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<LifecycleService, "plugin">;
474
-
475
- /** @public */
476
702
  declare const loggerServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.LoggerService, "plugin">;
477
703
 
478
- /**
479
- * @public
480
- * @deprecated Please import from `@backstage/backend-defaults/permissions` instead.
481
- */
482
- declare const permissionsServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.PermissionsService, "plugin">;
483
-
484
704
  /**
485
705
  * @public
486
706
  */
487
- interface RootHttpRouterConfigureContext {
707
+ interface RootHttpRouterConfigureContext$1 {
488
708
  app: Express;
489
709
  server: Server;
490
- middleware: MiddlewareFactory;
710
+ middleware: MiddlewareFactory$1;
491
711
  routes: RequestHandler;
492
712
  config: RootConfigService;
493
713
  logger: LoggerService;
@@ -495,39 +715,74 @@ interface RootHttpRouterConfigureContext {
495
715
  applyDefaults: () => void;
496
716
  }
497
717
  /**
718
+ * HTTP route registration for root services.
719
+ *
720
+ * See {@link @backstage/code-plugin-api#RootHttpRouterService}
721
+ * and {@link https://backstage.io/docs/backend-system/core-services/root-http-router | the service docs}
722
+ * for more information.
723
+ *
498
724
  * @public
499
725
  */
500
- type RootHttpRouterFactoryOptions = {
726
+ type RootHttpRouterFactoryOptions$1 = {
501
727
  /**
502
728
  * The path to forward all unmatched requests to. Defaults to '/api/app' if
503
729
  * not given. Disables index path behavior if false is given.
504
730
  */
505
731
  indexPath?: string | false;
506
- configure?(context: RootHttpRouterConfigureContext): void;
732
+ configure?(context: RootHttpRouterConfigureContext$1): void;
507
733
  };
508
- /** @public */
509
- declare const rootHttpRouterServiceFactory: (options?: RootHttpRouterFactoryOptions | undefined) => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.RootHttpRouterService, "root">;
734
+
735
+ /**
736
+ * @public
737
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
738
+ */
739
+ type RootHttpRouterConfigureContext = RootHttpRouterConfigureContext$1;
740
+ /**
741
+ * HTTP route registration for root services.
742
+ *
743
+ * See {@link @backstage/code-plugin-api#RootHttpRouterService}
744
+ * and {@link https://backstage.io/docs/backend-system/core-services/root-http-router | the service docs}
745
+ * for more information.
746
+ *
747
+ * @public
748
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
749
+ */
750
+ type RootHttpRouterFactoryOptions = RootHttpRouterFactoryOptions$1;
751
+ /**
752
+ * @public
753
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
754
+ */
755
+ declare const rootHttpRouterServiceFactory: (options?: RootHttpRouterFactoryOptions$1 | undefined) => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.RootHttpRouterService, "root">;
510
756
 
511
757
  /**
512
758
  * Options for the {@link DefaultRootHttpRouter} class.
513
759
  *
514
760
  * @public
515
761
  */
516
- interface DefaultRootHttpRouterOptions {
762
+ interface DefaultRootHttpRouterOptions$1 {
517
763
  /**
518
764
  * The path to forward all unmatched requests to. Defaults to '/api/app' if
519
765
  * not given. Disables index path behavior if false is given.
520
766
  */
521
767
  indexPath?: string | false;
522
768
  }
769
+
770
+ /**
771
+ * Options for the {@link DefaultRootHttpRouter} class.
772
+ *
773
+ * @public
774
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
775
+ */
776
+ type DefaultRootHttpRouterOptions = DefaultRootHttpRouterOptions$1;
523
777
  /**
524
778
  * The default implementation of the {@link @backstage/backend-plugin-api#RootHttpRouterService} interface for
525
779
  * {@link @backstage/backend-plugin-api#coreServices.rootHttpRouter}.
526
780
  *
527
781
  * @public
782
+ * @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
528
783
  */
529
784
  declare class DefaultRootHttpRouter implements RootHttpRouterService {
530
- #private;
785
+ private readonly impl;
531
786
  static create(options?: DefaultRootHttpRouterOptions): DefaultRootHttpRouter;
532
787
  private constructor();
533
788
  use(path: string, handler: Handler): void;
@@ -535,35 +790,27 @@ declare class DefaultRootHttpRouter implements RootHttpRouterService {
535
790
  }
536
791
 
537
792
  /**
538
- * Allows plugins to register shutdown hooks that are run when the process is about to exit.
793
+ * Root-level logging.
794
+ *
795
+ * See {@link @backstage/code-plugin-api#RootLoggerService}
796
+ * and {@link https://backstage.io/docs/backend-system/core-services/root-logger | the service docs}
797
+ * for more information.
539
798
  *
540
799
  * @public
541
- * @deprecated Please import from `@backstage/backend-defaults/rootLifecycle` instead.
800
+ * @deprecated Please import from `@backstage/backend-defaults/rootLogger` instead.
542
801
  */
543
- declare const rootLifecycleServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<RootLifecycleService, "root">;
544
-
545
- /** @public */
546
802
  declare const rootLoggerServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.RootLoggerService, "root">;
547
803
 
548
804
  /**
549
805
  * @public
550
- * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead
551
- */
552
- declare const tokenManagerServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.TokenManagerService, "plugin">;
553
-
554
- /**
555
- * @public
556
- * @deprecated Please import from `@backstage/backend-defaults/urlReader` instead.
806
+ * @deprecated Please import from `@backstage/backend-defaults/scheduler` instead.
557
807
  */
558
- declare const urlReaderServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.UrlReaderService, "plugin">;
559
-
560
- /** @public */
561
- declare const userInfoServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<UserInfoService, "plugin">;
808
+ declare const schedulerServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.SchedulerService, "plugin">;
562
809
 
563
810
  /**
564
811
  * @public
565
- * @deprecated Please import from `@backstage/backend-defaults/scheduler` instead.
812
+ * @deprecated Please import from `@backstage/backend-defaults/userInfo` instead.
566
813
  */
567
- declare const schedulerServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.SchedulerService, "plugin">;
814
+ declare const userInfoServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.UserInfoService, "plugin">;
568
815
 
569
816
  export { type Backend, type CreateSpecializedBackendOptions, DefaultRootHttpRouter, type DefaultRootHttpRouterOptions, type ExtendedHttpServer, HostDiscovery, type HttpRouterFactoryOptions, type HttpServerCertificateOptions, type HttpServerOptions, type IdentityFactoryOptions, type LifecycleMiddlewareOptions, MiddlewareFactory, type MiddlewareFactoryErrorOptions, type MiddlewareFactoryOptions, type RootConfigFactoryOptions, type RootHttpRouterConfigureContext, type RootHttpRouterFactoryOptions, WinstonLogger, type WinstonLoggerOptions, authServiceFactory, cacheServiceFactory, createConfigSecretEnumerator, createHttpServer, createLifecycleMiddleware, createSpecializedBackend, databaseServiceFactory, discoveryServiceFactory, httpAuthServiceFactory, httpRouterServiceFactory, identityServiceFactory, lifecycleServiceFactory, loadBackendConfig, loggerServiceFactory, permissionsServiceFactory, readCorsOptions, readHelmetOptions, readHttpServerOptions, rootConfigServiceFactory, rootHttpRouterServiceFactory, rootLifecycleServiceFactory, rootLoggerServiceFactory, schedulerServiceFactory, tokenManagerServiceFactory, urlReaderServiceFactory, userInfoServiceFactory };