add missing docstrings
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
committed by
Patrik Oldsberg
parent
4ba38d1f27
commit
9d9b7f7709
@@ -17,6 +17,9 @@
|
||||
import { createServiceRef } from '../system/types';
|
||||
import { PluginCacheManager } from '@backstage/backend-common';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const cacheServiceRef = createServiceRef<PluginCacheManager>({
|
||||
id: 'core.cache',
|
||||
});
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
import { Config } from '@backstage/config';
|
||||
import { createServiceRef } from '../system/types';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const configServiceRef = createServiceRef<Config>({
|
||||
id: 'core.config',
|
||||
});
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
import { PluginDatabaseManager } from '@backstage/backend-common';
|
||||
import { createServiceRef } from '../system/types';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const databaseServiceRef = createServiceRef<PluginDatabaseManager>({
|
||||
id: 'core.database',
|
||||
});
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
import { createServiceRef } from '../system/types';
|
||||
import { PluginEndpointDiscovery } from '@backstage/backend-common';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const discoveryServiceRef = createServiceRef<PluginEndpointDiscovery>({
|
||||
id: 'core.discovery',
|
||||
});
|
||||
|
||||
@@ -17,28 +17,16 @@
|
||||
import { createServiceRef } from '../system/types';
|
||||
import { Handler } from 'express';
|
||||
|
||||
// const apiRouter = Router();
|
||||
// apiRouter.use('/catalog', await catalog(catalogEnv));
|
||||
// const service = createServiceBuilder(module)
|
||||
// .loadConfig(config)
|
||||
// .addRouter('', await healthcheck(healthcheckEnv))
|
||||
// .addRouter('', metricsHandler())
|
||||
// .addRouter('/api', apiRouter)
|
||||
// .addRouter('', await app(appEnv));
|
||||
|
||||
// interface BackstageRequest extends Request {
|
||||
// identity?: BackstageIdentity;
|
||||
// context?: Context;
|
||||
// }
|
||||
|
||||
// interface RequestIdentityService {
|
||||
// getRequestIdentity(req: Request): BackstageIdentity | undefined;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface HttpRouterService {
|
||||
use(handler: Handler): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const httpRouterServiceRef = createServiceRef<HttpRouterService>({
|
||||
id: 'core.httpRouter',
|
||||
});
|
||||
|
||||
@@ -14,18 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// export type PluginEnvironment = {
|
||||
// logger: Logger;
|
||||
// cache: PluginCacheManager;
|
||||
// database: PluginDatabaseManager;
|
||||
// config: Config;
|
||||
// reader: UrlReader;
|
||||
// discovery: PluginEndpointDiscovery;
|
||||
// tokenManager: TokenManager;
|
||||
// permissions: PermissionEvaluator | PermissionAuthorizer;
|
||||
// scheduler: PluginTaskScheduler;
|
||||
// };
|
||||
|
||||
export { configServiceRef } from './configServiceRef';
|
||||
export { httpRouterServiceRef } from './httpRouterServiceRef';
|
||||
export type { HttpRouterService } from './httpRouterServiceRef';
|
||||
|
||||
@@ -16,11 +16,17 @@
|
||||
|
||||
import { createServiceRef } from '../system/types';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface Logger {
|
||||
info(message: string): void;
|
||||
child(fields: { [name: string]: string }): Logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const loggerServiceRef = createServiceRef<Logger>({
|
||||
id: 'core.logger',
|
||||
});
|
||||
|
||||
@@ -20,6 +20,9 @@ import {
|
||||
PermissionEvaluator,
|
||||
} from '@backstage/plugin-permission-common';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const permissionsServiceRef = createServiceRef<
|
||||
PermissionEvaluator | PermissionAuthorizer
|
||||
>({
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
import { createServiceRef } from '../system/types';
|
||||
import { PluginTaskScheduler } from '@backstage/backend-tasks';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const schedulerServiceRef = createServiceRef<PluginTaskScheduler>({
|
||||
id: 'core.scheduler',
|
||||
});
|
||||
|
||||
@@ -20,6 +20,9 @@ import {
|
||||
PermissionEvaluator,
|
||||
} from '@backstage/plugin-permission-common';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const permissionsServiceRef = createServiceRef<
|
||||
PermissionEvaluator | PermissionAuthorizer
|
||||
>({
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
import { createServiceRef } from '../system/types';
|
||||
import { TokenManager } from '@backstage/backend-common';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const tokenManagerServiceRef = createServiceRef<TokenManager>({
|
||||
id: 'core.tokenManager',
|
||||
});
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
import { createServiceRef } from '../system/types';
|
||||
import { UrlReader } from '@backstage/backend-common';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const urlReaderServiceRef = createServiceRef<UrlReader>({
|
||||
id: 'core.urlReader',
|
||||
});
|
||||
|
||||
@@ -56,6 +56,9 @@ export type AnyServiceFactory = ServiceFactory<
|
||||
{ [key in string]: unknown }
|
||||
>;
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export function createServiceRef<T>(options: { id: string }): ServiceRef<T> {
|
||||
return {
|
||||
id: options.id,
|
||||
@@ -69,6 +72,9 @@ export function createServiceRef<T>(options: { id: string }): ServiceRef<T> {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export function createServiceFactory<
|
||||
Api,
|
||||
Impl extends Api,
|
||||
|
||||
Reference in New Issue
Block a user