@backstage/backend-plugin-api 0.6.19-next.2 → 0.6.19
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 +72 -0
- package/alpha/package.json +1 -1
- package/dist/index.cjs.js +84 -93
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +169 -38
- package/package.json +6 -6
- package/testUtils/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,77 @@
|
|
|
1
1
|
# @backstage/backend-plugin-api
|
|
2
2
|
|
|
3
|
+
## 0.6.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 78a0b08: **DEPRECATION**: You should no longer do a function call on backend features when adding them to backends. The support for doing that is deprecated, and you should remove all trailing `()` parentheses after plugins and modules where you add them to your backend or test backends (e.g. when using `startTestBackend`).
|
|
8
|
+
|
|
9
|
+
The background for this is that `createBackendPlugin` and `createBackendModule` function now effectively return a `BackendFeature` rather than a `() => BackendFeature`. This is part of the cleanup efforts for New Backend System 1.0. In the short run this is non-breaking because the feature type has been given a callback signature that returns itself. But we strongly recommend that you remove all now-redundant calls made to feature objects, because that callback signature will be removed in a future release.
|
|
10
|
+
|
|
11
|
+
Service factories are still callbacks at this point.
|
|
12
|
+
|
|
13
|
+
Example change:
|
|
14
|
+
|
|
15
|
+
```diff
|
|
16
|
+
await startTestBackend({
|
|
17
|
+
features: [
|
|
18
|
+
eventsServiceFactory(), // service - stays unchanged
|
|
19
|
+
- catalogModuleBitbucketCloudEntityProvider(), // module - remove parentheses
|
|
20
|
+
+ catalogModuleBitbucketCloudEntityProvider,
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- 9bdc3e8: In tests, return `null` rather than throwing an error when trying to get the `ExtensionPoint.T` property, so that tests asserting the property are not easily broken.
|
|
24
|
+
- 9e63318: Added an optional `accessRestrictions` to external access service tokens and service principals in general, such that you can limit their access to certain plugins or permissions.
|
|
25
|
+
- 3aa3fc7: Marked the `TokenManagerService` and `IdentityService` types as deprecated
|
|
26
|
+
- b2ee7f3: Deprecated all of the `UrlReader` related type names and replaced them with prefixed versions. Please update your imports.
|
|
27
|
+
|
|
28
|
+
- `ReadTreeOptions` was renamed to `UrlReaderServiceReadTreeOptions`
|
|
29
|
+
- `ReadTreeResponse` was renamed to `UrlReaderServiceReadTreeResponse`
|
|
30
|
+
- `ReadTreeResponseDirOptions` was renamed to `UrlReaderServiceReadTreeResponseDirOptions`
|
|
31
|
+
- `ReadTreeResponseFile` was renamed to `UrlReaderServiceReadTreeResponseFile`
|
|
32
|
+
- `ReadUrlResponse` was renamed to `UrlReaderServiceReadUrlResponse`
|
|
33
|
+
- `ReadUrlOptions` was renamed to `UrlReaderServiceReadUrlOptions`
|
|
34
|
+
- `SearchOptions` was renamed to `UrlReaderServiceSearchOptions`
|
|
35
|
+
- `SearchResponse` was renamed to `UrlReaderServiceSearchResponse`
|
|
36
|
+
- `SearchResponseFile` was renamed to `UrlReaderServiceSearchResponseFile`
|
|
37
|
+
|
|
38
|
+
- 9539a0b: Improved `coreServices` doc comments
|
|
39
|
+
- 6551b3d: Moved the declaration of the `SchedulerService` here, along with prefixed versions of all of the types it depends on, from `@backstage/backend-tasks`
|
|
40
|
+
- 0665b7e: Renamed `BackendPluginConfig`, `BackendModuleConfig`, and `ExtensionPointConfig` respectively to `CreateBackendPluginOptions`, `CreateBackendModuleOptions`, and `CreateExtensionPointOptions` to standardize frontend and backend factories signatures.
|
|
41
|
+
- 1779188: Start using the `isDatabaseConflictError` helper from the `@backstage/backend-plugin-api` package in order to avoid dependency with the soon to deprecate `@backstage/backend-common` package.
|
|
42
|
+
- Updated dependencies
|
|
43
|
+
- @backstage/plugin-auth-node@0.4.14
|
|
44
|
+
- @backstage/plugin-permission-common@0.7.14
|
|
45
|
+
- @backstage/cli-common@0.1.14
|
|
46
|
+
- @backstage/config@1.2.0
|
|
47
|
+
- @backstage/errors@1.2.4
|
|
48
|
+
- @backstage/types@1.1.1
|
|
49
|
+
|
|
50
|
+
## 0.6.19-next.3
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- 9bdc3e8: In tests, return `null` rather than throwing an error when trying to get the `ExtensionPoint.T` property, so that tests asserting the property are not easily broken.
|
|
55
|
+
- b2ee7f3: Deprecated all of the `UrlReader` related type names and replaced them with prefixed versions. Please update your imports.
|
|
56
|
+
|
|
57
|
+
- `ReadTreeOptions` was renamed to `UrlReaderServiceReadTreeOptions`
|
|
58
|
+
- `ReadTreeResponse` was renamed to `UrlReaderServiceReadTreeResponse`
|
|
59
|
+
- `ReadTreeResponseDirOptions` was renamed to `UrlReaderServiceReadTreeResponseDirOptions`
|
|
60
|
+
- `ReadTreeResponseFile` was renamed to `UrlReaderServiceReadTreeResponseFile`
|
|
61
|
+
- `ReadUrlResponse` was renamed to `UrlReaderServiceReadUrlResponse`
|
|
62
|
+
- `ReadUrlOptions` was renamed to `UrlReaderServiceReadUrlOptions`
|
|
63
|
+
- `SearchOptions` was renamed to `UrlReaderServiceSearchOptions`
|
|
64
|
+
- `SearchResponse` was renamed to `UrlReaderServiceSearchResponse`
|
|
65
|
+
- `SearchResponseFile` was renamed to `UrlReaderServiceSearchResponseFile`
|
|
66
|
+
|
|
67
|
+
- Updated dependencies
|
|
68
|
+
- @backstage/plugin-auth-node@0.4.14-next.3
|
|
69
|
+
- @backstage/plugin-permission-common@0.7.14-next.0
|
|
70
|
+
- @backstage/cli-common@0.1.14-next.0
|
|
71
|
+
- @backstage/config@1.2.0
|
|
72
|
+
- @backstage/errors@1.2.4
|
|
73
|
+
- @backstage/types@1.1.1
|
|
74
|
+
|
|
3
75
|
## 0.6.19-next.2
|
|
4
76
|
|
|
5
77
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -129,6 +129,9 @@ function createExtensionPoint(options) {
|
|
|
129
129
|
return {
|
|
130
130
|
id: options.id,
|
|
131
131
|
get T() {
|
|
132
|
+
if (process.env.NODE_ENV === "test") {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
132
135
|
throw new Error(`tried to read ExtensionPoint.T of ${this}`);
|
|
133
136
|
},
|
|
134
137
|
toString() {
|
|
@@ -138,107 +141,95 @@ function createExtensionPoint(options) {
|
|
|
138
141
|
};
|
|
139
142
|
}
|
|
140
143
|
function createBackendPlugin(options) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return registrations;
|
|
144
|
+
function getRegistrations() {
|
|
145
|
+
const extensionPoints = [];
|
|
146
|
+
let init = void 0;
|
|
147
|
+
options.register({
|
|
148
|
+
registerExtensionPoint(ext, impl) {
|
|
149
|
+
if (init) {
|
|
150
|
+
throw new Error("registerExtensionPoint called after registerInit");
|
|
149
151
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
throw new Error(
|
|
156
|
-
"registerExtensionPoint called after registerInit"
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
extensionPoints.push([ext, impl]);
|
|
160
|
-
},
|
|
161
|
-
registerInit(regInit) {
|
|
162
|
-
if (init) {
|
|
163
|
-
throw new Error("registerInit must only be called once");
|
|
164
|
-
}
|
|
165
|
-
init = {
|
|
166
|
-
deps: regInit.deps,
|
|
167
|
-
func: regInit.init
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
if (!init) {
|
|
172
|
-
throw new Error(
|
|
173
|
-
`registerInit was not called by register in ${options.pluginId}`
|
|
174
|
-
);
|
|
152
|
+
extensionPoints.push([ext, impl]);
|
|
153
|
+
},
|
|
154
|
+
registerInit(regInit) {
|
|
155
|
+
if (init) {
|
|
156
|
+
throw new Error("registerInit must only be called once");
|
|
175
157
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
extensionPoints,
|
|
181
|
-
init
|
|
182
|
-
}
|
|
183
|
-
];
|
|
184
|
-
return registrations;
|
|
158
|
+
init = {
|
|
159
|
+
deps: regInit.deps,
|
|
160
|
+
func: regInit.init
|
|
161
|
+
};
|
|
185
162
|
}
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
163
|
+
});
|
|
164
|
+
if (!init) {
|
|
165
|
+
throw new Error(
|
|
166
|
+
`registerInit was not called by register in ${options.pluginId}`
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
return [
|
|
170
|
+
{
|
|
171
|
+
type: "plugin",
|
|
172
|
+
pluginId: options.pluginId,
|
|
173
|
+
extensionPoints,
|
|
174
|
+
init
|
|
175
|
+
}
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
function backendFeatureCompatWrapper() {
|
|
179
|
+
return backendFeatureCompatWrapper;
|
|
180
|
+
}
|
|
181
|
+
Object.assign(backendFeatureCompatWrapper, {
|
|
182
|
+
$$type: "@backstage/BackendFeature",
|
|
183
|
+
version: "v1",
|
|
184
|
+
getRegistrations
|
|
185
|
+
});
|
|
186
|
+
return backendFeatureCompatWrapper;
|
|
190
187
|
}
|
|
191
188
|
function createBackendModule(options) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return registrations;
|
|
189
|
+
function getRegistrations() {
|
|
190
|
+
const extensionPoints = [];
|
|
191
|
+
let init = void 0;
|
|
192
|
+
options.register({
|
|
193
|
+
registerExtensionPoint(ext, impl) {
|
|
194
|
+
if (init) {
|
|
195
|
+
throw new Error("registerExtensionPoint called after registerInit");
|
|
200
196
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
throw new Error(
|
|
207
|
-
"registerExtensionPoint called after registerInit"
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
extensionPoints.push([ext, impl]);
|
|
211
|
-
},
|
|
212
|
-
registerInit(regInit) {
|
|
213
|
-
if (init) {
|
|
214
|
-
throw new Error("registerInit must only be called once");
|
|
215
|
-
}
|
|
216
|
-
init = {
|
|
217
|
-
deps: regInit.deps,
|
|
218
|
-
func: regInit.init
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
if (!init) {
|
|
223
|
-
throw new Error(
|
|
224
|
-
`registerInit was not called by register in ${options.moduleId} module for ${options.pluginId}`
|
|
225
|
-
);
|
|
197
|
+
extensionPoints.push([ext, impl]);
|
|
198
|
+
},
|
|
199
|
+
registerInit(regInit) {
|
|
200
|
+
if (init) {
|
|
201
|
+
throw new Error("registerInit must only be called once");
|
|
226
202
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
moduleId: options.moduleId,
|
|
232
|
-
extensionPoints,
|
|
233
|
-
init
|
|
234
|
-
}
|
|
235
|
-
];
|
|
236
|
-
return registrations;
|
|
203
|
+
init = {
|
|
204
|
+
deps: regInit.deps,
|
|
205
|
+
func: regInit.init
|
|
206
|
+
};
|
|
237
207
|
}
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
208
|
+
});
|
|
209
|
+
if (!init) {
|
|
210
|
+
throw new Error(
|
|
211
|
+
`registerInit was not called by register in ${options.moduleId} module for ${options.pluginId}`
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
return [
|
|
215
|
+
{
|
|
216
|
+
type: "module",
|
|
217
|
+
pluginId: options.pluginId,
|
|
218
|
+
moduleId: options.moduleId,
|
|
219
|
+
extensionPoints,
|
|
220
|
+
init
|
|
221
|
+
}
|
|
222
|
+
];
|
|
223
|
+
}
|
|
224
|
+
function backendFeatureCompatWrapper() {
|
|
225
|
+
return backendFeatureCompatWrapper;
|
|
226
|
+
}
|
|
227
|
+
Object.assign(backendFeatureCompatWrapper, {
|
|
228
|
+
$$type: "@backstage/BackendFeature",
|
|
229
|
+
version: "v1",
|
|
230
|
+
getRegistrations
|
|
231
|
+
});
|
|
232
|
+
return backendFeatureCompatWrapper;
|
|
242
233
|
}
|
|
243
234
|
|
|
244
235
|
exports.packagePathMocks = paths.packagePathMocks;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/services/system/types.ts","../src/services/definitions/coreServices.ts","../src/services/definitions/SchedulerService.ts","../src/services/utilities/database.ts","../src/wiring/factories.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 { BackendFeature } from '../../types';\n\n/**\n * TODO\n *\n * @public\n */\nexport type ServiceRef<\n TService,\n TScope extends 'root' | 'plugin' = 'root' | 'plugin',\n> = {\n id: string;\n\n /**\n * This determines the scope at which this service is available.\n *\n * Root scoped services are available to all other services but\n * may only depend on other root scoped services.\n *\n * Plugin scoped services are only available to other plugin scoped\n * services but may depend on all other services.\n */\n scope: TScope;\n\n /**\n * Utility for getting the type of the service, using `typeof serviceRef.T`.\n * Attempting to actually read this value will result in an exception.\n */\n T: TService;\n\n $$type: '@backstage/ServiceRef';\n};\n\n/** @public */\nexport interface ServiceFactory<\n TService = unknown,\n TScope extends 'plugin' | 'root' = 'plugin' | 'root',\n> extends BackendFeature {\n service: ServiceRef<TService, TScope>;\n}\n\n/** @internal */\nexport interface InternalServiceFactory<\n TService = unknown,\n TScope extends 'plugin' | 'root' = 'plugin' | 'root',\n> extends ServiceFactory<TService, TScope> {\n version: 'v1';\n initialization?: 'always' | 'lazy';\n deps: { [key in string]: ServiceRef<unknown> };\n createRootContext?(deps: { [key in string]: unknown }): Promise<unknown>;\n factory(\n deps: { [key in string]: unknown },\n context: unknown,\n ): Promise<TService>;\n}\n\n/**\n * Represents either a {@link ServiceFactory} or a function that returns one.\n *\n * @public\n */\nexport type ServiceFactoryOrFunction = ServiceFactory | (() => ServiceFactory);\n\n/** @public */\nexport interface ServiceRefConfig<TService, TScope extends 'root' | 'plugin'> {\n id: string;\n scope?: TScope;\n defaultFactory?: (\n service: ServiceRef<TService, TScope>,\n ) => Promise<ServiceFactoryOrFunction>;\n}\n\n/**\n * Creates a new service definition. This overload is used to create plugin scoped services.\n *\n * @public\n */\nexport function createServiceRef<TService>(\n config: ServiceRefConfig<TService, 'plugin'>,\n): ServiceRef<TService, 'plugin'>;\n\n/**\n * Creates a new service definition. This overload is used to create root scoped services.\n *\n * @public\n */\nexport function createServiceRef<TService>(\n config: ServiceRefConfig<TService, 'root'>,\n): ServiceRef<TService, 'root'>;\nexport function createServiceRef<TService>(\n config: ServiceRefConfig<TService, any>,\n): ServiceRef<TService, any> {\n const { id, scope = 'plugin', defaultFactory } = config;\n return {\n id,\n scope,\n get T(): TService {\n throw new Error(`tried to read ServiceRef.T of ${this}`);\n },\n toString() {\n return `serviceRef{${config.id}}`;\n },\n $$type: '@backstage/ServiceRef',\n __defaultFactory: defaultFactory,\n } as ServiceRef<TService, typeof scope> & {\n __defaultFactory?: (\n service: ServiceRef<TService>,\n ) => Promise<ServiceFactory<TService> | (() => ServiceFactory<TService>)>;\n };\n}\n\n/** @ignore */\ntype ServiceRefsToInstances<\n T extends { [key in string]: ServiceRef<unknown> },\n TScope extends 'root' | 'plugin' = 'root' | 'plugin',\n> = {\n [key in keyof T as T[key]['scope'] extends TScope ? key : never]: T[key]['T'];\n};\n\n/** @public */\nexport interface RootServiceFactoryConfig<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown> },\n> {\n /**\n * The initialization strategy for the service factory. This service is root scoped and will use `always` by default.\n *\n * @remarks\n *\n * - `always` - The service will always be initialized regardless if it is used or not.\n * - `lazy` - The service will only be initialized if it is depended on by a different service or feature.\n *\n * Service factories for root scoped services use `always` as the default, while plugin scoped services use `lazy`.\n */\n initialization?: 'always' | 'lazy';\n service: ServiceRef<TService, 'root'>;\n deps: TDeps;\n factory(deps: ServiceRefsToInstances<TDeps, 'root'>): TImpl | Promise<TImpl>;\n}\n\n/** @public */\nexport interface PluginServiceFactoryConfig<\n TService,\n TContext,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown> },\n> {\n /**\n * The initialization strategy for the service factory. This service is plugin scoped and will use `lazy` by default.\n *\n * @remarks\n *\n * - `always` - The service will always be initialized regardless if it is used or not.\n * - `lazy` - The service will only be initialized if it is depended on by a different service or feature.\n *\n * Service factories for root scoped services use `always` as the default, while plugin scoped services use `lazy`.\n */\n initialization?: 'always' | 'lazy';\n service: ServiceRef<TService, 'plugin'>;\n deps: TDeps;\n createRootContext?(\n deps: ServiceRefsToInstances<TDeps, 'root'>,\n ): TContext | Promise<TContext>;\n factory(\n deps: ServiceRefsToInstances<TDeps>,\n context: TContext,\n ): TImpl | Promise<TImpl>;\n}\n\n/**\n * Creates a root scoped service factory without options.\n *\n * @public\n * @param config - The service factory configuration.\n */\nexport function createServiceFactory<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown, 'root'> },\n TOpts extends object | undefined = undefined,\n>(\n config: RootServiceFactoryConfig<TService, TImpl, TDeps>,\n): () => ServiceFactory<TService, 'root'>;\n/**\n * Creates a root scoped service factory with optional options.\n *\n * @public\n * @param config - The service factory configuration.\n */\nexport function createServiceFactory<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown, 'root'> },\n TOpts extends object | undefined = undefined,\n>(\n config: (options?: TOpts) => RootServiceFactoryConfig<TService, TImpl, TDeps>,\n): (options?: TOpts) => ServiceFactory<TService, 'root'>;\n/**\n * Creates a plugin scoped service factory without options.\n *\n * @public\n * @param config - The service factory configuration.\n */\nexport function createServiceFactory<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown> },\n TContext = undefined,\n TOpts extends object | undefined = undefined,\n>(\n config: PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>,\n): () => ServiceFactory<TService, 'plugin'>;\n/**\n * Creates a plugin scoped service factory with optional options.\n *\n * @public\n * @param config - The service factory configuration.\n */\nexport function createServiceFactory<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown> },\n TContext = undefined,\n TOpts extends object | undefined = undefined,\n>(\n config: (\n options?: TOpts,\n ) => PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>,\n): (options?: TOpts) => ServiceFactory<TService, 'plugin'>;\nexport function createServiceFactory<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown> },\n TContext,\n TOpts extends object | undefined = undefined,\n>(\n config:\n | RootServiceFactoryConfig<TService, TImpl, TDeps>\n | PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>\n | ((options: TOpts) => RootServiceFactoryConfig<TService, TImpl, TDeps>)\n | ((\n options: TOpts,\n ) => PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>)\n | (() => RootServiceFactoryConfig<TService, TImpl, TDeps>)\n | (() => PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>),\n): (options: TOpts) => ServiceFactory {\n const configCallback = typeof config === 'function' ? config : () => config;\n const factory = (\n options: TOpts,\n ): InternalServiceFactory<TService, 'plugin' | 'root'> => {\n const anyConf = configCallback(options);\n if (anyConf.service.scope === 'root') {\n const c = anyConf as RootServiceFactoryConfig<TService, TImpl, TDeps>;\n return {\n $$type: '@backstage/BackendFeature',\n version: 'v1',\n service: c.service,\n initialization: c.initialization,\n deps: c.deps,\n factory: async (deps: TDeps) => c.factory(deps),\n };\n }\n const c = anyConf as PluginServiceFactoryConfig<\n TService,\n TContext,\n TImpl,\n TDeps\n >;\n return {\n $$type: '@backstage/BackendFeature',\n version: 'v1',\n service: c.service,\n initialization: c.initialization,\n ...('createRootContext' in c\n ? {\n createRootContext: async (deps: TDeps) =>\n c?.createRootContext?.(deps),\n }\n : {}),\n deps: c.deps,\n factory: async (deps: TDeps, ctx: TContext) => c.factory(deps, ctx),\n };\n };\n\n factory.$$type = '@backstage/BackendFeatureFactory';\n\n return factory;\n}\n","/*\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 * The service reference for the plugin scoped {@link AuthService}.\n *\n * @public\n */\n export const auth = createServiceRef<import('./AuthService').AuthService>({\n id: 'core.auth',\n });\n\n /**\n * The service reference for the plugin scoped {@link UserInfoService}.\n *\n * @public\n */\n export const userInfo = createServiceRef<\n import('./UserInfoService').UserInfoService\n >({\n id: 'core.userInfo',\n });\n\n /**\n * The service reference for the plugin scoped {@link CacheService}.\n *\n * @public\n */\n export const cache = createServiceRef<import('./CacheService').CacheService>({\n id: 'core.cache',\n });\n\n /**\n * The service reference for the root scoped {@link RootConfigService}.\n *\n * @public\n */\n export const rootConfig = createServiceRef<\n import('./RootConfigService').RootConfigService\n >({ id: 'core.rootConfig', scope: 'root' });\n\n /**\n * The service reference for the plugin scoped {@link DatabaseService}.\n *\n * @public\n */\n export const database = createServiceRef<\n import('./DatabaseService').DatabaseService\n >({ id: 'core.database' });\n\n /**\n * The service reference for the plugin scoped {@link DiscoveryService}.\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 HttpAuthService}.\n *\n * @public\n */\n export const httpAuth = createServiceRef<\n import('./HttpAuthService').HttpAuthService\n >({ id: 'core.httpAuth' });\n\n /**\n * The service reference for the plugin scoped {@link HttpRouterService}.\n *\n * @public\n */\n export const httpRouter = createServiceRef<\n import('./HttpRouterService').HttpRouterService\n >({ id: 'core.httpRouter' });\n\n /**\n * The service reference for the plugin scoped {@link LifecycleService}.\n *\n * @public\n */\n export const lifecycle = createServiceRef<\n import('./LifecycleService').LifecycleService\n >({ id: 'core.lifecycle' });\n\n /**\n * The service reference for the plugin scoped {@link LoggerService}.\n *\n * @public\n */\n export const logger = createServiceRef<\n import('./LoggerService').LoggerService\n >({ id: 'core.logger' });\n\n /**\n * The service reference for the plugin scoped {@link PermissionsService}.\n *\n * @public\n */\n export const permissions = createServiceRef<\n import('./PermissionsService').PermissionsService\n >({ id: 'core.permissions' });\n\n /**\n * The service reference for the plugin scoped {@link PluginMetadataService}.\n *\n * @public\n */\n export const pluginMetadata = createServiceRef<\n import('./PluginMetadataService').PluginMetadataService\n >({ id: 'core.pluginMetadata' });\n\n /**\n * The service reference for the root scoped {@link RootHttpRouterService}.\n *\n * @public\n */\n export const rootHttpRouter = createServiceRef<\n import('./RootHttpRouterService').RootHttpRouterService\n >({ id: 'core.rootHttpRouter', scope: 'root' });\n\n /**\n * The service reference for the root scoped {@link RootLifecycleService}.\n *\n * @public\n */\n export const rootLifecycle = createServiceRef<\n import('./RootLifecycleService').RootLifecycleService\n >({ id: 'core.rootLifecycle', scope: 'root' });\n\n /**\n * The service reference for the root scoped {@link RootLoggerService}.\n *\n * @public\n */\n export const rootLogger = createServiceRef<\n import('./RootLoggerService').RootLoggerService\n >({ id: 'core.rootLogger', scope: 'root' });\n\n /**\n * The service reference for the plugin scoped {@link SchedulerService}.\n *\n * @public\n */\n export const scheduler = createServiceRef<\n import('./SchedulerService').SchedulerService\n >({ id: 'core.scheduler' });\n\n /**\n * The service reference for the plugin scoped {@link TokenManagerService}.\n *\n * @public\n * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead\n */\n export const tokenManager = createServiceRef<\n import('./TokenManagerService').TokenManagerService\n >({ id: 'core.tokenManager' });\n\n /**\n * The service reference for the plugin scoped {@link UrlReaderService}.\n *\n * @public\n */\n export const urlReader = createServiceRef<\n import('./UrlReaderService').UrlReaderService\n >({ id: 'core.urlReader' });\n\n /**\n * The service reference for the plugin scoped {@link IdentityService}.\n *\n * @public\n * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead\n */\n export const identity = createServiceRef<\n import('./IdentityService').IdentityService\n >({ id: 'core.identity' });\n}\n","/*\n * Copyright 2021 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 { Config, readDurationFromConfig } from '@backstage/config';\nimport { HumanDuration, JsonObject } from '@backstage/types';\nimport { Duration } from 'luxon';\n\n/**\n * A function that can be called as a scheduled task.\n *\n * It may optionally accept an abort signal argument. When the signal triggers,\n * processing should abort and return as quickly as possible.\n *\n * @public\n */\nexport type SchedulerServiceTaskFunction =\n | ((abortSignal: AbortSignal) => void | Promise<void>)\n | (() => void | Promise<void>);\n\n/**\n * A semi-opaque type to describe an actively scheduled task.\n *\n * @public\n */\nexport type SchedulerServiceTaskDescriptor = {\n /**\n * The unique identifier of the task.\n */\n id: string;\n /**\n * The scope of the task.\n */\n scope: 'global' | 'local';\n /**\n * The settings that control the task flow. This is a semi-opaque structure\n * that is mainly there for debugging purposes. Do not make any assumptions\n * about the contents of this field.\n */\n settings: { version: number } & JsonObject;\n};\n\n/**\n * Options that control the scheduling of a task.\n *\n * @public\n */\nexport interface SchedulerServiceTaskScheduleDefinition {\n /**\n * How often you want the task to run. The system does its best to avoid\n * overlapping invocations.\n *\n * @remarks\n *\n * This is the best effort value; under some circumstances there can be\n * deviations. For example, if the task runtime is longer than the frequency\n * and the timeout has not been given or not been exceeded yet, the next\n * invocation of this task will be delayed until after the previous one\n * finishes.\n *\n * This is a required field.\n */\n frequency:\n | {\n /**\n * A crontab style string.\n *\n * @remarks\n *\n * Overview:\n *\n * ```\n * ┌────────────── second (optional)\n * │ ┌──────────── minute\n * │ │ ┌────────── hour\n * │ │ │ ┌──────── day of month\n * │ │ │ │ ┌────── month\n * │ │ │ │ │ ┌──── day of week\n * │ │ │ │ │ │\n * │ │ │ │ │ │\n * * * * * * *\n * ```\n */\n cron: string;\n }\n | Duration\n | HumanDuration;\n\n /**\n * The maximum amount of time that a single task invocation can take, before\n * it's considered timed out and gets \"released\" such that a new invocation\n * is permitted to take place (possibly, then, on a different worker).\n */\n timeout: Duration | HumanDuration;\n\n /**\n * The amount of time that should pass before the first invocation happens.\n *\n * @remarks\n *\n * This can be useful in cold start scenarios to stagger or delay some heavy\n * compute jobs. If no value is given for this field then the first invocation\n * will happen as soon as possible according to the cadence.\n *\n * NOTE: This is a per-worker delay. If you have a cluster of workers all\n * collaborating on a task that has its `scope` field set to `'global'`, then\n * you may still see the task being processed by other long-lived workers,\n * while any given single worker is in its initial sleep delay time e.g. after\n * a deployment. Therefore, this parameter is not useful for \"globally\" pausing\n * work; its main intended use is for individual machines to get a chance to\n * reach some equilibrium at startup before triggering heavy batch workloads.\n */\n initialDelay?: Duration | HumanDuration;\n\n /**\n * Sets the scope of concurrency control / locking to apply for invocations of\n * this task.\n *\n * @remarks\n *\n * When the scope is set to the default value `'global'`, the scheduler will\n * attempt to ensure that only one worker machine runs the task at a time,\n * according to the given cadence. This means that as the number of worker\n * hosts increases, the invocation frequency of this task will not go up.\n * Instead, the load is spread randomly across hosts. This setting is useful\n * for tasks that access shared resources, for example catalog ingestion tasks\n * where you do not want many machines to repeatedly import the same data and\n * trample over each other.\n *\n * When the scope is set to `'local'`, there is no concurrency control across\n * hosts. Each host runs the task according to the given cadence similarly to\n * `setInterval`, but the runtime ensures that there are no overlapping runs.\n *\n * @defaultValue 'global'\n */\n scope?: 'global' | 'local';\n}\n\n/**\n * Config options for {@link SchedulerServiceTaskScheduleDefinition}\n * that control the scheduling of a task.\n *\n * @public\n */\nexport interface SchedulerServiceTaskScheduleDefinitionConfig {\n /**\n * How often you want the task to run. The system does its best to avoid\n * overlapping invocations.\n *\n * @remarks\n *\n * This is the best effort value; under some circumstances there can be\n * deviations. For example, if the task runtime is longer than the frequency\n * and the timeout has not been given or not been exceeded yet, the next\n * invocation of this task will be delayed until after the previous one\n * finishes.\n *\n * This is a required field.\n */\n frequency:\n | {\n /**\n * A crontab style string.\n *\n * @remarks\n *\n * Overview:\n *\n * ```\n * ┌────────────── second (optional)\n * │ ┌──────────── minute\n * │ │ ┌────────── hour\n * │ │ │ ┌──────── day of month\n * │ │ │ │ ┌────── month\n * │ │ │ │ │ ┌──── day of week\n * │ │ │ │ │ │\n * │ │ │ │ │ │\n * * * * * * *\n * ```\n */\n cron: string;\n }\n | string\n | HumanDuration;\n\n /**\n * The maximum amount of time that a single task invocation can take, before\n * it's considered timed out and gets \"released\" such that a new invocation\n * is permitted to take place (possibly, then, on a different worker).\n */\n timeout: string | HumanDuration;\n\n /**\n * The amount of time that should pass before the first invocation happens.\n *\n * @remarks\n *\n * This can be useful in cold start scenarios to stagger or delay some heavy\n * compute jobs. If no value is given for this field then the first invocation\n * will happen as soon as possible according to the cadence.\n *\n * NOTE: This is a per-worker delay. If you have a cluster of workers all\n * collaborating on a task that has its `scope` field set to `'global'`, then\n * you may still see the task being processed by other long-lived workers,\n * while any given single worker is in its initial sleep delay time e.g. after\n * a deployment. Therefore, this parameter is not useful for \"globally\" pausing\n * work; its main intended use is for individual machines to get a chance to\n * reach some equilibrium at startup before triggering heavy batch workloads.\n */\n initialDelay?: string | HumanDuration;\n\n /**\n * Sets the scope of concurrency control / locking to apply for invocations of\n * this task.\n *\n * @remarks\n *\n * When the scope is set to the default value `'global'`, the scheduler will\n * attempt to ensure that only one worker machine runs the task at a time,\n * according to the given cadence. This means that as the number of worker\n * hosts increases, the invocation frequency of this task will not go up.\n * Instead, the load is spread randomly across hosts. This setting is useful\n * for tasks that access shared resources, for example catalog ingestion tasks\n * where you do not want many machines to repeatedly import the same data and\n * trample over each other.\n *\n * When the scope is set to `'local'`, there is no concurrency control across\n * hosts. Each host runs the task according to the given cadence similarly to\n * `setInterval`, but the runtime ensures that there are no overlapping runs.\n *\n * @defaultValue 'global'\n */\n scope?: 'global' | 'local';\n}\n\n/**\n * Options that apply to the invocation of a given task.\n *\n * @public\n */\nexport interface SchedulerServiceTaskInvocationDefinition {\n /**\n * A unique ID (within the scope of the plugin) for the task.\n */\n id: string;\n\n /**\n * The actual task function to be invoked regularly.\n */\n fn: SchedulerServiceTaskFunction;\n\n /**\n * An abort signal that, when triggered, will stop the recurring execution of\n * the task.\n */\n signal?: AbortSignal;\n}\n\n/**\n * A previously prepared task schedule, ready to be invoked.\n *\n * @public\n */\nexport interface SchedulerServiceTaskRunner {\n /**\n * Takes the schedule and executes an actual task using it.\n *\n * @param task - The actual runtime properties of the task\n */\n run(task: SchedulerServiceTaskInvocationDefinition): Promise<void>;\n}\n\n/**\n * Deals with the scheduling of distributed tasks, for a given plugin.\n *\n * See the {@link https://backstage.io/docs/backend-system/core-services/scheduler | service documentation} for more details.\n *\n * @public\n */\nexport interface SchedulerService {\n /**\n * Manually triggers a task by ID.\n *\n * If the task doesn't exist, a NotFoundError is thrown. If the task is\n * currently running, a ConflictError is thrown.\n *\n * @param id - The task ID\n */\n triggerTask(id: string): Promise<void>;\n\n /**\n * Schedules a task function for recurring runs.\n *\n * @remarks\n *\n * The `scope` task field controls whether to use coordinated exclusive\n * invocation across workers, or to just coordinate within the current worker.\n *\n * This convenience method performs both the scheduling and invocation in one\n * go.\n *\n * @param task - The task definition\n */\n scheduleTask(\n task: SchedulerServiceTaskScheduleDefinition &\n SchedulerServiceTaskInvocationDefinition,\n ): Promise<void>;\n\n /**\n * Creates a scheduled but dormant recurring task, ready to be launched at a\n * later time.\n *\n * @remarks\n *\n * This method is useful for pre-creating a schedule in outer code to be\n * passed into an inner implementation, such that the outer code controls\n * scheduling while inner code controls implementation.\n *\n * @param schedule - The task schedule\n */\n createScheduledTaskRunner(\n schedule: SchedulerServiceTaskScheduleDefinition,\n ): SchedulerServiceTaskRunner;\n\n /**\n * Returns all scheduled tasks registered to this scheduler.\n *\n * @remarks\n *\n * This method is useful for triggering tasks manually using the triggerTask\n * functionality. Note that the returned tasks contain only tasks that have\n * been initialized in this instance of the scheduler.\n *\n * @returns Scheduled tasks\n */\n getScheduledTasks(): Promise<SchedulerServiceTaskDescriptor[]>;\n}\n\nfunction readDuration(config: Config, key: string): Duration | HumanDuration {\n if (typeof config.get(key) === 'string') {\n const value = config.getString(key);\n const duration = Duration.fromISO(value);\n if (!duration.isValid) {\n throw new Error(`Invalid duration: ${value}`);\n }\n return duration;\n }\n\n return readDurationFromConfig(config, { key });\n}\n\nfunction readCronOrDuration(\n config: Config,\n key: string,\n): { cron: string } | Duration | HumanDuration {\n const value = config.get(key);\n if (typeof value === 'object' && (value as { cron?: string }).cron) {\n return value as { cron: string };\n }\n\n return readDuration(config, key);\n}\n\n/**\n * Reads a {@link SchedulerServiceTaskScheduleDefinition} from config. Expects\n * the config not to be the root config, but the config for the definition.\n *\n * @param config - config for a TaskScheduleDefinition.\n * @public\n */\nexport function readSchedulerServiceTaskScheduleDefinitionFromConfig(\n config: Config,\n): SchedulerServiceTaskScheduleDefinition {\n const frequency = readCronOrDuration(config, 'frequency');\n const timeout = readDuration(config, 'timeout');\n\n const initialDelay = config.has('initialDelay')\n ? readDuration(config, 'initialDelay')\n : undefined;\n\n const scope = config.getOptionalString('scope');\n if (scope && !['global', 'local'].includes(scope)) {\n throw new Error(\n `Only \"global\" or \"local\" are allowed for TaskScheduleDefinition.scope, but got: ${scope}`,\n );\n }\n\n return {\n frequency,\n timeout,\n initialDelay,\n scope: scope as 'global' | 'local' | undefined,\n };\n}\n","/*\n * Copyright 2021 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\n/**\n * Tries to deduce whether a thrown error is a database conflict.\n *\n * @public\n * @param e - A thrown error\n * @returns True if the error looks like it was a conflict error thrown by a\n * known database engine\n */\nexport function isDatabaseConflictError(e: unknown) {\n const message = (e as any)?.message;\n\n return (\n typeof message === 'string' &&\n (/SQLITE_CONSTRAINT(?:_UNIQUE)?: UNIQUE/.test(message) ||\n /UNIQUE constraint failed:/.test(message) ||\n /unique constraint/.test(message) ||\n /Duplicate entry/.test(message)) // MySQL uniqueness error msg\n );\n}\n","/*\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 { BackendFeature, BackendFeatureFactory } from '../types';\nimport {\n BackendModuleRegistrationPoints,\n BackendPluginRegistrationPoints,\n ExtensionPoint,\n InternalBackendModuleRegistration,\n InternalBackendPluginRegistration,\n} from './types';\n\n/**\n * The configuration options passed to {@link createExtensionPoint}.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/extension-points | The architecture of extension points}\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\nexport interface CreateExtensionPointOptions {\n /**\n * The ID of this extension point.\n *\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\n id: string;\n}\n\n/**\n * Creates a new backend extension point.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/extension-points | The architecture of extension points}\n */\nexport function createExtensionPoint<T>(\n options: CreateExtensionPointOptions,\n): ExtensionPoint<T> {\n return {\n id: options.id,\n get T(): T {\n throw new Error(`tried to read ExtensionPoint.T of ${this}`);\n },\n toString() {\n return `extensionPoint{${options.id}}`;\n },\n $$type: '@backstage/ExtensionPoint',\n };\n}\n\n/**\n * The configuration options passed to {@link createBackendPlugin}.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/plugins | The architecture of plugins}\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\nexport interface CreateBackendPluginOptions {\n /**\n * The ID of this plugin.\n *\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\n pluginId: string;\n register(reg: BackendPluginRegistrationPoints): void;\n}\n\n/**\n * Creates a new backend plugin.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/plugins | The architecture of plugins}\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\nexport function createBackendPlugin(\n options: CreateBackendPluginOptions,\n): () => BackendFeature {\n const factory: BackendFeatureFactory = () => {\n let registrations: InternalBackendPluginRegistration[];\n\n return {\n $$type: '@backstage/BackendFeature',\n version: 'v1',\n getRegistrations() {\n if (registrations) {\n return registrations;\n }\n const extensionPoints: InternalBackendPluginRegistration['extensionPoints'] =\n [];\n let init: InternalBackendPluginRegistration['init'] | undefined =\n undefined;\n\n options.register({\n registerExtensionPoint(ext, impl) {\n if (init) {\n throw new Error(\n 'registerExtensionPoint called after registerInit',\n );\n }\n extensionPoints.push([ext, impl]);\n },\n registerInit(regInit) {\n if (init) {\n throw new Error('registerInit must only be called once');\n }\n init = {\n deps: regInit.deps,\n func: regInit.init,\n };\n },\n });\n\n if (!init) {\n throw new Error(\n `registerInit was not called by register in ${options.pluginId}`,\n );\n }\n\n registrations = [\n {\n type: 'plugin',\n pluginId: options.pluginId,\n extensionPoints,\n init,\n },\n ];\n return registrations;\n },\n };\n };\n factory.$$type = '@backstage/BackendFeatureFactory';\n\n return factory;\n}\n\n/**\n * The configuration options passed to {@link createBackendModule}.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/modules | The architecture of modules}\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\nexport interface CreateBackendModuleOptions {\n /**\n * Should exactly match the `id` of the plugin that the module extends.\n *\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\n pluginId: string;\n\n /**\n * The ID of this module, used to identify the module and ensure that it is not installed twice.\n */\n moduleId: string;\n register(reg: BackendModuleRegistrationPoints): void;\n}\n\n/**\n * Creates a new backend module for a given plugin.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/modules | The architecture of modules}\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\nexport function createBackendModule(\n options: CreateBackendModuleOptions,\n): () => BackendFeature {\n const factory: BackendFeatureFactory = () => {\n let registrations: InternalBackendModuleRegistration[];\n\n return {\n $$type: '@backstage/BackendFeature',\n version: 'v1',\n getRegistrations() {\n if (registrations) {\n return registrations;\n }\n const extensionPoints: InternalBackendPluginRegistration['extensionPoints'] =\n [];\n let init: InternalBackendModuleRegistration['init'] | undefined =\n undefined;\n\n options.register({\n registerExtensionPoint(ext, impl) {\n if (init) {\n throw new Error(\n 'registerExtensionPoint called after registerInit',\n );\n }\n extensionPoints.push([ext, impl]);\n },\n registerInit(regInit) {\n if (init) {\n throw new Error('registerInit must only be called once');\n }\n init = {\n deps: regInit.deps,\n func: regInit.init,\n };\n },\n });\n\n if (!init) {\n throw new Error(\n `registerInit was not called by register in ${options.moduleId} module for ${options.pluginId}`,\n );\n }\n\n registrations = [\n {\n type: 'module',\n pluginId: options.pluginId,\n moduleId: options.moduleId,\n extensionPoints,\n init,\n },\n ];\n return registrations;\n },\n };\n };\n factory.$$type = '@backstage/BackendFeatureFactory';\n\n return factory;\n}\n"],"names":["c","coreServices","config","Duration","readDurationFromConfig"],"mappings":";;;;;;;;;;AAyGO,SAAS,iBACd,MAC2B,EAAA;AAC3B,EAAA,MAAM,EAAE,EAAA,EAAI,KAAQ,GAAA,QAAA,EAAU,gBAAmB,GAAA,MAAA,CAAA;AACjD,EAAO,OAAA;AAAA,IACL,EAAA;AAAA,IACA,KAAA;AAAA,IACA,IAAI,CAAc,GAAA;AAChB,MAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,IAAI,CAAE,CAAA,CAAA,CAAA;AAAA,KACzD;AAAA,IACA,QAAW,GAAA;AACT,MAAO,OAAA,CAAA,WAAA,EAAc,OAAO,EAAE,CAAA,CAAA,CAAA,CAAA;AAAA,KAChC;AAAA,IACA,MAAQ,EAAA,uBAAA;AAAA,IACR,gBAAkB,EAAA,cAAA;AAAA,GACpB,CAAA;AAKF,CAAA;AAyHO,SAAS,qBAOd,MASoC,EAAA;AACpC,EAAA,MAAM,cAAiB,GAAA,OAAO,MAAW,KAAA,UAAA,GAAa,SAAS,MAAM,MAAA,CAAA;AACrE,EAAM,MAAA,OAAA,GAAU,CACd,OACwD,KAAA;AACxD,IAAM,MAAA,OAAA,GAAU,eAAe,OAAO,CAAA,CAAA;AACtC,IAAI,IAAA,OAAA,CAAQ,OAAQ,CAAA,KAAA,KAAU,MAAQ,EAAA;AACpC,MAAA,MAAMA,EAAI,G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AAAA,WAC/F,CAAA;AAAA,SACF;AAEA,QAAgB,aAAA,GAAA;AAAA,UACd;AAAA,YACE,IAAM,EAAA,QAAA;AAAA,YACN,UAAU,OAAQ,CAAA,QAAA;AAAA,YAClB,UAAU,OAAQ,CAAA,QAAA;AAAA,YAClB,eAAA;AAAA,YACA,IAAA;AAAA,WACF;AAAA,SACF,CAAA;AACA,QAAO,OAAA,aAAA,CAAA;AAAA,OACT;AAAA,KACF,CAAA;AAAA,GACF,CAAA;AACA,EAAA,OAAA,CAAQ,MAAS,GAAA,kCAAA,CAAA;AAEjB,EAAO,OAAA,OAAA,CAAA;AACT;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/services/system/types.ts","../src/services/definitions/coreServices.ts","../src/services/definitions/SchedulerService.ts","../src/services/utilities/database.ts","../src/wiring/factories.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 { BackendFeature } from '../../types';\n\n/**\n * TODO\n *\n * @public\n */\nexport type ServiceRef<\n TService,\n TScope extends 'root' | 'plugin' = 'root' | 'plugin',\n> = {\n id: string;\n\n /**\n * This determines the scope at which this service is available.\n *\n * Root scoped services are available to all other services but\n * may only depend on other root scoped services.\n *\n * Plugin scoped services are only available to other plugin scoped\n * services but may depend on all other services.\n */\n scope: TScope;\n\n /**\n * Utility for getting the type of the service, using `typeof serviceRef.T`.\n * Attempting to actually read this value will result in an exception.\n */\n T: TService;\n\n $$type: '@backstage/ServiceRef';\n};\n\n/** @public */\nexport interface ServiceFactory<\n TService = unknown,\n TScope extends 'plugin' | 'root' = 'plugin' | 'root',\n> extends BackendFeature {\n service: ServiceRef<TService, TScope>;\n}\n\n/** @internal */\nexport interface InternalServiceFactory<\n TService = unknown,\n TScope extends 'plugin' | 'root' = 'plugin' | 'root',\n> extends ServiceFactory<TService, TScope> {\n version: 'v1';\n initialization?: 'always' | 'lazy';\n deps: { [key in string]: ServiceRef<unknown> };\n createRootContext?(deps: { [key in string]: unknown }): Promise<unknown>;\n factory(\n deps: { [key in string]: unknown },\n context: unknown,\n ): Promise<TService>;\n}\n\n/**\n * Represents either a {@link ServiceFactory} or a function that returns one.\n *\n * @public\n */\nexport type ServiceFactoryOrFunction = ServiceFactory | (() => ServiceFactory);\n\n/** @public */\nexport interface ServiceRefConfig<TService, TScope extends 'root' | 'plugin'> {\n id: string;\n scope?: TScope;\n defaultFactory?: (\n service: ServiceRef<TService, TScope>,\n ) => Promise<ServiceFactoryOrFunction>;\n}\n\n/**\n * Creates a new service definition. This overload is used to create plugin scoped services.\n *\n * @public\n */\nexport function createServiceRef<TService>(\n config: ServiceRefConfig<TService, 'plugin'>,\n): ServiceRef<TService, 'plugin'>;\n\n/**\n * Creates a new service definition. This overload is used to create root scoped services.\n *\n * @public\n */\nexport function createServiceRef<TService>(\n config: ServiceRefConfig<TService, 'root'>,\n): ServiceRef<TService, 'root'>;\nexport function createServiceRef<TService>(\n config: ServiceRefConfig<TService, any>,\n): ServiceRef<TService, any> {\n const { id, scope = 'plugin', defaultFactory } = config;\n return {\n id,\n scope,\n get T(): TService {\n throw new Error(`tried to read ServiceRef.T of ${this}`);\n },\n toString() {\n return `serviceRef{${config.id}}`;\n },\n $$type: '@backstage/ServiceRef',\n __defaultFactory: defaultFactory,\n } as ServiceRef<TService, typeof scope> & {\n __defaultFactory?: (\n service: ServiceRef<TService>,\n ) => Promise<ServiceFactory<TService> | (() => ServiceFactory<TService>)>;\n };\n}\n\n/** @ignore */\ntype ServiceRefsToInstances<\n T extends { [key in string]: ServiceRef<unknown> },\n TScope extends 'root' | 'plugin' = 'root' | 'plugin',\n> = {\n [key in keyof T as T[key]['scope'] extends TScope ? key : never]: T[key]['T'];\n};\n\n/** @public */\nexport interface RootServiceFactoryConfig<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown> },\n> {\n /**\n * The initialization strategy for the service factory. This service is root scoped and will use `always` by default.\n *\n * @remarks\n *\n * - `always` - The service will always be initialized regardless if it is used or not.\n * - `lazy` - The service will only be initialized if it is depended on by a different service or feature.\n *\n * Service factories for root scoped services use `always` as the default, while plugin scoped services use `lazy`.\n */\n initialization?: 'always' | 'lazy';\n service: ServiceRef<TService, 'root'>;\n deps: TDeps;\n factory(deps: ServiceRefsToInstances<TDeps, 'root'>): TImpl | Promise<TImpl>;\n}\n\n/** @public */\nexport interface PluginServiceFactoryConfig<\n TService,\n TContext,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown> },\n> {\n /**\n * The initialization strategy for the service factory. This service is plugin scoped and will use `lazy` by default.\n *\n * @remarks\n *\n * - `always` - The service will always be initialized regardless if it is used or not.\n * - `lazy` - The service will only be initialized if it is depended on by a different service or feature.\n *\n * Service factories for root scoped services use `always` as the default, while plugin scoped services use `lazy`.\n */\n initialization?: 'always' | 'lazy';\n service: ServiceRef<TService, 'plugin'>;\n deps: TDeps;\n createRootContext?(\n deps: ServiceRefsToInstances<TDeps, 'root'>,\n ): TContext | Promise<TContext>;\n factory(\n deps: ServiceRefsToInstances<TDeps>,\n context: TContext,\n ): TImpl | Promise<TImpl>;\n}\n\n/**\n * Creates a root scoped service factory without options.\n *\n * @public\n * @param config - The service factory configuration.\n */\nexport function createServiceFactory<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown, 'root'> },\n TOpts extends object | undefined = undefined,\n>(\n config: RootServiceFactoryConfig<TService, TImpl, TDeps>,\n): () => ServiceFactory<TService, 'root'>;\n/**\n * Creates a root scoped service factory with optional options.\n *\n * @public\n * @param config - The service factory configuration.\n */\nexport function createServiceFactory<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown, 'root'> },\n TOpts extends object | undefined = undefined,\n>(\n config: (options?: TOpts) => RootServiceFactoryConfig<TService, TImpl, TDeps>,\n): (options?: TOpts) => ServiceFactory<TService, 'root'>;\n/**\n * Creates a plugin scoped service factory without options.\n *\n * @public\n * @param config - The service factory configuration.\n */\nexport function createServiceFactory<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown> },\n TContext = undefined,\n TOpts extends object | undefined = undefined,\n>(\n config: PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>,\n): () => ServiceFactory<TService, 'plugin'>;\n/**\n * Creates a plugin scoped service factory with optional options.\n *\n * @public\n * @param config - The service factory configuration.\n */\nexport function createServiceFactory<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown> },\n TContext = undefined,\n TOpts extends object | undefined = undefined,\n>(\n config: (\n options?: TOpts,\n ) => PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>,\n): (options?: TOpts) => ServiceFactory<TService, 'plugin'>;\nexport function createServiceFactory<\n TService,\n TImpl extends TService,\n TDeps extends { [name in string]: ServiceRef<unknown> },\n TContext,\n TOpts extends object | undefined = undefined,\n>(\n config:\n | RootServiceFactoryConfig<TService, TImpl, TDeps>\n | PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>\n | ((options: TOpts) => RootServiceFactoryConfig<TService, TImpl, TDeps>)\n | ((\n options: TOpts,\n ) => PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>)\n | (() => RootServiceFactoryConfig<TService, TImpl, TDeps>)\n | (() => PluginServiceFactoryConfig<TService, TContext, TImpl, TDeps>),\n): (options: TOpts) => ServiceFactory {\n const configCallback = typeof config === 'function' ? config : () => config;\n const factory = (\n options: TOpts,\n ): InternalServiceFactory<TService, 'plugin' | 'root'> => {\n const anyConf = configCallback(options);\n if (anyConf.service.scope === 'root') {\n const c = anyConf as RootServiceFactoryConfig<TService, TImpl, TDeps>;\n return {\n $$type: '@backstage/BackendFeature',\n version: 'v1',\n service: c.service,\n initialization: c.initialization,\n deps: c.deps,\n factory: async (deps: TDeps) => c.factory(deps),\n };\n }\n const c = anyConf as PluginServiceFactoryConfig<\n TService,\n TContext,\n TImpl,\n TDeps\n >;\n return {\n $$type: '@backstage/BackendFeature',\n version: 'v1',\n service: c.service,\n initialization: c.initialization,\n ...('createRootContext' in c\n ? {\n createRootContext: async (deps: TDeps) =>\n c?.createRootContext?.(deps),\n }\n : {}),\n deps: c.deps,\n factory: async (deps: TDeps, ctx: TContext) => c.factory(deps, ctx),\n };\n };\n\n factory.$$type = '@backstage/BackendFeatureFactory';\n\n return factory;\n}\n","/*\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 * 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 * 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 * 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 * Deprecated service authentication service, use the `auth` service instead.\n *\n * See {@link TokenManagerService}\n * and {@link https://backstage.io/docs/backend-system/core-services/token-manager | the service docs}\n * for more information.\n *\n * @public\n * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead\n */\n export const tokenManager = createServiceRef<\n import('./TokenManagerService').TokenManagerService\n >({ id: 'core.tokenManager' });\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 /**\n * Deprecated user authentication service, use the `auth` service instead.\n *\n * See {@link IdentityService}\n * and {@link https://backstage.io/docs/backend-system/core-services/identity | the service docs}\n * for more information.\n *\n * @public\n * @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead\n */\n export const identity = createServiceRef<\n import('./IdentityService').IdentityService\n >({ id: 'core.identity' });\n}\n","/*\n * Copyright 2021 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 { Config, readDurationFromConfig } from '@backstage/config';\nimport { HumanDuration, JsonObject } from '@backstage/types';\nimport { Duration } from 'luxon';\n\n/**\n * A function that can be called as a scheduled task.\n *\n * It may optionally accept an abort signal argument. When the signal triggers,\n * processing should abort and return as quickly as possible.\n *\n * @public\n */\nexport type SchedulerServiceTaskFunction =\n | ((abortSignal: AbortSignal) => void | Promise<void>)\n | (() => void | Promise<void>);\n\n/**\n * A semi-opaque type to describe an actively scheduled task.\n *\n * @public\n */\nexport type SchedulerServiceTaskDescriptor = {\n /**\n * The unique identifier of the task.\n */\n id: string;\n /**\n * The scope of the task.\n */\n scope: 'global' | 'local';\n /**\n * The settings that control the task flow. This is a semi-opaque structure\n * that is mainly there for debugging purposes. Do not make any assumptions\n * about the contents of this field.\n */\n settings: { version: number } & JsonObject;\n};\n\n/**\n * Options that control the scheduling of a task.\n *\n * @public\n */\nexport interface SchedulerServiceTaskScheduleDefinition {\n /**\n * How often you want the task to run. The system does its best to avoid\n * overlapping invocations.\n *\n * @remarks\n *\n * This is the best effort value; under some circumstances there can be\n * deviations. For example, if the task runtime is longer than the frequency\n * and the timeout has not been given or not been exceeded yet, the next\n * invocation of this task will be delayed until after the previous one\n * finishes.\n *\n * This is a required field.\n */\n frequency:\n | {\n /**\n * A crontab style string.\n *\n * @remarks\n *\n * Overview:\n *\n * ```\n * ┌────────────── second (optional)\n * │ ┌──────────── minute\n * │ │ ┌────────── hour\n * │ │ │ ┌──────── day of month\n * │ │ │ │ ┌────── month\n * │ │ │ │ │ ┌──── day of week\n * │ │ │ │ │ │\n * │ │ │ │ │ │\n * * * * * * *\n * ```\n */\n cron: string;\n }\n | Duration\n | HumanDuration;\n\n /**\n * The maximum amount of time that a single task invocation can take, before\n * it's considered timed out and gets \"released\" such that a new invocation\n * is permitted to take place (possibly, then, on a different worker).\n */\n timeout: Duration | HumanDuration;\n\n /**\n * The amount of time that should pass before the first invocation happens.\n *\n * @remarks\n *\n * This can be useful in cold start scenarios to stagger or delay some heavy\n * compute jobs. If no value is given for this field then the first invocation\n * will happen as soon as possible according to the cadence.\n *\n * NOTE: This is a per-worker delay. If you have a cluster of workers all\n * collaborating on a task that has its `scope` field set to `'global'`, then\n * you may still see the task being processed by other long-lived workers,\n * while any given single worker is in its initial sleep delay time e.g. after\n * a deployment. Therefore, this parameter is not useful for \"globally\" pausing\n * work; its main intended use is for individual machines to get a chance to\n * reach some equilibrium at startup before triggering heavy batch workloads.\n */\n initialDelay?: Duration | HumanDuration;\n\n /**\n * Sets the scope of concurrency control / locking to apply for invocations of\n * this task.\n *\n * @remarks\n *\n * When the scope is set to the default value `'global'`, the scheduler will\n * attempt to ensure that only one worker machine runs the task at a time,\n * according to the given cadence. This means that as the number of worker\n * hosts increases, the invocation frequency of this task will not go up.\n * Instead, the load is spread randomly across hosts. This setting is useful\n * for tasks that access shared resources, for example catalog ingestion tasks\n * where you do not want many machines to repeatedly import the same data and\n * trample over each other.\n *\n * When the scope is set to `'local'`, there is no concurrency control across\n * hosts. Each host runs the task according to the given cadence similarly to\n * `setInterval`, but the runtime ensures that there are no overlapping runs.\n *\n * @defaultValue 'global'\n */\n scope?: 'global' | 'local';\n}\n\n/**\n * Config options for {@link SchedulerServiceTaskScheduleDefinition}\n * that control the scheduling of a task.\n *\n * @public\n */\nexport interface SchedulerServiceTaskScheduleDefinitionConfig {\n /**\n * How often you want the task to run. The system does its best to avoid\n * overlapping invocations.\n *\n * @remarks\n *\n * This is the best effort value; under some circumstances there can be\n * deviations. For example, if the task runtime is longer than the frequency\n * and the timeout has not been given or not been exceeded yet, the next\n * invocation of this task will be delayed until after the previous one\n * finishes.\n *\n * This is a required field.\n */\n frequency:\n | {\n /**\n * A crontab style string.\n *\n * @remarks\n *\n * Overview:\n *\n * ```\n * ┌────────────── second (optional)\n * │ ┌──────────── minute\n * │ │ ┌────────── hour\n * │ │ │ ┌──────── day of month\n * │ │ │ │ ┌────── month\n * │ │ │ │ │ ┌──── day of week\n * │ │ │ │ │ │\n * │ │ │ │ │ │\n * * * * * * *\n * ```\n */\n cron: string;\n }\n | string\n | HumanDuration;\n\n /**\n * The maximum amount of time that a single task invocation can take, before\n * it's considered timed out and gets \"released\" such that a new invocation\n * is permitted to take place (possibly, then, on a different worker).\n */\n timeout: string | HumanDuration;\n\n /**\n * The amount of time that should pass before the first invocation happens.\n *\n * @remarks\n *\n * This can be useful in cold start scenarios to stagger or delay some heavy\n * compute jobs. If no value is given for this field then the first invocation\n * will happen as soon as possible according to the cadence.\n *\n * NOTE: This is a per-worker delay. If you have a cluster of workers all\n * collaborating on a task that has its `scope` field set to `'global'`, then\n * you may still see the task being processed by other long-lived workers,\n * while any given single worker is in its initial sleep delay time e.g. after\n * a deployment. Therefore, this parameter is not useful for \"globally\" pausing\n * work; its main intended use is for individual machines to get a chance to\n * reach some equilibrium at startup before triggering heavy batch workloads.\n */\n initialDelay?: string | HumanDuration;\n\n /**\n * Sets the scope of concurrency control / locking to apply for invocations of\n * this task.\n *\n * @remarks\n *\n * When the scope is set to the default value `'global'`, the scheduler will\n * attempt to ensure that only one worker machine runs the task at a time,\n * according to the given cadence. This means that as the number of worker\n * hosts increases, the invocation frequency of this task will not go up.\n * Instead, the load is spread randomly across hosts. This setting is useful\n * for tasks that access shared resources, for example catalog ingestion tasks\n * where you do not want many machines to repeatedly import the same data and\n * trample over each other.\n *\n * When the scope is set to `'local'`, there is no concurrency control across\n * hosts. Each host runs the task according to the given cadence similarly to\n * `setInterval`, but the runtime ensures that there are no overlapping runs.\n *\n * @defaultValue 'global'\n */\n scope?: 'global' | 'local';\n}\n\n/**\n * Options that apply to the invocation of a given task.\n *\n * @public\n */\nexport interface SchedulerServiceTaskInvocationDefinition {\n /**\n * A unique ID (within the scope of the plugin) for the task.\n */\n id: string;\n\n /**\n * The actual task function to be invoked regularly.\n */\n fn: SchedulerServiceTaskFunction;\n\n /**\n * An abort signal that, when triggered, will stop the recurring execution of\n * the task.\n */\n signal?: AbortSignal;\n}\n\n/**\n * A previously prepared task schedule, ready to be invoked.\n *\n * @public\n */\nexport interface SchedulerServiceTaskRunner {\n /**\n * Takes the schedule and executes an actual task using it.\n *\n * @param task - The actual runtime properties of the task\n */\n run(task: SchedulerServiceTaskInvocationDefinition): Promise<void>;\n}\n\n/**\n * Deals with the scheduling of distributed tasks, for a given plugin.\n *\n * See the {@link https://backstage.io/docs/backend-system/core-services/scheduler | service documentation} for more details.\n *\n * @public\n */\nexport interface SchedulerService {\n /**\n * Manually triggers a task by ID.\n *\n * If the task doesn't exist, a NotFoundError is thrown. If the task is\n * currently running, a ConflictError is thrown.\n *\n * @param id - The task ID\n */\n triggerTask(id: string): Promise<void>;\n\n /**\n * Schedules a task function for recurring runs.\n *\n * @remarks\n *\n * The `scope` task field controls whether to use coordinated exclusive\n * invocation across workers, or to just coordinate within the current worker.\n *\n * This convenience method performs both the scheduling and invocation in one\n * go.\n *\n * @param task - The task definition\n */\n scheduleTask(\n task: SchedulerServiceTaskScheduleDefinition &\n SchedulerServiceTaskInvocationDefinition,\n ): Promise<void>;\n\n /**\n * Creates a scheduled but dormant recurring task, ready to be launched at a\n * later time.\n *\n * @remarks\n *\n * This method is useful for pre-creating a schedule in outer code to be\n * passed into an inner implementation, such that the outer code controls\n * scheduling while inner code controls implementation.\n *\n * @param schedule - The task schedule\n */\n createScheduledTaskRunner(\n schedule: SchedulerServiceTaskScheduleDefinition,\n ): SchedulerServiceTaskRunner;\n\n /**\n * Returns all scheduled tasks registered to this scheduler.\n *\n * @remarks\n *\n * This method is useful for triggering tasks manually using the triggerTask\n * functionality. Note that the returned tasks contain only tasks that have\n * been initialized in this instance of the scheduler.\n *\n * @returns Scheduled tasks\n */\n getScheduledTasks(): Promise<SchedulerServiceTaskDescriptor[]>;\n}\n\nfunction readDuration(config: Config, key: string): Duration | HumanDuration {\n if (typeof config.get(key) === 'string') {\n const value = config.getString(key);\n const duration = Duration.fromISO(value);\n if (!duration.isValid) {\n throw new Error(`Invalid duration: ${value}`);\n }\n return duration;\n }\n\n return readDurationFromConfig(config, { key });\n}\n\nfunction readCronOrDuration(\n config: Config,\n key: string,\n): { cron: string } | Duration | HumanDuration {\n const value = config.get(key);\n if (typeof value === 'object' && (value as { cron?: string }).cron) {\n return value as { cron: string };\n }\n\n return readDuration(config, key);\n}\n\n/**\n * Reads a {@link SchedulerServiceTaskScheduleDefinition} from config. Expects\n * the config not to be the root config, but the config for the definition.\n *\n * @param config - config for a TaskScheduleDefinition.\n * @public\n */\nexport function readSchedulerServiceTaskScheduleDefinitionFromConfig(\n config: Config,\n): SchedulerServiceTaskScheduleDefinition {\n const frequency = readCronOrDuration(config, 'frequency');\n const timeout = readDuration(config, 'timeout');\n\n const initialDelay = config.has('initialDelay')\n ? readDuration(config, 'initialDelay')\n : undefined;\n\n const scope = config.getOptionalString('scope');\n if (scope && !['global', 'local'].includes(scope)) {\n throw new Error(\n `Only \"global\" or \"local\" are allowed for TaskScheduleDefinition.scope, but got: ${scope}`,\n );\n }\n\n return {\n frequency,\n timeout,\n initialDelay,\n scope: scope as 'global' | 'local' | undefined,\n };\n}\n","/*\n * Copyright 2021 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\n/**\n * Tries to deduce whether a thrown error is a database conflict.\n *\n * @public\n * @param e - A thrown error\n * @returns True if the error looks like it was a conflict error thrown by a\n * known database engine\n */\nexport function isDatabaseConflictError(e: unknown) {\n const message = (e as any)?.message;\n\n return (\n typeof message === 'string' &&\n (/SQLITE_CONSTRAINT(?:_UNIQUE)?: UNIQUE/.test(message) ||\n /UNIQUE constraint failed:/.test(message) ||\n /unique constraint/.test(message) ||\n /Duplicate entry/.test(message)) // MySQL uniqueness error msg\n );\n}\n","/*\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 { BackendFeatureCompat } from '../types';\nimport {\n BackendModuleRegistrationPoints,\n BackendPluginRegistrationPoints,\n ExtensionPoint,\n InternalBackendModuleRegistration,\n InternalBackendPluginRegistration,\n} from './types';\n\n/**\n * The configuration options passed to {@link createExtensionPoint}.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/extension-points | The architecture of extension points}\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\nexport interface CreateExtensionPointOptions {\n /**\n * The ID of this extension point.\n *\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\n id: string;\n}\n\n/**\n * Creates a new backend extension point.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/extension-points | The architecture of extension points}\n */\nexport function createExtensionPoint<T>(\n options: CreateExtensionPointOptions,\n): ExtensionPoint<T> {\n return {\n id: options.id,\n get T(): T {\n if (process.env.NODE_ENV === 'test') {\n // Avoid throwing errors so tests asserting extensions' properties cannot be easily broken\n return null as T;\n }\n throw new Error(`tried to read ExtensionPoint.T of ${this}`);\n },\n toString() {\n return `extensionPoint{${options.id}}`;\n },\n $$type: '@backstage/ExtensionPoint',\n };\n}\n\n/**\n * The configuration options passed to {@link createBackendPlugin}.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/plugins | The architecture of plugins}\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\nexport interface CreateBackendPluginOptions {\n /**\n * The ID of this plugin.\n *\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\n pluginId: string;\n register(reg: BackendPluginRegistrationPoints): void;\n}\n\n/**\n * Creates a new backend plugin.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/plugins | The architecture of plugins}\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\nexport function createBackendPlugin(\n options: CreateBackendPluginOptions,\n): BackendFeatureCompat {\n function getRegistrations() {\n const extensionPoints: InternalBackendPluginRegistration['extensionPoints'] =\n [];\n let init: InternalBackendPluginRegistration['init'] | undefined = undefined;\n\n options.register({\n registerExtensionPoint(ext, impl) {\n if (init) {\n throw new Error('registerExtensionPoint called after registerInit');\n }\n extensionPoints.push([ext, impl]);\n },\n registerInit(regInit) {\n if (init) {\n throw new Error('registerInit must only be called once');\n }\n init = {\n deps: regInit.deps,\n func: regInit.init,\n };\n },\n });\n\n if (!init) {\n throw new Error(\n `registerInit was not called by register in ${options.pluginId}`,\n );\n }\n\n return [\n {\n type: 'plugin',\n pluginId: options.pluginId,\n extensionPoints,\n init,\n },\n ];\n }\n\n function backendFeatureCompatWrapper() {\n return backendFeatureCompatWrapper;\n }\n\n Object.assign(backendFeatureCompatWrapper, {\n $$type: '@backstage/BackendFeature' as const,\n version: 'v1',\n getRegistrations,\n });\n\n return backendFeatureCompatWrapper as BackendFeatureCompat;\n}\n\n/**\n * The configuration options passed to {@link createBackendModule}.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/modules | The architecture of modules}\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\nexport interface CreateBackendModuleOptions {\n /**\n * Should exactly match the `id` of the plugin that the module extends.\n *\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\n pluginId: string;\n\n /**\n * The ID of this module, used to identify the module and ensure that it is not installed twice.\n */\n moduleId: string;\n register(reg: BackendModuleRegistrationPoints): void;\n}\n\n/**\n * Creates a new backend module for a given plugin.\n *\n * @public\n * @see {@link https://backstage.io/docs/backend-system/architecture/modules | The architecture of modules}\n * @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}\n */\nexport function createBackendModule(\n options: CreateBackendModuleOptions,\n): BackendFeatureCompat {\n function getRegistrations() {\n const extensionPoints: InternalBackendPluginRegistration['extensionPoints'] =\n [];\n let init: InternalBackendModuleRegistration['init'] | undefined = undefined;\n\n options.register({\n registerExtensionPoint(ext, impl) {\n if (init) {\n throw new Error('registerExtensionPoint called after registerInit');\n }\n extensionPoints.push([ext, impl]);\n },\n registerInit(regInit) {\n if (init) {\n throw new Error('registerInit must only be called once');\n }\n init = {\n deps: regInit.deps,\n func: regInit.init,\n };\n },\n });\n\n if (!init) {\n throw new Error(\n `registerInit was not called by register in ${options.moduleId} module for ${options.pluginId}`,\n );\n }\n\n return [\n {\n type: 'module',\n pluginId: options.pluginId,\n moduleId: options.moduleId,\n extensionPoints,\n init,\n },\n ];\n }\n\n function backendFeatureCompatWrapper() {\n return backendFeatureCompatWrapper;\n }\n\n Object.assign(backendFeatureCompatWrapper, {\n $$type: '@backstage/BackendFeature' as const,\n version: 'v1',\n getRegistrations,\n });\n\n return backendFeatureCompatWrapper as BackendFeatureCompat;\n}\n"],"names":["c","coreServices","config","Duration","readDurationFromConfig"],"mappings":";;;;;;;;;;AAyGO,SAAS,iBACd,MAC2B,EAAA;AAC3B,EAAA,MAAM,EAAE,EAAA,EAAI,KAAQ,GAAA,QAAA,EAAU,gBAAmB,GAAA,MAAA,CAAA;AACjD,EAAO,OAAA;AAAA,IACL,EAAA;AAAA,IACA,KAAA;AAAA,IACA,IAAI,CAAc,GAAA;AAChB,MAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,IAAI,CAAE,CAAA,CAAA,CAAA;AAAA,KACzD;AAAA,IACA,QAAW,GAAA;AACT,MAAO,OAAA,CAAA,WAAA,EAAc,OAAO,EAAE,CAAA,CAAA,CAAA,CAAA;AAAA,KAChC;AAAA,IACA,MAAQ,EAAA,uBAAA;AAAA,IACR,gBAAkB,EAAA,cAAA;AAAA,GACpB,CAAA;AAKF,CAAA;AAyHO,SAAS,qBAOd,MASoC,EAAA;AACpC,EAAA,MAAM,cAAiB,GAAA,OAAO,MAAW,KAAA,UAAA,GAAa,SAAS,MAAM,MAAA,CAAA;AACrE,EAAM,MAAA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AO,OAAA;AAAA,MACL;AAAA,QACE,IAAM,EAAA,QAAA;AAAA,QACN,UAAU,OAAQ,CAAA,QAAA;AAAA,QAClB,UAAU,OAAQ,CAAA,QAAA;AAAA,QAClB,eAAA;AAAA,QACA,IAAA;AAAA,OACF;AAAA,KACF,CAAA;AAAA,GACF;AAEA,EAAA,SAAS,2BAA8B,GAAA;AACrC,IAAO,OAAA,2BAAA,CAAA;AAAA,GACT;AAEA,EAAA,MAAA,CAAO,OAAO,2BAA6B,EAAA;AAAA,IACzC,MAAQ,EAAA,2BAAA;AAAA,IACR,OAAS,EAAA,IAAA;AAAA,IACT,gBAAA;AAAA,GACD,CAAA,CAAA;AAED,EAAO,OAAA,2BAAA,CAAA;AACT;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -31,22 +31,22 @@ interface UrlReaderService {
|
|
|
31
31
|
/**
|
|
32
32
|
* Reads a single file and return its content.
|
|
33
33
|
*/
|
|
34
|
-
readUrl(url: string, options?:
|
|
34
|
+
readUrl(url: string, options?: UrlReaderServiceReadUrlOptions): Promise<UrlReaderServiceReadUrlResponse>;
|
|
35
35
|
/**
|
|
36
36
|
* Reads a full or partial file tree.
|
|
37
37
|
*/
|
|
38
|
-
readTree(url: string, options?:
|
|
38
|
+
readTree(url: string, options?: UrlReaderServiceReadTreeOptions): Promise<UrlReaderServiceReadTreeResponse>;
|
|
39
39
|
/**
|
|
40
40
|
* Searches for a file in a tree using a glob pattern.
|
|
41
41
|
*/
|
|
42
|
-
search(url: string, options?:
|
|
42
|
+
search(url: string, options?: UrlReaderServiceSearchOptions): Promise<UrlReaderServiceSearchResponse>;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* An options object for readUrl operations.
|
|
46
46
|
*
|
|
47
47
|
* @public
|
|
48
48
|
*/
|
|
49
|
-
type
|
|
49
|
+
type UrlReaderServiceReadUrlOptions = {
|
|
50
50
|
/**
|
|
51
51
|
* An ETag which can be provided to check whether a
|
|
52
52
|
* {@link UrlReaderService.readUrl} response has changed from a previous execution.
|
|
@@ -110,7 +110,7 @@ type ReadUrlOptions = {
|
|
|
110
110
|
*
|
|
111
111
|
* @public
|
|
112
112
|
*/
|
|
113
|
-
type
|
|
113
|
+
type UrlReaderServiceReadUrlResponse = {
|
|
114
114
|
/**
|
|
115
115
|
* Returns the data that was read from the remote URL.
|
|
116
116
|
*/
|
|
@@ -141,7 +141,7 @@ type ReadUrlResponse = {
|
|
|
141
141
|
*
|
|
142
142
|
* @public
|
|
143
143
|
*/
|
|
144
|
-
type
|
|
144
|
+
type UrlReaderServiceReadTreeOptions = {
|
|
145
145
|
/**
|
|
146
146
|
* A filter that can be used to select which files should be included.
|
|
147
147
|
*
|
|
@@ -199,11 +199,11 @@ type ReadTreeOptions = {
|
|
|
199
199
|
token?: string;
|
|
200
200
|
};
|
|
201
201
|
/**
|
|
202
|
-
* Options that control {@link
|
|
202
|
+
* Options that control {@link UrlReaderServiceReadTreeResponse.dir} execution.
|
|
203
203
|
*
|
|
204
204
|
* @public
|
|
205
205
|
*/
|
|
206
|
-
type
|
|
206
|
+
type UrlReaderServiceReadTreeResponseDirOptions = {
|
|
207
207
|
/**
|
|
208
208
|
* The directory to write files to.
|
|
209
209
|
*
|
|
@@ -218,12 +218,12 @@ type ReadTreeResponseDirOptions = {
|
|
|
218
218
|
*
|
|
219
219
|
* @public
|
|
220
220
|
*/
|
|
221
|
-
type
|
|
221
|
+
type UrlReaderServiceReadTreeResponse = {
|
|
222
222
|
/**
|
|
223
223
|
* Returns an array of all the files inside the tree, and corresponding
|
|
224
224
|
* functions to read their content.
|
|
225
225
|
*/
|
|
226
|
-
files(): Promise<
|
|
226
|
+
files(): Promise<UrlReaderServiceReadTreeResponseFile[]>;
|
|
227
227
|
/**
|
|
228
228
|
* Returns the tree contents as a binary archive, using a stream.
|
|
229
229
|
*/
|
|
@@ -234,7 +234,7 @@ type ReadTreeResponse = {
|
|
|
234
234
|
*
|
|
235
235
|
* **NOTE**: It is the responsibility of the caller to remove the directory after use.
|
|
236
236
|
*/
|
|
237
|
-
dir(options?:
|
|
237
|
+
dir(options?: UrlReaderServiceReadTreeResponseDirOptions): Promise<string>;
|
|
238
238
|
/**
|
|
239
239
|
* Etag returned by content provider.
|
|
240
240
|
*
|
|
@@ -249,7 +249,7 @@ type ReadTreeResponse = {
|
|
|
249
249
|
*
|
|
250
250
|
* @public
|
|
251
251
|
*/
|
|
252
|
-
type
|
|
252
|
+
type UrlReaderServiceReadTreeResponseFile = {
|
|
253
253
|
/**
|
|
254
254
|
* The filepath of the data.
|
|
255
255
|
*/
|
|
@@ -268,7 +268,7 @@ type ReadTreeResponseFile = {
|
|
|
268
268
|
*
|
|
269
269
|
* @public
|
|
270
270
|
*/
|
|
271
|
-
type
|
|
271
|
+
type UrlReaderServiceSearchOptions = {
|
|
272
272
|
/**
|
|
273
273
|
* An etag can be provided to check whether the search response has changed from a previous execution.
|
|
274
274
|
*
|
|
@@ -306,11 +306,11 @@ type SearchOptions = {
|
|
|
306
306
|
*
|
|
307
307
|
* @public
|
|
308
308
|
*/
|
|
309
|
-
type
|
|
309
|
+
type UrlReaderServiceSearchResponse = {
|
|
310
310
|
/**
|
|
311
311
|
* The files that matched the search query.
|
|
312
312
|
*/
|
|
313
|
-
files:
|
|
313
|
+
files: UrlReaderServiceSearchResponseFile[];
|
|
314
314
|
/**
|
|
315
315
|
* A unique identifier of the current remote tree, usually the commit SHA or etag from the target.
|
|
316
316
|
*/
|
|
@@ -321,7 +321,7 @@ type SearchResponse = {
|
|
|
321
321
|
*
|
|
322
322
|
* @public
|
|
323
323
|
*/
|
|
324
|
-
type
|
|
324
|
+
type UrlReaderServiceSearchResponseFile = {
|
|
325
325
|
/**
|
|
326
326
|
* The full URL to the file.
|
|
327
327
|
*/
|
|
@@ -335,6 +335,51 @@ type SearchResponseFile = {
|
|
|
335
335
|
*/
|
|
336
336
|
lastModifiedAt?: Date;
|
|
337
337
|
};
|
|
338
|
+
/**
|
|
339
|
+
* @public
|
|
340
|
+
* @deprecated Use `UrlReaderServiceReadTreeOptions` instead
|
|
341
|
+
*/
|
|
342
|
+
type ReadTreeOptions = UrlReaderServiceReadTreeOptions;
|
|
343
|
+
/**
|
|
344
|
+
* @public
|
|
345
|
+
* @deprecated Use `UrlReaderServiceReadTreeResponse` instead
|
|
346
|
+
*/
|
|
347
|
+
type ReadTreeResponse = UrlReaderServiceReadTreeResponse;
|
|
348
|
+
/**
|
|
349
|
+
* @public
|
|
350
|
+
* @deprecated Use `UrlReaderServiceReadTreeResponseDirOptions` instead
|
|
351
|
+
*/
|
|
352
|
+
type ReadTreeResponseDirOptions = UrlReaderServiceReadTreeResponseDirOptions;
|
|
353
|
+
/**
|
|
354
|
+
* @public
|
|
355
|
+
* @deprecated Use `UrlReaderServiceReadTreeResponseFile` instead
|
|
356
|
+
*/
|
|
357
|
+
type ReadTreeResponseFile = UrlReaderServiceReadTreeResponseFile;
|
|
358
|
+
/**
|
|
359
|
+
* @public
|
|
360
|
+
* @deprecated Use `UrlReaderServiceReadUrlResponse` instead
|
|
361
|
+
*/
|
|
362
|
+
type ReadUrlResponse = UrlReaderServiceReadUrlResponse;
|
|
363
|
+
/**
|
|
364
|
+
* @public
|
|
365
|
+
* @deprecated Use `UrlReaderServiceReadUrlOptions` instead
|
|
366
|
+
*/
|
|
367
|
+
type ReadUrlOptions = UrlReaderServiceReadUrlOptions;
|
|
368
|
+
/**
|
|
369
|
+
* @public
|
|
370
|
+
* @deprecated Use `UrlReaderServiceSearchOptions` instead
|
|
371
|
+
*/
|
|
372
|
+
type SearchOptions = UrlReaderServiceSearchOptions;
|
|
373
|
+
/**
|
|
374
|
+
* @public
|
|
375
|
+
* @deprecated Use `UrlReaderServiceSearchResponse` instead
|
|
376
|
+
*/
|
|
377
|
+
type SearchResponse = UrlReaderServiceSearchResponse;
|
|
378
|
+
/**
|
|
379
|
+
* @public
|
|
380
|
+
* @deprecated Use `UrlReaderServiceSearchResponseFile` instead
|
|
381
|
+
*/
|
|
382
|
+
type SearchResponseFile = UrlReaderServiceSearchResponseFile;
|
|
338
383
|
|
|
339
384
|
/**
|
|
340
385
|
* This is the legacy service for creating and validating tokens. Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead.
|
|
@@ -1358,6 +1403,16 @@ interface UserInfoService {
|
|
|
1358
1403
|
interface BackendFeature {
|
|
1359
1404
|
$$type: '@backstage/BackendFeature';
|
|
1360
1405
|
}
|
|
1406
|
+
/**
|
|
1407
|
+
* @public
|
|
1408
|
+
* @deprecated This type exists only as a helper for old code that relied on `createBackendFeature` and `createBackendPlugin` to return `() => BackendFeature` instead of `BackendFeature`. You should remove the `()` parentheses at the end of your usages. This type will be removed in a future release.
|
|
1409
|
+
*/
|
|
1410
|
+
interface BackendFeatureCompat extends BackendFeature {
|
|
1411
|
+
/**
|
|
1412
|
+
* @deprecated You do not need to use this call signature; use the type directly instead by removing the `()` parentheses at the end. This call signature will be removed in a future release.
|
|
1413
|
+
*/
|
|
1414
|
+
(): this;
|
|
1415
|
+
}
|
|
1361
1416
|
|
|
1362
1417
|
/**
|
|
1363
1418
|
* TODO
|
|
@@ -1500,116 +1555,192 @@ declare function createServiceFactory<TService, TImpl extends TService, TDeps ex
|
|
|
1500
1555
|
*/
|
|
1501
1556
|
declare namespace coreServices {
|
|
1502
1557
|
/**
|
|
1503
|
-
*
|
|
1558
|
+
* Handles token authentication and credentials management.
|
|
1559
|
+
*
|
|
1560
|
+
* See {@link AuthService}
|
|
1561
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/auth | the service docs}
|
|
1562
|
+
* for more information.
|
|
1504
1563
|
*
|
|
1505
1564
|
* @public
|
|
1506
1565
|
*/
|
|
1507
1566
|
const auth: ServiceRef<AuthService, "plugin">;
|
|
1508
1567
|
/**
|
|
1509
|
-
*
|
|
1568
|
+
* Authenticated user information retrieval.
|
|
1569
|
+
*
|
|
1570
|
+
* See {@link UserInfoService}
|
|
1571
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/user-info | the service docs}
|
|
1572
|
+
* for more information.
|
|
1510
1573
|
*
|
|
1511
1574
|
* @public
|
|
1512
1575
|
*/
|
|
1513
1576
|
const userInfo: ServiceRef<UserInfoService, "plugin">;
|
|
1514
1577
|
/**
|
|
1515
|
-
*
|
|
1578
|
+
* Key-value store for caching data.
|
|
1579
|
+
*
|
|
1580
|
+
* See {@link CacheService}
|
|
1581
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/cache | the service docs}
|
|
1582
|
+
* for more information.
|
|
1516
1583
|
*
|
|
1517
1584
|
* @public
|
|
1518
1585
|
*/
|
|
1519
1586
|
const cache: ServiceRef<CacheService, "plugin">;
|
|
1520
1587
|
/**
|
|
1521
|
-
*
|
|
1588
|
+
* Access to static configuration.
|
|
1589
|
+
*
|
|
1590
|
+
* See {@link RootConfigService}
|
|
1591
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/root-config | the service docs}
|
|
1592
|
+
* for more information.
|
|
1522
1593
|
*
|
|
1523
1594
|
* @public
|
|
1524
1595
|
*/
|
|
1525
1596
|
const rootConfig: ServiceRef<RootConfigService, "root">;
|
|
1526
1597
|
/**
|
|
1527
|
-
*
|
|
1598
|
+
* Database access and management via `knex`.
|
|
1599
|
+
*
|
|
1600
|
+
* See {@link DatabaseService}
|
|
1601
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/database | the service docs}
|
|
1602
|
+
* for more information.
|
|
1528
1603
|
*
|
|
1529
1604
|
* @public
|
|
1530
1605
|
*/
|
|
1531
1606
|
const database: ServiceRef<DatabaseService, "plugin">;
|
|
1532
1607
|
/**
|
|
1533
|
-
*
|
|
1608
|
+
* Service discovery for inter-plugin communication.
|
|
1609
|
+
*
|
|
1610
|
+
* See {@link DiscoveryService}
|
|
1611
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/discovery | the service docs}
|
|
1612
|
+
* for more information.
|
|
1534
1613
|
*
|
|
1535
1614
|
* @public
|
|
1536
1615
|
*/
|
|
1537
1616
|
const discovery: ServiceRef<DiscoveryService, "plugin">;
|
|
1538
1617
|
/**
|
|
1539
|
-
*
|
|
1618
|
+
* Authentication of HTTP requests.
|
|
1619
|
+
*
|
|
1620
|
+
* See {@link HttpAuthService}
|
|
1621
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/http-auth | the service docs}
|
|
1622
|
+
* for more information.
|
|
1540
1623
|
*
|
|
1541
1624
|
* @public
|
|
1542
1625
|
*/
|
|
1543
1626
|
const httpAuth: ServiceRef<HttpAuthService, "plugin">;
|
|
1544
1627
|
/**
|
|
1545
|
-
*
|
|
1628
|
+
* HTTP route registration for plugins.
|
|
1629
|
+
*
|
|
1630
|
+
* See {@link HttpRouterService}
|
|
1631
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/http-router | the service docs}
|
|
1632
|
+
* for more information.
|
|
1546
1633
|
*
|
|
1547
1634
|
* @public
|
|
1548
1635
|
*/
|
|
1549
1636
|
const httpRouter: ServiceRef<HttpRouterService, "plugin">;
|
|
1550
1637
|
/**
|
|
1551
|
-
*
|
|
1638
|
+
* Registration of plugin startup and shutdown lifecycle hooks.
|
|
1639
|
+
*
|
|
1640
|
+
* See {@link LifecycleService}
|
|
1641
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/lifecycle | the service docs}
|
|
1642
|
+
* for more information.
|
|
1552
1643
|
*
|
|
1553
1644
|
* @public
|
|
1554
1645
|
*/
|
|
1555
1646
|
const lifecycle: ServiceRef<LifecycleService, "plugin">;
|
|
1556
1647
|
/**
|
|
1557
|
-
*
|
|
1648
|
+
* Plugin-level logging.
|
|
1649
|
+
*
|
|
1650
|
+
* See {@link LoggerService}
|
|
1651
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/logger | the service docs}
|
|
1652
|
+
* for more information.
|
|
1558
1653
|
*
|
|
1559
1654
|
* @public
|
|
1560
1655
|
*/
|
|
1561
1656
|
const logger: ServiceRef<LoggerService, "plugin">;
|
|
1562
1657
|
/**
|
|
1563
|
-
*
|
|
1658
|
+
* Permission system integration for authorization of user actions.
|
|
1659
|
+
*
|
|
1660
|
+
* See {@link PermissionsService}
|
|
1661
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/permissions | the service docs}
|
|
1662
|
+
* for more information.
|
|
1564
1663
|
*
|
|
1565
1664
|
* @public
|
|
1566
1665
|
*/
|
|
1567
1666
|
const permissions: ServiceRef<PermissionsService, "plugin">;
|
|
1568
1667
|
/**
|
|
1569
|
-
*
|
|
1668
|
+
* Built-in service for accessing metadata about the current plugin.
|
|
1669
|
+
*
|
|
1670
|
+
* See {@link PluginMetadataService}
|
|
1671
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/plugin-metadata | the service docs}
|
|
1672
|
+
* for more information.
|
|
1570
1673
|
*
|
|
1571
1674
|
* @public
|
|
1572
1675
|
*/
|
|
1573
1676
|
const pluginMetadata: ServiceRef<PluginMetadataService, "plugin">;
|
|
1574
1677
|
/**
|
|
1575
|
-
*
|
|
1678
|
+
* HTTP route registration for root services.
|
|
1679
|
+
*
|
|
1680
|
+
* See {@link RootHttpRouterService}
|
|
1681
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/root-http-router | the service docs}
|
|
1682
|
+
* for more information.
|
|
1576
1683
|
*
|
|
1577
1684
|
* @public
|
|
1578
1685
|
*/
|
|
1579
1686
|
const rootHttpRouter: ServiceRef<RootHttpRouterService, "root">;
|
|
1580
1687
|
/**
|
|
1581
|
-
*
|
|
1688
|
+
* Registration of backend startup and shutdown lifecycle hooks.
|
|
1689
|
+
*
|
|
1690
|
+
* See {@link RootLifecycleService}
|
|
1691
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/root-lifecycle | the service docs}
|
|
1692
|
+
* for more information.
|
|
1582
1693
|
*
|
|
1583
1694
|
* @public
|
|
1584
1695
|
*/
|
|
1585
1696
|
const rootLifecycle: ServiceRef<RootLifecycleService, "root">;
|
|
1586
1697
|
/**
|
|
1587
|
-
*
|
|
1698
|
+
* Root-level logging.
|
|
1699
|
+
*
|
|
1700
|
+
* See {@link RootLoggerService}
|
|
1701
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/root-logger | the service docs}
|
|
1702
|
+
* for more information.
|
|
1588
1703
|
*
|
|
1589
1704
|
* @public
|
|
1590
1705
|
*/
|
|
1591
1706
|
const rootLogger: ServiceRef<RootLoggerService, "root">;
|
|
1592
1707
|
/**
|
|
1593
|
-
*
|
|
1708
|
+
* Scheduling of distributed background tasks.
|
|
1709
|
+
*
|
|
1710
|
+
* See {@link SchedulerService}
|
|
1711
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/scheduler | the service docs}
|
|
1712
|
+
* for more information.
|
|
1594
1713
|
*
|
|
1595
1714
|
* @public
|
|
1596
1715
|
*/
|
|
1597
1716
|
const scheduler: ServiceRef<SchedulerService, "plugin">;
|
|
1598
1717
|
/**
|
|
1599
|
-
*
|
|
1718
|
+
* Deprecated service authentication service, use the `auth` service instead.
|
|
1719
|
+
*
|
|
1720
|
+
* See {@link TokenManagerService}
|
|
1721
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/token-manager | the service docs}
|
|
1722
|
+
* for more information.
|
|
1600
1723
|
*
|
|
1601
1724
|
* @public
|
|
1602
1725
|
* @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead
|
|
1603
1726
|
*/
|
|
1604
1727
|
const tokenManager: ServiceRef<TokenManagerService, "plugin">;
|
|
1605
1728
|
/**
|
|
1606
|
-
*
|
|
1729
|
+
* Reading content from external systems.
|
|
1730
|
+
*
|
|
1731
|
+
* See {@link UrlReaderService}
|
|
1732
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/url-reader | the service docs}
|
|
1733
|
+
* for more information.
|
|
1607
1734
|
*
|
|
1608
1735
|
* @public
|
|
1609
1736
|
*/
|
|
1610
1737
|
const urlReader: ServiceRef<UrlReaderService, "plugin">;
|
|
1611
1738
|
/**
|
|
1612
|
-
*
|
|
1739
|
+
* Deprecated user authentication service, use the `auth` service instead.
|
|
1740
|
+
*
|
|
1741
|
+
* See {@link IdentityService}
|
|
1742
|
+
* and {@link https://backstage.io/docs/backend-system/core-services/identity | the service docs}
|
|
1743
|
+
* for more information.
|
|
1613
1744
|
*
|
|
1614
1745
|
* @public
|
|
1615
1746
|
* @deprecated Please migrate to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead
|
|
@@ -1743,7 +1874,7 @@ interface CreateBackendPluginOptions {
|
|
|
1743
1874
|
* @see {@link https://backstage.io/docs/backend-system/architecture/plugins | The architecture of plugins}
|
|
1744
1875
|
* @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}
|
|
1745
1876
|
*/
|
|
1746
|
-
declare function createBackendPlugin(options: CreateBackendPluginOptions):
|
|
1877
|
+
declare function createBackendPlugin(options: CreateBackendPluginOptions): BackendFeatureCompat;
|
|
1747
1878
|
/**
|
|
1748
1879
|
* The configuration options passed to {@link createBackendModule}.
|
|
1749
1880
|
*
|
|
@@ -1771,7 +1902,7 @@ interface CreateBackendModuleOptions {
|
|
|
1771
1902
|
* @see {@link https://backstage.io/docs/backend-system/architecture/modules | The architecture of modules}
|
|
1772
1903
|
* @see {@link https://backstage.io/docs/backend-system/architecture/naming-patterns | Recommended naming patterns}
|
|
1773
1904
|
*/
|
|
1774
|
-
declare function createBackendModule(options: CreateBackendModuleOptions):
|
|
1905
|
+
declare function createBackendModule(options: CreateBackendModuleOptions): BackendFeatureCompat;
|
|
1775
1906
|
|
|
1776
1907
|
/**
|
|
1777
1908
|
* @public
|
|
@@ -1789,4 +1920,4 @@ type BackendModuleConfig = CreateBackendModuleOptions;
|
|
|
1789
1920
|
*/
|
|
1790
1921
|
type ExtensionPointConfig = CreateExtensionPointOptions;
|
|
1791
1922
|
|
|
1792
|
-
export { type AuthService, type BackendFeature, type BackendModuleConfig, type BackendModuleRegistrationPoints, type BackendPluginConfig, type BackendPluginRegistrationPoints, type BackstageCredentials, type BackstageNonePrincipal, type BackstagePrincipalAccessRestrictions, type BackstagePrincipalTypes, type BackstageServicePrincipal, type BackstageUserInfo, type BackstageUserPrincipal, type CacheService, type CacheServiceOptions, type CacheServiceSetOptions, type CreateBackendModuleOptions, type CreateBackendPluginOptions, type CreateExtensionPointOptions, type DatabaseService, type DiscoveryService, type ExtensionPoint, type ExtensionPointConfig, type HttpAuthService, type HttpRouterService, type HttpRouterServiceAuthPolicy, type IdentityService, type LifecycleService, type LifecycleServiceShutdownHook, type LifecycleServiceShutdownOptions, type LifecycleServiceStartupHook, type LifecycleServiceStartupOptions, type LoggerService, type PermissionsService, type PermissionsServiceRequestOptions, type PluginMetadataService, type PluginServiceFactoryConfig, type ReadTreeOptions, type ReadTreeResponse, type ReadTreeResponseDirOptions, type ReadTreeResponseFile, type ReadUrlOptions, type ReadUrlResponse, type RootConfigService, type RootHttpRouterService, type RootLifecycleService, type RootLoggerService, type RootServiceFactoryConfig, type SchedulerService, type SchedulerServiceTaskDescriptor, type SchedulerServiceTaskFunction, type SchedulerServiceTaskInvocationDefinition, type SchedulerServiceTaskRunner, type SchedulerServiceTaskScheduleDefinition, type SchedulerServiceTaskScheduleDefinitionConfig, type SearchOptions, type SearchResponse, type SearchResponseFile, type ServiceFactory, type ServiceFactoryOrFunction, type ServiceRef, type ServiceRefConfig, type TokenManagerService, type UrlReaderService, type UserInfoService, coreServices, createBackendModule, createBackendPlugin, createExtensionPoint, createServiceFactory, createServiceRef, isDatabaseConflictError, readSchedulerServiceTaskScheduleDefinitionFromConfig, resolvePackagePath, resolveSafeChildPath };
|
|
1923
|
+
export { type AuthService, type BackendFeature, type BackendFeatureCompat, type BackendModuleConfig, type BackendModuleRegistrationPoints, type BackendPluginConfig, type BackendPluginRegistrationPoints, type BackstageCredentials, type BackstageNonePrincipal, type BackstagePrincipalAccessRestrictions, type BackstagePrincipalTypes, type BackstageServicePrincipal, type BackstageUserInfo, type BackstageUserPrincipal, type CacheService, type CacheServiceOptions, type CacheServiceSetOptions, type CreateBackendModuleOptions, type CreateBackendPluginOptions, type CreateExtensionPointOptions, type DatabaseService, type DiscoveryService, type ExtensionPoint, type ExtensionPointConfig, type HttpAuthService, type HttpRouterService, type HttpRouterServiceAuthPolicy, type IdentityService, type LifecycleService, type LifecycleServiceShutdownHook, type LifecycleServiceShutdownOptions, type LifecycleServiceStartupHook, type LifecycleServiceStartupOptions, type LoggerService, type PermissionsService, type PermissionsServiceRequestOptions, type PluginMetadataService, type PluginServiceFactoryConfig, type ReadTreeOptions, type ReadTreeResponse, type ReadTreeResponseDirOptions, type ReadTreeResponseFile, type ReadUrlOptions, type ReadUrlResponse, type RootConfigService, type RootHttpRouterService, type RootLifecycleService, type RootLoggerService, type RootServiceFactoryConfig, type SchedulerService, type SchedulerServiceTaskDescriptor, type SchedulerServiceTaskFunction, type SchedulerServiceTaskInvocationDefinition, type SchedulerServiceTaskRunner, type SchedulerServiceTaskScheduleDefinition, type SchedulerServiceTaskScheduleDefinitionConfig, type SearchOptions, type SearchResponse, type SearchResponseFile, type ServiceFactory, type ServiceFactoryOrFunction, type ServiceRef, type ServiceRefConfig, type TokenManagerService, type UrlReaderService, type UrlReaderServiceReadTreeOptions, type UrlReaderServiceReadTreeResponse, type UrlReaderServiceReadTreeResponseDirOptions, type UrlReaderServiceReadTreeResponseFile, type UrlReaderServiceReadUrlOptions, type UrlReaderServiceReadUrlResponse, type UrlReaderServiceSearchOptions, type UrlReaderServiceSearchResponse, type UrlReaderServiceSearchResponseFile, type UserInfoService, coreServices, createBackendModule, createBackendPlugin, createExtensionPoint, createServiceFactory, createServiceRef, isDatabaseConflictError, readSchedulerServiceTaskScheduleDefinitionFromConfig, resolvePackagePath, resolveSafeChildPath };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/backend-plugin-api",
|
|
3
|
-
"version": "0.6.19
|
|
3
|
+
"version": "0.6.19",
|
|
4
4
|
"description": "Core API used by Backstage backend plugins",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "node-library"
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"test": "backstage-cli package test"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@backstage/cli-common": "^0.1.
|
|
56
|
+
"@backstage/cli-common": "^0.1.14",
|
|
57
57
|
"@backstage/config": "^1.2.0",
|
|
58
58
|
"@backstage/errors": "^1.2.4",
|
|
59
|
-
"@backstage/plugin-auth-node": "^0.4.14
|
|
60
|
-
"@backstage/plugin-permission-common": "^0.7.
|
|
59
|
+
"@backstage/plugin-auth-node": "^0.4.14",
|
|
60
|
+
"@backstage/plugin-permission-common": "^0.7.14",
|
|
61
61
|
"@backstage/types": "^1.1.1",
|
|
62
62
|
"@types/express": "^4.17.6",
|
|
63
63
|
"@types/luxon": "^3.0.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"luxon": "^3.0.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@backstage/backend-test-utils": "^0.4.0
|
|
70
|
-
"@backstage/cli": "^0.26.7
|
|
69
|
+
"@backstage/backend-test-utils": "^0.4.0",
|
|
70
|
+
"@backstage/cli": "^0.26.7"
|
|
71
71
|
}
|
|
72
72
|
}
|