+1
-1
@@ -21,7 +21,7 @@ import {
|
||||
} from '@backstage/backend-plugin-api';
|
||||
|
||||
/** @public */
|
||||
export const cacheFactory = createServiceFactory({
|
||||
export const cacheServiceFactory = createServiceFactory({
|
||||
service: coreServices.cache,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { cacheFactory } from './cacheFactory';
|
||||
export { cacheServiceFactory } from './cacheServiceFactory';
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ export interface ConfigFactoryOptions {
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export const configFactory = createServiceFactory(
|
||||
export const configServiceFactory = createServiceFactory(
|
||||
(options?: ConfigFactoryOptions) => ({
|
||||
service: coreServices.config,
|
||||
deps: {},
|
||||
@@ -14,5 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { configFactory } from './configFactory';
|
||||
export type { ConfigFactoryOptions } from './configFactory';
|
||||
export { configServiceFactory } from './configServiceFactory';
|
||||
export type { ConfigFactoryOptions } from './configServiceFactory';
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import {
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
|
||||
/** @public */
|
||||
export const databaseFactory = createServiceFactory({
|
||||
export const databaseServiceFactory = createServiceFactory({
|
||||
service: coreServices.database,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { databaseFactory } from './databaseFactory';
|
||||
export { databaseServiceFactory } from './databaseServiceFactory';
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import {
|
||||
} from '@backstage/backend-plugin-api';
|
||||
|
||||
/** @public */
|
||||
export const discoveryFactory = createServiceFactory({
|
||||
export const discoveryServiceFactory = createServiceFactory({
|
||||
service: coreServices.discovery,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { discoveryFactory } from './discoveryFactory';
|
||||
export { discoveryServiceFactory } from './discoveryServiceFactory';
|
||||
|
||||
+3
-3
@@ -18,12 +18,12 @@ import {
|
||||
HttpRouterService,
|
||||
ServiceFactory,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { httpRouterFactory } from './httpRouterFactory';
|
||||
import { httpRouterServiceFactory } from './httpRouterServiceFactory';
|
||||
|
||||
describe('httpRouterFactory', () => {
|
||||
it('should register plugin paths', async () => {
|
||||
const rootHttpRouter = { use: jest.fn() };
|
||||
const factory = httpRouterFactory() as Exclude<
|
||||
const factory = httpRouterServiceFactory() as Exclude<
|
||||
ServiceFactory<HttpRouterService>,
|
||||
{ scope: 'root' }
|
||||
>;
|
||||
@@ -55,7 +55,7 @@ describe('httpRouterFactory', () => {
|
||||
|
||||
it('should use custom path generator', async () => {
|
||||
const rootHttpRouter = { use: jest.fn() };
|
||||
const factory = httpRouterFactory({
|
||||
const factory = httpRouterServiceFactory({
|
||||
getPath: id => `/some/${id}/path`,
|
||||
}) as Exclude<ServiceFactory<HttpRouterService>, { scope: 'root' }>;
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ export interface HttpRouterFactoryOptions {
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export const httpRouterFactory = createServiceFactory(
|
||||
export const httpRouterServiceFactory = createServiceFactory(
|
||||
(options?: HttpRouterFactoryOptions) => ({
|
||||
service: coreServices.httpRouter,
|
||||
deps: {
|
||||
@@ -14,5 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { httpRouterFactory } from './httpRouterFactory';
|
||||
export type { HttpRouterFactoryOptions } from './httpRouterFactory';
|
||||
export { httpRouterServiceFactory } from './httpRouterServiceFactory';
|
||||
export type { HttpRouterFactoryOptions } from './httpRouterServiceFactory';
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ export type IdentityFactoryOptions = {
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export const identityFactory = createServiceFactory(
|
||||
export const identityServiceFactory = createServiceFactory(
|
||||
(options?: IdentityFactoryOptions) => ({
|
||||
service: coreServices.identity,
|
||||
deps: {
|
||||
@@ -14,5 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { identityFactory } from './identityFactory';
|
||||
export type { IdentityFactoryOptions } from './identityFactory';
|
||||
export { identityServiceFactory } from './identityServiceFactory';
|
||||
export type { IdentityFactoryOptions } from './identityServiceFactory';
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { lifecycleFactory } from './lifecycleFactory';
|
||||
export { lifecycleServiceFactory } from './lifecycleServiceFactory';
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import {
|
||||
* Allows plugins to register shutdown hooks that are run when the process is about to exit.
|
||||
* @public
|
||||
*/
|
||||
export const lifecycleFactory = createServiceFactory({
|
||||
export const lifecycleServiceFactory = createServiceFactory({
|
||||
service: coreServices.lifecycle,
|
||||
deps: {
|
||||
logger: coreServices.logger,
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { loggerFactory } from './loggerFactory';
|
||||
export { loggerServiceFactory } from './loggerServiceFactory';
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import {
|
||||
} from '@backstage/backend-plugin-api';
|
||||
|
||||
/** @public */
|
||||
export const loggerFactory = createServiceFactory({
|
||||
export const loggerServiceFactory = createServiceFactory({
|
||||
service: coreServices.logger,
|
||||
deps: {
|
||||
rootLogger: coreServices.rootLogger,
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { permissionsFactory } from './permissionsFactory';
|
||||
export { permissionsServiceFactory } from './permissionsServiceFactory';
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import {
|
||||
import { ServerPermissionClient } from '@backstage/plugin-permission-node';
|
||||
|
||||
/** @public */
|
||||
export const permissionsFactory = createServiceFactory({
|
||||
export const permissionsServiceFactory = createServiceFactory({
|
||||
service: coreServices.permissions,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
|
||||
export {
|
||||
rootHttpRouterFactory,
|
||||
rootHttpRouterServiceFactory,
|
||||
type RootHttpRouterFactoryOptions,
|
||||
type RootHttpRouterConfigureOptions,
|
||||
} from './rootHttpRouterFactory';
|
||||
} from './rootHttpRouterServiceFactory';
|
||||
export {
|
||||
DefaultRootHttpRouter,
|
||||
type DefaultRootHttpRouterOptions,
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ function defaultConfigure({
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export const rootHttpRouterFactory = createServiceFactory(
|
||||
export const rootHttpRouterServiceFactory = createServiceFactory(
|
||||
(options?: RootHttpRouterFactoryOptions) => ({
|
||||
service: coreServices.rootHttpRouter,
|
||||
deps: {
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { rootLifecycleFactory } from './rootLifecycleFactory';
|
||||
export { rootLifecycleServiceFactory } from './rootLifecycleServiceFactory';
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { getVoidLogger } from '@backstage/backend-common';
|
||||
import { BackendLifecycleImpl } from './rootLifecycleFactory';
|
||||
import { BackendLifecycleImpl } from './rootLifecycleServiceFactory';
|
||||
|
||||
describe('lifecycleService', () => {
|
||||
it('should execute registered shutdown hook', async () => {
|
||||
+1
-1
@@ -65,7 +65,7 @@ export class BackendLifecycleImpl implements RootLifecycleService {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const rootLifecycleFactory = createServiceFactory({
|
||||
export const rootLifecycleServiceFactory = createServiceFactory({
|
||||
service: coreServices.rootLifecycle,
|
||||
deps: {
|
||||
logger: coreServices.rootLogger,
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { rootLoggerFactory } from './rootLoggerFactory';
|
||||
export { rootLoggerServiceFactory } from './rootLoggerServiceFactory';
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import { transports, format } from 'winston';
|
||||
import { createConfigSecretEnumerator } from '../../../config';
|
||||
|
||||
/** @public */
|
||||
export const rootLoggerFactory = createServiceFactory({
|
||||
export const rootLoggerServiceFactory = createServiceFactory({
|
||||
service: coreServices.rootLogger,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { schedulerFactory } from './schedulerFactory';
|
||||
export { schedulerServiceFactory } from './schedulerServiceFactory';
|
||||
|
||||
+2
-2
@@ -19,13 +19,13 @@ import {
|
||||
createBackendPlugin,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { startTestBackend } from '@backstage/backend-test-utils';
|
||||
import { schedulerFactory } from './schedulerFactory';
|
||||
import { schedulerServiceFactory } from './schedulerServiceFactory';
|
||||
|
||||
describe('schedulerFactory', () => {
|
||||
it('creates sidecar database features', async () => {
|
||||
expect.assertions(3);
|
||||
|
||||
const subject = schedulerFactory();
|
||||
const subject = schedulerServiceFactory();
|
||||
|
||||
const plugin = createBackendPlugin({
|
||||
pluginId: 'example',
|
||||
+1
-1
@@ -22,7 +22,7 @@ import {
|
||||
import { TaskScheduler } from '@backstage/backend-tasks';
|
||||
|
||||
/** @public */
|
||||
export const schedulerFactory = createServiceFactory({
|
||||
export const schedulerServiceFactory = createServiceFactory({
|
||||
service: coreServices.scheduler,
|
||||
deps: {
|
||||
plugin: coreServices.pluginMetadata,
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { tokenManagerFactory } from './tokenManagerFactory';
|
||||
export { tokenManagerServiceFactory } from './tokenManagerServiceFactory';
|
||||
|
||||
+2
-2
@@ -20,13 +20,13 @@ import {
|
||||
TokenManagerService,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { tokenManagerFactory } from './tokenManagerFactory';
|
||||
import { tokenManagerServiceFactory } from './tokenManagerServiceFactory';
|
||||
|
||||
describe('tokenManagerFactory', () => {
|
||||
it('should create managers that can share tokens in development', async () => {
|
||||
(process.env as { NODE_ENV?: string }).NODE_ENV = 'development';
|
||||
|
||||
const factory = tokenManagerFactory() as Exclude<
|
||||
const factory = tokenManagerServiceFactory() as Exclude<
|
||||
ServiceFactory<TokenManagerService>,
|
||||
{ scope: 'root' }
|
||||
>;
|
||||
+1
-1
@@ -21,7 +21,7 @@ import {
|
||||
import { ServerTokenManager } from '@backstage/backend-common';
|
||||
|
||||
/** @public */
|
||||
export const tokenManagerFactory = createServiceFactory({
|
||||
export const tokenManagerServiceFactory = createServiceFactory({
|
||||
service: coreServices.tokenManager,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { urlReaderFactory } from './urlReaderFactory';
|
||||
export { urlReaderServiceFactory } from './urlReaderServiceFactory';
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import {
|
||||
} from '@backstage/backend-plugin-api';
|
||||
|
||||
/** @public */
|
||||
export const urlReaderFactory = createServiceFactory({
|
||||
export const urlReaderServiceFactory = createServiceFactory({
|
||||
service: coreServices.urlReader,
|
||||
deps: {
|
||||
config: coreServices.config,
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
coreServices,
|
||||
ServiceRef,
|
||||
} from '@backstage/backend-plugin-api';
|
||||
import { BackendLifecycleImpl } from '../services/implementations/rootLifecycle/rootLifecycleFactory';
|
||||
import { BackendLifecycleImpl } from '../services/implementations/rootLifecycle/rootLifecycleServiceFactory';
|
||||
import {
|
||||
BackendRegisterInit,
|
||||
EnumerableServiceHolder,
|
||||
|
||||
Reference in New Issue
Block a user