@backstage/backend-plugin-api 1.3.1-next.2 → 1.4.0-next.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
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @backstage/backend-plugin-api
|
|
2
2
|
|
|
3
|
+
## 1.4.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 664c07a: Added `coreServices.actionsRegistry` and `coreServices.actions` to allow registration of distributed actions from plugins, and the ability to invoke these actions
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @backstage/plugin-auth-node@0.6.4-next.0
|
|
13
|
+
- @backstage/plugin-permission-node@0.10.1-next.0
|
|
14
|
+
|
|
15
|
+
## 1.3.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- acea1d4: update documentation
|
|
20
|
+
- 72d019d: Removed various typos
|
|
21
|
+
- d385854: Minor doc comment update
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @backstage/plugin-auth-node@0.6.3
|
|
24
|
+
- @backstage/plugin-permission-common@0.9.0
|
|
25
|
+
- @backstage/plugin-permission-node@0.10.0
|
|
26
|
+
- @backstage/config@1.3.2
|
|
27
|
+
- @backstage/cli-common@0.1.15
|
|
28
|
+
- @backstage/errors@1.2.7
|
|
29
|
+
- @backstage/types@1.2.1
|
|
30
|
+
|
|
3
31
|
## 1.3.1-next.2
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ZodType, z } from 'zod';
|
|
2
|
+
import { JsonObject, JsonValue, HumanDuration } from '@backstage/types';
|
|
3
3
|
import { PermissionAttributes, EvaluatorRequestOptions, PermissionEvaluator, AuthorizePermissionRequest, AuthorizePermissionResponse, QueryPermissionRequest, QueryPermissionResponse, Permission } from '@backstage/plugin-permission-common';
|
|
4
|
+
import { JSONSchema7 } from 'json-schema';
|
|
5
|
+
import { Request, Response, Handler } from 'express';
|
|
4
6
|
import { Knex } from 'knex';
|
|
5
7
|
import { PermissionResourceRef, PermissionRule, PermissionRuleset } from '@backstage/plugin-permission-node';
|
|
6
8
|
import { Config } from '@backstage/config';
|
|
@@ -9,51 +11,18 @@ import { Readable } from 'stream';
|
|
|
9
11
|
export { isChildPath } from '@backstage/cli-common';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
13
|
-
* medium: accessing write endpoints
|
|
14
|
-
* high: non-root permission changes
|
|
15
|
-
* critical: root permission changes
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
type AuditorServiceEventSeverityLevel = 'low' | 'medium' | 'high' | 'critical';
|
|
19
|
-
/** @public */
|
|
20
|
-
type AuditorServiceCreateEventOptions = {
|
|
21
|
-
/**
|
|
22
|
-
* Use kebab-case to name audit events (e.g., "user-login", "file-download", "fetch"). Represents a logical group of similar events or operations. For example, "fetch" could be used as an eventId encompassing various fetch methods like "by-id" or "by-location".
|
|
23
|
-
*
|
|
24
|
-
* The `pluginId` already provides plugin/module context, so avoid redundant prefixes in the `eventId`.
|
|
25
|
-
*/
|
|
26
|
-
eventId: string;
|
|
27
|
-
/** (Optional) The severity level for the audit event. */
|
|
28
|
-
severityLevel?: AuditorServiceEventSeverityLevel;
|
|
29
|
-
/** (Optional) The associated HTTP request, if applicable. */
|
|
30
|
-
request?: Request<any, any, any, any, any>;
|
|
31
|
-
/**
|
|
32
|
-
* (Optional) Additional metadata relevant to the event, structured as a JSON object.
|
|
33
|
-
* This could include a `queryType` field, using kebab-case, for variations within the main event (e.g., "by-id", "by-user").
|
|
34
|
-
* For example, if the `eventId` is "fetch", the `queryType` in `meta` could be "by-id" or "by-location".
|
|
35
|
-
*/
|
|
36
|
-
meta?: JsonObject;
|
|
37
|
-
};
|
|
38
|
-
/** @public */
|
|
39
|
-
type AuditorServiceEvent = {
|
|
40
|
-
success(options?: {
|
|
41
|
-
meta?: JsonObject;
|
|
42
|
-
}): Promise<void>;
|
|
43
|
-
fail(options: {
|
|
44
|
-
meta?: JsonObject;
|
|
45
|
-
error: Error;
|
|
46
|
-
}): Promise<void>;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* A service that provides an auditor facility.
|
|
14
|
+
* A service that provides a logging facility.
|
|
50
15
|
*
|
|
51
|
-
* See the {@link https://backstage.io/docs/backend-system/core-services/
|
|
16
|
+
* See the {@link https://backstage.io/docs/backend-system/core-services/logger | service documentation} for more details.
|
|
52
17
|
*
|
|
53
18
|
* @public
|
|
54
19
|
*/
|
|
55
|
-
interface
|
|
56
|
-
|
|
20
|
+
interface LoggerService {
|
|
21
|
+
error(message: string, meta?: Error | JsonObject): void;
|
|
22
|
+
warn(message: string, meta?: Error | JsonObject): void;
|
|
23
|
+
info(message: string, meta?: Error | JsonObject): void;
|
|
24
|
+
debug(message: string, meta?: Error | JsonObject): void;
|
|
25
|
+
child(meta: JsonObject): LoggerService;
|
|
57
26
|
}
|
|
58
27
|
|
|
59
28
|
/**
|
|
@@ -279,6 +248,115 @@ interface AuthService {
|
|
|
279
248
|
}>;
|
|
280
249
|
}
|
|
281
250
|
|
|
251
|
+
/**
|
|
252
|
+
* @public
|
|
253
|
+
*/
|
|
254
|
+
type ActionsRegistryActionContext<TInputSchema extends ZodType> = {
|
|
255
|
+
input: z.infer<TInputSchema>;
|
|
256
|
+
logger: LoggerService;
|
|
257
|
+
credentials: BackstageCredentials;
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* @public
|
|
261
|
+
*/
|
|
262
|
+
type ActionsRegistryActionOptions<TInputSchema extends ZodType, TOutputSchema extends ZodType> = {
|
|
263
|
+
name: string;
|
|
264
|
+
title: string;
|
|
265
|
+
description: string;
|
|
266
|
+
schema: {
|
|
267
|
+
input: (zod: typeof z) => TInputSchema;
|
|
268
|
+
output: (zod: typeof z) => TOutputSchema;
|
|
269
|
+
};
|
|
270
|
+
action: (context: ActionsRegistryActionContext<TInputSchema>) => Promise<z.infer<TOutputSchema> extends void ? void : {
|
|
271
|
+
output: z.infer<TOutputSchema>;
|
|
272
|
+
}>;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* @public
|
|
276
|
+
*/
|
|
277
|
+
interface ActionsRegistryService {
|
|
278
|
+
register<TInputSchema extends ZodType, TOutputSchema extends ZodType>(options: ActionsRegistryActionOptions<TInputSchema, TOutputSchema>): void;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* @public
|
|
283
|
+
*/
|
|
284
|
+
type ActionsServiceAction = {
|
|
285
|
+
id: string;
|
|
286
|
+
name: string;
|
|
287
|
+
title: string;
|
|
288
|
+
description: string;
|
|
289
|
+
schema: {
|
|
290
|
+
input: JSONSchema7;
|
|
291
|
+
output: JSONSchema7;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
/**
|
|
295
|
+
* @public
|
|
296
|
+
*/
|
|
297
|
+
interface ActionsService {
|
|
298
|
+
list: (opts: {
|
|
299
|
+
credentials: BackstageCredentials;
|
|
300
|
+
}) => Promise<{
|
|
301
|
+
actions: ActionsServiceAction[];
|
|
302
|
+
}>;
|
|
303
|
+
invoke(opts: {
|
|
304
|
+
id: string;
|
|
305
|
+
input?: JsonObject;
|
|
306
|
+
credentials: BackstageCredentials;
|
|
307
|
+
}): Promise<{
|
|
308
|
+
output: JsonValue;
|
|
309
|
+
}>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* low (default): normal usage
|
|
314
|
+
* medium: accessing write endpoints
|
|
315
|
+
* high: non-root permission changes
|
|
316
|
+
* critical: root permission changes
|
|
317
|
+
* @public
|
|
318
|
+
*/
|
|
319
|
+
type AuditorServiceEventSeverityLevel = 'low' | 'medium' | 'high' | 'critical';
|
|
320
|
+
/** @public */
|
|
321
|
+
type AuditorServiceCreateEventOptions = {
|
|
322
|
+
/**
|
|
323
|
+
* Use kebab-case to name audit events (e.g., "user-login", "file-download", "fetch"). Represents a logical group of similar events or operations. For example, "fetch" could be used as an eventId encompassing various fetch methods like "by-id" or "by-location".
|
|
324
|
+
*
|
|
325
|
+
* The `pluginId` already provides plugin/module context, so avoid redundant prefixes in the `eventId`.
|
|
326
|
+
*/
|
|
327
|
+
eventId: string;
|
|
328
|
+
/** (Optional) The severity level for the audit event. */
|
|
329
|
+
severityLevel?: AuditorServiceEventSeverityLevel;
|
|
330
|
+
/** (Optional) The associated HTTP request, if applicable. */
|
|
331
|
+
request?: Request<any, any, any, any, any>;
|
|
332
|
+
/**
|
|
333
|
+
* (Optional) Additional metadata relevant to the event, structured as a JSON object.
|
|
334
|
+
* This could include a `queryType` field, using kebab-case, for variations within the main event (e.g., "by-id", "by-user").
|
|
335
|
+
* For example, if the `eventId` is "fetch", the `queryType` in `meta` could be "by-id" or "by-location".
|
|
336
|
+
*/
|
|
337
|
+
meta?: JsonObject;
|
|
338
|
+
};
|
|
339
|
+
/** @public */
|
|
340
|
+
type AuditorServiceEvent = {
|
|
341
|
+
success(options?: {
|
|
342
|
+
meta?: JsonObject;
|
|
343
|
+
}): Promise<void>;
|
|
344
|
+
fail(options: {
|
|
345
|
+
meta?: JsonObject;
|
|
346
|
+
error: Error;
|
|
347
|
+
}): Promise<void>;
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* A service that provides an auditor facility.
|
|
351
|
+
*
|
|
352
|
+
* See the {@link https://backstage.io/docs/backend-system/core-services/auditor | service documentation} for more details.
|
|
353
|
+
*
|
|
354
|
+
* @public
|
|
355
|
+
*/
|
|
356
|
+
interface AuditorService {
|
|
357
|
+
createEvent(options: AuditorServiceCreateEventOptions): Promise<AuditorServiceEvent>;
|
|
358
|
+
}
|
|
359
|
+
|
|
282
360
|
/**
|
|
283
361
|
* Options passed to {@link CacheService.set}.
|
|
284
362
|
*
|
|
@@ -546,21 +624,6 @@ interface HttpRouterService {
|
|
|
546
624
|
addAuthPolicy(policy: HttpRouterServiceAuthPolicy): void;
|
|
547
625
|
}
|
|
548
626
|
|
|
549
|
-
/**
|
|
550
|
-
* A service that provides a logging facility.
|
|
551
|
-
*
|
|
552
|
-
* See the {@link https://backstage.io/docs/backend-system/core-services/logger | service documentation} for more details.
|
|
553
|
-
*
|
|
554
|
-
* @public
|
|
555
|
-
*/
|
|
556
|
-
interface LoggerService {
|
|
557
|
-
error(message: string, meta?: Error | JsonObject): void;
|
|
558
|
-
warn(message: string, meta?: Error | JsonObject): void;
|
|
559
|
-
info(message: string, meta?: Error | JsonObject): void;
|
|
560
|
-
debug(message: string, meta?: Error | JsonObject): void;
|
|
561
|
-
child(meta: JsonObject): LoggerService;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
627
|
/**
|
|
565
628
|
* @public
|
|
566
629
|
*/
|
|
@@ -1655,6 +1718,26 @@ declare namespace coreServices {
|
|
|
1655
1718
|
* @public
|
|
1656
1719
|
*/
|
|
1657
1720
|
const auth: ServiceRef<AuthService, "plugin", "singleton">;
|
|
1721
|
+
/**
|
|
1722
|
+
* Service for calling distributed actions
|
|
1723
|
+
*
|
|
1724
|
+
* See {@link ActionsService}
|
|
1725
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/actions | the service docs}
|
|
1726
|
+
* for more information.
|
|
1727
|
+
*
|
|
1728
|
+
* @public
|
|
1729
|
+
*/
|
|
1730
|
+
const actions: ServiceRef<ActionsService, "plugin", "singleton">;
|
|
1731
|
+
/**
|
|
1732
|
+
* Service for registering and managing distributed actions.
|
|
1733
|
+
*
|
|
1734
|
+
* See {@link ActionsRegistryService}
|
|
1735
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/actions-registry | the service docs}
|
|
1736
|
+
* for more information.
|
|
1737
|
+
*
|
|
1738
|
+
* @public
|
|
1739
|
+
*/
|
|
1740
|
+
const actionsRegistry: ServiceRef<ActionsRegistryService, "plugin", "singleton">;
|
|
1658
1741
|
/**
|
|
1659
1742
|
* Authenticated user information retrieval.
|
|
1660
1743
|
*
|
|
@@ -2027,4 +2110,4 @@ declare function createBackendFeatureLoader<TDeps extends {
|
|
|
2027
2110
|
[name in string]: unknown;
|
|
2028
2111
|
}>(options: CreateBackendFeatureLoaderOptions<TDeps>): BackendFeature;
|
|
2029
2112
|
|
|
2030
|
-
export { type AuditorService, type AuditorServiceCreateEventOptions, type AuditorServiceEvent, type AuditorServiceEventSeverityLevel, type AuthService, type BackendFeature, type BackendModuleRegistrationPoints, type BackendPluginRegistrationPoints, type BackstageCredentials, type BackstageNonePrincipal, type BackstagePrincipalAccessRestrictions, type BackstagePrincipalTypes, type BackstageServicePrincipal, type BackstageUserInfo, type BackstageUserPrincipal, type CacheService, type CacheServiceOptions, type CacheServiceSetOptions, type CreateBackendFeatureLoaderOptions, type CreateBackendModuleOptions, type CreateBackendPluginOptions, type CreateExtensionPointOptions, type DatabaseService, type DiscoveryService, type ExtensionPoint, type HttpAuthService, type HttpRouterService, type HttpRouterServiceAuthPolicy, type LifecycleService, type LifecycleServiceShutdownHook, type LifecycleServiceShutdownOptions, type LifecycleServiceStartupHook, type LifecycleServiceStartupOptions, type LoggerService, type PermissionsRegistryService, type PermissionsRegistryServiceAddResourceTypeOptions, type PermissionsService, type PermissionsServiceRequestOptions, type PluginMetadataService, type PluginServiceFactoryOptions, type RootConfigService, type RootHealthService, type RootHttpRouterService, type RootLifecycleService, type RootLoggerService, type RootServiceFactoryOptions, type SchedulerService, type SchedulerServiceTaskDescriptor, type SchedulerServiceTaskFunction, type SchedulerServiceTaskInvocationDefinition, type SchedulerServiceTaskRunner, type SchedulerServiceTaskScheduleDefinition, type SchedulerServiceTaskScheduleDefinitionConfig, type ServiceFactory, type ServiceRef, type ServiceRefOptions, type UrlReaderService, type UrlReaderServiceReadTreeOptions, type UrlReaderServiceReadTreeResponse, type UrlReaderServiceReadTreeResponseDirOptions, type UrlReaderServiceReadTreeResponseFile, type UrlReaderServiceReadUrlOptions, type UrlReaderServiceReadUrlResponse, type UrlReaderServiceSearchOptions, type UrlReaderServiceSearchResponse, type UrlReaderServiceSearchResponseFile, type UserInfoService, coreServices, createBackendFeatureLoader, createBackendModule, createBackendPlugin, createExtensionPoint, createServiceFactory, createServiceRef, isDatabaseConflictError, readSchedulerServiceTaskScheduleDefinitionFromConfig, resolvePackagePath, resolveSafeChildPath };
|
|
2113
|
+
export { type ActionsRegistryActionContext, type ActionsRegistryActionOptions, type ActionsRegistryService, type ActionsService, type ActionsServiceAction, type AuditorService, type AuditorServiceCreateEventOptions, type AuditorServiceEvent, type AuditorServiceEventSeverityLevel, type AuthService, type BackendFeature, type BackendModuleRegistrationPoints, type BackendPluginRegistrationPoints, type BackstageCredentials, type BackstageNonePrincipal, type BackstagePrincipalAccessRestrictions, type BackstagePrincipalTypes, type BackstageServicePrincipal, type BackstageUserInfo, type BackstageUserPrincipal, type CacheService, type CacheServiceOptions, type CacheServiceSetOptions, type CreateBackendFeatureLoaderOptions, type CreateBackendModuleOptions, type CreateBackendPluginOptions, type CreateExtensionPointOptions, type DatabaseService, type DiscoveryService, type ExtensionPoint, type HttpAuthService, type HttpRouterService, type HttpRouterServiceAuthPolicy, type LifecycleService, type LifecycleServiceShutdownHook, type LifecycleServiceShutdownOptions, type LifecycleServiceStartupHook, type LifecycleServiceStartupOptions, type LoggerService, type PermissionsRegistryService, type PermissionsRegistryServiceAddResourceTypeOptions, type PermissionsService, type PermissionsServiceRequestOptions, type PluginMetadataService, type PluginServiceFactoryOptions, type RootConfigService, type RootHealthService, type RootHttpRouterService, type RootLifecycleService, type RootLoggerService, type RootServiceFactoryOptions, type SchedulerService, type SchedulerServiceTaskDescriptor, type SchedulerServiceTaskFunction, type SchedulerServiceTaskInvocationDefinition, type SchedulerServiceTaskRunner, type SchedulerServiceTaskScheduleDefinition, type SchedulerServiceTaskScheduleDefinitionConfig, type ServiceFactory, type ServiceRef, type ServiceRefOptions, type UrlReaderService, type UrlReaderServiceReadTreeOptions, type UrlReaderServiceReadTreeResponse, type UrlReaderServiceReadTreeResponseDirOptions, type UrlReaderServiceReadTreeResponseFile, type UrlReaderServiceReadUrlOptions, type UrlReaderServiceReadUrlResponse, type UrlReaderServiceSearchOptions, type UrlReaderServiceSearchResponse, type UrlReaderServiceSearchResponseFile, type UserInfoService, coreServices, createBackendFeatureLoader, createBackendModule, createBackendPlugin, createExtensionPoint, createServiceFactory, createServiceRef, isDatabaseConflictError, readSchedulerServiceTaskScheduleDefinitionFromConfig, resolvePackagePath, resolveSafeChildPath };
|
|
@@ -7,6 +7,12 @@ exports.coreServices = void 0;
|
|
|
7
7
|
coreServices2.auth = types.createServiceRef({
|
|
8
8
|
id: "core.auth"
|
|
9
9
|
});
|
|
10
|
+
coreServices2.actions = types.createServiceRef({
|
|
11
|
+
id: "core.actions"
|
|
12
|
+
});
|
|
13
|
+
coreServices2.actionsRegistry = types.createServiceRef({
|
|
14
|
+
id: "core.actionsRegistry"
|
|
15
|
+
});
|
|
10
16
|
coreServices2.userInfo = types.createServiceRef({
|
|
11
17
|
id: "core.userInfo"
|
|
12
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreServices.cjs.js","sources":["../../../src/services/definitions/coreServices.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createServiceRef } from '../system';\n\n/**\n * All core services references\n *\n * @public\n */\nexport namespace coreServices {\n /**\n * Handles token authentication and credentials management.\n *\n * See {@link AuthService}\n * and {@link https://backstage.io/docs/backend-system/core-services/auth | the service docs}\n * for more information.\n *\n * @public\n */\n export const auth = createServiceRef<import('./AuthService').AuthService>({\n id: 'core.auth',\n });\n\n /**\n * Authenticated user information retrieval.\n *\n * See {@link UserInfoService}\n * and {@link https://backstage.io/docs/backend-system/core-services/user-info | the service docs}\n * for more information.\n *\n * @public\n */\n export const userInfo = createServiceRef<\n import('./UserInfoService').UserInfoService\n >({\n id: 'core.userInfo',\n });\n\n /**\n * Key-value store for caching data.\n *\n * See {@link CacheService}\n * and {@link https://backstage.io/docs/backend-system/core-services/cache | the service docs}\n * for more information.\n *\n * @public\n */\n export const cache = createServiceRef<import('./CacheService').CacheService>({\n id: 'core.cache',\n });\n\n /**\n * Access to static configuration.\n *\n * See {@link RootConfigService}\n * and {@link https://backstage.io/docs/backend-system/core-services/root-config | the service docs}\n * for more information.\n *\n * @public\n */\n export const rootConfig = createServiceRef<\n import('./RootConfigService').RootConfigService\n >({ id: 'core.rootConfig', scope: 'root' });\n\n /**\n * Database access and management via `knex`.\n *\n * See {@link DatabaseService}\n * and {@link https://backstage.io/docs/backend-system/core-services/database | the service docs}\n * for more information.\n *\n * @public\n */\n export const database = createServiceRef<\n import('./DatabaseService').DatabaseService\n >({ id: 'core.database' });\n\n /**\n * Service discovery for inter-plugin communication.\n *\n * See {@link DiscoveryService}\n * and {@link https://backstage.io/docs/backend-system/core-services/discovery | the service docs}\n * for more information.\n *\n * @public\n */\n export const discovery = createServiceRef<\n import('./DiscoveryService').DiscoveryService\n >({ id: 'core.discovery' });\n\n /**\n * The service reference for the plugin scoped {@link RootHealthService}.\n */\n export const rootHealth = createServiceRef<\n import('./RootHealthService').RootHealthService\n >({ id: 'core.rootHealth', scope: 'root' });\n\n /**\n * Authentication of HTTP requests.\n *\n * See {@link HttpAuthService}\n * and {@link https://backstage.io/docs/backend-system/core-services/http-auth | the service docs}\n * for more information.\n *\n * @public\n */\n export const httpAuth = createServiceRef<\n import('./HttpAuthService').HttpAuthService\n >({ id: 'core.httpAuth' });\n\n /**\n * HTTP route registration for plugins.\n *\n * See {@link HttpRouterService}\n * and {@link https://backstage.io/docs/backend-system/core-services/http-router | the service docs}\n * for more information.\n *\n * @public\n */\n export const httpRouter = createServiceRef<\n import('./HttpRouterService').HttpRouterService\n >({ id: 'core.httpRouter' });\n\n /**\n * Registration of plugin startup and shutdown lifecycle hooks.\n *\n * See {@link LifecycleService}\n * and {@link https://backstage.io/docs/backend-system/core-services/lifecycle | the service docs}\n * for more information.\n *\n * @public\n */\n export const lifecycle = createServiceRef<\n import('./LifecycleService').LifecycleService\n >({ id: 'core.lifecycle' });\n\n /**\n * Plugin-level logging.\n *\n * See {@link LoggerService}\n * and {@link https://backstage.io/docs/backend-system/core-services/logger | the service docs}\n * for more information.\n *\n * @public\n */\n export const logger = createServiceRef<\n import('./LoggerService').LoggerService\n >({ id: 'core.logger' });\n\n /**\n * Plugin-level auditing.\n *\n * See {@link AuditorService}\n * and {@link https://backstage.io/docs/backend-system/core-services/auditor | the service docs}\n * for more information.\n *\n * @public\n */\n export const auditor = createServiceRef<\n import('./AuditorService').AuditorService\n >({ id: 'core.auditor' });\n\n /**\n * Permission system integration for authorization of user actions.\n *\n * See {@link PermissionsService}\n * and {@link https://backstage.io/docs/backend-system/core-services/permissions | the service docs}\n * for more information.\n *\n * @public\n */\n export const permissions = createServiceRef<\n import('./PermissionsService').PermissionsService\n >({ id: 'core.permissions' });\n\n /**\n * Permission system integration for registering resources and permissions.\n *\n * See {@link PermissionsRegistryService}\n * and {@link https://backstage.io/docs/backend-system/core-services/permission-integrations | the service docs}\n * for more information.\n *\n * @public\n */\n export const permissionsRegistry = createServiceRef<\n import('./PermissionsRegistryService').PermissionsRegistryService\n >({ id: 'core.permissionsRegistry' });\n\n /**\n * Built-in service for accessing metadata about the current plugin.\n *\n * See {@link PluginMetadataService}\n * and {@link https://backstage.io/docs/backend-system/core-services/plugin-metadata | the service docs}\n * for more information.\n *\n * @public\n */\n export const pluginMetadata = createServiceRef<\n import('./PluginMetadataService').PluginMetadataService\n >({ id: 'core.pluginMetadata' });\n\n /**\n * HTTP route registration for root services.\n *\n * See {@link RootHttpRouterService}\n * and {@link https://backstage.io/docs/backend-system/core-services/root-http-router | the service docs}\n * for more information.\n *\n * @public\n */\n export const rootHttpRouter = createServiceRef<\n import('./RootHttpRouterService').RootHttpRouterService\n >({ id: 'core.rootHttpRouter', scope: 'root' });\n\n /**\n * Registration of backend startup and shutdown lifecycle hooks.\n *\n * See {@link RootLifecycleService}\n * and {@link https://backstage.io/docs/backend-system/core-services/root-lifecycle | the service docs}\n * for more information.\n *\n * @public\n */\n export const rootLifecycle = createServiceRef<\n import('./RootLifecycleService').RootLifecycleService\n >({ id: 'core.rootLifecycle', scope: 'root' });\n\n /**\n * Root-level logging.\n *\n * See {@link RootLoggerService}\n * and {@link https://backstage.io/docs/backend-system/core-services/root-logger | the service docs}\n * for more information.\n *\n * @public\n */\n export const rootLogger = createServiceRef<\n import('./RootLoggerService').RootLoggerService\n >({ id: 'core.rootLogger', scope: 'root' });\n\n /**\n * Scheduling of distributed background tasks.\n *\n * See {@link SchedulerService}\n * and {@link https://backstage.io/docs/backend-system/core-services/scheduler | the service docs}\n * for more information.\n *\n * @public\n */\n export const scheduler = createServiceRef<\n import('./SchedulerService').SchedulerService\n >({ id: 'core.scheduler' });\n\n /**\n * Reading content from external systems.\n *\n * See {@link UrlReaderService}\n * and {@link https://backstage.io/docs/backend-system/core-services/url-reader | the service docs}\n * for more information.\n *\n * @public\n */\n export const urlReader = createServiceRef<\n import('./UrlReaderService').UrlReaderService\n >({ id: 'core.urlReader' });\n}\n"],"names":["coreServices","createServiceRef"],"mappings":";;;;AAuBiBA;AAAA,CAAV,CAAUA,aAAV,KAAA;AAUE,EAAMA,aAAAA,CAAA,OAAOC,sBAAsD,CAAA;AAAA,IACxE,EAAI,EAAA;AAAA,GACL,CAAA;AAWM,EAAMD,aAAAA,CAAA,WAAWC,sBAEtB,CAAA;AAAA,IACA,EAAI,EAAA;AA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,CAAA,gBAAgBC,sBAE3B,CAAA,EAAE,IAAI,oBAAsB,EAAA,KAAA,EAAO,QAAQ,CAAA;AAWtC,EAAMD,aAAAA,CAAA,aAAaC,sBAExB,CAAA,EAAE,IAAI,iBAAmB,EAAA,KAAA,EAAO,QAAQ,CAAA;AAWnC,EAAMD,cAAA,SAAY,GAAAC,sBAAA,CAEvB,EAAE,EAAA,EAAI,kBAAkB,CAAA;AAWnB,EAAMD,cAAA,SAAY,GAAAC,sBAAA,CAEvB,EAAE,EAAA,EAAI,kBAAkB,CAAA;AAAA,CA/PX,EAAAD,oBAAA,KAAAA,oBAAA,GAAA,EAAA,CAAA,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"coreServices.cjs.js","sources":["../../../src/services/definitions/coreServices.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createServiceRef } from '../system';\n\n/**\n * All core services references\n *\n * @public\n */\nexport namespace coreServices {\n /**\n * Handles token authentication and credentials management.\n *\n * See {@link AuthService}\n * and {@link https://backstage.io/docs/backend-system/core-services/auth | the service docs}\n * for more information.\n *\n * @public\n */\n export const auth = createServiceRef<import('./AuthService').AuthService>({\n id: 'core.auth',\n });\n\n /**\n * Service for calling distributed actions\n *\n * See {@link ActionsService}\n * and {@link https://backstage.io/docs/backend-system/core-services/actions | the service docs}\n * for more information.\n *\n * @public\n */\n export const actions = createServiceRef<\n import('./ActionsService').ActionsService\n >({\n id: 'core.actions',\n });\n\n /**\n * Service for registering and managing distributed actions.\n *\n * See {@link ActionsRegistryService}\n * and {@link https://backstage.io/docs/backend-system/core-services/actions-registry | the service docs}\n * for more information.\n *\n * @public\n */\n export const actionsRegistry = createServiceRef<\n import('./ActionsRegistryService').ActionsRegistryService\n >({\n id: 'core.actionsRegistry',\n });\n\n /**\n * Authenticated user information retrieval.\n *\n * See {@link UserInfoService}\n * and {@link https://backstage.io/docs/backend-system/core-services/user-info | the service docs}\n * for more information.\n *\n * @public\n */\n export const userInfo = createServiceRef<\n import('./UserInfoService').UserInfoService\n >({\n id: 'core.userInfo',\n });\n\n /**\n * Key-value store for caching data.\n *\n * See {@link CacheService}\n * and {@link https://backstage.io/docs/backend-system/core-services/cache | the service docs}\n * for more information.\n *\n * @public\n */\n export const cache = createServiceRef<import('./CacheService').CacheService>({\n id: 'core.cache',\n });\n\n /**\n * Access to static configuration.\n *\n * See {@link RootConfigService}\n * and {@link https://backstage.io/docs/backend-system/core-services/root-config | the service docs}\n * for more information.\n *\n * @public\n */\n export const rootConfig = createServiceRef<\n import('./RootConfigService').RootConfigService\n >({ id: 'core.rootConfig', scope: 'root' });\n\n /**\n * Database access and management via `knex`.\n *\n * See {@link DatabaseService}\n * and {@link https://backstage.io/docs/backend-system/core-services/database | the service docs}\n * for more information.\n *\n * @public\n */\n export const database = createServiceRef<\n import('./DatabaseService').DatabaseService\n >({ id: 'core.database' });\n\n /**\n * Service discovery for inter-plugin communication.\n *\n * See {@link DiscoveryService}\n * and {@link https://backstage.io/docs/backend-system/core-services/discovery | the service docs}\n * for more information.\n *\n * @public\n */\n export const discovery = createServiceRef<\n import('./DiscoveryService').DiscoveryService\n >({ id: 'core.discovery' });\n\n /**\n * The service reference for the plugin scoped {@link RootHealthService}.\n */\n export const rootHealth = createServiceRef<\n import('./RootHealthService').RootHealthService\n >({ id: 'core.rootHealth', scope: 'root' });\n\n /**\n * Authentication of HTTP requests.\n *\n * See {@link HttpAuthService}\n * and {@link https://backstage.io/docs/backend-system/core-services/http-auth | the service docs}\n * for more information.\n *\n * @public\n */\n export const httpAuth = createServiceRef<\n import('./HttpAuthService').HttpAuthService\n >({ id: 'core.httpAuth' });\n\n /**\n * HTTP route registration for plugins.\n *\n * See {@link HttpRouterService}\n * and {@link https://backstage.io/docs/backend-system/core-services/http-router | the service docs}\n * for more information.\n *\n * @public\n */\n export const httpRouter = createServiceRef<\n import('./HttpRouterService').HttpRouterService\n >({ id: 'core.httpRouter' });\n\n /**\n * Registration of plugin startup and shutdown lifecycle hooks.\n *\n * See {@link LifecycleService}\n * and {@link https://backstage.io/docs/backend-system/core-services/lifecycle | the service docs}\n * for more information.\n *\n * @public\n */\n export const lifecycle = createServiceRef<\n import('./LifecycleService').LifecycleService\n >({ id: 'core.lifecycle' });\n\n /**\n * Plugin-level logging.\n *\n * See {@link LoggerService}\n * and {@link https://backstage.io/docs/backend-system/core-services/logger | the service docs}\n * for more information.\n *\n * @public\n */\n export const logger = createServiceRef<\n import('./LoggerService').LoggerService\n >({ id: 'core.logger' });\n\n /**\n * Plugin-level auditing.\n *\n * See {@link AuditorService}\n * and {@link https://backstage.io/docs/backend-system/core-services/auditor | the service docs}\n * for more information.\n *\n * @public\n */\n export const auditor = createServiceRef<\n import('./AuditorService').AuditorService\n >({ id: 'core.auditor' });\n\n /**\n * Permission system integration for authorization of user actions.\n *\n * See {@link PermissionsService}\n * and {@link https://backstage.io/docs/backend-system/core-services/permissions | the service docs}\n * for more information.\n *\n * @public\n */\n export const permissions = createServiceRef<\n import('./PermissionsService').PermissionsService\n >({ id: 'core.permissions' });\n\n /**\n * Permission system integration for registering resources and permissions.\n *\n * See {@link PermissionsRegistryService}\n * and {@link https://backstage.io/docs/backend-system/core-services/permission-integrations | the service docs}\n * for more information.\n *\n * @public\n */\n export const permissionsRegistry = createServiceRef<\n import('./PermissionsRegistryService').PermissionsRegistryService\n >({ id: 'core.permissionsRegistry' });\n\n /**\n * Built-in service for accessing metadata about the current plugin.\n *\n * See {@link PluginMetadataService}\n * and {@link https://backstage.io/docs/backend-system/core-services/plugin-metadata | the service docs}\n * for more information.\n *\n * @public\n */\n export const pluginMetadata = createServiceRef<\n import('./PluginMetadataService').PluginMetadataService\n >({ id: 'core.pluginMetadata' });\n\n /**\n * HTTP route registration for root services.\n *\n * See {@link RootHttpRouterService}\n * and {@link https://backstage.io/docs/backend-system/core-services/root-http-router | the service docs}\n * for more information.\n *\n * @public\n */\n export const rootHttpRouter = createServiceRef<\n import('./RootHttpRouterService').RootHttpRouterService\n >({ id: 'core.rootHttpRouter', scope: 'root' });\n\n /**\n * Registration of backend startup and shutdown lifecycle hooks.\n *\n * See {@link RootLifecycleService}\n * and {@link https://backstage.io/docs/backend-system/core-services/root-lifecycle | the service docs}\n * for more information.\n *\n * @public\n */\n export const rootLifecycle = createServiceRef<\n import('./RootLifecycleService').RootLifecycleService\n >({ id: 'core.rootLifecycle', scope: 'root' });\n\n /**\n * Root-level logging.\n *\n * See {@link RootLoggerService}\n * and {@link https://backstage.io/docs/backend-system/core-services/root-logger | the service docs}\n * for more information.\n *\n * @public\n */\n export const rootLogger = createServiceRef<\n import('./RootLoggerService').RootLoggerService\n >({ id: 'core.rootLogger', scope: 'root' });\n\n /**\n * Scheduling of distributed background tasks.\n *\n * See {@link SchedulerService}\n * and {@link https://backstage.io/docs/backend-system/core-services/scheduler | the service docs}\n * for more information.\n *\n * @public\n */\n export const scheduler = createServiceRef<\n import('./SchedulerService').SchedulerService\n >({ id: 'core.scheduler' });\n\n /**\n * Reading content from external systems.\n *\n * See {@link UrlReaderService}\n * and {@link https://backstage.io/docs/backend-system/core-services/url-reader | the service docs}\n * for more information.\n *\n * @public\n */\n export const urlReader = createServiceRef<\n import('./UrlReaderService').UrlReaderService\n >({ id: 'core.urlReader' });\n}\n"],"names":["coreServices","createServiceRef"],"mappings":";;;;AAuBiBA;AAAA,CAAV,CAAUA,aAAV,KAAA;AAUE,EAAMA,aAAAA,CAAA,OAAOC,sBAAsD,CAAA;AAAA,IACxE,EAAI,EAAA;AAAA,GACL,CAAA;AAWM,EAAMD,aAAAA,CAAA,UAAUC,sBAErB,CAA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AAW7B,EAAMD,cAAA,cAAiB,GAAAC,sBAAA,CAE5B,EAAE,EAAA,EAAI,uBAAuB,CAAA;AAWxB,EAAMD,aAAAA,CAAA,iBAAiBC,sBAE5B,CAAA,EAAE,IAAI,qBAAuB,EAAA,KAAA,EAAO,QAAQ,CAAA;AAWvC,EAAMD,aAAAA,CAAA,gBAAgBC,sBAE3B,CAAA,EAAE,IAAI,oBAAsB,EAAA,KAAA,EAAO,QAAQ,CAAA;AAWtC,EAAMD,aAAAA,CAAA,aAAaC,sBAExB,CAAA,EAAE,IAAI,iBAAmB,EAAA,KAAA,EAAO,QAAQ,CAAA;AAWnC,EAAMD,cAAA,SAAY,GAAAC,sBAAA,CAEvB,EAAE,EAAA,EAAI,kBAAkB,CAAA;AAWnB,EAAMD,cAAA,SAAY,GAAAC,sBAAA,CAEvB,EAAE,EAAA,EAAI,kBAAkB,CAAA;AAAA,CA7RX,EAAAD,oBAAA,KAAAA,oBAAA,GAAA,EAAA,CAAA,CAAA;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/backend-plugin-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-next.0",
|
|
4
4
|
"description": "Core API used by Backstage backend plugins",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "node-library"
|
|
@@ -68,18 +68,21 @@
|
|
|
68
68
|
"@backstage/cli-common": "0.1.15",
|
|
69
69
|
"@backstage/config": "1.3.2",
|
|
70
70
|
"@backstage/errors": "1.2.7",
|
|
71
|
-
"@backstage/plugin-auth-node": "0.6.
|
|
72
|
-
"@backstage/plugin-permission-common": "0.9.0
|
|
73
|
-
"@backstage/plugin-permission-node": "0.10.
|
|
71
|
+
"@backstage/plugin-auth-node": "0.6.4-next.0",
|
|
72
|
+
"@backstage/plugin-permission-common": "0.9.0",
|
|
73
|
+
"@backstage/plugin-permission-node": "0.10.1-next.0",
|
|
74
74
|
"@backstage/types": "1.2.1",
|
|
75
75
|
"@types/express": "^4.17.6",
|
|
76
|
+
"@types/json-schema": "^7.0.6",
|
|
76
77
|
"@types/luxon": "^3.0.0",
|
|
78
|
+
"json-schema": "^0.4.0",
|
|
77
79
|
"knex": "^3.0.0",
|
|
78
|
-
"luxon": "^3.0.0"
|
|
80
|
+
"luxon": "^3.0.0",
|
|
81
|
+
"zod": "^3.22.4"
|
|
79
82
|
},
|
|
80
83
|
"devDependencies": {
|
|
81
|
-
"@backstage/backend-test-utils": "1.
|
|
82
|
-
"@backstage/cli": "0.32.1
|
|
84
|
+
"@backstage/backend-test-utils": "1.6.0-next.0",
|
|
85
|
+
"@backstage/cli": "0.32.1"
|
|
83
86
|
},
|
|
84
87
|
"configSchema": "config.d.ts"
|
|
85
88
|
}
|