Skip to content

Commit 02103be

Browse files
committed
move over cache and database services
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
1 parent 8ed28ff commit 02103be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+468
-499
lines changed

.changeset/six-llamas-give.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@backstage/backend-defaults': minor
3+
'@backstage/backend-common': minor
4+
---
5+
6+
Deprecated and moved over core services to `@backstage/backend-defaults`

packages/backend-app-api/api-report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import type { AppConfig } from '@backstage/config';
99
import { AuthService } from '@backstage/backend-plugin-api';
1010
import { BackendFeature } from '@backstage/backend-plugin-api';
11-
import { CacheClient } from '@backstage/backend-common';
11+
import { CacheService } from '@backstage/backend-plugin-api';
1212
import { Config } from '@backstage/config';
1313
import { ConfigSchema } from '@backstage/config-loader';
1414
import { CorsOptions } from 'cors';
@@ -66,7 +66,7 @@ export interface Backend {
6666
}
6767

6868
// @public @deprecated (undocumented)
69-
export const cacheServiceFactory: () => ServiceFactory<CacheClient, 'plugin'>;
69+
export const cacheServiceFactory: () => ServiceFactory<CacheService, 'plugin'>;
7070

7171
// @public (undocumented)
7272
export function createConfigSecretEnumerator(options: {

packages/backend-common/api-report.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ import { BackendFeature } from '@backstage/backend-plugin-api';
1717
import { BitbucketCloudIntegration } from '@backstage/integration';
1818
import { BitbucketIntegration } from '@backstage/integration';
1919
import { BitbucketServerIntegration } from '@backstage/integration';
20-
import { CacheService as CacheClient } from '@backstage/backend-plugin-api';
21-
import { CacheServiceOptions as CacheClientOptions } from '@backstage/backend-plugin-api';
22-
import { CacheServiceSetOptions as CacheClientSetOptions } from '@backstage/backend-plugin-api';
20+
import { CacheService } from '@backstage/backend-plugin-api';
21+
import { CacheServiceOptions } from '@backstage/backend-plugin-api';
22+
import type { CacheServiceSetOptions } from '@backstage/backend-plugin-api';
2323
import { Config } from '@backstage/config';
2424
import cors from 'cors';
25+
import { DiscoveryService } from '@backstage/backend-plugin-api';
2526
import Docker from 'dockerode';
2627
import { ErrorRequestHandler } from 'express';
2728
import express from 'express';
@@ -44,7 +45,6 @@ import { LoggerService } from '@backstage/backend-plugin-api';
4445
import { MergeResult } from 'isomorphic-git';
4546
import { PermissionsService } from '@backstage/backend-plugin-api';
4647
import { DatabaseService as PluginDatabaseManager } from '@backstage/backend-plugin-api';
47-
import { DiscoveryService as PluginEndpointDiscovery } from '@backstage/backend-plugin-api';
4848
import { PluginMetadataService } from '@backstage/backend-plugin-api';
4949
import { PushResult } from 'isomorphic-git';
5050
import { Readable } from 'stream';
@@ -193,18 +193,26 @@ export class BitbucketUrlReader implements UrlReader {
193193
toString(): string;
194194
}
195195

196-
export { CacheClient };
196+
// @public @deprecated (undocumented)
197+
export type CacheClient = CacheService;
197198

198-
export { CacheClientOptions };
199+
// @public @deprecated (undocumented)
200+
export type CacheClientOptions = CacheServiceOptions;
199201

200-
export { CacheClientSetOptions };
202+
// @public @deprecated (undocumented)
203+
export type CacheClientSetOptions = CacheServiceSetOptions;
201204

202205
// @public
203206
export class CacheManager {
204-
forPlugin(pluginId: string): PluginCacheManager;
207+
forPlugin(pluginId: string): {
208+
getClient(options?: CacheServiceOptions): CacheService;
209+
};
205210
static fromConfig(
206211
config: Config,
207-
options?: CacheManagerOptions,
212+
options?: {
213+
logger?: LoggerService;
214+
onError?: (err: Error) => void;
215+
},
208216
): CacheManager;
209217
}
210218

@@ -214,10 +222,10 @@ export type CacheManagerOptions = {
214222
onError?: (err: Error) => void;
215223
};
216224

217-
// @public (undocumented)
218-
export function cacheToPluginCacheManager(
219-
cache: CacheClient,
220-
): PluginCacheManager;
225+
// @public
226+
export function cacheToPluginCacheManager(cache: CacheService): {
227+
getClient(options?: CacheServiceOptions): CacheService;
228+
};
221229

222230
// @public @deprecated
223231
export const coloredFormat: winston.Logform.Format;
@@ -575,10 +583,10 @@ export const legacyPlugin: (
575583
default: LegacyCreateRouter<
576584
TransformedEnv<
577585
{
578-
cache: CacheClient;
586+
cache: CacheService;
579587
config: RootConfigService;
580588
database: PluginDatabaseManager;
581-
discovery: PluginEndpointDiscovery;
589+
discovery: DiscoveryService;
582590
logger: LoggerService;
583591
permissions: PermissionsService;
584592
scheduler: SchedulerService;
@@ -588,7 +596,9 @@ export const legacyPlugin: (
588596
},
589597
{
590598
logger: (log: LoggerService) => Logger;
591-
cache: (cache: CacheClient) => PluginCacheManager;
599+
cache: (cache: CacheService) => {
600+
getClient(options?: CacheServiceOptions | undefined): CacheService;
601+
};
592602
}
593603
>
594604
>;
@@ -639,12 +649,13 @@ export function notFoundHandler(): RequestHandler;
639649
// @public (undocumented)
640650
export interface PluginCacheManager {
641651
// (undocumented)
642-
getClient(options?: CacheClientOptions): CacheClient;
652+
getClient(options?: CacheServiceOptions): CacheService;
643653
}
644654

645655
export { PluginDatabaseManager };
646656

647-
export { PluginEndpointDiscovery };
657+
// @public @deprecated (undocumented)
658+
export type PluginEndpointDiscovery = DiscoveryService;
648659

649660
// @public
650661
export interface PullOptions {

0 commit comments

Comments
 (0)