@backstage/backend-app-api 0.8.1-next.2 → 0.9.0
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/CHANGELOG.md +43 -0
- package/alpha/package.json +1 -1
- package/dist/index.cjs.js +725 -3798
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -762
- package/package.json +9 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,442 +1,5 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
3
|
-
import {
|
|
4
|
-
import { Config, AppConfig } from '@backstage/config';
|
|
5
|
-
import { ConfigSchema, LoadConfigOptionsRemote, RemoteConfigSourceOptions } from '@backstage/config-loader';
|
|
6
|
-
import { RequestHandler, ErrorRequestHandler, Express, Handler } from 'express';
|
|
7
|
-
import * as http from 'http';
|
|
8
|
-
import { RequestListener } from 'http';
|
|
9
|
-
import { CorsOptions } from 'cors';
|
|
10
|
-
import { HelmetOptions } from 'helmet';
|
|
11
|
-
import { JsonObject, HumanDuration } from '@backstage/types';
|
|
12
|
-
import { Format } from 'logform';
|
|
13
|
-
import { transport } from 'winston';
|
|
14
|
-
import { Server } from 'node:http';
|
|
15
|
-
|
|
16
|
-
/** @public */
|
|
17
|
-
declare function createConfigSecretEnumerator$1(options: {
|
|
18
|
-
logger: LoggerService;
|
|
19
|
-
dir?: string;
|
|
20
|
-
schema?: ConfigSchema;
|
|
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;
|
|
28
|
-
/**
|
|
29
|
-
* Load configuration for a Backend.
|
|
30
|
-
*
|
|
31
|
-
* This function should only be called once, during the initialization of the backend.
|
|
32
|
-
*
|
|
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.
|
|
35
|
-
*/
|
|
36
|
-
declare function loadBackendConfig(options: {
|
|
37
|
-
remote?: LoadConfigOptionsRemote;
|
|
38
|
-
argv: string[];
|
|
39
|
-
additionalConfigs?: AppConfig[];
|
|
40
|
-
watch?: boolean;
|
|
41
|
-
}): Promise<{
|
|
42
|
-
config: Config;
|
|
43
|
-
}>;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* An HTTP server extended with utility methods.
|
|
47
|
-
*
|
|
48
|
-
* @public
|
|
49
|
-
*/
|
|
50
|
-
interface ExtendedHttpServer$1 extends http.Server {
|
|
51
|
-
start(): Promise<void>;
|
|
52
|
-
stop(): Promise<void>;
|
|
53
|
-
port(): number;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Options for starting up an HTTP server.
|
|
57
|
-
*
|
|
58
|
-
* @public
|
|
59
|
-
*/
|
|
60
|
-
type HttpServerOptions$1 = {
|
|
61
|
-
listen: {
|
|
62
|
-
port: number;
|
|
63
|
-
host: string;
|
|
64
|
-
};
|
|
65
|
-
https?: {
|
|
66
|
-
certificate: HttpServerCertificateOptions$1;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Options for configuring HTTPS for an HTTP server.
|
|
71
|
-
*
|
|
72
|
-
* @public
|
|
73
|
-
*/
|
|
74
|
-
type HttpServerCertificateOptions$1 = {
|
|
75
|
-
type: 'pem';
|
|
76
|
-
key: string;
|
|
77
|
-
cert: string;
|
|
78
|
-
} | {
|
|
79
|
-
type: 'generated';
|
|
80
|
-
hostname: string;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Reads {@link HttpServerOptions} from a {@link @backstage/config#Config} object.
|
|
85
|
-
*
|
|
86
|
-
* @public
|
|
87
|
-
* @remarks
|
|
88
|
-
*
|
|
89
|
-
* The provided configuration object should contain the `listen` and
|
|
90
|
-
* additional keys directly.
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```ts
|
|
94
|
-
* const opts = readHttpServerOptions(config.getConfig('backend'));
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
declare function readHttpServerOptions$1(config?: Config): HttpServerOptions$1;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Creates a Node.js HTTP or HTTPS server instance.
|
|
101
|
-
*
|
|
102
|
-
* @public
|
|
103
|
-
*/
|
|
104
|
-
declare function createHttpServer$1(listener: RequestListener, options: HttpServerOptions$1, deps: {
|
|
105
|
-
logger: LoggerService;
|
|
106
|
-
}): Promise<ExtendedHttpServer$1>;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Options used to create a {@link MiddlewareFactory}.
|
|
110
|
-
*
|
|
111
|
-
* @public
|
|
112
|
-
*/
|
|
113
|
-
interface MiddlewareFactoryOptions$1 {
|
|
114
|
-
config: RootConfigService;
|
|
115
|
-
logger: LoggerService;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Options passed to the {@link MiddlewareFactory.error} middleware.
|
|
119
|
-
*
|
|
120
|
-
* @public
|
|
121
|
-
*/
|
|
122
|
-
interface MiddlewareFactoryErrorOptions$1 {
|
|
123
|
-
/**
|
|
124
|
-
* Whether error response bodies should show error stack traces or not.
|
|
125
|
-
*
|
|
126
|
-
* If not specified, by default shows stack traces only in development mode.
|
|
127
|
-
*/
|
|
128
|
-
showStackTraces?: boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Whether any 4xx errors should be logged or not.
|
|
131
|
-
*
|
|
132
|
-
* If not specified, default to only logging 5xx errors.
|
|
133
|
-
*/
|
|
134
|
-
logAllErrors?: boolean;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* A utility to configure common middleware.
|
|
138
|
-
*
|
|
139
|
-
* @public
|
|
140
|
-
*/
|
|
141
|
-
declare class MiddlewareFactory$1 {
|
|
142
|
-
#private;
|
|
143
|
-
/**
|
|
144
|
-
* Creates a new {@link MiddlewareFactory}.
|
|
145
|
-
*/
|
|
146
|
-
static create(options: MiddlewareFactoryOptions$1): MiddlewareFactory$1;
|
|
147
|
-
private constructor();
|
|
148
|
-
/**
|
|
149
|
-
* Returns a middleware that unconditionally produces a 404 error response.
|
|
150
|
-
*
|
|
151
|
-
* @remarks
|
|
152
|
-
*
|
|
153
|
-
* Typically you want to place this middleware at the end of the chain, such
|
|
154
|
-
* that it's the last one attempted after no other routes matched.
|
|
155
|
-
*
|
|
156
|
-
* @returns An Express request handler
|
|
157
|
-
*/
|
|
158
|
-
notFound(): RequestHandler;
|
|
159
|
-
/**
|
|
160
|
-
* Returns the compression middleware.
|
|
161
|
-
*
|
|
162
|
-
* @remarks
|
|
163
|
-
*
|
|
164
|
-
* The middleware will attempt to compress response bodies for all requests
|
|
165
|
-
* that traverse through the middleware.
|
|
166
|
-
*/
|
|
167
|
-
compression(): RequestHandler;
|
|
168
|
-
/**
|
|
169
|
-
* Returns a request logging middleware.
|
|
170
|
-
*
|
|
171
|
-
* @remarks
|
|
172
|
-
*
|
|
173
|
-
* Typically you want to place this middleware at the start of the chain, such
|
|
174
|
-
* that it always logs requests whether they are "caught" by handlers farther
|
|
175
|
-
* down or not.
|
|
176
|
-
*
|
|
177
|
-
* @returns An Express request handler
|
|
178
|
-
*/
|
|
179
|
-
logging(): RequestHandler;
|
|
180
|
-
/**
|
|
181
|
-
* Returns a middleware that implements the helmet library.
|
|
182
|
-
*
|
|
183
|
-
* @remarks
|
|
184
|
-
*
|
|
185
|
-
* This middleware applies security policies to incoming requests and outgoing
|
|
186
|
-
* responses. It is configured using config keys such as `backend.csp`.
|
|
187
|
-
*
|
|
188
|
-
* @see {@link https://helmetjs.github.io/}
|
|
189
|
-
*
|
|
190
|
-
* @returns An Express request handler
|
|
191
|
-
*/
|
|
192
|
-
helmet(): RequestHandler;
|
|
193
|
-
/**
|
|
194
|
-
* Returns a middleware that implements the cors library.
|
|
195
|
-
*
|
|
196
|
-
* @remarks
|
|
197
|
-
*
|
|
198
|
-
* This middleware handles CORS. It is configured using the config key
|
|
199
|
-
* `backend.cors`.
|
|
200
|
-
*
|
|
201
|
-
* @see {@link https://github.com/expressjs/cors}
|
|
202
|
-
*
|
|
203
|
-
* @returns An Express request handler
|
|
204
|
-
*/
|
|
205
|
-
cors(): RequestHandler;
|
|
206
|
-
/**
|
|
207
|
-
* Express middleware to handle errors during request processing.
|
|
208
|
-
*
|
|
209
|
-
* @remarks
|
|
210
|
-
*
|
|
211
|
-
* This is commonly the very last middleware in the chain.
|
|
212
|
-
*
|
|
213
|
-
* Its primary purpose is not to do translation of business logic exceptions,
|
|
214
|
-
* but rather to be a global catch-all for uncaught "fatal" errors that are
|
|
215
|
-
* expected to result in a 500 error. However, it also does handle some common
|
|
216
|
-
* error types (such as http-error exceptions, and the well-known error types
|
|
217
|
-
* in the `@backstage/errors` package) and returns the enclosed status code
|
|
218
|
-
* accordingly.
|
|
219
|
-
*
|
|
220
|
-
* It will also produce a response body with a serialized form of the error,
|
|
221
|
-
* unless a previous handler already did send a body. See
|
|
222
|
-
* {@link @backstage/errors#ErrorResponseBody} for the response shape used.
|
|
223
|
-
*
|
|
224
|
-
* @returns An Express error request handler
|
|
225
|
-
*/
|
|
226
|
-
error(options?: MiddlewareFactoryErrorOptions$1): ErrorRequestHandler;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Attempts to read a CORS options object from the backend configuration object.
|
|
231
|
-
*
|
|
232
|
-
* @public
|
|
233
|
-
* @param config - The backend configuration object.
|
|
234
|
-
* @returns A CORS options object, or undefined if no cors configuration is present.
|
|
235
|
-
*
|
|
236
|
-
* @example
|
|
237
|
-
* ```ts
|
|
238
|
-
* const corsOptions = readCorsOptions(config.getConfig('backend'));
|
|
239
|
-
* ```
|
|
240
|
-
*/
|
|
241
|
-
declare function readCorsOptions$1(config?: Config): CorsOptions;
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Attempts to read Helmet options from the backend configuration object.
|
|
245
|
-
*
|
|
246
|
-
* @public
|
|
247
|
-
* @param config - The backend configuration object.
|
|
248
|
-
* @returns A Helmet options object, or undefined if no Helmet configuration is present.
|
|
249
|
-
*
|
|
250
|
-
* @example
|
|
251
|
-
* ```ts
|
|
252
|
-
* const helmetOptions = readHelmetOptions(config.getConfig('backend'));
|
|
253
|
-
* ```
|
|
254
|
-
*/
|
|
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;
|
|
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;
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* @public
|
|
396
|
-
*/
|
|
397
|
-
interface WinstonLoggerOptions$1 {
|
|
398
|
-
meta?: JsonObject;
|
|
399
|
-
level?: string;
|
|
400
|
-
format?: Format;
|
|
401
|
-
transports?: transport[];
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* @public
|
|
406
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootLogger` instead.
|
|
407
|
-
*/
|
|
408
|
-
type WinstonLoggerOptions = WinstonLoggerOptions$1;
|
|
409
|
-
/**
|
|
410
|
-
* A {@link @backstage/backend-plugin-api#LoggerService} implementation based on winston.
|
|
411
|
-
*
|
|
412
|
-
* @public
|
|
413
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootLogger` instead.
|
|
414
|
-
*/
|
|
415
|
-
declare class WinstonLogger implements RootLoggerService {
|
|
416
|
-
private readonly impl;
|
|
417
|
-
/**
|
|
418
|
-
* Creates a {@link WinstonLogger} instance.
|
|
419
|
-
*/
|
|
420
|
-
static create(options: WinstonLoggerOptions): WinstonLogger;
|
|
421
|
-
/**
|
|
422
|
-
* Creates a winston log formatter for redacting secrets.
|
|
423
|
-
*/
|
|
424
|
-
static redacter(): {
|
|
425
|
-
format: Format;
|
|
426
|
-
add: (redactions: Iterable<string>) => void;
|
|
427
|
-
};
|
|
428
|
-
/**
|
|
429
|
-
* Creates a pretty printed winston log formatter.
|
|
430
|
-
*/
|
|
431
|
-
static colorFormat(): Format;
|
|
432
|
-
private constructor();
|
|
433
|
-
error(message: string, meta?: JsonObject): void;
|
|
434
|
-
warn(message: string, meta?: JsonObject): void;
|
|
435
|
-
info(message: string, meta?: JsonObject): void;
|
|
436
|
-
debug(message: string, meta?: JsonObject): void;
|
|
437
|
-
child(meta: JsonObject): LoggerService;
|
|
438
|
-
addRedactions(redactions: Iterable<string>): void;
|
|
439
|
-
}
|
|
2
|
+
import { BackendFeature, ServiceFactory } from '@backstage/backend-plugin-api';
|
|
440
3
|
|
|
441
4
|
/**
|
|
442
5
|
* @public
|
|
@@ -445,16 +8,6 @@ interface Backend {
|
|
|
445
8
|
add(feature: BackendFeature | Promise<{
|
|
446
9
|
default: BackendFeature;
|
|
447
10
|
}>): void;
|
|
448
|
-
/**
|
|
449
|
-
* @deprecated The ability to add features defined as a callback is being
|
|
450
|
-
* removed. Please update the installed feature to no longer be defined as a
|
|
451
|
-
* callback, typically this means updating it to use the latest version of
|
|
452
|
-
* `@backstage/backend-plugin-api`. If the feature is from a third-party
|
|
453
|
-
* package, please reach out to the package maintainer to update it.
|
|
454
|
-
*/
|
|
455
|
-
add(feature: (() => BackendFeature) | Promise<{
|
|
456
|
-
default: () => BackendFeature;
|
|
457
|
-
}>): void;
|
|
458
11
|
start(): Promise<void>;
|
|
459
12
|
stop(): Promise<void>;
|
|
460
13
|
}
|
|
@@ -470,90 +23,6 @@ interface CreateSpecializedBackendOptions {
|
|
|
470
23
|
*/
|
|
471
24
|
declare function createSpecializedBackend(options: CreateSpecializedBackendOptions): Backend;
|
|
472
25
|
|
|
473
|
-
/**
|
|
474
|
-
* @public
|
|
475
|
-
* @deprecated Please import from `@backstage/backend-defaults/cache` instead.
|
|
476
|
-
*/
|
|
477
|
-
declare const cacheServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.CacheService, "plugin", "singleton", undefined>;
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* @public
|
|
481
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootConfig` instead.
|
|
482
|
-
*/
|
|
483
|
-
interface RootConfigFactoryOptions {
|
|
484
|
-
/**
|
|
485
|
-
* Process arguments to use instead of the default `process.argv()`.
|
|
486
|
-
*/
|
|
487
|
-
argv?: string[];
|
|
488
|
-
/**
|
|
489
|
-
* Enables and sets options for remote configuration loading.
|
|
490
|
-
*/
|
|
491
|
-
remote?: Pick<RemoteConfigSourceOptions, 'reloadInterval'>;
|
|
492
|
-
watch?: boolean;
|
|
493
|
-
}
|
|
494
|
-
/**
|
|
495
|
-
* @public
|
|
496
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootConfig` instead.
|
|
497
|
-
*/
|
|
498
|
-
declare const rootConfigServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.RootConfigService, "root", "singleton", RootConfigFactoryOptions>;
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* @public
|
|
502
|
-
* @deprecated Please import from `@backstage/backend-defaults/database` instead.
|
|
503
|
-
*/
|
|
504
|
-
declare const databaseServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.DatabaseService, "plugin", "singleton", undefined>;
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* @public
|
|
508
|
-
* @deprecated Please import from `@backstage/backend-defaults/discovery` instead.
|
|
509
|
-
*/
|
|
510
|
-
declare const discoveryServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.DiscoveryService, "plugin", "singleton", undefined>;
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* HostDiscovery is a basic PluginEndpointDiscovery implementation
|
|
514
|
-
* that can handle plugins that are hosted in a single or multiple deployments.
|
|
515
|
-
*
|
|
516
|
-
* The deployment may be scaled horizontally, as long as the external URL
|
|
517
|
-
* is the same for all instances. However, internal URLs will always be
|
|
518
|
-
* resolved to the same host, so there won't be any balancing of internal traffic.
|
|
519
|
-
*
|
|
520
|
-
* @public
|
|
521
|
-
* @deprecated Please import from `@backstage/backend-defaults/discovery` instead.
|
|
522
|
-
*/
|
|
523
|
-
declare class HostDiscovery implements DiscoveryService {
|
|
524
|
-
private readonly impl;
|
|
525
|
-
/**
|
|
526
|
-
* Creates a new HostDiscovery discovery instance by reading
|
|
527
|
-
* from the `backend` config section, specifically the `.baseUrl` for
|
|
528
|
-
* discovering the external URL, and the `.listen` and `.https` config
|
|
529
|
-
* for the internal one.
|
|
530
|
-
*
|
|
531
|
-
* Can be overridden in config by providing a target and corresponding plugins in `discovery.endpoints`.
|
|
532
|
-
* eg.
|
|
533
|
-
* ```yaml
|
|
534
|
-
* discovery:
|
|
535
|
-
* endpoints:
|
|
536
|
-
* - target: https://internal.example.com/internal-catalog
|
|
537
|
-
* plugins: [catalog]
|
|
538
|
-
* - target: https://internal.example.com/secure/api/{{pluginId}}
|
|
539
|
-
* plugins: [auth, permission]
|
|
540
|
-
* - target:
|
|
541
|
-
* internal: https://internal.example.com/search
|
|
542
|
-
* external: https://example.com/search
|
|
543
|
-
* plugins: [search]
|
|
544
|
-
* ```
|
|
545
|
-
*
|
|
546
|
-
* The basePath defaults to `/api`, meaning the default full internal
|
|
547
|
-
* path for the `catalog` plugin will be `http://localhost:7007/api/catalog`.
|
|
548
|
-
*/
|
|
549
|
-
static fromConfig(config: Config, options?: {
|
|
550
|
-
basePath?: string;
|
|
551
|
-
}): HostDiscovery;
|
|
552
|
-
private constructor();
|
|
553
|
-
getBaseUrl(pluginId: string): Promise<string>;
|
|
554
|
-
getExternalBaseUrl(pluginId: string): Promise<string>;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
26
|
/**
|
|
558
27
|
* An identity client options object which allows extra configurations
|
|
559
28
|
*
|
|
@@ -574,239 +43,10 @@ type IdentityFactoryOptions = {
|
|
|
574
43
|
*/
|
|
575
44
|
declare const identityServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.IdentityService, "plugin", "singleton", IdentityFactoryOptions>;
|
|
576
45
|
|
|
577
|
-
/**
|
|
578
|
-
* Allows plugins to register shutdown hooks that are run when the process is about to exit.
|
|
579
|
-
*
|
|
580
|
-
* @public
|
|
581
|
-
* @deprecated Please import from `@backstage/backend-defaults/lifecycle` instead.
|
|
582
|
-
*/
|
|
583
|
-
declare const lifecycleServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<LifecycleService, "plugin", "singleton", undefined>;
|
|
584
|
-
|
|
585
|
-
/**
|
|
586
|
-
* @public
|
|
587
|
-
* @deprecated Please import from `@backstage/backend-defaults/permissions` instead.
|
|
588
|
-
*/
|
|
589
|
-
declare const permissionsServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.PermissionsService, "plugin", "singleton", undefined>;
|
|
590
|
-
|
|
591
|
-
/**
|
|
592
|
-
* Allows plugins to register shutdown hooks that are run when the process is about to exit.
|
|
593
|
-
*
|
|
594
|
-
* @public
|
|
595
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootLifecycle` instead.
|
|
596
|
-
*/
|
|
597
|
-
declare const rootLifecycleServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<RootLifecycleService, "root", "singleton", undefined>;
|
|
598
|
-
|
|
599
46
|
/**
|
|
600
47
|
* @public
|
|
601
48
|
* @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead
|
|
602
49
|
*/
|
|
603
50
|
declare const tokenManagerServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.TokenManagerService, "plugin", "singleton", undefined>;
|
|
604
51
|
|
|
605
|
-
|
|
606
|
-
* @public
|
|
607
|
-
* @deprecated Please import from `@backstage/backend-defaults/urlReader` instead.
|
|
608
|
-
*/
|
|
609
|
-
declare const urlReaderServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.UrlReaderService, "plugin", "singleton", undefined>;
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
* @public
|
|
613
|
-
* @deprecated Please import from `@backstage/backend-defaults/auth` instead.
|
|
614
|
-
*/
|
|
615
|
-
declare const authServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.AuthService, "plugin", "singleton", undefined>;
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* @public
|
|
619
|
-
* @deprecated Please import from `@backstage/backend-defaults/httpAuth` instead.
|
|
620
|
-
*/
|
|
621
|
-
declare const httpAuthServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.HttpAuthService, "plugin", "singleton", undefined>;
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* HTTP route registration for plugins.
|
|
625
|
-
*
|
|
626
|
-
* See {@link @backstage/code-plugin-api#HttpRouterService}
|
|
627
|
-
* and {@link https://backstage.io/docs/backend-system/core-services/http-router | the service docs}
|
|
628
|
-
* for more information.
|
|
629
|
-
*
|
|
630
|
-
* @public
|
|
631
|
-
* @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead.
|
|
632
|
-
*/
|
|
633
|
-
declare const httpRouterServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.HttpRouterService, "plugin", "singleton", undefined>;
|
|
634
|
-
|
|
635
|
-
/**
|
|
636
|
-
* Options for {@link createLifecycleMiddleware}.
|
|
637
|
-
* @public
|
|
638
|
-
*/
|
|
639
|
-
interface LifecycleMiddlewareOptions$1 {
|
|
640
|
-
lifecycle: LifecycleService;
|
|
641
|
-
/**
|
|
642
|
-
* The maximum time that paused requests will wait for the service to start, before returning an error.
|
|
643
|
-
*
|
|
644
|
-
* Defaults to 5 seconds.
|
|
645
|
-
*/
|
|
646
|
-
startupRequestPauseTimeout?: HumanDuration;
|
|
647
|
-
}
|
|
648
|
-
/**
|
|
649
|
-
* Creates a middleware that pauses requests until the service has started.
|
|
650
|
-
*
|
|
651
|
-
* @remarks
|
|
652
|
-
*
|
|
653
|
-
* Requests that arrive before the service has started will be paused until startup is complete.
|
|
654
|
-
* If the service does not start within the provided timeout, the request will be rejected with a
|
|
655
|
-
* {@link @backstage/errors#ServiceUnavailableError}.
|
|
656
|
-
*
|
|
657
|
-
* If the service is shutting down, all requests will be rejected with a
|
|
658
|
-
* {@link @backstage/errors#ServiceUnavailableError}.
|
|
659
|
-
*
|
|
660
|
-
* @public
|
|
661
|
-
*/
|
|
662
|
-
declare function createLifecycleMiddleware$1(options: LifecycleMiddlewareOptions$1): RequestHandler;
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* Options for {@link createLifecycleMiddleware}.
|
|
666
|
-
* @public
|
|
667
|
-
* @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead.
|
|
668
|
-
*/
|
|
669
|
-
type LifecycleMiddlewareOptions = LifecycleMiddlewareOptions$1;
|
|
670
|
-
/**
|
|
671
|
-
* Creates a middleware that pauses requests until the service has started.
|
|
672
|
-
*
|
|
673
|
-
* @remarks
|
|
674
|
-
*
|
|
675
|
-
* Requests that arrive before the service has started will be paused until startup is complete.
|
|
676
|
-
* If the service does not start within the provided timeout, the request will be rejected with a
|
|
677
|
-
* {@link @backstage/errors#ServiceUnavailableError}.
|
|
678
|
-
*
|
|
679
|
-
* If the service is shutting down, all requests will be rejected with a
|
|
680
|
-
* {@link @backstage/errors#ServiceUnavailableError}.
|
|
681
|
-
*
|
|
682
|
-
* @public
|
|
683
|
-
* @deprecated Please import from `@backstage/backend-defaults/httpRouter` instead.
|
|
684
|
-
*/
|
|
685
|
-
declare const createLifecycleMiddleware: typeof createLifecycleMiddleware$1;
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* Plugin-level logging.
|
|
689
|
-
*
|
|
690
|
-
* See {@link @backstage/code-plugin-api#LoggerService}
|
|
691
|
-
* and {@link https://backstage.io/docs/backend-system/core-services/logger | the service docs}
|
|
692
|
-
* for more information.
|
|
693
|
-
*
|
|
694
|
-
* @public
|
|
695
|
-
* @deprecated Please import from `@backstage/backend-defaults/logger` instead.
|
|
696
|
-
*/
|
|
697
|
-
declare const loggerServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.LoggerService, "plugin", "singleton", undefined>;
|
|
698
|
-
|
|
699
|
-
/**
|
|
700
|
-
* @public
|
|
701
|
-
*/
|
|
702
|
-
interface RootHttpRouterConfigureContext$1 {
|
|
703
|
-
app: Express;
|
|
704
|
-
server: Server;
|
|
705
|
-
middleware: MiddlewareFactory$1;
|
|
706
|
-
routes: RequestHandler;
|
|
707
|
-
config: RootConfigService;
|
|
708
|
-
logger: LoggerService;
|
|
709
|
-
lifecycle: LifecycleService;
|
|
710
|
-
healthRouter: RequestHandler;
|
|
711
|
-
applyDefaults: () => void;
|
|
712
|
-
}
|
|
713
|
-
/**
|
|
714
|
-
* HTTP route registration for root services.
|
|
715
|
-
*
|
|
716
|
-
* See {@link @backstage/code-plugin-api#RootHttpRouterService}
|
|
717
|
-
* and {@link https://backstage.io/docs/backend-system/core-services/root-http-router | the service docs}
|
|
718
|
-
* for more information.
|
|
719
|
-
*
|
|
720
|
-
* @public
|
|
721
|
-
*/
|
|
722
|
-
type RootHttpRouterFactoryOptions$1 = {
|
|
723
|
-
/**
|
|
724
|
-
* The path to forward all unmatched requests to. Defaults to '/api/app' if
|
|
725
|
-
* not given. Disables index path behavior if false is given.
|
|
726
|
-
*/
|
|
727
|
-
indexPath?: string | false;
|
|
728
|
-
configure?(context: RootHttpRouterConfigureContext$1): void;
|
|
729
|
-
};
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* @public
|
|
733
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
|
|
734
|
-
*/
|
|
735
|
-
type RootHttpRouterConfigureContext = RootHttpRouterConfigureContext$1;
|
|
736
|
-
/**
|
|
737
|
-
* HTTP route registration for root services.
|
|
738
|
-
*
|
|
739
|
-
* See {@link @backstage/code-plugin-api#RootHttpRouterService}
|
|
740
|
-
* and {@link https://backstage.io/docs/backend-system/core-services/root-http-router | the service docs}
|
|
741
|
-
* for more information.
|
|
742
|
-
*
|
|
743
|
-
* @public
|
|
744
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
|
|
745
|
-
*/
|
|
746
|
-
type RootHttpRouterFactoryOptions = RootHttpRouterFactoryOptions$1;
|
|
747
|
-
/**
|
|
748
|
-
* @public
|
|
749
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
|
|
750
|
-
*/
|
|
751
|
-
declare const rootHttpRouterServiceFactory: ((options?: RootHttpRouterFactoryOptions$1 | undefined) => _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.RootHttpRouterService, "root", "singleton">) & _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api.RootHttpRouterService, "root", "singleton">;
|
|
752
|
-
|
|
753
|
-
/**
|
|
754
|
-
* Options for the {@link DefaultRootHttpRouter} class.
|
|
755
|
-
*
|
|
756
|
-
* @public
|
|
757
|
-
*/
|
|
758
|
-
interface DefaultRootHttpRouterOptions$1 {
|
|
759
|
-
/**
|
|
760
|
-
* The path to forward all unmatched requests to. Defaults to '/api/app' if
|
|
761
|
-
* not given. Disables index path behavior if false is given.
|
|
762
|
-
*/
|
|
763
|
-
indexPath?: string | false;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* Options for the {@link DefaultRootHttpRouter} class.
|
|
768
|
-
*
|
|
769
|
-
* @public
|
|
770
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
|
|
771
|
-
*/
|
|
772
|
-
type DefaultRootHttpRouterOptions = DefaultRootHttpRouterOptions$1;
|
|
773
|
-
/**
|
|
774
|
-
* The default implementation of the {@link @backstage/backend-plugin-api#RootHttpRouterService} interface for
|
|
775
|
-
* {@link @backstage/backend-plugin-api#coreServices.rootHttpRouter}.
|
|
776
|
-
*
|
|
777
|
-
* @public
|
|
778
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootHttpRouter` instead.
|
|
779
|
-
*/
|
|
780
|
-
declare class DefaultRootHttpRouter implements RootHttpRouterService {
|
|
781
|
-
private readonly impl;
|
|
782
|
-
static create(options?: DefaultRootHttpRouterOptions): DefaultRootHttpRouter;
|
|
783
|
-
private constructor();
|
|
784
|
-
use(path: string, handler: Handler): void;
|
|
785
|
-
handler(): Handler;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
/**
|
|
789
|
-
* Root-level logging.
|
|
790
|
-
*
|
|
791
|
-
* See {@link @backstage/code-plugin-api#RootLoggerService}
|
|
792
|
-
* and {@link https://backstage.io/docs/backend-system/core-services/root-logger | the service docs}
|
|
793
|
-
* for more information.
|
|
794
|
-
*
|
|
795
|
-
* @public
|
|
796
|
-
* @deprecated Please import from `@backstage/backend-defaults/rootLogger` instead.
|
|
797
|
-
*/
|
|
798
|
-
declare const rootLoggerServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.RootLoggerService, "root", "singleton", undefined>;
|
|
799
|
-
|
|
800
|
-
/**
|
|
801
|
-
* @public
|
|
802
|
-
* @deprecated Please import from `@backstage/backend-defaults/scheduler` instead.
|
|
803
|
-
*/
|
|
804
|
-
declare const schedulerServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.SchedulerService, "plugin", "singleton", undefined>;
|
|
805
|
-
|
|
806
|
-
/**
|
|
807
|
-
* @public
|
|
808
|
-
* @deprecated Please import from `@backstage/backend-defaults/userInfo` instead.
|
|
809
|
-
*/
|
|
810
|
-
declare const userInfoServiceFactory: _backstage_backend_plugin_api.ServiceFactoryCompat<_backstage_backend_plugin_api.UserInfoService, "plugin", "singleton", undefined>;
|
|
811
|
-
|
|
812
|
-
export { type Backend, type CreateSpecializedBackendOptions, DefaultRootHttpRouter, type DefaultRootHttpRouterOptions, type ExtendedHttpServer, HostDiscovery, 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 };
|
|
52
|
+
export { type Backend, type CreateSpecializedBackendOptions, type IdentityFactoryOptions, createSpecializedBackend, identityServiceFactory, tokenManagerServiceFactory };
|