Merge pull request #18838 from backstage/vinzscam/root-config-service
Rename ConfigService to RootConfigService
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch
|
||||
'@backstage/plugin-catalog-backend-module-bitbucket-server': patch
|
||||
'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch
|
||||
'@backstage/plugin-search-backend-module-elasticsearch': patch
|
||||
'@backstage/plugin-catalog-backend-module-puppetdb': patch
|
||||
'@backstage/plugin-catalog-backend-module-msgraph': patch
|
||||
'@backstage/plugin-search-backend-module-techdocs': patch
|
||||
'@backstage/plugin-catalog-backend-module-gerrit': patch
|
||||
'@backstage/plugin-catalog-backend-module-github': patch
|
||||
'@backstage/plugin-catalog-backend-module-gitlab': patch
|
||||
'@backstage/plugin-events-backend-module-aws-sqs': patch
|
||||
'@backstage/plugin-search-backend-module-catalog': patch
|
||||
'@backstage/plugin-search-backend-module-explore': patch
|
||||
'@backstage/plugin-catalog-backend-module-azure': patch
|
||||
'@backstage/plugin-events-backend-module-github': patch
|
||||
'@backstage/plugin-events-backend-module-gitlab': patch
|
||||
'@backstage/plugin-catalog-backend-module-aws': patch
|
||||
'@backstage/plugin-catalog-backend-module-gcp': patch
|
||||
'@backstage/plugin-search-backend-module-pg': patch
|
||||
'@backstage/plugin-azure-devops-backend': patch
|
||||
'@backstage/plugin-kubernetes-backend': patch
|
||||
'@backstage/plugin-lighthouse-backend': patch
|
||||
'@backstage/plugin-permission-backend': patch
|
||||
'@backstage/plugin-scaffolder-backend': patch
|
||||
'@backstage/backend-defaults': patch
|
||||
'@backstage/plugin-airbrake-backend': patch
|
||||
'@backstage/plugin-devtools-backend': patch
|
||||
'@backstage/plugin-periskop-backend': patch
|
||||
'@backstage/plugin-techdocs-backend': patch
|
||||
'@backstage/backend-common': patch
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
'@backstage/plugin-badges-backend': patch
|
||||
'@backstage/plugin-bazaar-backend': patch
|
||||
'@backstage/plugin-events-backend': patch
|
||||
'@backstage/plugin-search-backend': patch
|
||||
'@backstage/plugin-kafka-backend': patch
|
||||
'@backstage/plugin-proxy-backend': patch
|
||||
'@backstage/plugin-todo-backend': patch
|
||||
'@backstage/plugin-app-backend': patch
|
||||
---
|
||||
|
||||
Use `coreServices.rootConfig` instead of `coreService.config`
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-test-utils': minor
|
||||
---
|
||||
|
||||
**BREAKING**: Renamed `mockServices.config` to `mockServices.rootConfig`.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-app-api': minor
|
||||
---
|
||||
|
||||
**BREAKING**: Renamed `configServiceFactory` to `rootConfigServiceFactory`.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-plugin-api': minor
|
||||
---
|
||||
|
||||
**BREAKING**: Renamed `coreServices.config` to `coreServices.rootConfig`.
|
||||
@@ -61,11 +61,11 @@ All of these services can be replaced with your own implementations if you need
|
||||
For example, let's say we want to customize the core configuration service to enable remote configuration loading. That would look something like this:
|
||||
|
||||
```ts
|
||||
import { configServiceFactory } from '@backstage/backend-app-api';
|
||||
import { rootConfigServiceFactory } from '@backstage/backend-app-api';
|
||||
|
||||
const backend = createBackend({
|
||||
services: [
|
||||
configServiceFactory({
|
||||
rootConfigServiceFactory({
|
||||
remote: { reloadIntervalSeconds: 60 },
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -37,7 +37,7 @@ describe('myPlugin', () => {
|
||||
|
||||
const { server } = await startTestBackend({
|
||||
features: [myPlugin()],
|
||||
services: [mockServices.config.factory({ data: fakeConfig })],
|
||||
services: [mockServices.rootConfig.factory({ data: fakeConfig })],
|
||||
});
|
||||
|
||||
const response = await request(server).get('/api/example/get-value');
|
||||
|
||||
@@ -183,11 +183,11 @@ There's additional configuration that you can optionally pass to setup the `conf
|
||||
You can configure these additional options by adding an override for the core service when calling `createBackend` like follows:
|
||||
|
||||
```ts
|
||||
import { configServiceFactory } from '@backstage/backend-app-api';
|
||||
import { rootConfigServiceFactory } from '@backstage/backend-app-api';
|
||||
|
||||
const backend = createBackend({
|
||||
services: [
|
||||
configServiceFactory({
|
||||
rootConfigServiceFactory({
|
||||
argv: [
|
||||
'--config',
|
||||
'/backstage/app-config.development.yaml',
|
||||
|
||||
@@ -9,7 +9,6 @@ import type { AppConfig } from '@backstage/config';
|
||||
import { BackendFeature } from '@backstage/backend-plugin-api';
|
||||
import { CacheClient } from '@backstage/backend-common';
|
||||
import { Config } from '@backstage/config';
|
||||
import { ConfigService } from '@backstage/backend-plugin-api';
|
||||
import { CorsOptions } from 'cors';
|
||||
import { ErrorRequestHandler } from 'express';
|
||||
import { Express as Express_2 } from 'express';
|
||||
@@ -30,6 +29,7 @@ import { PluginEndpointDiscovery } from '@backstage/backend-common';
|
||||
import { RemoteConfigSourceOptions } from '@backstage/config-loader';
|
||||
import { RequestHandler } from 'express';
|
||||
import { RequestListener } from 'http';
|
||||
import { RootConfigService } from '@backstage/backend-plugin-api';
|
||||
import { RootHttpRouterService } from '@backstage/backend-plugin-api';
|
||||
import { RootLifecycleService } from '@backstage/backend-plugin-api';
|
||||
import { RootLoggerService } from '@backstage/backend-plugin-api';
|
||||
@@ -53,17 +53,6 @@ export interface Backend {
|
||||
// @public (undocumented)
|
||||
export const cacheServiceFactory: () => ServiceFactory<CacheClient, 'plugin'>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ConfigFactoryOptions {
|
||||
argv?: string[];
|
||||
remote?: Pick<RemoteConfigSourceOptions, 'reloadInterval'>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export const configServiceFactory: (
|
||||
options?: ConfigFactoryOptions | undefined,
|
||||
) => ServiceFactory<ConfigService, 'root'>;
|
||||
|
||||
// @public (undocumented)
|
||||
export function createConfigSecretEnumerator(options: {
|
||||
logger: LoggerService;
|
||||
@@ -224,7 +213,7 @@ export interface MiddlewareFactoryErrorOptions {
|
||||
// @public
|
||||
export interface MiddlewareFactoryOptions {
|
||||
// (undocumented)
|
||||
config: ConfigService;
|
||||
config: RootConfigService;
|
||||
// (undocumented)
|
||||
logger: LoggerService;
|
||||
}
|
||||
@@ -244,12 +233,23 @@ export function readHelmetOptions(config?: Config): HelmetOptions;
|
||||
// @public
|
||||
export function readHttpServerOptions(config?: Config): HttpServerOptions;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface RootConfigFactoryOptions {
|
||||
argv?: string[];
|
||||
remote?: Pick<RemoteConfigSourceOptions, 'reloadInterval'>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export const rootConfigServiceFactory: (
|
||||
options?: RootConfigFactoryOptions | undefined,
|
||||
) => ServiceFactory<RootConfigService, 'root'>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface RootHttpRouterConfigureContext {
|
||||
// (undocumented)
|
||||
app: Express_2;
|
||||
// (undocumented)
|
||||
config: ConfigService;
|
||||
config: RootConfigService;
|
||||
// (undocumented)
|
||||
lifecycle: LifecycleService;
|
||||
// (undocumented)
|
||||
|
||||
@@ -14,12 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ConfigService } from '@backstage/backend-plugin-api';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { Config, ConfigReader } from '@backstage/config';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
|
||||
export class ObservableConfigProxy implements ConfigService {
|
||||
private config: ConfigService = new ConfigReader({});
|
||||
export class ObservableConfigProxy implements Config {
|
||||
private config: Config = new ConfigReader({});
|
||||
|
||||
private readonly subscribers: (() => void)[] = [];
|
||||
|
||||
@@ -32,7 +31,7 @@ export class ObservableConfigProxy implements ConfigService {
|
||||
}
|
||||
}
|
||||
|
||||
setConfig(config: ConfigService) {
|
||||
setConfig(config: Config) {
|
||||
if (this.parent) {
|
||||
throw new Error('immutable');
|
||||
}
|
||||
@@ -62,9 +61,9 @@ export class ObservableConfigProxy implements ConfigService {
|
||||
};
|
||||
}
|
||||
|
||||
private select(required: true): ConfigService;
|
||||
private select(required: false): ConfigService | undefined;
|
||||
private select(required: boolean): ConfigService | undefined {
|
||||
private select(required: true): Config;
|
||||
private select(required: false): Config | undefined;
|
||||
private select(required: boolean): Config | undefined {
|
||||
if (this.parent && this.parentKey) {
|
||||
if (required) {
|
||||
return this.parent.select(true).getConfig(this.parentKey);
|
||||
@@ -87,19 +86,19 @@ export class ObservableConfigProxy implements ConfigService {
|
||||
getOptional<T = JsonValue>(key?: string): T | undefined {
|
||||
return this.select(false)?.getOptional(key);
|
||||
}
|
||||
getConfig(key: string): ConfigService {
|
||||
getConfig(key: string): Config {
|
||||
return new ObservableConfigProxy(this, key);
|
||||
}
|
||||
getOptionalConfig(key: string): ConfigService | undefined {
|
||||
getOptionalConfig(key: string): Config | undefined {
|
||||
if (this.select(false)?.has(key)) {
|
||||
return new ObservableConfigProxy(this, key);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
getConfigArray(key: string): ConfigService[] {
|
||||
getConfigArray(key: string): Config[] {
|
||||
return this.select(true).getConfigArray(key);
|
||||
}
|
||||
getOptionalConfigArray(key: string): ConfigService[] | undefined {
|
||||
getOptionalConfigArray(key: string): Config[] | undefined {
|
||||
return this.select(false)?.getOptionalConfigArray(key);
|
||||
}
|
||||
getNumber(key: string): number {
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ConfigService, LoggerService } from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
RootConfigService,
|
||||
LoggerService,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import {
|
||||
Request,
|
||||
Response,
|
||||
@@ -47,7 +50,7 @@ import { NotImplementedError } from '@backstage/errors';
|
||||
* @public
|
||||
*/
|
||||
export interface MiddlewareFactoryOptions {
|
||||
config: ConfigService;
|
||||
config: RootConfigService;
|
||||
logger: LoggerService;
|
||||
}
|
||||
|
||||
@@ -78,7 +81,7 @@ export interface MiddlewareFactoryErrorOptions {
|
||||
* @public
|
||||
*/
|
||||
export class MiddlewareFactory {
|
||||
#config: ConfigService;
|
||||
#config: RootConfigService;
|
||||
#logger: LoggerService;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import {
|
||||
export const cacheServiceFactory = createServiceFactory({
|
||||
service: coreServices.cache,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
plugin: coreServices.pluginMetadata,
|
||||
},
|
||||
async createRootContext({ config }) {
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { configServiceFactory } from './configServiceFactory';
|
||||
export type { ConfigFactoryOptions } from './configServiceFactory';
|
||||
export { rootConfigServiceFactory } from './rootConfigServiceFactory';
|
||||
export type { RootConfigFactoryOptions } from './rootConfigServiceFactory';
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@ import {
|
||||
} from '@backstage/config-loader';
|
||||
|
||||
/** @public */
|
||||
export interface ConfigFactoryOptions {
|
||||
export interface RootConfigFactoryOptions {
|
||||
/**
|
||||
* Process arguments to use instead of the default `process.argv()`.
|
||||
*/
|
||||
@@ -37,9 +37,9 @@ export interface ConfigFactoryOptions {
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export const configServiceFactory = createServiceFactory(
|
||||
(options?: ConfigFactoryOptions) => ({
|
||||
service: coreServices.config,
|
||||
export const rootConfigServiceFactory = createServiceFactory(
|
||||
(options?: RootConfigFactoryOptions) => ({
|
||||
service: coreServices.rootConfig,
|
||||
deps: {},
|
||||
async factory() {
|
||||
const source = ConfigSources.default({
|
||||
+1
-1
@@ -25,7 +25,7 @@ import { ConfigReader } from '@backstage/config';
|
||||
export const databaseServiceFactory = createServiceFactory({
|
||||
service: coreServices.database,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
lifecycle: coreServices.lifecycle,
|
||||
pluginMetadata: coreServices.pluginMetadata,
|
||||
},
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import {
|
||||
export const discoveryServiceFactory = createServiceFactory({
|
||||
service: coreServices.discovery,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
},
|
||||
async factory({ config }) {
|
||||
return HostDiscovery.fromConfig(config);
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import { ServerPermissionClient } from '@backstage/plugin-permission-node';
|
||||
export const permissionsServiceFactory = createServiceFactory({
|
||||
service: coreServices.permissions,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
discovery: coreServices.discovery,
|
||||
tokenManager: coreServices.tokenManager,
|
||||
},
|
||||
|
||||
+3
-3
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
ConfigService,
|
||||
RootConfigService,
|
||||
coreServices,
|
||||
createServiceFactory,
|
||||
LifecycleService,
|
||||
@@ -36,7 +36,7 @@ export interface RootHttpRouterConfigureContext {
|
||||
app: Express;
|
||||
middleware: MiddlewareFactory;
|
||||
routes: RequestHandler;
|
||||
config: ConfigService;
|
||||
config: RootConfigService;
|
||||
logger: LoggerService;
|
||||
lifecycle: LifecycleService;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ export const rootHttpRouterServiceFactory = createServiceFactory(
|
||||
(options?: RootHttpRouterFactoryOptions) => ({
|
||||
service: coreServices.rootHttpRouter,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
rootLogger: coreServices.rootLogger,
|
||||
lifecycle: coreServices.rootLifecycle,
|
||||
},
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import { createConfigSecretEnumerator } from '../../../config';
|
||||
export const rootLoggerServiceFactory = createServiceFactory({
|
||||
service: coreServices.rootLogger,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
},
|
||||
async factory({ config }) {
|
||||
const logger = WinstonLogger.create({
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import { ServerTokenManager } from '@backstage/backend-common';
|
||||
export const tokenManagerServiceFactory = createServiceFactory({
|
||||
service: coreServices.tokenManager,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.rootLogger,
|
||||
},
|
||||
createRootContext({ config, logger }) {
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import {
|
||||
export const urlReaderServiceFactory = createServiceFactory({
|
||||
service: coreServices.urlReader,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
},
|
||||
async factory({ config, logger }) {
|
||||
|
||||
@@ -18,7 +18,6 @@ import { CacheService as CacheClient } from '@backstage/backend-plugin-api';
|
||||
import { CacheServiceOptions as CacheClientOptions } from '@backstage/backend-plugin-api';
|
||||
import { CacheServiceSetOptions as CacheClientSetOptions } from '@backstage/backend-plugin-api';
|
||||
import { Config } from '@backstage/config';
|
||||
import { ConfigService } from '@backstage/backend-plugin-api';
|
||||
import cors from 'cors';
|
||||
import Docker from 'dockerode';
|
||||
import { ErrorRequestHandler } from 'express';
|
||||
@@ -51,6 +50,7 @@ import { ReadTreeResponseFile } from '@backstage/backend-plugin-api';
|
||||
import { ReadUrlOptions } from '@backstage/backend-plugin-api';
|
||||
import { ReadUrlResponse } from '@backstage/backend-plugin-api';
|
||||
import { RequestHandler } from 'express';
|
||||
import { RootConfigService } from '@backstage/backend-plugin-api';
|
||||
import { Router } from 'express';
|
||||
import { SchedulerService } from '@backstage/backend-plugin-api';
|
||||
import { SearchOptions } from '@backstage/backend-plugin-api';
|
||||
@@ -525,7 +525,7 @@ export const legacyPlugin: (
|
||||
TransformedEnv<
|
||||
{
|
||||
cache: CacheClient;
|
||||
config: ConfigService;
|
||||
config: RootConfigService;
|
||||
database: PluginDatabaseManager;
|
||||
discovery: PluginEndpointDiscovery;
|
||||
logger: LoggerService;
|
||||
|
||||
@@ -108,7 +108,7 @@ export function makeLegacyPlugin<
|
||||
export const legacyPlugin = makeLegacyPlugin(
|
||||
{
|
||||
cache: coreServices.cache,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
database: coreServices.database,
|
||||
discovery: coreServices.discovery,
|
||||
logger: coreServices.logger,
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import {
|
||||
Backend,
|
||||
cacheServiceFactory,
|
||||
configServiceFactory,
|
||||
rootConfigServiceFactory,
|
||||
createSpecializedBackend,
|
||||
databaseServiceFactory,
|
||||
discoveryServiceFactory,
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
|
||||
export const defaultServiceFactories = [
|
||||
cacheServiceFactory(),
|
||||
configServiceFactory(),
|
||||
rootConfigServiceFactory(),
|
||||
databaseServiceFactory(),
|
||||
discoveryServiceFactory(),
|
||||
httpRouterServiceFactory(),
|
||||
|
||||
@@ -93,13 +93,10 @@ export type CacheServiceSetOptions = {
|
||||
ttl?: number;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ConfigService extends Config {}
|
||||
|
||||
// @public
|
||||
export namespace coreServices {
|
||||
const cache: ServiceRef<CacheService, 'plugin'>;
|
||||
const config: ServiceRef<ConfigService, 'root'>;
|
||||
const rootConfig: ServiceRef<RootConfigService, 'root'>;
|
||||
const database: ServiceRef<DatabaseService, 'plugin'>;
|
||||
const discovery: ServiceRef<DiscoveryService, 'plugin'>;
|
||||
const httpRouter: ServiceRef<HttpRouterService, 'plugin'>;
|
||||
@@ -380,6 +377,9 @@ export type ReadUrlResponse = {
|
||||
lastModifiedAt?: Date;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export interface RootConfigService extends Config {}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface RootHttpRouterService {
|
||||
use(path: string, handler: Handler): void;
|
||||
|
||||
+1
-1
@@ -19,4 +19,4 @@ import { Config } from '@backstage/config';
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ConfigService extends Config {}
|
||||
export interface RootConfigService extends Config {}
|
||||
@@ -32,13 +32,13 @@ export namespace coreServices {
|
||||
});
|
||||
|
||||
/**
|
||||
* The service reference for the root scoped {@link ConfigService}.
|
||||
* The service reference for the root scoped {@link RootConfigService}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const config = createServiceRef<
|
||||
import('./ConfigService').ConfigService
|
||||
>({ id: 'core.config', scope: 'root' });
|
||||
export const rootConfig = createServiceRef<
|
||||
import('./RootConfigService').RootConfigService
|
||||
>({ id: 'core.rootConfig', scope: 'root' });
|
||||
|
||||
/**
|
||||
* The service reference for the plugin scoped {@link DatabaseService}.
|
||||
|
||||
@@ -20,7 +20,7 @@ export type {
|
||||
CacheServiceOptions,
|
||||
CacheServiceSetOptions,
|
||||
} from './CacheService';
|
||||
export type { ConfigService } from './ConfigService';
|
||||
export type { RootConfigService } from './RootConfigService';
|
||||
export type { DatabaseService } from './DatabaseService';
|
||||
export type { DiscoveryService } from './DiscoveryService';
|
||||
export type { HttpRouterService } from './HttpRouterService';
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
import { Backend } from '@backstage/backend-app-api';
|
||||
import { BackendFeature } from '@backstage/backend-plugin-api';
|
||||
import { CacheService } from '@backstage/backend-plugin-api';
|
||||
import { ConfigService } from '@backstage/backend-plugin-api';
|
||||
import { DatabaseService } from '@backstage/backend-plugin-api';
|
||||
import { ExtendedHttpServer } from '@backstage/backend-app-api';
|
||||
import { ExtensionPoint } from '@backstage/backend-plugin-api';
|
||||
@@ -18,6 +17,7 @@ import { Knex } from 'knex';
|
||||
import { LifecycleService } from '@backstage/backend-plugin-api';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { PermissionsService } from '@backstage/backend-plugin-api';
|
||||
import { RootConfigService } from '@backstage/backend-plugin-api';
|
||||
import { RootLifecycleService } from '@backstage/backend-plugin-api';
|
||||
import { SchedulerService } from '@backstage/backend-plugin-api';
|
||||
import { ServiceFactory } from '@backstage/backend-plugin-api';
|
||||
@@ -36,19 +36,6 @@ export namespace mockServices {
|
||||
factory: () => ServiceFactory<CacheService, 'plugin'>;
|
||||
}
|
||||
// (undocumented)
|
||||
export function config(options?: config.Options): ConfigService;
|
||||
// (undocumented)
|
||||
export namespace config {
|
||||
// (undocumented)
|
||||
export type Options = {
|
||||
data?: JsonObject;
|
||||
};
|
||||
const // (undocumented)
|
||||
factory: (
|
||||
options?: Options | undefined,
|
||||
) => ServiceFactory<ConfigService, 'root'>;
|
||||
}
|
||||
// (undocumented)
|
||||
export namespace database {
|
||||
const // (undocumented)
|
||||
factory: () => ServiceFactory<DatabaseService, 'plugin'>;
|
||||
@@ -83,6 +70,19 @@ export namespace mockServices {
|
||||
factory: () => ServiceFactory<PermissionsService, 'plugin'>;
|
||||
}
|
||||
// (undocumented)
|
||||
export function rootConfig(options?: rootConfig.Options): RootConfigService;
|
||||
// (undocumented)
|
||||
export namespace rootConfig {
|
||||
// (undocumented)
|
||||
export type Options = {
|
||||
data?: JsonObject;
|
||||
};
|
||||
const // (undocumented)
|
||||
factory: (
|
||||
options?: Options | undefined,
|
||||
) => ServiceFactory<RootConfigService, 'root'>;
|
||||
}
|
||||
// (undocumented)
|
||||
export namespace rootLifecycle {
|
||||
const // (undocumented)
|
||||
factory: () => ServiceFactory<RootLifecycleService, 'root'>;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
ConfigService,
|
||||
RootConfigService,
|
||||
coreServices,
|
||||
createServiceFactory,
|
||||
IdentityService,
|
||||
@@ -61,13 +61,13 @@ function simpleFactory<
|
||||
* @public
|
||||
*/
|
||||
export namespace mockServices {
|
||||
export function config(options?: config.Options): ConfigService {
|
||||
export function rootConfig(options?: rootConfig.Options): RootConfigService {
|
||||
return new ConfigReader(options?.data, 'mock-config');
|
||||
}
|
||||
export namespace config {
|
||||
export namespace rootConfig {
|
||||
export type Options = { data?: JsonObject };
|
||||
|
||||
export const factory = simpleFactory(coreServices.config, config);
|
||||
export const factory = simpleFactory(coreServices.rootConfig, rootConfig);
|
||||
}
|
||||
|
||||
export function rootLogger(options?: rootLogger.Options): LoggerService {
|
||||
|
||||
@@ -168,7 +168,7 @@ describe('TestBackend', () => {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
cache: coreServices.cache,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
database: coreServices.database,
|
||||
discovery: coreServices.discovery,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
|
||||
@@ -73,7 +73,7 @@ export interface TestBackend extends Backend {
|
||||
|
||||
const defaultServiceFactories = [
|
||||
mockServices.cache.factory(),
|
||||
mockServices.config.factory(),
|
||||
mockServices.rootConfig.factory(),
|
||||
mockServices.database.factory(),
|
||||
mockServices.httpRouter.factory(),
|
||||
mockServices.identity.factory(),
|
||||
@@ -108,7 +108,7 @@ export async function startTestBackend<
|
||||
const rootHttpRouterFactory = createServiceFactory({
|
||||
service: coreServices.rootHttpRouter,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
lifecycle: coreServices.rootLifecycle,
|
||||
rootLogger: coreServices.rootLogger,
|
||||
},
|
||||
|
||||
@@ -32,7 +32,7 @@ export const airbrakePlugin = createBackendPlugin({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
},
|
||||
|
||||
@@ -76,7 +76,7 @@ export const appPlugin = createBackendPlugin((options: AppPluginOptions) => ({
|
||||
env.registerInit({
|
||||
deps: {
|
||||
logger: coreServices.logger,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
database: coreServices.database,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@ export const azureDevOpsPlugin = createBackendPlugin({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
reader: coreServices.urlReader,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
|
||||
@@ -31,7 +31,7 @@ export const badgesPlugin = createBackendPlugin({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
discovery: coreServices.discovery,
|
||||
tokenManager: coreServices.tokenManager,
|
||||
|
||||
@@ -31,7 +31,7 @@ export const bazaarPlugin = createBackendPlugin({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
database: coreServices.database,
|
||||
identity: coreServices.identity,
|
||||
logger: coreServices.logger,
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ describe('catalogModuleAwsS3EntityProvider', () => {
|
||||
await startTestBackend({
|
||||
extensionPoints: [[catalogProcessingExtensionPoint, extensionPoint]],
|
||||
services: [
|
||||
[coreServices.config, config],
|
||||
[coreServices.rootConfig, config],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
[coreServices.scheduler, scheduler],
|
||||
],
|
||||
|
||||
@@ -33,7 +33,7 @@ export const catalogModuleAwsS3EntityProvider = createBackendModule({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ describe('catalogModuleAzureDevOpsEntityProvider', () => {
|
||||
await startTestBackend({
|
||||
extensionPoints: [[catalogProcessingExtensionPoint, extensionPoint]],
|
||||
services: [
|
||||
[coreServices.config, config],
|
||||
[coreServices.rootConfig, config],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
[coreServices.scheduler, scheduler],
|
||||
],
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ export const catalogModuleAzureDevOpsEntityProvider = createBackendModule({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ describe('catalogModuleBitbucketCloudEntityProvider', () => {
|
||||
[eventsExtensionPoint, eventsExtensionPointImpl],
|
||||
],
|
||||
services: [
|
||||
mockServices.config.factory({
|
||||
mockServices.rootConfig.factory({
|
||||
data: {
|
||||
catalog: {
|
||||
providers: {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ export const catalogModuleBitbucketCloudEntityProvider = createBackendModule({
|
||||
deps: {
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
catalogApi: catalogServiceRef,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
// TODO(pjungermann): How to make this optional for those which only want the provider without event support?
|
||||
// Do we even want to support this?
|
||||
events: eventsExtensionPoint,
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ describe('catalogModuleBitbucketServerEntityProvider', () => {
|
||||
await startTestBackend({
|
||||
extensionPoints: [[catalogProcessingExtensionPoint, extensionPoint]],
|
||||
services: [
|
||||
[coreServices.config, config],
|
||||
[coreServices.rootConfig, config],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
[coreServices.scheduler, scheduler],
|
||||
],
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ export const catalogModuleBitbucketServerEntityProvider = createBackendModule({
|
||||
env.registerInit({
|
||||
deps: {
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
},
|
||||
|
||||
@@ -33,7 +33,7 @@ export const catalogModuleGcpGkeEntityProvider = createBackendModule({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ describe('catalogModuleGerritEntityProvider', () => {
|
||||
await startTestBackend({
|
||||
extensionPoints: [[catalogProcessingExtensionPoint, extensionPoint]],
|
||||
services: [
|
||||
[coreServices.config, config],
|
||||
[coreServices.rootConfig, config],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
[coreServices.scheduler, scheduler],
|
||||
],
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ export const catalogModuleGerritEntityProvider = createBackendModule({
|
||||
env.registerInit({
|
||||
deps: {
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
},
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ describe('catalogModuleGithubEntityProvider', () => {
|
||||
await startTestBackend({
|
||||
extensionPoints: [[catalogProcessingExtensionPoint, extensionPoint]],
|
||||
services: [
|
||||
[coreServices.config, config],
|
||||
[coreServices.rootConfig, config],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
[coreServices.scheduler, scheduler],
|
||||
],
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ export const catalogModuleGithubEntityProvider = createBackendModule({
|
||||
env.registerInit({
|
||||
deps: {
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
},
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ describe('catalogModuleGitlabDiscoveryEntityProvider', () => {
|
||||
await startTestBackend({
|
||||
extensionPoints: [[catalogProcessingExtensionPoint, extensionPoint]],
|
||||
services: [
|
||||
[coreServices.config, config],
|
||||
[coreServices.rootConfig, config],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
[coreServices.scheduler, scheduler],
|
||||
],
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ export const catalogModuleGitlabDiscoveryEntityProvider = createBackendModule({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
ConfigService,
|
||||
RootConfigService,
|
||||
LoggerService,
|
||||
SchedulerService,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
@@ -49,7 +49,7 @@ export class WrapperProviders {
|
||||
|
||||
constructor(
|
||||
private readonly options: {
|
||||
config: ConfigService;
|
||||
config: RootConfigService;
|
||||
logger: LoggerService;
|
||||
client: Knex;
|
||||
scheduler: SchedulerService;
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ describe('catalogModuleIncrementalIngestionEntityProvider', () => {
|
||||
[catalogProcessingExtensionPoint, { addEntityProvider }],
|
||||
],
|
||||
services: [
|
||||
[coreServices.config, new ConfigReader({})],
|
||||
[coreServices.rootConfig, new ConfigReader({})],
|
||||
[coreServices.database, database],
|
||||
[coreServices.httpRouter, httpRouter],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ export const catalogModuleIncrementalIngestionEntityProvider =
|
||||
env.registerInit({
|
||||
deps: {
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
database: coreServices.database,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
logger: coreServices.logger,
|
||||
|
||||
@@ -54,7 +54,7 @@ async function main() {
|
||||
const backend = createBackend({
|
||||
services: [
|
||||
createServiceFactory({
|
||||
service: coreServices.config,
|
||||
service: coreServices.rootConfig,
|
||||
deps: {},
|
||||
factory: () => new ConfigReader(config),
|
||||
}),
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ describe('catalogModuleMicrosoftGraphOrgEntityProvider', () => {
|
||||
await startTestBackend({
|
||||
extensionPoints: [[catalogProcessingExtensionPoint, extensionPoint]],
|
||||
services: [
|
||||
[coreServices.config, config],
|
||||
[coreServices.rootConfig, config],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
[coreServices.scheduler, scheduler],
|
||||
],
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ export const catalogModuleMicrosoftGraphOrgEntityProvider = createBackendModule(
|
||||
env.registerInit({
|
||||
deps: {
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
},
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ describe('catalogModulePuppetDbEntityProvider', () => {
|
||||
await startTestBackend({
|
||||
extensionPoints: [[catalogProcessingExtensionPoint, extensionPoint]],
|
||||
services: [
|
||||
[coreServices.config, config],
|
||||
[coreServices.rootConfig, config],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
[coreServices.scheduler, scheduler],
|
||||
],
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ export const catalogModulePuppetDbEntityProvider = createBackendModule({
|
||||
env.registerInit({
|
||||
deps: {
|
||||
catalog: catalogProcessingExtensionPoint,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
},
|
||||
|
||||
@@ -84,7 +84,7 @@ export const catalogPlugin = createBackendPlugin({
|
||||
env.registerInit({
|
||||
deps: {
|
||||
logger: coreServices.logger,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
reader: coreServices.urlReader,
|
||||
permissions: coreServices.permissions,
|
||||
database: coreServices.database,
|
||||
|
||||
@@ -31,7 +31,7 @@ export const devtoolsPlugin = createBackendPlugin({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
permissions: coreServices.permissions,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ describe('eventsModuleAwsSqsConsumingEventPublisher', () => {
|
||||
await startTestBackend({
|
||||
extensionPoints: [[eventsExtensionPoint, extensionPoint]],
|
||||
services: [
|
||||
[coreServices.config, config],
|
||||
[coreServices.rootConfig, config],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
[coreServices.scheduler, scheduler],
|
||||
],
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ export const eventsModuleAwsSqsConsumingEventPublisher = createBackendModule({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
events: eventsExtensionPoint,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
|
||||
@@ -59,7 +59,7 @@ describe('eventsModuleGithubWebhook', () => {
|
||||
|
||||
await startTestBackend({
|
||||
extensionPoints: [[eventsExtensionPoint, extensionPoint]],
|
||||
services: [[coreServices.config, config]],
|
||||
services: [[coreServices.rootConfig, config]],
|
||||
features: [eventsModuleGithubWebhook()],
|
||||
});
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export const eventsModuleGithubWebhook = createBackendModule({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
events: eventsExtensionPoint,
|
||||
},
|
||||
async init({ config, events }) {
|
||||
|
||||
@@ -54,7 +54,7 @@ describe('gitlabWebhookEventsModule', () => {
|
||||
|
||||
await startTestBackend({
|
||||
extensionPoints: [[eventsExtensionPoint, extensionPoint]],
|
||||
services: [[coreServices.config, config]],
|
||||
services: [[coreServices.rootConfig, config]],
|
||||
features: [eventsModuleGitlabWebhook()],
|
||||
});
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ export const eventsModuleGitlabWebhook = createBackendModule({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
events: eventsExtensionPoint,
|
||||
},
|
||||
async init({ config, events }) {
|
||||
|
||||
@@ -71,7 +71,7 @@ describe('eventPlugin', () => {
|
||||
await startTestBackend({
|
||||
extensionPoints: [],
|
||||
services: [
|
||||
[coreServices.config, config],
|
||||
[coreServices.rootConfig, config],
|
||||
[coreServices.httpRouter, httpRouter],
|
||||
[coreServices.logger, getVoidLogger()],
|
||||
],
|
||||
|
||||
@@ -89,7 +89,7 @@ export const eventsPlugin = createBackendPlugin({
|
||||
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
router: coreServices.httpRouter,
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@ export const kafkaPlugin = createBackendPlugin({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
},
|
||||
|
||||
@@ -34,7 +34,7 @@ export const kubernetesPlugin = createBackendPlugin({
|
||||
deps: {
|
||||
http: coreServices.httpRouter,
|
||||
logger: coreServices.logger,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
catalogApi: catalogServiceRef,
|
||||
permissions: coreServices.permissions,
|
||||
},
|
||||
|
||||
@@ -34,7 +34,7 @@ export const lighthousePlugin = createBackendPlugin({
|
||||
env.registerInit({
|
||||
deps: {
|
||||
catalogClient: catalogServiceRef,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
scheduler: coreServices.scheduler,
|
||||
tokenManager: coreServices.tokenManager,
|
||||
|
||||
@@ -31,7 +31,7 @@ export const periskopPlugin = createBackendPlugin({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
},
|
||||
|
||||
@@ -90,7 +90,7 @@ export const permissionPlugin = createBackendPlugin(() => ({
|
||||
env.registerInit({
|
||||
deps: {
|
||||
http: coreServices.httpRouter,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
discovery: coreServices.discovery,
|
||||
identity: coreServices.identity,
|
||||
|
||||
@@ -35,7 +35,7 @@ export const proxyPlugin = createBackendPlugin(
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
discovery: coreServices.discovery,
|
||||
logger: coreServices.logger,
|
||||
httpRouter: coreServices.httpRouter,
|
||||
|
||||
@@ -80,7 +80,7 @@ export const scaffolderPlugin = createBackendPlugin(
|
||||
env.registerInit({
|
||||
deps: {
|
||||
logger: coreServices.logger,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
reader: coreServices.urlReader,
|
||||
permissions: coreServices.permissions,
|
||||
database: coreServices.database,
|
||||
|
||||
@@ -53,7 +53,7 @@ export const searchModuleCatalogCollator = createBackendModule(
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
discovery: coreServices.discovery,
|
||||
tokenManager: coreServices.tokenManager,
|
||||
scheduler: coreServices.scheduler,
|
||||
|
||||
@@ -48,7 +48,7 @@ export const searchModuleElasticsearchEngine = createBackendModule(
|
||||
deps: {
|
||||
searchEngineRegistry: searchEngineRegistryExtensionPoint,
|
||||
logger: coreServices.logger,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
},
|
||||
async init({ searchEngineRegistry, logger, config }) {
|
||||
const searchEngine = await ElasticSearchSearchEngine.fromConfig({
|
||||
|
||||
@@ -54,7 +54,7 @@ export const searchModuleExploreCollator = createBackendModule(
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
discovery: coreServices.discovery,
|
||||
scheduler: coreServices.scheduler,
|
||||
|
||||
@@ -32,7 +32,7 @@ export const searchModulePostgresEngine = createBackendModule({
|
||||
deps: {
|
||||
searchEngineRegistry: searchEngineRegistryExtensionPoint,
|
||||
database: coreServices.database,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
},
|
||||
async init({ searchEngineRegistry, database, config }) {
|
||||
searchEngineRegistry.setSearchEngine(
|
||||
|
||||
@@ -54,7 +54,7 @@ export const searchModuleTechDocsCollator = createBackendModule(
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
discovery: coreServices.discovery,
|
||||
tokenManager: coreServices.tokenManager,
|
||||
|
||||
@@ -93,7 +93,7 @@ export const searchPlugin = createBackendPlugin({
|
||||
env.registerInit({
|
||||
deps: {
|
||||
logger: coreServices.logger,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
permissions: coreServices.permissions,
|
||||
http: coreServices.httpRouter,
|
||||
searchIndexService: searchIndexServiceRef,
|
||||
|
||||
@@ -41,7 +41,7 @@ export const techdocsPlugin = createBackendPlugin({
|
||||
register(env) {
|
||||
env.registerInit({
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
urlReader: coreServices.urlReader,
|
||||
http: coreServices.httpRouter,
|
||||
|
||||
@@ -183,7 +183,7 @@ export const todoReaderServiceRef = createServiceRef<TodoReader>({
|
||||
service,
|
||||
deps: {
|
||||
reader: coreServices.urlReader,
|
||||
config: coreServices.config,
|
||||
config: coreServices.rootConfig,
|
||||
logger: coreServices.logger,
|
||||
},
|
||||
factory: async ({ reader, config, logger }) => {
|
||||
|
||||
Reference in New Issue
Block a user