@backstage/backend-plugin-api 1.7.0-next.0 → 1.7.0-next.1
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 +8 -0
- package/dist/wiring/constants.cjs.js +8 -0
- package/dist/wiring/constants.cjs.js.map +1 -0
- package/dist/wiring/createBackendModule.cjs.js +12 -0
- package/dist/wiring/createBackendModule.cjs.js.map +1 -1
- package/dist/wiring/createBackendPlugin.cjs.js +12 -0
- package/dist/wiring/createBackendPlugin.cjs.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @backstage/backend-plugin-api
|
|
2
2
|
|
|
3
|
+
## 1.7.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- bb9b471: Plugin IDs that do not match the standard format are deprecated (letters, digits, and dashes only, starting with a letter). Plugin IDs that do no match this format will be rejected in a future release.
|
|
8
|
+
|
|
9
|
+
In addition, plugin IDs that don't match the legacy pattern that also allows underscores, with be rejected.
|
|
10
|
+
|
|
3
11
|
## 1.7.0-next.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs.js","sources":["../../src/wiring/constants.ts"],"sourcesContent":["/*\n * Copyright 2025 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// NOTE: changing any of these constants need to be reflected in\n// @backstage/frontend-plugin-api/src/wiring/constants.ts as well\n\n/**\n * The pattern that IDs must match.\n *\n * @remarks\n * ids must only contain the letters `a` through `z` and digits, in groups separated by\n * dashes. Additionally, the very first character of the first group\n * must be a letter, not a digit\n *\n * @public\n */\nexport const ID_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/i;\nexport const ID_PATTERN_OLD = /^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$/i;\n"],"names":[],"mappings":";;AA6BO,MAAM,UAAA,GAAa;AACnB,MAAM,cAAA,GAAiB;;;;;"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var constants = require('./constants.cjs.js');
|
|
4
|
+
|
|
3
5
|
function createBackendModule(options) {
|
|
6
|
+
if (!constants.ID_PATTERN.test(options.moduleId)) {
|
|
7
|
+
console.warn(
|
|
8
|
+
`WARNING: The moduleId '${options.moduleId}' for plugin '${options.pluginId}', will be invalid soon, please change it to match the pattern ${constants.ID_PATTERN} (letters, digits, and dashes only, starting with a letter)`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
if (!constants.ID_PATTERN_OLD.test(options.moduleId)) {
|
|
12
|
+
throw new Error(
|
|
13
|
+
`Invalid moduleId '${options.moduleId}' for plugin '${options.pluginId}', must match the pattern ${constants.ID_PATTERN} (letters, digits, and dashes only, starting with a letter)`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
4
16
|
function getRegistrations() {
|
|
5
17
|
const extensionPoints = [];
|
|
6
18
|
let init = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBackendModule.cjs.js","sources":["../../src/wiring/createBackendModule.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';\nimport {\n BackendModuleRegistrationPoints,\n ExtensionPoint,\n ExtensionPointFactoryContext,\n InternalBackendModuleRegistrationV1_1,\n InternalBackendRegistrations,\n} from './types';\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 function getRegistrations() {\n const extensionPoints: InternalBackendModuleRegistrationV1_1['extensionPoints'] =\n [];\n let init: InternalBackendModuleRegistrationV1_1['init'] | undefined =\n undefined;\n\n options.register({\n registerExtensionPoint<TExtensionPoint>(\n extOrOpts:\n | ExtensionPoint<TExtensionPoint>\n | {\n extensionPoint: ExtensionPoint<TExtensionPoint>;\n factory: (\n context: ExtensionPointFactoryContext,\n ) => TExtensionPoint;\n },\n impl?: TExtensionPoint,\n ) {\n if (init) {\n throw new Error('registerExtensionPoint called after registerInit');\n }\n if (\n typeof extOrOpts === 'object' &&\n extOrOpts !== null &&\n 'extensionPoint' in extOrOpts\n ) {\n extensionPoints.push({\n extensionPoint: extOrOpts.extensionPoint,\n factory: extOrOpts.factory as (\n context: ExtensionPointFactoryContext,\n ) => unknown,\n });\n } else {\n extensionPoints.push({\n extensionPoint: extOrOpts,\n factory: () => impl,\n });\n }\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-v1.1',\n pluginId: options.pluginId,\n moduleId: options.moduleId,\n extensionPoints,\n init,\n },\n ];\n }\n\n return {\n $$type: '@backstage/BackendFeature' as const,\n featureType: 'registrations',\n version: 'v1',\n getRegistrations,\n } as InternalBackendRegistrations;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createBackendModule.cjs.js","sources":["../../src/wiring/createBackendModule.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';\nimport { ID_PATTERN, ID_PATTERN_OLD } from './constants';\nimport {\n BackendModuleRegistrationPoints,\n ExtensionPoint,\n ExtensionPointFactoryContext,\n InternalBackendModuleRegistrationV1_1,\n InternalBackendRegistrations,\n} from './types';\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 if (!ID_PATTERN.test(options.moduleId)) {\n console.warn(\n `WARNING: The moduleId '${options.moduleId}' for plugin '${options.pluginId}', will be invalid soon, please change it to match the pattern ${ID_PATTERN} (letters, digits, and dashes only, starting with a letter)`,\n );\n }\n if (!ID_PATTERN_OLD.test(options.moduleId)) {\n throw new Error(\n `Invalid moduleId '${options.moduleId}' for plugin '${options.pluginId}', must match the pattern ${ID_PATTERN} (letters, digits, and dashes only, starting with a letter)`,\n );\n }\n\n function getRegistrations() {\n const extensionPoints: InternalBackendModuleRegistrationV1_1['extensionPoints'] =\n [];\n let init: InternalBackendModuleRegistrationV1_1['init'] | undefined =\n undefined;\n\n options.register({\n registerExtensionPoint<TExtensionPoint>(\n extOrOpts:\n | ExtensionPoint<TExtensionPoint>\n | {\n extensionPoint: ExtensionPoint<TExtensionPoint>;\n factory: (\n context: ExtensionPointFactoryContext,\n ) => TExtensionPoint;\n },\n impl?: TExtensionPoint,\n ) {\n if (init) {\n throw new Error('registerExtensionPoint called after registerInit');\n }\n if (\n typeof extOrOpts === 'object' &&\n extOrOpts !== null &&\n 'extensionPoint' in extOrOpts\n ) {\n extensionPoints.push({\n extensionPoint: extOrOpts.extensionPoint,\n factory: extOrOpts.factory as (\n context: ExtensionPointFactoryContext,\n ) => unknown,\n });\n } else {\n extensionPoints.push({\n extensionPoint: extOrOpts,\n factory: () => impl,\n });\n }\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-v1.1',\n pluginId: options.pluginId,\n moduleId: options.moduleId,\n extensionPoints,\n init,\n },\n ];\n }\n\n return {\n $$type: '@backstage/BackendFeature' as const,\n featureType: 'registrations',\n version: 'v1',\n getRegistrations,\n } as InternalBackendRegistrations;\n}\n"],"names":["ID_PATTERN","ID_PATTERN_OLD"],"mappings":";;;;AAuDO,SAAS,oBACd,OAAA,EACgB;AAChB,EAAA,IAAI,CAACA,oBAAA,CAAW,IAAA,CAAK,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACtC,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,0BAA0B,OAAA,CAAQ,QAAQ,iBAAiB,OAAA,CAAQ,QAAQ,kEAAkEA,oBAAU,CAAA,2DAAA;AAAA,KACzJ;AAAA,EACF;AACA,EAAA,IAAI,CAACC,wBAAA,CAAe,IAAA,CAAK,OAAA,CAAQ,QAAQ,CAAA,EAAG;AAC1C,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,qBAAqB,OAAA,CAAQ,QAAQ,iBAAiB,OAAA,CAAQ,QAAQ,6BAA6BD,oBAAU,CAAA,2DAAA;AAAA,KAC/G;AAAA,EACF;AAEA,EAAA,SAAS,gBAAA,GAAmB;AAC1B,IAAA,MAAM,kBACJ,EAAC;AACH,IAAA,IAAI,IAAA,GACF,MAAA;AAEF,IAAA,OAAA,CAAQ,QAAA,CAAS;AAAA,MACf,sBAAA,CACE,WAQA,IAAA,EACA;AACA,QAAA,IAAI,IAAA,EAAM;AACR,UAAA,MAAM,IAAI,MAAM,kDAAkD,CAAA;AAAA,QACpE;AACA,QAAA,IACE,OAAO,SAAA,KAAc,QAAA,IACrB,SAAA,KAAc,IAAA,IACd,oBAAoB,SAAA,EACpB;AACA,UAAA,eAAA,CAAgB,IAAA,CAAK;AAAA,YACnB,gBAAgB,SAAA,CAAU,cAAA;AAAA,YAC1B,SAAS,SAAA,CAAU;AAAA,WAGpB,CAAA;AAAA,QACH,CAAA,MAAO;AACL,UAAA,eAAA,CAAgB,IAAA,CAAK;AAAA,YACnB,cAAA,EAAgB,SAAA;AAAA,YAChB,SAAS,MAAM;AAAA,WAChB,CAAA;AAAA,QACH;AAAA,MACF,CAAA;AAAA,MACA,aAAa,OAAA,EAAS;AACpB,QAAA,IAAI,IAAA,EAAM;AACR,UAAA,MAAM,IAAI,MAAM,uCAAuC,CAAA;AAAA,QACzD;AACA,QAAA,IAAA,GAAO;AAAA,UACL,MAAM,OAAA,CAAQ,IAAA;AAAA,UACd,MAAM,OAAA,CAAQ;AAAA,SAChB;AAAA,MACF;AAAA,KACD,CAAA;AAED,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,CAAA,2CAAA,EAA8C,OAAA,CAAQ,QAAQ,CAAA,YAAA,EAAe,QAAQ,QAAQ,CAAA;AAAA,OAC/F;AAAA,IACF;AAEA,IAAA,OAAO;AAAA,MACL;AAAA,QACE,IAAA,EAAM,aAAA;AAAA,QACN,UAAU,OAAA,CAAQ,QAAA;AAAA,QAClB,UAAU,OAAA,CAAQ,QAAA;AAAA,QAClB,eAAA;AAAA,QACA;AAAA;AACF,KACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,MAAA,EAAQ,2BAAA;AAAA,IACR,WAAA,EAAa,eAAA;AAAA,IACb,OAAA,EAAS,IAAA;AAAA,IACT;AAAA,GACF;AACF;;;;"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var constants = require('./constants.cjs.js');
|
|
4
|
+
|
|
3
5
|
function createBackendPlugin(options) {
|
|
6
|
+
if (!constants.ID_PATTERN.test(options.pluginId)) {
|
|
7
|
+
console.warn(
|
|
8
|
+
`WARNING: The pluginId '${options.pluginId}' will be invalid soon, please change it to match the pattern ${constants.ID_PATTERN} (letters, digits, and dashes only, starting with a letter)`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
if (!constants.ID_PATTERN_OLD.test(options.pluginId)) {
|
|
12
|
+
throw new Error(
|
|
13
|
+
`Invalid pluginId '${options.pluginId}', must match the pattern ${constants.ID_PATTERN} (letters, digits, and dashes only, starting with a letter)`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
4
16
|
function getRegistrations() {
|
|
5
17
|
const extensionPoints = [];
|
|
6
18
|
let init = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBackendPlugin.cjs.js","sources":["../../src/wiring/createBackendPlugin.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';\nimport {\n BackendPluginRegistrationPoints,\n ExtensionPoint,\n ExtensionPointFactoryContext,\n InternalBackendPluginRegistrationV1_1,\n InternalBackendRegistrations,\n} from './types';\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 function getRegistrations() {\n const extensionPoints: InternalBackendPluginRegistrationV1_1['extensionPoints'] =\n [];\n let init: InternalBackendPluginRegistrationV1_1['init'] | undefined =\n undefined;\n\n options.register({\n registerExtensionPoint<TExtensionPoint>(\n extOrOpts:\n | ExtensionPoint<TExtensionPoint>\n | {\n extensionPoint: ExtensionPoint<TExtensionPoint>;\n factory: (\n context: ExtensionPointFactoryContext,\n ) => TExtensionPoint;\n },\n impl?: TExtensionPoint,\n ) {\n if (init) {\n throw new Error('registerExtensionPoint called after registerInit');\n }\n if (\n typeof extOrOpts === 'object' &&\n extOrOpts !== null &&\n 'extensionPoint' in extOrOpts\n ) {\n extensionPoints.push({\n extensionPoint: extOrOpts.extensionPoint,\n factory: extOrOpts.factory as (\n context: ExtensionPointFactoryContext,\n ) => unknown,\n });\n } else {\n extensionPoints.push({\n extensionPoint: extOrOpts,\n factory: () => impl,\n });\n }\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-v1.1',\n pluginId: options.pluginId,\n extensionPoints,\n init,\n },\n ];\n }\n\n return {\n $$type: '@backstage/BackendFeature' as const,\n version: 'v1',\n featureType: 'registrations',\n getRegistrations,\n } as InternalBackendRegistrations;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createBackendPlugin.cjs.js","sources":["../../src/wiring/createBackendPlugin.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';\nimport {\n BackendPluginRegistrationPoints,\n ExtensionPoint,\n ExtensionPointFactoryContext,\n InternalBackendPluginRegistrationV1_1,\n InternalBackendRegistrations,\n} from './types';\nimport { ID_PATTERN, ID_PATTERN_OLD } from './constants';\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 if (!ID_PATTERN.test(options.pluginId)) {\n console.warn(\n `WARNING: The pluginId '${options.pluginId}' will be invalid soon, please change it to match the pattern ${ID_PATTERN} (letters, digits, and dashes only, starting with a letter)`,\n );\n }\n if (!ID_PATTERN_OLD.test(options.pluginId)) {\n throw new Error(\n `Invalid pluginId '${options.pluginId}', must match the pattern ${ID_PATTERN} (letters, digits, and dashes only, starting with a letter)`,\n );\n }\n\n function getRegistrations() {\n const extensionPoints: InternalBackendPluginRegistrationV1_1['extensionPoints'] =\n [];\n let init: InternalBackendPluginRegistrationV1_1['init'] | undefined =\n undefined;\n\n options.register({\n registerExtensionPoint<TExtensionPoint>(\n extOrOpts:\n | ExtensionPoint<TExtensionPoint>\n | {\n extensionPoint: ExtensionPoint<TExtensionPoint>;\n factory: (\n context: ExtensionPointFactoryContext,\n ) => TExtensionPoint;\n },\n impl?: TExtensionPoint,\n ) {\n if (init) {\n throw new Error('registerExtensionPoint called after registerInit');\n }\n if (\n typeof extOrOpts === 'object' &&\n extOrOpts !== null &&\n 'extensionPoint' in extOrOpts\n ) {\n extensionPoints.push({\n extensionPoint: extOrOpts.extensionPoint,\n factory: extOrOpts.factory as (\n context: ExtensionPointFactoryContext,\n ) => unknown,\n });\n } else {\n extensionPoints.push({\n extensionPoint: extOrOpts,\n factory: () => impl,\n });\n }\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-v1.1',\n pluginId: options.pluginId,\n extensionPoints,\n init,\n },\n ];\n }\n\n return {\n $$type: '@backstage/BackendFeature' as const,\n version: 'v1',\n featureType: 'registrations',\n getRegistrations,\n } as InternalBackendRegistrations;\n}\n"],"names":["ID_PATTERN","ID_PATTERN_OLD"],"mappings":";;;;AAkDO,SAAS,oBACd,OAAA,EACgB;AAChB,EAAA,IAAI,CAACA,oBAAA,CAAW,IAAA,CAAK,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACtC,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,uBAAA,EAA0B,OAAA,CAAQ,QAAQ,CAAA,8DAAA,EAAiEA,oBAAU,CAAA,2DAAA;AAAA,KACvH;AAAA,EACF;AACA,EAAA,IAAI,CAACC,wBAAA,CAAe,IAAA,CAAK,OAAA,CAAQ,QAAQ,CAAA,EAAG;AAC1C,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,kBAAA,EAAqB,OAAA,CAAQ,QAAQ,CAAA,0BAAA,EAA6BD,oBAAU,CAAA,2DAAA;AAAA,KAC9E;AAAA,EACF;AAEA,EAAA,SAAS,gBAAA,GAAmB;AAC1B,IAAA,MAAM,kBACJ,EAAC;AACH,IAAA,IAAI,IAAA,GACF,MAAA;AAEF,IAAA,OAAA,CAAQ,QAAA,CAAS;AAAA,MACf,sBAAA,CACE,WAQA,IAAA,EACA;AACA,QAAA,IAAI,IAAA,EAAM;AACR,UAAA,MAAM,IAAI,MAAM,kDAAkD,CAAA;AAAA,QACpE;AACA,QAAA,IACE,OAAO,SAAA,KAAc,QAAA,IACrB,SAAA,KAAc,IAAA,IACd,oBAAoB,SAAA,EACpB;AACA,UAAA,eAAA,CAAgB,IAAA,CAAK;AAAA,YACnB,gBAAgB,SAAA,CAAU,cAAA;AAAA,YAC1B,SAAS,SAAA,CAAU;AAAA,WAGpB,CAAA;AAAA,QACH,CAAA,MAAO;AACL,UAAA,eAAA,CAAgB,IAAA,CAAK;AAAA,YACnB,cAAA,EAAgB,SAAA;AAAA,YAChB,SAAS,MAAM;AAAA,WAChB,CAAA;AAAA,QACH;AAAA,MACF,CAAA;AAAA,MACA,aAAa,OAAA,EAAS;AACpB,QAAA,IAAI,IAAA,EAAM;AACR,UAAA,MAAM,IAAI,MAAM,uCAAuC,CAAA;AAAA,QACzD;AACA,QAAA,IAAA,GAAO;AAAA,UACL,MAAM,OAAA,CAAQ,IAAA;AAAA,UACd,MAAM,OAAA,CAAQ;AAAA,SAChB;AAAA,MACF;AAAA,KACD,CAAA;AAED,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,CAAA,2CAAA,EAA8C,QAAQ,QAAQ,CAAA;AAAA,OAChE;AAAA,IACF;AAEA,IAAA,OAAO;AAAA,MACL;AAAA,QACE,IAAA,EAAM,aAAA;AAAA,QACN,UAAU,OAAA,CAAQ,QAAA;AAAA,QAClB,eAAA;AAAA,QACA;AAAA;AACF,KACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,MAAA,EAAQ,2BAAA;AAAA,IACR,OAAA,EAAS,IAAA;AAAA,IACT,WAAA,EAAa,eAAA;AAAA,IACb;AAAA,GACF;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/backend-plugin-api",
|
|
3
|
-
"version": "1.7.0-next.
|
|
3
|
+
"version": "1.7.0-next.1",
|
|
4
4
|
"description": "Core API used by Backstage backend plugins",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "node-library"
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"@backstage/cli-common": "0.1.18-next.0",
|
|
69
69
|
"@backstage/config": "1.3.6",
|
|
70
70
|
"@backstage/errors": "1.2.7",
|
|
71
|
-
"@backstage/plugin-auth-node": "0.6.
|
|
72
|
-
"@backstage/plugin-permission-common": "0.9.
|
|
73
|
-
"@backstage/plugin-permission-node": "0.10.
|
|
71
|
+
"@backstage/plugin-auth-node": "0.6.13-next.0",
|
|
72
|
+
"@backstage/plugin-permission-common": "0.9.6-next.0",
|
|
73
|
+
"@backstage/plugin-permission-node": "0.10.10-next.0",
|
|
74
74
|
"@backstage/types": "1.2.2",
|
|
75
75
|
"@types/express": "^4.17.6",
|
|
76
76
|
"@types/json-schema": "^7.0.6",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"zod": "^3.25.76"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@backstage/backend-test-utils": "1.10.
|
|
85
|
-
"@backstage/cli": "0.35.
|
|
84
|
+
"@backstage/backend-test-utils": "1.10.5-next.0",
|
|
85
|
+
"@backstage/cli": "0.35.4-next.1"
|
|
86
86
|
},
|
|
87
87
|
"configSchema": "config.d.ts"
|
|
88
88
|
}
|