@backstage/backend-app-api 0.4.3 → 0.4.4-next.1

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.

Potentially problematic release.


This version of @backstage/backend-app-api might be problematic. Click here for more details.

package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import { RequestListener } from 'http';
8
8
  import { RequestHandler, ErrorRequestHandler, Express, Handler } from 'express';
9
9
  import { CorsOptions } from 'cors';
10
10
  import { HelmetOptions } from 'helmet';
11
- import { JsonObject } from '@backstage/types';
11
+ import { JsonObject, HumanDuration } from '@backstage/types';
12
12
  import { Format } from 'logform';
13
13
  import { transport } from 'winston';
14
14
  import * as _backstage_backend_common from '@backstage/backend-common';
@@ -340,6 +340,35 @@ interface HttpRouterFactoryOptions {
340
340
  /** @public */
341
341
  declare const httpRouterServiceFactory: (options?: HttpRouterFactoryOptions | undefined) => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.HttpRouterService, "plugin">;
342
342
 
343
+ /**
344
+ * Options for {@link createLifecycleMiddleware}.
345
+ * @public
346
+ */
347
+ interface LifecycleMiddlewareOptions {
348
+ lifecycle: LifecycleService;
349
+ /**
350
+ * The maximum time that paused requests will wait for the service to start, before returning an error.
351
+ *
352
+ * Defaults to 5 seconds.
353
+ */
354
+ startupRequestPauseTimeout?: HumanDuration;
355
+ }
356
+ /**
357
+ * Creates a middleware that pauses requests until the service has started.
358
+ *
359
+ * @remarks
360
+ *
361
+ * Requests that arrive before the service has started will be paused until startup is complete.
362
+ * If the service does not start within the provided timeout, the request will be rejected with a
363
+ * {@link @backstage/errors#ServiceUnavailableError}.
364
+ *
365
+ * If the service is shutting down, all requests will be rejected with a
366
+ * {@link @backstage/errors#ServiceUnavailableError}.
367
+ *
368
+ * @public
369
+ */
370
+ declare function createLifecycleMiddleware(options: LifecycleMiddlewareOptions): RequestHandler;
371
+
343
372
  /**
344
373
  * An identity client options object which allows extra configurations
345
374
  *
@@ -358,7 +387,7 @@ declare const identityServiceFactory: (options?: IdentityFactoryOptions | undefi
358
387
  * Allows plugins to register shutdown hooks that are run when the process is about to exit.
359
388
  * @public
360
389
  */
361
- declare const lifecycleServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.LifecycleService, "plugin">;
390
+ declare const lifecycleServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<LifecycleService, "plugin">;
362
391
 
363
392
  /** @public */
364
393
  declare const loggerServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.LoggerService, "plugin">;
@@ -436,4 +465,4 @@ declare const tokenManagerServiceFactory: () => _backstage_backend_plugin_api.Se
436
465
  /** @public */
437
466
  declare const urlReaderServiceFactory: () => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_common.UrlReader, "plugin">;
438
467
 
439
- export { Backend, ConfigFactoryOptions, CreateSpecializedBackendOptions, DefaultRootHttpRouter, DefaultRootHttpRouterOptions, ExtendedHttpServer, HttpRouterFactoryOptions, HttpServerCertificateOptions, HttpServerOptions, IdentityFactoryOptions, MiddlewareFactory, MiddlewareFactoryErrorOptions, MiddlewareFactoryOptions, RootHttpRouterConfigureContext, RootHttpRouterFactoryOptions, WinstonLogger, WinstonLoggerOptions, cacheServiceFactory, configServiceFactory, createConfigSecretEnumerator, createHttpServer, createSpecializedBackend, databaseServiceFactory, discoveryServiceFactory, httpRouterServiceFactory, identityServiceFactory, lifecycleServiceFactory, loadBackendConfig, loggerServiceFactory, permissionsServiceFactory, readCorsOptions, readHelmetOptions, readHttpServerOptions, rootHttpRouterServiceFactory, rootLifecycleServiceFactory, rootLoggerServiceFactory, schedulerServiceFactory, tokenManagerServiceFactory, urlReaderServiceFactory };
468
+ export { Backend, ConfigFactoryOptions, CreateSpecializedBackendOptions, DefaultRootHttpRouter, DefaultRootHttpRouterOptions, ExtendedHttpServer, HttpRouterFactoryOptions, HttpServerCertificateOptions, HttpServerOptions, IdentityFactoryOptions, LifecycleMiddlewareOptions, MiddlewareFactory, MiddlewareFactoryErrorOptions, MiddlewareFactoryOptions, RootHttpRouterConfigureContext, RootHttpRouterFactoryOptions, WinstonLogger, WinstonLoggerOptions, cacheServiceFactory, configServiceFactory, createConfigSecretEnumerator, createHttpServer, createLifecycleMiddleware, createSpecializedBackend, databaseServiceFactory, discoveryServiceFactory, httpRouterServiceFactory, identityServiceFactory, lifecycleServiceFactory, loadBackendConfig, loggerServiceFactory, permissionsServiceFactory, readCorsOptions, readHelmetOptions, readHttpServerOptions, rootHttpRouterServiceFactory, rootLifecycleServiceFactory, rootLoggerServiceFactory, schedulerServiceFactory, tokenManagerServiceFactory, urlReaderServiceFactory };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/backend-app-api",
3
3
  "description": "Core API used by Backstage backend apps",
4
- "version": "0.4.3",
4
+ "version": "0.4.4-next.1",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "publishConfig": {
@@ -32,15 +32,15 @@
32
32
  "start": "backstage-cli package start"
33
33
  },
34
34
  "dependencies": {
35
- "@backstage/backend-common": "^0.18.5",
36
- "@backstage/backend-plugin-api": "^0.5.2",
37
- "@backstage/backend-tasks": "^0.5.2",
35
+ "@backstage/backend-common": "^0.19.0-next.1",
36
+ "@backstage/backend-plugin-api": "^0.5.3-next.1",
37
+ "@backstage/backend-tasks": "^0.5.3-next.1",
38
38
  "@backstage/cli-common": "^0.1.12",
39
39
  "@backstage/config": "^1.0.7",
40
- "@backstage/config-loader": "^1.3.0",
41
- "@backstage/errors": "^1.1.5",
42
- "@backstage/plugin-auth-node": "^0.2.14",
43
- "@backstage/plugin-permission-node": "^0.7.8",
40
+ "@backstage/config-loader": "^1.3.1-next.1",
41
+ "@backstage/errors": "^1.2.0-next.0",
42
+ "@backstage/plugin-auth-node": "^0.2.15-next.1",
43
+ "@backstage/plugin-permission-node": "^0.7.9-next.1",
44
44
  "@backstage/types": "^1.0.2",
45
45
  "@manypkg/get-packages": "^1.1.3",
46
46
  "@types/cors": "^2.8.6",
@@ -63,8 +63,8 @@
63
63
  "winston-transport": "^4.5.0"
64
64
  },
65
65
  "devDependencies": {
66
- "@backstage/backend-test-utils": "^0.1.37",
67
- "@backstage/cli": "^0.22.7",
66
+ "@backstage/backend-test-utils": "^0.1.38-next.1",
67
+ "@backstage/cli": "^0.22.8-next.1",
68
68
  "@types/compression": "^1.7.0",
69
69
  "@types/fs-extra": "^9.0.3",
70
70
  "@types/http-errors": "^2.0.0",